/** 翻译 API 类型 */ export type TranslateApiType = "baidu"; /** 翻译 API 配置 */ export interface TranslateConfig { /** 翻译 API 类型 */ type: TranslateApiType; /** API 密钥 */ appId: string; /** API 密钥 */ secretKey?: string; /** 缓存路径 */ cachePath: string; } /** 翻译缓存 */ export interface TranslateCache { [key: string]: string; } /** 加载缓存 */ export declare const loadCache: (cachePath: string) => Promise; /** 保存缓存 */ export declare const saveCache: (cachePath: string, cache: TranslateCache) => Promise; /** 纯翻译功能,不涉及缓存 */ export declare const pureTranslate: (config: TranslateConfig, text: string, from?: string, to?: string) => Promise; /** 翻译文本 */ export declare const translate: (config: TranslateConfig, text: string, from?: string, to?: string) => Promise; /** 批量翻译文本 */ export declare const translateTexts: (config: TranslateConfig, texts: string[], from?: string, to?: string) => Promise;