UNPKG

marko

Version:

Optimized runtime for Marko templates.

24 lines (23 loc) • 2.69 kB
import { types as t } from "@marko/compiler"; import { type Binding } from "./bindings"; import { type Section, type StructureNode, type StructureRef } from "./sections"; export declare function enter(path: t.NodePath<any>): void; export declare function exit(path: t.NodePath<any>): void; export declare function enterShallow(path: t.NodePath<any>): void; export declare function child(tag: t.NodePath<t.MarkoTag>, name: string, renderer?: StructureRef): void; export declare function writeTo(path: t.NodePath<any>): (strs: TemplateStringsArray, ...exprs: string[]) => void; export declare function writeModuleReadTo(path: t.NodePath<any>, read: string[]): void; export declare function writeTextTo(path: t.NodePath<any>, value: string): void; export declare function node(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, binding?: Binding): StructureNode | undefined; export declare function marker(path: t.NodePath<t.MarkoTag | t.MarkoPlaceholder>, binding: Binding): void; export declare function controlFlowNode(tag: t.NodePath<t.MarkoTag>, section: Section): Binding; interface SectionMeta { walks: t.Expression | undefined; writes: t.Expression | undefined; } export declare const getSectionMeta: (section: Section) => SectionMeta; export declare function writeStructureExports(program: t.NodePath<t.Program>): void; /** `_content` strips trailing exit codes before it walks, so a renderer that * reaches the runtime through it never needs them on the wire. */ export declare function trimTrailingExits(walks: t.Expression | undefined): t.ArrayExpression | t.ArrowFunctionExpression | t.AssignmentExpression | t.AwaitExpression | t.BigIntLiteral | t.BinaryExpression | t.BindExpression | t.BooleanLiteral | t.CallExpression | t.ClassExpression | t.ConditionalExpression | t.DecimalLiteral | t.DoExpression | t.FunctionExpression | t.Identifier | t.Import | t.ImportExpression | t.JSXElement | t.JSXFragment | t.LogicalExpression | t.MarkoParseError | t.MemberExpression | t.MetaProperty | t.ModuleExpression | t.NewExpression | t.NullLiteral | t.NumericLiteral | t.ObjectExpression | t.OptionalCallExpression | t.OptionalMemberExpression | t.ParenthesizedExpression | t.PipelineBareFunction | t.PipelinePrimaryTopicReference | t.PipelineTopicExpression | t.RecordExpression | t.RegExpLiteral | t.SequenceExpression | t.StringLiteral | t.Super | t.TSAsExpression | t.TSInstantiationExpression | t.TSNonNullExpression | t.TSSatisfiesExpression | t.TSTypeAssertion | t.TaggedTemplateExpression | t.TemplateLiteral | t.ThisExpression | t.TopicReference | t.TupleExpression | t.TypeCastExpression | t.UnaryExpression | t.UpdateExpression | t.YieldExpression | undefined; export {};