-
Notifications
You must be signed in to change notification settings - Fork 12
/
LDEvaluationDetail.ts
48 lines (42 loc) · 1.54 KB
/
LDEvaluationDetail.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { LDEvaluationReason } from './LDEvaluationReason';
import { LDFlagValue } from './LDFlagValue';
/**
* An object that combines the result of a feature flag evaluation with information about
* how it was calculated.
*
* This is the result of calling `LDClient.variationDetail`.
*
* For more information, see the [SDK reference guide](https://docs.launchdarkly.com/sdk/features/evaluation-reasons#nodejs-server-side).
*/
export interface LDEvaluationDetail {
/**
* The result of the flag evaluation. This will be either one of the flag's variations or
* the default value that was passed to `LDClient.variationDetail`.
*/
value: LDFlagValue;
/**
* The index of the returned value within the flag's list of variations, e.g. 0 for the
* first variation-- or `null` if the default value was returned.
*/
variationIndex?: number | null;
/**
* An object describing the main factor that influenced the flag evaluation value.
*/
reason: LDEvaluationReason;
}
export interface LDEvaluationDetailTyped<TFlag> {
/**
* The result of the flag evaluation. This will be either one of the flag's variations or
* the default value that was passed to `LDClient.variationDetail`.
*/
value: TFlag;
/**
* The index of the returned value within the flag's list of variations, e.g. 0 for the
* first variation-- or `null` if the default value was returned.
*/
variationIndex?: number | null;
/**
* An object describing the main factor that influenced the flag evaluation value.
*/
reason: LDEvaluationReason;
}