import type { NodeSchema } from '../../types';
import type { Document } from '../document';
import type { PropValue, PropsMap } from '../prop/prop';
import { type SettingTopEntry } from '../..';
import { TRANSFORM_STAGE } from '../../types';
import { Props } from '../prop/props';
import { NodeChildren } from './node-children';
export declare enum NODE_EVENT {
    ADD = "node:add",
    REMOVE = "node:remove",
    VISIBLE_CHANGE = "node:visible.change",
    LOCK_CHANGE = "node:lock.change",
    PROP_CHANGE = "node:prop.change"
}
export declare class Node<Schema extends NodeSchema = NodeSchema> {
    readonly document: Document;
    protected emitter: import("../..").EventBus;
    readonly isNode = true;
    readonly id: string;
    readonly componentName: string;
    protected _children: NodeChildren | null;
    private accessor _parent;
    get parent(): Node<NodeSchema> | null;
    get children(): NodeChildren | null;
    get childrenNodes(): Node<NodeSchema>[];
    /**
     * if the node is the root node or not linked, return -1
     */
    get index(): number;
    /**
     * z-index level of this node
     */
    get zLevel(): number;
    get title(): string;
    get icon(): string | undefined;
    private purged;
    /**
     * 是否已销毁
     */
    get isPurged(): boolean;
    props: Props;
    _settingEntry: SettingTopEntry;
    get settingEntry(): SettingTopEntry;
    constructor(document: Document, Schema: Schema);
    import(data: Schema, checkId?: boolean): void;
    export<T = NodeSchema>(stage?: TRANSFORM_STAGE): T;
    purge(): void;
    toData(): NodeSchema;
    /**
     * get node schema
     */
    get schema(): Schema;
    set schema(data: Schema);
    initBuiltinProps(): void;
    private initProps;
    private upgradeProps;
    /**
     * relate to componentMeta.advanced.initialChildren
     */
    private initialChildren;
    /**
     * link to componentMeta.advanced.callbacks.onNodeAdd
     */
    didDropIn(dragNode: Node): void;
    /**
     * link to componentMeta.advanced.callbacks.onNodeRemove
     */
    didDropOut(dragNode: Node): void;
    /**
     * link to componentMeta.advanced.callbacks.onSelectHook
     */
    canSelect(): boolean;
    /**
     * link to componentMeta.advanced.callbacks.onClickHook
     */
    canClick(e: MouseEvent): any;
    select(): void;
    hover(flag?: boolean): void;
    getChildren(): NodeChildren | null;
    getComponentName(): string;
    getParent(): Node<NodeSchema> | null;
    getId(): string;
    getIndex(): number;
    getNode(): this;
    getRoot(): Node<NodeSchema> | null;
    getProps(): Props;
    get isContainer(): boolean;
    get isRoot(): boolean;
    /**
     * whether child nodes are included
     */
    get isParental(): boolean;
    /**
     * whether this node is a leaf node
     */
    get isLeaf(): boolean;
    toString(): string;
    hide(flag?: boolean): void;
    get hidden(): boolean;
    get isHidden(): boolean;
    lock(flag?: boolean): void;
    get locked(): boolean;
    get isLocked(): boolean;
    hasCondition(): boolean;
    /**
     * has loop when 1. loop is validArray with length > 1 ; OR  2. loop is variable object
     * @return boolean, has loop config or not
     */
    hasLoop(): boolean;
    getProp(path: string, createIfNone?: boolean): import("..").Prop | null;
    getExtraProp(key: string, createIfNone?: boolean): import("..").Prop | null;
    setExtraProp(key: string, value: PropValue): void;
    getPropValue(path: string): unknown;
    setPropValue(path: string, value: PropValue): void;
    getExtraPropValue(key: string): unknown;
    setExtraPropValue(key: string, value: PropValue): void;
    clearPropValue(path: string): void;
    mergeProps(props: PropsMap): void;
    setProps(props?: PropsMap | Props | null): void;
    internalSetParent(parent: Node | null, useMutator?: boolean): void;
    internalUnlinkParent(): void;
    /**
     * unlink this node from its parent and document
     */
    unlink(): void;
    /**
     * migrate this node to a new parent
     */
    migrate(newParent: Node): void;
    /**
     * if the node is linked in the document tree
     */
    get isLinked(): boolean;
    /**
     * insert a node at a specific position or a reference node
     */
    insert(node: Node, ref?: Node | number, useMutator?: boolean): void;
    /**
     * insert a node before a reference node(in current node's children)
     */
    insertBefore(node: Node, ref?: Node, useMutator?: boolean): void;
    /**
     * insert a node after a reference node(in current node's children)
     */
    insertAfter(node: Node, ref?: Node, useMutator?: boolean): void;
    remove(purge?: boolean, useMutator?: boolean): void;
    removeChild(node: Node): void;
    isValidComponent(): boolean;
    get componentMeta(): import("../..").ComponentMeta;
    get propsData(): PropsMap | null;
    getRect(): DOMRect | null;
    getDOMNode(): any;
    /**
     * use schema to update this node
     */
    wrapWith(schema: Schema): Node<NodeSchema> | null | undefined;
    /**
     * replace this node with a new node
     */
    replaceWith(schema: Schema, migrate?: boolean): Node<NodeSchema> | null | undefined;
    /**
     * replace a child node with a new node
     */
    replaceChild(node: Node, data: Schema): Node | null;
    /**
     * check if this node contains another node
     */
    contains(node: Node): boolean;
    /**
     * get the parent node at a specific depth
     */
    getZLevelTop(zLevel: number): Node<NodeSchema> | null;
    /**
     * compare the position of this node and another node
     *
     *  - 16 thisNode contains otherNode
     *  - 8  thisNode contained_by otherNode
     *  - 2  thisNode before or after otherNode
     *  - 0  thisNode same as otherNode
     */
    comparePosition(otherNode: Node): PositionNO;
    /**
     * get next sibling node
     */
    get nextSibling(): Node | null | undefined;
    /**
     * get previous sibling node
     */
    get prevSibling(): Node | null | undefined;
    mergeChildren(remover: (node: Node, idx: number) => any, adder: (children: Node[]) => Schema[] | null, sorter: (firstNode: Node, secondNode: Node) => any): void;
    onVisibleChange(listener: (flag: boolean) => void): () => void;
    onLockChange(listener: (flag: boolean) => void): () => void;
    onChildrenChange(listener: (info?: {
        type: string;
        node: Node;
    }) => void): (() => void) | undefined;
    emitPropChange(prop: any): void;
    onPropChange(listener: (info: any) => void): () => void;
}
export declare const isNode: (node: any) => node is Node;
export declare const isNodeSchema: (data: any) => data is NodeSchema;
/**
 * get the top node of the same zLevel
 */
export declare const getZLevelTop: (child: Node, zLevel: number) => Node | null;
/**
 * check if node1 contains node2
 */
export declare const contains: (node1: Node, node2: Node) => boolean;
export declare enum PositionNO {
    Contains = 16,
    ContainedBy = 8,
    BeforeOrAfter = 2,
    TheSame = 0
}
/**
 * compare the position of two nodes
 */
export declare const comparePosition: (node1: Node, node2: Node) => PositionNO;
export declare const insertChild: (container: Node, thing: Node | NodeSchema, at?: number | null, copy?: boolean) => Node | null;
export declare const insertChildren: (container: Node, nodes: Node[] | NodeSchema[], at?: number | null, copy?: boolean) => Node[];
/**
 * get the closest node that satisfies the condition
 */
export declare const getClosestNode: (node: Node | null, until: (n: Node) => boolean) => Node | undefined;
/**
 * get the closest clickable node
 */
export declare const getClosestClickableNode: (currentNode: Node | undefined | null, event: MouseEvent) => Node<NodeSchema> | null | undefined;
/**
 * ensure the node is a Node instance
 */
export declare const ensureNode: (node: any, document: Document) => Node;
