import { StoreDefinition, PiniaCustomStateProperties } from 'pinia'; import { ResultSetPaging } from '@alfresco/js-api'; /** * A Pinia store definition for managing search state and operations. * * Provides state, getters, and actions to handle search-related functionality, * including query definitions, result pagination, sorting, facets, and context. * * Store ID: "SearchStore" * * State: * - language: Specifies the query language, default is "afts". * - userQuery: The raw user input for search. * - aftsQuery: Reserved for AFTS-specific queries. * - fullQuery: The full search query composed of user query and additional parameters. * - paging: Contains pagination properties like `maxItems` and `skipCount`. * - include: Specifies the fields to be included in the results, e.g., properties and path. * - sort: Custom sort criteria applied to the search results. * - defaultSort: Default sorting configured by field and order. * - spellcheck: Reserved for enabling/disabling spellcheck in the search. * - filterQueries: Filters applied to limit search results based on specific criteria. * - facetQueries: Queries for retrieving facet-related data. * - facets: Configurations for available facets such as field, label, and minimum count. * - fields: Custom fields selected for filtering or querying. * - context: Contains metadata about the current search result context. * - entries: The list of search results. * - pagination: Information about the result pagination state. * * Getters: * - facetFields: Extracts and returns facets from the store state. * * Actions: * - reset: Resets the store state to its initial configuration using default values and external configurations. * - defineUserQuery(userQuery): Constructs and updates the search query using the provided user input. * - queryStore(searchInput, page): Executes the configured search query and updates the store with the results. * - addSortField(sortField): Adds a custom sort criterion. * - removeSortField: Clears the existing sort configuration. * - addFilterQuery(bucket): Adds a new filter query if it does not already exist. * - removeFilterQuery(bucket): Removes a specific filter query based on the provided bucket. * - addField(bucket): Adds a new field to the fields array if it does not already exist. * - removeField(bucket): Removes a specific field from the fields array. */ export const useSearchStore: StoreDefinition<"SearchStore", { language: string; userQuery: string; aftsQuery: string; fullQuery: string; paging: { maxItems: string; skipCount: string; }; include: string[]; sort: any; defaultSort: { type: string; field: string; ascending: boolean; }[]; spellcheck: any; filterQueries: any[]; facetQueries: any[]; facets: any[]; fields: any[]; context: any; entries: any[]; pagination: {}; isExactSearchActivated: boolean; }, { facetFields(state: { language: string; userQuery: string; aftsQuery: string; fullQuery: string; paging: { maxItems: string; skipCount: string; }; include: string[]; sort: any; defaultSort: { type: string; field: string; ascending: boolean; }[]; spellcheck: any; filterQueries: any[]; facetQueries: any[]; facets: any[]; fields: any[]; context: any; entries: any[]; pagination: {}; isExactSearchActivated: boolean; } & PiniaCustomStateProperties<{ language: string; userQuery: string; aftsQuery: string; fullQuery: string; paging: { maxItems: string; skipCount: string; }; include: string[]; sort: any; defaultSort: { type: string; field: string; ascending: boolean; }[]; spellcheck: any; filterQueries: any[]; facetQueries: any[]; facets: any[]; fields: any[]; context: any; entries: any[]; pagination: {}; isExactSearchActivated: boolean; }>): { facetFields: any[]; }; }, { setIsExactSearchActivated(value: any): void; reset(): void; defineUserQuery(userQuery: any): void; queryStore(searchInput: any, page: any, customQuery?: any): Promise; searchForExport(nbrToExport: any): Promise< ResultSetPaging>; addSortField(sortField: any): void; removeSortField(): void; /** * * @param bucket {query: ".." , label: ".."} * @returns {boolean} */ addFilterQuery(bucket: query): boolean; removeFilterQuery(bucket: any): void; /** * * @param bucket {query: ".." , label: ".."} * @returns {boolean} */ addField(bucket: query): boolean; removeField(bucket: any): void; }>; //# sourceMappingURL=search.d.ts.map