import { SearchAdapter } from '@empathyco/x-adapter' ; import { Facet , Filter , HistoryQuery , NextQuery , PartialResult , Redirection , RelatedTag , Result , Suggestion } from '@empathyco/x-types' ; import { Store } from 'vuex' ; import { ActionsTree } from '../store/actions.types' ; import { GettersTree } from '../store/getters.types' ; import { MutationsTree } from '../store/mutations.types' ; import { AnyXStoreModule , XStoreModule } from '../store/store.types' ; import { RequestStatus } from '../store/utils/status-store.utils' ; import { StoreEmitters } from '../store/utils/store-emitters.utils' ; import { DeepPartial , PropsWithType } from '../utils' ; import { XEvent , XEventPayload , XEventsTypes } from '../wiring/events.types' ; import { WireMetadata , Wiring } from '../wiring/wiring.types' ; import { AnyXModule , ExtractState , XModuleName , XModulesTree } from '../x-modules/x-modules.types' ; import { XBus } from './x-bus.types' ; /**
 *  XPlugin Installation options.
 *
 *  public export interface XPluginOptions { /** The adapter transforms the request for the the search and tagging APIs and its responses. */ adapter : SearchAdapter ; /** A Vuex store to install the X module. If not passed a new one will be created and injected
     * into every component. */ store ? : Store < any > ; /** A  XModule to be registered during the  XPlugin installation.  initialXModules ? : AnyXModule [ ] ; /** Override the  XModule config state and its wiring.  xModules ? : XModulesOptions ; /** Override the  XModule store module and store emitters. It must be used
     * only in exceptional cases.  __PRIVATE__xModules ? : PrivateXModulesOptions ; } public export type DocumentDirection = 'ltr' | 'rtl' ; /**
 * The XComponentAPI exposes access to the  XBus , and store aliases to the
 * components.
 *
 *  public export interface XComponentAPI extends XComponentBusAPI , XComponentAliasAPI { } /**
 * API for emitting and subscribing to events of the  XBus .
 *
 *  public export interface XComponentBusAPI { /** {@inheritDoc XBus.(on:1)} */ on : XBus [ 'on' ] ; /** {@inheritDoc XBus.(emit:1)} */ emit ( event ) : void ; /** {@inheritDoc XBus.(emit:2)} */ emit < Event extends XEvent > ( event , payload , metadata ? ) : void ; } public export interface XComponentAliasAPI { /** The  DeviceXModule detected device.  readonly device : string | null ; /** The  FacetsXModule facets.  readonly facets : Record < Facet [ 'id' ] , Facet > ; /** The  HistoryQueriesXModule history queries.  readonly historyQueries : ReadonlyArray < HistoryQuery > ; /** The  IdentifierResultsXModule results.  readonly identifierResults : ReadonlyArray < Result > ; /** The  Empathize is open state.  readonly isEmpathizeOpen : boolean ; /** The  NextQueriesXModule next queries.  readonly nextQueries : ReadonlyArray < NextQuery > ; /** The  SearchXModule no results situation.  readonly noResults : boolean ; /** The  SearchXModule partial results.  readonly partialResults : ReadonlyArray < PartialResult > ; /** The  PopularSearchesXModule popular searches.  readonly popularSearches : ReadonlyArray < Suggestion > ; /** The query value of the different modules. */ readonly query : XComponentAliasQueryAPI ; /** The  QuerySuggestionsXModule query suggestions.  readonly querySuggestions : ReadonlyArray < Suggestion > ; /** The  RecommendationsXModule recommendations.  readonly recommendations : ReadonlyArray < Result > ; /** The  SearchXModule redirections.  readonly redirections : ReadonlyArray < Redirection > ; /** The  RelatedTagsXModule related tags (Both selected and deselected).  readonly relatedTags : ReadonlyArray < RelatedTag > ; /** The  FacetsXModule selected filters.  readonly selectedFilters : Filter [ ] ; /** The  RelatedTagsXModule selected related tags.  readonly selectedRelatedTags : ReadonlyArray < RelatedTag > ; /** The  SearchXModule spellchecked query.  readonly spellcheckedQuery : string | null ; /** The status value of the different modules. */ readonly status : XComponentAliasStatusAPI ; /** The  SearchXModule total results.  readonly totalResults : number ; /** The  SearchXModule selected sort.  readonly selectedSort : string ; } public export interface XComponentAliasQueryAPI { /** The  SearchBoxXModule query.  readonly searchBox : string ; /** The  NextQueriesXModule query.  readonly nextQueries : string ; /** The  QuerySuggestionsXModule query.  readonly querySuggestions : string ; /** The  RelatedTagsXModule query.  readonly relatedTags : string ; /** The  SearchXModule query.  readonly search : string ; } public export interface XComponentAliasStatusAPI { /** The  IdentifierResultsXModule status.  readonly identifierResults : RequestStatus | undefined ; /** The  NextQueriesXModule status.  readonly nextQueries : RequestStatus | undefined ; /** The  PopularSearchesXModule status.  readonly popularSearches : RequestStatus | undefined ; /** The  QuerySuggestionsXModule status.  readonly querySuggestions : RequestStatus | undefined ; /** The  RecommendationsXModule status.  readonly recommendations : RequestStatus | undefined ; /** The  RelatedTagsXModule status.  readonly relatedTags : RequestStatus | undefined ; /** The  SearchXModule status.  readonly search : RequestStatus | undefined ; } /**
 * Options for overriding the default config state and wiring for each  XModule .
 *
 *  public export type XModulesOptions = { [ ModuleName in XModuleName ] ? : XModuleOptions < ModuleName > ; } ; /**
 * Options for overriding the default config state and wiring for a  XModule .
 *
 *  param ModuleName - The  XModuleName to extract the config.
 *  public export interface XModuleOptions < ModuleName extends XModuleName > { /** The options to override the default config state for the module. */ config ? : DeepPartial < ExtractState < ModuleName > extends { config : infer Config ; } ? Config : never > ; /** The options to override the default wiring configuration for the module. */ wiring ? : Partial < Wiring > ; } /**
 * Options for overriding the default store module and store emitters for each
 *  XModule .
 *
 *  public export type PrivateXModulesOptions = { [ ModuleName in XModuleName ] ? : PrivateXModuleOptions < XModulesTree [ ModuleName ] > ; } ; /**
 * Options for overriding the default store module and store emitters for a
 *  XModule .
 *
 *  param Module - The  XModule to modify its default configuration.
 *  public export interface PrivateXModuleOptions < Module extends AnyXModule > { /** The options to override events that will be emitted when a the getters value or the state
     * of the store changes. */ storeEmitters ? : Partial < StoreEmitters < Module [ 'storeModule' ] > > ; /** The options to override the default store module configuration. */ storeModule ? : XStoreModuleOptions < Module [ 'storeModule' ] > ; } /**
 * Options for overriding a default  XStoreModule .
 *
 *  public export type XStoreModuleOptions < StoreModule extends AnyXStoreModule > = StoreModule extends XStoreModule < infer State , infer Getters , infer Mutations , infer Actions > ? { state ? : DeepPartial < State > ; actions ? : DeepPartial < ActionsTree < State , Getters , Mutations , Actions > > ; getters ? : DeepPartial < GettersTree < State , Getters > > ; mutations ? : DeepPartial < MutationsTree < State , Mutations > > ; } : never ; public export type AnyXStoreModuleOption = XStoreModuleOptions < AnyXStoreModule > ;