import Muya from '../../index'; import type { TState } from '../../state/types'; import { Nullable } from '../../types'; import type { Attributes, Datasets } from '../../utils/types'; import Content from './content'; import type { LinkedNode } from './linkedList/linkedNode'; import Parent from './parent'; interface IConstructor { blockName: string; create: (muya: Muya, state: TState) => T; new (muya: Muya): T; } declare class TreeNode implements LinkedNode { muya: Muya; prev: Nullable; next: Nullable; parent: Nullable; domNode: Nullable; tagName: string; classList: string[]; attributes: Attributes; datasets: Datasets; static blockName: string; get static(): IConstructor; get blockName(): string; get jsonState(): import("../../state").default; get scrollPage(): Nullable; get isScrollPage(): boolean; get isOutMostBlock(): boolean; get outMostBlock(): Nullable; constructor(muya: Muya); /** * check this is a Content block? * @param this * @returns boolean */ isContent(this: TreeNode): this is Content; /** * check this is a Parent block? * @param this * @returns boolean */ isParent(this: unknown): this is Parent; /** * create domNode */ createDomNode(): void; previousContentInContext(): Nullable; nextContentInContext(): Nullable; /** * Weather `this` is the only child of its parent. */ isOnlyChild(): boolean; /** * Weather `this` is the first child of its parent. */ isFirstChild(): boolean; /** * Weather `this` is the last child of its parent. */ isLastChild(): boolean; /** * Weather `this` is descendant of `block` * @param {*} block */ isInBlock(block: Parent): boolean; /** * Find the closest block which blockName is `blockName`. return `null` if not found. * @param {string} blockName */ closestBlock(blockName: string): TreeNode | null; farthestBlock(blockName: string): TreeNode | null; insertInto(parent: Parent, refBlock?: Nullable): void; /** * Remove the current block in the block tree. */ remove(_source?: string): this | undefined; } export default TreeNode;