type SingleCodec = (value: string) => T; type MultiCodec = (entry: [string, string]) => [string, T]; type SingleHashStateOpts = { suffix?: string; read?: SingleCodec; write?: (value: T) => string; multi?: false; ready?: boolean; }; type MultiHashStateOpts> = { suffix?: string; read?: MultiCodec; write?: (entry: [string, T[keyof T]]) => [string, unknown]; multi: true; ready?: boolean; }; /** * Synchronizes a state value with a URL hash parameter. * * On mount, if the hash contains an explicit value for the parameter, that * value is used. Otherwise, `initial` is used. * * When `ready` is `false`, the hook skips syncing `initial` into state. * When `ready` transitions to `true`, the hook syncs `initial` into state * (unless the hash was explicitly set on mount). This is useful for deferring * the initial sync until async data (e.g. saved settings) has loaded. * * @param initial - The initial state value used when the hash is not set. * @param param - The URL hash parameter name, or `null`/`undefined` to disable. * @param opts - Optional codec, mode, and readiness options. */ export declare function useHashState(initial: T, param: string | null | undefined, opts?: SingleHashStateOpts): [T, (value: T | ((prev: T) => T)) => void]; export declare function useHashState>(initial: T, param: string | null | undefined, opts: MultiHashStateOpts): [T, (value: T | ((prev: T) => T)) => void]; export {}; //# sourceMappingURL=use-hash-state.d.ts.map