mirror of
https://github.com/google/blockly.git
synced 2026-01-08 09:30:06 +01:00
* chore(deps): Add pretter-plugin-organize-imports * chore: Remove insignificant blank lines in import sections Since prettier-plugin-organize-imports sorts imports within sections separated by blank lines, but preserves the section divisions, remove any blank lines that are not dividing imports into meaningful sections. Do not remove blank lines separating side-effect-only imports from main imports. * chore: Remove unneded eslint-disable directives * chore: Organise imports
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2024 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import {CommentState} from '../icons/comment_icon.js';
|
|
import {IconType} from '../icons/icon_types.js';
|
|
import {Size} from '../utils/size.js';
|
|
import {IHasBubble, hasBubble} from './i_has_bubble.js';
|
|
import {IIcon, isIcon} from './i_icon.js';
|
|
import {ISerializable, isSerializable} from './i_serializable.js';
|
|
|
|
export interface ICommentIcon extends IIcon, IHasBubble, ISerializable {
|
|
setText(text: string): void;
|
|
|
|
getText(): string;
|
|
|
|
setBubbleSize(size: Size): void;
|
|
|
|
getBubbleSize(): Size;
|
|
|
|
saveState(): CommentState;
|
|
|
|
loadState(state: CommentState): void;
|
|
}
|
|
|
|
/** Checks whether the given object is an ICommentIcon. */
|
|
export function isCommentIcon(obj: object): obj is ICommentIcon {
|
|
return (
|
|
isIcon(obj) &&
|
|
hasBubble(obj) &&
|
|
isSerializable(obj) &&
|
|
(obj as any)['setText'] !== undefined &&
|
|
(obj as any)['getText'] !== undefined &&
|
|
(obj as any)['setBubbleSize'] !== undefined &&
|
|
(obj as any)['getBubbleSize'] !== undefined &&
|
|
obj.getType() === IconType.COMMENT
|
|
);
|
|
}
|