import { namespacedWireCommit , namespacedWireDispatch , namespacedWireDispatchWithoutPayload } from '../../wiring/namespaced-wires.factory' ; import { namespacedDebounce } from '../../wiring/namespaced-wires.operators' ; import { NamespacedWireCommit , NamespacedWireDispatch } from '../../wiring/namespaced-wiring.types' ; import { createWiring } from '../../wiring/wiring.utils' ; /**
 * `historyQueries`  XModuleName .
 *
 *  internal const moduleName = 'historyQueries' ; /**
 * WireCommit for  HistoryQueriesXModule .
 *
 *  internal const wireCommit = namespacedWireCommit ( moduleName ) ; /**
 * WireDispatch for  HistoryQueriesXModule .
 *
 *  internal const wireDispatch = namespacedWireDispatch ( moduleName ) ; /**
 * WireDispatchWithoutPayload for  HistoryQueriesXModule .
 *
 *  internal const wireDispatchWithoutPayload = namespacedWireDispatchWithoutPayload ( moduleName ) ; public export const addQueryToHistoryQueries = wireDispatch ( 'addQueryToHistory' ) ; public export const setHistoryQueriesQuery = wireCommit ( 'setQuery' ) ; public const setUrlParams = wireDispatch ( 'setUrlParams' ) ; public export const clearHistoryQueriesQuery = wireCommit ( 'setQuery' , '' ) ; /**
 * Triggers a session refresh, extending its validity for the time configured in the
 *  HistoryQueriesConfig . sessionTTLInMs .
 *
 *  public export const refreshHistoryQueriesSession = wireDispatchWithoutPayload ( 'refreshSession' ) ; /**
 * Loads the history queries from the browser storage, saving them to the
 *  HistoryQueriesState . historyQueries .
 *
 *  public export const loadHistoryQueriesFromBrowserStorageWire = wireDispatchWithoutPayload ( 'loadHistoryQueriesFromBrowserStorage' ) ; public export const clearHistoryQueries = wireDispatch ( 'setHistoryQueries' , [ ] ) ; public export const removeHistoryQuery = wireDispatch ( 'removeFromHistory' ) ; /**
 * Debounce function for the module.
 */ const moduleDebounce = namespacedDebounce ( moduleName ) ; /**
 * Default wiring for the  HistoryQueries module.
 *
 *  internal export const historyQueriesWiring = createWiring ( { HistoryQueriesQueryChanged : { refreshHistoryQueriesSession } , HistoryQueriesStorageKeyChanged : { loadHistoryQueriesFromBrowserStorageWire } , UserClearedQuery : { clearHistoryQueriesQuery } , UserAcceptedAQuery : { setHistoryQueriesQuery , addQueryToHistoryQueries } , UserIsTypingAQuery : { setHistoryQueriesQueryDebounce : moduleDebounce ( setHistoryQueriesQuery , ( { state } ) => state . config . debounceInMs , { cancelOn : 'UserAcceptedAQuery' } ) } , UserPressedClearHistoryQueries : { clearHistoryQueries } , UserPressedRemoveHistoryQuery : { removeHistoryQuery } , ParamsLoadedFromUrl : { setUrlParams } } ) ;