This repository has been archived by the owner on Oct 18, 2023. It is now read-only.
forked from FelipeBuiles/react-native-analytics-segment-io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
80 lines (69 loc) · 2.66 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
declare module 'react-native-analytics-segment-io' {
export enum AnalyticsConstants {
enableAdvertisingTracking = 'enableAdvertisingTracking',
flushAt = 'flushAt',
recordScreenViews = 'recordScreenViews',
shouldUseBluetooth = 'shouldUseBluetooth',
shouldUseLocationServices = 'shouldUseLocationServices',
trackApplicationLifecycleEvents = 'trackApplicationLifecycleEvents',
trackAttributionData = 'trackAttributionData',
trackDeepLinks = 'trackDeepLinks',
debug = 'debug',
}
/**
* Initialize Segment with the write key
* @param {string} key The writable key for segment
* @param {{string: any}} options Parameters to initalize segment with, see AnalyticsConstants
* @return {Promise} Returns true when initialization has started
*/
export function setup(key: string, options: any ) : Promise<boolean>;
/**
* Identify the current user
* @param {string} userID UserID
* @param {{string: any}} traits Traits identifying the user
*/
export function identify(userId: string, traits: any): void;
/**
* Track an event
* @param {string} event Event Name
* @param {{string: any}} properties Properties for the current event
*/
export function track(event: string, properties: any): void;
/**
* Track a screen change event
* @param {string} name Name of the screen
* @param {{string: any}} properties Properties for the current screen
*/
export function screen(name: string, properties: any): void;
/**
* Track a group
* @param {string} groupID ID of the current users group
* @param {{string: any}} traits Traits for this group
*/
export function group(groupID: string, traits: any): void;
/**
* Set an alias for the user
* @param {string} alias Alias of the user
*/
export function alias(alias: string): void;
/**
* Reset internal current Segment cache
* Useful to call during login/logout operations after calling flush
*/
export function reset(): void;
/**
* Flush all segment data to server.
* Note: By default segment caches 20 events before sending data to server
*/
export function flush(): void;
/**
* Enable tracking for this user
* This function allows users to opt-in/opt-out of analytics tracking
*/
export function enable(): void;
/**
* Disable tracking for this user
* This function allows users to opt-in/opt-out of analytics tracking
*/
export function disable(): void;
}