Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit f4704f1

Browse files
committed
"Fix" type issues
Signed-off-by: Šimon Brandner <[email protected]>
1 parent efdecf8 commit f4704f1

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

cypress/global.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ import type {
2828
} from "matrix-js-sdk/src/matrix";
2929
import type { MatrixDispatcher } from "../src/dispatcher/dispatcher";
3030
import type PerformanceMonitor from "../src/performance";
31-
import type SettingsStore from "../src/settings/SettingsStore";
3231

3332
declare global {
3433
// eslint-disable-next-line @typescript-eslint/no-namespace
3534
namespace Cypress {
3635
interface ApplicationWindow {
37-
mxSettingsStore: typeof SettingsStore;
36+
mxSettingsStore: any; // XXX: Importing SettingsStore causes a bunch of type lint errors
3837
mxMatrixClientPeg: {
3938
matrixClient?: MatrixClient;
4039
};

cypress/support/settings.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ limitations under the License.
1818

1919
import Chainable = Cypress.Chainable;
2020
import type { SettingLevel } from "../../src/settings/SettingLevel";
21-
import SettingsStore from "../../src/settings/SettingsStore";
2221

2322
declare global {
2423
// eslint-disable-next-line @typescript-eslint/no-namespace
@@ -27,7 +26,7 @@ declare global {
2726
/**
2827
* Returns the SettingsStore
2928
*/
30-
getSettingsStore(): Chainable<typeof SettingsStore | undefined>;
29+
getSettingsStore(): Chainable<any | undefined>; // XXX: Importing SettingsStore causes a bunch of type lint errors
3130
/**
3231
* Open the top left user menu, returning a handle to the resulting context menu.
3332
*/
@@ -101,7 +100,7 @@ declare global {
101100
}
102101
}
103102

104-
Cypress.Commands.add("getSettingsStore", (): Chainable<typeof SettingsStore> => {
103+
Cypress.Commands.add("getSettingsStore", (): Chainable<any> => {
105104
return cy.window({ log: false }).then(win => win.mxSettingsStore);
106105
});
107106

@@ -111,14 +110,14 @@ Cypress.Commands.add("setSettingValue", (
111110
level: SettingLevel,
112111
value: any,
113112
): Chainable<void> => {
114-
return cy.getSettingsStore().then(async (store: typeof SettingsStore) => {
113+
return cy.getSettingsStore().then(async (store: any) => {
115114
return store.setValue(name, roomId, level, value);
116115
});
117116
});
118117

119118
Cypress.Commands.add("getSettingValue", <T = any>(name: string, roomId?: string): Chainable<T> => {
120-
return cy.getSettingsStore().then(<T>(store: typeof SettingsStore) => {
121-
return store.getValue<T>(name, roomId);
119+
return cy.getSettingsStore().then((store: any) => {
120+
return store.getValue(name, roomId);
122121
});
123122
});
124123

0 commit comments

Comments
 (0)