UNPKG

@launchdarkly/js-server-sdk-common

Version:
46 lines 1.84 kB
import { LDEvaluationReason, LDFlagSet, LDFlagValue } from '@launchdarkly/js-sdk-common'; /** * An object that contains the state of all feature flags, generated by `LDClient.allFlagsState`. */ export interface LDFlagsState { /** * True if this object contains a valid snapshot of feature flag state, or false if the * state could not be computed (for instance, because the client was offline or there * was no user). */ valid: boolean; /** * Returns the value of an individual feature flag at the time the state was recorded. * It will be null if the flag returned the default value, or if there was no such flag. * * @param key * The flag key. */ getFlagValue(key: string): LDFlagValue; /** * Returns the evaluation reason for a feature flag at the time the state was recorded. * It will be null if reasons were not recorded, or if there was no such flag. * * @param key * The flag key. */ getFlagReason(key: string): LDEvaluationReason | null; /** * Returns a map of feature flag keys to values. If a flag would have evaluated to the * default value, its value will be null. * * Do not use this method if you are passing data to the front end to "bootstrap" the * JavaScript client. Instead, use {@link toJSON}. */ allValues(): LDFlagSet; /** * Returns a Javascript representation of the entire state map, in the format used by * the Javascript SDK. Use this method if you are passing data to the front end in * order to "bootstrap" the JavaScript client. * * Do not rely on the exact shape of this data, as it may change in future to support * the needs of the JavaScript client. */ toJSON(): object; } //# sourceMappingURL=LDFlagsState.d.ts.map