import { type FeatureFlagScope } from "../feature-flags/store.js"; import { type LabDefinition } from "./registry.js"; export declare const LABS_SETTING_KEY = "labs"; export interface UserLabState { enabled: boolean; source: "choice" | "legacy" | "default" | "host"; legacyValues?: Record; mixed: boolean; } export type UserLabStateValue = UserLabState; export interface UserLabStateError { error: "invalid-choice" | "legacy-unavailable"; } export type UserLabStateResult = UserLabState | UserLabStateError; export declare function getUserLabStates(email: string, scope?: FeatureFlagScope): Promise>; /** * Host hook: when an app runs inside another product (e.g. Builder), the host * owns rollout decisions. A host override wins over the user's saved choice * and the lab default; return `undefined` to defer. */ type HostLabOverride = (key: string, scope: FeatureFlagScope & { userEmail: string; }) => boolean | undefined; export declare function registerHostLabOverrides(override: HostLabOverride | null): void; export declare function getUserLabState(email: string, lab: string | LabDefinition, scope?: FeatureFlagScope): Promise; export declare function getUserLabEnabled(email: string, lab: string | LabDefinition, scope?: FeatureFlagScope): Promise; export declare function normalizeLabValues(stored: Record | null | undefined): Record; export declare function getUserLabs(email: string, scope?: FeatureFlagScope): Promise>; export declare function setUserLab(email: string, key: string, enabled: boolean, scope?: FeatureFlagScope): Promise>; export declare function setUserLabStates(email: string, key: string, enabled: boolean, scope?: FeatureFlagScope): Promise>; export {};