/** * Block deletion helpers. * * The slide renders markdown as a list of chunks; each rendered block element * is tagged (via `data-md-chunk` / `data-md-start` / `data-md-end`) with the * chunk it belongs to and its 1-based source line range *within that chunk's * content*. When a user highlights text we resolve the highlight to the * top-level blocks it touches, then splice those blocks' source lines out of * the full slide content. * * Mapping chunk-relative line ranges back to the full `content` relies on the * fact that each `markdown_chunk.content` is an exact substring of the slide * content (the parser slices without trimming what it stores), so a chunk's * absolute character offset can be recovered with a forward `indexOf`. */ export interface BlockDeletionTarget { /** Index of the chunk in the slide's chunk list. */ chunkIndex: number; /** 1-based, inclusive start line relative to the chunk's content. */ startLine: number; /** 1-based, inclusive end line relative to the chunk's content. */ endLine: number; } export interface ResolvedDeletion { /** Slide content with the targeted blocks removed. */ newContent: string; /** The exact source text that was removed. */ removedText: string; /** Absolute character ranges removed from `content` (merged, sorted). */ ranges: Array<{ start: number; end: number; }>; } interface ChunkLike { content: string; } /** * Resolve each chunk's absolute character offset within `content`. Chunks * whose content can't be located resolve to -1. A forward cursor keeps the * search monotonic so duplicate chunk bodies still map to distinct offsets. */ export declare function computeChunkOffsets(content: string, chunks: ChunkLike[]): number[]; /** * Compute the result of deleting `targets` from `content`. Overlapping or * adjacent ranges are merged; each block's trailing newline is consumed so the * surrounding text collapses cleanly. */ export declare function computeDeletion(content: string, chunks: ChunkLike[], targets: BlockDeletionTarget[]): ResolvedDeletion; /** * Delete an exact source character range (precise "text" deletion). The * offsets are relative to the owning chunk's content; they're mapped to the * full slide content via the chunk's absolute offset. */ export declare function computeTextDeletion(content: string, chunks: ChunkLike[], chunkIndex: number, startOffset: number, endOffset: number): ResolvedDeletion; export {}; //# sourceMappingURL=blockDeletion.d.ts.map