UNPKG

@n1k1t/unit-generator

Version:

Coverage based unit tests AI generator

34 lines 1.21 kB
export interface IFileOptions { cwd?: string; /** Restricts file building based on provided `state` option */ strict?: boolean; /** Expected state of the file (works only on `strict` option provided as `true`) */ state?: 'new' | 'existent'; } export declare class FileReplaceError extends Error { source: string; constructor(source: string, reason: string); } export declare class FileBuildError extends Error { constructor(reason: string); } export declare class File { private provided; path: string; dir: string; cwd: string; content: string; lang: string; options?: IFileOptions; constructor(provided: Pick<File, 'cwd' | 'lang' | 'path' | 'content' | 'options'>); append(content: string): this; prepend(content: string): this; replace(source: string, target: string, options?: Pick<IFileOptions, 'strict'>): this; /** Writes content to file */ write(content?: string): Promise<void>; /** Refreshes and stores source content from file */ refresh(): Promise<void>; remove(): Promise<void>; static build(location: string | string[], options?: IFileOptions): Promise<File>; } //# sourceMappingURL=file.d.ts.map