import { StringOrNumber } from "../types"; import { BaseTreeNode } from "./types"; /** * Find the TreeNode in the Tree by the special `key` * * @param TreeData * @param targetKey * @returns The first node found */ export declare const findNodeById: (treeData: T[], targetKey: StringOrNumber, options?: { idFieldName?: string; childrenFieldName?: string; }) => T | null; /** * Remove the TreeNode in the Tree by the special `key` */ export declare const deleteNodeById: (treeData: T[], targetId: StringOrNumber, options?: { idFieldName?: string; childrenFieldName?: string; }) => T[] | undefined; /** * Add the TreeNode into Found position in the Tree. * * @param position 0 means added node before the children, 1 means after */ export declare const addChildNodeById: (treeData: T[], targetId: StringOrNumber, sourceNode: T, position?: 0 | 1) => void; /** * Add the tree children for Found TreeNode in the Tree. */ export declare const addChildrenById: (treeData: T[], targetId: StringOrNumber, children: T[]) => void; /** * insert TreeNode into the before of after of the Found TreeNode. * * @param position 0 means added node before the found TreeNode, 1 means after */ export declare const insertNodeById: (treeData: T[], targetId: StringOrNumber, sourceNode: T, position: 0 | 1, options?: { idFieldName?: string; childrenFieldName?: string; }) => void; //# sourceMappingURL=crud.d.ts.map