8
8
9
9
import { Agent } from ' http' ;
10
10
11
+ // @public
12
+ export interface AndCondition {
13
+ conditions? : Array <OneOfCondition >;
14
+ }
15
+
16
+ // @public
17
+ export type DefaultConfig = {
18
+ [key : string ]: string | number | boolean ;
19
+ };
20
+
21
+ // @public
22
+ export type EvaluationContext = {
23
+ randomizationId? : string ;
24
+ };
25
+
11
26
// @public
12
27
export interface ExplicitParameterValue {
13
28
value: string ;
@@ -18,11 +33,21 @@ export interface ExplicitParameterValue {
18
33
// @public
19
34
export function getRemoteConfig(app ? : App ): RemoteConfig ;
20
35
36
+ // @public
37
+ export interface GetServerTemplateOptions {
38
+ defaultConfig? : DefaultConfig ;
39
+ }
40
+
21
41
// @public
22
42
export interface InAppDefaultValue {
23
43
useInAppDefault: boolean ;
24
44
}
25
45
46
+ // @public
47
+ export interface InitServerTemplateOptions extends GetServerTemplateOptions {
48
+ template? : ServerTemplateDataType ;
49
+ }
50
+
26
51
// @public
27
52
export interface ListVersionsOptions {
28
53
endTime? : Date | string ;
@@ -38,16 +63,60 @@ export interface ListVersionsResult {
38
63
versions: Version [];
39
64
}
40
65
66
+ // @public
67
+ export interface MicroPercentRange {
68
+ microPercentLowerBound? : number ;
69
+ microPercentUpperBound? : number ;
70
+ }
71
+
72
+ // @public
73
+ export interface NamedCondition {
74
+ condition: OneOfCondition ;
75
+ name: string ;
76
+ }
77
+
78
+ // @public
79
+ export interface OneOfCondition {
80
+ andCondition? : AndCondition ;
81
+ false? : Record <string , never >;
82
+ orCondition? : OrCondition ;
83
+ percent? : PercentCondition ;
84
+ true? : Record <string , never >;
85
+ }
86
+
87
+ // @public
88
+ export interface OrCondition {
89
+ conditions? : Array <OneOfCondition >;
90
+ }
91
+
41
92
// @public
42
93
export type ParameterValueType = ' STRING' | ' BOOLEAN' | ' NUMBER' | ' JSON' ;
43
94
95
+ // @public
96
+ export interface PercentCondition {
97
+ microPercent? : number ;
98
+ microPercentRange? : MicroPercentRange ;
99
+ percentOperator? : PercentConditionOperator ;
100
+ seed? : string ;
101
+ }
102
+
103
+ // @public
104
+ export enum PercentConditionOperator {
105
+ BETWEEN = " BETWEEN" ,
106
+ GREATER_THAN = " GREATER_THAN" ,
107
+ LESS_OR_EQUAL = " LESS_OR_EQUAL" ,
108
+ UNKNOWN = " UNKNOWN"
109
+ }
110
+
44
111
// @public
45
112
export class RemoteConfig {
46
113
// (undocumented)
47
114
readonly app: App ;
48
115
createTemplateFromJSON(json : string ): RemoteConfigTemplate ;
116
+ getServerTemplate(options ? : GetServerTemplateOptions ): Promise <ServerTemplate >;
49
117
getTemplate(): Promise <RemoteConfigTemplate >;
50
118
getTemplateAtVersion(versionNumber : number | string ): Promise <RemoteConfigTemplate >;
119
+ initServerTemplate(options ? : InitServerTemplateOptions ): ServerTemplate ;
51
120
listVersions(options ? : ListVersionsOptions ): Promise <ListVersionsResult >;
52
121
publishTemplate(template : RemoteConfigTemplate , options ? : {
53
122
force: boolean ;
@@ -104,9 +173,49 @@ export interface RemoteConfigUser {
104
173
name? : string ;
105
174
}
106
175
176
+ // @public
177
+ export interface ServerConfig {
178
+ getBoolean(key : string ): boolean ;
179
+ getNumber(key : string ): number ;
180
+ getString(key : string ): string ;
181
+ getValue(key : string ): Value ;
182
+ }
183
+
184
+ // @public
185
+ export interface ServerTemplate {
186
+ evaluate(context ? : EvaluationContext ): ServerConfig ;
187
+ load(): Promise <void >;
188
+ set(template : ServerTemplateDataType ): void ;
189
+ toJSON(): ServerTemplateData ;
190
+ }
191
+
192
+ // @public
193
+ export interface ServerTemplateData {
194
+ conditions: NamedCondition [];
195
+ readonly etag: string ;
196
+ parameters: {
197
+ [key : string ]: RemoteConfigParameter ;
198
+ };
199
+ version? : Version ;
200
+ }
201
+
202
+ // @public
203
+ export type ServerTemplateDataType = ServerTemplateData | string ;
204
+
107
205
// @public
108
206
export type TagColor = ' BLUE' | ' BROWN' | ' CYAN' | ' DEEP_ORANGE' | ' GREEN' | ' INDIGO' | ' LIME' | ' ORANGE' | ' PINK' | ' PURPLE' | ' TEAL' ;
109
207
208
+ // @public
209
+ export interface Value {
210
+ asBoolean(): boolean ;
211
+ asNumber(): number ;
212
+ asString(): string ;
213
+ getSource(): ValueSource ;
214
+ }
215
+
216
+ // @public
217
+ export type ValueSource = ' static' | ' default' | ' remote' ;
218
+
110
219
// @public
111
220
export interface Version {
112
221
description? : string ;
0 commit comments