event.ts 1.0 KB

123456789101112131415161718192021222324252627
  1. export type EventNameEnumType = 'pageview' | '';
  2. export type Dict<T> = { [key: string]: T };
  3. export interface GlobalEventType {
  4. id: string;
  5. eventName: string;
  6. eventVariable: string;
  7. triggerTime: number;
  8. }
  9. export type TrackEventType = 'click' | 'menu';
  10. export interface TrackActionOption extends Dict<any> {
  11. eventType: string;
  12. maxWaitTime?: number;
  13. }
  14. export type EventReturnType = Promise<XMLHttpRequestResponseType>;
  15. export interface IBaseAction {
  16. trackView(url: string, referrer: string, uuid: string): EventReturnType;
  17. trackEvent(event_name: string, event_data: string, url?: string, uuid?: string): EventReturnType;
  18. sendEvent(value: string, type: string, url?: string, uuid?: string): EventReturnType;
  19. }
  20. export interface ICustomAction {
  21. track(trackActionName: string, trackActionOption?: TrackActionOption): EventReturnType;
  22. startTrack(trackActionName: string, trackActionOption?: TrackActionOption): EventReturnType;
  23. endTrack(trackActionName: string, trackActionOption?: TrackActionOption): EventReturnType;
  24. }