index.d.ts 601 B

123456789101112131415
  1. declare const hardRejection: {
  2. /**
  3. Make unhandled promise rejections fail hard right away instead of the default [silent fail](https://gist.github.com/benjamingr/0237932cee84712951a2).
  4. @param log - Custom logging function to print the rejected promise. Receives the error stack. Default: `console.error`.
  5. */
  6. (log?: (stack?: string) => void): void;
  7. // TODO: Remove this for the next major release, refactor the whole definition to:
  8. // declare function hardRejection(log?: (stack?: string) => void): void;
  9. // export = hardRejection;
  10. default: typeof hardRejection;
  11. };
  12. export = hardRejection;