Documentation
    Preparing search index...

    Interface TwingTemplate

    The shape of a template. A template

    interface TwingTemplate {
        aliases: TwingTemplateAliases;
        ast: TwingTemplateNode;
        blockHandlers: Map<string, TwingTemplateBlockHandler>;
        canBeUsedAsATrait: boolean;
        embeddedTemplates: Map<number, TwingTemplate>;
        macroHandlers: Map<string, TwingTemplateMacroHandler>;
        name: string;
        source: TwingSource;
        displayBlock(
            executionContext: TwingExecutionContext,
            name: string,
            useBlocks: boolean,
        ): Promise<void>;
        displayParentBlock(
            executionContext: TwingExecutionContext,
            name: string,
        ): Promise<void>;
        execute(
            environment: TwingEnvironment,
            context: TwingContext<any, any>,
            blocks: TwingTemplateBlockMap,
            outputBuffer: TwingOutputBuffer,
            options?: {
                nodeExecutor?: TwingNodeExecutor;
                sandboxed?: boolean;
                sourceMapRuntime?: TwingSourceMapRuntime;
                strict?: boolean;
                templateLoader?: TwingTemplateLoader;
            },
        ): Promise<void>;
        getBlocks(
            executionContext: TwingExecutionContext,
        ): Promise<TwingTemplateBlockMap>;
        getParent(
            executionContext: TwingExecutionContext,
        ): Promise<null | TwingTemplate>;
        getTraits(
            executionContext: TwingExecutionContext,
        ): Promise<TwingTemplateBlockMap>;
        hasBlock(
            executionContext: TwingExecutionContext,
            name: string,
            blocks: TwingTemplateBlockMap,
        ): Promise<boolean>;
        hasMacro(name: string): Promise<boolean>;
        loadTemplate(
            executionContext: TwingExecutionContext,
            identifier: string | TwingTemplate | (null | string | TwingTemplate)[],
        ): Promise<TwingTemplate>;
        render(
            environment: TwingEnvironment,
            context: Record<string, any>,
            options?: {
                nodeExecutor?: TwingNodeExecutor;
                outputBuffer?: TwingOutputBuffer;
                sandboxed?: boolean;
                sourceMapRuntime?: TwingSourceMapRuntime;
                strict?: boolean;
                templateLoader?: TwingTemplateLoader;
            },
        ): Promise<string>;
    }
    Index

    Properties

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

    Methods