template-file
Version:
🔀 Replace {{ variables }} in all your files
8 lines (7 loc) • 587 B
TypeScript
export declare type DataValue = string | number | Data | (() => string | number | Data);
export interface Data extends Record<string | number | symbol, DataValue | DataValue[]> {
}
export declare function renderGlob(sourceGlob: string, data: Data, onFileCallback: (filename: string, contents: string) => void): Promise<void>;
export declare function render(template: string, data: Data): string;
export declare function renderFile(filepath: string, data: Data): Promise<string>;
export declare function renderToFolder(sourceGlob: string, destination: string, data: Data): Promise<void>;