mirror of
https://github.com/google/blockly.git
synced 2026-01-10 10:27:08 +01:00
feat!: Add support for preserving block comment locations. (#8231)
* feat: Add support for preserving block comment locations. * chore: format the tests.
This commit is contained in:
@@ -8,6 +8,7 @@ import {IconType} from '../icons/icon_types.js';
|
||||
import {CommentState} from '../icons/comment_icon.js';
|
||||
import {IIcon, isIcon} from './i_icon.js';
|
||||
import {Size} from '../utils/size.js';
|
||||
import {Coordinate} from '../utils/coordinate.js';
|
||||
import {IHasBubble, hasBubble} from './i_has_bubble.js';
|
||||
import {ISerializable, isSerializable} from './i_serializable.js';
|
||||
|
||||
@@ -20,6 +21,10 @@ export interface ICommentIcon extends IIcon, IHasBubble, ISerializable {
|
||||
|
||||
getBubbleSize(): Size;
|
||||
|
||||
setBubbleLocation(location: Coordinate): void;
|
||||
|
||||
getBubbleLocation(): Coordinate | undefined;
|
||||
|
||||
saveState(): CommentState;
|
||||
|
||||
loadState(state: CommentState): void;
|
||||
@@ -35,6 +40,8 @@ export function isCommentIcon(obj: Object): obj is ICommentIcon {
|
||||
(obj as any)['getText'] !== undefined &&
|
||||
(obj as any)['setBubbleSize'] !== undefined &&
|
||||
(obj as any)['getBubbleSize'] !== undefined &&
|
||||
(obj as any)['setBubbleLocation'] !== undefined &&
|
||||
(obj as any)['getBubbleLocation'] !== undefined &&
|
||||
obj.getType() === IconType.COMMENT
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user