Remove type casting from TS files

Bug: none
Change-Id: I385831924e3c40ea054a486cf025975675b0733b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5574912
Reviewed-by: Alina Varkki <[email protected]>
Commit-Queue: Nikolay Vitkov <[email protected]>
diff --git a/front_end/ui/legacy/ActionRegistration.ts b/front_end/ui/legacy/ActionRegistration.ts
index e61a0b0..c1d88ab 100644
--- a/front_end/ui/legacy/ActionRegistration.ts
+++ b/front_end/ui/legacy/ActionRegistration.ts
@@ -99,7 +99,7 @@
 const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
 
 export interface ActionDelegate {
-  handleAction(_context: Context, _actionId: string): boolean;
+  handleAction(context: Context, actionId: string): boolean;
 }
 
 export class Action extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
diff --git a/front_end/ui/legacy/ActionRegistry.ts b/front_end/ui/legacy/ActionRegistry.ts
index ddb352d..3aa71a4 100644
--- a/front_end/ui/legacy/ActionRegistry.ts
+++ b/front_end/ui/legacy/ActionRegistry.ts
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-import {getRegisteredActionExtensions, type Action, reset as resetActionRegistrations} from './ActionRegistration.js';
+import {type Action, getRegisteredActionExtensions, reset as resetActionRegistrations} from './ActionRegistration.js';
 import {Context} from './Context.js';
 
 let actionRegistryInstance: ActionRegistry|undefined;
@@ -56,8 +56,8 @@
     for (const actionId of actionIds) {
       const action = this.actionsById.get(actionId);
       if (action && action.enabled()) {
-        if (isActionApplicableToContextTypes((action as Action), context.flavors())) {
-          applicableActions.push((action as Action));
+        if (isActionApplicableToContextTypes(action, context.flavors())) {
+          applicableActions.push(action);
         }
       }
     }
diff --git a/front_end/ui/legacy/ViewManager.ts b/front_end/ui/legacy/ViewManager.ts
index 792165d..c96db6a 100644
--- a/front_end/ui/legacy/ViewManager.ts
+++ b/front_end/ui/legacy/ViewManager.ts
@@ -15,7 +15,7 @@
 import {type EventData, Events as TabbedPaneEvents, TabbedPane} from './TabbedPane.js';
 import {type ItemsProvider, Toolbar, type ToolbarItem, ToolbarMenuButton} from './Toolbar.js';
 import {createTextChild} from './UIUtils.js';
-import {type TabbedViewLocation, type View, type ViewLocation, type ViewLocationResolver} from './View.js';
+import {type TabbedViewLocation, type View, type ViewLocation} from './View.js';
 import viewContainersStyles from './viewContainers.css.legacy.js';
 import {
   getLocalizedViewLocationCategory,
@@ -314,7 +314,7 @@
 
   async resolveLocation(location?: string): Promise<Location|null> {
     if (!location) {
-      return Promise.resolve(null) as Promise<Location|null>;
+      return null;
     }
     const registeredResolvers = getRegisteredLocationResolvers().filter(resolver => resolver.name === location);
 
@@ -322,7 +322,7 @@
       throw new Error('Duplicate resolver for location: ' + location);
     }
     if (registeredResolvers.length) {
-      const resolver = (await registeredResolvers[0].loadResolver() as ViewLocationResolver);
+      const resolver = await registeredResolvers[0].loadResolver();
       return resolver.resolveLocation(location) as Location | null;
     }
     throw new Error('Unresolved location: ' + location);