-
Notifications
You must be signed in to change notification settings - Fork 23
/
types.ts
44 lines (37 loc) · 1011 Bytes
/
types.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
interface PageViewEvent {
type: 'pageview';
url: string;
}
interface CustomEvent {
type: 'event';
url: string;
}
export type BeforeSendEvent = PageViewEvent | CustomEvent;
export type Mode = 'auto' | 'development' | 'production';
export type AllowedPropertyValues = string | number | boolean | null;
export type BeforeSend = (event: BeforeSendEvent) => BeforeSendEvent | null;
export interface AnalyticsProps {
beforeSend?: BeforeSend;
debug?: boolean;
mode?: Mode;
route?: string | null;
disableAutoTrack?: boolean;
scriptSrc?: string;
endpoint?: string;
dsn?: string;
}
declare global {
interface Window {
// Base interface
va?: (
event: 'beforeSend' | 'event' | 'pageview',
properties?: unknown
) => void;
// Queue for actions, before the library is loaded
vaq?: [string, unknown?][];
vai?: boolean;
vam?: Mode;
}
}
export type PlainFlags = Record<string, unknown>;
export type FlagsDataInput = (string | PlainFlags)[] | PlainFlags;