/** * 自定义模板存储模块 * 使用 LocalStorage 持久化存储用户自定义的正则表达式模板 */ import type { RegexTemplate } from './types'; /** * 模板存储工具类 */ export declare class TemplateStorage { /** * 加载所有自定义模板 */ static loadCustomTemplates(): RegexTemplate[]; /** * 保存自定义模板 */ static saveCustomTemplate(template: RegexTemplate): boolean; /** * 更新模板使用统计 */ static updateTemplateUsage(templateId: string): boolean; /** * 删除自定义模板 */ static deleteCustomTemplate(templateId: string): boolean; /** * 批量删除自定义模板 */ static deleteMultipleTemplates(templateIds: string[]): boolean; /** * 清空所有自定义模板 */ static clearAllTemplates(): boolean; /** * 导出所有自定义模板为 JSON */ static exportTemplates(): string; /** * 从 JSON 导入自定义模板 */ static importTemplates(jsonString: string, merge?: boolean): boolean; /** * 获取存储统计信息 */ static getStorageStats(): { count: number; size: number; lastModified: string | null; }; /** * 内部方法: 持久化模板数据到 LocalStorage */ private static _persistTemplates; /** * 检查 LocalStorage 是否可用 */ static isStorageAvailable(): boolean; } /** * 便捷函数导出 */ export declare const loadCustomTemplates: () => RegexTemplate[]; export declare const saveCustomTemplate: (template: RegexTemplate) => boolean; export declare const deleteCustomTemplate: (templateId: string) => boolean; export declare const updateTemplateUsage: (templateId: string) => boolean; export declare const clearAllTemplates: () => boolean; export declare const exportTemplates: () => string; export declare const importTemplates: (jsonString: string, merge?: boolean) => boolean; export declare const getStorageStats: () => { count: number; size: number; lastModified: string | null; }; export declare const isStorageAvailable: () => boolean;