diff --git a/.eslintrc.js b/.eslintrc.js index 785389dfd1..4434aecfdf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -144,20 +144,6 @@ module.exports = { "!matrix-js-sdk/src/models/read-receipt", "!matrix-js-sdk/src/models/relations-container", "!matrix-js-sdk/src/models/related-relations", - "!matrix-js-sdk/src/@types", - "!matrix-js-sdk/src/@types/global", - "!matrix-js-sdk/src/@types/auth", - "!matrix-js-sdk/src/@types/beacon", - "!matrix-js-sdk/src/@types/threepids", - "!matrix-js-sdk/src/@types/polls", - "!matrix-js-sdk/src/@types/crypto", - "!matrix-js-sdk/src/@types/local_notifications", - "!matrix-js-sdk/src/@types/location", - "!matrix-js-sdk/src/@types/topic", - "!matrix-js-sdk/src/@types/registration", - "!matrix-js-sdk/src/@types/read_receipts", - "!matrix-js-sdk/src/@types/extensible_events", - "!matrix-js-sdk/src/@types/IIdentityServerProvider", ], message: "Please use matrix-js-sdk/src/matrix instead", }, diff --git a/cypress/e2e/read-receipts/read-receipts.spec.ts b/cypress/e2e/read-receipts/read-receipts.spec.ts index a08862d440..e298f7fa98 100644 --- a/cypress/e2e/read-receipts/read-receipts.spec.ts +++ b/cypress/e2e/read-receipts/read-receipts.spec.ts @@ -16,8 +16,7 @@ limitations under the License. /// -import type { MatrixClient, MatrixEvent, ISendEventResponse } from "matrix-js-sdk/src/matrix"; -import type { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; +import type { MatrixClient, MatrixEvent, ISendEventResponse, ReceiptType } from "matrix-js-sdk/src/matrix"; import { HomeserverInstance } from "../../plugins/utils/homeserver"; describe("Read receipts", () => { diff --git a/cypress/global.d.ts b/cypress/global.d.ts index da5b3b8cd7..f8caad1f89 100644 --- a/cypress/global.d.ts +++ b/cypress/global.d.ts @@ -17,6 +17,7 @@ limitations under the License. import "../src/@types/global"; import "../src/@types/svg"; import "../src/@types/raw-loader"; +// eslint-disable-next-line no-restricted-imports import "matrix-js-sdk/src/@types/global"; import type { MatrixClient, diff --git a/cypress/support/client.ts b/cypress/support/client.ts index ad3c2e239f..44bc1487af 100644 --- a/cypress/support/client.ts +++ b/cypress/support/client.ts @@ -26,8 +26,8 @@ import type { UploadOpts, ICreateRoomOpts, ISendEventResponse, + ReceiptType, } from "matrix-js-sdk/src/matrix"; -import type { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; import Chainable = Cypress.Chainable; import { UserCredentials } from "./login"; diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index d8f01cd4be..39e1eacbc8 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +// eslint-disable-next-line no-restricted-imports import "matrix-js-sdk/src/@types/global"; // load matrix-js-sdk's type extensions first import "@types/modernizr"; diff --git a/src/AddThreepid.ts b/src/AddThreepid.ts index bc9958cb6d..ff4f2d9e6c 100644 --- a/src/AddThreepid.ts +++ b/src/AddThreepid.ts @@ -24,8 +24,8 @@ import { MatrixClient, MatrixError, HTTPError, + IThreepid, } from "matrix-js-sdk/src/matrix"; -import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; import Modal from "./Modal"; import { _t, UserFriendlyError } from "./languageHandler"; diff --git a/src/Login.ts b/src/Login.ts index 5359b23540..5ca4e9e5a2 100644 --- a/src/Login.ts +++ b/src/Login.ts @@ -15,9 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { createClient, MatrixClient, LoginFlow } from "matrix-js-sdk/src/matrix"; +import { + createClient, + MatrixClient, + LoginFlow, + DELEGATED_OIDC_COMPATIBILITY, + ILoginFlow, + LoginRequest, +} from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { DELEGATED_OIDC_COMPATIBILITY, ILoginFlow, LoginRequest } from "matrix-js-sdk/src/@types/auth"; import { IMatrixClientCreds } from "./MatrixClientPeg"; import SecurityCustomisations from "./customisations/Security"; diff --git a/src/Notifier.ts b/src/Notifier.ts index cf9bafdcab..2a7e7daf6a 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -27,9 +27,9 @@ import { SyncState, SyncStateData, IRoomTimelineData, + M_LOCATION, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { M_LOCATION } from "matrix-js-sdk/src/@types/location"; import { PermissionChanged as PermissionChangedEvent } from "@matrix-org/analytics-events/types/typescript/PermissionChanged"; import { MatrixClientPeg } from "./MatrixClientPeg"; diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 88c8de7ee3..8cb2f781d0 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -18,9 +18,8 @@ limitations under the License. */ import * as React from "react"; -import { User, IContent, Direction, ContentHelpers } from "matrix-js-sdk/src/matrix"; +import { User, IContent, Direction, ContentHelpers, MRoomTopicEventContent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { MRoomTopicEventContent } from "matrix-js-sdk/src/@types/topic"; import dis from "./dispatcher/dispatcher"; import { _t, _td, UserFriendlyError } from "./languageHandler"; diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index c4aa4416a9..a187683914 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -23,10 +23,11 @@ import { JoinRule, EventType, MsgType, + M_POLL_START, + M_POLL_END, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { removeDirectionOverrideChars } from "matrix-js-sdk/src/utils"; -import { M_POLL_START, M_POLL_END } from "matrix-js-sdk/src/@types/polls"; import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; import { _t } from "./languageHandler"; diff --git a/src/Unread.ts b/src/Unread.ts index 6185407a9b..45f4f1fb82 100644 --- a/src/Unread.ts +++ b/src/Unread.ts @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { M_BEACON } from "matrix-js-sdk/src/@types/beacon"; +import { M_BEACON, Room, Thread, MatrixEvent, EventType, MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { Room, Thread, MatrixEvent, EventType, MatrixClient } from "matrix-js-sdk/src/matrix"; import shouldHideEvent from "./shouldHideEvent"; import { haveRendererForEvent } from "./events/EventTileFactory"; diff --git a/src/boundThreepids.ts b/src/boundThreepids.ts index 42a81876fb..e8fee803be 100644 --- a/src/boundThreepids.ts +++ b/src/boundThreepids.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; -import { MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { IThreepid, ThreepidMedium, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import IdentityAuthClient from "./IdentityAuthClient"; diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 957377f477..0760d316b7 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -17,9 +17,16 @@ limitations under the License. import React, { createRef, ReactNode, TransitionEvent } from "react"; import ReactDOM from "react-dom"; import classNames from "classnames"; -import { Room, MatrixClient, RoomStateEvent, EventStatus, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { + Room, + MatrixClient, + RoomStateEvent, + EventStatus, + MatrixEvent, + EventType, + M_BEACON_INFO, +} from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; import { isSupportedReceiptType } from "matrix-js-sdk/src/utils"; import { Optional } from "matrix-events-sdk"; diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index 0b77d5daa9..86fa7adb4a 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -37,10 +37,10 @@ import { TimelineWindow, Thread, ThreadEvent, + ReceiptType, } from "matrix-js-sdk/src/matrix"; import { debounce, findLastIndex, throttle } from "lodash"; import { logger } from "matrix-js-sdk/src/logger"; -import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; import SettingsStore from "../../settings/SettingsStore"; import { Layout } from "../../settings/enums/Layout"; diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index 53f0576ea4..1c70ffd906 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -26,11 +26,11 @@ import { MatrixClient, SSOFlow, SSOAction, + RegisterResponse, } from "matrix-js-sdk/src/matrix"; import React, { Fragment, ReactNode } from "react"; import classNames from "classnames"; import { logger } from "matrix-js-sdk/src/logger"; -import { RegisterResponse } from "matrix-js-sdk/src/@types/registration"; import { _t } from "../../../languageHandler"; import { adminContactStrings, messageForResourceLimitError, resourceLimitStrings } from "../../../utils/ErrorUtils"; diff --git a/src/components/views/context_menus/MessageContextMenu.tsx b/src/components/views/context_menus/MessageContextMenu.tsx index 54f845f751..e794789ca8 100644 --- a/src/components/views/context_menus/MessageContextMenu.tsx +++ b/src/components/views/context_menus/MessageContextMenu.tsx @@ -26,8 +26,8 @@ import { RelationType, Relations, Thread, + M_POLL_START, } from "matrix-js-sdk/src/matrix"; -import { M_POLL_START } from "matrix-js-sdk/src/@types/polls"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import dis from "../../../dispatcher/dispatcher"; diff --git a/src/components/views/dialogs/ForwardDialog.tsx b/src/components/views/dialogs/ForwardDialog.tsx index 395c0e4146..c33ca0d703 100644 --- a/src/components/views/dialogs/ForwardDialog.tsx +++ b/src/components/views/dialogs/ForwardDialog.tsx @@ -24,9 +24,11 @@ import { EventType, MatrixClient, ContentHelpers, + ILocationContent, + LocationAssetType, + M_TIMESTAMP, + M_BEACON, } from "matrix-js-sdk/src/matrix"; -import { ILocationContent, LocationAssetType, M_TIMESTAMP } from "matrix-js-sdk/src/@types/location"; -import { M_BEACON } from "matrix-js-sdk/src/@types/beacon"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; diff --git a/src/components/views/dialogs/devtools/RoomNotifications.tsx b/src/components/views/dialogs/devtools/RoomNotifications.tsx index d7a2ad253d..34e9a29c6b 100644 --- a/src/components/views/dialogs/devtools/RoomNotifications.tsx +++ b/src/components/views/dialogs/devtools/RoomNotifications.tsx @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { NotificationCountType, Room, Thread } from "matrix-js-sdk/src/matrix"; +import { NotificationCountType, Room, Thread, ReceiptType } from "matrix-js-sdk/src/matrix"; import React, { useContext } from "react"; -import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; import { ReadReceipt } from "matrix-js-sdk/src/models/read-receipt"; import MatrixClientContext from "../../../../contexts/MatrixClientContext"; diff --git a/src/components/views/elements/PollCreateDialog.tsx b/src/components/views/elements/PollCreateDialog.tsx index 16c8a69b58..bf9804fd66 100644 --- a/src/components/views/elements/PollCreateDialog.tsx +++ b/src/components/views/elements/PollCreateDialog.tsx @@ -15,15 +15,16 @@ limitations under the License. */ import React, { ChangeEvent, createRef } from "react"; -import { Room, MatrixEvent } from "matrix-js-sdk/src/matrix"; import { + Room, + MatrixEvent, KnownPollKind, M_POLL_KIND_DISCLOSED, M_POLL_KIND_UNDISCLOSED, M_POLL_START, -} from "matrix-js-sdk/src/@types/polls"; + IPartialEvent, +} from "matrix-js-sdk/src/matrix"; import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; -import { IPartialEvent } from "matrix-js-sdk/src/@types/extensible_events"; import ScrollableBaseModal, { IScrollableBaseState } from "../dialogs/ScrollableBaseModal"; import QuestionDialog from "../dialogs/QuestionDialog"; diff --git a/src/components/views/elements/SSOButtons.tsx b/src/components/views/elements/SSOButtons.tsx index c3778532a5..24339a579a 100644 --- a/src/components/views/elements/SSOButtons.tsx +++ b/src/components/views/elements/SSOButtons.tsx @@ -17,9 +17,15 @@ limitations under the License. import React from "react"; import { chunk } from "lodash"; import classNames from "classnames"; -import { MatrixClient, IdentityProviderBrand, SSOFlow, SSOAction } from "matrix-js-sdk/src/matrix"; +import { + MatrixClient, + IdentityProviderBrand, + SSOFlow, + SSOAction, + IIdentityProvider, + DELEGATED_OIDC_COMPATIBILITY, +} from "matrix-js-sdk/src/matrix"; import { Signup } from "@matrix-org/analytics-events/types/typescript/Signup"; -import { IIdentityProvider, DELEGATED_OIDC_COMPATIBILITY } from "matrix-js-sdk/src/@types/auth"; import PlatformPeg from "../../../PlatformPeg"; import AccessibleButton from "./AccessibleButton"; diff --git a/src/components/views/messages/MBeaconBody.tsx b/src/components/views/messages/MBeaconBody.tsx index 74d5127ae0..eeed20d567 100644 --- a/src/components/views/messages/MBeaconBody.tsx +++ b/src/components/views/messages/MBeaconBody.tsx @@ -24,9 +24,9 @@ import { RelationType, IRedactOpts, ContentHelpers, + M_BEACON, } from "matrix-js-sdk/src/matrix"; import { randomString } from "matrix-js-sdk/src/randomstring"; -import { M_BEACON } from "matrix-js-sdk/src/@types/beacon"; import classNames from "classnames"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; diff --git a/src/components/views/messages/MPollBody.tsx b/src/components/views/messages/MPollBody.tsx index f0829ca27a..e26c1faf4b 100644 --- a/src/components/views/messages/MPollBody.tsx +++ b/src/components/views/messages/MPollBody.tsx @@ -16,8 +16,16 @@ limitations under the License. import React, { ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixEvent, MatrixClient, Relations, Poll, PollEvent } from "matrix-js-sdk/src/matrix"; -import { M_POLL_KIND_DISCLOSED, M_POLL_RESPONSE, M_POLL_START } from "matrix-js-sdk/src/@types/polls"; +import { + MatrixEvent, + MatrixClient, + Relations, + Poll, + PollEvent, + M_POLL_KIND_DISCLOSED, + M_POLL_RESPONSE, + M_POLL_START, +} from "matrix-js-sdk/src/matrix"; import { RelatedRelations } from "matrix-js-sdk/src/models/related-relations"; import { PollStartEvent, PollAnswerSubevent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; import { PollResponseEvent } from "matrix-js-sdk/src/extensible_events_v1/PollResponseEvent"; diff --git a/src/components/views/messages/MPollEndBody.tsx b/src/components/views/messages/MPollEndBody.tsx index 091a69be94..7aef7a5b51 100644 --- a/src/components/views/messages/MPollEndBody.tsx +++ b/src/components/views/messages/MPollEndBody.tsx @@ -15,8 +15,7 @@ limitations under the License. */ import React, { useEffect, useState, useContext, ForwardRefExoticComponent } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { M_TEXT } from "matrix-js-sdk/src/@types/extensible_events"; +import { MatrixEvent, M_TEXT } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { Icon as PollIcon } from "../../../../res/img/element-icons/room/composer/poll.svg"; diff --git a/src/components/views/messages/MessageActionBar.tsx b/src/components/views/messages/MessageActionBar.tsx index 70e48bb2cd..54b2923bcc 100644 --- a/src/components/views/messages/MessageActionBar.tsx +++ b/src/components/views/messages/MessageActionBar.tsx @@ -17,9 +17,15 @@ limitations under the License. */ import React, { ReactElement, useCallback, useContext, useEffect } from "react"; -import { EventStatus, MatrixEvent, MatrixEventEvent, MsgType, RelationType } from "matrix-js-sdk/src/matrix"; +import { + EventStatus, + MatrixEvent, + MatrixEventEvent, + MsgType, + RelationType, + M_BEACON_INFO, +} from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; import { Icon as ContextMenuIcon } from "../../../../res/img/element-icons/context-menu.svg"; import { Icon as EditIcon } from "../../../../res/img/element-icons/room/message-bar/edit.svg"; diff --git a/src/components/views/messages/MessageEvent.tsx b/src/components/views/messages/MessageEvent.tsx index dfadd5a231..db0016de7b 100644 --- a/src/components/views/messages/MessageEvent.tsx +++ b/src/components/views/messages/MessageEvent.tsx @@ -15,10 +15,15 @@ limitations under the License. */ import React, { createRef } from "react"; -import { EventType, MsgType, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; -import { M_LOCATION } from "matrix-js-sdk/src/@types/location"; -import { M_POLL_END, M_POLL_START } from "matrix-js-sdk/src/@types/polls"; +import { + EventType, + MsgType, + MatrixEventEvent, + M_BEACON_INFO, + M_LOCATION, + M_POLL_END, + M_POLL_START, +} from "matrix-js-sdk/src/matrix"; import SettingsStore from "../../../settings/SettingsStore"; import { Mjolnir } from "../../../mjolnir/Mjolnir"; diff --git a/src/components/views/polls/pollHistory/fetchPastPolls.ts b/src/components/views/polls/pollHistory/fetchPastPolls.ts index d05e3ef9ef..958dc68a13 100644 --- a/src/components/views/polls/pollHistory/fetchPastPolls.ts +++ b/src/components/views/polls/pollHistory/fetchPastPolls.ts @@ -15,8 +15,8 @@ limitations under the License. */ import { useCallback, useEffect, useState } from "react"; -import { M_POLL_START } from "matrix-js-sdk/src/@types/polls"; import { + M_POLL_START, MatrixClient, Direction, EventTimeline, diff --git a/src/components/views/rooms/MessageComposerButtons.tsx b/src/components/views/rooms/MessageComposerButtons.tsx index bda6d6bbfe..41fd8291f9 100644 --- a/src/components/views/rooms/MessageComposerButtons.tsx +++ b/src/components/views/rooms/MessageComposerButtons.tsx @@ -15,8 +15,7 @@ limitations under the License. */ import classNames from "classnames"; -import { IEventRelation, Room, MatrixClient, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix"; -import { M_POLL_START } from "matrix-js-sdk/src/@types/polls"; +import { IEventRelation, Room, MatrixClient, THREAD_RELATION_TYPE, M_POLL_START } from "matrix-js-sdk/src/matrix"; import React, { createContext, ReactElement, ReactNode, useContext, useRef } from "react"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/settings/Notifications.tsx b/src/components/views/settings/Notifications.tsx index be0ad075dd..aabc382c82 100644 --- a/src/components/views/settings/Notifications.tsx +++ b/src/components/views/settings/Notifications.tsx @@ -15,10 +15,17 @@ limitations under the License. */ import React, { ReactNode } from "react"; -import { IAnnotatedPushRule, IPusher, PushRuleAction, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; -import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { + IAnnotatedPushRule, + IPusher, + PushRuleAction, + PushRuleKind, + RuleId, + IThreepid, + ThreepidMedium, + LocalNotificationSettings, +} from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; import Spinner from "../elements/Spinner"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/settings/SetIdServer.tsx b/src/components/views/settings/SetIdServer.tsx index 8c7df5cf18..4a5b44ef0a 100644 --- a/src/components/views/settings/SetIdServer.tsx +++ b/src/components/views/settings/SetIdServer.tsx @@ -16,7 +16,7 @@ limitations under the License. import React, { ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; +import { IThreepid } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/settings/account/EmailAddresses.tsx b/src/components/views/settings/account/EmailAddresses.tsx index 9d267a523e..a7d20f5b97 100644 --- a/src/components/views/settings/account/EmailAddresses.tsx +++ b/src/components/views/settings/account/EmailAddresses.tsx @@ -16,9 +16,8 @@ limitations under the License. */ import React from "react"; -import { ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { ThreepidMedium, MatrixError } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixError } from "matrix-js-sdk/src/matrix"; import { _t, UserFriendlyError } from "../../../../languageHandler"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; diff --git a/src/components/views/settings/account/PhoneNumbers.tsx b/src/components/views/settings/account/PhoneNumbers.tsx index d883d2a347..ea01bcb976 100644 --- a/src/components/views/settings/account/PhoneNumbers.tsx +++ b/src/components/views/settings/account/PhoneNumbers.tsx @@ -16,7 +16,7 @@ limitations under the License. */ import React from "react"; -import { ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { ThreepidMedium } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t, UserFriendlyError } from "../../../../languageHandler"; diff --git a/src/components/views/settings/devices/CurrentDeviceSection.tsx b/src/components/views/settings/devices/CurrentDeviceSection.tsx index 516acf3f96..14b0bde1cb 100644 --- a/src/components/views/settings/devices/CurrentDeviceSection.tsx +++ b/src/components/views/settings/devices/CurrentDeviceSection.tsx @@ -15,7 +15,7 @@ limitations under the License. */ import React, { useState } from "react"; -import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; +import { LocalNotificationSettings } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../languageHandler"; import Spinner from "../../elements/Spinner"; diff --git a/src/components/views/settings/devices/DeviceDetails.tsx b/src/components/views/settings/devices/DeviceDetails.tsx index 64c8d0a07d..58608598ec 100644 --- a/src/components/views/settings/devices/DeviceDetails.tsx +++ b/src/components/views/settings/devices/DeviceDetails.tsx @@ -16,8 +16,7 @@ limitations under the License. import React from "react"; import classNames from "classnames"; -import { IPusher, PUSHER_ENABLED } from "matrix-js-sdk/src/matrix"; -import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; +import { IPusher, PUSHER_ENABLED, LocalNotificationSettings } from "matrix-js-sdk/src/matrix"; import { formatDate } from "../../../../DateUtils"; import { _t } from "../../../../languageHandler"; diff --git a/src/components/views/settings/devices/FilteredDeviceList.tsx b/src/components/views/settings/devices/FilteredDeviceList.tsx index 805e62a54a..f36444d72a 100644 --- a/src/components/views/settings/devices/FilteredDeviceList.tsx +++ b/src/components/views/settings/devices/FilteredDeviceList.tsx @@ -15,8 +15,7 @@ limitations under the License. */ import React, { ForwardedRef, forwardRef } from "react"; -import { IPusher, PUSHER_DEVICE_ID } from "matrix-js-sdk/src/matrix"; -import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; +import { IPusher, PUSHER_DEVICE_ID, LocalNotificationSettings } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../languageHandler"; import AccessibleButton from "../../elements/AccessibleButton"; diff --git a/src/components/views/settings/devices/useOwnDevices.ts b/src/components/views/settings/devices/useOwnDevices.ts index 7093c0544e..24c5cb25fc 100644 --- a/src/components/views/settings/devices/useOwnDevices.ts +++ b/src/components/views/settings/devices/useOwnDevices.ts @@ -26,10 +26,10 @@ import { PUSHER_ENABLED, UNSTABLE_MSC3852_LAST_SEEN_UA, MatrixError, + LocalNotificationSettings, } from "matrix-js-sdk/src/matrix"; import { VerificationRequest } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; -import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; import { CryptoEvent } from "matrix-js-sdk/src/crypto"; import MatrixClientContext from "../../../../contexts/MatrixClientContext"; diff --git a/src/components/views/settings/notifications/NotificationPusherSettings.tsx b/src/components/views/settings/notifications/NotificationPusherSettings.tsx index 5035e58550..fc7a81615c 100644 --- a/src/components/views/settings/notifications/NotificationPusherSettings.tsx +++ b/src/components/views/settings/notifications/NotificationPusherSettings.tsx @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; -import { IPusher } from "matrix-js-sdk/src/matrix"; +import { ThreepidMedium, IPusher } from "matrix-js-sdk/src/matrix"; import React, { useCallback, useMemo } from "react"; import { useMatrixClientContext } from "../../../../contexts/MatrixClientContext"; diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx index 1c6eccdaab..7d48460127 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx @@ -17,8 +17,7 @@ limitations under the License. */ import React, { ReactNode } from "react"; -import { SERVICE_TYPES, HTTPError } from "matrix-js-sdk/src/matrix"; -import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; +import { SERVICE_TYPES, HTTPError, IThreepid, ThreepidMedium } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { Icon as WarningIcon } from "../../../../../../res/img/feather-customised/warning-triangle.svg"; diff --git a/src/events/EventTileFactory.tsx b/src/events/EventTileFactory.tsx index 55966852ff..99ddc6c6ce 100644 --- a/src/events/EventTileFactory.tsx +++ b/src/events/EventTileFactory.tsx @@ -15,9 +15,17 @@ limitations under the License. */ import React from "react"; -import { MatrixEvent, EventType, MsgType, RelationType, MatrixClient, GroupCallIntent } from "matrix-js-sdk/src/matrix"; +import { + MatrixEvent, + EventType, + MsgType, + RelationType, + MatrixClient, + GroupCallIntent, + M_POLL_END, + M_POLL_START, +} from "matrix-js-sdk/src/matrix"; import { Optional } from "matrix-events-sdk"; -import { M_POLL_END, M_POLL_START } from "matrix-js-sdk/src/@types/polls"; import SettingsStore from "../settings/SettingsStore"; import LegacyCallEventGrouper from "../components/structures/LegacyCallEventGrouper"; diff --git a/src/events/forward/getForwardableEvent.ts b/src/events/forward/getForwardableEvent.ts index 380c0a5f9a..ddf5f180ad 100644 --- a/src/events/forward/getForwardableEvent.ts +++ b/src/events/forward/getForwardableEvent.ts @@ -14,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { M_POLL_END, M_POLL_START } from "matrix-js-sdk/src/@types/polls"; -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; -import { MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { M_POLL_END, M_POLL_START, M_BEACON_INFO, MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; import { getShareableLocationEventForBeacon } from "../../utils/beacon/getShareableLocation"; import { VoiceBroadcastInfoEventType } from "../../voice-broadcast/types"; diff --git a/src/events/location/getShareableLocationEvent.ts b/src/events/location/getShareableLocationEvent.ts index 09b84dbf8f..4070bb7acb 100644 --- a/src/events/location/getShareableLocationEvent.ts +++ b/src/events/location/getShareableLocationEvent.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; -import { MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { M_BEACON_INFO, MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; import { getShareableLocationEventForBeacon } from "../../utils/beacon/getShareableLocation"; import { isLocationEvent } from "../../utils/EventUtils"; diff --git a/src/hooks/room/useTopic.ts b/src/hooks/room/useTopic.ts index c1485fd6cf..1b63cb8ed9 100644 --- a/src/hooks/room/useTopic.ts +++ b/src/hooks/room/useTopic.ts @@ -15,8 +15,14 @@ limitations under the License. */ import { useEffect, useState } from "react"; -import { EventType, MatrixEvent, Room, RoomStateEvent, ContentHelpers } from "matrix-js-sdk/src/matrix"; -import { MRoomTopicEventContent } from "matrix-js-sdk/src/@types/topic"; +import { + EventType, + MatrixEvent, + Room, + RoomStateEvent, + ContentHelpers, + MRoomTopicEventContent, +} from "matrix-js-sdk/src/matrix"; import { Optional } from "matrix-events-sdk"; import { useTypedEventEmitter } from "../useEventEmitter"; diff --git a/src/hooks/useThreepids.ts b/src/hooks/useThreepids.ts index b2762c0817..72ce67dd04 100644 --- a/src/hooks/useThreepids.ts +++ b/src/hooks/useThreepids.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixClient } from "matrix-js-sdk/src/matrix"; -import { IThreepid } from "matrix-js-sdk/src/@types/threepids"; +import { MatrixClient, IThreepid } from "matrix-js-sdk/src/matrix"; import { useAsyncRefreshMemo } from "./useAsyncRefreshMemo"; diff --git a/src/stores/OwnBeaconStore.ts b/src/stores/OwnBeaconStore.ts index bdece66512..e2b4a0c07b 100644 --- a/src/stores/OwnBeaconStore.ts +++ b/src/stores/OwnBeaconStore.ts @@ -25,8 +25,9 @@ import { RoomState, RoomStateEvent, ContentHelpers, + MBeaconInfoEventContent, + M_BEACON, } from "matrix-js-sdk/src/matrix"; -import { MBeaconInfoEventContent, M_BEACON } from "matrix-js-sdk/src/@types/beacon"; import { logger } from "matrix-js-sdk/src/logger"; import defaultDispatcher from "../dispatcher/dispatcher"; diff --git a/src/stores/room-list/MessagePreviewStore.ts b/src/stores/room-list/MessagePreviewStore.ts index efec81a9e8..62dfa6f0f1 100644 --- a/src/stores/room-list/MessagePreviewStore.ts +++ b/src/stores/room-list/MessagePreviewStore.ts @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { Room, RelationType, MatrixEvent, Thread } from "matrix-js-sdk/src/matrix"; +import { Room, RelationType, MatrixEvent, Thread, M_POLL_START } from "matrix-js-sdk/src/matrix"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; -import { M_POLL_START } from "matrix-js-sdk/src/@types/polls"; import { ActionPayload } from "../../dispatcher/payloads"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; diff --git a/src/stores/room-list/previews/PollStartEventPreview.ts b/src/stores/room-list/previews/PollStartEventPreview.ts index f6577889f7..d18bd80cbd 100644 --- a/src/stores/room-list/previews/PollStartEventPreview.ts +++ b/src/stores/room-list/previews/PollStartEventPreview.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { PollStartEventContent } from "matrix-js-sdk/src/@types/polls"; +import { MatrixEvent, PollStartEventContent } from "matrix-js-sdk/src/matrix"; import { InvalidEventError } from "matrix-js-sdk/src/extensible_events_v1/InvalidEventError"; import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; diff --git a/src/utils/EventRenderingUtils.ts b/src/utils/EventRenderingUtils.ts index a094283fcd..8fad898bed 100644 --- a/src/utils/EventRenderingUtils.ts +++ b/src/utils/EventRenderingUtils.ts @@ -14,9 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixEvent, IContent, MatrixClient, EventType, MsgType } from "matrix-js-sdk/src/matrix"; -import { M_POLL_END, M_POLL_START } from "matrix-js-sdk/src/@types/polls"; -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; +import { + MatrixEvent, + IContent, + MatrixClient, + EventType, + MsgType, + M_POLL_END, + M_POLL_START, + M_BEACON_INFO, +} from "matrix-js-sdk/src/matrix"; import SettingsStore from "../settings/SettingsStore"; import { haveRendererForEvent, JitsiEventFactory, JSONEventFactory, pickFactory } from "../events/EventTileFactory"; diff --git a/src/utils/EventUtils.ts b/src/utils/EventUtils.ts index 50b5875682..373bcf49a7 100644 --- a/src/utils/EventUtils.ts +++ b/src/utils/EventUtils.ts @@ -23,11 +23,12 @@ import { RelationType, MatrixClient, THREAD_RELATION_TYPE, + M_POLL_END, + M_POLL_START, + M_LOCATION, + M_BEACON_INFO, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { M_POLL_END, M_POLL_START } from "matrix-js-sdk/src/@types/polls"; -import { M_LOCATION } from "matrix-js-sdk/src/@types/location"; -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; import shouldHideEvent from "../shouldHideEvent"; import { GetRelationsForEvent } from "../components/views/rooms/EventTile"; diff --git a/src/utils/PinningUtils.ts b/src/utils/PinningUtils.ts index d6baf40013..f9750a3ed2 100644 --- a/src/utils/PinningUtils.ts +++ b/src/utils/PinningUtils.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; -import { M_POLL_START } from "matrix-js-sdk/src/@types/polls"; +import { MatrixEvent, EventType, M_POLL_START } from "matrix-js-sdk/src/matrix"; export default class PinningUtils { /** diff --git a/src/utils/Reply.ts b/src/utils/Reply.ts index 9e5420b1aa..3ecd893967 100644 --- a/src/utils/Reply.ts +++ b/src/utils/Reply.ts @@ -15,11 +15,18 @@ * limitations under the License. */ -import { IContent, IEventRelation, MatrixEvent, MsgType, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix"; +import { + IContent, + IEventRelation, + MatrixEvent, + MsgType, + THREAD_RELATION_TYPE, + M_BEACON_INFO, + M_POLL_END, + M_POLL_START, +} from "matrix-js-sdk/src/matrix"; import sanitizeHtml from "sanitize-html"; import escapeHtml from "escape-html"; -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; -import { M_POLL_END, M_POLL_START } from "matrix-js-sdk/src/@types/polls"; import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; import { PERMITTED_URL_SCHEMES } from "./UrlUtils"; diff --git a/src/utils/beacon/timeline.ts b/src/utils/beacon/timeline.ts index a04a61f364..2c8d1e106f 100644 --- a/src/utils/beacon/timeline.ts +++ b/src/utils/beacon/timeline.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; +import { MatrixEvent, M_BEACON_INFO } from "matrix-js-sdk/src/matrix"; /** * beacon_info events without live property set to true diff --git a/src/utils/location/isSelfLocation.ts b/src/utils/location/isSelfLocation.ts index d1e656e1a0..479e60d6c6 100644 --- a/src/utils/location/isSelfLocation.ts +++ b/src/utils/location/isSelfLocation.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ILocationContent, LocationAssetType, M_ASSET } from "matrix-js-sdk/src/@types/location"; +import { ILocationContent, LocationAssetType, M_ASSET } from "matrix-js-sdk/src/matrix"; export const isSelfLocation = (locationContent: ILocationContent): boolean => { const asset = M_ASSET.findIn(locationContent) as { type: string }; diff --git a/src/utils/location/locationEventGeoUri.ts b/src/utils/location/locationEventGeoUri.ts index 2009edc325..a04df2d6a7 100644 --- a/src/utils/location/locationEventGeoUri.ts +++ b/src/utils/location/locationEventGeoUri.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { M_LOCATION } from "matrix-js-sdk/src/@types/location"; +import { MatrixEvent, M_LOCATION } from "matrix-js-sdk/src/matrix"; /** * Find the geo-URI contained within a location event. diff --git a/src/utils/location/map.ts b/src/utils/location/map.ts index b39331b949..b7267fdb3a 100644 --- a/src/utils/location/map.ts +++ b/src/utils/location/map.ts @@ -15,8 +15,7 @@ limitations under the License. */ import * as maplibregl from "maplibre-gl"; -import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { M_LOCATION } from "matrix-js-sdk/src/@types/location"; +import { MatrixClient, MatrixEvent, M_LOCATION } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../languageHandler"; diff --git a/src/utils/notifications.ts b/src/utils/notifications.ts index 1e6ca3e841..e0cde92617 100644 --- a/src/utils/notifications.ts +++ b/src/utils/notifications.ts @@ -19,9 +19,9 @@ import { LOCAL_NOTIFICATION_SETTINGS_PREFIX, NotificationCountType, Room, + LocalNotificationSettings, + ReceiptType, } from "matrix-js-sdk/src/matrix"; -import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications"; -import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; import SettingsStore from "../settings/SettingsStore"; diff --git a/test/Reply-test.ts b/test/Reply-test.ts index 48fc03d590..ac64610ec7 100644 --- a/test/Reply-test.ts +++ b/test/Reply-test.ts @@ -14,10 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { IContent, MatrixEvent, MsgType } from "matrix-js-sdk/src/matrix"; -import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; -import { LocationAssetType, M_ASSET } from "matrix-js-sdk/src/@types/location"; -import { M_POLL_END } from "matrix-js-sdk/src/@types/polls"; +import { + IContent, + MatrixEvent, + MsgType, + M_BEACON_INFO, + LocationAssetType, + M_ASSET, + M_POLL_END, +} from "matrix-js-sdk/src/matrix"; import { getNestedReplyText, diff --git a/test/Unread-test.ts b/test/Unread-test.ts index 300acfa54b..46221d75d2 100644 --- a/test/Unread-test.ts +++ b/test/Unread-test.ts @@ -15,8 +15,7 @@ limitations under the License. */ import { mocked } from "jest-mock"; -import { MatrixEvent, EventType, MsgType, Room } from "matrix-js-sdk/src/matrix"; -import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; +import { MatrixEvent, EventType, MsgType, Room, ReceiptType } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { haveRendererForEvent } from "../src/events/EventTileFactory"; diff --git a/test/components/structures/MessagePanel-test.tsx b/test/components/structures/MessagePanel-test.tsx index f368ca9515..afbe87a0a6 100644 --- a/test/components/structures/MessagePanel-test.tsx +++ b/test/components/structures/MessagePanel-test.tsx @@ -17,9 +17,8 @@ limitations under the License. import React from "react"; import { EventEmitter } from "events"; -import { MatrixEvent, Room, RoomMember, Thread } from "matrix-js-sdk/src/matrix"; +import { MatrixEvent, Room, RoomMember, Thread, ReceiptType } from "matrix-js-sdk/src/matrix"; import { render } from "@testing-library/react"; -import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; import MessagePanel, { shouldFormContinuation } from "../../../src/components/structures/MessagePanel"; import SettingsStore from "../../../src/settings/SettingsStore"; diff --git a/test/components/structures/TimelinePanel-test.tsx b/test/components/structures/TimelinePanel-test.tsx index 97c9b52ab1..2c43fe432b 100644 --- a/test/components/structures/TimelinePanel-test.tsx +++ b/test/components/structures/TimelinePanel-test.tsx @@ -15,8 +15,8 @@ limitations under the License. */ import { render, waitFor, screen } from "@testing-library/react"; -import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; import { + ReceiptType, EventTimelineSet, EventType, MatrixClient, diff --git a/test/components/structures/auth/Login-test.tsx b/test/components/structures/auth/Login-test.tsx index 9a9a1a8329..85100ad7a3 100644 --- a/test/components/structures/auth/Login-test.tsx +++ b/test/components/structures/auth/Login-test.tsx @@ -18,7 +18,7 @@ import React from "react"; import { fireEvent, render, screen, waitForElementToBeRemoved } from "@testing-library/react"; import { mocked, MockedObject } from "jest-mock"; import fetchMock from "fetch-mock-jest"; -import { DELEGATED_OIDC_COMPATIBILITY, IdentityProviderBrand } from "matrix-js-sdk/src/@types/auth"; +import { DELEGATED_OIDC_COMPATIBILITY, IdentityProviderBrand } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import * as Matrix from "matrix-js-sdk/src/matrix"; import { OidcError } from "matrix-js-sdk/src/oidc/error"; diff --git a/test/components/views/context_menus/MessageContextMenu-test.tsx b/test/components/views/context_menus/MessageContextMenu-test.tsx index 42ab2dbe1b..8da114a2e1 100644 --- a/test/components/views/context_menus/MessageContextMenu-test.tsx +++ b/test/components/views/context_menus/MessageContextMenu-test.tsx @@ -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"; diff --git a/test/components/views/context_menus/RoomGeneralContextMenu-test.tsx b/test/components/views/context_menus/RoomGeneralContextMenu-test.tsx index e24d2dc086..bb832612bf 100644 --- a/test/components/views/context_menus/RoomGeneralContextMenu-test.tsx +++ b/test/components/views/context_menus/RoomGeneralContextMenu-test.tsx @@ -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"; diff --git a/test/components/views/dialogs/ForwardDialog-test.tsx b/test/components/views/dialogs/ForwardDialog-test.tsx index 7476918310..b4c131e99f 100644 --- a/test/components/views/dialogs/ForwardDialog-test.tsx +++ b/test/components/views/dialogs/ForwardDialog-test.tsx @@ -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"; diff --git a/test/components/views/elements/PollCreateDialog-test.tsx b/test/components/views/elements/PollCreateDialog-test.tsx index 738597af56..930af8fc32 100644 --- a/test/components/views/elements/PollCreateDialog-test.tsx +++ b/test/components/views/elements/PollCreateDialog-test.tsx @@ -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"; diff --git a/test/components/views/location/LocationShareMenu-test.tsx b/test/components/views/location/LocationShareMenu-test.tsx index ffee8dff60..83bf3a6b5f 100644 --- a/test/components/views/location/LocationShareMenu-test.tsx +++ b/test/components/views/location/LocationShareMenu-test.tsx @@ -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"; diff --git a/test/components/views/location/shareLocation-test.ts b/test/components/views/location/shareLocation-test.ts index 017430fd22..ecd210a081 100644 --- a/test/components/views/location/shareLocation-test.ts +++ b/test/components/views/location/shareLocation-test.ts @@ -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 { diff --git a/test/components/views/messages/MBeaconBody-test.tsx b/test/components/views/messages/MBeaconBody-test.tsx index d6f9a932e8..694df7f24a 100644 --- a/test/components/views/messages/MBeaconBody-test.tsx +++ b/test/components/views/messages/MBeaconBody-test.tsx @@ -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 { diff --git a/test/components/views/messages/MPollBody-test.tsx b/test/components/views/messages/MPollBody-test.tsx index 168476bfe0..7e9c2a542f 100644 --- a/test/components/views/messages/MPollBody-test.tsx +++ b/test/components/views/messages/MPollBody-test.tsx @@ -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"; diff --git a/test/components/views/messages/MPollEndBody-test.tsx b/test/components/views/messages/MPollEndBody-test.tsx index 2e78646ceb..4585f4d813 100644 --- a/test/components/views/messages/MPollEndBody-test.tsx +++ b/test/components/views/messages/MPollEndBody-test.tsx @@ -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"; diff --git a/test/components/views/polls/pollHistory/PollHistory-test.tsx b/test/components/views/polls/pollHistory/PollHistory-test.tsx index cfedfcc11e..2a5fc80168 100644 --- a/test/components/views/polls/pollHistory/PollHistory-test.tsx +++ b/test/components/views/polls/pollHistory/PollHistory-test.tsx @@ -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 { diff --git a/test/components/views/polls/pollHistory/PollListItemEnded-test.tsx b/test/components/views/polls/pollHistory/PollListItemEnded-test.tsx index 9ba284bc6c..7bf27ee447 100644 --- a/test/components/views/polls/pollHistory/PollListItemEnded-test.tsx +++ b/test/components/views/polls/pollHistory/PollListItemEnded-test.tsx @@ -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 { diff --git a/test/components/views/right_panel/LegacyRoomHeaderButtons-test.tsx b/test/components/views/right_panel/LegacyRoomHeaderButtons-test.tsx index 0ed8968c9c..97d24f1ce1 100644 --- a/test/components/views/right_panel/LegacyRoomHeaderButtons-test.tsx +++ b/test/components/views/right_panel/LegacyRoomHeaderButtons-test.tsx @@ -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"; diff --git a/test/components/views/right_panel/PinnedMessagesCard-test.tsx b/test/components/views/right_panel/PinnedMessagesCard-test.tsx index ea45312ac1..6439e55f88 100644 --- a/test/components/views/right_panel/PinnedMessagesCard-test.tsx +++ b/test/components/views/right_panel/PinnedMessagesCard-test.tsx @@ -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"; diff --git a/test/components/views/rooms/NotificationBadge/UnreadNotificationBadge-test.tsx b/test/components/views/rooms/NotificationBadge/UnreadNotificationBadge-test.tsx index e281b2d303..09fed6e73e 100644 --- a/test/components/views/rooms/NotificationBadge/UnreadNotificationBadge-test.tsx +++ b/test/components/views/rooms/NotificationBadge/UnreadNotificationBadge-test.tsx @@ -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"; diff --git a/test/components/views/settings/Notifications-test.tsx b/test/components/views/settings/Notifications-test.tsx index 685e062767..e8fbb74d57 100644 --- a/test/components/views/settings/Notifications-test.tsx +++ b/test/components/views/settings/Notifications-test.tsx @@ -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"; diff --git a/test/components/views/settings/devices/LoginWithQR-test.tsx b/test/components/views/settings/devices/LoginWithQR-test.tsx index e350c76dfb..af9ab74175 100644 --- a/test/components/views/settings/devices/LoginWithQR-test.tsx +++ b/test/components/views/settings/devices/LoginWithQR-test.tsx @@ -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"; diff --git a/test/components/views/settings/discovery/EmailAddresses-test.tsx b/test/components/views/settings/discovery/EmailAddresses-test.tsx index b2eaa3bd06..547f802873 100644 --- a/test/components/views/settings/discovery/EmailAddresses-test.tsx +++ b/test/components/views/settings/discovery/EmailAddresses-test.tsx @@ -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"; diff --git a/test/components/views/settings/discovery/PhoneNumbers-test.tsx b/test/components/views/settings/discovery/PhoneNumbers-test.tsx index 3dcfcb1419..19aede79cd 100644 --- a/test/components/views/settings/discovery/PhoneNumbers-test.tsx +++ b/test/components/views/settings/discovery/PhoneNumbers-test.tsx @@ -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"; diff --git a/test/components/views/settings/notifications/Notifications2-test.tsx b/test/components/views/settings/notifications/Notifications2-test.tsx index 7cbe432eaa..91c440d4f3 100644 --- a/test/components/views/settings/notifications/Notifications2-test.tsx +++ b/test/components/views/settings/notifications/Notifications2-test.tsx @@ -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"; diff --git a/test/components/views/settings/tabs/user/GeneralUserSettingsTab-test.tsx b/test/components/views/settings/tabs/user/GeneralUserSettingsTab-test.tsx index 96204490a6..a58cb6ea1a 100644 --- a/test/components/views/settings/tabs/user/GeneralUserSettingsTab-test.tsx +++ b/test/components/views/settings/tabs/user/GeneralUserSettingsTab-test.tsx @@ -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"; diff --git a/test/stores/OwnBeaconStore-test.ts b/test/stores/OwnBeaconStore-test.ts index 9867fb2728..378ebfe94c 100644 --- a/test/stores/OwnBeaconStore-test.ts +++ b/test/stores/OwnBeaconStore-test.ts @@ -23,8 +23,8 @@ import { RoomStateEvent, RoomMember, ContentHelpers, + M_BEACON, } from "matrix-js-sdk/src/matrix"; -import { M_BEACON } from "matrix-js-sdk/src/@types/beacon"; import { logger } from "matrix-js-sdk/src/logger"; import { Mocked } from "jest-mock"; diff --git a/test/test-utils/beacon.ts b/test/test-utils/beacon.ts index e519e791d4..081c986413 100644 --- a/test/test-utils/beacon.ts +++ b/test/test-utils/beacon.ts @@ -22,8 +22,9 @@ import { getBeaconInfoIdentifier, ContentHelpers, LocationAssetType, + M_BEACON, + M_BEACON_INFO, } from "matrix-js-sdk/src/matrix"; -import { M_BEACON, M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon"; import { getMockGeolocationPositionError } from "./location"; import { makeRoomWithStateEvents } from "./room"; diff --git a/test/test-utils/location.ts b/test/test-utils/location.ts index 4d22d98364..c0bd6d449e 100644 --- a/test/test-utils/location.ts +++ b/test/test-utils/location.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { LocationAssetType, M_LOCATION } from "matrix-js-sdk/src/@types/location"; -import { MatrixEvent, EventType, ContentHelpers } from "matrix-js-sdk/src/matrix"; +import { LocationAssetType, M_LOCATION, MatrixEvent, EventType, ContentHelpers } from "matrix-js-sdk/src/matrix"; let id = 1; export const makeLegacyLocationEvent = (geoUri: string): MatrixEvent => { diff --git a/test/test-utils/poll.ts b/test/test-utils/poll.ts index 76ca4b4680..cb1217a5d4 100644 --- a/test/test-utils/poll.ts +++ b/test/test-utils/poll.ts @@ -15,15 +15,17 @@ limitations under the License. */ import { Mocked } from "jest-mock"; -import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { + MatrixClient, + MatrixEvent, + Room, M_POLL_START, PollAnswer, M_POLL_KIND_DISCLOSED, M_POLL_END, M_POLL_RESPONSE, -} 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 { uuid4 } from "@sentry/utils"; import { flushPromises } from "./utilities"; diff --git a/test/test-utils/test-utils.ts b/test/test-utils/test-utils.ts index f96d8cebe1..35a926f7d3 100644 --- a/test/test-utils/test-utils.ts +++ b/test/test-utils/test-utils.ts @@ -36,13 +36,13 @@ import { IPushRules, RelationType, JoinRule, + IEventDecryptionResult, } from "matrix-js-sdk/src/matrix"; 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"; import { Feature, ServerSupport } from "matrix-js-sdk/src/feature"; import { CryptoBackend } from "matrix-js-sdk/src/common-crypto/CryptoBackend"; -import { IEventDecryptionResult } from "matrix-js-sdk/src/@types/crypto"; import { MapperOpts } from "matrix-js-sdk/src/event-mapper"; import type { GroupCall } from "matrix-js-sdk/src/matrix"; diff --git a/test/utils/EventUtils-test.ts b/test/utils/EventUtils-test.ts index 1d6aee98bc..fb88b7a21c 100644 --- a/test/utils/EventUtils-test.ts +++ b/test/utils/EventUtils-test.ts @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { M_LOCATION } from "matrix-js-sdk/src/@types/location"; import { + M_LOCATION, EventStatus, EventType, IEvent, diff --git a/test/utils/beacon/duration-test.ts b/test/utils/beacon/duration-test.ts index e4ac952086..bb5b5e7448 100644 --- a/test/utils/beacon/duration-test.ts +++ b/test/utils/beacon/duration-test.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { M_TIMESTAMP } from "matrix-js-sdk/src/@types/location"; -import { Beacon } from "matrix-js-sdk/src/matrix"; +import { M_TIMESTAMP, Beacon } from "matrix-js-sdk/src/matrix"; import { msUntilExpiry, sortBeaconsByLatestExpiry, sortBeaconsByLatestCreation } from "../../../src/utils/beacon"; import { makeBeaconInfoEvent } from "../../test-utils"; diff --git a/test/utils/location/isSelfLocation-test.ts b/test/utils/location/isSelfLocation-test.ts index 02d9b0253c..51492701f2 100644 --- a/test/utils/location/isSelfLocation-test.ts +++ b/test/utils/location/isSelfLocation-test.ts @@ -14,15 +14,15 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { M_TEXT } from "matrix-js-sdk/src/@types/extensible_events"; import { + M_TEXT, ILocationContent, LocationAssetType, M_ASSET, M_LOCATION, M_TIMESTAMP, -} from "matrix-js-sdk/src/@types/location"; -import { ContentHelpers } from "matrix-js-sdk/src/matrix"; + ContentHelpers, +} from "matrix-js-sdk/src/matrix"; import { isSelfLocation } from "../../../src/utils/location"; diff --git a/test/utils/notifications-test.ts b/test/utils/notifications-test.ts index ace6422732..a556f3ffc3 100644 --- a/test/utils/notifications-test.ts +++ b/test/utils/notifications-test.ts @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixEvent, NotificationCountType, Room, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { MatrixEvent, NotificationCountType, Room, MatrixClient, ReceiptType } from "matrix-js-sdk/src/matrix"; import { Mocked, mocked } from "jest-mock"; -import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts"; import { localNotificationsAreSilenced, diff --git a/test/utils/threepids-test.ts b/test/utils/threepids-test.ts index 3f8ac6242e..ef99874326 100644 --- a/test/utils/threepids-test.ts +++ b/test/utils/threepids-test.ts @@ -15,8 +15,7 @@ limitations under the License. */ import { Mocked } from "jest-mock"; -import { IIdentityServerProvider } from "matrix-js-sdk/src/@types/IIdentityServerProvider"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { IIdentityServerProvider, MatrixClient } from "matrix-js-sdk/src/matrix"; import { DirectoryMember, ThreepidMember } from "../../src/utils/direct-messages"; import { lookupThreePids, resolveThreePids } from "../../src/utils/threepids";