-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathtypes.d.ts
57 lines (51 loc) · 1.59 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
55
56
declare module '@segment/snippet' {
interface PageOptions {
category?: string
name?: string
properties?: {
[key: string]: string | number
}
}
interface LoadOptions {
integrations?: {
[key: string]: boolean
}
}
interface Options {
/** The domain name where the analytics.js script is hosted. */
host?: string
/** The apiKey to load in the snippet. */
apiKey?: string
ajsPath?: string
/**
* The options to pass to `analytics.page`. if page is false, then the
* `page()` call will be omitted.
*/
page?: boolean | PageOptions
/**
* If set to false the `load()` call will be omitted. This is useful for if
* you want dynamically control the load process on the client-side for
* things like GDPR.
*/
load?: boolean | LoadOptions
/**
* If useHostForBundles is set, the snippet will include the `_cdn` property
* to tell Analytics JS where to fetch bundles from.
*/
useHostForBundles?: boolean
/**
* They key at which the global Analytics object will become accessible on the
* window namespace
*/
globalAnalyticsKey?: string
}
/**
* Returns the maxified version of the analytics.js snippet given a set of
* options.
*/
export function max(options?: Options): string
/**
* Returns the minified version of the snippet.
*/
export function min(options?: Options): string
}