base.d.ts 456 B

12345678910
  1. import ErrorOptions from './error_options';
  2. declare class BaseError<T extends ErrorOptions> extends Error {
  3. [key: string]: any;
  4. static getType(err: Error): string;
  5. static from<S extends new (...args: any) => InstanceType<typeof BaseError>, P extends ConstructorParameters<S>>(this: S, err: Error, ...args: P | undefined[]): InstanceType<S>;
  6. code: string;
  7. protected options?: T;
  8. constructor(options?: T);
  9. }
  10. export default BaseError;