import { DecorationSet, EditorView } from '@milkdown/kit/prose/view'; import { Fragment, Schema, Node as ProseMirrorNode } from '@milkdown/kit/prose/model'; import { ResolvedReviewSuggestionRange } from './types'; export type ParseSuggestionMarkdown = (markdown: string) => ProseMirrorNode | null | undefined; export type ParseProposedMd = ParseSuggestionMarkdown; export declare function looksLikeBlockSuggestion(markdown: string): boolean; /** * Unwrap parsed doc to the Fragment used for inline chips and apply/replace slices: * doc→single paragraph, or doc→blockquote→paragraph. */ export declare function unwrapParsedInline(parsed: ProseMirrorNode): Fragment; export declare function isFragmentInlineOnly(fragment: Fragment): boolean; /** * CommonMark / Milkdown often drop leading or trailing **horizontal** whitespace inside the parsed * paragraph; API `proposedText` still carries it for insert/replace UX (e.g. a space * after "1965." or before "(double album)"). Only spaces/tabs are restored at the edges; * newlines are not injected as text nodes (would break inline PM structure). */ export declare function inlineFragWithEdgeWs(schema: Schema, parsed: ProseMirrorNode, rawMarkdown: string): Fragment; export declare function disableSuggestionChipInteractions(el: HTMLElement): void; /** * Inline suggestion chip (insert/replace proposed text). Without `options`, renders * stripped plain text in a ``. With `options`, parses markdown via Milkdown * and serializes into the chip (typically a `
` so block content is valid). */ export declare function createInlineSuggestionElement(suggestionId: string, replacementMarkdown: string, isSelected: boolean, options?: { view: EditorView; parseMarkdown: ParseSuggestionMarkdown; }): HTMLSpanElement; export declare function createBlockSuggestionElement(suggestionId: string, replacementMarkdown: string, isSelected: boolean, options: { view: EditorView; parseMarkdown: ParseSuggestionMarkdown; }): HTMLDivElement; export declare function buildDecorationSetFromRanges(doc: ProseMirrorNode, ranges: ResolvedReviewSuggestionRange[], selectedId: string | null | undefined, parseMarkdown?: ParseSuggestionMarkdown): DecorationSet; export declare function expectedWidgetCountFromRanges(ranges: ResolvedReviewSuggestionRange[]): number; export declare function actualWidgetCountFromDecorations(decorations: DecorationSet): number;