UNPKG

@lifeart/gxt

Version:

<img align="right" width="95" height="95" alt="Philosopher’s stone, logo of PostCSS" src="./public/logo.png">

22 lines (21 loc) • 1.22 kB
import { Component } from './component'; import { Root } from './dom'; export declare const RENDERING_CONTEXT: unique symbol; export declare function context(contextKey: symbol): (klass: any, key: string, descriptor?: PropertyDescriptor & { initializer?: () => any; }) => void; export declare function initDOM(ctx: Component<any> | Root): { 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; append(parent: Node | HTMLElement, child: Node | HTMLElement, targetIndex?: number): void; insert(parent: Node | HTMLElement, child: Node | HTMLElement, anchor?: Node | HTMLElement | null | undefined): void; }; export declare function getContext<T>(ctx: Component<any> | Root, key: symbol): T | null; export declare function provideContext<T>(ctx: Component<any> | Root, key: symbol, value: T): void;