add archy definitions

This commit is contained in:
vvakame
2015-02-22 23:21:10 +09:00
parent 8e85bba87a
commit bf7b74abf3
2 changed files with 53 additions and 0 deletions
+32
View File
@@ -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
View File
@@ -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[];
}
interface Options {
unicode?: boolean;
}
}
export = archy;
}