UNPKG

stcg

Version:

Scripted Template Content Generator

37 lines (36 loc) 749 B
/** * Generator error */ export declare class StcgError extends Error { } /** * Generator options */ export interface StcgOptions { codeBegin?: string; codeEnd?: string; outputBegin?: string; outputEnd?: string; trimAfterCode?: boolean; debugLen?: number; } /** * Scripted Template Content Generator */ export declare class Stcg { private script; private globals; constructor(template: string, options?: StcgOptions); /** * Add a global symbol * @param name Symbol name * @param data Symbol data */ global(name: string, data: any): void; /** * Run the generator */ run(ldata?: { [key: string]: any; }): string; }