@atlaskit/editor-plugin-type-ahead
Version:
Type-ahead plugin for @atlaskit/editor-core
40 lines (39 loc) • 1.54 kB
TypeScript
/**
* @jsxRuntime classic
* @jsx jsx
*/
import React from 'react';
import { jsx } from '@emotion/react';
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
import type { TypeAheadItem } from '@atlaskit/editor-common/types';
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
import { CloseSelectionOptions } from '../pm-plugins/constants';
type InputQueryProps = {
activeDescendantId?: string;
cancel: (props: {
addPrefixTrigger: boolean;
forceFocusOnEditor: boolean;
setSelectionAt: CloseSelectionOptions;
text: string;
}) => void;
editorView: EditorView;
forceFocus: boolean;
/**
* @private
* @deprecated Pass `optionCount` instead.
*/
items?: TypeAheadItem[];
listId?: string;
onItemSelect: (mode: SelectItemMode) => void;
onQueryChange: (query: string) => void;
onQueryFocus: () => void;
onUndoRedo?: (inputType: 'historyUndo' | 'historyRedo') => boolean;
optionCount?: number;
reopenQuery?: string;
selectNextItem: () => void;
selectPreviousItem: () => void;
shouldKeepOpenOnRegisteredMenu?: boolean;
triggerQueryPrefix: string;
};
export declare const InputQuery: React.MemoExoticComponent<({ activeDescendantId, triggerQueryPrefix, cancel, onQueryChange, onItemSelect, selectNextItem, selectPreviousItem, forceFocus, reopenQuery, onQueryFocus, onUndoRedo, editorView, items, listId, optionCount, shouldKeepOpenOnRegisteredMenu, }: InputQueryProps) => jsx.JSX.Element>;
export {};