@aws-amplify/analytics
Version:
Analytics category of aws-amplify
23 lines (22 loc) • 789 B
TypeScript
export type SessionTrackingOptions = {
attributes?: TrackerAttributes;
};
export type PageViewTrackingOptions = {
attributes?: TrackerAttributes;
eventName?: string;
urlProvider?: () => string;
appType?: 'multiPage' | 'singlePage';
};
export type EventTrackingOptions = {
attributes?: TrackerAttributes;
events?: DOMEvent[];
selectorPrefix?: string;
};
export type TrackerType = 'event' | 'pageView' | 'session';
export type TrackerAttributes = Record<string, string>;
export type TrackerEventRecorder = (eventName: string, attributes: TrackerAttributes) => void;
export type DOMEvent = keyof GlobalEventHandlersEventMap;
export interface TrackerInterface {
configure(eventRecorder: TrackerEventRecorder, options?: object): void;
cleanup(): void;
}