import { SearchByIdRequest } from '@empathyco/x-adapter' ; import { Result } from '@empathyco/x-types' ; import { XActionContext , XStoreModule } from '../../../store' ; import { StatusMutations , StatusState } from '../../../store/utils/status-store.utils' ; import { QueryOrigin , QueryOriginInit } from '../../../types/origin' ; import { Dictionary } from '../../../utils' ; import { IdentifierResultsConfig } from '../config.types' ; public export interface IdentifierResultsState extends StatusState { /** The configuration of the identifier results module. */ config : IdentifierResultsConfig ; /** The list of the identifier results, related to the `query` property of the state. */ identifierResults : Result [ ] ; /** The origin property of the request. */ origin : QueryOrigin | null ; /** The extra params property of the state. */ params : Dictionary < unknown > ; /** The internal query of the module. Used to request the identifier results. */ query : string ; } public export interface IdentifierResultsGetters { /** The adapter request object for retrieving the identifier suggestions, or null if there is not
     * valid data to create a request. */ identifierResultsRequest : SearchByIdRequest | null ; /** The RegExp to test against the query. */ identifierDetectionRegexp : RegExp ; /** The RegExp with the current query from the state adding the separatorChars after each
     * matching character. */ identifierHighlightRegexp : RegExp ; } public export interface IdentifierResultsMutations extends StatusMutations { param identifierResults setIdentifierResults ( identifierResults ) : void ; param origin setOrigin ( origin ) : void ; param params setParams ( params ) : void ; param newQuery setQuery ( newQuery ) : void ; } public export interface IdentifierResultsActions { /**
     * Cancels / interrupt  IdentifierResultsActions . fetchAndSaveIdentifierResults synchronous
     * promise.
      cancelFetchAndSaveIdentifierResults ( ) : void ; returns fetchIdentifierResults ( request ) : Result [ ] ; /**
     * Requests a new set of identifier results and stores them in the module.
     */ fetchAndSaveIdentifierResults ( request ) : void ; /**
     * Creates a  QueryOrigin and saves it.
     *
     *  param originInit saveOrigin ( originInit ) : void ; /**
     * Stores the query in the module if it matches the regex.
     */ saveQuery ( query ) : void ; } public export type IdentifierResultsXStoreModule = XStoreModule < IdentifierResultsState , IdentifierResultsGetters , IdentifierResultsMutations , IdentifierResultsActions > ; /**
 * Alias type for actions context of the  IdentifierResultsXStoreModule .
 *
 *  public export type IdentifierResultsActionsContext = XActionContext < IdentifierResultsState , IdentifierResultsGetters , IdentifierResultsMutations , IdentifierResultsActions > ;