kapouer
October 5, 2017, 11:07pm
#1
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.insert(from, slice)
tr.replaceRangeWith(from, to, slice)
and i suppose replaceWith too. Just saying !
marijn
October 6, 2017, 9:55am
#2
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.
kapouer
October 6, 2017, 11:10am
#3
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…