-
Notifications
You must be signed in to change notification settings - Fork 22
/
types.d.ts
55 lines (41 loc) · 1.51 KB
/
types.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
42
43
44
45
46
47
48
49
50
51
52
53
54
export type MontiEvent = any
export type KadiraInfo = any
export type ConnectOptions = {
enableErrorTracking?: boolean
endpoint?: string
hostname?: string
uploadSourceMaps?: boolean
recordIPAddress?: 'full' | 'anonymized' | 'none'
eventStackTrace?: boolean
disableNtp?: boolean
stalledTimeout?: number
}
export type TrackErrorOptions = {
type?: 'method' | 'client' | 'sub' | 'server-crash' | 'server-internal'
subType?: string
kadiraInfo?: KadiraInfo
}
export type TraceInfo = {
type: 'sub' | 'method' | 'http'
name: string
}
export type EventType = 'start' | 'end' | 'email' | 'db' | 'http' | 'fs' | 'compute' | 'custom'
export namespace Tracer {
function addFilter(filterFunction: (eventType: EventType, data: Record<string, any>, info: TraceInfo) => any): void
}
export namespace Monti {
var tracer: typeof Tracer
function connect(appId: string, appSecret: string, options?: ConnectOptions): void;
function startContinuousProfiling(): void;
function enableErrorTracking(): void;
function disableErrorTracking(): void;
function trackError(error: Error, options?: TrackErrorOptions): void;
function ignoreErrorTracking(error: Error): void;
function startEvent(name: string, data?: Record<string, any>): MontiEvent | false;
function endEvent(event: MontiEvent | false, data?: Record<string, any>): void;
}
declare var MontiNamespace: typeof Monti
declare global {
var Monti: typeof MontiNamespace
var Kadira: typeof MontiNamespace
}