Variable defaultConst

default: {
    cache: eventObject[];
    currency: undefined | string;
    debug: boolean;
    port: undefined | MessagePort;
    searchInfo:
        | undefined
        | {
            allTrips?: {
                availableNearbyCities?: any[];
                nextAvailableDate?: string;
                results: any;
            }[];
            currency: string;
            departureDate: string;
            fromCity: City;
            leadTimeOutbound?: number;
            leadTimeReturn?: number;
            products: { [key: string]: number };
            returnDate?: null | string;
            stations: Stations;
            toCity: City;
        };
    stations: Stations;
    trips: Trip[];
    attachGlobalEvents(): void;
    attachPageviewEvent(): void;
    globalEventsHandler(name: string, payloads: unknown): void;
    handleCachedGlobalEvents(): undefined | false;
    init(event?: MessageEvent<any>): void;
    sendAbEvent(
        payloads: { name: string; source: string; variation: string },
    ): AbtestEvent;
    sendAdjustEvent(
        payloads: {
            action: "view_content" | "add_to_cart" | "initiate_checkout";
            parameters: {
                _valueToSum: string;
                fb_checkin_date: string;
                fb_checkout_date?: null | string;
                fb_city: string;
                fb_content_id: string;
                fb_content_type: "[\"hotel\", \"product\"]";
                fb_country: string;
                fb_currency: string;
                fb_num_adults: string;
                fb_region: string;
                fb_travel_end?: null | string;
                fb_travel_start: string;
            };
        },
    ): AdjustEvent;
    sendBothEvents(
        eventData: {
            action: string;
            category: string;
            label?: null | string;
            property?: null | string;
        },
    ): (StructuredEvent | DLStructured)[];
    sendCachedEvents(): void;
    sendDatalayerEcomEvent<
        T extends
            | ProductImpressionsEvent
            | AddToCartEvent
            | RemoveFromCartEvent
            | ProductDetailEvent,
    >(
        eventType: string,
        products: EnhancedEcomProduct[],
        currencyCode: string,
        additionalData?: Record<string, unknown>,
    ): T;
    sendDatalayerEvent(
        payloads: {
            eventAction: string;
            eventCategory: string;
            eventLabel?: null | string;
            eventProperty?: null | string;
        },
    ): DLStructured;
    sendEcomEvent(
        payloads: {
            action: "impressions" | "add" | "remove" | "view";
            currency: string;
            product?: { id: string; name: string; price: number } & {
                id: string;
                name: string;
                price: number;
            };
            products?: null
            | Product[];
            total?: null | number;
        },
    ): EcomEvent;
    sendEvent(event: eventObject): eventObject;
    sendFirebaseEvent(
        payloads: {
            action: "add_to_cart" | "begin_checkout";
            parameters: {
                currency: string;
                destination: string;
                end_date?: null | string;
                number_of_passengers: string;
                origin: string;
                quantity: string;
                start_date: string;
                value: string;
            };
        },
    ): FirebaseEvent;
    sendPageviewEvent(url: string): PageviewEvent;
    sendStructuredEvent(
        payloads: {
            action: string;
            category: string;
            label?: null | string;
            property?: null | string;
        },
    ): StructuredEvent;
    setDebug(value: boolean): void;
    setPort(value: MessagePort): void;
} = ...

Type declaration

  • cache: eventObject[]
  • currency: undefined | string
  • debug: boolean
  • port: undefined | MessagePort
  • searchInfo:
        | undefined
        | {
            allTrips?: {
                availableNearbyCities?: any[];
                nextAvailableDate?: string;
                results: any;
            }[];
            currency: string;
            departureDate: string;
            fromCity: City;
            leadTimeOutbound?: number;
            leadTimeReturn?: number;
            products: { [key: string]: number };
            returnDate?: null | string;
            stations: Stations;
            toCity: City;
        }
  • stations: Stations
  • trips: Trip[]
  • attachGlobalEvents:function
    • Returns void

  • attachPageviewEvent:function
    • Returns void

  • globalEventsHandler:function
    • Parameters

      • name: string
      • payloads: unknown

      Returns void

  • handleCachedGlobalEvents:function
    • Returns undefined | false

  • init:function
    • Parameters

      • Optionalevent: MessageEvent<any>

      Returns void

  • sendAbEvent:function
    • Parameters

      • payloads: { name: string; source: string; variation: string }
        • name: string

          Experiment name

        • source: string

          Experiment source

        • variation: string

          Experiment variation

      Returns AbtestEvent

  • sendAdjustEvent:function
    • Parameters

      • payloads: {
            action: "view_content" | "add_to_cart" | "initiate_checkout";
            parameters: {
                _valueToSum: string;
                fb_checkin_date: string;
                fb_checkout_date?: null | string;
                fb_city: string;
                fb_content_id: string;
                fb_content_type: "[\"hotel\", \"product\"]";
                fb_country: string;
                fb_currency: string;
                fb_num_adults: string;
                fb_region: string;
                fb_travel_end?: null | string;
                fb_travel_start: string;
            };
        }
        • action: "view_content" | "add_to_cart" | "initiate_checkout"

          Event action, has to be mapped to the Adjust token

        • parameters: {
              _valueToSum: string;
              fb_checkin_date: string;
              fb_checkout_date?: null | string;
              fb_city: string;
              fb_content_id: string;
              fb_content_type: "[\"hotel\", \"product\"]";
              fb_country: string;
              fb_currency: string;
              fb_num_adults: string;
              fb_region: string;
              fb_travel_end?: null | string;
              fb_travel_start: string;
          }

          Facebook parameters

          • _valueToSum: string

            Product value, as a string

          • fb_checkin_date: string

            Departure date

          • Optionalfb_checkout_date?: null | string

            Return ride date, if presented

          • fb_city: string

            City of destination

          • fb_content_id: string

            ["from_city_id#to_city_id"]

          • fb_content_type: "[\"hotel\", \"product\"]"

            ["hotel", "product"]

          • fb_country: string

            Country code of destination

          • fb_currency: string

            Product currency

          • fb_num_adults: string

            Number of tickets, as a string

          • fb_region: string

            City of destination

          • Optionalfb_travel_end?: null | string

            Return ride date, if presented

          • fb_travel_start: string

            Departure date

      Returns AdjustEvent

  • sendBothEvents:function
    • Helper method to send both structured and datalayer events with the same data

      Parameters

      • eventData: {
            action: string;
            category: string;
            label?: null | string;
            property?: null | string;
        }

      Returns (StructuredEvent | DLStructured)[]

  • sendCachedEvents:function
    • Returns void

  • sendDatalayerEcomEvent:function
  • sendDatalayerEvent:function
    • Parameters

      • payloads: {
            eventAction: string;
            eventCategory: string;
            eventLabel?: null | string;
            eventProperty?: null | string;
        }
        • eventAction: string

          Event action

        • eventCategory: string

          Event category

        • OptionaleventLabel?: null | string

          Event label

        • OptionaleventProperty?: null | string

          Event property

      Returns DLStructured

  • sendEcomEvent:function
    • Parameters

      • payloads: {
            action: "impressions" | "add" | "remove" | "view";
            currency: string;
            product?: { id: string; name: string; price: number } & {
                id: string;
                name: string;
                price: number;
            };
            products?: null
            | Product[];
            total?: null | number;
        }
        • action: "impressions" | "add" | "remove" | "view"

          Ecom action

        • currency: string

          Ecom currency

        • Optionalproduct?: { id: string; name: string; price: number } & {
              id: string;
              name: string;
              price: number;
          }
        • Optionalproducts?: null | Product[]

          Ecom product list

        • Optionaltotal?: null | number

          Ecom total value

      Returns EcomEvent

  • sendEvent:function
  • sendFirebaseEvent:function
    • Parameters

      • payloads: {
            action: "add_to_cart" | "begin_checkout";
            parameters: {
                currency: string;
                destination: string;
                end_date?: null | string;
                number_of_passengers: string;
                origin: string;
                quantity: string;
                start_date: string;
                value: string;
            };
        }
        • action: "add_to_cart" | "begin_checkout"

          Firebase Event name/key/action

        • parameters: {
              currency: string;
              destination: string;
              end_date?: null | string;
              number_of_passengers: string;
              origin: string;
              quantity: string;
              start_date: string;
              value: string;
          }

          Firebase parameters

          • currency: string

            Currency

          • destination: string

            Arrival/Destination cityID

          • Optionalend_date?: null | string

            Return ride date, if presented

          • number_of_passengers: string

            Number of Passengers

          • origin: string

            Departure/Origin cityID

          • quantity: string

            Number of items in the cart

          • start_date: string

            Departure date

          • value: string

            Value

      Returns FirebaseEvent

  • sendPageviewEvent:function
  • sendStructuredEvent:function
    • Sends structured event

      Parameters

      • payloads: {
            action: string;
            category: string;
            label?: null | string;
            property?: null | string;
        }
        • action: string

          Event action

        • category: string

          Event category

        • Optionallabel?: null | string

          Event label

        • Optionalproperty?: null | string

          Event property

      Returns StructuredEvent

  • setDebug:function
    • Parameters

      • value: boolean

      Returns void

  • setPort:function
    • Parameters

      • value: MessagePort

      Returns void