mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
c10ace7a84
- feat(core): 多应用配置 v2(claude/codex)与 ProviderManager;支持 v1→v2 自动迁移 - feat(ui): 新增 Codex 页签与双编辑器表单;统一 window.api 支持 app 参数 - feat(tauri): 新增 get_config_status/open_config_folder/open_external 命令并适配 Codex - fix(codex): 主配置缺失时不执行默认导入(对齐 Claude 行为) - chore: 配置目录展示与重启提示等细节优化
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
/// <reference types="vite/client" />
|
|
|
|
import { Provider } from "./types";
|
|
import { AppType } from "./lib/tauri-api";
|
|
|
|
interface ImportResult {
|
|
success: boolean;
|
|
message?: string;
|
|
}
|
|
|
|
interface ConfigStatus {
|
|
exists: boolean;
|
|
path: string;
|
|
error?: string;
|
|
}
|
|
|
|
declare global {
|
|
interface Window {
|
|
api: {
|
|
getProviders: (app?: AppType) => Promise<Record<string, Provider>>;
|
|
getCurrentProvider: (app?: AppType) => Promise<string>;
|
|
addProvider: (provider: Provider, app?: AppType) => Promise<boolean>;
|
|
deleteProvider: (id: string, app?: AppType) => Promise<boolean>;
|
|
updateProvider: (provider: Provider, app?: AppType) => Promise<boolean>;
|
|
switchProvider: (providerId: string, app?: AppType) => Promise<boolean>;
|
|
importCurrentConfigAsDefault: (app?: AppType) => Promise<ImportResult>;
|
|
getClaudeCodeConfigPath: () => Promise<string>;
|
|
getClaudeConfigStatus: () => Promise<ConfigStatus>;
|
|
getConfigStatus: (app?: AppType) => Promise<ConfigStatus>;
|
|
selectConfigFile: () => Promise<string | null>;
|
|
openConfigFolder: (app?: AppType) => Promise<void>;
|
|
openExternal: (url: string) => Promise<void>;
|
|
};
|
|
platform: {
|
|
isMac: boolean;
|
|
};
|
|
__TAURI__?: any;
|
|
}
|
|
}
|
|
|
|
export {};
|