generated from ehmicky/template-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.d.ts
41 lines (38 loc) · 1.17 KB
/
main.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type logProcessErrors from 'log-process-errors'
import type { Event as ProcessEvent, Options } from 'log-process-errors'
import type { Info } from 'modern-errors'
export type { ProcessEvent as Event }
/**
* Options of `modern-errors-process`
*/
export type { Options }
/**
* `modern-errors-process` plugin (Node.js only)
*/
declare const plugin: {
name: 'process'
getOptions: (input: Options) => Options
staticMethods: {
/**
* Improves process errors:
* [uncaught](https://nodejs.org/api/process.html#process_event_uncaughtexception)
* exceptions,
* [unhandled](https://nodejs.org/api/process.html#process_event_unhandledrejection)
* promises, promises
* [handled too late](https://nodejs.org/api/process.html#process_event_rejectionhandled)
* and [warnings](https://nodejs.org/api/process.html#process_event_warning).
*
* It returns a function to restore Node.js default behavior.
*
* @example
* ```js
* const restore = UnknownError.logProcess()
* restore()
* ```
*/
logProcess: (
info: Info['staticMethods'],
) => ReturnType<typeof logProcessErrors>
}
}
export default plugin