import { XBus } from '../../plugins/x-bus.types' ; import { DocumentDirection } from '../../plugins/x-plugin.types' ; import { XEvent , XEventPayload } from '../../wiring/events.types' ; import { WireMetadata } from '../../wiring/wiring.types' ; /**
 * Interface with the API functions exposes as X
 *  https property.
 *
 *  public export interface XAPI { /**
     * To set the  XBus to the API. This bus will be used to emit the necessary
     * events.
     *
     *  internal setBus ( bus ) : void ; /**
     * To set the callback to call after the call to method init. This is used from  XInstaller * because the logic of initialization is there.
     *
     *  param initCallback - The callback to call passing in the  SnippetConfig .
     *
     *  internal setInitCallback ( initCallback ) : void ; param query public search ( query ? ) : void ; param config -  SnippetConfig To receive the customer parameters.
     *
     *  public init ( config ) : void ; } /**
 * Map type of every  XEvent and a callback with the payload and metadata for that event.
 *
 *  public export type XEventListeners = Partial < { [ Event in XEvent ] : ( payload : XEventPayload < Event > , metadata : WireMetadata ) => void ; } > ; public export interface SnippetConfig { /** Customer instance. */ instance : string ; /** Backend services environment. */ env ? : 'live' | 'staging' ; /** Execution scope (desktop, mobile, app, ...). */ scope : string ; /** Language to display. */ lang : string ; /** Language to send to backend services. */ searchLang ? : string ; /** User GDPR consent. */ consent ? : boolean ; /** Document direction. */ documentDirection ? : DocumentDirection ; /** The currency name. There should be a currency format associated to this name in the app. */ currency ? : string ; /** Callbacks to be triggered when an XEvent is emitted. */ callbacks ? : XEventListeners ; /** Flag determining if the page is a single page application or not. */ isSpa ? : boolean ; /** Any extra param to send in all backend calls. */ [ extra ] : any ; }