import { MilkdownPlugin } from '@milkdown/kit/ctx'; import { Info, State } from 'mdast-util-to-markdown'; import { Parents } from 'mdast'; /** * ProseMirror mark registered as `highlight` in the schema. * * - **DOM** — Renders as `` so HTML paste and copy round-trip with the same tag. * - **Markdown** — Expects companion mdast nodes with `type: 'highlight'` (produced by the remark * transform below, not by stock GFM). Serializes back through `toMarkdown` + the custom stringify * handler in `configure.ts`. */ export declare const highlightSchema: import('@milkdown/utils').$MarkSchema<"highlight">; /** Command used by the formatting toolbar; toggles the highlight mark on the active selection. */ export declare const toggleHighlightCommand: import('@milkdown/utils').$Command; /** * When the user types closing `==` after `==some text`, wraps the inner span in the highlight mark * and strips the delimiters (same idea as GFM `~~` strikethrough input rules). * * Regex groups: `(==)` `([^=\n]+)` `\1` — `markRule` uses the **last** capture group as the marked * span, so the middle group must be the highlighted text. Lookbehind/lookahead avoid matching four * or more equals in a row as a single highlight. */ export declare const highlightInputRule: import('@milkdown/utils').$InputRule; /** * Remark/unified plugin: mutates the mdast between parse and the Milkdown schema parser. * Must run in the remark pipeline **before** the document is converted to ProseMirror. */ export declare const remarkHighlightSyntax: import('@milkdown/utils').$Remark<"brainfish-highlight-syntax", unknown>; /** * Passed into `remarkStringifyOptionsCtx.unsafe` in `configure.ts`. * Declares that `=` may appear in phrasing in ways that are “unsafe” by default but are intentional * for our `==highlight==` delimiter pair. */ export declare const highlightMdastUnsafe: { character: string; inConstruct: "phrasing"; notInConstruct: ("autolink" | "destinationLiteral" | "destinationRaw" | "reference" | "titleQuote" | "titleApostrophe")[]; }[]; /** * Serializes mdast `highlight` nodes to markdown `==...==`. * * Mirrors the structure of GFM strikethrough’s `delete` handler: tracker + `containerPhrasing` keep * line wrapping and nesting correct. `state.enter('highlight', …)` is cast because mdast’s * `ConstructName` union does not include our custom node name. */ export declare function highlightMarkdownHandler(node: Parents, _: unknown, state: State, info: Info): string; /** * All Milkdown plugins for this feature, in registration order: * 1. Remark transform (syntax in mdast) * 2. Mark schema * 3. Input rule * 4. Toggle command */ export declare const textHighlightPlugin: MilkdownPlugin[];