UNPKG

@tsed/cli

Version:
45 lines (44 loc) 1.5 kB
import "../utils/hbs/index.js"; import { CliFs } from "@tsed/cli-core"; import { Observable } from "rxjs"; export interface RenderOptions { path: string; templateDir: string; rootDir: string; output: string; baseDir: string; basename: string; replaces?: string[]; } export declare abstract class Renderer { templateDir: string; readonly fs: CliFs; readonly cache: Set<string>; abstract get rootDir(): string; loadPartials(cwd: string): Promise<void>; render(path: string, data: any, options?: Partial<RenderOptions>): Promise<void>; renderAll(paths: (string | RenderOptions)[], data: any, options?: Partial<RenderOptions>): Observable<unknown>; write(content: string, options: any): Promise<void>; templateExists(path: string, options?: Partial<RenderOptions>): boolean; scan(pattern: string[], options?: any): Promise<string[]>; relativeFrom(path: string): string; update(path: string, actions: { type?: string; content: string; pattern?: RegExp; }[]): Promise<void>; protected mapOptions(path: string, options: Partial<RenderOptions>): { output: string; templateDir: string; rootDir: string; }; } export declare class RootRendererService extends Renderer { get rootDir(): string; } export declare class SrcRendererService extends Renderer { get rootDir(): string; } export declare class ScriptsRendererService extends Renderer { get rootDir(): string; }