Data types
    • 3 Minutes to read
    • Dark
      Light

    Data types

    • Dark
      Light

    Article summary

    Overview

    This document provides details on the TypeScript types used in our React Native plugin. The types described here define the structure and constraints for various entities within the plugin, ensuring type safety and consistency.

    Types

    PartialPageParameters

    An interface representing partial parameters for a page.

    Properties:

    • searchTerm (string | null): The search term used on the page.

    • params (Map<number, string> | null): Additional parameters as a map.

    • categories (Map<number, string> | null): Categories associated with the page as a map.

    PageParameters

    A type representing required page parameters.

    Base Type: Required<PartialPageParameters>


    PartialBirthday

    An interface representing partial birthday details.

    Properties:

    • day (number): The day of the birthday.

    • month (number): The month of the birthday.

    • year (number): The year of the birthday.

    MIBirthday

    A type representing a complete birthday.

    Base Type: Required<PartialBirthday>


    MIGender

    An enum representing gender options.

    Values:

    • unknown (1): Unknown gender.

    • male (2): Male gender.

    • female (3): Female gender.


    PartialUserCategories

    An interface representing partial user categories.

    Properties:

    • birthday (MIBirthday | null): User's birthday.

    • city (string | null): User's city.

    • country (string | null): User's country.

    • emailAddress (string | null): User's email address.

    • emailReceiverId (string | null): Email receiver ID.

    • firstName (string | null): User's first name.

    • gender (MIGender | MIGender.unknown): User's gender.

    • customerId (string | null): User's customer ID.

    • lastName (string | null): User's last name.

    • newsletterSubscribed (boolean | null): Whether the user is subscribed to a newsletter.

    • phoneNumber (string | null): User's phone number.

    • street (string | null): User's street address.

    • streetNumber (string | null): User's street number.

    • zipCode (string | null | undefined): User's zip code.

    • customCategories (Map<number, string> | null): Custom categories for the user.

    UserCategories

    A type representing user categories.

    Base Type: PartialUserCategories


    ParticularEcommerceParameters

    An interface representing specific E-Commerce parameters.

    Properties:

    • products (MIProduct[] | null): List of products.

    • status (MIStatus | null): E-Commerce status.

    • currency (string | null): Currency used.

    • orderID (string | null): Order ID.

    • orderValue (number | null): Order value.

    • returningOrNewCustomer (string | null): Whether the customer is returning or new.

    • returnValue (number | null): Return value.

    • cancellationValue (number | null): Cancellation value.

    • couponValue (number | null): Coupon value.

    • paymentMethod (string | null): Payment method used.

    • shippingServiceProvider (string | null): Shipping service provider.

    • shippingSpeed (string | null): Shipping speed.

    • shippingCost (number | null): Shipping cost.

    • markUp (number | null): Mark-up value.

    • orderStatus (string | null): Order status.

    • customParameters (Map<number, string> | null): Custom parameters as a map.

    EcommerceParameters

    A type representing E-Commerce parameters.

    Base Type: Required<ParticularEcommerceParameters>


    MIProduct

    An interface representing a product.

    Properties:

    • name (string | null): Product name.

    • cost (number | null): Product cost.

    • quantity (number | null): Product quantity.

    • productAdvertiseID (number | null): Product advertise ID.

    • productSoldOut (boolean | null): Whether the product is sold out.

    • productVariant (string | null): Product variant.

    • categories (Map<number, string> | null): Product categories.

    • ecommerceParameters (Map<string, string> | null): E-Commerce parameters.


    MIStatus

    An enum representing E-Commerce status.

    Values:

    • noneStatus (0): No status.

    • addedToBasket (1): Added to basket.

    • purchased (2): Purchased.

    • viewed (3): Viewed.

    • deletedFromBasket (4): Deleted from basket.

    • addedToWishlist (5): Added to wishlist.

    • deletedFromWishlist (6): Deleted from wishlist.

    • checkout (7): Checkout.


    MIAction

    An enum representing actions.

    Values:

    • click (1): Click action.

    • view (2): View action.


    ParticularCampaignParameters

    An interface representing specific campaign parameters.

    Properties:

    • campaignId (string | null): Campaign ID.

    • action (MIAction | null): Campaign action.

    • mediaCode (string | null): Media code.

    • oncePerSession (boolean | null): Whether the campaign is once per session.

    • customParameters (Map<number, string> | null): Custom parameters as a map.

    CampaignParameters

    A type representing campaign parameters.

    Base Type: Required<ParticularCampaignParameters>


    ParticularSessionParameters

    An interface representing specific session parameters.

    Properties:

    • parameters (Map<number, string> | null): Session parameters as a map.

    SessionParameters

    A type representing session parameters.

    Base Type: Required<ParticularSessionParameters>


    EventParameters

    An interface representing event parameters.

    Properties:

    • customParameters (Map<number, string>): Custom parameters as a map.


    MediaParam

    An enum representing media parameters.

    Values:

    • media_category ('mg'): Media category.

    • media_action ('mk'): Media action.

    • media_position ('mt1'): Media position.

    • media_duration ('mt2'): Media duration.

    • bandwidth ('bw'): Bandwidth.

    • volume ('vol'): Volume.

    • mute ('mut'): Mute.

    • name ('mi'): Name.


    MediaParameters

    An interface representing media parameters.

    Properties:

    • name (string): Media name.

    • action (string): Media action.

    • position (number): Media position.

    • duration (number): Media duration.

    • bandwidth (number | null): Bandwidth.

    • soundIsMuted (boolean | null): Whether the sound is muted.

    • soundVolume (number | null): Sound volume.

    • customCategories (Map<number, string> | null): Custom categories.


    MediaEvent

    An interface representing a media event.

    Properties:

    • pageName (string): Page name.

    • parameters (MediaParameters | null): Media parameters.

    • eventParameters (EventParameters | null): Event parameters.

    • sessionParameters (SessionParameters | null): Session parameters.

    • eCommerceParameters (EcommerceParameters | null): E-Commerce parameters.

    • customParameters (Map<number, string> | null): Custom parameters.


    ExceptionType

    An enum representing exception types.

    Values:

    • none (0): No exception.

    • uncaught (1): Uncaught exception.

    • caught (2): Caught exception.

    • custom (3): Custom exception.

    • all (4): All exceptions.

    • uncaught_and_custom (5): Uncaught and custom exceptions.

    • uncaught_and_caught (6): Uncaught and caught exceptions.

    • custom_and_caught (7): Custom and caught exceptions.


    MediaAction

    An enum representing media actions.

    Values:

    • init ('init'): Initialize action.

    • play ('play'): Play action.

    • pause ('pause'): Pause action.

    • stop ('stop'): Stop action.

    • seek ('seek'): Seek action.

    • pos ('pos'): Position action.

    • eof ('eof'): End of file action.


    LogLevel

    An enum representing log levels.

    Values:

    • all (1): All logs.

    • debug (2): Debug logs.

    • warning (3): Warning logs.

    • error (4): Error logs.

    • fault (5): Fault logs.

    • info (6): Informational

    • none (7): No logs.

    Android supports only [all, none] log-level enum values. Every other value, other than ‘none' will be parsed as 'all’ on Android.


    Was this article helpful?