import { fsm2 } from "@heydovetail/ui-components"; import { Plugin, Transaction } from "prosemirror-state"; import { Range } from "./types"; import { Step } from "prosemirror-transform"; interface PluginState { readonly type: "default"; /** * Ranges sorted by `range.from`. */ readonly sortedRanges: ReadonlyArray; } export declare const updateRangesFromSteps: (sortedRanges: ReadonlyArray, steps: Step[]) => ReadonlyArray; export declare const transition: (state: CurrentStateShape) => CurrentStateShape extends PluginState ? fsm2.Transition; }) => { type: "default"; sortedRanges: ReadonlyArray; }; }; }, { default: { tr: (prev: PluginState, { tr }: { tr: Transaction; }) => { type: "default"; sortedRanges: ReadonlyArray; }; }; } extends { [key in CurrentStateShape["type"]]: infer T; } ? T : never> : never; declare const getPluginStateOrThrow: (source: import("prosemirror-state").EditorState | Transaction>) => PluginState; export { PluginState, getPluginStateOrThrow }; /** * Track ranges in a document. * * This is kept as its own plugin (and not merged with `HighlightPlugin`) * primarily because it's anticipated that comments will use the same range * infrastructure as highlights, and so having ranges be managed by a single * dedicated plugin with its own transform steps avoids coupling to any * particular usage. */ export declare class RangePlugin extends Plugin { constructor(ranges?: ReadonlyArray, scrollToRangeId?: string); }