@@ -54,6 +54,27 @@ export interface RemoteConfigCondition {
5454 tagColor ?: TagColor ;
5555}
5656
57+ /**
58+ * Interface representing a Remote Config condition in the data-plane.
59+ * A condition targets a specific group of users. A list of these conditions make up
60+ * part of a Remote Config template.
61+ */
62+ export interface RemoteConfigServerCondition {
63+
64+ /**
65+ * A non-empty and unique name of this condition.
66+ */
67+ name : string ;
68+
69+ /**
70+ * The logic of this condition.
71+ * See the documentation on
72+ * {@link https://firebase.google.com/docs/remote-config/condition-reference | condition expressions}
73+ * for the expected syntax of this field.
74+ */
75+ expression : string ;
76+ }
77+
5778/**
5879 * Interface representing an explicit parameter value.
5980 */
@@ -135,7 +156,7 @@ export interface RemoteConfigParameterGroup {
135156}
136157
137158/**
138- * Interface representing a Remote Config template.
159+ * Interface representing a Remote Config client template.
139160 */
140161export interface RemoteConfigTemplate {
141162 /**
@@ -167,6 +188,58 @@ export interface RemoteConfigTemplate {
167188 version ?: Version ;
168189}
169190
191+ /**
192+ * Interface representing the data in a Remote Config server template.
193+ */
194+ export interface RemoteConfigServerTemplateData {
195+ /**
196+ * A list of conditions in descending order by priority.
197+ */
198+ conditions : RemoteConfigServerCondition [ ] ;
199+
200+ /**
201+ * Map of parameter keys to their optional default values and optional conditional values.
202+ */
203+ parameters : { [ key : string ] : RemoteConfigParameter } ;
204+
205+ /**
206+ * ETag of the current Remote Config template (readonly).
207+ */
208+ readonly etag : string ;
209+
210+ /**
211+ * Version information for the current Remote Config template.
212+ */
213+ version ?: Version ;
214+ }
215+
216+ /**
217+ * Interface representing a stateful abstraction for a Remote Config server template.
218+ */
219+ export interface RemoteConfigServerTemplate {
220+
221+ /**
222+ * Cached {@link RemoteConfigServerTemplateData}
223+ */
224+ cache : RemoteConfigServerTemplateData ;
225+
226+ /**
227+ * A {@link RemoteConfigServerConfig} containing default values for Config
228+ */
229+ defaultConfig : RemoteConfigServerConfig ;
230+
231+ /**
232+ * Evaluates the current template to produce a {@link RemoteConfigServerConfig}
233+ */
234+ evaluate ( ) : RemoteConfigServerConfig ;
235+
236+ /**
237+ * Fetches and caches the current active version of the
238+ * {@link RemoteConfigServerTemplate} of the project.
239+ */
240+ load ( ) : Promise < void > ;
241+ }
242+
170243/**
171244 * Interface representing a Remote Config user.
172245 */
@@ -289,3 +362,8 @@ export interface ListVersionsOptions {
289362 */
290363 endTime ?: Date | string ;
291364}
365+
366+ /**
367+ * Type representing the configuration produced by evaluating a server template.
368+ */
369+ export type RemoteConfigServerConfig = { [ key : string ] : string | boolean | number }
0 commit comments