@blocknote/react
Version:
A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.
19 lines (18 loc) • 635 B
TypeScript
import { DefaultSuggestionItem } from "@blocknote/core";
/**
* Although any arbitrary data can be passed as suggestion items, the built-in
* UI components such as `MantineSuggestionMenu` expect a shape that conforms to DefaultSuggestionItem
*/
export type DefaultReactSuggestionItem = Omit<DefaultSuggestionItem, "key"> & {
icon?: JSX.Element;
size?: "default" | "small";
};
/**
* Props passed to a suggestion menu component
*/
export type SuggestionMenuProps<T> = {
items: T[];
loadingState: "loading-initial" | "loading" | "loaded";
selectedIndex: number | undefined;
onItemClick?: (item: T) => void;
};