-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.d.ts
More file actions
40 lines (37 loc) · 863 Bytes
/
main.d.ts
File metadata and controls
40 lines (37 loc) · 863 Bytes
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
import type { Options } from 'handle-cli-error'
import type { Info } from 'modern-errors'
/**
* Options of `modern-errors-cli`
*/
export type { Options }
/**
* `modern-errors-cli` plugin
*/
declare const plugin: {
name: 'cli'
getOptions: (input: Options) => Options
instanceMethods: {
/**
* Logs `error` on the console (`stderr`) then exits the process.
*
* This never throws. Invalid errors are silently
* [normalized](https://github.com/ehmicky/normalize-exception).
*
* @example
* ```js
* const cliMain = function () {
* try {
* // ...
* } catch (error) {
* // Logs `error` then exits the process
* BaseError.exit(error)
* }
* }
*
* cliMain()
* ```
*/
exit: (info: Info['instanceMethods']) => void
}
}
export default plugin