import type { Transaction, TransactionSpec } from '@codemirror/state'; import { EditorView } from '@codemirror/view'; import { type MutableRefObject } from 'react'; import { AriaLabelingProps } from '../../../core/types/a11y-props.js'; import type { FilterFieldAutoSuggestionsContextProps } from '../contexts/FilterFieldContext.types.js'; import type { FilterFieldSuggestion, FilterFieldSuggestionProps } from '../suggestions/Suggestion.types.js'; import type { FilterFieldSuggestionsContext, InternalFilterFieldSuggestionsCallback } from '../suggestions/suggestions-extension.js'; import type { FilterFieldSuggestionsCallback } from '../types/suggestions.js'; import type { FilterFieldNodeBase } from '../types/tree-nodes.js'; import { type VirtualFocusItem } from '../utils/get-next-suggestion.js'; import type { FilterFieldSuggestionRecentPinnedSuggestion } from '../utils/suggestions-utils/recent-and-pinned-suggestions.js'; /** * Suggestion arrays can contain ReactNode values (e.g. icons on custom types). * In dev mode, React elements created via jsxDEV() (used by @vitejs/plugin-react-swc * with development:true) carry an _owner property pointing to the currently rendering * Fiber, which has circular back-references. JSON.stringify would throw on those. * The replacer intercepts React elements before _owner is traversed, replacing each * element with a stable string token derived from its type. * @internal */ export declare function stringifySuggestions(value: unknown): string; export declare function useSuggestions(props: { ariaDisabled: boolean | undefined; autoSuggestions: boolean; isOpen: boolean; id: string; suggestionsOverlayRef: MutableRefObject; editorViewRef: MutableRefObject; viewDispatch: (args: Transaction | TransactionSpec | TransactionSpec[]) => void; onSuggest?: FilterFieldSuggestionsCallback; hiddenInputRef: MutableRefObject; ariaLabelingProps?: AriaLabelingProps; }): { ariaAttributes: { 'aria-labelledby'?: string | undefined; 'aria-details'?: string | undefined; 'aria-describedby': string; 'aria-disabled'?: string | undefined; 'aria-activedescendant'?: string | undefined; 'aria-controls'?: string | undefined; 'aria-label': string; 'aria-autocomplete': string; 'aria-haspopup': string; }; autoSuggestionsConfig: FilterFieldAutoSuggestionsContextProps; recentSuggestionValues: FilterFieldSuggestionRecentPinnedSuggestion[]; pinnedSuggestionValues: FilterFieldSuggestionRecentPinnedSuggestion[]; logicalOperatorSuggestionValues: FilterFieldSuggestion[]; pastedContentSuggestionValues: FilterFieldSuggestion[]; searchSuggestionValues: FilterFieldSuggestion[]; fallbackKeySuggestionValues: FilterFieldSuggestion[]; statementSuggestionValues: FilterFieldSuggestion[]; focusedListItem: VirtualFocusItem | undefined; suggestionsContext: MutableRefObject; applySuggestion: (element: HTMLElement | null, value: string, trailing: string | undefined, insertionStrategy: FilterFieldSuggestionProps["insertionStrategy"], cursorBeforeTrailing: boolean | undefined, range: FilterFieldNodeBase["range"] | undefined, shouldEscapeSuggestion?: boolean) => void; handleNextSuggestion: (nextSuggestion: HTMLElement | null) => void; _onSuggest: InternalFilterFieldSuggestionsCallback; suggestionsOverlayHintId: string; };