// Type declarations for xeact.mjs, which is vendored as plain JavaScript with // JSDoc annotations. TypeScript resolves `import ... from "./xeact.mjs"` to // this file, so keep the two in sync when updating xeact. // // This file was generated by Claude Opus 5. import { jsx } from "preact/jsx-runtime"; type Child = Node | string; type Children = Child | Child[]; /** * Creates a DOM element, assigns the properties of `data` to it, and appends * all `children`. */ export function h( name: K, data?: Partial, children?: Children, ): HTMLElementTagNameMap[K]; export function h

( name: (data: P) => R, data?: P, children?: Children, ): R; export function h( name: string, data?: Partial, children?: Children, ): HTMLElement; /** Create a text node. Equivalent to `document.createTextNode(text)`. */ export function t(text: string): Text; /** Remove all child nodes from a DOM element. */ export function x(elem: Node): void; /** * Get the element with the given ID. Equivalent to * `document.getElementById(name)`, and like it returns `null` when no element * matches. */ export function g(name: string): HTMLElement | null; /** * Get all elements with the given class name. Equivalent to * `document.getElementsByClassName(name)`. */ export function c(name: string): HTMLCollectionOf; /** * Get all elements with the given name attribute. Equivalent to * `document.getElementsByName(name)`. */ export function n(name: string): NodeListOf; /** * Get all elements matching the given selector via * `document.querySelectorAll(selector)`. */ export function s(selector: string): HTMLElement[]; /** * Generate a relative URL from `url`, appending all key-value pairs from * `params` as URL-encoded parameters. */ export function u(url?: string, params?: Record): string; /** * Takes a callback to run when all DOM content is loaded. Equivalent to * `window.addEventListener("DOMContentLoaded", callback)`. */ export function r(callback: () => void): void; /** * Allows a stateful value to be tracked by consumers. This is the Xeact * version of the React useState hook. */ export function useState(value: T): [() => T, (value: T) => void]; export function useState(): [ () => T | undefined, (value: T | undefined) => void, ]; /** Debounce an action for up to `ms` milliseconds. */ export function d(ms: number): (f: () => void) => void; /** * Parse a given element as JSON and return it as a bare * object. */ export function j(id: string): any | null;