refactor: remove AnyDuringMigration from browser events (#6303)

* fix: bind data

* fix: use correct event types

* fix: make event happy with us clueging properties onto it

* fix: change thisObject to type Object | null

* chore: format

* chore: call out event conversion wierdness

* chore: fix build by changing things to use MouseEvent

* chore: remove default value for object

* fix: unbind trying to get an element of an empty array

* chore: format

* fix: call out potentially unsafe element access.

* chore: add issue number to TODO

* fix: attempt to fix CI build error?
This commit is contained in:
Beka Westberg
2022-08-04 17:35:02 +00:00
committed by GitHub
parent f70f82327b
commit dc44c66057
12 changed files with 55 additions and 57 deletions

View File

@@ -132,7 +132,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout {
/**
* Opaque data that can be passed to Blockly.unbindEvent_.
*/
private eventWrappers_: AnyDuringMigration[][] = [];
private eventWrappers_: browserEvents.Data = [];
/**
* Function that will be registered as a change listener on the workspace
@@ -904,7 +904,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout {
*/
private blockMouseDown_(block: BlockSvg): Function {
const flyout = this;
return (e: Event) => {
return (e: MouseEvent) => {
const gesture = flyout.targetWorkspace.getGesture(e);
if (gesture) {
gesture.setStartBlock(block);
@@ -917,7 +917,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout {
* Mouse down on the flyout background. Start a vertical scroll drag.
* @param e Mouse down event.
*/
private onMouseDown_(e: Event) {
private onMouseDown_(e: MouseEvent) {
const gesture = this.targetWorkspace.getGesture(e);
if (gesture) {
gesture.handleFlyoutStart(e, this);