/// interface Node { type: string; } interface Comment extends Node { type: 'comment'; content: string; } export interface Text extends Node { type: 'text'; content: string; } export interface Element extends Node { type: 'element'; tagName: string; children: ChildNode[]; attributes: string[]; } export declare type ChildNode = Comment | Text | Element; export declare enum RichNodeType { ELEMENT = 0, TEXT = 1 } export declare type RichNode = RichElement | RichText; export interface RichElement { nodeType: RichNodeType.ELEMENT; parent?: RichElement; /** * 元素名称, 根据是否为块元素决定,需要特殊渲染的,通过 htmlTagName 自定义组件 */ tagName: string; /** * 元素名称,原始标签 */ htmlTagName: string; /** * 类名 */ className: string; style: React.CSSProperties; /** * 子节点 */ childNodes: RichNode[]; /** * 子元素 */ readonly children: RichElement[]; /** * 其他属性 */ [attribute: string]: any; } export interface RichText { nodeType: RichNodeType.TEXT; parent?: RichElement; /** * 文本内容 */ content: string; } export {}; //# sourceMappingURL=type.d.ts.map