Skip to content

Commit

Permalink
fix(tree): add type declaration (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinggg authored Aug 3, 2021
1 parent d981f1f commit aeb95f9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,17 @@ declare namespace BlessedContrib {
}


export interface TreeNode {
name?: string,
children?: TreeChildren | ((node: TreeNode) => TreeChildren | Promise<TreeChildren>),
childrenContent?: TreeChildren,
extended?: boolean,
parent?: TreeNode,
[custom: string]: any
}

export type TreeChildren = Record<string, TreeNode>

export interface TreeOptions extends BoxOptions {
data?: any
extended?: boolean
Expand All @@ -430,6 +441,8 @@ declare namespace BlessedContrib {
data: any

options: TreeOptions;

setData(data: TreeNode): void
}


Expand Down

0 comments on commit aeb95f9

Please sign in to comment.