@launchdarkly/react-native-client-sdk
Version:
React Native LaunchDarkly SDK
32 lines • 1.45 kB
TypeScript
import { LDEvaluationDetailTyped } from './LDEvaluationDetail';
/**
* Determines the strongly typed variation of a feature flag.
*
* @param key The unique key of the feature flag.
* @param defaultValue The default value of the flag, to be used if the value is not available
* from LaunchDarkly.
* @returns
* The strongly typed value.
*/
export declare const useTypedVariation: <T extends unknown>(key: string, defaultValue: T) => T;
/**
* Determines the strongly typed variation of a feature flag for a context, along with information about
* how it was calculated.
*
* The `reason` property of the result will also be included in analytics events, if you are
* capturing detailed event data for this flag.
*
* If the flag variation does not have the specified type, defaultValue is returned. The reason will
* indicate an error of the type `WRONG_KIND` in this case.
*
* For more information, see the [SDK reference
* guide](https://docs.launchdarkly.com/sdk/features/evaluation-reasons#react-native).
*
* @param key The unique key of the feature flag.
* @param defaultValue The default value of the flag, to be used if the value is not available
* from LaunchDarkly.
* @returns
* The result (as an {@link LDEvaluationDetailTyped<T>}).
*/
export declare const useTypedVariationDetail: <T extends unknown>(key: string, defaultValue: T) => LDEvaluationDetailTyped<T>;
//# sourceMappingURL=useTypedVariation.d.ts.map