import * as React from 'react'; import type { IBaseFloatingSuggestionsProps, IBaseFloatingPickerHeaderFooterProps } from '../../../FloatingSuggestionsComposite/FloatingSuggestions.types'; import type { IFloatingSuggestionItemProps } from '../../../FloatingSuggestionsComposite/FloatingSuggestionsItem/FloatingSuggestionsItem.types'; import type { EditingItemComponentProps } from '../EditableItem'; import type { JSXElement } from '@fluentui/utilities'; export interface IDefaultEditingItemInnerProps extends React.HTMLAttributes { /** * The current item of the EditingItem */ item: TItem; /** * Callback for when the edited item's new value has been selected. * Invoked indirectly by the picker mounted by onRenderFloatingPicker. */ onEditingComplete: (oldItem: TItem, newItem: TItem) => void; /** * Callback for when the FloatingSuggestions is dismissed */ onDismiss?: () => void; /** * Renders the floating suggestions for suggesting the result of the item edit. * * Not actually optional, since is what is needed to resolve the new item. */ onRenderFloatingPicker?: React.ComponentType>; /** * Callback for when the editing item removes the item from the well * * Called when the item is currently being edited and the text length goes to zero */ onRemoveItem?: (item: TItem) => void; /** * Callback used by the EditingItem to populate the initial value of the editing item */ getEditingItemText: (item: TItem) => string; /** * Callback used to retrieve the suggestions to show in the floating suggestions */ getSuggestions: (value: string) => IFloatingSuggestionItemProps[]; /** * The header and footer props for the floating picker * This should be set here instead of in onRenderFloatingPicker if you want them to be keyboard selectable */ pickerSuggestionsProps?: IBaseFloatingPickerHeaderFooterProps; /** * Function that specifies how arbitrary text entered into the edit input is handled. */ createGenericItem?: (input: string) => TItem; } export type EditingItemInnerFloatingPickerProps = Pick, 'componentRef' | 'suggestions' | 'onSuggestionSelected' | 'targetElement' | 'onRemoveSuggestion' | 'onFloatingSuggestionsDismiss' | 'onKeyDown' | 'selectedSuggestionIndex' | 'selectedHeaderIndex' | 'selectedFooterIndex' | 'pickerSuggestionsProps'>; /** * Wrapper around an item in a selection well that renders an item with a context menu for * replacing that item with another item. */ export declare const DefaultEditingItemInner: (props: IDefaultEditingItemInnerProps) => JSXElement; type EditingItemProps = Pick, Exclude, keyof EditingItemComponentProps>>; export declare const DefaultEditingItem: (outerProps: EditingItemProps) => ((innerProps: EditingItemComponentProps) => JSXElement); export {};