UNPKG

fsl-authorization

Version:
42 lines (41 loc) 1.17 kB
interface WrapValue<T> { value: T; [key: string]: any; } type PartialWrapValue<T> = { [P in keyof T]: WrapValue<T[P]>; }; interface IUserStorage { id?: number; token?: string; passkeyHash?: string; hash?: string; local?: string; cloud?: string; noUsePassKey?: boolean; hasDownload?: boolean; email?: string; ico?: string; refreshToken?: string; pwdKey?: string; credentialId?: string; accessToken?: 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 getAllUsers(): 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 | boolean | undefined; removeItem(key: IUserInfoKey): void; clear(): void; clearAll(): void; } export default SDKStorage;