From bf7b74abf3b6635d4371d5655a139d8efdcb8d54 Mon Sep 17 00:00:00 2001 From: vvakame Date: Sun, 22 Feb 2015 23:21:10 +0900 Subject: [PATCH] add archy definitions --- archy/archy-tests.ts | 32 ++++++++++++++++++++++++++++++++ archy/archy.d.ts | 21 +++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 archy/archy-tests.ts create mode 100644 archy/archy.d.ts diff --git a/archy/archy-tests.ts b/archy/archy-tests.ts new file mode 100644 index 000000000..b2f62384f --- /dev/null +++ b/archy/archy-tests.ts @@ -0,0 +1,32 @@ +/// + +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); diff --git a/archy/archy.d.ts b/archy/archy.d.ts new file mode 100644 index 000000000..c7145e628 --- /dev/null +++ b/archy/archy.d.ts @@ -0,0 +1,21 @@ +// Type definitions for archy +// Project: https://github.com/substack/node-archy +// Definitions by: 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; +}