import { Address, APIEvent, ChainID, IFormoEvent, IFormoEventContext, IFormoEventProperties, Nullable, Options, SignatureStatus, TransactionStatus } from "../types"; import { IEventFactory } from "./type"; declare class EventFactory implements IEventFactory { /** Consulted once per event, after the only await in creation. */ private readonly canCreate; private options?; private compiledPathPattern?; private excludedQueryParams; /** Bumped by invalidate(); an event created across a bump is dropped. */ private generation; constructor(options?: Options, /** Consulted once per event, after the only await in creation. */ canCreate?: () => boolean); /** * Validate an address for both EVM and Solana chains. * Uses chainId for strict validation when available. * @param address The address to validate * @param chainId Optional chain ID for strict chain-specific validation * @returns The validated address or null if invalid */ private validateEventAddress; private getTimezone; private getLocation; private getLanguage; private getLibraryVersion; private isExcludedQueryParam; /** * Normalize URL paths for analytics aggregation by stripping trailing slashes * from non-root paths. Query strings and hash fragments are preserved by * mutating only the URL pathname. */ private normalizeUrlPath; /** * Strip excluded (sensitive) query parameters from a URL in place. Only the * query string is touched; the path and hash/fragment are left as-is. */ private redactQueryParams; /** * Return the given absolute URL with excluded query parameters removed and * trailing slashes stripped from non-root paths. The input is returned * unchanged when it is empty or cannot be parsed (e.g. an empty referrer). */ private redactUrl; private extractUTMParameters; private extractClickIdParameters; private extractReferralParameter; /** * Returns the document referrer with same-host referrers filtered out. * Internal navigation populates `document.referrer` with the previous page * on the same site, which is not an attribution signal - treating it as * "external" would otherwise let an internal URL become the session's * first-touch referrer after a direct landing. */ private getExternalReferrer; /** * Apply the current query-param denylist to a previously-persisted traffic * source object. Traffic-source keys (utm_*, click ids, ref) are themselves * query-parameter names, so an excluded key's stored value is dropped; the * referrer is a URL and is re-redacted. Guards against a stored value * outliving the config (or SDK version) under which it was first captured. */ private redactStoredTrafficSources; private getTrafficSources; private getScreen; /** Drop every event still being created. Called on clear() and close(). */ invalidate(): void; private generateContext; /** * Add any missing default page properties using values from options and defaults * @param properties Input page properties * @param options API options */ private getPageProperties; private getEnrichedEvent; generatePageEvent(category?: string, name?: string, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; generateDetectWalletEvent(providerName: string, rdns: string, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; generateIdentifyEvent(providerName?: string, rdns?: string, address?: Nullable
, userId?: Nullable, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; generateConnectEvent(chainId: ChainID, address: Address, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; generateDisconnectEvent(chainId?: ChainID, address?: Address, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; generateChainChangedEvent(chainId: ChainID, address: Address, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; generateSignatureEvent(status: SignatureStatus, chainId: ChainID, address: Address, message: string, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; generateTransactionEvent(status: TransactionStatus, chainId: ChainID, address: Address, data?: string, to?: string, value?: string, transactionHash?: string, function_name?: string, function_args?: Record, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; generateTrackEvent(event: string, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; /** * A web vitals report describes one page load, so it is placed at that * load: `page_url` is the URL the page loaded with (not a later SPA route) * and the timestamp is the navigation start. The timestamp also keeps the * report older than the page event of the same load, so it never becomes * a visitor's "last event". */ generateWebVitalsEvent(url: string, startTime: number, properties?: IFormoEventProperties, context?: IFormoEventContext): Promise; create(event: APIEvent, address?: Address, userId?: string): Promise; } export { EventFactory }; //# sourceMappingURL=EventFactory.d.ts.map