diff --git a/types/plugin-error/index.d.ts b/types/plugin-error/index.d.ts index 87aa892832..9f1d8833c5 100644 --- a/types/plugin-error/index.d.ts +++ b/types/plugin-error/index.d.ts @@ -3,56 +3,54 @@ // Definitions by: Rogier Schouten // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module 'plugin-error' { - namespace PluginError { - interface PluginErrorOpts { - /** - * By default the stack will not be shown. Set options.showStack to true if you think the stack is important for your error. - */ - showStack?: boolean; - /** - * Error properties will be included in err.toString(), but may be omitted by including {showProperties: false} in the options - */ - showProperties?: boolean; - } +export = PluginError; - interface PluginErrorOpts2 extends PluginErrorOpts { - /** - * If you pass an error object as the message the stack will be pulled from that, otherwise one will be created. - */ - message?: string | Error; - } - - interface PluginErrorOpts3 extends PluginErrorOpts2 { - /** - * The name of the plugin - */ - plugin?: string; - } +declare namespace PluginError { + export interface PluginErrorOpts { + /** + * By default the stack will not be shown. Set options.showStack to true if you think the stack is important for your error. + */ + showStack?: boolean; + /** + * Error properties will be included in err.toString(), but may be omitted by including {showProperties: false} in the options + */ + showProperties?: boolean; } - class PluginError extends Error { + export interface PluginErrorOpts2 extends PluginErrorOpts { /** - * Constructor - * @param pluginName - * @param message If you pass an error object as the message the stack will be pulled from that, otherwise one will be created. - * @param options + * If you pass an error object as the message the stack will be pulled from that, otherwise one will be created. */ - constructor(pluginName: string, message: string | Error, options?: PluginError.PluginErrorOpts); - - /** - * Constructor - * @param pluginName - * @param options - */ - constructor(pluginName: string, options: PluginError.PluginErrorOpts2); - - /** - * Constructor - * @param options - */ - constructor(options: PluginError.PluginErrorOpts3); + message?: string | Error; } - export = PluginError; + export interface PluginErrorOpts3 extends PluginErrorOpts2 { + /** + * The name of the plugin + */ + plugin?: string; + } +} + +declare class PluginError extends Error { + /** + * Constructor + * @param pluginName The name of your plugin + * @param message If you pass an error object as the message the stack will be pulled from that, otherwise one will be created. + * @param options Options + */ + constructor(pluginName: string, message: string | Error, options?: PluginError.PluginErrorOpts); + + /** + * Constructor + * @param pluginName The name of your plugin + * @param options Options, including message + */ + constructor(pluginName: string, options: PluginError.PluginErrorOpts2); + + /** + * Constructor + * @param options Options, including message and plugin name + */ + constructor(options: PluginError.PluginErrorOpts3); } diff --git a/types/plugin-error/tslint.json b/types/plugin-error/tslint.json index 3db14f85ea..4c4fc86ace 100644 --- a/types/plugin-error/tslint.json +++ b/types/plugin-error/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false + } +}