Consume more imports from matrix-js-sdk/src/matrix (#11449)

This commit is contained in:
Michael Telatynski 2023-08-23 10:04:25 +01:00 committed by GitHub
parent aa6e3654b8
commit 99e80dd296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
89 changed files with 236 additions and 172 deletions

View file

@ -27,8 +27,8 @@ import {
EventType,
FeatureSupport,
Thread,
M_POLL_KIND_DISCLOSED,
} 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 { mocked } from "jest-mock";

View file

@ -16,8 +16,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, Room } from "matrix-js-sdk/src/matrix";
import { ReceiptType, MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix";
import React from "react";
import userEvent from "@testing-library/user-event";

View file

@ -15,9 +15,15 @@ limitations under the License.
*/
import React from "react";
import { MatrixEvent, EventType } from "matrix-js-sdk/src/matrix";
import { LocationAssetType, M_ASSET, M_LOCATION, M_TIMESTAMP } from "matrix-js-sdk/src/@types/location";
import { M_TEXT } from "matrix-js-sdk/src/@types/extensible_events";
import {
MatrixEvent,
EventType,
LocationAssetType,
M_ASSET,
M_LOCATION,
M_TIMESTAMP,
M_TEXT,
} from "matrix-js-sdk/src/matrix";
import { act, fireEvent, getByTestId, render, RenderResult, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";

View file

@ -16,10 +16,15 @@ limitations under the License.
import React from "react";
import { fireEvent, render, RenderResult } from "@testing-library/react";
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 {
Room,
MatrixEvent,
M_POLL_KIND_DISCLOSED,
M_POLL_KIND_UNDISCLOSED,
M_POLL_START,
M_TEXT,
} from "matrix-js-sdk/src/matrix";
import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent";
import { M_TEXT } from "matrix-js-sdk/src/@types/extensible_events";
import { getMockClientWithEventEmitter } from "../../../test-utils";
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";

View file

@ -16,9 +16,8 @@ limitations under the License.
import React from "react";
import { mocked } from "jest-mock";
import { RoomMember, RelationType, MatrixClient } from "matrix-js-sdk/src/matrix";
import { RoomMember, RelationType, MatrixClient, M_ASSET, LocationAssetType } 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";
import * as maplibregl from "maplibre-gl";

View file

@ -15,8 +15,12 @@ limitations under the License.
*/
import { mocked } from "jest-mock";
import { ContentHelpers, MatrixClient } from "matrix-js-sdk/src/matrix";
import { LegacyLocationEventContent, MLocationEventContent } from "matrix-js-sdk/src/@types/location";
import {
ContentHelpers,
MatrixClient,
LegacyLocationEventContent,
MLocationEventContent,
} from "matrix-js-sdk/src/matrix";
import { doMaybeLocalRoomAction } from "../../../../src/utils/local-room";
import {

View file

@ -24,8 +24,8 @@ import {
MatrixEvent,
EventType,
Relations,
M_BEACON,
} from "matrix-js-sdk/src/matrix";
import { M_BEACON } from "matrix-js-sdk/src/@types/beacon";
import MBeaconBody from "../../../../src/components/views/messages/MBeaconBody";
import {

View file

@ -16,16 +16,17 @@ limitations under the License.
import React from "react";
import { fireEvent, render, RenderResult } from "@testing-library/react";
import { MatrixEvent, Relations } from "matrix-js-sdk/src/matrix";
import {
MatrixEvent,
Relations,
M_POLL_KIND_DISCLOSED,
M_POLL_KIND_UNDISCLOSED,
M_POLL_RESPONSE,
M_POLL_START,
PollStartEventContent,
PollAnswer,
} from "matrix-js-sdk/src/@types/polls";
import { M_TEXT } from "matrix-js-sdk/src/@types/extensible_events";
M_TEXT,
} from "matrix-js-sdk/src/matrix";
import MPollBody, { allVotes, findTopAnswer, isPollEnded } from "../../../../src/components/views/messages/MPollBody";
import { IBodyProps } from "../../../../src/components/views/messages/IBodyProps";

View file

@ -16,9 +16,8 @@ limitations under the License.
import React from "react";
import { render } from "@testing-library/react";
import { EventTimeline, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { EventTimeline, MatrixEvent, Room, M_TEXT } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { M_TEXT } from "matrix-js-sdk/src/@types/extensible_events";
import { IBodyProps } from "../../../../src/components/views/messages/IBodyProps";
import { MPollEndBody } from "../../../../src/components/views/messages/MPollEndBody";

View file

@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { act, fireEvent, render } from "@testing-library/react";
import { Filter, EventTimeline, Room, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { M_POLL_START } from "matrix-js-sdk/src/@types/polls";
import { Filter, EventTimeline, Room, MatrixEvent, M_POLL_START } from "matrix-js-sdk/src/matrix";
import { PollHistory } from "../../../../../src/components/views/polls/pollHistory/PollHistory";
import {

View file

@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import { render } from "@testing-library/react";
import { MatrixEvent, Poll, Room } from "matrix-js-sdk/src/matrix";
import { M_TEXT } from "matrix-js-sdk/src/@types/extensible_events";
import { MatrixEvent, Poll, Room, M_TEXT } from "matrix-js-sdk/src/matrix";
import { PollListItemEnded } from "../../../../../src/components/views/polls/pollHistory/PollListItemEnded";
import {

View file

@ -23,8 +23,8 @@ import {
Room,
MatrixClient,
PendingEventOrdering,
ReceiptType,
} from "matrix-js-sdk/src/matrix";
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
import React from "react";
import LegacyRoomHeaderButtons from "../../../../src/components/views/right_panel/LegacyRoomHeaderButtons";

View file

@ -27,8 +27,8 @@ import {
EventType,
RelationType,
MsgType,
M_POLL_KIND_DISCLOSED,
} 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";
import { PollEndEvent } from "matrix-js-sdk/src/extensible_events_v1/PollEndEvent";

View file

@ -25,8 +25,8 @@ import {
Room,
EventStatus,
PendingEventOrdering,
ReceiptType,
} from "matrix-js-sdk/src/matrix";
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
import type { MatrixClient } from "matrix-js-sdk/src/matrix";
import { mkThread } from "../../../../test-utils/threads";

View file

@ -27,9 +27,10 @@ import {
ConditionKind,
IPushRuleCondition,
PushRuleKind,
IThreepid,
ThreepidMedium,
} from "matrix-js-sdk/src/matrix";
import { randomString } from "matrix-js-sdk/src/randomstring";
import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import { act, fireEvent, getByTestId, render, screen, waitFor, within } from "@testing-library/react";
import { mocked } from "jest-mock";
import userEvent from "@testing-library/user-event";

View file

@ -18,7 +18,7 @@ import { cleanup, render, waitFor } from "@testing-library/react";
import { mocked } from "jest-mock";
import React from "react";
import { MSC3906Rendezvous, RendezvousFailureReason } from "matrix-js-sdk/src/rendezvous";
import { LoginTokenPostResponse } from "matrix-js-sdk/src/@types/auth";
import { LoginTokenPostResponse } from "matrix-js-sdk/src/matrix";
import LoginWithQR, { Click, Mode, Phase } from "../../../../../src/components/views/auth/LoginWithQR";
import type { MatrixClient } from "matrix-js-sdk/src/matrix";

View file

@ -16,8 +16,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, MatrixError } from "matrix-js-sdk/src/matrix";
import { IThreepid, ThreepidMedium, IRequestTokenResponse, MatrixError } from "matrix-js-sdk/src/matrix";
import { TranslationKey, UserFriendlyError } from "../../../../../src/languageHandler";
import EmailAddresses, { EmailAddress } from "../../../../../src/components/views/settings/discovery/EmailAddresses";

View file

@ -16,7 +16,7 @@ limitations under the License.
import React from "react";
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/matrix";
import userEvent from "@testing-library/user-event";
import { mocked } from "jest-mock";

View file

@ -14,8 +14,15 @@ limitations under the License.
import { act, findByRole, getByRole, queryByRole, render, waitFor } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import { IPushRules, MatrixClient, NotificationCountType, PushRuleKind, Room, RuleId } from "matrix-js-sdk/src/matrix";
import {
ThreepidMedium,
IPushRules,
MatrixClient,
NotificationCountType,
PushRuleKind,
Room,
RuleId,
} from "matrix-js-sdk/src/matrix";
import React from "react";
import NotificationSettings2 from "../../../../../src/components/views/settings/notifications/NotificationSettings2";

View file

@ -13,9 +13,8 @@ limitations under the License.
import { fireEvent, render, screen, within } from "@testing-library/react";
import React from "react";
import { M_AUTHENTICATION } from "matrix-js-sdk/src/matrix";
import { M_AUTHENTICATION, ThreepidMedium } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import GeneralUserSettingsTab from "../../../../../../src/components/views/settings/tabs/user/GeneralUserSettingsTab";
import MatrixClientContext from "../../../../../../src/contexts/MatrixClientContext";