/** * Client-side hydration and runtime directive binding. * * @packageDocumentation */ import { Directive } from '../types.js'; /** * Registry of directives by name. */ export type DirectiveRegistry = Map>; export type { ServiceRegistry } from '../resolver-config.js'; /** * Register a directive in the registry. * * @remarks * If called after hydration, scans the DOM for any elements using * this directive and processes them immediately. * * @param registry - The directive registry * @param name - Directive name (without g- prefix) * @param fn - The directive function */ export declare function registerDirective(registry: DirectiveRegistry, name: string, fn: Directive): void; /** * Register a service for dependency injection. * * @param name - Service name (used in $inject arrays) * @param service - The service instance */ export declare function registerService(name: string, service: unknown): void; /** * Initialize the client-side framework. * * @remarks * Processes all existing elements with directive attributes, then * sets up a MutationObserver to handle dynamically added elements. * Works for both SSR hydration and pure client-side rendering. * * @param registry - The directive registry */ export declare function hydrate(root?: Element | Document, registry?: DirectiveRegistry): Promise; /** * Reset hydration state for testing. * * @remarks * Clears cached selector, disconnects observer, and resets initialized flag. * Primarily useful for testing. */ export declare function resetHydration(): void;