import { EntityKind, EntityVerdict } from '../atoms/Chip'; /** The custom element the transform emits, mapped to a Chip when rendering. */ export declare const ENTITY_ELEMENT = "octopus-entity"; export interface EntitySpan { /** Start offset into the raw markdown source, inclusive. */ start: number; /** End offset into the raw markdown source, exclusive. */ end: number; kind: EntityKind; /** Canonical full value. What a copy action yields. */ value: string; /** Shortened text to display. Defaults to the marked source text. */ display?: string; /** Omit when the value was never resolved. */ verdict?: EntityVerdict; /** * Enrichment facts shown in the entity menu. Kept off the rendered element * and looked up by canonical value at open time, so nothing structural ends * up serialised into DOM attributes. */ attributes?: { label: string; value: string; }[]; } /** Minimal structural view of mdast, so this module needs no tree typings. */ interface MdNode { type: string; value?: string; children?: MdNode[]; position?: { start: { offset?: number; }; end: { offset?: number; }; }; data?: Record; } export interface ApplyEntitySpansOptions { /** * Cap on marked spans per top-level block. A summary genuinely dense with * indicators wants a table underneath it, not more chips inside it. */ maxPerBlock?: number; /** Reports spans that could not be applied. Defaults to a dev-only warning. */ onSkipped?: (span: EntitySpan, reason: string) => void; } /** * Rewrites text nodes in place so each applicable span becomes an entity node. * * Mutates the tree, which is what a remark transformer is expected to do. */ export declare function applyEntitySpans(tree: MdNode, spans: readonly EntitySpan[], options?: ApplyEntitySpansOptions): void; /** * remark plugin form, for `ReactMarkdown`'s `remarkPlugins`. * * @example remarkPlugins={[remarkGfm, [remarkEntitySpans, { spans }]]} */ export declare function remarkEntitySpans(options?: ApplyEntitySpansOptions & { spans?: readonly EntitySpan[]; }): (tree: MdNode) => void; export {};