mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #4125 from thmiceli/custom-error-generator
Added type definitions for module custom-error-generator
This commit is contained in:
@@ -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);
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user