From ef385e6028ea7fca24b853000fd4222c2373f7b2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 10 Aug 2023 09:01:14 +0100 Subject: [PATCH] Switch to importing more things from the main js-sdk export (#11377) --- .eslintrc.js | 20 +++++++++++++++++++ src/DeviceListener.ts | 3 +-- src/IdentityAuthClient.tsx | 3 +-- src/LegacyCallHandler.tsx | 3 +-- src/Searching.ts | 8 +++++--- src/Terms.ts | 3 +-- src/components/structures/FilePanel.tsx | 2 +- src/components/structures/LoggedInView.tsx | 7 ++++--- src/components/structures/MatrixChat.tsx | 5 +++-- src/components/structures/RoomSearchView.tsx | 3 +-- src/components/structures/RoomStatusBar.tsx | 7 +++---- src/components/structures/RoomView.tsx | 2 +- src/components/structures/TimelinePanel.tsx | 2 +- src/components/views/dialogs/TermsDialog.tsx | 2 +- .../views/polls/pollHistory/fetchPastPolls.ts | 11 ++++++++-- .../views/rooms/LegacyRoomHeader.tsx | 3 +-- .../tabs/user/GeneralUserSettingsTab.tsx | 3 +-- src/components/views/voip/CallDuration.tsx | 2 +- src/events/EventTileFactory.tsx | 3 +-- src/indexing/BaseEventIndexManager.ts | 8 ++++++-- src/indexing/EventIndex.ts | 9 ++++++--- src/models/Call.ts | 18 ++++++++++------- src/stores/AutoRageshakeStore.ts | 5 ++--- src/stores/CallStore.ts | 3 +-- src/stores/ReadyWatchingStore.ts | 3 +-- .../RoomNotificationStateStore.ts | 3 +-- src/utils/IdentityServerUtils.ts | 3 +-- src/utils/connection.ts | 3 +-- .../utils/VoiceBroadcastResumer.ts | 3 +-- .../checkVoiceBroadcastPreConditions.tsx | 3 +-- test/Notifier-test.ts | 2 +- .../components/structures/MatrixChat-test.tsx | 3 +-- .../structures/RoomSearchView-test.tsx | 11 ++++++++-- .../views/messages/MLocationBody-test.tsx | 3 +-- .../polls/pollHistory/PollHistory-test.tsx | 3 +-- .../views/rooms/LegacyRoomHeader-test.tsx | 10 ++++++++-- test/models/Call-test.ts | 11 ++++++++-- test/stores/AutoRageshakeStore-test.ts | 10 ++++++++-- .../stores/RoomNotificationStateStore-test.ts | 3 +-- test/test-utils/call.ts | 3 +-- test/test-utils/test-utils.ts | 2 +- test/utils/connection-test.ts | 3 +-- .../VoiceBroadcastRecordingPip-test.tsx | 3 +-- .../models/VoiceBroadcastRecording-test.ts | 2 +- .../utils/VoiceBroadcastResumer-test.ts | 3 +-- .../setUpVoiceBroadcastPreRecording-test.ts | 3 +-- .../startNewVoiceBroadcastRecording-test.ts | 3 +-- 47 files changed, 136 insertions(+), 95 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 5d810164fd..09941cba7e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -134,6 +134,26 @@ module.exports = { name: "matrix-js-sdk/src/@types/PushRules", message: "Please use matrix-js-sdk/src/matrix instead", }, + { + name: "matrix-js-sdk/src/@types/search", + message: "Please use matrix-js-sdk/src/matrix instead", + }, + { + name: "matrix-js-sdk/src/filter", + message: "Please use matrix-js-sdk/src/matrix instead", + }, + { + name: "matrix-js-sdk/src/webrtc/groupCall", + message: "Please use matrix-js-sdk/src/matrix instead", + }, + { + name: "matrix-js-sdk/src/service-types", + message: "Please use matrix-js-sdk/src/matrix instead", + }, + { + name: "matrix-js-sdk/src/sync", + message: "Please use matrix-js-sdk/src/matrix instead", + }, { name: "matrix-react-sdk", message: "Please use matrix-react-sdk/src/index instead", diff --git a/src/DeviceListener.ts b/src/DeviceListener.ts index 24e7300721..8e8197736b 100644 --- a/src/DeviceListener.ts +++ b/src/DeviceListener.ts @@ -14,10 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { MatrixEvent, ClientEvent, EventType, MatrixClient, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { MatrixEvent, ClientEvent, EventType, MatrixClient, RoomStateEvent, SyncState } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { CryptoEvent } from "matrix-js-sdk/src/crypto"; -import { SyncState } from "matrix-js-sdk/src/sync"; import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; import dis from "./dispatcher/dispatcher"; diff --git a/src/IdentityAuthClient.tsx b/src/IdentityAuthClient.tsx index c27640c6c4..87909f5277 100644 --- a/src/IdentityAuthClient.tsx +++ b/src/IdentityAuthClient.tsx @@ -15,8 +15,7 @@ limitations under the License. */ import React from "react"; -import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; -import { createClient, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { SERVICE_TYPES, createClient, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "./MatrixClientPeg"; diff --git a/src/LegacyCallHandler.tsx b/src/LegacyCallHandler.tsx index c1a19a62db..5c9460aa98 100644 --- a/src/LegacyCallHandler.tsx +++ b/src/LegacyCallHandler.tsx @@ -18,7 +18,7 @@ limitations under the License. */ import React from "react"; -import { MatrixError, RuleId, TweakName } from "matrix-js-sdk/src/matrix"; +import { MatrixError, RuleId, TweakName, SyncState } from "matrix-js-sdk/src/matrix"; import { CallError, CallErrorCode, @@ -32,7 +32,6 @@ import { import { logger } from "matrix-js-sdk/src/logger"; import EventEmitter from "events"; import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; -import { SyncState } from "matrix-js-sdk/src/sync"; import { CallEventHandlerEvent } from "matrix-js-sdk/src/webrtc/callEventHandler"; import { MatrixClientPeg } from "./MatrixClientPeg"; diff --git a/src/Searching.ts b/src/Searching.ts index af73d0ae47..691600d591 100644 --- a/src/Searching.ts +++ b/src/Searching.ts @@ -21,9 +21,11 @@ import { ISearchResult, ISearchResults, SearchOrderBy, -} from "matrix-js-sdk/src/@types/search"; -import { IRoomEventFilter } from "matrix-js-sdk/src/filter"; -import { EventType, MatrixClient, SearchResult } from "matrix-js-sdk/src/matrix"; + IRoomEventFilter, + EventType, + MatrixClient, + SearchResult, +} from "matrix-js-sdk/src/matrix"; import { ISearchArgs } from "./indexing/BaseEventIndexManager"; import EventIndexPeg from "./indexing/EventIndexPeg"; diff --git a/src/Terms.ts b/src/Terms.ts index d31b6357f8..41400ef872 100644 --- a/src/Terms.ts +++ b/src/Terms.ts @@ -15,9 +15,8 @@ limitations under the License. */ import classNames from "classnames"; -import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; +import { SERVICE_TYPES, MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; import Modal from "./Modal"; import TermsDialog from "./components/views/dialogs/TermsDialog"; diff --git a/src/components/structures/FilePanel.tsx b/src/components/structures/FilePanel.tsx index a3850b90b6..18e6db0908 100644 --- a/src/components/structures/FilePanel.tsx +++ b/src/components/structures/FilePanel.tsx @@ -16,8 +16,8 @@ limitations under the License. */ import React, { createRef } from "react"; -import { Filter } from "matrix-js-sdk/src/filter"; import { + Filter, EventTimelineSet, IRoomTimelineData, Direction, diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index 612c563cfd..919b5e6053 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -22,10 +22,11 @@ import { RoomStateEvent, MatrixError, IUsageLimit, + SyncStateData, + SyncState, } from "matrix-js-sdk/src/matrix"; import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import classNames from "classnames"; -import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync"; import { isOnlyCtrlOrCmdKeyEvent, Key } from "../../Keyboard"; import PageTypes from "../../PageTypes"; @@ -109,7 +110,7 @@ interface IProps { } interface IState { - syncErrorData?: ISyncStateData; + syncErrorData?: SyncStateData; usageLimitDismissed: boolean; usageLimitEventContent?: IUsageLimit; usageLimitEventTs?: number; @@ -294,7 +295,7 @@ class LoggedInView extends React.Component { }); }; - private onSync = (syncState: SyncState | null, oldSyncState: SyncState | null, data?: ISyncStateData): void => { + private onSync = (syncState: SyncState | null, oldSyncState: SyncState | null, data?: SyncStateData): void => { const oldErrCode = (this.state.syncErrorData?.error as MatrixError)?.errcode; const newErrCode = (data?.error as MatrixError)?.errcode; if (syncState === oldSyncState && oldErrCode === newErrCode) return; diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index c5298dcd0c..1da54addf4 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -24,8 +24,9 @@ import { MatrixEventEvent, MatrixEvent, RoomType, + SyncStateData, + SyncState, } from "matrix-js-sdk/src/matrix"; -import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync"; import { InvalidStoreError } from "matrix-js-sdk/src/errors"; import { defer, IDeferred, QueryDict } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; @@ -1502,7 +1503,7 @@ export default class MatrixChat extends React.PureComponent { return this.loggedInView.current.canResetTimelineInRoom(roomId); }); - cli.on(ClientEvent.Sync, (state: SyncState, prevState: SyncState | null, data?: ISyncStateData) => { + cli.on(ClientEvent.Sync, (state: SyncState, prevState: SyncState | null, data?: SyncStateData) => { if (state === SyncState.Error || state === SyncState.Reconnecting) { if (data?.error instanceof InvalidStoreError) { Lifecycle.handleInvalidStoreError(data.error); diff --git a/src/components/structures/RoomSearchView.tsx b/src/components/structures/RoomSearchView.tsx index a08071eb02..ba552260e1 100644 --- a/src/components/structures/RoomSearchView.tsx +++ b/src/components/structures/RoomSearchView.tsx @@ -15,8 +15,7 @@ limitations under the License. */ import React, { forwardRef, useCallback, useContext, useEffect, useRef, useState } from "react"; -import { ISearchResults } from "matrix-js-sdk/src/@types/search"; -import { IThreadBundledRelationship, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { ISearchResults, IThreadBundledRelationship, MatrixEvent } from "matrix-js-sdk/src/matrix"; import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/components/structures/RoomStatusBar.tsx b/src/components/structures/RoomStatusBar.tsx index 8ff18eba36..98039b1abc 100644 --- a/src/components/structures/RoomStatusBar.tsx +++ b/src/components/structures/RoomStatusBar.tsx @@ -15,8 +15,7 @@ limitations under the License. */ import React, { ReactNode } from "react"; -import { EventStatus, MatrixEvent, Room, MatrixError } from "matrix-js-sdk/src/matrix"; -import { SyncState, ISyncStateData } from "matrix-js-sdk/src/sync"; +import { EventStatus, MatrixEvent, Room, MatrixError, SyncState, SyncStateData } from "matrix-js-sdk/src/matrix"; import { Icon as WarningIcon } from "../../../res/img/feather-customised/warning-triangle.svg"; import { _t, _td } from "../../languageHandler"; @@ -81,7 +80,7 @@ interface IProps { interface IState { syncState: SyncState; - syncStateData: ISyncStateData; + syncStateData: SyncStateData; unsentMessages: MatrixEvent[]; isResending: boolean; } @@ -123,7 +122,7 @@ export default class RoomStatusBar extends React.PureComponent { } } - private onSyncStateChange = (state: SyncState, prevState: SyncState, data: ISyncStateData): void => { + private onSyncStateChange = (state: SyncState, prevState: SyncState, data: SyncStateData): void => { if (state === "SYNCING" && prevState === "SYNCING") { return; } diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index b93481f467..26190460a2 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -35,13 +35,13 @@ import { JoinRule, ClientEvent, MatrixError, + ISearchResults, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { throttle } from "lodash"; import { CryptoEvent } from "matrix-js-sdk/src/crypto"; import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread"; -import { ISearchResults } from "matrix-js-sdk/src/@types/search"; import shouldHideEvent from "../../shouldHideEvent"; import { _t } from "../../languageHandler"; diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index 7d639eceaf..be414bb590 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -33,9 +33,9 @@ import { MatrixClient, Relations, MatrixError, + SyncState, } from "matrix-js-sdk/src/matrix"; import { TimelineWindow } from "matrix-js-sdk/src/timeline-window"; -import { SyncState } from "matrix-js-sdk/src/sync"; import { debounce, findLastIndex, throttle } from "lodash"; import { logger } from "matrix-js-sdk/src/logger"; import { Thread, ThreadEvent } from "matrix-js-sdk/src/models/thread"; diff --git a/src/components/views/dialogs/TermsDialog.tsx b/src/components/views/dialogs/TermsDialog.tsx index 3de62188e1..0098740204 100644 --- a/src/components/views/dialogs/TermsDialog.tsx +++ b/src/components/views/dialogs/TermsDialog.tsx @@ -15,7 +15,7 @@ limitations under the License. */ import React from "react"; -import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; +import { SERVICE_TYPES } from "matrix-js-sdk/src/matrix"; import { _t, pickBestLanguage } from "../../../languageHandler"; import DialogButtons from "../elements/DialogButtons"; diff --git a/src/components/views/polls/pollHistory/fetchPastPolls.ts b/src/components/views/polls/pollHistory/fetchPastPolls.ts index 2252a368fc..d05e3ef9ef 100644 --- a/src/components/views/polls/pollHistory/fetchPastPolls.ts +++ b/src/components/views/polls/pollHistory/fetchPastPolls.ts @@ -16,8 +16,15 @@ limitations under the License. import { useCallback, useEffect, useState } from "react"; import { M_POLL_START } from "matrix-js-sdk/src/@types/polls"; -import { MatrixClient, Direction, EventTimeline, EventTimelineSet, Room } from "matrix-js-sdk/src/matrix"; -import { Filter, IFilterDefinition } from "matrix-js-sdk/src/filter"; +import { + MatrixClient, + Direction, + EventTimeline, + EventTimelineSet, + Room, + Filter, + IFilterDefinition, +} from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; const getOldestEventTimestamp = (timelineSet?: EventTimelineSet): number | undefined => { diff --git a/src/components/views/rooms/LegacyRoomHeader.tsx b/src/components/views/rooms/LegacyRoomHeader.tsx index 315332fd8c..2bf56dc187 100644 --- a/src/components/views/rooms/LegacyRoomHeader.tsx +++ b/src/components/views/rooms/LegacyRoomHeader.tsx @@ -18,9 +18,8 @@ limitations under the License. import React, { FC, useState, useMemo, useCallback } from "react"; import classNames from "classnames"; import { throttle } from "lodash"; -import { RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { RoomStateEvent, ISearchResults } from "matrix-js-sdk/src/matrix"; import { CallType } from "matrix-js-sdk/src/webrtc/call"; -import { ISearchResults } from "matrix-js-sdk/src/@types/search"; import type { MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx index be6d8dd56a..4259cc5b9d 100644 --- a/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/GeneralUserSettingsTab.tsx @@ -17,10 +17,9 @@ limitations under the License. */ import React, { ReactNode } from "react"; -import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; +import { SERVICE_TYPES, IDelegatedAuthConfig, M_AUTHENTICATION, HTTPError } from "matrix-js-sdk/src/matrix"; import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids"; import { logger } from "matrix-js-sdk/src/logger"; -import { IDelegatedAuthConfig, M_AUTHENTICATION, HTTPError } from "matrix-js-sdk/src/matrix"; import { Icon as WarningIcon } from "../../../../../../res/img/feather-customised/warning-triangle.svg"; import { UserFriendlyError, _t } from "../../../../../languageHandler"; diff --git a/src/components/views/voip/CallDuration.tsx b/src/components/views/voip/CallDuration.tsx index 64d3837b89..1f0ec4822d 100644 --- a/src/components/views/voip/CallDuration.tsx +++ b/src/components/views/voip/CallDuration.tsx @@ -15,7 +15,7 @@ limitations under the License. */ import React, { FC, useState, useEffect, memo } from "react"; -import { GroupCall } from "matrix-js-sdk/src/webrtc/groupCall"; +import { GroupCall } from "matrix-js-sdk/src/matrix"; import { formatPreciseDuration } from "../../../DateUtils"; diff --git a/src/events/EventTileFactory.tsx b/src/events/EventTileFactory.tsx index 96206aaec3..55966852ff 100644 --- a/src/events/EventTileFactory.tsx +++ b/src/events/EventTileFactory.tsx @@ -15,10 +15,9 @@ limitations under the License. */ import React from "react"; -import { MatrixEvent, EventType, MsgType, RelationType, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { MatrixEvent, EventType, MsgType, RelationType, MatrixClient, GroupCallIntent } 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 { GroupCallIntent } from "matrix-js-sdk/src/webrtc/groupCall"; import SettingsStore from "../settings/SettingsStore"; import LegacyCallEventGrouper from "../components/structures/LegacyCallEventGrouper"; diff --git a/src/indexing/BaseEventIndexManager.ts b/src/indexing/BaseEventIndexManager.ts index 1234496b44..d618d1718a 100644 --- a/src/indexing/BaseEventIndexManager.ts +++ b/src/indexing/BaseEventIndexManager.ts @@ -14,8 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { IMatrixProfile, IEventWithRoomId as IMatrixEvent, IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; -import { Direction } from "matrix-js-sdk/src/matrix"; +import { + IMatrixProfile, + IEventWithRoomId as IMatrixEvent, + IResultRoomEvents, + Direction, +} from "matrix-js-sdk/src/matrix"; // The following interfaces take their names and member names from seshat and the spec /* eslint-disable camelcase */ diff --git a/src/indexing/EventIndex.ts b/src/indexing/EventIndex.ts index 9c2e755a9f..4360ed92e9 100644 --- a/src/indexing/EventIndex.ts +++ b/src/indexing/EventIndex.ts @@ -30,12 +30,15 @@ import { ClientEvent, MatrixClient, HTTPError, + IEventWithRoomId, + IMatrixProfile, + IResultRoomEvents, + SyncStateData, + SyncState, } from "matrix-js-sdk/src/matrix"; import { TimelineIndex, TimelineWindow } from "matrix-js-sdk/src/timeline-window"; import { sleep } from "matrix-js-sdk/src/utils"; -import { IEventWithRoomId, IMatrixProfile, IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; import { logger } from "matrix-js-sdk/src/logger"; -import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync"; import PlatformPeg from "../PlatformPeg"; import { MatrixClientPeg } from "../MatrixClientPeg"; @@ -168,7 +171,7 @@ export default class EventIndex extends EventEmitter { * - Every other sync, tell the event index to commit all the queued up * live events */ - private onSync = async (state: SyncState, prevState: SyncState | null, data?: ISyncStateData): Promise => { + private onSync = async (state: SyncState, prevState: SyncState | null, data?: SyncStateData): Promise => { const indexManager = PlatformPeg.get()?.getEventIndexingManager(); if (!indexManager) return; diff --git a/src/models/Call.ts b/src/models/Call.ts index 3a84fe59af..724d277f4e 100644 --- a/src/models/Call.ts +++ b/src/models/Call.ts @@ -14,19 +14,23 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { TypedEventEmitter, RoomEvent, RoomStateEvent, EventType, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { logger } from "matrix-js-sdk/src/logger"; -import { randomString } from "matrix-js-sdk/src/randomstring"; -import { CallType } from "matrix-js-sdk/src/webrtc/call"; -import { NamespacedValue } from "matrix-js-sdk/src/NamespacedValue"; -import { IWidgetApiRequest, MatrixWidgetType } from "matrix-widget-api"; import { + TypedEventEmitter, + RoomEvent, + RoomStateEvent, + EventType, + MatrixClient, GroupCall, GroupCallEvent, GroupCallIntent, GroupCallState, GroupCallType, -} from "matrix-js-sdk/src/webrtc/groupCall"; +} from "matrix-js-sdk/src/matrix"; +import { logger } from "matrix-js-sdk/src/logger"; +import { randomString } from "matrix-js-sdk/src/randomstring"; +import { CallType } from "matrix-js-sdk/src/webrtc/call"; +import { NamespacedValue } from "matrix-js-sdk/src/NamespacedValue"; +import { IWidgetApiRequest, MatrixWidgetType } from "matrix-widget-api"; import type EventEmitter from "events"; import type { IMyDevice, Room, RoomMember } from "matrix-js-sdk/src/matrix"; diff --git a/src/stores/AutoRageshakeStore.ts b/src/stores/AutoRageshakeStore.ts index a5d6b0068b..0a2c1a6d7d 100644 --- a/src/stores/AutoRageshakeStore.ts +++ b/src/stores/AutoRageshakeStore.ts @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ClientEvent, MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, MatrixEvent, MatrixEventEvent, SyncStateData, SyncState } from "matrix-js-sdk/src/matrix"; import { sleep } from "matrix-js-sdk/src/utils"; -import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync"; import SdkConfig from "../SdkConfig"; import sendBugReport from "../rageshake/submit-rageshake"; @@ -145,7 +144,7 @@ export default class AutoRageshakeStore extends AsyncStoreWithClient { private async onSyncStateChange( _state: SyncState, _prevState: SyncState | null, - data?: ISyncStateData, + data?: SyncStateData, ): Promise { if (!this.state.initialSyncCompleted) { await this.updateState({ initialSyncCompleted: !!data?.nextSyncToken }); diff --git a/src/stores/CallStore.ts b/src/stores/CallStore.ts index 7c2b648a03..9c90a4929b 100644 --- a/src/stores/CallStore.ts +++ b/src/stores/CallStore.ts @@ -17,8 +17,7 @@ limitations under the License. import { logger } from "matrix-js-sdk/src/logger"; import { GroupCallEventHandlerEvent } from "matrix-js-sdk/src/webrtc/groupCallEventHandler"; -import type { GroupCall } from "matrix-js-sdk/src/webrtc/groupCall"; -import type { Room } from "matrix-js-sdk/src/matrix"; +import type { GroupCall, Room } from "matrix-js-sdk/src/matrix"; import defaultDispatcher from "../dispatcher/dispatcher"; import { UPDATE_EVENT } from "./AsyncStore"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; diff --git a/src/stores/ReadyWatchingStore.ts b/src/stores/ReadyWatchingStore.ts index 10e9082526..c615dcc7d6 100644 --- a/src/stores/ReadyWatchingStore.ts +++ b/src/stores/ReadyWatchingStore.ts @@ -14,8 +14,7 @@ * limitations under the License. */ -import { MatrixClient } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { MatrixClient, SyncState } from "matrix-js-sdk/src/matrix"; import { EventEmitter } from "events"; import { MatrixClientPeg } from "../MatrixClientPeg"; diff --git a/src/stores/notifications/RoomNotificationStateStore.ts b/src/stores/notifications/RoomNotificationStateStore.ts index c483584077..ce9b89871c 100644 --- a/src/stores/notifications/RoomNotificationStateStore.ts +++ b/src/stores/notifications/RoomNotificationStateStore.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { Room, ClientEvent } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { Room, ClientEvent, SyncState } from "matrix-js-sdk/src/matrix"; import { ActionPayload } from "../../dispatcher/payloads"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; diff --git a/src/utils/IdentityServerUtils.ts b/src/utils/IdentityServerUtils.ts index ada676c69f..c163d92091 100644 --- a/src/utils/IdentityServerUtils.ts +++ b/src/utils/IdentityServerUtils.ts @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; +import { SERVICE_TYPES, HTTPError, MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { HTTPError, MatrixClient } from "matrix-js-sdk/src/matrix"; import SdkConfig from "../SdkConfig"; import { Policies } from "../Terms"; diff --git a/src/utils/connection.ts b/src/utils/connection.ts index 0a0569fc98..584510a5b9 100644 --- a/src/utils/connection.ts +++ b/src/utils/connection.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ClientEvent, ClientEventHandlerMap } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { ClientEvent, ClientEventHandlerMap, SyncState } from "matrix-js-sdk/src/matrix"; /** * Creates a MatrixClient event listener function that can be used to get notified about reconnects. diff --git a/src/voice-broadcast/utils/VoiceBroadcastResumer.ts b/src/voice-broadcast/utils/VoiceBroadcastResumer.ts index 288d97156f..facd423d42 100644 --- a/src/voice-broadcast/utils/VoiceBroadcastResumer.ts +++ b/src/voice-broadcast/utils/VoiceBroadcastResumer.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ClientEvent, MatrixClient, MatrixEvent, RelationType, Room } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { ClientEvent, MatrixClient, MatrixEvent, RelationType, Room, SyncState } from "matrix-js-sdk/src/matrix"; import { VoiceBroadcastInfoEventContent, VoiceBroadcastInfoEventType, VoiceBroadcastInfoState } from ".."; import { IDestroyable } from "../../utils/IDestroyable"; diff --git a/src/voice-broadcast/utils/checkVoiceBroadcastPreConditions.tsx b/src/voice-broadcast/utils/checkVoiceBroadcastPreConditions.tsx index be4d52d96c..c5dfd416b4 100644 --- a/src/voice-broadcast/utils/checkVoiceBroadcastPreConditions.tsx +++ b/src/voice-broadcast/utils/checkVoiceBroadcastPreConditions.tsx @@ -15,8 +15,7 @@ limitations under the License. */ import React from "react"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { MatrixClient, Room, SyncState } from "matrix-js-sdk/src/matrix"; import { hasRoomLiveVoiceBroadcast, VoiceBroadcastInfoEventType, VoiceBroadcastRecordingsStore } from ".."; import InfoDialog from "../../components/views/dialogs/InfoDialog"; diff --git a/test/Notifier-test.ts b/test/Notifier-test.ts index 7d996bbe7c..d9b8dfcc1b 100644 --- a/test/Notifier-test.ts +++ b/test/Notifier-test.ts @@ -24,8 +24,8 @@ import { MsgType, IContent, MatrixEvent, + SyncState, } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; import { waitFor } from "@testing-library/react"; import BasePlatform from "../src/BasePlatform"; diff --git a/test/components/structures/MatrixChat-test.tsx b/test/components/structures/MatrixChat-test.tsx index b2c47ab268..563fafafd6 100644 --- a/test/components/structures/MatrixChat-test.tsx +++ b/test/components/structures/MatrixChat-test.tsx @@ -18,8 +18,7 @@ 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, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { ClientEvent, MatrixClient, MatrixEvent, Room, SyncState } from "matrix-js-sdk/src/matrix"; import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler"; import * as MatrixJs from "matrix-js-sdk/src/matrix"; import { completeAuthorizationCodeGrant } from "matrix-js-sdk/src/oidc/authorize"; diff --git a/test/components/structures/RoomSearchView-test.tsx b/test/components/structures/RoomSearchView-test.tsx index 887d1b7e46..5d69f6595a 100644 --- a/test/components/structures/RoomSearchView-test.tsx +++ b/test/components/structures/RoomSearchView-test.tsx @@ -17,8 +17,15 @@ limitations under the License. import React from "react"; import { mocked } from "jest-mock"; import { render, screen } from "@testing-library/react"; -import { Room, MatrixClient, IEvent, MatrixEvent, EventType, SearchResult } from "matrix-js-sdk/src/matrix"; -import { ISearchResults } from "matrix-js-sdk/src/@types/search"; +import { + Room, + MatrixClient, + IEvent, + MatrixEvent, + EventType, + SearchResult, + ISearchResults, +} from "matrix-js-sdk/src/matrix"; import { defer } from "matrix-js-sdk/src/utils"; import { RoomSearchView } from "../../../src/components/structures/RoomSearchView"; diff --git a/test/components/views/messages/MLocationBody-test.tsx b/test/components/views/messages/MLocationBody-test.tsx index 70f8b95a7f..753cb6eca2 100644 --- a/test/components/views/messages/MLocationBody-test.tsx +++ b/test/components/views/messages/MLocationBody-test.tsx @@ -17,10 +17,9 @@ limitations under the License. import React, { ComponentProps } from "react"; import { fireEvent, render } from "@testing-library/react"; import { LocationAssetType } from "matrix-js-sdk/src/@types/location"; -import { ClientEvent, RoomMember } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, RoomMember, SyncState } from "matrix-js-sdk/src/matrix"; import * as maplibregl from "maplibre-gl"; import { logger } from "matrix-js-sdk/src/logger"; -import { SyncState } from "matrix-js-sdk/src/sync"; import MLocationBody from "../../../../src/components/views/messages/MLocationBody"; import MatrixClientContext from "../../../../src/contexts/MatrixClientContext"; diff --git a/test/components/views/polls/pollHistory/PollHistory-test.tsx b/test/components/views/polls/pollHistory/PollHistory-test.tsx index b1de79b2d9..28374fd0fb 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 { fireEvent, render } from "@testing-library/react"; -import { Filter } from "matrix-js-sdk/src/filter"; -import { EventTimeline, Room } from "matrix-js-sdk/src/matrix"; +import { Filter, EventTimeline, Room } from "matrix-js-sdk/src/matrix"; import { M_POLL_START } from "matrix-js-sdk/src/@types/polls"; import { PollHistory } from "../../../../../src/components/views/polls/pollHistory/PollHistory"; diff --git a/test/components/views/rooms/LegacyRoomHeader-test.tsx b/test/components/views/rooms/LegacyRoomHeader-test.tsx index ebd96264ea..099a95c733 100644 --- a/test/components/views/rooms/LegacyRoomHeader-test.tsx +++ b/test/components/views/rooms/LegacyRoomHeader-test.tsx @@ -17,11 +17,17 @@ 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, PendingEventOrdering } from "matrix-js-sdk/src/matrix"; +import { + EventType, + RoomType, + Room, + RoomStateEvent, + PendingEventOrdering, + ISearchResults, +} 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, MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix"; import type { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; diff --git a/test/models/Call-test.ts b/test/models/Call-test.ts index 5041364794..12839bfd11 100644 --- a/test/models/Call-test.ts +++ b/test/models/Call-test.ts @@ -17,9 +17,16 @@ limitations under the License. import EventEmitter from "events"; import { mocked } from "jest-mock"; import { waitFor } from "@testing-library/react"; -import { RoomType, Room, RoomEvent, MatrixEvent, RoomStateEvent, PendingEventOrdering } from "matrix-js-sdk/src/matrix"; +import { + RoomType, + Room, + RoomEvent, + MatrixEvent, + RoomStateEvent, + PendingEventOrdering, + GroupCallIntent, +} from "matrix-js-sdk/src/matrix"; import { Widget } from "matrix-widget-api"; -import { GroupCallIntent } from "matrix-js-sdk/src/webrtc/groupCall"; import type { Mocked } from "jest-mock"; import type { MatrixClient, IMyDevice, RoomMember } from "matrix-js-sdk/src/matrix"; diff --git a/test/stores/AutoRageshakeStore-test.ts b/test/stores/AutoRageshakeStore-test.ts index 76b42209c3..7a481441fb 100644 --- a/test/stores/AutoRageshakeStore-test.ts +++ b/test/stores/AutoRageshakeStore-test.ts @@ -15,8 +15,14 @@ limitations under the License. */ import { mocked } from "jest-mock"; -import { ClientEvent, EventType, MatrixClient, MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { + ClientEvent, + EventType, + MatrixClient, + MatrixEvent, + MatrixEventEvent, + SyncState, +} from "matrix-js-sdk/src/matrix"; import SettingsStore from "../../src/settings/SettingsStore"; import AutoRageshakeStore from "../../src/stores/AutoRageshakeStore"; diff --git a/test/stores/RoomNotificationStateStore-test.ts b/test/stores/RoomNotificationStateStore-test.ts index 3a63ee7401..acb6a59347 100644 --- a/test/stores/RoomNotificationStateStore-test.ts +++ b/test/stores/RoomNotificationStateStore-test.ts @@ -15,8 +15,7 @@ limitations under the License. */ import { mocked } from "jest-mock"; -import { ClientEvent, MatrixClient, Room } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { ClientEvent, MatrixClient, Room, SyncState } from "matrix-js-sdk/src/matrix"; import { createTestClient, setupAsyncStoreWithClient } from "../test-utils"; import { diff --git a/test/test-utils/call.ts b/test/test-utils/call.ts index 8c1f3dffb3..de136c1649 100644 --- a/test/test-utils/call.ts +++ b/test/test-utils/call.ts @@ -16,8 +16,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, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import type { GroupCall, 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"; diff --git a/test/test-utils/test-utils.ts b/test/test-utils/test-utils.ts index 788407fb9d..ef52e634c8 100644 --- a/test/test-utils/test-utils.ts +++ b/test/test-utils/test-utils.ts @@ -45,7 +45,7 @@ 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/webrtc/groupCall"; +import type { GroupCall } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg as peg } from "../../src/MatrixClientPeg"; import { ValidatedDelegatedAuthConfig, ValidatedServerConfig } from "../../src/utils/ValidatedServerConfig"; import { EnhancedMap } from "../../src/utils/maps"; diff --git a/test/utils/connection-test.ts b/test/utils/connection-test.ts index c9fdb2e771..f34482ac8e 100644 --- a/test/utils/connection-test.ts +++ b/test/utils/connection-test.ts @@ -14,8 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { ClientEvent, ClientEventHandlerMap } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { ClientEvent, ClientEventHandlerMap, SyncState } from "matrix-js-sdk/src/matrix"; import { createReconnectedListener } from "../../src/utils/connection"; diff --git a/test/voice-broadcast/components/molecules/VoiceBroadcastRecordingPip-test.tsx b/test/voice-broadcast/components/molecules/VoiceBroadcastRecordingPip-test.tsx index 240d573288..5c2371e1a0 100644 --- a/test/voice-broadcast/components/molecules/VoiceBroadcastRecordingPip-test.tsx +++ b/test/voice-broadcast/components/molecules/VoiceBroadcastRecordingPip-test.tsx @@ -18,10 +18,9 @@ limitations under the License. import React from "react"; import { act, render, RenderResult, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; -import { ClientEvent, MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, MatrixClient, MatrixEvent, SyncState } from "matrix-js-sdk/src/matrix"; import { sleep } from "matrix-js-sdk/src/utils"; import { mocked } from "jest-mock"; -import { SyncState } from "matrix-js-sdk/src/sync"; import { VoiceBroadcastInfoState, diff --git a/test/voice-broadcast/models/VoiceBroadcastRecording-test.ts b/test/voice-broadcast/models/VoiceBroadcastRecording-test.ts index c6b9ee8857..896e1b303a 100644 --- a/test/voice-broadcast/models/VoiceBroadcastRecording-test.ts +++ b/test/voice-broadcast/models/VoiceBroadcastRecording-test.ts @@ -27,8 +27,8 @@ import { RelationType, Room, Relations, + SyncState, } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; import { uploadFile } from "../../../src/ContentMessages"; import { EncryptedFile } from "../../../src/customisations/models/IMediaEventContent"; diff --git a/test/voice-broadcast/utils/VoiceBroadcastResumer-test.ts b/test/voice-broadcast/utils/VoiceBroadcastResumer-test.ts index 7c07554fd2..8f2f7f1500 100644 --- a/test/voice-broadcast/utils/VoiceBroadcastResumer-test.ts +++ b/test/voice-broadcast/utils/VoiceBroadcastResumer-test.ts @@ -15,8 +15,7 @@ limitations under the License. */ import { mocked } from "jest-mock"; -import { ClientEvent, MatrixClient, MatrixEvent, RelationType, Room } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { ClientEvent, MatrixClient, MatrixEvent, RelationType, Room, SyncState } from "matrix-js-sdk/src/matrix"; import { VoiceBroadcastInfoEventContent, diff --git a/test/voice-broadcast/utils/setUpVoiceBroadcastPreRecording-test.ts b/test/voice-broadcast/utils/setUpVoiceBroadcastPreRecording-test.ts index f3f9c94485..1c61426ccc 100644 --- a/test/voice-broadcast/utils/setUpVoiceBroadcastPreRecording-test.ts +++ b/test/voice-broadcast/utils/setUpVoiceBroadcastPreRecording-test.ts @@ -15,8 +15,7 @@ limitations under the License. */ import { mocked } from "jest-mock"; -import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { MatrixClient, MatrixEvent, Room, SyncState } from "matrix-js-sdk/src/matrix"; import Modal from "../../../src/Modal"; import { diff --git a/test/voice-broadcast/utils/startNewVoiceBroadcastRecording-test.ts b/test/voice-broadcast/utils/startNewVoiceBroadcastRecording-test.ts index e417e7e0fd..2e69295813 100644 --- a/test/voice-broadcast/utils/startNewVoiceBroadcastRecording-test.ts +++ b/test/voice-broadcast/utils/startNewVoiceBroadcastRecording-test.ts @@ -15,8 +15,7 @@ limitations under the License. */ import { mocked } from "jest-mock"; -import { EventType, ISendEventResponse, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; -import { SyncState } from "matrix-js-sdk/src/sync"; +import { EventType, ISendEventResponse, MatrixClient, MatrixEvent, Room, SyncState } from "matrix-js-sdk/src/matrix"; import Modal from "../../../src/Modal"; import {