import { OpenCodeConfig } from "../types.mjs"; //#region src/services/config.d.ts /** * 获取平台相关的配置目录 * Linux: $XDG_CONFIG_HOME/opencode 或 ~/.config/opencode * macOS: ~/Library/Application Support/opencode * Windows: %APPDATA%/opencode */ declare function getPlatformConfigDir(): string; interface ConfigResult { config: OpenCodeConfig; path: string; } /** * 加载全局 opencode 配置及其文件路径 * @param customPath 自定义配置路径,不传则使用默认路径 * @returns 配置结果,文件不存在或解析失败返回 null */ declare function loadGlobalConfigWithPath(customPath?: string): ConfigResult | null; /** * 加载项目级 opencode 配置及其文件路径 * @param startDir 起始查找目录,默认为当前工作目录 * @returns 配置结果,未找到返回 null */ declare function loadProjectConfigWithPath(startDir?: string): ConfigResult | null; /** * 加载全局 opencode 配置 * @param customPath 自定义配置路径,不传则使用默认路径 * @returns 配置对象,文件不存在或解析失败返回 null */ declare function loadGlobalConfig(customPath?: string): null | OpenCodeConfig; /** * 从指定目录开始向上查找项目级 opencode 配置 * 依次查找 opencode.json 和 .opencode.json * @param startDir 起始查找目录,默认为当前工作目录 * @returns 配置对象,未找到返回 null */ declare function loadProjectConfig(startDir?: string): null | OpenCodeConfig; /** * 将配置对象写回文件 * @param filePath 配置文件路径 * @param config 配置对象 */ declare function saveConfig(filePath: string, config: OpenCodeConfig): void; //#endregion export { ConfigResult, getPlatformConfigDir, loadGlobalConfig, loadGlobalConfigWithPath, loadProjectConfig, loadProjectConfigWithPath, saveConfig };