Files
blockly/core/interfaces/i_has_bubble.ts
Beka Westberg 07db0c27d1 feat: add IIcon interface, and related interfaces (#7054)
* feat: add IIcon interface

* feat: add ISerializable interface

* feat: add IHasBubble interface

* feat: add type guards for icon interfaces

* chore: PR comments
2023-05-09 10:13:44 -07:00

21 lines
538 B
TypeScript

/**
* @license
* Copyright 2023 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export interface IHasBubble {
/** @return True if the bubble is currently open, false otherwise. */
isBubbleVisible(): boolean;
/** Sets whether the bubble is open or not. */
setBubbleVisible(visible: boolean): void;
}
/** Type guard that checks whether the given object is a IHasBubble. */
export function hasBubble(obj: any): obj is IHasBubble {
return obj.isBubbleVisible !== undefined &&
obj.setBubbleVisible !== undefined;
}