@lifeart/gxt
Version:
<img align="right" width="95" height="95" alt="Philosopher’s stone, logo of PostCSS" src="./public/logo.png">
37 lines (36 loc) • 1.74 kB
TypeScript
type VoidFn = () => void;
export declare abstract class DOMApi {
abstract toString(): string;
abstract parent(node: Node): Node | null;
abstract isNode(node: Node): node is Node;
abstract addEventListener(node: Node, eventName: string, fn: EventListener): undefined | VoidFn;
abstract attr(element: Node, name: string, value: string | null): void;
abstract prop(element: Node, name: string, value: any): void;
abstract comment(text?: string): Comment;
abstract text(text: string | number): Node;
abstract textContent(node: Node, text: string): void;
abstract fragment(): DocumentFragment;
abstract element(tagName: string): Node;
abstract insert(parent: HTMLElement | Node, child: HTMLElement | Node, anchor?: HTMLElement | Node | null): void;
abstract destroy(element: Node): void;
abstract clearChildren(element: Node): void;
}
export declare class HTMLBrowserDOMApi implements DOMApi {
doc: Document;
constructor(document: Document);
parent(node: Node): ParentNode | null;
isNode(node: Node): node is Node;
destroy(node: Node): void;
clearChildren(element: Node): void;
toString(): string;
addEventListener(node: Node, eventName: string, fn: EventListener): (() => void) | undefined;
attr(element: HTMLElement, name: string, value: string | null): void;
prop(element: HTMLElement, name: string, value: any): any;
comment(text?: string): Comment;
text(text?: string | number): Text;
textContent(node: Node, text: string): void;
fragment(): DocumentFragment;
element(tagName?: string): HTMLElement;
insert(parent: HTMLElement | Node, child: HTMLElement | Node, anchor?: HTMLElement | Node | null): void;
}
export {};