//#region packages/blocks-interactive/src/types.d.ts /** Cleanup function returned by hydration — call to remove all listeners. */ type Cleanup = () => void; /** Options for hydration. */ interface HydrateOptions { /** Callback for action events (button clicks, select changes). */ onAction?: (actionId: string, value?: string) => void; /** Container to scope hydration to (default: document.body). */ container?: Element; } //#endregion //#region packages/blocks-interactive/src/hydrate.d.ts /** * Hydrate all interactive blocks within a container. */ declare function hydrate(options?: HydrateOptions): Cleanup; /** * Hydrate only the interactive islands present in the DOM. */ declare function hydrateAsync(options?: HydrateOptions): Promise; //#endregion //#region packages/blocks-interactive/src/island-registry.d.ts interface LoadedIsland { hydrate: (element: Element, options?: HydrateOptions) => Cleanup; } interface IslandDefinition { selector: string; matches?: (element: Element, options?: HydrateOptions) => boolean; load: () => Promise; } declare const ISLAND_REGISTRY: IslandDefinition[]; //#endregion //#region packages/blocks-interactive/src/islands/actions.d.ts /** * Hydrate action buttons, selects, text-submits, and form-submits inside an actions block. */ declare function hydrateActions(container: Element, onAction: (id: string, value?: string) => void): Cleanup; //#endregion //#region packages/blocks-interactive/src/islands/table.d.ts /** * Hydrate a blocks-core table with client-side sorting and filtering. */ declare function hydrateTable(table: Element): Cleanup; //#endregion //#region packages/blocks-interactive/src/islands/tree.d.ts /** * Hydrate a blocks-core tree with toggle-all controls and keyboard navigation. */ declare function hydrateTree(tree: Element): Cleanup; //#endregion export { type Cleanup, type HydrateOptions, ISLAND_REGISTRY, type IslandDefinition, type LoadedIsland, hydrate, hydrateActions, hydrateAsync, hydrateTable, hydrateTree };