import type { LabDefinition } from "../../labs/registry.js"; import type { UserLabState, UserLabStateResult } from "../../labs/store.js"; export type LabValues = Record; export type LabStates = Record; export declare function isLabStateEnabled(labs: LabStates, key: string): boolean; /** * A lab by key, or by its definition. Pass the definition so the lab reads as * its `defaultEnabled` until the server answers (and when it can't); a bare * key can't know that default. */ export type LabReference = string | Pick; export declare function useLabState(lab: LabReference): { enabled: boolean; source: UserLabState["source"] | null; mixed: boolean; legacyValues?: Record; isLoading: boolean; isError: boolean; isSuccess: boolean; isStateError: boolean; /** Read the Lab state again, such as after it failed to load. */ refetch: () => void; }; /** * Whether a lab is on. Until the server answers, a definition reads as its * `defaultEnabled`; a bare key reads as on, so UI behind a lab that may be * enabled doesn't disappear while loading. */ export declare function useLab(lab: LabReference): boolean; export declare function useLabs(): LabValues; export declare function useLabStates(): LabStates;