import type { Extension } from '@codemirror/state'; import type { OverlayTriggerState } from '../../../overlays/hooks/useOverlay.js'; import type { FilterFieldSuggestion } from './Suggestion.js'; import type { useCachedTreeConversion } from '../hooks/useCachedTreeConversion.js'; import type { NumberFormatParser } from '../parser/getNumberParser.js'; import type { FilterFieldSuggestionsCallback } from '../types/suggestions.js'; import type { FilterFieldStatementNode, FilterFieldValueNode } from '../types/tree-nodes.js'; import type { FilterFieldValidatorMap } from '../types/validation.js'; /** @internal */ export type _FilterFieldSuggestionsContext = { token: FilterFieldValueNode; currentStatement: FilterFieldStatementNode | undefined; shouldEscapeSuggestion: boolean; }; /** @internal */ export type _FilterFieldSuggestionsCallback = (args: { suggestionsContext: _FilterFieldSuggestionsContext; autoSuggestionValues: FilterFieldSuggestion[]; }) => void; type SuggestionsExtensionProps = { overlayState: OverlayTriggerState; numberParser: NumberFormatParser; validatorMap?: FilterFieldValidatorMap; /** * Internal callback that is triggered whenever suggestions may need to be updated. * Used to update flags to determine which suggestions to show in the suggestions * overlay and update the suggestions context. */ _onSuggest: _FilterFieldSuggestionsCallback; /** Consumer callback triggered whenever suggestions may need to be updated. */ onSuggest?: FilterFieldSuggestionsCallback; /** Function to get the filter field syntax tree from the lezer syntax tree. */ getSyntaxTree: ReturnType['getSyntaxTree']; }; /** * @internal */ export declare const suggestionsExtension: ({ overlayState, numberParser, validatorMap, onSuggest, _onSuggest, getSyntaxTree, }: SuggestionsExtensionProps) => Extension; export {};