From d45e918d66d3e90eb3758462fc7e3a0d6f0b7a15 Mon Sep 17 00:00:00 2001 From: Alan Date: Sun, 6 Apr 2014 02:43:49 -0400 Subject: [PATCH] Fixed express definition and added asciify definitions. --- asciify/asciify-tests.ts | 9 +++++++++ asciify/asciify.d.ts | 29 +++++++++++++++++++++++++++++ asciify/asciify.ts.tscparams | 1 + express/express.d.ts | 2 +- 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 asciify/asciify-tests.ts create mode 100644 asciify/asciify.d.ts create mode 100644 asciify/asciify.ts.tscparams diff --git a/asciify/asciify-tests.ts b/asciify/asciify-tests.ts new file mode 100644 index 000000000..c95b9c699 --- /dev/null +++ b/asciify/asciify-tests.ts @@ -0,0 +1,9 @@ +/// + +import asciify = require('asciify'); + +asciify('Whoa', function(err, result){console.log(result)}); +asciify('Whoa', '3-d', function(err, result){console.log(result)}); +asciify('Whoa', {font:'3-d'}, function(err, result){console.log(result)}); + +asciify.getFonts(function(err, fonts) { fonts.slice(0); }); \ No newline at end of file diff --git a/asciify/asciify.d.ts b/asciify/asciify.d.ts new file mode 100644 index 000000000..4dc47cd3a --- /dev/null +++ b/asciify/asciify.d.ts @@ -0,0 +1,29 @@ +// Type definitions for asciify 1.3.5 +// Project: https://www.npmjs.org/package/asciify +// Definitions by: Alan Norbauer http://alan.norbauer.com +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface AsciifyOptions { + font?: string; + maxWidth?: number; + color?: string; +} + +interface AsciifyCallback { + // err is sometimes a string and sometimes an Error + (err: any, asciifiedText: string): void +} + +declare module "asciify" { + function asciify(text: string, callback: AsciifyCallback): void; + function asciify(text: string, options: string, callback: AsciifyCallback): void; + function asciify(text: string, options: AsciifyOptions, callback: AsciifyCallback): void; + + module asciify { + function getFonts(callback: (err: Error, fonts: string[]) => void): void; + } + + export = asciify +} \ No newline at end of file diff --git a/asciify/asciify.ts.tscparams b/asciify/asciify.ts.tscparams new file mode 100644 index 000000000..64dbb84a5 --- /dev/null +++ b/asciify/asciify.ts.tscparams @@ -0,0 +1 @@ +"--noImplicitAny --module commonjs" \ No newline at end of file diff --git a/express/express.d.ts b/express/express.d.ts index 7dd170629..96cda8e8b 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -258,7 +258,7 @@ declare module "express" { header(name: string): string; - headers: string[]; + headers: { [key: string]: string; }; /** * Check if the given `type(s)` is acceptable, returning