interface StorageManager { setItem(val: T): T; getItem(defaultVal?: Partial): T; removeItem(): void; updateItem(val: Partial): T; } declare function factory(type: 'sessionStorage' | 'localStorage'): { setItem: (key: string, val: T) => T; getItem: (key: string, defaultVal?: Partial | null) => T_1; removeItem: (key: string) => void; updateItem: (key: string, val: Partial) => T_2; clear: () => void; generate: (key: string) => { setItem: (val: T_3) => T_3; getItem: (defaultVal?: Partial | undefined) => T_3; removeItem: () => void; updateItem: (val: Partial) => T_3; }; }; export { type StorageManager, factory };