Closed pixelzoom closed 2 years ago
Hmm... Some evidence in Sim.ts that modalNodeStack should be PopupableNode, which does implement hide
:
public hidePopup( popup: PopupableNode, isModal: boolean ): void {
assert && assert( popup && this.modalNodeStack.includes( popup ) );
The above commit works, and allowed me to proceed with converting BarrierRectangle. Closing.
Encountered when trying to port BarrierRectangle.js to TS.
In Sim.js, @samreid ported
modalNodeStack
like this:Node is an incorrect type here. Looking at BarrierRectangle, the only place that takes
modalNodeStack
as an input:So it doesn't need to be a Node at all, just something that implements
hide: () => void
. Creating a type just for that seems a little odd. It would be nice it that were Popupable, but it's not. Maybe something like this in BarrierRectangle?Suggestions on how to proceed?