import { Node , RedBlackTree } from "../pageModel" ; import { Style } from "../../editor/render" ; export interface KeyValueStr { [ key ] : string ; } export enum TagType { EndTag = "EndTag" , StartEndTag = "StartEndTag" , StartTag = "StartTag" } export function isStructureNode ( node ) { return ( node as StructureNode ) . leftSubTreeLength !== undefined ; } export function isStructureRedBlackTree ( tree ) { return isStructureNode ( tree . nodes [ 0 ] ) ; } export interface StructureNode extends Node { attributes ? : KeyValueStr ; id : string ; leftSubTreeLength : number ; length : number ; style ? : Style ; tag : keyof HTMLElementTagNameMap ; tagType : TagType ; }