/// import { fsm2 } from "@heydovetail/ui-components"; import { EditorState, Plugin, Transaction } from "prosemirror-state"; import { Decoration, DecorationSet } from "prosemirror-view"; export interface ITag { id: string; title: string; color: string; count: number | null; } export interface GlossWithRange { rangeId: string; tagId: string; from: number; to: number; color: string; decoration: Decoration; } export interface PluginState { readonly type: "default"; readonly focusedRangeId: string | null; readonly strongRangeId: string | null; readonly selectionRangeId: string | null; readonly sortedGlosses: ReadonlyArray; readonly decorationSet: DecorationSet; } export declare const transition: (state: CurrentStateShape) => CurrentStateShape extends PluginState ? fsm2.Transition; }) => { sortedGlosses: ReadonlyArray; decorationSet: DecorationSet; focusedRangeId: string | null; strongRangeId: string | null; type: "default"; selectionRangeId: string | null; }; tr: (prev: PluginState, { tr, tagLookup, updateTagColors }: { tr: Transaction; tagLookup: Map; updateTagColors: boolean; }) => { sortedGlosses: ReadonlyArray; selectionRangeId: string | null; decorationSet: DecorationSet; type: "default"; focusedRangeId: string | null; strongRangeId: string | null; }; }; }, { default: { with: (prev: PluginState, options: { focusedRangeId?: string | null | undefined; strongRangeId?: string | null | undefined; doc: import("prosemirror-model").Node; }) => { sortedGlosses: ReadonlyArray; decorationSet: DecorationSet; focusedRangeId: string | null; strongRangeId: string | null; type: "default"; selectionRangeId: string | null; }; tr: (prev: PluginState, { tr, tagLookup, updateTagColors }: { tr: Transaction; tagLookup: Map; updateTagColors: boolean; }) => { sortedGlosses: ReadonlyArray; selectionRangeId: string | null; decorationSet: DecorationSet; type: "default"; focusedRangeId: string | null; strongRangeId: string | null; }; }; } extends { [key in CurrentStateShape["type"]]: infer T; } ? T : never> : never; declare const setPluginState: (env: { state: EditorState>; tr?: Transaction> | undefined; dispatch?: ((tr: Transaction>) => void) | undefined; }, newPluginState: PluginState | ((prevPluginState: PluginState) => PluginState)) => void, getPluginStateOrThrow: (source: EditorState | Transaction>) => PluginState; export { setPluginState, getPluginStateOrThrow }; export declare class HighlightDecorationPlugin extends Plugin { constructor(options: { defaultFocusedRangeId?: string; }); } export declare enum GlossWeight { Subtle = 0, Strong = 1, Focus = 2 } export interface Gloss { color: string; type: GlossWeight; }