UNPKG

@baseplate-dev/sync

Version:

Library for syncing Baseplate descriptions

34 lines 1.16 kB
/** * Interface for a codebase file reader */ export interface CodebaseFileReader { /** * Check if a file exists in the codebase * * @param relativePath - Relative path of the file to check * @returns True if the file exists, false otherwise */ fileExists: (relativePath: string) => Promise<boolean>; /** * Read the contents of a file from the codebase * * @param relativePath - Relative path of the file to read * @returns Contents of the file or undefined if the file does not exist */ readFile: (relativePath: string) => Promise<Buffer | undefined>; } /** * Create a codebase file reader from a directory * * @param directory - Directory to read files from * @returns Codebase file reader */ export declare function createCodebaseFileReaderFromDirectory(directory: string): CodebaseFileReader; /** * Create a codebase file reader from a map of files * * @param files - Map of files to read * @returns Codebase file reader */ export declare function createCodebaseReaderFromMemory(files: Map<string, Buffer>): CodebaseFileReader; //# sourceMappingURL=codebase-file-reader.d.ts.map