import { ComputedRef, Ref } from '../vue/dist/vue.esm-bundler.js'; import { BootstrappedState as BrowserBootstrappedState, CompanyContext, InitOptions, Logger, OptInFlag as BrowserOptInFlag, RawFlags, ReflagClient, ReflagContext, RequestFeedbackData, UserContext } from '@reflag/browser-sdk'; export type EmptyFlagRemoteConfig = { key: undefined; payload: undefined; }; export type FlagType = { config?: { payload: any; }; }; export type FlagRemoteConfig = { key: string; payload: any; } | EmptyFlagRemoteConfig; export interface Flag { key: string; isEnabled: Ref; isLoading: Ref; config: Ref<({ key: string; } & TConfig) | EmptyFlagRemoteConfig>; track(): Promise | undefined; requestFeedback: (opts: RequestFlagFeedbackOptions) => void; } export interface Flags { } export type TypedFlags = keyof Flags extends never ? Record : { [TypedFlagKey in keyof Flags]: Flags[TypedFlagKey] extends FlagType ? Flag : Flag; }; export type FlagKey = keyof TypedFlags; /** * An opt-in-enabled flag for the generated Vue SDK flag definitions. * * Includes all fields from {@link BrowserOptInFlag}: `name`, `description`, * `isEnabled`, `userOptedIn`, `companyOptedIn`, and `isOptedIn`. * Only `key` is narrowed to the generated {@link FlagKey} type. */ export type OptInFlag = Omit & { key: FlagKey; }; export type UseOptInFlagsResult = { flags: ComputedRef; isLoading: ComputedRef; }; export interface ProviderContextType { client: ReflagClient; isLoading: Ref; } export type BootstrappedFlags = BrowserBootstrappedState & { flags: RawFlags; }; export type RequestFlagFeedbackOptions = Omit; /** * Base init options for the ReflagProvider and ReflagBootstrappedProvider. * @internal */ export type ReflagInitOptionsBase = Omit; /** * Base props for the ReflagProvider and ReflagBootstrappedProvider. * @internal */ export type ReflagBaseProps = { /** * Set to `true` to show the loading component while the client is initializing. */ initialLoading?: boolean; /** * A custom logger to use for SDK logs. * Use this for advanced control or filtering of SDK logs. * If both `logger` and `debug` are provided, `logger` takes precedence. */ logger?: Logger; /** * Set to `true` to enable debug logging to the console. */ debug?: boolean; }; /** * Props for the ReflagClientProvider. */ export type ReflagClientProviderProps = Omit & { /** * A pre-initialized ReflagClient to use. */ client: ReflagClient; }; /** * Props for the ReflagProvider. */ export type ReflagProps = ReflagInitOptionsBase & ReflagBaseProps & { /** * The context to use for the ReflagClient containing user, company, and other context. */ context?: ReflagContext; /** * Company related context. If you provide `id` Reflag will enrich the evaluation context with * company attributes on Reflag servers. * @deprecated Use `context` instead, this property will be removed in the next major version */ company?: CompanyContext; /** * User related context. If you provide `id` Reflag will enrich the evaluation context with * user attributes on Reflag servers. * @deprecated Use `context` instead, this property will be removed in the next major version */ user?: UserContext; /** * Context which is not related to a user or a company. * @deprecated Use `context` instead, this property will be removed in the next major version */ otherContext?: Record; }; /** * Props for the ReflagBootstrappedProvider. */ export type ReflagBootstrappedProps = ReflagInitOptionsBase & ReflagBaseProps & { /** * Pre-fetched flags used for the initial render. The browser client fetches opt-in * metadata on demand when opt-in flags are requested. */ flags: BootstrappedFlags; }; //# sourceMappingURL=types.d.ts.map