UNPKG

marko

Version:

Optimized runtime for Marko templates.

12 lines (11 loc) 663 B
import type { types as t } from "@marko/compiler"; export type VisitorType = "migrate" | "transform" | "analyze" | "translate"; export type TemplateVisitor<T extends t.Node> = Partial<Record<VisitorType, t.VisitNode<unknown, T>>>; export declare function extractVisitors<Visitors extends Partial<Record<keyof t.Visitor, TemplateVisitor<any>>>>(visitors: Visitors): Record<VisitorType, t.Visitor<unknown>>; export declare function translateByTarget<T extends t.Node>({ html, dom, }: { dom: t.VisitNode<unknown, T>; html: t.VisitNode<unknown, T>; }): { readonly enter: (path: t.NodePath<T>) => void; readonly exit: (path: t.NodePath<T>) => void; };