/** * localStorage 工具函数 * 用于管理搜索历史的存储 */ /** * 从 localStorage 加载历史记录 * @param key 存储的 key * @returns 历史记录数组 */ export declare const loadHistory: (key: string) => string[]; /** * 保存历史记录到 localStorage * @param key 存储的 key * @param history 历史记录数组 * @param maxCount 最大数量限制 */ export declare const saveHistory: (key: string, history: string[], maxCount: number) => void; /** * 清除历史记录 * @param key 存储的 key */ export declare const clearHistory: (key: string) => void; /** * 添加历史记录项 * @param key 存储的 key * @param item 新的历史记录项 * @param maxCount 最大数量限制 * @returns 更新后的历史记录数组 */ export declare const addHistoryItem: (key: string, item: string, maxCount: number) => string[]; /** * 删除历史记录项 * @param key 存储的 key * @param item 要删除的历史记录项 * @returns 更新后的历史记录数组 */ export declare const removeHistoryItem: (key: string, item: string) => string[]; /** * 检查 localStorage 是否可用 * @returns 是否可用 */ export declare const isLocalStorageAvailable: () => boolean;