ProseMirror is now a TypeScript project

Ok, you may be right about the extra strictness, that could be noUncheckedIndexedAccess. I will check that and report back.

To your question, I copied those type declarations from the DT types for prosemirror-model, and they did actually properly infer N and M. At least I never manually specified them, so I am assuming they were inferred.