Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#3710 from borisyankov/add-archy
Browse files Browse the repository at this point in the history
add archy definitions
  • Loading branch information
vvakame committed Feb 22, 2015
2 parents 8e85bba + b3def0f commit 2272849
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
32 changes: 32 additions & 0 deletions archy/archy-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/// <reference path="./archy.d.ts" />

import archy = require("archy");

var opts: archy.Options = {
};

var data: archy.Data = {
label: 'beep',
nodes: [
'ity',
{
label: 'boop',
nodes: [
{
label: 'o_O',
nodes: [
{
label: 'oh',
nodes: ['hello', 'puny']
},
'human'
]
},
'party\ntime!'
]
}
]
};

var str = archy(data);
console.log(str);
21 changes: 21 additions & 0 deletions archy/archy.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Type definitions for archy
// Project: https://github.com/substack/node-archy
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

declare module "archy" {
function archy(obj: archy.Data, prefix?: string, opts?: archy.Options): string;
function archy(obj: string, prefix?: string, opts?: archy.Options): string;

module archy {
interface Data {
label: string;
nodes?: (Data | string)[];
}
interface Options {
unicode?: boolean;
}
}

export = archy;
}

0 comments on commit 2272849

Please sign in to comment.