Import Anubis v1.28.2
Replace the tree with upstream TecharoHQ/anubis v1.28.2 (a1384fbf42e3). Masyunis customizations are re-applied in the following commits.
This commit is contained in:
1 parent
eb3e46d8d0
commit
e07de898cd
573 files changed
+35846
-6807
No files matched your search
@@ -0,0 +1,92 @@
|
||||
// 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<K extends keyof HTMLElementTagNameMap>(
|
||||
name: K,
|
||||
data?: Partial<HTMLElementTagNameMap[K]>,
|
||||
children?: Children,
|
||||
): HTMLElementTagNameMap[K];
|
||||
export function h<P extends object, R extends Node>(
|
||||
name: (data: P) => R,
|
||||
data?: P,
|
||||
children?: Children,
|
||||
): R;
|
||||
export function h(
|
||||
name: string,
|
||||
data?: Partial<HTMLElement>,
|
||||
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<Element>;
|
||||
|
||||
/**
|
||||
* Get all elements with the given name attribute. Equivalent to
|
||||
* `document.getElementsByName(name)`.
|
||||
*/
|
||||
export function n(name: string): NodeListOf<HTMLElement>;
|
||||
|
||||
/**
|
||||
* 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, string>): 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<T>(value: T): [() => T, (value: T) => void];
|
||||
export function useState<T = undefined>(): [
|
||||
() => 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;
|
||||
Reference in new issue
Block a user