From 3ebc3451fe261808ac01f295462658b957cafa75 Mon Sep 17 00:00:00 2001 From: youki Date: Mon, 4 Jan 2021 14:49:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20refactor:=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B1=BB=E5=9E=8B=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/core/utils/tree.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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