Import
import { TemplateContext } from "@typed/template";Signatures
export type TemplateContext<R = never> = {
readonly document: Document;
readonly renderQueue: RQ.RenderQueue;
readonly disposables: Set<Disposable>;
readonly eventSource: EventSource;
readonly refCounter: IndexRefCounter;
readonly scope: Scope.Closeable;
readonly eventScope: Scope.Scope;
readonly disposeEventHandlers: boolean;
readonly values: ArrayLike<Renderable<unknown, any, any>>;
readonly services: Context.Context<R | Scope.Scope>;
readonly onCause: (cause: Cause.Cause<any>) => Effect.Effect<unknown>;
readonly hydrateContext: HydrateContext | undefined;
};Why
The context gathers explicit Effect services, a forked child Scope, delegated native events, queue policy, ref coordination, and optional hydration state without relying on a hidden component tree.
Ownership and lifetime
The child scope owns one-shot render setup. The surrounding eventScope
owns mounted dynamic parts, handler fibers, queued callbacks, and ref
finalizers until the rendered range is unmounted. Replaceable parts create
their own child event Scope so replacement disposes only that part.
Examples
import type { TemplateContext } from "@typed/template/Render"
declare const context: TemplateContext
context.renderQueueOther public imports
These import paths expose the same declaration. Each page retains its own public name and signature.
Source
packages/template/src/Render.ts:1181packages/template/src/Render.ts:1184packages/template/src/Render.ts:1189packages/template/src/Render.ts:1182packages/template/src/Render.ts:1188packages/template/src/Render.ts:1185packages/template/src/Render.ts:1203packages/template/src/Render.ts:1192packages/template/src/Render.ts:1186packages/template/src/Render.ts:1183packages/template/src/Render.ts:1187packages/template/src/Render.ts:1191packages/template/src/Render.ts:1190