import { Context } from 'react'; import { FC } from 'react'; import { PropsWithChildren } from 'react'; export declare function getFromLocalStorage(key: string): T | null; export declare const LocalStorageContext: Context; export declare interface LocalStorageContextProps { getLocalStorage: (name: K) => ValidLocalStorageObject[K] | undefined; setLocalStorage: (name: K, value: ValidLocalStorageObject[K]) => void; removeLocalStorageValue: (name: K) => void; removeLocalStorageValues: () => void; checkLocalStorage: () => void; localStorageValues: ValidLocalStorageObject | undefined; } /** * Provider component for managing local storage. * * @remarks * The local storage is typed using the `jenesei-kit-react.d.ts` file: * * ```typescript * import '@jenesei-software/jenesei-kit-react' * * declare module '@jenesei-software/jenesei-kit-react' { * export interface ValidLocalStorageObject { * access_token: string * refresh_token: string * } * } * ``` */ export declare const ProviderLocalStorage: FC; export declare interface ProviderLocalStorageProps extends PropsWithChildren { validate?: { validateKeys: (keyof ValidLocalStorageObject)[]; getValidateLocalStorageValue: (key: K, value: ValidLocalStorageObject[K]) => value is ValidLocalStorageObject[K]; }; } export declare function setToLocalStorage(key: string, value: T): void; /** * Custom hook to access the LocalStorageContext. */ export declare const useLocalStorage: () => LocalStorageContextProps; export declare interface ValidLocalStorageObject { } export { }