Interface TwingTemplate

interface TwingTemplate {
    aliases: TwingTemplateAliases;
    blockHandlers: Map<string, TwingTemplateBlockHandler>;
    canBeUsedAsATrait: boolean;
    macroHandlers: Map<string, TwingTemplateMacroHandler>;
    name: string;
    source: TwingSource;
    checkMethodAllowed(candidate, method): void;
    checkPropertyAllowed(candidate, property): void;
    checkSecurity(tags, filters, functions): void;
    createTemplateFromString(content, name): Promise<TwingTemplate>;
    displayBlock(name, context, outputBuffer, blocks, useBlocks, sandboxed, sourceMapRuntime?): Promise<void>;
    escape(value, strategy, charset, autoEscape?): Promise<string | boolean | TwingMarkup>;
    execute(context, outputBuffer, childBlocks, options?): Promise<void>;
    getBlocks(): Promise<TwingTemplateBlockMap>;
    getFilter(name): null | TwingFilter;
    getFunction(name): null | TwingFunction;
    getParent(context, outputBuffer, sandboxed, sourceMapRuntime?): Promise<null | TwingTemplate>;
    getTemplateSource(name): Promise<null | TwingSource>;
    getTest(name): null | TwingTest;
    getTraits(): Promise<TwingTemplateBlockMap>;
    hasBlock(name, context, outputBuffer, blocks, sandboxed, sourceMapRuntime?): Promise<boolean>;
    hasMacro(name): Promise<boolean>;
    loadEmbeddedTemplate(index): Promise<TwingTemplate>;
    loadTemplate(identifier): Promise<TwingTemplate>;
    render(context, options?): Promise<string>;
    renderBlock(name, context, outputBuffer, blocks, useBlocks, sandboxed, sourceMapRuntime?): Promise<string>;
    renderParentBlock(name, context, outputBuffer, sandboxed, sourceMapRuntime?): Promise<string>;
    resolveTemplate(names): Promise<TwingTemplate>;


blockHandlers: Map<string, TwingTemplateBlockHandler>
canBeUsedAsATrait: boolean
macroHandlers: Map<string, TwingTemplateMacroHandler>
name: string
source: TwingSource


  • Parameters

    • tags: string[]
    • filters: string[]
    • functions: string[]

    Returns void

  • Parameters

    • value: undefined | null | string | boolean | TwingMarkup
    • strategy: string
    • charset: null | string
    • Optional autoEscape: boolean

    Returns Promise<string | boolean | TwingMarkup>

  • Parameters

    • name: string

    Returns Promise<boolean>

  • Tries to load templates consecutively from an array.

    Similar to loadTemplate() but it also accepts instances of TwingTemplate and an array of templates where each is tried to be loaded.


    • names: (null | string | TwingTemplate)[]

      A template or an array of templates to try consecutively

    Returns Promise<TwingTemplate>

Generated using TypeDoc