import { type RefObject } from 'react'; import type { BlockDeletionTarget } from './blockDeletion'; export declare const BLOCK_SELECTED_ATTR = "data-md-selected"; export type DeletionMode = 'block' | 'text'; interface SelectionAnchor { /** * Position for the floating action button, relative to the slide root's * scrolled content. `top`/`bottom` are the selection's top/bottom edges and * `left` is its right edge; the consumer clamps the button within the slide. */ top: number; bottom: number; left: number; } export type ResolvedDeletionSelection = { kind: 'block'; targets: BlockDeletionTarget[]; anchor: SelectionAnchor; } | { kind: 'text'; chunkIndex: number; startOffset: number; endOffset: number; anchor: SelectionAnchor; }; interface UseBlockSelectionParams { rootRef: RefObject; /** When false the hook is inert (no listeners, no resolution). */ enabled: boolean; /** * 'block' resolves a highlight to whole top-level blocks; 'text' resolves it * to the exact source character range, falling back to block resolution when * the precise range can't be determined. */ mode: DeletionMode; } interface UseBlockSelectionResult { selection: ResolvedDeletionSelection | null; /** Clear the current selection outline + state. */ clear: () => void; } /** * Resolve a live text highlight inside `rootRef` to a deletion target. In * 'text' mode this is the exact source character range under the highlight; in * 'block' mode (or when a precise range can't be resolved) it's the outermost * top-level block(s) the highlight overlaps. */ export declare function useBlockSelection({ rootRef, enabled, mode, }: UseBlockSelectionParams): UseBlockSelectionResult; export {}; //# sourceMappingURL=useBlockSelection.d.ts.map