UNPKG

fsl-authorization

Version:
29 lines (28 loc) 816 B
interface WrapValue<T> { value: T; [key: string]: any; } type PartialWrapValue<T> = { [P in keyof T]: WrapValue<T[P]>; }; interface IUserStorage { id?: number; token?: string; } type IUserInfoKey = keyof PartialWrapValue<IUserStorage>; declare class SDKStorage { id: string; userInfo: PartialWrapValue<IUserStorage>; loaded: boolean; constructor(id: string); static unRefValue(user: PartialWrapValue<IUserStorage>): Record<keyof IUserStorage, any>; static getUserToken(uid: string | undefined | null): any; setItem(key: IUserInfoKey, value: any, opt?: { timeStamp?: number; }): void; getItem(key: IUserInfoKey): string | number | undefined; removeItem(key: IUserInfoKey): void; clear(): void; clearAll(): void; } export default SDKStorage;