Chore: Improve some types (#64675)

* some type fixes

* few more

* more type fixes

* fix the majority of (window as any) calls

* don't make new variable for event

* few more

* MOAR
This commit is contained in:
Ashley Harrison
2023-03-14 09:51:44 +00:00
committed by GitHub
parent aade4b0bd2
commit 53186c14a4
73 changed files with 256 additions and 436 deletions

View File

@@ -10,7 +10,7 @@ type WithGrafanaRuntime<T> = T & {
};
const hasGrafanaRuntime = <T>(obj: T): obj is WithGrafanaRuntime<T> => {
return typeof (obj as any)?.grafanaRuntime === 'object';
return 'grafanaRuntime' in obj;
};
e2e.benchmark({

View File

@@ -88,14 +88,14 @@ e2e.scenario({
},
});
const expectInspectorResultAndClose = (expectCallBack: (keys: any[]) => void) => {
const expectInspectorResultAndClose = (expectCallBack: (keys: JQuery<HTMLElement>) => void) => {
e2e.components.QueryTab.queryInspectorButton().should('be.visible').click();
e2e.components.PanelInspector.Query.refreshButton().should('be.visible').click();
e2e.components.PanelInspector.Query.jsonObjectKeys({ timeout: flakyTimeout })
.should('be.visible')
.within((keys: any) => expectCallBack(keys));
.within((keys) => expectCallBack(keys));
e2e.components.Drawer.General.close().should('be.visible').click();
};