Why can `getState` return undefined?

I upgraded to the latest prosemirror version and am wondering why the typing of the getState function declares undefined. According to the docs, this is a generic type, so as an api user, i should be able to decide myself if this can be undefined or not. Or am i missing something?

If no plugin with that key is present in the state, you’ll get undefined.