import { type Events } from '../src/events.js'; import type { AnyFunction } from "../src/types/functions"; type EventMapping = { [E in keyof Events]?: (payload: Events[E][0]) => any; }; type BaseOptions = { /** * Number of events to collect into a single call to `handler` or `url`. * Defaults to 1 */ batchSize?: number; /** * Time (in milliseconds) to wait before calling handler or url with an incomplete batch * (when fewer than batchSize events have been collected). * Defaults to 100 */ batchDelay?: number; /** * Global vendor list ID to use for the purpose of GDPR purpose 7 enforcement */ gvlid?: number; /** * Map from event name to a custom format function. When provided, only events in this map will be collected, * using the data returned by their corresponding function. */ events?: EventMapping; }; type Payloads = { [H in keyof M]: M[H] extends AnyFunction ? ReturnType : never; }[keyof M]; type CustomHandlersOptions = BaseOptions & { /** * Custom handler function. * @param data an array of length `batchSize` containing event data as returned by the functions in `events`. */ handler: (data: Payloads[]) => void; events: M; url?: undefined; method?: undefined; }; type BasicHandlerOptions = BaseOptions & { /** * Custom handler function. * @param data an array of length `batchSize` containing the event payloads. */ handler: (data: (Events[keyof Events][0])[]) => void; events?: undefined; url?: undefined; method?: undefined; }; type UrlOptions = BaseOptions & { /** * Data collection URL */ url: string; /** * HTTP method used to call `url`. Defaults to 'POST' */ method?: string; handler?: undefined; }; declare module '../libraries/analyticsAdapter/AnalyticsAdapter' { interface AnalyticsProviderConfig { generic: { options: DefaultOptions & (UrlOptions | BasicHandlerOptions | CustomHandlersOptions); }; } } export declare function GenericAnalytics(): any; export declare function defaultHandler({ url, method, batchSize, ajax }: { url: any; method: any; batchSize: any; ajax?: (url: string, callback?: import("../src/ajax.js").AjaxCallback, data?: unknown, options?: import("../src/ajax.js").AjaxOptions) => void; }): (events: any) => void; export {};