import Analytics, { type EventContextData, type EventData, type EventProperties, type IntegrationRuntimeData, type TrackTypesValues } from '@farfetch/blackout-analytics'; import { type WebContext } from './context.js'; /** * Analytics facade for web applications. Refer to \@farfetch/blackout-analytics * documentation to know the inherited methods from Analytics. */ declare class AnalyticsWeb extends Analytics { private webContextStateManager; currentPageCallData: EventData | null; constructor(); /** * Whenever the integrations are loaded at a certain point in time, we fetch them * and send the page track information. This can happen whenever the user gives * consent for a specific category mid session. * * @param loadedIntegrations - List of integrations that were loaded. * * @returns Promise that will resolve when the method finishes. */ protected onLoadedIntegrations(loadedIntegrations: IntegrationRuntimeData[]): void; /** * Getter for the context object. * * @param key - Key to retrieve from the context. If not specified, will return the whole data stored * in the context. * * @returns Value for the key in context or the whole context data if key is not specified. */ context(): Promise; context(key: string): Promise; /** * Process context to append context features related with this package. * * @param context - Context data that is specific for this event. */ processContext(context: WebContext): WebContext; /** * Decorates a context with the passed-in state snapshot. * The state is managed by this.webContextStateManager instance and * a snapshot is retrieved via getSnapshot() method. * * @param context - Context to decorate. * @param webContextState - Snapshot of the state used to decorate the context with. */ private decorateWebContext; /** * Stores the lastFromParameter if available, so it can be used on the next event's context. * @param event - Name of the event. * @param properties - Properties of the event. * @param eventContext - Context data that is specific for this event. * * @returns Promise that will resolve with the instance that was used when calling this method to allow * chaining. */ track(event: string, properties?: EventProperties | undefined, eventContext?: EventContextData | undefined): Promise; /** * Tracks a page view. * * @param event - Name of the event. * @param properties - Properties of the event. * @param eventContext - Context data that is specific for this event. * * @returns Promise that will resolve with the instance that was used when calling this method to allow * chaining. */ page(event: string, properties?: EventProperties, eventContext?: EventContextData): Promise; /** * When webAnalytics is ready to start initializing the integrations, it means that * all conditions are met to access the document object. * * @returns - Promise that will resolve with the instance that was used when calling this method to allow * chaining. */ ready(): Promise; } /** * Instance to be used to track events and pageviews. */ declare const instance: AnalyticsWeb; export default instance;