Browse Source

无JIRA任务 refactor: 修改类型描述

master
youki 4 years ago
parent
commit
3ebc3451fe
  1. 10
      typescript/core/utils/tree.ts

10
typescript/core/utils/tree.ts

@ -14,7 +14,7 @@ export declare class Node {
setParent(parent: Node): void; setParent(parent: Node): void;
getParent(): Node; getParent(): Node;
getChild(index: number): Node; getChild(index: number): Node;
getChildIndex(id: any): Node; getChildIndex(id: any): number;
removeChild(id: any): void; removeChild(id: any): void;
removeChildByIndex(index: number): void; removeChildByIndex(index: number): void;
removeAllChilds(): void; removeAllChilds(): void;
@ -31,9 +31,9 @@ export declare class Tree {
getRoot(): Node; getRoot(): Node;
clear():void; clear():void;
initTree(nodes: any[]):void; initTree(nodes: any[]):void;
toJSON(node: Node): object[]; toJSON<T>(node?: Node): T[];
toJSONWithNode(node: Node): object[]; toJSONWithNode<T>(node: Node): T[];
search(root: Node, target: any, param?: any): boolean; search(root: Node, target?: any, param?: any): Node;
traverse(callback: Function): void; traverse(callback: Function): void;
recursion(callback: Function): void; recursion(callback: Function): void;
inOrderTraverse(callback: Function): void; inOrderTraverse(callback: Function): void;
@ -44,7 +44,7 @@ export declare class Tree {
nrPostOrderTraverse(callback: Function): void; nrPostOrderTraverse(callback: Function): void;
static transformToArrayFormat(nodes: Node | Node[], pId: any): Node[]; static transformToArrayFormat(nodes: Node | Node[], pId: any): Node[];
static arrayFormat(nodes: Node | Node[], pId: any): Node[]; static arrayFormat(nodes: Node | Node[], pId: any): Node[];
static transformToTreeFormat(sNodes: Node | Node[]): Node[]; static transformToTreeFormat<T>(sNodes: T[]): Node[];
static treeFormat(sNodes: Node | Node[]): Node[]; static treeFormat(sNodes: Node | Node[]): Node[];
static traversal(array: Node[], callback: Function, pNode: Node): void; static traversal(array: Node[], callback: Function, pNode: Node): void;
} }
Loading…
Cancel
Save