/** * Template directive for rendering reusable templates. * * @remarks * Saves the element's children for slot transclusion, * fetches and renders the template, and sets up context * for nested slots to access the saved content. * * @packageDocumentation */ import { Directive } from '../types.js'; import { EffectScope } from '../reactivity.js'; import { ContextKey } from '../context-registry.js'; /** * Saved slot content for an element. */ export interface SlotContent { /** Content by slot name. 'default' for unnamed content. */ slots: Map; } /** * Context key for slot content. * * @remarks * Templates register their slot content using this context, and * slot directives resolve it to find their content. */ export declare const SlotContentContext: ContextKey; /** * Get saved slot content for an element. * * @internal */ export declare function getSavedContent(el: Element): SlotContent | undefined; /** * Find the nearest ancestor with saved content (the template element). * * @internal */ export declare function findTemplateAncestor(el: Element): Element | null; /** * Template directive for rendering reusable templates. * * @remarks * Fetches a template by name and replaces the element's content. * Children are saved for slot transclusion before replacement. * * @example * ```html *
* Title *

Body content

*
* ``` */ export declare const template: Directive<['$expr', '$element', '$templates']>; /** * Get the effect scope for an element. * * @internal */ export declare function getEffectScope(el: Element): EffectScope | undefined;