import * as PropTypes from 'prop-types'; interface PageData { name?: string; category?: string; keywords?: string[]; title?: string; url?: string; path?: string; search?: string; referrer?: string; properties?: Record; } interface UserData { user_id?: string; anonymous_id?: string; edgee_id: string; properties?: Record; } interface TrackData { name?: string; properties?: Record; } type ConsentStatus = 'granted' | 'denied' | 'pending'; type EdgeeMethod = (arg: T, components?: Record) => void; type EdgeeConsentMethod = (arg: ConsentStatus) => void; type QueuedEvent = { method: Exclude; args: [T, Record?]; }; type QueuedConsentEvent = { method: 'consent'; args: [ConsentStatus]; }; /** * Custom hook `useEdgeeDataCollection` * * Provides access to Edgee's tracking methods: `track`, `page`, `user`, and `consent`. * - Returns memoized functions for tracking events and user identification. * * @returns {{ * track: (eventData: TrackData) => void; * page: (pageData: PageData) => void; * user: (userData: UserData) => void; * consent: (consent: ConsentStatus) => void; * }} Object containing the tracking functions. */ declare const useEdgeeDataCollection: () => { track: (trackData: TrackData) => void; page: (pageData: PageData) => void; user: (userData: UserData) => void; consent: (status: ConsentStatus) => void; }; /** * Interface representing the Edgee analytics object. * Provides methods for tracking page, track, and user events. */ interface Edgee { /** * Tracks a page view event. * @param arg - The event name or an object containing event properties. * @param components - Optional object specifying components for the event. */ page: (arg?: string | object, components?: object) => void; /** * Tracks a custom user action or event. * @param arg - The event name or an object containing event properties. * @param components - Optional object specifying components for the event. */ track: (arg?: string | object, components?: object) => void; /** * Identifies a user and associates them with subsequent events. * @param arg - A unique identifier for the user or an object containing user properties. * @param components - Optional object specifying components for the event. */ user: (arg?: string | object, components?: object) => void; /** * ConsentStatus management system that allows you to control data collection and anonymization based on user consent status. * @param {ConsentStatus} status - ConsentStatus state. Could be pending, denied or granted. */ consent: (status: ConsentStatus) => void; } declare global { interface Window { edgee: Edgee; } } /** * Props for the EdgeeSdk component. */ type EdgeeSdkProps = { src: string; dataInline?: boolean; }; /** * `EdgeeSdk` is a React component that injects the Edgee SDK script into the application. * It also sets up listeners to track page navigations via `history.pushState` and `history.replaceState` * to automatically call the `edgee.page` method, ensuring page views are tracked during SPA navigations. * * @param {EdgeeSdkProps} props - The component props. * @param {string} props.src - The source URL of the Edgee SDK script. * @param {boolean} [props.dataInline=true] - Determines if the script should be inlined. * @returns {JSX.Element} The script element to be injected into the application. */ declare const EdgeeSdk: { ({ src, dataInline }: EdgeeSdkProps): JSX.Element; propTypes: { src: PropTypes.Requireable; dataInline: PropTypes.Requireable; }; }; interface EdgeeDataLayerObject { data_collection?: DataCollection; } interface DataCollection { events?: Event[]; context?: Context; components?: object; } interface Event { type: string; data: object; components?: object; } interface Context { page?: Page; user?: User; } interface Page { name?: string; category?: string; title?: string; url?: string; path?: string; search?: string; keywords?: string[]; properties?: object; } interface User { user_id?: string; anonymous_id?: string; properties?: object; } /** * Props for the EdgeeDataLayerProps component. */ type EdgeeDataLayerProps = { data: EdgeeDataLayerObject; }; declare const EdgeeDataLayer: { ({ data }: EdgeeDataLayerProps): JSX.Element; propTypes: { data: PropTypes.Requireable; }; }; export { type ConsentStatus, type Context, type DataCollection, type Edgee, type EdgeeConsentMethod, EdgeeDataLayer, type EdgeeDataLayerObject, type EdgeeDataLayerProps, type EdgeeMethod, EdgeeSdk, type EdgeeSdkProps, type Event, type PageData, type QueuedConsentEvent, type QueuedEvent, type TrackData, type UserData, EdgeeSdk as default, useEdgeeDataCollection };