marko
Version:
Optimized runtime for Marko templates.
26 lines (25 loc) • 1.2 kB
TypeScript
import type { Boundary } from "./writer";
export declare const K_SCOPE_ID: unique symbol;
export type ScopeFlush = [scopeId: number, scope: object, props: object];
export interface SerializeChannel {
readyId?: string;
parent?: SerializeChannel;
}
export declare function setDebugInfo(obj: WeakKey, file: string, loc: string | 0, vars?: Record<string, string>): void;
export declare class Serializer {
#private;
pending(channel?: SerializeChannel): boolean;
pendingReadyChannel(): SerializeChannel | undefined;
stringifyScopes(flushes: ScopeFlush[], boundary: Boundary, channel?: SerializeChannel): string;
written(val: WeakKey): boolean;
takeChannelDeps(): Set<string> | null;
writeCall(value: unknown, object: unknown, property: string, channel?: SerializeChannel): void;
}
export declare function register<T extends WeakKey>(id: string, val: T, scope?: unknown): T;
export declare function getRegistered(val: WeakKey): {
id: string;
scope: unknown;
} | undefined;
export declare function toObjectKey(name: string): string;
export declare function toAccess(accessor: string): string;
export declare function quote(str: string, startPos: number): string;