import { RelatedTagsRequest } from '@empathyco/x-adapter' ; import { RelatedTag } from '@empathyco/x-types' ; import { XActionContext , XStoreModule } from '../../../store' ; import { StatusMutations , StatusState } from '../../../store/utils/status-store.utils' ; import { UrlParams } from '../../../types/url-params' ; import { Dictionary } from '../../../utils' ; import { RelatedTagsConfig } from '../config.types' ; public export interface RelatedTagsState extends StatusState { /** The internal query of the module. Used to request the related tags. */ query : string ; /** The list of the related tags, related to the `query` property of the state. */ relatedTags : RelatedTag [ ] ; /** The list of the selected related tags. */ selectedRelatedTags : RelatedTag [ ] ; /** The configuration of the related tags module. */ config : RelatedTagsConfig ; /** The extra params property of the state. */ params : Dictionary < unknown > ; } public export interface RelatedTagsGetters { /** The adapter request object for retrieving the related tags, or null if there is not
     * valid data to create a request. */ request : RelatedTagsRequest | null ; /** List that contains al the related tags, having the selected ones at the first positions
     * (if there are any), and then the unselected ones.
     */ relatedTags : RelatedTag [ ] ; } public export interface RelatedTagsMutations extends StatusMutations { param newQuery setQuery ( newQuery ) : void ; param relatedTags setRelatedTags ( relatedTags ) : void ; param selectedRelatedTags setSelectedRelatedTags ( selectedRelatedTags ) : void ; param params setParams ( params ) : void ; } public export interface RelatedTagsActions { /**
     * Cancels / interrupt  RelatedTagsActions . fetchAndSaveRelatedTags synchronous promise.
      cancelFetchAndSaveRelatedTags ( ) : void ; returns fetchRelatedTags ( request ) : RelatedTag [ ] ; /**
     * Fetches a new set of related tags and stores them in the module state.
     */ fetchAndSaveRelatedTags ( request ) : void ; /**
     * Add or remove the clicked related tag from selected related tags.
     */ toggleRelatedTag ( relatedTag ) : void ; /**
     * Receives a list of params from the url, builds the entities and
     * set them in the store.
     */ setUrlParams ( urlParams ) : void ; } public export type RelatedTagsXStoreModule = XStoreModule < RelatedTagsState , RelatedTagsGetters , RelatedTagsMutations , RelatedTagsActions > ; /**
 * Alias type for actions context of the  RelatedTagsXStoreModule .
 *
 *  public export type RelatedTagsActionContext = XActionContext < RelatedTagsState , RelatedTagsGetters , RelatedTagsMutations , RelatedTagsActions > ;