Switch to importing models/event from main js-sdk export (#11363)

This commit is contained in:
Michael Telatynski
2023-08-07 09:24:58 +01:00
committed by GitHub
parent 22ce756f76
commit 24703eea8f
179 changed files with 210 additions and 283 deletions

View File

@@ -17,7 +17,7 @@ limitations under the License.
import React, { ReactElement } from "react";
import { mocked } from "jest-mock";
import { render, screen } from "@testing-library/react";
import { IContent } from "matrix-js-sdk/src/models/event";
import { IContent } from "matrix-js-sdk/src/matrix";
import { bodyToHtml, formatEmojis, topicToHtml } from "../src/HtmlUtils";
import SettingsStore from "../src/settings/SettingsStore";

View File

@@ -16,8 +16,7 @@ limitations under the License.
import { mocked, MockedObject } from "jest-mock";
import { ClientEvent, MatrixClient } from "matrix-js-sdk/src/client";
import { Room, RoomEvent, EventType, MsgType } from "matrix-js-sdk/src/matrix";
import { IContent, MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room, RoomEvent, EventType, MsgType, IContent, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { waitFor } from "@testing-library/react";

View File

@@ -17,11 +17,10 @@ limitations under the License.
import React from "react";
import { mocked } from "jest-mock";
import { render, screen } from "@testing-library/react";
import { Room, MatrixClient } from "matrix-js-sdk/src/matrix";
import { Room, MatrixClient, IEvent, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { ISearchResults } from "matrix-js-sdk/src/@types/search";
import { defer } from "matrix-js-sdk/src/utils";
import { SearchResult } from "matrix-js-sdk/src/models/search-result";
import { IEvent, MatrixEvent } from "matrix-js-sdk/src/models/event";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { RoomSearchView } from "../../../src/components/structures/RoomSearchView";

View File

@@ -17,8 +17,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 } from "matrix-js-sdk/src/models/event";
import { Room } from "matrix-js-sdk/src/matrix";
import { 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

@@ -17,8 +17,15 @@ 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 { Room, RoomEvent, EventType, JoinRule, MatrixError, RoomStateEvent } from "matrix-js-sdk/src/matrix";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import {
Room,
RoomEvent,
EventType,
JoinRule,
MatrixError,
RoomStateEvent,
MatrixEvent,
} from "matrix-js-sdk/src/matrix";
import { MEGOLM_ALGORITHM } from "matrix-js-sdk/src/crypto/olmlib";
import { fireEvent, render, screen, RenderResult } from "@testing-library/react";

View File

@@ -19,8 +19,7 @@ import userEvent from "@testing-library/user-event";
import { mocked } from "jest-mock";
import { MsgType, RelationType } from "matrix-js-sdk/src/@types/event";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room } from "matrix-js-sdk/src/matrix";
import { EventStatus, MatrixEvent, Room } 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,9 @@ limitations under the License.
import React from "react";
import { fireEvent, render, RenderResult } from "@testing-library/react";
import { EventStatus, MatrixEvent } from "matrix-js-sdk/src/models/event";
import {
EventStatus,
MatrixEvent,
Room,
PendingEventOrdering,
BeaconIdentifier,

View File

@@ -18,8 +18,7 @@ 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 } from "matrix-js-sdk/src/models/event";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import React from "react";
import ThreadListContextMenu, {

View File

@@ -16,10 +16,9 @@ limitations under the License.
import React from "react";
import { fireEvent, render, RenderResult } from "@testing-library/react";
import { Room } from "matrix-js-sdk/src/matrix";
import { Room, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { M_POLL_KIND_DISCLOSED, M_POLL_KIND_UNDISCLOSED, M_POLL_START } from "matrix-js-sdk/src/@types/polls";
import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { M_TEXT } from "matrix-js-sdk/src/@types/extensible_events";
import { getMockClientWithEventEmitter } from "../../../test-utils";

View File

@@ -17,7 +17,7 @@ limitations under the License.
import React from "react";
import { render, screen } from "@testing-library/react";
import { CallErrorCode, CallState } from "matrix-js-sdk/src/webrtc/call";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { MatrixEvent } from "matrix-js-sdk/src/matrix";
import LegacyCallEvent from "../../../../src/components/views/messages/LegacyCallEvent";
import LegacyCallEventGrouper from "../../../../src/components/structures/LegacyCallEventGrouper";

View File

@@ -17,9 +17,8 @@ limitations under the License.
import React from "react";
import { render, act, RenderResult, fireEvent, waitForElementToBeRemoved, screen } from "@testing-library/react";
import { mocked } from "jest-mock";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { MatrixEvent, RoomStateEvent, IEvent, Room, EventTimelineSet, IMinimalEvent } from "matrix-js-sdk/src/matrix";
import { EventType, RelationType, MsgType } from "matrix-js-sdk/src/@types/event";
import { RoomStateEvent, IEvent, Room, EventTimelineSet, IMinimalEvent } from "matrix-js-sdk/src/matrix";
import { M_POLL_KIND_DISCLOSED } from "matrix-js-sdk/src/@types/polls";
import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent";
import { PollResponseEvent } from "matrix-js-sdk/src/extensible_events_v1/PollResponseEvent";

View File

@@ -19,8 +19,7 @@ import { render, waitFor, screen, act, fireEvent } from "@testing-library/react"
import { mocked } from "jest-mock";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/client";
import { CryptoApi, TweakName, NotificationCountType, Room } from "matrix-js-sdk/src/matrix";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { CryptoApi, TweakName, NotificationCountType, Room, MatrixEvent } 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

@@ -26,8 +26,7 @@ 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 } from "matrix-js-sdk/src/models/event";
import type { RoomMember } from "matrix-js-sdk/src/matrix";
import type { MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix";
import type { MatrixCall } from "matrix-js-sdk/src/webrtc/call";
import {
stubClient,

View File

@@ -15,10 +15,9 @@ limitations under the License.
*/
import * as React from "react";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { render, type RenderResult } from "@testing-library/react";
import { Room } from "matrix-js-sdk/src/matrix";
import { stubClient } from "../../../test-utils";
import SearchResultTile from "../../../../src/components/views/rooms/SearchResultTile";

View File

@@ -18,8 +18,7 @@ import React from "react";
import { fireEvent, render, RenderResult, screen } from "@testing-library/react";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room, RoomMember } from "matrix-js-sdk/src/matrix";
import { 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

@@ -17,8 +17,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 } from "matrix-js-sdk/src/matrix";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { JoinRule } from "matrix-js-sdk/src/@types/partials";

View File

@@ -17,8 +17,7 @@ limitations under the License.
import { MatrixWidgetType } from "matrix-widget-api";
import type { GroupCall } from "matrix-js-sdk/src/webrtc/groupCall";
import type { Room, RoomMember } from "matrix-js-sdk/src/matrix";
import type { MatrixEvent } from "matrix-js-sdk/src/models/event";
import type { Room, RoomMember, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { mkEvent } from "./test-utils";
import { Call, ConnectionState, ElementCall, JitsiCall } from "../../src/models/Call";
import { CallStore } from "../../src/stores/CallStore";

View File

@@ -16,9 +16,8 @@ limitations under the License.
import EventEmitter from "events";
import { mocked, MockedObject } from "jest-mock";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { JoinRule } from "matrix-js-sdk/src/@types/partials";
import {
MatrixEvent,
Room,
User,
IContent,
@@ -37,6 +36,7 @@ import {
IPushRules,
RelationType,
} from "matrix-js-sdk/src/matrix";
import { JoinRule } from "matrix-js-sdk/src/@types/partials";
import { normalize } from "matrix-js-sdk/src/utils";
import { ReEmitter } from "matrix-js-sdk/src/ReEmitter";
import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler";

View File

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

View File

@@ -14,10 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { MatrixEvent, NotificationCountType, Room } from "matrix-js-sdk/src/matrix";
import { Mocked, mocked } from "jest-mock";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { NotificationCountType, Room } from "matrix-js-sdk/src/matrix";
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
import {

View File

@@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { render } from "@testing-library/react";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { ConditionKind, EventType, PushRuleActionName, Room, TweakName } from "matrix-js-sdk/src/matrix";
import { MatrixEvent, ConditionKind, EventType, PushRuleActionName, Room, TweakName } from "matrix-js-sdk/src/matrix";
import { pillifyLinks } from "../../src/utils/pillify";
import { stubClient } from "../test-utils";