import { Plugin, PluginKey } from 'prosemirror-state'; import { DecorationSet } from 'prosemirror-view'; import { Editor } from './Editor.js'; export type TrackedRangeSpec = { id: string; type: string; metadata?: Record; kind?: 'range' | 'point'; inclusiveStart?: boolean; inclusiveEnd?: boolean; }; export type ResolvedRange = { id: string; from: number; to: number; spec: TrackedRangeSpec; }; type TrackablePosition = { blockId: string; offset: number; }; type TrackableInlineAnchor = { start: TrackablePosition; end: TrackablePosition; }; type TrackableNodeAddress = { kind: 'inline'; anchor: TrackableInlineAnchor; } | { kind: 'block'; nodeId: string; nodeType?: string; }; type TrackableFindNodeItem = { address?: TrackableNodeAddress; }; type TrackNodeInput = TrackableNodeAddress | TrackableFindNodeItem; type ScrollBlock = 'start' | 'center' | 'end' | 'nearest'; export type PositionTrackerState = { decorations: DecorationSet; generation: number; }; export declare const positionTrackerKey: PluginKey; export declare function createPositionTrackerPlugin(): Plugin; export declare class PositionTracker { #private; constructor(editor: Editor); track(from: number, to: number, spec: Omit): string; trackMany(ranges: Array<{ from: number; to: number; spec: Omit; }>): string[]; trackNode(input: TrackNodeInput, spec?: Omit): string | null; trackNodes(inputs: TrackNodeInput[], spec?: Omit): Array; untrack(id: string): void; untrackMany(ids: string[]): void; untrackByType(type: string): void; resolve(id: string): ResolvedRange | null; resolveMany(ids: string[]): Map; findByType(type: string): ResolvedRange[]; goToTracked(id: string, options?: { block?: ScrollBlock; }): boolean; get generation(): number; } export {}; //# sourceMappingURL=PositionTracker.d.ts.map