2022-10-19 13:07:03 +01:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2022-10-19 13:07:03 +01:00
|
|
|
Copyright 2022 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
2025-01-06 11:18:54 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-09 14:57:16 +01:00
|
|
|
Please see LICENSE files in the repository root for full details.
|
2022-10-19 13:07:03 +01:00
|
|
|
*/
|
|
|
|
|
|
2026-07-06 17:09:21 +01:00
|
|
|
import { type MatrixClient } from "matrix-js-sdk/src/matrix";
|
|
|
|
|
|
2026-07-01 13:49:18 +01:00
|
|
|
import { SDKContextClass } from "../../src/contexts/SDKContextClass";
|
2025-02-05 13:25:06 +00:00
|
|
|
import { type PosthogAnalytics } from "../../src/PosthogAnalytics";
|
|
|
|
|
import { type SlidingSyncManager } from "../../src/SlidingSyncManager";
|
|
|
|
|
import { type RoomNotificationStateStore } from "../../src/stores/notifications/RoomNotificationStateStore";
|
|
|
|
|
import type RightPanelStore from "../../src/stores/right-panel/RightPanelStore";
|
|
|
|
|
import { type RoomViewStore } from "../../src/stores/RoomViewStore";
|
2026-07-13 15:31:39 +01:00
|
|
|
import type SpaceStore from "../../src/stores/spaces/SpaceStore";
|
2025-02-05 13:25:06 +00:00
|
|
|
import { type WidgetLayoutStore } from "../../src/stores/widgets/WidgetLayoutStore";
|
|
|
|
|
import { type WidgetPermissionStore } from "../../src/stores/widgets/WidgetPermissionStore";
|
|
|
|
|
import type WidgetStore from "../../src/stores/WidgetStore";
|
2026-07-07 13:29:54 +01:00
|
|
|
import type LegacyCallHandler from "../../src/LegacyCallHandler.tsx";
|
2022-10-19 13:07:03 +01:00
|
|
|
|
|
|
|
|
/**
|
2026-07-01 13:49:18 +01:00
|
|
|
* A class which provides the same API as SDKContextClass but adds additional unsafe setters which can
|
2022-10-19 13:07:03 +01:00
|
|
|
* replace individual stores. This is useful for tests which need to mock out stores.
|
|
|
|
|
*/
|
2026-07-01 13:49:18 +01:00
|
|
|
export class TestSDKContext extends SDKContextClass {
|
2026-07-06 17:09:21 +01:00
|
|
|
declare public _client?: MatrixClient;
|
2024-12-02 09:39:36 +00:00
|
|
|
declare public _RightPanelStore?: RightPanelStore;
|
|
|
|
|
declare public _RoomNotificationStateStore?: RoomNotificationStateStore;
|
|
|
|
|
declare public _RoomViewStore?: RoomViewStore;
|
|
|
|
|
declare public _WidgetPermissionStore?: WidgetPermissionStore;
|
|
|
|
|
declare public _WidgetLayoutStore?: WidgetLayoutStore;
|
|
|
|
|
declare public _WidgetStore?: WidgetStore;
|
|
|
|
|
declare public _PosthogAnalytics?: PosthogAnalytics;
|
|
|
|
|
declare public _SlidingSyncManager?: SlidingSyncManager;
|
2026-07-13 15:31:39 +01:00
|
|
|
declare public _SpaceStore?: SpaceStore;
|
2026-07-07 13:29:54 +01:00
|
|
|
declare public _LegacyCallHandler?: LegacyCallHandler;
|
2022-10-19 13:07:03 +01:00
|
|
|
}
|