UNPKG

marko

Version:

Optimized runtime for Marko templates.

15 lines (14 loc) • 1.32 kB
import { types as t } from "@marko/compiler"; import type { Falsy } from "../../common/types"; export type DOMRuntimeHelpers = keyof typeof import("../../dom"); export type HTMLRuntimeHelpers = keyof typeof import("../../html"); export declare function importRuntime(name: DOMRuntimeHelpers | HTMLRuntimeHelpers): t.Identifier; export declare function registerRuntimeValue(id: string, value: t.Expression): t.AssignmentExpression; export declare function callRuntime(name: DOMRuntimeHelpers | HTMLRuntimeHelpers, ...args: Array<Parameters<typeof t.callExpression>[1][number] | Falsy>): t.CallExpression; export declare function dynamicImport(request: string, ...handlers: Array<t.Expression | Falsy>): t.CallExpression; export declare const domRuntimeFeatures: readonly ["catch", "controllable", "controllable-input", "controllable-open", "controllable-select", "controllable-textarea", "dynamic-tag-script", "dynamic-tag-var", "lazy", "placeholder"]; export type DOMRuntimeFeature = (typeof domRuntimeFeatures)[number]; export declare function importRuntimeFeature(feature: DOMRuntimeFeature): void; export declare function getRuntimeFeatureImport(feature: DOMRuntimeFeature): t.ImportDeclaration; export declare function getRuntimePath(output: string): string; export declare function getCompatRuntimeFile(): string;