Open pvande opened 2 years ago
That static method doesn't appear to be part of the public interface, so you can't really expect anything from it.
On the one hand, I agree — GapCursor.findGapCursorFrom
is explicitly marked @internal
, and is therefore at best an unreliable interface.
On the other hand, Selection.findFrom
is a documented member of the public interface, inherited by all Selection subclasses. Furthermore, GapCursor.findFrom
is assigned, but never used within the prosemirror-gapcursor
library (though I suspect that this was intended as a nod towards backwards compatibility after the TS refactor).
While upgrading my ProseMirror libraries, I was greeted with type errors in a small section of code:
Specifically, the error I received noted that
GapCursor.findFrom
should, perSelection.findFrom
, returnSelection | null
, while theGapCursor
constructor requires aResolvedPos
.Digging into this a little more deeply, it seems that
GapCursor
doesn't actually documentfindFrom
, but aliases this public method to the (internal)findGapCursorFrom
, which returns aResolvedPos
.