TomTom Maps for JavaScript
    Preparing search index...

    Type Alias CommonServiceParams<ApiRequest, ApiResponse>

    CommonServiceParams: Partial<GlobalConfig> & {
        customServiceBaseURL?: string;
        onAPIRequest?: (apiRequest: ApiRequest) => void;
        onAPIResponse?: (apiRequest: ApiRequest, apiResponse: ApiResponse) => void;
        validateRequest?: boolean;
    }

    Common parameters shared across all service calls.

    Type Parameters

    • ApiRequest = any

      The type of the API request object

    • ApiResponse = any

      The type of the API response object

    Type Declaration

    • OptionalcustomServiceBaseURL?: string

      Custom base URL for the service endpoint.

      Should contain the URL up to the part that changes per service call.

      customServiceBaseURL: 'https://api.tomtom.com/search/10/reverseGeocode/'
      

      undefined (uses default service URL)

    • OptionalonAPIRequest?: (apiRequest: ApiRequest) => void

      Callback invoked immediately before sending the request to the API.

      Useful for tracking, logging, or debugging API requests before they are sent to the server.

    • OptionalonAPIResponse?: (apiRequest: ApiRequest, apiResponse: ApiResponse) => void

      Callback invoked when the raw response is received from the API.

      Called as soon as the API response is received, before parsing. The request object is the same reference as provided to onAPIRequest. Useful for tracking, logging, or debugging successful API request-response pairs.

    • OptionalvalidateRequest?: boolean

      Controls whether input request schema validation is performed.

      When enabled, the SDK validates request parameters against the expected schema before sending the request to the API. Set to false to skip validation.

      true

    This type extends the global configuration and provides additional service-specific options such as custom base URLs, request validation, and lifecycle event listeners.