UNPKG

web-shared-preferences

Version:

An simple class to manage the loacal storage, including React like useString, useJSON and more!

8 lines (7 loc) 604 B
declare const useLocalStorage: { string: (key: string, defValue: string) => [string, import("./Dispatcher").Dispatch<import("./Dispatcher").SetPrefAction<string>>]; boolean: (key: string, defValue: boolean) => [boolean, import("./Dispatcher").Dispatch<import("./Dispatcher").SetPrefAction<boolean>>]; number: (key: string, defValue: number) => [number, import("./Dispatcher").Dispatch<import("./Dispatcher").SetPrefAction<number>>]; json: <T = any>(key: string, defValue: T) => [T, import("./Dispatcher").Dispatch<import("./Dispatcher").SetPrefAction<T>>]; }; export { useLocalStorage };