Tonight i chose to rely upon my (bad) memory of the api for some minutes.
It appeared i could feed several wrong stuff without even throwing an error:
tr.insert(from, from, what)
tr.replaceRangeWith(from, to, slice)
and i suppose replaceWith too. Just saying !
The library does not do type checking. JS code with explicit dynamic type checks inserted tends to be big, ugly, and rather wasteful, so I don’t plan to add them. If you want your types checked, something like TypeScript or Flow could help.
Arg, i’m still trying to figure out how to make tsc actually check types.
I installed latest typescript and @types/prosemirror-* modules, and
tsc --allowJs --checkJs --noEmit --lib es2015,dom src/editor.js
returns some errors, but does not find intentional errors that violate directly some prosemirror typescript definitions.
That’s why i’m still complaining…