Skip to content

Commit

Permalink
Closes gulpjs#10
Browse files Browse the repository at this point in the history
  • Loading branch information
gucong3000 committed Jan 22, 2018
1 parent 4dfcef3 commit 1f850c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ declare namespace PluginError {
*/
new <E extends Error>(plugin: string, error: E, options?: Options): PluginError<E>;

/**
* @param plugin Plugin name
* @param error Base error / Error message
* @param options Error options
*/
new <E extends Error>(plugin: string, error: E | string, options?: Options): PluginError<E> | PluginError;

/**
* @param plugin Plugin name
* @param options Options with message
Expand Down
7 changes: 7 additions & 0 deletions test/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,10 @@ import PluginError = require("plugin-error");
}
}

{
const PLUGIN_NAME = 'test'

function createPluginError(err: Error | string) {
return new PluginError(PLUGIN_NAME, err);
}
}

0 comments on commit 1f850c3

Please sign in to comment.