88
99import { Agent } from ' http' ;
1010
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+
1126// @public
1227export interface ExplicitParameterValue {
1328 value: string ;
@@ -18,11 +33,21 @@ export interface ExplicitParameterValue {
1833// @public
1934export function getRemoteConfig(app ? : App ): RemoteConfig ;
2035
36+ // @public
37+ export interface GetServerTemplateOptions {
38+ defaultConfig? : DefaultConfig ;
39+ }
40+
2141// @public
2242export interface InAppDefaultValue {
2343 useInAppDefault: boolean ;
2444}
2545
46+ // @public
47+ export interface InitServerTemplateOptions extends GetServerTemplateOptions {
48+ template? : ServerTemplateDataType ;
49+ }
50+
2651// @public
2752export interface ListVersionsOptions {
2853 endTime? : Date | string ;
@@ -38,16 +63,60 @@ export interface ListVersionsResult {
3863 versions: Version [];
3964}
4065
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+
4192// @public
4293export type ParameterValueType = ' STRING' | ' BOOLEAN' | ' NUMBER' | ' JSON' ;
4394
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+
44111// @public
45112export class RemoteConfig {
46113 // (undocumented)
47114 readonly app: App ;
48115 createTemplateFromJSON(json : string ): RemoteConfigTemplate ;
116+ getServerTemplate(options ? : GetServerTemplateOptions ): Promise <ServerTemplate >;
49117 getTemplate(): Promise <RemoteConfigTemplate >;
50118 getTemplateAtVersion(versionNumber : number | string ): Promise <RemoteConfigTemplate >;
119+ initServerTemplate(options ? : InitServerTemplateOptions ): ServerTemplate ;
51120 listVersions(options ? : ListVersionsOptions ): Promise <ListVersionsResult >;
52121 publishTemplate(template : RemoteConfigTemplate , options ? : {
53122 force: boolean ;
@@ -104,9 +173,49 @@ export interface RemoteConfigUser {
104173 name? : string ;
105174}
106175
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+
107205// @public
108206export type TagColor = ' BLUE' | ' BROWN' | ' CYAN' | ' DEEP_ORANGE' | ' GREEN' | ' INDIGO' | ' LIME' | ' ORANGE' | ' PINK' | ' PURPLE' | ' TEAL' ;
109207
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+
110219// @public
111220export interface Version {
112221 description? : string ;
0 commit comments