This repository has been archived by the owner on May 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
55 lines (52 loc) · 1.8 KB
/
index.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
55
// Type definitions for electron-nucleus
// Project: https://github.com/lyserio/electron-nucleus
export interface Nucleus {
init: (
appId: string,
config?: {}
) => void;
setUserId: (id: number | string) => void;
onError: (
type: "uncaughtException" | "unhandledRejection" | "windowError",
error: Error
) => void;
trackError: (name: string, error: Error) => void;
setProps: (props: { [key: string]: string | number | boolean }, overwrite: boolean) => void;
track: (
customEvent: string,
data?: { [key: string]: string | number | boolean }
) => void;
disableTracking: () => void;
enableTracking: () => void;
checkLicense: (
license: string,
callback: (error: Error | null, licenseInfo?: any) => void,
) => void;
getCustomData: (callback: (error: Error | null, customData?: any) => void) => void;
checkUpdates: () => void;
onUpdate: ( version: string ) => void;
}
declare const nucleus: (
appId: string,
config?: {
/* disable module while in development (default: false) */
disableInDev?: boolean;
/* completely disable tracking (default: false) */
disableTracking?: boolean;
/* if you can only use Nucleus in the mainprocess (default: false)*/
onlyMainProcess?: boolean;
/* disable errors reporting (default: false) */
disableErrorReports?: boolean;
/* auto gives the user an id: username@hostname default: false) */
autoUserId?: boolean;
/* set an identifier for this user */
userId?: number | string;
/* cache events to disk if offline to report later (default: false) */
persist?: boolean;
/* set a custom version for your app (default: autodetected) */
version?: string;
/* specify a custom language (default: autodetected) */
language?: string;
}
) => Nucleus;
export default nucleus;