[docs]classNotificationHandle(NotificationProps,AssignablePropsBase[_NotificationHandleState]):"""Handle for a notification in our visualizer."""def__init__(self,impl:_NotificationHandleState)->None:self._impl=impl@overridedef_queue_update(self,name:str,value:Any)->None:# Send the full props each time; the redundancy key collapses# successive updates to "latest wins".delname,valueself._impl.websock_interface.queue_message(NotificationUpdateMessage(self._impl.uuid,self._impl.props))def_show(self)->None:"""Emit the initial NotificationShowMessage."""self._impl.websock_interface.queue_message(NotificationShowMessage(self._impl.uuid,self._impl.props))
[docs]defremove(self)->None:ifself._impl.removed:warnings.warn("Attempted to remove an already removed NotificationHandle.",stacklevel=2,)returnself._impl.removed=Trueself._impl.websock_interface.queue_message(RemoveNotificationMessage(self._impl.uuid))