-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
27 lines (25 loc) · 996 Bytes
/
index.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
import CrashHunterBase from '../lib/core/crash-hunter';
import { AnyMap, CrashEvent, CrashHunterClientInitOptions, CrashHunterClientOptions, ICrashHunter, RequiredOptionKey } from '../lib/interface';
import { IPlugin } from '../lib/interface/i-plugins';
import NodeUncaughtExceptionPlugin from '../lib/plugin/node-uncaught-exception';
import NodeUnhandledRejectionPlugin from '../lib/plugin/node-unhandled-rejection';
import { GetLogger } from '../lib/tools/logger';
const CrashHunter = {
init<Context extends AnyMap, Metadata extends AnyMap>(
options: CrashHunterClientInitOptions<Context, Metadata>,
plugins: IPlugin[] = [new NodeUncaughtExceptionPlugin(), new NodeUnhandledRejectionPlugin()],
): ICrashHunter<Context, Metadata> {
return new CrashHunterBase<Context, Metadata>(options, plugins);
},
};
export {
CrashHunter,
AnyMap,
CrashHunterClientInitOptions,
IPlugin,
ICrashHunter,
CrashHunterClientOptions,
RequiredOptionKey,
CrashEvent,
GetLogger,
};