import { integrations, type LoadIntegrationEventData, type SetUserEventData, type StrippedDownAnalytics } from '@farfetch/blackout-analytics'; import type { ForterIntegrationOptions } from './types/index.js'; declare class Forter extends integrations.Integration { private onSetUserPromise; private resolveOnSetUserPromise?; static shouldLoad(): boolean; constructor(options: ForterIntegrationOptions, loadData: LoadIntegrationEventData, analytics: StrippedDownAnalytics); initialize(): void; /** * Sets up a ForterTokenLoadedDetector instance in order to detect * when the forter token loaded event is raised. * When raised, it will then post a tracking message to Omnitracking * with the loaded forter token. * * @returns Promise that will be resolved when the forter token is loaded. */ setupForterTokenLoadedEventListener(): Promise; /** * Creates a synthetic analytics event representing a track of * the forter loaded event in order to be used * in calls to omnitracking-helper functions. * * @returns Promise that will be resolved when analytics creates an event. */ createSyntheticForterTokenLoadedEvent(): Promise>; /** * Responsible for sending the loaded forter token to Omnitracking. * Needs to wait for a user to be set in analytics by analytics.setUser method * in order to have the `customerId` parameter filled as it is a required * parameter by Omnitracking. * * @param forterToken - String representing the loaded forter token. * @returns Promise that will be resolved when the user is set in analytics and the Omnitracking message is built. * */ sendForterTokenLoadedEventForOmnitracking(forterToken: string): Promise; /** * Generates an Omnitracking message as specified by the documentation * in order to be posted to Omnitracking and thus, obtain the reference * to the forter token for this session. * * @param forterToken - String representing the loaded forter token. * * @returns Promise that will be resolved when the Omnitracking message is built. */ getForterTokenLoadedEventPayload(forterToken: string): Promise>; /** * Sets up the promise that will be resolved when onSetUser of this instance * is called by analytics. */ setupOnSetUserPromise(): void; /** * Loads the forter script with the corresponding siteId. * * @param siteId - Site identifier required by forter script and is configured by the user when adding this integration with `analytics.addIntegration` method. */ loadForterScript(siteId: string): void; /** * Resolves the configured set user promise. */ onSetUser(data: SetUserEventData): void; /** * Overrides track method to remove the default * implementation which throws an error. */ track(): void; } export default Forter;