Question about ResolvedPos start at depth 0

Hey, as I was again twiddling with ResolvePos, I noticed that ProseMirror Reference manual (as well as end I suppose) never point to the node pos at the given depth but inside it.

For example in if I resolve the pos within the second paragraph view.state.doc.resolve(30).start(2) returns 18 which sure enough, using nodeAt resolves into the text node using view.state.doc.nodeAt(18). However, if I use view.state.doc.resolve(30).start(1) this returns 17 which still resolves to the same text node. And moreover, using view.state.doc.resolve(30).start(0) returns 0, the start of the document which is kinda pointless since does that ever change?

Is this correct? Shouldn’t start & end work differently and return the actual positions of the nodes at said depth?

EDIT: Oh I see. before & after were the methods I was looking for. Hmm well I would deprecate the start & end as IMO there should be just one good way of doing this. Kinda confusing. And it seems with before using before(0) just throws an error which seems kinda clunky to have to if this myself but I digress.

Text nodes aren’t real nodes for the purpose of this kind of resolution. They hold a bunch of characters, but they don’t really contribute to the structure of the document. As such, resolution doesn’t treat them like a new ‘level’ in the tree.

Sure, nodeAt isn’t maybe really applicable here. But I would still argue having two sets of methods that practically do the same thing is little unintuitive and perhaps even harmful as even I, who has used ProseMirror for a while now, can’t figure this out immediately. Not mentioning someone with little experience who might be absolutely baffled why start(0) always returns 0 and the next results aren’t directly mappable as node positions. Anyway, this is just a small annoyance I noticed.

EDIT: And just as a minor addition to why this should be reworked: going out of bounds with eg start(51) returns NaN whereas before(51) returns undefined or an error for before(0). It’d interesting to have a poll what people thought to add nodeStart nodeEnd to deprecate them both.