File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ /// <reference path="./archy.d.ts" />
2
+
3
+ import archy = require( "archy" ) ;
4
+
5
+ var opts : archy . Options = {
6
+ } ;
7
+
8
+ var data : archy . Data = {
9
+ label : 'beep' ,
10
+ nodes : [
11
+ 'ity' ,
12
+ {
13
+ label : 'boop' ,
14
+ nodes : [
15
+ {
16
+ label : 'o_O' ,
17
+ nodes : [
18
+ {
19
+ label : 'oh' ,
20
+ nodes : [ 'hello' , 'puny' ]
21
+ } ,
22
+ 'human'
23
+ ]
24
+ } ,
25
+ 'party\ntime!'
26
+ ]
27
+ }
28
+ ]
29
+ } ;
30
+
31
+ var str = archy ( data ) ;
32
+ console . log ( str ) ;
Original file line number Diff line number Diff line change
1
+ // Type definitions for archy
2
+ // Project: https://github.com/substack/node-archy
3
+ // Definitions by: vvakame <https://github.com/vvakame/>
4
+ // Definitions: https://github.com/borisyankov/DefinitelyTyped
5
+
6
+ declare module "archy" {
7
+ function archy ( obj : archy . Data , prefix ?: string , opts ?: archy . Options ) : string ;
8
+ function archy ( obj : string , prefix ?: string , opts ?: archy . Options ) : string ;
9
+
10
+ module archy {
11
+ interface Data {
12
+ label : string ;
13
+ nodes ?: ( Data | string ) [ ] ;
14
+ }
15
+ interface Options {
16
+ unicode ?: boolean ;
17
+ }
18
+ }
19
+
20
+ export = archy ;
21
+ }
You can’t perform that action at this time.
0 commit comments