/** * 异步存储适配器接口 * 统一使用异步 API,无论底层是 localStorage 还是 IndexedDB */ interface IStorageAdapter { /** * 获取存储项 * @param key 存储键 * @returns 存储的值,如果不存在则返回 null */ getItem(key: string): Promise; /** * 设置存储项 * @param key 存储键 * @param value 要存储的值 */ setItem(key: string, value: string): Promise; /** * 移除存储项 * @param key 存储键 */ removeItem(key: string): Promise; } export { IStorageAdapter };