index.d.ts 654 B

123456789101112131415161718
  1. import makeError = require('make-error');
  2. declare function makeErrorCause(value: string | Function): makeErrorCause.Constructor<makeErrorCause.BaseError>;
  3. declare function makeErrorCause<T extends Error>(value: string | Function, _super: {
  4. new (...args: any[]): T;
  5. }): makeErrorCause.Constructor<T>;
  6. declare namespace makeErrorCause {
  7. class BaseError extends makeError.BaseError {
  8. cause: Error;
  9. constructor(message: string, cause?: Error);
  10. toString(): string;
  11. }
  12. interface Constructor<T> {
  13. new (message: string, cause?: Error): T;
  14. super_: any;
  15. prototype: T;
  16. }
  17. }
  18. export = makeErrorCause;