UNPKG

@aftership/web-pixels

Version:

AfterShip Web Pixels for data anaylsis

96 lines (95 loc) 3.11 kB
export declare enum AvoEnv { Prod = "prod", Dev = "dev" } export interface CustomDestination { make?(env: AvoEnv, apiKey: string): void; logEvent?: (eventName: string, eventProperties: Record<string, any>) => void; setUserProperties?: (userId: string, userProperties: Record<string, any>) => void; identify?: (userId: string) => void; unidentify?: () => void; logPage?: (pageName: string, eventProperties: Record<string, any>) => void; revenue?: (amount: number, eventProperties: Record<string, any>) => void; setGroupProperties?: (groupType: string, groupId: string, groupProperties: Record<string, any>) => void; addCurrentUserToGroup?: (groupType: string, groupId: string, groupProperties: Record<string, any>) => void; logEventWithGroups?: (eventName: string, eventProperties: any, groupTypesToGroupIds: Record<string, string>) => void; } export declare const avoInspectorApiKey = "NuOPid1xkkh9zhfhEG6H"; interface AvoInspector { } interface AvoLogger { logDebug(env: AvoEnv | null, message: string): boolean; logWarn(env: AvoEnv | null, message: string): boolean; logError(env: AvoEnv | null, error: string): boolean; } declare enum webDebuggerArea { BottomRight = "BottomRight", BottomLeft = "BottomLeft", TopRight = "TopRight", TopLeft = "TopLeft" } interface bottomRightParameters { bottom: number; right: number; } interface bottomLeftParameters { bottom: number; left: number; } interface topRightParameters { top: number; right: number; } interface topLeftParameters { top: number; left: number; } interface webDebuggerPosition { position: webDebuggerArea; top?: number; right?: number; bottom?: number; left?: number; } interface webDebuggerOptions { position?: webDebuggerPosition; } interface WebDebuggerPositionSetter { BottomRight(p: bottomRightParameters): webDebuggerPosition; BottomLeft(p: bottomLeftParameters): webDebuggerPosition; TopRight(p: topRightParameters): webDebuggerPosition; TopLeft(p: topLeftParameters): webDebuggerPosition; } export declare const WebDebuggerPosition: WebDebuggerPositionSetter; export declare function setSystemProperties(properties: { env: string; pixelId: string; }): void; export declare function initAvo(options: { env: AvoEnv; webDebugger?: boolean; webDebuggerOptions?: webDebuggerOptions; strict?: boolean; noop?: boolean; reportFailureAs?: 'error' | 'warn' | 'log'; inspector?: AvoInspector; avoLogger?: AvoLogger; }, systemProperties: { env: string; pixelId: string; }, destinationOptions: any, AfterShipPixelDestination: CustomDestination): void; export declare function setAvoLogger(avoLogger: AvoLogger | null): void; /** * test_page_viewed: No description * * */ export declare function testPageViewed(): void; declare const _default: { AvoEnv: typeof AvoEnv; initAvo: typeof initAvo; setSystemProperties: typeof setSystemProperties; avoInspectorApiKey: string; testPageViewed: typeof testPageViewed; }; export default _default;