UNPKG

@iicoding/utils

Version:

Browser 端 - 类型判断 - 类似 koa 的异步compose - sleep - 扩展对象属性 - 扩展 storage 对象功能

19 lines (18 loc) 702 B
import type { TStorageType, ExtendStoreGet, ExtendStoreSet, ExtendStoreSetMore, ExtendStoreGet2Json, ExtendStoreRemove, ExtendStoreClearAll, ExtendStoreRemoveMore } from '..'; interface IExtendMethod { get: ExtendStoreGet; get2Json: ExtendStoreGet2Json; set: ExtendStoreSet; setMore: ExtendStoreSetMore; remove: ExtendStoreRemove; removeMore: ExtendStoreRemoveMore; clearAll: ExtendStoreClearAll; } declare global { export interface Window { sessionStorage: Storage | IExtendMethod; localStorage: Storage | IExtendMethod; } } export declare const extendStorageMethod: (storageType?: TStorageType | 'all') => void; export default extendStorageMethod;