export type CastTarget = "string" | "number" | "boolean" | "bigint"; /** * Configuration options for retrieving values from state. * @template T - The expected type of the value */ export type Options = { /** If true, throws an error when the key doesn't exist or a cast fails. */ strict?: boolean; /** Default value returned when the key doesn't exist or holds an empty value. */ fallback?: T; /** Cast the stored value to a specific primitive type. */ cast?: CastTarget; }; /** * Result of fetching a raw value from the underlying storage. * `found: false` means the key was absent (vs holding an explicit null/empty value). */ export type FetchResult = { found: true; value: unknown; } | { found: false; }; /** * Centralised value-resolution logic shared by every storage implementation. * * Order of operations: * 1. If not found: throw in strict mode, otherwise return fallback (or undefined). * 2. If value is "empty-ish" AND a fallback is provided: return fallback. * 3. If a cast is requested: try to cast; on failure throw in strict mode, * otherwise return fallback. */ export declare function resolveValue(result: FetchResult, options: Options, storageName: string, key: string): T | undefined;