Added type definitions for module custom-error-generator

This commit is contained in:
thmiceli
2015-04-15 17:08:43 -07:00
parent 1957eb54fb
commit a496cd76cc
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
/// <reference path="./custom-error-generator.d.ts" />
import createCustomError = require('custom-error-generator');
var HTTPError = createCustomError('HTTPError', { 'code' : 500, 'status' : 'Server Error' });
var error = new HTTPError('Uh oh');
console.log(error.code, error.status);

View File

@@ -0,0 +1,11 @@
// Type definitions for custom-error-generator 7.0.0
// Project: https://github.com/jproulx/node-custom-error
// Definitions by: Thierry Miceli <https://github.com/thmiceli>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "custom-error-generator" {
function createError(name: string, parameters?: Object, Constructor?: any): any;
module createError {
}
export = createError;
}