Skip to content

Commit 4c68e0c

Browse files
Add interface/type documentation & run apidocs
1 parent dea5828 commit 4c68e0c

File tree

3 files changed

+116
-14
lines changed

3 files changed

+116
-14
lines changed

etc/firebase-admin.remote-config.api.md

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,32 @@ export type EvaluationContext = UserProvidedSignals & PredefinedSignals;
4949

5050
// @public (undocumented)
5151
export interface ExperimentParameterValue {
52-
// Warning: (ae-forgotten-export) The symbol "ExperimentValue" needs to be exported by the entry point index.d.ts
53-
//
54-
// (undocumented)
5552
experimentValue: ExperimentValue;
5653
}
5754

55+
// @public
56+
export interface ExperimentValue {
57+
experimentId: string;
58+
variantValue: ExperimentVariantValue[];
59+
}
60+
61+
// @public
62+
export interface ExperimentVariantExplicitValue {
63+
noChange?: never;
64+
value: string;
65+
variantId: string;
66+
}
67+
68+
// @public
69+
export interface ExperimentVariantNoChange {
70+
noChange: true;
71+
value?: never;
72+
variantId: string;
73+
}
74+
75+
// @public
76+
export type ExperimentVariantValue = ExperimentVariantExplicitValue | ExperimentVariantNoChange;
77+
5878
// @public
5979
export interface ExplicitParameterValue {
6080
value: string;
@@ -150,14 +170,16 @@ export enum PercentConditionOperator {
150170
UNKNOWN = "UNKNOWN"
151171
}
152172

153-
// @public (undocumented)
173+
// @public
154174
export interface PersonalizationParameterValue {
155-
// Warning: (ae-forgotten-export) The symbol "PersonalizationValue" needs to be exported by the entry point index.d.ts
156-
//
157-
// (undocumented)
158175
personalizationValue: PersonalizationValue;
159176
}
160177

178+
// @public
179+
export interface PersonalizationValue {
180+
personalizationId: string;
181+
}
182+
161183
// @public
162184
export type PredefinedSignals = {
163185
randomizationId?: string;
@@ -235,14 +257,18 @@ export interface RemoteConfigUser {
235257
name?: string;
236258
}
237259

238-
// @public (undocumented)
260+
// @public
239261
export interface RolloutParameterValue {
240-
// Warning: (ae-forgotten-export) The symbol "RolloutValue" needs to be exported by the entry point index.d.ts
241-
//
242-
// (undocumented)
243262
rolloutValue: RolloutValue;
244263
}
245264

265+
// @public
266+
export interface RolloutValue {
267+
percent: number;
268+
rolloutId: string;
269+
value: string;
270+
}
271+
246272
// @public
247273
export interface ServerConfig {
248274
getAll(): {

src/remote-config/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@ export {
4848
RemoteConfigCondition,
4949
RemoteConfigParameter,
5050
ExperimentParameterValue,
51+
ExperimentValue,
52+
ExperimentVariantExplicitValue,
53+
ExperimentVariantNoChange,
54+
ExperimentVariantValue,
5155
PersonalizationParameterValue,
56+
PersonalizationValue,
5257
RolloutParameterValue,
58+
RolloutValue,
5359
RemoteConfigParameterGroup,
5460
RemoteConfigParameterValue,
5561
RemoteConfigTemplate,

src/remote-config/remote-config-api.ts

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,58 +355,128 @@ export interface InAppDefaultValue {
355355
}
356356

357357
/**
358-
* Represents a Rollout value.
358+
* Interface representing a value that is linked to a Rollout.
359359
*/
360360
export interface RolloutValue {
361+
/**
362+
* The ID of the Rollout to which the value is linked.
363+
*/
361364
rolloutId: string;
365+
366+
/**
367+
* The value that is being rolled out.
368+
*/
362369
value: string;
370+
371+
/**
372+
* The rollout percentage representing the exposure of the rollout value in
373+
* the target audience.
374+
*/
363375
percent: number; // Numeric value between 1-100
364376
}
365377

366378
/**
367-
* Represents a Personalization value.
379+
* Interface representing a value returned by Personalization.
368380
*/
369381
export interface PersonalizationValue {
382+
/**
383+
* The ID of the Personalization to which the value is linked.
384+
*/
370385
personalizationId: string;
371386
}
372387

373388
/**
374-
* Represents a specific variant value within an Experiment.
389+
* Interface representing a specific variant value within an Experiment.
375390
*/
376391
export interface ExperimentVariantExplicitValue {
392+
/**
393+
* ID of the variant value within an Experiment.
394+
*/
377395
variantId: string;
396+
397+
/**
398+
* Value of the variant within an Experiment.
399+
*/
378400
value: string;
401+
402+
/**
403+
* Represents an unset `noChange` value. To set `noChange`, use
404+
* `ExperimentVariantNoChange` instead.
405+
*/
379406
noChange?: never;
380407
}
381408

382409
/**
383410
* Represents a no-change variant value within an Experiment.
384411
*/
385412
export interface ExperimentVariantNoChange {
413+
/**
414+
* ID of the variant value within an Experiment.
415+
*/
386416
variantId: string;
417+
418+
/**
419+
* Represents an unset value as only one of `noChange` or `value` can be set.
420+
* To set a variant value, use `ExperimentVariantExplicitValue` instead.
421+
*/
387422
value?: never;
423+
424+
/**
425+
* Represents a no-change variant value within an Experiment. If `true`,
426+
* the variant served to the client is equal to the value against the
427+
* next condition in the evaluation order (or the default value if no
428+
* conditions are applicable).
429+
*/
388430
noChange: true;
389431
}
390432

433+
/**
434+
* Type representing a Experiment variant value.
435+
* A `ExperimentVariantValue` could be either an
436+
* `ExperimentVariantExplicitValue` or an `ExperimentVariantNoChange`.
437+
*/
391438
export type ExperimentVariantValue = ExperimentVariantExplicitValue | ExperimentVariantNoChange;
392439

393440
/**
394441
* Represents an Experiment value.
395442
*/
396443
export interface ExperimentValue {
444+
/**
445+
* ID of the Experiment to which the value is linked.
446+
*/
397447
experimentId: string;
448+
449+
/**
450+
* Collection of `ExperimentVariantValue`s that represents the variants
451+
* served by the Experiment.
452+
*/
398453
variantValue: ExperimentVariantValue[];
399454
}
400455

456+
/**
457+
* Interface representing a parameter value linked to a Rollout.
458+
*/
401459
export interface RolloutParameterValue {
460+
/**
461+
* The value returned by a Rollout.
462+
*/
402463
rolloutValue: RolloutValue;
403464
}
404465

466+
/**
467+
* Interface representing a parameter value linked to a Personalization.
468+
*/
405469
export interface PersonalizationParameterValue {
470+
/**
471+
* The value returned by a Personalization.
472+
*/
406473
personalizationValue: PersonalizationValue;
407474
}
408475

409476
export interface ExperimentParameterValue {
477+
/**
478+
* The value returned by an Experiment.
479+
*/
410480
experimentValue: ExperimentValue;
411481
}
412482

0 commit comments

Comments
 (0)