marko
Version:
Optimized runtime for Marko templates.
38 lines (37 loc) • 1.85 kB
TypeScript
import { writeLoadAsset } from "./assets";
import { _await } from "./control-flow";
import { register } from "./serializer";
import type { ServerRenderer } from "./template";
import { _html, _peek_scope_id, _scope_id, $global, Chunk, getChunk, isInResumedBranch, State, withChunk, writeScript } from "./writer";
export declare const compat: {
$global: typeof $global;
writeLoadAsset: typeof writeLoadAsset;
fork: typeof _await;
write: typeof _html;
writeScript: typeof writeScript;
nextScopeId: typeof _scope_id;
peekNextScopeId: typeof _peek_scope_id;
isInResumedBranch: typeof isInResumedBranch;
withChunk: typeof withChunk;
getChunk: typeof getChunk;
ensureState($global: any): State;
isTagsAPI(fn: any): boolean;
onFlush(fn: (chunk: Chunk) => void): void;
patchDynamicTag: (patch: (tag: unknown, scopeId: number, accessor: import("../common/types").Accessor) => unknown) => void;
writeSetScopeForComponent(branchId: number, m5c: string, m5i: unknown): void;
toJSON(): (this: WeakKey) => [registryId: string, scopeId: unknown] | undefined;
joinChunks(chunks: Chunk[]): Chunk | undefined;
appendChunks(chunks: Chunk[]): void;
deferReorders(reorders: Chunk[]): void;
createChunk($global: any): Chunk;
flushScript(chunk: Chunk, reorders?: Chunk[]): {
html: string;
scripts: string;
};
render(renderer: ServerRenderer, willRerender: boolean, classAPIOut: any, component: any, input: any, componentScopes: Chunk[], registerChildScope?: boolean, parentChunk?: Chunk): void;
register: typeof register;
registerRenderBody(fn: any): void;
registerClassFunctions(input: any): void;
registerClassFunction<T extends WeakKey>($global: object, id: string, fn: T, hostId: string): T;
hasPendingClassFunctions($global: object): boolean;
};