UNPKG

rvx

Version:

A signal based rendering library

150 lines (149 loc) 4.95 kB
import { WINDOW_MARKER } from "./internals.js"; declare const NODE_LENGTH: unique symbol; declare const NODE_APPEND_HTML_TO: unique symbol; export declare class NodeList { #private; constructor(node: Node); get length(): number; forEach(cb: (node: Node, index: number, list: NodeList) => void, thisArg?: unknown): void; [Symbol.iterator](): Iterator<Node>; values(): Iterator<Node>; } export declare function htmlEscapeAppendTo(html: string, data: string): string; export declare class NoopEvent { } export declare class NoopEventTarget { addEventListener(): void; removeEventListener(): void; dispatchEvent(): void; } export declare class Document extends NoopEventTarget { get body(): Element | null; get activeElement(): Element | null; createTextNode(data: string): Text; createComment(data: string): NoopComment; createDocumentFragment(): DocumentFragment; createElementNS(namespaceURI: string, tagName: string): Element; createElement(tagName: string): Element; } export declare class Node extends NoopEventTarget { #private; get parentNode(): Node | null; get firstChild(): Node | null; get lastChild(): Node | null; get previousSibling(): Node | null; get nextSibling(): Node | null; get childNodes(): NodeList; [NODE_LENGTH](): number; [NODE_APPEND_HTML_TO](html: string): string; contains(node: Node | null): boolean; hasChildNodes(): boolean; removeChild(node: Node): Node; appendChild(node: Node): Node; insertBefore(node: Node, ref: Node): Node; replaceChild(node: Node, ref: Node): Node; remove(): void; append(...nodes: (Node | string)[]): void; replaceChildren(...nodes: (Node | string)[]): void; get textContent(): string; get outerHTML(): string; } export interface Node { nodeType: number; nodeName: string; } export declare class DocumentFragment extends Node { } export declare class NoopComment extends Node { #private; constructor(data: string); get textContent(): string; set textContent(data: string); [NODE_APPEND_HTML_TO](html: string): string; } export declare class Text extends Node { #private; constructor(data: string); get textContent(): string; set textContent(data: string); [NODE_APPEND_HTML_TO](html: string): string; } export declare const XMLNS_HTML = 0; export declare const XMLNS_SVG = 1; export declare const XMLNS_MATHML = 2; export type XMLNS = typeof XMLNS_HTML | typeof XMLNS_SVG | typeof XMLNS_MATHML; export declare function resolveNamespaceURI(uri: string): XMLNS; export declare function isVoidTag(xmlns: XMLNS, name: string): boolean; declare const ATTR_CHANGED: unique symbol; interface Attribute { name: string; value: string; stale: boolean; } export declare class ElementClassList { #private; constructor(attrs: Attribute[]); get length(): number; get value(): string; [ATTR_CHANGED](attr: Attribute | null): void; add(...tokens: string[]): void; contains(token: string): boolean; remove(...tokens: string[]): void; replace(oldToken: string, newToken: string): boolean; toggle(token: string, force?: boolean): boolean; values(): IterableIterator<string>; [Symbol.iterator](): IterableIterator<string>; } export declare class ElementStyles { #private; constructor(attrs: Attribute[]); get cssText(): string; [ATTR_CHANGED](attr: Attribute | null): void; setProperty(name: string, value: string, priority?: "" | "important"): void; removeProperty(name: string): string; getPropertyValue(name: string): string; } export declare class Element extends Node { #private; constructor(namespaceURI: string, tagName: string); get tagName(): string; get nodeName(): string; get namespaceURI(): string; get innerHTML(): string; set innerHTML(html: string); get classList(): ElementClassList; get style(): ElementStyles; focus(): void; blur(): void; setAttribute(name: string, value: string): void; removeAttribute(name: string): void; toggleAttribute(name: string, force?: boolean): void; getAttribute(name: string): string | null; hasAttribute(name: string): boolean; [NODE_APPEND_HTML_TO](html: string): string; } export declare class RawHTML extends Node { #private; constructor(html: string); [NODE_APPEND_HTML_TO](html: string): string; } export declare class Window extends NoopEventTarget { window: this; document: Document; } export interface Window { [WINDOW_MARKER]: boolean; Comment: typeof NoopComment; CustomEvent: typeof NoopEvent; Document: typeof Document; DocumentFragment: typeof DocumentFragment; Element: typeof Element; Event: typeof NoopEvent; Node: typeof Node; Text: typeof Text; } /** * A global default rvxdom window instance. */ export declare const WINDOW: Window; export {};