UNPKG

@blocknote/react

Version:

A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.

13 lines (12 loc) 760 B
import { BlockNoteEditor, BlockSchema, InlineContentSchema, StyleSchema } from "@blocknote/core"; /** * Returns the blocks that are currently selected in the editor. If no * multi-block selection exists, returns an array containing the single block * at the text cursor position. Re-renders automatically when the selection * changes. * * @param editor - The BlockNote editor instance. If omitted, uses the editor * from the nearest `BlockNoteContext`. * @returns An array of the currently selected blocks. */ export declare function useSelectedBlocks<BSchema extends BlockSchema, ISchema extends InlineContentSchema, SSchema extends StyleSchema>(editor?: BlockNoteEditor<BSchema, ISchema, SSchema>): import("@blocknote/core").Block<any, any, any>[];