I’d like to hide implementation details, so I’d do: https://www.typescriptlang.org/play/?#code/JYOwLgpgTgZghgYwgAgJIgVCBbC4D2UyA3gFDLKgIAUAlAFzIBu+wAJqQL6kwCuGYYPhDJMEOJHRjcBKACZqCXlCzhkAXmQAGBmgxYZYQiXLIsYZSLIUKVOiZs2lKvGADUbgNymKnADSm3NxAA
(Looking at the code right now, I realize that I should change the interface because with only .inc():void there is no way to retrieve the current counter. But that doesn’t change the basic challenge.)