mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Added type definitions for module custom-error-generator
This commit is contained in:
6
custom-error-generator/custom-error-generator-test.ts
Normal file
6
custom-error-generator/custom-error-generator-test.ts
Normal 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);
|
||||
11
custom-error-generator/custom-error-generator.d.ts
vendored
Normal file
11
custom-error-generator/custom-error-generator.d.ts
vendored
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user