How to get the state of the history plugin?

After looking through the soruce code of the collab and history plugins, I see you always get the state of these by means of the plugin key. But the history plugin key is not exported, so how do I get to the plugin state then?

My guess is that you don’t want us to directly read for example:

view.state.history$.done.eventCount

What do you want to do with that state? It doesn’t have a documented type, so indeed, there’s not much you’d be able to do with it.

I want to see how many undo or redo steps there currently in order to build my UI in other parts of the DOM. I just need read access.

That’s what undoDepth and redoDepth do.

Ah, right. I had actually used these earlier. Thanks!