Fixed express definition and added asciify definitions.

This commit is contained in:
Alan
2014-04-06 02:43:49 -04:00
parent 0695415aa4
commit d45e918d66
4 changed files with 40 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
/// <reference path="./asciify.d.ts" />
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); });
+29
View File
@@ -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
/// <reference path="../node/node.d.ts" />
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
}
+1
View File
@@ -0,0 +1 @@
"--noImplicitAny --module commonjs"
+1 -1
View File
@@ -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