import { Slot } from './slot'; import { Component } from './component'; import { Decorator } from './decorator'; /** * Textbus 虚拟 DOM 文本节点 */ export declare class VTextNode { textContent: string; location: NodeLocation | null; constructor(textContent?: string); } export interface VElementListeners { [listenKey: string]: (ev: T) => any; } export type VChildNode = VElement | VTextNode | Component | Decorator | string | number | boolean | null | undefined; /** * 虚拟 DOM 节点在数据内的范围 */ export interface NodeLocation { startIndex: number; endIndex: number; slot: Slot; } export declare function createVNode(tagName: string, attrs?: Record | null, children?: VChildNode[]): VElement; /** * Textbus 虚拟 DOM 元素节点 */ export declare class VElement { tagName: string; children: Array; location: NodeLocation | null; readonly attrs: Map; readonly styles: Map; readonly classes: Set; readonly listeners: VElementListeners; constructor(tagName: string, attrs?: Record | null, children?: VChildNode[]); /** * 在最后位置添加一个子节点。 * @param newNodes */ appendChild(...newNodes: Array): void; }