import { DataOptionType } from '../propsType'; export type StorageType = 'localStorage' | 'sessionStorage' | 'indexedDB'; export declare const baseCacheKey = "zat-design-pro-component-cacheKey"; /** v4 默认存储类型 */ export declare const baseStorage: StorageType; /** 模块级内存缓存,key 为 cacheKey,替代原单例 baseEnumStorage 变量 */ export declare const enumMemoryCache: Map; interface EnumRes { data: Record; [key: string]: any; } /** * 获取枚举数据 * @param storage * @param cacheKey * @returns */ export declare function getEnumData(storage: StorageType, cacheKey: string): EnumRes | Promise; /** * 设置枚举数据 * @param storage * @param cacheKey * @param data */ export declare function setEnumData(storage: StorageType, cacheKey: string, data: any): void | Promise; /** * 删除枚举缓存数据 * @param storage * @param cacheKey */ export declare function removeEnumData(storage: StorageType, cacheKey: string): Promise; /** * 从内存缓存或同步存储中同步读取枚举数据,不触发任何异步 I/O。 * - 内存缓存命中时直接返回 * - localStorage/sessionStorage 同步读取并预热内存缓存 * - indexedDB 未命中时返回 undefined(需异步兜底) */ export declare function getEnumDataSync(storage: StorageType, cacheKey: string): EnumRes | undefined; /** * 判断枚举列表是否存在 * @param storage * @param cacheKey * @param code * @returns */ export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string): false | DataOptionType[]; /** * 判断是否是对象 * @param obj * @returns */ export declare function isObject(obj: any): boolean; /** * 合并枚举数据 * @param storage * @param code * @param cacheKey * @param responseData */ export declare function mergeCacheData(storage: string, code: string, cacheKey: string, responseData: any): Promise; /** * diff code 差异 * @param cacheCodes * @param codes * @returns */ export declare function diffCode(cacheCodes: string[], codes: string[]): boolean; /** * 缓存fieldNames制定的值 * @param fieldNames 保留映射值 * @param dataSource 需要筛选的数据源 * @returns {} */ export declare function cacheFieldNames(fieldNames: { [key: string]: string; }, dataSource: { [key: string]: any; }): any; export {};