import type { NixTemplate } from "@deijose/nix-js"; export type IslandComponent = (props: TProps) => NixTemplate | null | false | undefined; export type { IslandDirective } from "./island.js"; /** Lazy island loader in a discriminated form (no probe required to detect). */ export interface IslandLoader { load: () => Promise>; } /** * Island registry entry. Two unambiguous shapes: * - `IslandComponent` (eager component function). * - `IslandLoader` `{ load }` (lazy, code-split loader). * * Legacy async loader functions are also accepted for backwards compatibility * and detected *without invoking them* (via the `AsyncFunction` tag), so no * side effects or duplicate signal creation happen during detection. */ export type IslandRegistryEntry = IslandComponent | IslandLoader | (() => Promise>); export type IslandRegistry = Record>; /** * Wraps a lazy island loader in the discriminated `{ load }` form. */ export declare function lazyIsland(loader: () => Promise>): IslandLoader; /** * Hydrates all islands on the page using the provided registry. * * @param registry Map from island name to component factory. */ /** * Dispose all currently hydrated islands. Called by the client router before * swapping the page body to prevent leaked effects and stale DOM writes. */ export declare function cleanupHydratedIslands(): void; export declare function hydrateIslands(registry: IslandRegistry): void;