openapi-ts-mock-generator
Version:
typescript mock data generator based openapi
30 lines (28 loc) • 983 B
TypeScript
/**
* 파일 시스템 관련 유틸리티 함수들
*/
/**
* 디렉토리가 존재하지 않으면 생성
*/
declare const ensureDir: (dirPath: string) => void;
/**
* 디렉토리를 비우고 정리
*/
declare const clearDirectory: (dirPath: string) => void;
/**
* 안전하게 파일 쓰기 (디렉토리 자동 생성)
*/
declare const safeWriteFile: (filePath: string, content: string) => void;
/**
* JSON 파일 읽기 (파일이 없으면 기본값 반환)
*/
declare const readJsonFile: <T>(filePath: string, defaultValue: T) => T;
/**
* 파일 경로가 URL인지 로컬 파일인지 확인하여 절대 경로 반환
*/
declare const resolveFilePath: (inputPath: string, baseDir?: string) => string;
/**
* 여러 파일명 조합하여 고유한 파일명 생성
*/
declare const createUniqueFileName: (baseName: string, extension: string) => string;
export { clearDirectory, createUniqueFileName, ensureDir, readJsonFile, resolveFilePath, safeWriteFile };