1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-07 21:23:00 +03:00

Switch to importing client from main js-sdk export (#11370)

This commit is contained in:
Michael Telatynski
2023-08-09 08:18:41 +01:00
committed by GitHub
parent e0d498e338
commit c3574c2050
155 changed files with 259 additions and 268 deletions

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { render, RenderResult } from "@testing-library/react";
import { ConditionKind, EventType, IPushRule, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { ClientEvent } from "matrix-js-sdk/src/client";
import { ConditionKind, EventType, IPushRule, MatrixEvent, ClientEvent } from "matrix-js-sdk/src/matrix";
import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler";
import { logger } from "matrix-js-sdk/src/logger";

View File

@@ -18,11 +18,10 @@ import React, { ComponentProps } from "react";
import { fireEvent, render, RenderResult, screen, within } from "@testing-library/react";
import fetchMock from "fetch-mock-jest";
import { mocked } from "jest-mock";
import { ClientEvent, MatrixClient } from "matrix-js-sdk/src/client";
import { ClientEvent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler";
import * as MatrixJs from "matrix-js-sdk/src/matrix";
import { MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { completeAuthorizationCodeGrant } from "matrix-js-sdk/src/oidc/authorize";
import { logger } from "matrix-js-sdk/src/logger";
import { OidcError } from "matrix-js-sdk/src/oidc/error";

View File

@@ -18,8 +18,7 @@ import React from "react";
import { mocked, Mocked } from "jest-mock";
import { screen, render, act, cleanup } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room, MatrixEvent, RoomStateEvent } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering, Room, MatrixEvent, RoomStateEvent } from "matrix-js-sdk/src/matrix";
import { Widget, ClientWidgetApi } from "matrix-widget-api";
import { UserEvent } from "@testing-library/user-event/dist/types/setup/setup";

View File

@@ -19,7 +19,7 @@ import { render, screen, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { jest } from "@jest/globals";
import { mocked, MockedObject } from "jest-mock";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
import _RightPanel from "../../../src/components/structures/RightPanel";
import { MatrixClientPeg } from "../../../src/MatrixClientPeg";

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { render } from "@testing-library/react";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { EventStatus, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering, EventStatus, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { MatrixError } from "matrix-js-sdk/src/http-api";
import RoomStatusBar, { getUnsentMessages } from "../../../src/components/structures/RoomStatusBar";

View File

@@ -16,8 +16,9 @@ limitations under the License.
import React, { createRef, RefObject } from "react";
import { mocked, MockedObject } from "jest-mock";
import { ClientEvent, MatrixClient } from "matrix-js-sdk/src/client";
import {
ClientEvent,
MatrixClient,
Room,
RoomEvent,
EventType,

View File

@@ -17,8 +17,7 @@ limitations under the License.
import React from "react";
import { mocked } from "jest-mock";
import { fireEvent, render, screen, waitFor, waitForElementToBeRemoved } from "@testing-library/react";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient, Room } from "matrix-js-sdk/src/matrix";
import { RoomHierarchy } from "matrix-js-sdk/src/room-hierarchy";
import { IHierarchyRoom } from "matrix-js-sdk/src/@types/spaces";

View File

@@ -17,8 +17,15 @@ limitations under the License.
import { act, getByTestId, render, RenderResult, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { mocked } from "jest-mock";
import { MsgType, RelationType, EventStatus, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import {
MsgType,
RelationType,
EventStatus,
MatrixEvent,
Room,
MatrixClient,
PendingEventOrdering,
} from "matrix-js-sdk/src/matrix";
import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread";
import React, { useState } from "react";

View File

@@ -16,8 +16,7 @@ limitations under the License.
import { getByTestId, render, waitFor } from "@testing-library/react";
import { mocked } from "jest-mock";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room, RoomMember } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering, Room, RoomMember } from "matrix-js-sdk/src/matrix";
import React, { ComponentProps } from "react";
import MemberAvatar from "../../../../src/components/views/avatars/MemberAvatar";

View File

@@ -19,8 +19,7 @@ limitations under the License.
import { render, screen } from "@testing-library/react";
import React, { ComponentProps } from "react";
import { mocked } from "jest-mock";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix";
import MatrixClientContext from "../../../../src/contexts/MatrixClientContext";
import RoomContextMenu from "../../../../src/components/views/context_menus/RoomContextMenu";

View File

@@ -17,8 +17,7 @@ limitations under the License.
import { fireEvent, getByLabelText, render, screen } from "@testing-library/react";
import { mocked } from "jest-mock";
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix";
import React from "react";
import userEvent from "@testing-library/user-event";

View File

@@ -17,8 +17,7 @@ limitations under the License.
import { getByTestId, render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { mocked } from "jest-mock";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import React from "react";
import ThreadListContextMenu, {

View File

@@ -18,7 +18,7 @@ limitations under the License.
import React, { ComponentProps } from "react";
import { screen, render } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
import { MatrixWidgetType } from "matrix-widget-api";
import {
ApprovalOpts,

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { getByLabelText, getAllByLabelText, render } from "@testing-library/react";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { Room, MatrixClient } from "matrix-js-sdk/src/matrix";
import userEvent from "@testing-library/user-event";
import { stubClient } from "../../../test-utils";

View File

@@ -16,8 +16,7 @@
import React from "react";
import { render, screen } from "@testing-library/react";
import { Device } from "matrix-js-sdk/src/matrix";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { Device, MatrixClient } from "matrix-js-sdk/src/matrix";
import { stubClient } from "../../../test-utils";
import { ManualDeviceKeyVerificationDialog } from "../../../../src/components/views/dialogs/ManualDeviceKeyVerificationDialog";

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { render } from "@testing-library/react";
import { Room } from "matrix-js-sdk/src/matrix";
import { PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room, PendingEventOrdering } from "matrix-js-sdk/src/matrix";
import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext";
import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg";

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { render } from "@testing-library/react";
import { Room } from "matrix-js-sdk/src/matrix";
import { PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room, PendingEventOrdering } from "matrix-js-sdk/src/matrix";
import RoomNotifications from "../../../../../src/components/views/dialogs/devtools/RoomNotifications";
import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext";

View File

@@ -16,7 +16,7 @@ limitations under the License.
import React from "react";
import { render } from "@testing-library/react";
import { IPublicRoomsChunkRoom } from "matrix-js-sdk/src/client";
import { IPublicRoomsChunkRoom } from "matrix-js-sdk/src/matrix";
import { PublicRoomResultDetails } from "../../../../../src/components/views/dialogs/spotlight/PublicRoomResultDetails";

View File

@@ -18,8 +18,7 @@ limitations under the License.
import React from "react";
import { render, screen, RenderResult } from "@testing-library/react";
import { mocked } from "jest-mock";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room, MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/matrix";
import { RoomResultContextMenus } from "../../../../../src/components/views/dialogs/spotlight/RoomResultContextMenus";
import { filterConsole, stubClient } from "../../../../test-utils";

View File

@@ -17,8 +17,7 @@ limitations under the License.
import React from "react";
import { act, fireEvent, render, RenderResult } from "@testing-library/react";
import * as maplibregl from "maplibre-gl";
import { RoomMember } from "matrix-js-sdk/src/matrix";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { RoomMember, MatrixClient } from "matrix-js-sdk/src/matrix";
import { mocked } from "jest-mock";
import { logger } from "matrix-js-sdk/src/logger";

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { mocked } from "jest-mock";
import { RoomMember, RelationType } from "matrix-js-sdk/src/matrix";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { RoomMember, RelationType, MatrixClient } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { M_ASSET, LocationAssetType } from "matrix-js-sdk/src/@types/location";
import { act, fireEvent, render, RenderResult } from "@testing-library/react";

View File

@@ -17,8 +17,7 @@ limitations under the License.
import React from "react";
import { render, screen, act, cleanup, fireEvent, waitFor } from "@testing-library/react";
import { mocked, Mocked } from "jest-mock";
import { Room, RoomStateEvent } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room, RoomStateEvent, MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/matrix";
import { ClientWidgetApi, Widget } from "matrix-widget-api";
import type { RoomMember } from "matrix-js-sdk/src/matrix";

View File

@@ -17,7 +17,7 @@ limitations under the License.
import React from "react";
import { mocked } from "jest-mock";
import { fireEvent, render, screen } from "@testing-library/react";
import { TimestampToEventResponse } from "matrix-js-sdk/src/client";
import { TimestampToEventResponse } from "matrix-js-sdk/src/matrix";
import { ConnectionError, HTTPError, MatrixError } from "matrix-js-sdk/src/http-api";
import dispatcher from "../../../../src/dispatcher/dispatcher";

View File

@@ -15,8 +15,15 @@ limitations under the License.
*/
import { render } from "@testing-library/react";
import { MatrixEvent, MsgType, RelationType, NotificationCountType, Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import {
MatrixEvent,
MsgType,
RelationType,
NotificationCountType,
Room,
MatrixClient,
PendingEventOrdering,
} from "matrix-js-sdk/src/matrix";
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
import React from "react";

View File

@@ -17,8 +17,16 @@ limitations under the License.
import * as React from "react";
import { render, waitFor, screen, act, fireEvent } from "@testing-library/react";
import { mocked } from "jest-mock";
import { EventType, CryptoApi, TweakName, NotificationCountType, Room, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import {
EventType,
CryptoApi,
TweakName,
NotificationCountType,
Room,
MatrixEvent,
MatrixClient,
PendingEventOrdering,
} from "matrix-js-sdk/src/matrix";
import { DeviceTrustLevel, UserTrustLevel } from "matrix-js-sdk/src/crypto/CrossSigning";
import { DeviceInfo } from "matrix-js-sdk/src/crypto/deviceinfo";
import { IEncryptedEventInfo } from "matrix-js-sdk/src/crypto/api";

View File

@@ -17,15 +17,13 @@ limitations under the License.
import React from "react";
import { render, screen, act, fireEvent, waitFor, getByRole, RenderResult } from "@testing-library/react";
import { mocked, Mocked } from "jest-mock";
import { EventType, RoomType, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix";
import { PendingEventOrdering } from "matrix-js-sdk/src/client";
import { EventType, RoomType, Room, RoomStateEvent, PendingEventOrdering } from "matrix-js-sdk/src/matrix";
import { CallType } from "matrix-js-sdk/src/webrtc/call";
import { ClientWidgetApi, Widget } from "matrix-widget-api";
import EventEmitter from "events";
import { ISearchResults } from "matrix-js-sdk/src/@types/search";
import type { MatrixClient } from "matrix-js-sdk/src/client";
import type { MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix";
import type { MatrixClient, MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix";
import type { MatrixCall } from "matrix-js-sdk/src/webrtc/call";
import {
stubClient,

View File

@@ -17,11 +17,18 @@ limitations under the License.
import React from "react";
import "jest-mock";
import { screen, act, render } from "@testing-library/react";
import { MatrixEvent, MsgType, RelationType, NotificationCountType, Room, EventStatus } from "matrix-js-sdk/src/matrix";
import { PendingEventOrdering } from "matrix-js-sdk/src/client";
import {
MatrixEvent,
MsgType,
RelationType,
NotificationCountType,
Room,
EventStatus,
PendingEventOrdering,
} from "matrix-js-sdk/src/matrix";
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
import type { MatrixClient } from "matrix-js-sdk/src/client";
import type { MatrixClient } from "matrix-js-sdk/src/matrix";
import { mkThread } from "../../../../test-utils/threads";
import { UnreadNotificationBadge } from "../../../../../src/components/views/rooms/NotificationBadge/UnreadNotificationBadge";
import { mkEvent, mkMessage, muteRoom, stubClient } from "../../../../test-utils/test-utils";

View File

@@ -15,8 +15,7 @@ limitations under the License.
*/
import React from "react";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { Room, EventType } from "matrix-js-sdk/src/matrix";
import { MatrixClient, Room, EventType } from "matrix-js-sdk/src/matrix";
import { mocked } from "jest-mock";
import { act, render, screen, fireEvent, RenderResult } from "@testing-library/react";

View File

@@ -17,11 +17,9 @@ limitations under the License.
import React from "react";
import { mocked, Mocked } from "jest-mock";
import { render, screen, act } from "@testing-library/react";
import { PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room, RoomStateEvent, RoomType } from "matrix-js-sdk/src/matrix";
import { PendingEventOrdering, Room, RoomStateEvent, RoomType } from "matrix-js-sdk/src/matrix";
import type { MatrixClient } from "matrix-js-sdk/src/client";
import type { RoomMember } from "matrix-js-sdk/src/matrix";
import type { MatrixClient, RoomMember } from "matrix-js-sdk/src/matrix";
import { stubClient, wrapInMatrixClientContext, mkRoomMember } from "../../../test-utils";
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
import DMRoomMap from "../../../../src/utils/DMRoomMap";

View File

@@ -17,8 +17,7 @@ limitations under the License.
import React from "react";
import { render, screen, act, RenderResult } from "@testing-library/react";
import { mocked, Mocked } from "jest-mock";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room, MatrixEvent, RoomStateEvent } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering, Room, MatrixEvent, RoomStateEvent } from "matrix-js-sdk/src/matrix";
import { Widget } from "matrix-widget-api";
import { Thread } from "matrix-js-sdk/src/models/thread";

View File

@@ -17,7 +17,7 @@ limitations under the License.
import React from "react";
import { fireEvent, render, screen } from "@testing-library/react";
import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import { IRequestTokenResponse } from "matrix-js-sdk/src/client";
import { IRequestTokenResponse } from "matrix-js-sdk/src/matrix";
import { MatrixError } from "matrix-js-sdk/src/http-api";
import { UserFriendlyError } from "../../../../../src/languageHandler";

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { fireEvent, render, RenderResult, screen } from "@testing-library/react";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { Room, EventType, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { MatrixClient, Room, EventType, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { mocked } from "jest-mock";
import AdvancedRoomSettingsTab from "../../../../../../src/components/views/settings/tabs/room/AdvancedRoomSettingsTab";

View File

@@ -16,7 +16,7 @@ limitations under the License.
import React from "react";
import { render, RenderResult, screen } from "@testing-library/react";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
import userEvent from "@testing-library/user-event";
import NotificationSettingsTab from "../../../../../../src/components/views/settings/tabs/room/NotificationSettingsTab";

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { fireEvent, render, RenderResult, screen } from "@testing-library/react";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { EventType, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix";
import { MatrixClient, EventType, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix";
import { mocked } from "jest-mock";
import RolesRoomSettingsTab from "../../../../../../src/components/views/settings/tabs/room/RolesRoomSettingsTab";

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { fireEvent, render, RenderResult, waitFor } from "@testing-library/react";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { Room, MatrixEvent, EventType, JoinRule } from "matrix-js-sdk/src/matrix";
import { MatrixClient, Room, MatrixEvent, EventType, JoinRule } from "matrix-js-sdk/src/matrix";
import { mkStubRoom, stubClient } from "../../../../../test-utils";
import { MatrixClientPeg } from "../../../../../../src/MatrixClientPeg";

View File

@@ -18,8 +18,7 @@ import React from "react";
import { zip } from "lodash";
import { render, screen, act, fireEvent, waitFor, cleanup } from "@testing-library/react";
import { mocked, Mocked } from "jest-mock";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { Room, RoomStateEvent } from "matrix-js-sdk/src/matrix";
import { MatrixClient, PendingEventOrdering, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix";
import { Widget } from "matrix-widget-api";
import type { RoomMember } from "matrix-js-sdk/src/matrix";

View File

@@ -18,8 +18,7 @@ import React from "react";
import { render, screen } from "@testing-library/react";
import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed";
import { MatrixCall } from "matrix-js-sdk/src/webrtc/call";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient, Room } from "matrix-js-sdk/src/matrix";
import * as AvatarModule from "../../../../src/Avatar";
import VideoFeed from "../../../../src/components/views/voip/VideoFeed";