import { namespacedWireCommit , namespacedWireDispatch , namespacedWireDispatchWithoutPayload } from '../../wiring/namespaced-wires.factory' ; import { WirePayload } from '../../wiring/wiring.types' ; import { createWiring } from '../../wiring/wiring.utils' ; import { InternalSearchRequest } from './types' ; /**
 * `search`  XModuleName .
 *
 *  internal const moduleName = 'search' ; /**
 * WireCommit for  SearchXModule .
 *
 *  internal const wireCommit = namespacedWireCommit ( moduleName ) ; /**
 * WireDispatch for  SearchXModule .
 *
 *  internal const wireDispatch = namespacedWireDispatch ( moduleName ) ; /**
 * WireDispatchWithoutPayload for  SearchXModule .
 *
 *  internal const wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload ( moduleName ) ; /**
 * Cancels the  SearchActions . fetchAndSaveSearchResponse request promise.
 *
 *  public export const cancelFetchAndSaveSearchResponseWire = wireDispatchWithoutPayload ( 'cancelFetchAndSaveSearchResponse' ) ; public export const saveOriginWire = wireDispatch ( 'saveOrigin' , ( { metadata } ) => metadata ) ; public export const fetchAndSaveSearchResponseWire = wireDispatch ( 'fetchAndSaveSearchResponse' ) ; public export const resetSpellcheckQuery = wireCommit ( 'setSpellcheck' , '' ) ; public export const setRelatedTags = wireCommit ( 'setRelatedTags' ) ; public export const setSearchQuery = wireCommit ( 'setQuery' ) ; public export const setSelectedFilters = wireCommit ( 'setSelectedFilters' ) ; public export const setSort = wireCommit ( 'setSort' ) ; public export const setUrlParams = wireDispatch ( 'setUrlParams' ) ; public export const setSearchPage = wireCommit ( 'setPage' ) ; public export const setSearchExtraParams = wireCommit ( 'setParams' ) ; public export const increasePageAppendingResults = wireDispatchWithoutPayload ( 'increasePageAppendingResults' ) ; public export const setPageSize = wireCommit ( 'setPageSize' ) ; public export const resetAppending = wireCommit ( 'setIsAppendResults' , false ) ; /**
 * Batches state resets after  SearchGetters . request parameters update.
 *
 *  public export const resetStateWire = wireDispatch ( 'resetState' , ( { eventPayload : newRequest , metadata : { oldValue } } ) => ( { newRequest , oldRequest : oldValue as InternalSearchRequest } ) ) ; internal export const searchWiring = createWiring ( { UserAcceptedAQuery : { setSearchQuery , saveOriginWire } , UserAcceptedSpellcheckQuery : { resetSpellcheckQuery } , UserClearedQuery : { setSearchQuery , cancelFetchAndSaveSearchResponseWire } , UserClickedASort : { setSort } , UserPickedARelatedTag : { saveOriginWire } , UserReachedResultsListEnd : { increasePageAppendingResults } , SearchRequestChanged : { fetchAndSaveSearchResponseWire } , SearchRequestUpdated : { resetStateWire } , SelectedRelatedTagsChanged : { setRelatedTags } , SelectedFiltersChanged : { setSelectedFilters } , ResultsChanged : { resetAppending } , SelectedSortProvided : { setSort } , ExtraParamsChanged : { setSearchExtraParams } , ParamsLoadedFromUrl : { setUrlParams , saveOriginWire } } ) ;