import { type ReactNode } from 'react'; /** The block the pointer is on: its §13.3 id, its element, and — in an editor — where it starts. */ export interface HandleBlock { /** `undefined` only for a block that has none yet, which nothing can address. */ id: string | undefined; element: HTMLElement; /** Position before the block in the editor's document; absent when reading. */ pos?: number; } /** What `EditorBlockHandle` hands this part to make it edit. A reading surface leaves it off. */ export interface BlockHandleEditing { /** The block level with `y`, in the editor's own document. */ find: (y: number) => HandleBlock | null; /** The editing rows, before the caller's. */ rows: (block: HandleBlock) => ReactNode; /** Starts the browser's drag of the block; the handle is draggable only with this. */ startDrag: (block: HandleBlock, event: globalThis.DragEvent) => void; /** Drops the dragged block before `target`, or after it: a drop in the gutter, where the editor has none. */ drop: (target: HandleBlock, after: boolean) => void; endDrag: () => void; /** Calls back when the document changes, so a block found before is found again. Returns the unsubscribe. */ onChange: (changed: () => void) => () => void; } export interface BlockHandleProps { /** The caller's own rows — a link to the block, a comment on it. Reading, they are the whole menu; with none, no handle is drawn. */ actions?: (block: HandleBlock) => ReactNode; /** Given by `EditorBlockHandle` (from `@estiva-app/ui/editor`). Leave it off to read. */ editing?: BlockHandleEditing; /** What the blocks are drawn in. Reading: a surface whose top-level elements carry `data-block-id`, as `RichText` draws. */ children: ReactNode; className?: string; } /** The last of `blocks` whose top is at or above `y` — the gap between two blocks belongs to the one before. */ export declare function blockAtY(blocks: readonly HandleBlock[], y: number): HandleBlock | null; /** * The handle at the left of the block under the pointer, and the block's menu * behind it. Reading, the menu is the caller's rows only, so someone who * cannot edit can still point at one block — copy a link to it, comment on * it. In an editor, `EditorBlockHandle` adds the drag, Turn into, Duplicate * and Delete. * * It sits in the gutter left of the content, 28px out, so wrapping the content * moves nothing. The gutter counts as the block's, as in Notion: the handle * stays while the pointer crosses to it. */ export declare function BlockHandle({ actions, editing, children, className }: BlockHandleProps): import("react").JSX.Element; //# sourceMappingURL=BlockHandle.d.ts.map