openai-compatible-task-master
Version:
使用MCP解析PRD文档并生成任务列表
50 lines (49 loc) • 1.44 kB
TypeScript
/**
* 规范化路径,去除开头的斜杠
* @param filePath 文件路径
* @returns 规范化后的路径
*/
export declare function normalizePath(filePath: string): string;
/**
* 构建完整路径
* @param projectDir 项目根目录
* @param relativePath 相对路径
* @returns 完整路径
*/
export declare function resolveFullPath(projectDir: string, relativePath: string): string;
/**
* 检查文件是否存在
* @param filePath 文件路径
* @returns 文件是否存在
*/
export declare function ensureFileExists(filePath: string): Promise<boolean>;
/**
* 读取文件内容
* @param filePath 文件路径
* @returns 文件内容
*/
export declare function readFileContent(filePath: string): Promise<string>;
/**
* 写入文件内容
* @param filePath 文件路径
* @param content 文件内容
*/
export declare function writeFileContent(filePath: string, content: string): Promise<void>;
/**
* 确保目录存在
* @param dirPath 目录路径
*/
export declare function ensureDirectoryExists(dirPath: string): Promise<void>;
/**
* 读取JSON文件
* @param filePath 文件路径
* @returns JSON对象
*/
export declare function readJsonFile<T>(filePath: string): Promise<T>;
/**
* 写入JSON文件
* @param filePath 文件路径
* @param data JSON对象
* @param spaces 缩进空格数
*/
export declare function writeJsonFile<T>(filePath: string, data: T, spaces?: number): Promise<void>;