diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..954204d --- /dev/null +++ b/index.d.ts @@ -0,0 +1,22 @@ +export interface TreeObject { + [k: string]: TreeValue; +} +export type TreeValue = string | TreeObject; + +export function asTree( + treeObj: TreeObject, + showValues: boolean, + hideFunctions: boolean +): string; + +export function asLines( + treeObj: TreeObject, + showValues: boolean, + lineCallback: (line: string) => void +): string; +export function asLines( + treeObj: TreeObject, + showValues: boolean, + hideFunctions: boolean, + lineCallback: (line: string) => void +): string; diff --git a/package.json b/package.json index 0de9eea..77f8151 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "treeify", + "types": "index.d.ts", "version": "1.1.0", "author": "Luke Plaster ", "description": "converts a JS object into a nice and readable tree structure for the console",