mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #3710 from borisyankov/add-archy
add archy definitions
This commit is contained in:
@@ -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);
|
||||
Vendored
+21
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user