@@ -10,6 +10,7 @@ import { type EditorView } from "prosemirror-view";
1010import { findSuggestionMarkEnd } from "./findSuggestionMarkEnd.js" ;
1111import { suggestChangesKey } from "./plugin.js" ;
1212import { getSuggestionMarks } from "./utils.js" ;
13+ import { type SuggestionId } from "./generateId.js" ;
1314
1415/**
1516 * Given a node and a transform, add a set of steps to the
@@ -24,7 +25,7 @@ function applySuggestionsToTransform(
2425 tr : Transform ,
2526 markTypeToApply : MarkType ,
2627 markTypeToRevert : MarkType ,
27- suggestionId ?: number ,
28+ suggestionId ?: SuggestionId ,
2829 from ?: number ,
2930 to ?: number ,
3031) {
@@ -144,7 +145,7 @@ function revertModifications(node: Node, pos: number, tr: Transform) {
144145
145146function modificationIsInSet (
146147 modification : MarkType ,
147- id : number | undefined ,
148+ id : SuggestionId | undefined ,
148149 marks : readonly Mark [ ] ,
149150) {
150151 const mark = modification . isInSet ( marks ) ;
@@ -159,7 +160,7 @@ function applyModificationsToTransform(
159160 node : Node ,
160161 tr : Transform ,
161162 dir : number ,
162- suggestionId ?: number ,
163+ suggestionId ?: SuggestionId ,
163164 from ?: number ,
164165 to ?: number ,
165166) {
@@ -243,6 +244,7 @@ export function applySuggestionsToRange(doc: Node, from: number, to: number) {
243244 doc ,
244245 transform ,
245246 1 ,
247+ undefined ,
246248 nodeRange . start ,
247249 nodeRange . end ,
248250 ) ;
@@ -281,7 +283,7 @@ export function applySuggestions(
281283 * The insertion mark and modification mark will be removed, and their
282284 * contents left in the doc.
283285 */
284- export function applySuggestion ( suggestionId : number ) : Command {
286+ export function applySuggestion ( suggestionId : SuggestionId ) : Command {
285287 return ( state , dispatch ) => {
286288 const { deletion, insertion } = getSuggestionMarks ( state . schema ) ;
287289
@@ -328,7 +330,7 @@ export function revertSuggestions(
328330 * The deletion mark will be removed, and their contents left in the doc.
329331 * Modifications tracked in modification marks will be reverted.
330332 */
331- export function revertSuggestion ( suggestionId : number ) : Command {
333+ export function revertSuggestion ( suggestionId : SuggestionId ) : Command {
332334 return ( state , dispatch ) => {
333335 const { deletion, insertion } = getSuggestionMarks ( state . schema ) ;
334336
@@ -351,7 +353,7 @@ export function revertSuggestion(suggestionId: number): Command {
351353/**
352354 * Command that updates the selection to cover an existing change.
353355 */
354- export function selectSuggestion ( suggestionId : number ) : Command {
356+ export function selectSuggestion ( suggestionId : SuggestionId ) : Command {
355357 return ( state , dispatch ) => {
356358 const { deletion, insertion, modification } = getSuggestionMarks (
357359 state . schema ,
0 commit comments