/** * DOM tree indexing for server-side directive discovery. * * @packageDocumentation */ import { Expression, Directive } from '../types.js'; import { ContextKey } from '../context-registry.js'; import type { DirectiveRegistry } from './render.js'; /** * An indexed directive instance found in the DOM. * * @internal */ export interface IndexedDirective { el: Element; name: string; directive: Directive | null; expr: Expression; priority: number; isNativeSlot?: boolean; isCustomElement?: boolean; using?: ContextKey[]; } /** * Build a CSS selector for all registered directives. * Uses the global directive registry to support any prefix (g-, l-, v-, etc.). * Also includes local registry entries with g- prefix for backward compatibility. * * @internal */ export declare function getSelector(localRegistry?: DirectiveRegistry): string; /** * Index all directive elements in a subtree. * Discovers elements matching the selector and builds an ordered list * of directives to process. * * @param root - The DOM subtree root to scan * @param selector - CSS selector matching directive elements * @param registry - Local directive registry for backward compatibility * @param index - Accumulator for discovered directives (mutated in place) * @param indexed - Set tracking already-indexed elements (mutated in place) * * @internal */ export declare function indexTree(root: any, selector: string, registry: DirectiveRegistry, index: IndexedDirective[], indexed: Set): void;