1- import { LDEvaluationDetailTyped as CommonLDEvaluationDetailTyped , LDEvaluationReason , } from '@launchdarkly/js-client-sdk-common' ;
1+ import {
2+ LDEvaluationDetail as CommonDetail ,
3+ LDEvaluationDetailTyped as CommonDetailTyped ,
4+ LDEvaluationReason ,
5+ } from '@launchdarkly/js-client-sdk-common' ;
6+
7+ // Implementation note: In client-side SDKs the reason is optional. The common type, which is also
8+ // used by server SDKs, has a required reason. This file contains a client specific
9+ // LDEvaluationDetail which has an optional reason.
10+
11+ // TODO: On major version change "reason" to be optional instead of nullable.
212
313/**
414 * An object that combines the result of a feature flag evaluation with information about
515 * how it was calculated.
616 *
7- * This is the result of calling detailed variation methods.
17+ * This is the result of calling `LDClient.variationDetail`.
18+ */
19+ export type LDEvaluationDetail = Omit < CommonDetail , 'reason' > & {
20+ /**
21+ * An optional object describing the main factor that influenced the flag evaluation value.
22+ */
23+ reason : LDEvaluationReason | null ;
24+ } ;
25+
26+ /**
27+ * An object that combines the result of a feature flag evaluation with information about
28+ * how it was calculated.
829 *
9- * @remarks
10- * We will be deprecating this type in favor of {@link CommonLDEvaluationDetailTyped} in the
11- * next major version.
30+ * This is the result of calling detailed variation methods.
1231 */
13- export type LDEvaluationDetailTyped < TFlag > = Omit < CommonLDEvaluationDetailTyped < TFlag > , 'reason' > & {
32+ export type LDEvaluationDetailTyped < TFlag > = Omit < CommonDetailTyped < TFlag > , 'reason' > & {
1433 /**
1534 * An optional object describing the main factor that influenced the flag evaluation value.
1635 */
1736 reason : LDEvaluationReason | null ;
18- } ;
37+ } ;
0 commit comments