UNPKG

marko

Version:

Optimized runtime for Marko templates.

19 lines (18 loc) 1.14 kB
import { types as t } from "@marko/compiler"; import { type Section } from "../util/sections"; import { type Binding } from "./references"; import type { SerializeReason } from "./serialize-reasons"; type Write = string | t.Expression | (() => undefined | string | t.Expression); export declare function writeTo(path: t.NodePath<any>, trailer?: boolean): (strs: TemplateStringsArray, ...exprs: Write[]) => void; export declare function consumeHTML(path: t.NodePath<any>): t.ExpressionStatement | undefined; export declare function flushBefore(path: t.NodePath<any>): void; export declare function flushInto(path: t.NodePath<t.MarkoTag> | t.NodePath<t.Program>): void; interface SectionMeta { walks: t.Expression | undefined; writes: t.Expression | undefined; decls: t.VariableDeclarator[] | undefined; } export declare const getSectionMeta: (section: Section) => SectionMeta; export declare function getSectionMetaIdentifiers(section: Section): SectionMeta; export declare function markNode(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, nodeBinding: Binding, reason: undefined | false | SerializeReason): void; export {};