diff --git a/typescript/core/utils/tree.ts b/typescript/core/utils/tree.ts index 7ec4c83b6..3ae195351 100644 --- a/typescript/core/utils/tree.ts +++ b/typescript/core/utils/tree.ts @@ -14,7 +14,7 @@ export declare class Node { setParent(parent: Node): void; getParent(): Node; getChild(index: number): Node; - getChildIndex(id: any): Node; + getChildIndex(id: any): number; removeChild(id: any): void; removeChildByIndex(index: number): void; removeAllChilds(): void; @@ -31,9 +31,9 @@ export declare class Tree { getRoot(): Node; clear():void; initTree(nodes: any[]):void; - toJSON(node: Node): object[]; - toJSONWithNode(node: Node): object[]; - search(root: Node, target: any, param?: any): boolean; + toJSON(node?: Node): T[]; + toJSONWithNode(node: Node): T[]; + search(root: Node, target?: any, param?: any): Node; traverse(callback: Function): void; recursion(callback: Function): void; inOrderTraverse(callback: Function): void; @@ -44,7 +44,7 @@ export declare class Tree { nrPostOrderTraverse(callback: Function): void; static transformToArrayFormat(nodes: Node | Node[], pId: any): Node[]; static arrayFormat(nodes: Node | Node[], pId: any): Node[]; - static transformToTreeFormat(sNodes: Node | Node[]): Node[]; + static transformToTreeFormat(sNodes: T[]): Node[]; static treeFormat(sNodes: Node | Node[]): Node[]; static traversal(array: Node[], callback: Function, pNode: Node): void; } \ No newline at end of file