diff --git a/src/actions/action_menu.ts b/src/actions/action_menu.ts index 4226ce4c..82f3eb36 100644 --- a/src/actions/action_menu.ts +++ b/src/actions/action_menu.ts @@ -86,8 +86,11 @@ export class ActionMenu { const node = cursor.getCurNode(); if (!node) return false; // TODO(google/blockly#8847): Add typeguard for IContextMenu in core when this moves over - const location = node.getLocation() as any; - if (location.showContextMenu) { + const location = node.getLocation(); + if ( + 'showContextMenu' in location && + typeof location.showContextMenu === 'function' + ) { location.showContextMenu(menuOpenEvent); } else { console.info(`No action menu for ASTNode of type ${node.getType()}`); diff --git a/src/keyboard_drag_strategy.ts b/src/keyboard_drag_strategy.ts index 0b4b3377..2bd4d1af 100644 --- a/src/keyboard_drag_strategy.ts +++ b/src/keyboard_drag_strategy.ts @@ -8,7 +8,6 @@ import { ASTNode, BlockSvg, ConnectionType, - LineCursor, RenderedConnection, dragging, utils,