export interface UseHostFeatureFlagOptions { /** * Value returned when the feature flags have loaded but the requested flag is * not present in the loaded set. When omitted, a missing flag resolves to * `null` (the historical behaviour). * * Note: this only applies once flags are loaded. While flags are still * loading the hook always returns `null` regardless of this option. */ defaultValueWhenMissing?: boolean; } /** * Reads a host feature flag by key. * * Return values: * - `null` while the host feature flags have not loaded yet. * - the flag's boolean `state` when the flag exists in the loaded set. * - `null` when the flags are loaded but the requested flag is not present, * unless `options.defaultValueWhenMissing` is provided, in which case that * value is returned. * * The hook is generic so callers can narrow the accepted key. Internal callers * pass the strongly-typed `Flag` union for type safety, e.g. * `useHostFeatureFlag(Flags.SOME_FLAG, { defaultValueWhenMissing: true })`. * External callers may pass any string. * * Must be used within a `FeatureFlagContext` (provided by `TrackunitProviders`). * * @example * import { useHostFeatureFlag } from "@trackunit/react-core-hooks"; * const isEnabled = useHostFeatureFlag("my_flag", { defaultValueWhenMissing: true }); * @see useFeatureFlags */ export declare const useHostFeatureFlag: (flag: TFlag, options: UseHostFeatureFlagOptions) => boolean | null;