mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
refactor: Remove uses of AnyDuringMigration from scrollbar.ts, workspace_svg.ts, contextmenu_registry.ts, and component_manager.ts (#6318)
* refactor: Remove uses of AnyDuringMigration from scrollbar.ts. * refactor: Remove almost all uses of AnyDuringMigration from workspace_svg.ts. * refactor: Remove uses of AnyDuringMigration from contextmenu_registry.ts. * refactor: Remove uses of AnyDuringMigration from component_manager.ts. * refactor: Use String() rather than toString(). * fix: Fix lint and build errors.
This commit is contained in:
@@ -84,7 +84,7 @@ export class ContextMenuRegistry {
|
||||
*/
|
||||
getContextMenuOptions(scopeType: ScopeType, scope: Scope):
|
||||
ContextMenuOption[] {
|
||||
const menuOptions: AnyDuringMigration[] = [];
|
||||
const menuOptions: ContextMenuOption[] = [];
|
||||
for (const item of this.registry_.values()) {
|
||||
if (scopeType === item.scopeType) {
|
||||
const precondition = item.preconditionFn(scope);
|
||||
@@ -126,15 +126,15 @@ export namespace ContextMenuRegistry {
|
||||
* to callback and displayText functions that depend on this information.
|
||||
*/
|
||||
export interface Scope {
|
||||
block: BlockSvg|undefined;
|
||||
workspace: WorkspaceSvg|undefined;
|
||||
block?: BlockSvg;
|
||||
workspace?: WorkspaceSvg;
|
||||
}
|
||||
|
||||
/**
|
||||
* A menu item as entered in the registry.
|
||||
*/
|
||||
export interface RegistryItem {
|
||||
callback: (p1: Scope) => AnyDuringMigration;
|
||||
callback: (p1: Scope) => void;
|
||||
scopeType: ScopeType;
|
||||
displayText: ((p1: Scope) => string)|string;
|
||||
preconditionFn: (p1: Scope) => string;
|
||||
@@ -148,7 +148,7 @@ export namespace ContextMenuRegistry {
|
||||
export interface ContextMenuOption {
|
||||
text: string;
|
||||
enabled: boolean;
|
||||
callback: (p1: Scope) => AnyDuringMigration;
|
||||
callback: (p1: Scope) => void;
|
||||
scope: Scope;
|
||||
weight: number;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ export namespace ContextMenuRegistry {
|
||||
export interface LegacyContextMenuOption {
|
||||
text: string;
|
||||
enabled: boolean;
|
||||
callback: (p1: Scope) => AnyDuringMigration;
|
||||
callback: (p1: Scope) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user