import { InjectionToken, type Injector, type WritableSignal } from '@angular/core'; export declare const NGXTENSION_LOCAL_STORAGE: InjectionToken; export declare function provideLocalStorageImpl(impl: typeof globalThis.localStorage): { provide: InjectionToken; useValue: Storage; }; /** * Options to override the default behavior of the local storage signal. */ export type LocalStorageOptionsBase = { /** * Determines if local storage syncs with the signal. * When true, updates in one tab reflect in others, ideal for shared-state apps. * @default true */ storageSync?: boolean; /** * Override the default JSON.stringify function for custom serialization. * @param value */ stringify?: (value: T) => string; /** * Override the default JSON.parse function for custom deserialization. * @param value */ parse?: (value: string) => T; /** * Injector for the Injection Context */ injector?: Injector; }; export type LocalStorageOptionsNoDefault = LocalStorageOptionsBase; export type LocalStorageOptionsWithDefaultValue = LocalStorageOptionsNoDefault & { /** * Default value for the signal. * Can be a value or a function that returns the value. */ defaultValue: T | (() => T); }; type ClearOnKeyChange = { /** * Specifies whether the value stored under the previous key * should be removed from `localStorage` when the key changes. * @default true */ clearOnKeyChange?: boolean; }; export type LocalStorageOptionsComputedNoDefault = LocalStorageOptionsBase & ClearOnKeyChange; export type LocalStorageOptionsComputedWithDefaultValue = LocalStorageOptionsWithDefaultValue & ClearOnKeyChange; export type LocalStorageOptions = LocalStorageOptionsNoDefault | LocalStorageOptionsWithDefaultValue | LocalStorageOptionsComputedNoDefault | LocalStorageOptionsComputedWithDefaultValue; type LocalStorageSignal = WritableSignal; export declare const injectLocalStorage: { (key: string, options: LocalStorageOptionsWithDefaultValue): LocalStorageSignal; (key: string, options?: LocalStorageOptionsNoDefault): LocalStorageSignal; (keyComputation: () => string, options: LocalStorageOptionsComputedWithDefaultValue): LocalStorageSignal; (keyComputation: () => string, options?: LocalStorageOptionsComputedNoDefault): LocalStorageSignal; }; export {};