Switch to importing more things from the main js-sdk export (#11377)

This commit is contained in:
Michael Telatynski 2023-08-10 09:01:14 +01:00 committed by GitHub
parent a1328d8ef7
commit ef385e6028
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 136 additions and 95 deletions

View file

@ -134,6 +134,26 @@ module.exports = {
name: "matrix-js-sdk/src/@types/PushRules", name: "matrix-js-sdk/src/@types/PushRules",
message: "Please use matrix-js-sdk/src/matrix instead", 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", name: "matrix-react-sdk",
message: "Please use matrix-react-sdk/src/index instead", message: "Please use matrix-react-sdk/src/index instead",

View file

@ -14,10 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License. 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 { logger } from "matrix-js-sdk/src/logger";
import { CryptoEvent } from "matrix-js-sdk/src/crypto"; 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 { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup";
import dis from "./dispatcher/dispatcher"; import dis from "./dispatcher/dispatcher";

View file

@ -15,8 +15,7 @@ limitations under the License.
*/ */
import React from "react"; import React from "react";
import { SERVICE_TYPES } from "matrix-js-sdk/src/service-types"; import { SERVICE_TYPES, createClient, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix";
import { createClient, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger"; import { logger } from "matrix-js-sdk/src/logger";
import { MatrixClientPeg } from "./MatrixClientPeg"; import { MatrixClientPeg } from "./MatrixClientPeg";

View file

@ -18,7 +18,7 @@ limitations under the License.
*/ */
import React from "react"; 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 { import {
CallError, CallError,
CallErrorCode, CallErrorCode,
@ -32,7 +32,6 @@ import {
import { logger } from "matrix-js-sdk/src/logger"; import { logger } from "matrix-js-sdk/src/logger";
import EventEmitter from "events"; import EventEmitter from "events";
import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; 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 { CallEventHandlerEvent } from "matrix-js-sdk/src/webrtc/callEventHandler";
import { MatrixClientPeg } from "./MatrixClientPeg"; import { MatrixClientPeg } from "./MatrixClientPeg";

View file

@ -21,9 +21,11 @@ import {
ISearchResult, ISearchResult,
ISearchResults, ISearchResults,
SearchOrderBy, SearchOrderBy,
} from "matrix-js-sdk/src/@types/search"; IRoomEventFilter,
import { IRoomEventFilter } from "matrix-js-sdk/src/filter"; EventType,
import { EventType, MatrixClient, SearchResult } from "matrix-js-sdk/src/matrix"; MatrixClient,
SearchResult,
} from "matrix-js-sdk/src/matrix";
import { ISearchArgs } from "./indexing/BaseEventIndexManager"; import { ISearchArgs } from "./indexing/BaseEventIndexManager";
import EventIndexPeg from "./indexing/EventIndexPeg"; import EventIndexPeg from "./indexing/EventIndexPeg";

View file

@ -15,9 +15,8 @@ limitations under the License.
*/ */
import classNames from "classnames"; 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 { logger } from "matrix-js-sdk/src/logger";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
import Modal from "./Modal"; import Modal from "./Modal";
import TermsDialog from "./components/views/dialogs/TermsDialog"; import TermsDialog from "./components/views/dialogs/TermsDialog";

View file

@ -16,8 +16,8 @@ limitations under the License.
*/ */
import React, { createRef } from "react"; import React, { createRef } from "react";
import { Filter } from "matrix-js-sdk/src/filter";
import { import {
Filter,
EventTimelineSet, EventTimelineSet,
IRoomTimelineData, IRoomTimelineData,
Direction, Direction,

View file

@ -22,10 +22,11 @@ import {
RoomStateEvent, RoomStateEvent,
MatrixError, MatrixError,
IUsageLimit, IUsageLimit,
SyncStateData,
SyncState,
} from "matrix-js-sdk/src/matrix"; } from "matrix-js-sdk/src/matrix";
import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { MatrixCall } from "matrix-js-sdk/src/webrtc/call";
import classNames from "classnames"; import classNames from "classnames";
import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync";
import { isOnlyCtrlOrCmdKeyEvent, Key } from "../../Keyboard"; import { isOnlyCtrlOrCmdKeyEvent, Key } from "../../Keyboard";
import PageTypes from "../../PageTypes"; import PageTypes from "../../PageTypes";
@ -109,7 +110,7 @@ interface IProps {
} }
interface IState { interface IState {
syncErrorData?: ISyncStateData; syncErrorData?: SyncStateData;
usageLimitDismissed: boolean; usageLimitDismissed: boolean;
usageLimitEventContent?: IUsageLimit; usageLimitEventContent?: IUsageLimit;
usageLimitEventTs?: number; usageLimitEventTs?: number;
@ -294,7 +295,7 @@ class LoggedInView extends React.Component<IProps, IState> {
}); });
}; };
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 oldErrCode = (this.state.syncErrorData?.error as MatrixError)?.errcode;
const newErrCode = (data?.error as MatrixError)?.errcode; const newErrCode = (data?.error as MatrixError)?.errcode;
if (syncState === oldSyncState && oldErrCode === newErrCode) return; if (syncState === oldSyncState && oldErrCode === newErrCode) return;

View file

@ -24,8 +24,9 @@ import {
MatrixEventEvent, MatrixEventEvent,
MatrixEvent, MatrixEvent,
RoomType, RoomType,
SyncStateData,
SyncState,
} from "matrix-js-sdk/src/matrix"; } from "matrix-js-sdk/src/matrix";
import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync";
import { InvalidStoreError } from "matrix-js-sdk/src/errors"; import { InvalidStoreError } from "matrix-js-sdk/src/errors";
import { defer, IDeferred, QueryDict } from "matrix-js-sdk/src/utils"; import { defer, IDeferred, QueryDict } from "matrix-js-sdk/src/utils";
import { logger } from "matrix-js-sdk/src/logger"; import { logger } from "matrix-js-sdk/src/logger";
@ -1502,7 +1503,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
return this.loggedInView.current.canResetTimelineInRoom(roomId); 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 (state === SyncState.Error || state === SyncState.Reconnecting) {
if (data?.error instanceof InvalidStoreError) { if (data?.error instanceof InvalidStoreError) {
Lifecycle.handleInvalidStoreError(data.error); Lifecycle.handleInvalidStoreError(data.error);

View file

@ -15,8 +15,7 @@ limitations under the License.
*/ */
import React, { forwardRef, useCallback, useContext, useEffect, useRef, useState } from "react"; import React, { forwardRef, useCallback, useContext, useEffect, useRef, useState } from "react";
import { ISearchResults } from "matrix-js-sdk/src/@types/search"; import { ISearchResults, IThreadBundledRelationship, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { IThreadBundledRelationship, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread"; import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread";
import { logger } from "matrix-js-sdk/src/logger"; import { logger } from "matrix-js-sdk/src/logger";

View file

@ -15,8 +15,7 @@ limitations under the License.
*/ */
import React, { ReactNode } from "react"; import React, { ReactNode } from "react";
import { EventStatus, MatrixEvent, Room, MatrixError } from "matrix-js-sdk/src/matrix"; import { EventStatus, MatrixEvent, Room, MatrixError, SyncState, SyncStateData } from "matrix-js-sdk/src/matrix";
import { SyncState, ISyncStateData } from "matrix-js-sdk/src/sync";
import { Icon as WarningIcon } from "../../../res/img/feather-customised/warning-triangle.svg"; import { Icon as WarningIcon } from "../../../res/img/feather-customised/warning-triangle.svg";
import { _t, _td } from "../../languageHandler"; import { _t, _td } from "../../languageHandler";
@ -81,7 +80,7 @@ interface IProps {
interface IState { interface IState {
syncState: SyncState; syncState: SyncState;
syncStateData: ISyncStateData; syncStateData: SyncStateData;
unsentMessages: MatrixEvent[]; unsentMessages: MatrixEvent[];
isResending: boolean; isResending: boolean;
} }
@ -123,7 +122,7 @@ export default class RoomStatusBar extends React.PureComponent<IProps, IState> {
} }
} }
private onSyncStateChange = (state: SyncState, prevState: SyncState, data: ISyncStateData): void => { private onSyncStateChange = (state: SyncState, prevState: SyncState, data: SyncStateData): void => {
if (state === "SYNCING" && prevState === "SYNCING") { if (state === "SYNCING" && prevState === "SYNCING") {
return; return;
} }

View file

@ -35,13 +35,13 @@ import {
JoinRule, JoinRule,
ClientEvent, ClientEvent,
MatrixError, MatrixError,
ISearchResults,
} from "matrix-js-sdk/src/matrix"; } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger"; import { logger } from "matrix-js-sdk/src/logger";
import { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call";
import { throttle } from "lodash"; import { throttle } from "lodash";
import { CryptoEvent } from "matrix-js-sdk/src/crypto"; import { CryptoEvent } from "matrix-js-sdk/src/crypto";
import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread"; 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 shouldHideEvent from "../../shouldHideEvent";
import { _t } from "../../languageHandler"; import { _t } from "../../languageHandler";

View file

@ -33,9 +33,9 @@ import {
MatrixClient, MatrixClient,
Relations, Relations,
MatrixError, MatrixError,
SyncState,
} from "matrix-js-sdk/src/matrix"; } from "matrix-js-sdk/src/matrix";
import { TimelineWindow } from "matrix-js-sdk/src/timeline-window"; import { TimelineWindow } from "matrix-js-sdk/src/timeline-window";
import { SyncState } from "matrix-js-sdk/src/sync";
import { debounce, findLastIndex, throttle } from "lodash"; import { debounce, findLastIndex, throttle } from "lodash";
import { logger } from "matrix-js-sdk/src/logger"; import { logger } from "matrix-js-sdk/src/logger";
import { Thread, ThreadEvent } from "matrix-js-sdk/src/models/thread"; import { Thread, ThreadEvent } from "matrix-js-sdk/src/models/thread";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/ */
import React from "react"; 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 { _t, pickBestLanguage } from "../../../languageHandler";
import DialogButtons from "../elements/DialogButtons"; import DialogButtons from "../elements/DialogButtons";

View file

@ -16,8 +16,15 @@ limitations under the License.
import { useCallback, useEffect, useState } from "react"; import { useCallback, useEffect, useState } from "react";
import { M_POLL_START } from "matrix-js-sdk/src/@types/polls"; import { M_POLL_START } from "matrix-js-sdk/src/@types/polls";
import { MatrixClient, Direction, EventTimeline, EventTimelineSet, Room } from "matrix-js-sdk/src/matrix"; import {
import { Filter, IFilterDefinition } from "matrix-js-sdk/src/filter"; MatrixClient,
Direction,
EventTimeline,
EventTimelineSet,
Room,
Filter,
IFilterDefinition,
} from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger"; import { logger } from "matrix-js-sdk/src/logger";
const getOldestEventTimestamp = (timelineSet?: EventTimelineSet): number | undefined => { const getOldestEventTimestamp = (timelineSet?: EventTimelineSet): number | undefined => {

View file

@ -18,9 +18,8 @@ limitations under the License.
import React, { FC, useState, useMemo, useCallback } from "react"; import React, { FC, useState, useMemo, useCallback } from "react";
import classNames from "classnames"; import classNames from "classnames";
import { throttle } from "lodash"; 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 { 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 type { MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { _t } from "../../../languageHandler"; import { _t } from "../../../languageHandler";

View file

@ -17,10 +17,9 @@ limitations under the License.
*/ */
import React, { ReactNode } from "react"; 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 { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import { logger } from "matrix-js-sdk/src/logger"; 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 { Icon as WarningIcon } from "../../../../../../res/img/feather-customised/warning-triangle.svg";
import { UserFriendlyError, _t } from "../../../../../languageHandler"; import { UserFriendlyError, _t } from "../../../../../languageHandler";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/ */
import React, { FC, useState, useEffect, memo } from "react"; 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"; import { formatPreciseDuration } from "../../../DateUtils";

View file

@ -15,10 +15,9 @@ limitations under the License.
*/ */
import React from "react"; 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 { Optional } from "matrix-events-sdk";
import { M_POLL_END, M_POLL_START } from "matrix-js-sdk/src/@types/polls"; 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 SettingsStore from "../settings/SettingsStore";
import LegacyCallEventGrouper from "../components/structures/LegacyCallEventGrouper"; import LegacyCallEventGrouper from "../components/structures/LegacyCallEventGrouper";

View file

@ -14,8 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { IMatrixProfile, IEventWithRoomId as IMatrixEvent, IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; import {
import { Direction } from "matrix-js-sdk/src/matrix"; 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 // The following interfaces take their names and member names from seshat and the spec
/* eslint-disable camelcase */ /* eslint-disable camelcase */

View file

@ -30,12 +30,15 @@ import {
ClientEvent, ClientEvent,
MatrixClient, MatrixClient,
HTTPError, HTTPError,
IEventWithRoomId,
IMatrixProfile,
IResultRoomEvents,
SyncStateData,
SyncState,
} from "matrix-js-sdk/src/matrix"; } from "matrix-js-sdk/src/matrix";
import { TimelineIndex, TimelineWindow } from "matrix-js-sdk/src/timeline-window"; import { TimelineIndex, TimelineWindow } from "matrix-js-sdk/src/timeline-window";
import { sleep } from "matrix-js-sdk/src/utils"; 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 { logger } from "matrix-js-sdk/src/logger";
import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync";
import PlatformPeg from "../PlatformPeg"; import PlatformPeg from "../PlatformPeg";
import { MatrixClientPeg } from "../MatrixClientPeg"; 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 * - Every other sync, tell the event index to commit all the queued up
* live events * live events
*/ */
private onSync = async (state: SyncState, prevState: SyncState | null, data?: ISyncStateData): Promise<void> => { private onSync = async (state: SyncState, prevState: SyncState | null, data?: SyncStateData): Promise<void> => {
const indexManager = PlatformPeg.get()?.getEventIndexingManager(); const indexManager = PlatformPeg.get()?.getEventIndexingManager();
if (!indexManager) return; if (!indexManager) return;

View file

@ -14,19 +14,23 @@ See the License for the specific language governing permissions and
limitations under the License. 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 { import {
TypedEventEmitter,
RoomEvent,
RoomStateEvent,
EventType,
MatrixClient,
GroupCall, GroupCall,
GroupCallEvent, GroupCallEvent,
GroupCallIntent, GroupCallIntent,
GroupCallState, GroupCallState,
GroupCallType, 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 EventEmitter from "events";
import type { IMyDevice, Room, RoomMember } from "matrix-js-sdk/src/matrix"; import type { IMyDevice, Room, RoomMember } from "matrix-js-sdk/src/matrix";

View file

@ -14,9 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. 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 { sleep } from "matrix-js-sdk/src/utils";
import { ISyncStateData, SyncState } from "matrix-js-sdk/src/sync";
import SdkConfig from "../SdkConfig"; import SdkConfig from "../SdkConfig";
import sendBugReport from "../rageshake/submit-rageshake"; import sendBugReport from "../rageshake/submit-rageshake";
@ -145,7 +144,7 @@ export default class AutoRageshakeStore extends AsyncStoreWithClient<IState> {
private async onSyncStateChange( private async onSyncStateChange(
_state: SyncState, _state: SyncState,
_prevState: SyncState | null, _prevState: SyncState | null,
data?: ISyncStateData, data?: SyncStateData,
): Promise<void> { ): Promise<void> {
if (!this.state.initialSyncCompleted) { if (!this.state.initialSyncCompleted) {
await this.updateState({ initialSyncCompleted: !!data?.nextSyncToken }); await this.updateState({ initialSyncCompleted: !!data?.nextSyncToken });

View file

@ -17,8 +17,7 @@ limitations under the License.
import { logger } from "matrix-js-sdk/src/logger"; import { logger } from "matrix-js-sdk/src/logger";
import { GroupCallEventHandlerEvent } from "matrix-js-sdk/src/webrtc/groupCallEventHandler"; import { GroupCallEventHandlerEvent } from "matrix-js-sdk/src/webrtc/groupCallEventHandler";
import type { GroupCall } from "matrix-js-sdk/src/webrtc/groupCall"; import type { GroupCall, Room } from "matrix-js-sdk/src/matrix";
import type { Room } from "matrix-js-sdk/src/matrix";
import defaultDispatcher from "../dispatcher/dispatcher"; import defaultDispatcher from "../dispatcher/dispatcher";
import { UPDATE_EVENT } from "./AsyncStore"; import { UPDATE_EVENT } from "./AsyncStore";
import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient";

View file

@ -14,8 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { MatrixClient } from "matrix-js-sdk/src/matrix"; import { MatrixClient, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { EventEmitter } from "events"; import { EventEmitter } from "events";
import { MatrixClientPeg } from "../MatrixClientPeg"; import { MatrixClientPeg } from "../MatrixClientPeg";

View file

@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { Room, ClientEvent } from "matrix-js-sdk/src/matrix"; import { Room, ClientEvent, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { ActionPayload } from "../../dispatcher/payloads"; import { ActionPayload } from "../../dispatcher/payloads";
import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient";

View file

@ -14,9 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. 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 { logger } from "matrix-js-sdk/src/logger";
import { HTTPError, MatrixClient } from "matrix-js-sdk/src/matrix";
import SdkConfig from "../SdkConfig"; import SdkConfig from "../SdkConfig";
import { Policies } from "../Terms"; import { Policies } from "../Terms";

View file

@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { ClientEvent, ClientEventHandlerMap } from "matrix-js-sdk/src/matrix"; import { ClientEvent, ClientEventHandlerMap, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
/** /**
* Creates a MatrixClient event listener function that can be used to get notified about reconnects. * Creates a MatrixClient event listener function that can be used to get notified about reconnects.

View file

@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { ClientEvent, MatrixClient, MatrixEvent, RelationType, Room } from "matrix-js-sdk/src/matrix"; import { ClientEvent, MatrixClient, MatrixEvent, RelationType, Room, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { VoiceBroadcastInfoEventContent, VoiceBroadcastInfoEventType, VoiceBroadcastInfoState } from ".."; import { VoiceBroadcastInfoEventContent, VoiceBroadcastInfoEventType, VoiceBroadcastInfoState } from "..";
import { IDestroyable } from "../../utils/IDestroyable"; import { IDestroyable } from "../../utils/IDestroyable";

View file

@ -15,8 +15,7 @@ limitations under the License.
*/ */
import React from "react"; import React from "react";
import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { MatrixClient, Room, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { hasRoomLiveVoiceBroadcast, VoiceBroadcastInfoEventType, VoiceBroadcastRecordingsStore } from ".."; import { hasRoomLiveVoiceBroadcast, VoiceBroadcastInfoEventType, VoiceBroadcastRecordingsStore } from "..";
import InfoDialog from "../../components/views/dialogs/InfoDialog"; import InfoDialog from "../../components/views/dialogs/InfoDialog";

View file

@ -24,8 +24,8 @@ import {
MsgType, MsgType,
IContent, IContent,
MatrixEvent, MatrixEvent,
SyncState,
} from "matrix-js-sdk/src/matrix"; } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { waitFor } from "@testing-library/react"; import { waitFor } from "@testing-library/react";
import BasePlatform from "../src/BasePlatform"; import BasePlatform from "../src/BasePlatform";

View file

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

View file

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

View file

@ -17,10 +17,9 @@ limitations under the License.
import React, { ComponentProps } from "react"; import React, { ComponentProps } from "react";
import { fireEvent, render } from "@testing-library/react"; import { fireEvent, render } from "@testing-library/react";
import { LocationAssetType } from "matrix-js-sdk/src/@types/location"; 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 * as maplibregl from "maplibre-gl";
import { logger } from "matrix-js-sdk/src/logger"; 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 MLocationBody from "../../../../src/components/views/messages/MLocationBody";
import MatrixClientContext from "../../../../src/contexts/MatrixClientContext"; import MatrixClientContext from "../../../../src/contexts/MatrixClientContext";

View file

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

View file

@ -17,11 +17,17 @@ limitations under the License.
import React from "react"; import React from "react";
import { render, screen, act, fireEvent, waitFor, getByRole, RenderResult } from "@testing-library/react"; import { render, screen, act, fireEvent, waitFor, getByRole, RenderResult } from "@testing-library/react";
import { mocked, Mocked } from "jest-mock"; 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 { CallType } from "matrix-js-sdk/src/webrtc/call";
import { ClientWidgetApi, Widget } from "matrix-widget-api"; import { ClientWidgetApi, Widget } from "matrix-widget-api";
import EventEmitter from "events"; 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 { MatrixClient, MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix";
import type { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import type { MatrixCall } from "matrix-js-sdk/src/webrtc/call";

View file

@ -17,9 +17,16 @@ limitations under the License.
import EventEmitter from "events"; import EventEmitter from "events";
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { waitFor } from "@testing-library/react"; 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 { Widget } from "matrix-widget-api";
import { GroupCallIntent } from "matrix-js-sdk/src/webrtc/groupCall";
import type { Mocked } from "jest-mock"; import type { Mocked } from "jest-mock";
import type { MatrixClient, IMyDevice, RoomMember } from "matrix-js-sdk/src/matrix"; import type { MatrixClient, IMyDevice, RoomMember } from "matrix-js-sdk/src/matrix";

View file

@ -15,8 +15,14 @@ limitations under the License.
*/ */
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { ClientEvent, EventType, MatrixClient, MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; import {
import { SyncState } from "matrix-js-sdk/src/sync"; ClientEvent,
EventType,
MatrixClient,
MatrixEvent,
MatrixEventEvent,
SyncState,
} from "matrix-js-sdk/src/matrix";
import SettingsStore from "../../src/settings/SettingsStore"; import SettingsStore from "../../src/settings/SettingsStore";
import AutoRageshakeStore from "../../src/stores/AutoRageshakeStore"; import AutoRageshakeStore from "../../src/stores/AutoRageshakeStore";

View file

@ -15,8 +15,7 @@ limitations under the License.
*/ */
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { ClientEvent, MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { ClientEvent, MatrixClient, Room, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { createTestClient, setupAsyncStoreWithClient } from "../test-utils"; import { createTestClient, setupAsyncStoreWithClient } from "../test-utils";
import { import {

View file

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

View file

@ -45,7 +45,7 @@ import { CryptoBackend } from "matrix-js-sdk/src/common-crypto/CryptoBackend";
import { IEventDecryptionResult } from "matrix-js-sdk/src/@types/crypto"; import { IEventDecryptionResult } from "matrix-js-sdk/src/@types/crypto";
import { MapperOpts } from "matrix-js-sdk/src/event-mapper"; 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 { MatrixClientPeg as peg } from "../../src/MatrixClientPeg";
import { ValidatedDelegatedAuthConfig, ValidatedServerConfig } from "../../src/utils/ValidatedServerConfig"; import { ValidatedDelegatedAuthConfig, ValidatedServerConfig } from "../../src/utils/ValidatedServerConfig";
import { EnhancedMap } from "../../src/utils/maps"; import { EnhancedMap } from "../../src/utils/maps";

View file

@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { ClientEvent, ClientEventHandlerMap } from "matrix-js-sdk/src/matrix"; import { ClientEvent, ClientEventHandlerMap, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { createReconnectedListener } from "../../src/utils/connection"; import { createReconnectedListener } from "../../src/utils/connection";

View file

@ -18,10 +18,9 @@ limitations under the License.
import React from "react"; import React from "react";
import { act, render, RenderResult, screen } from "@testing-library/react"; import { act, render, RenderResult, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event"; 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 { sleep } from "matrix-js-sdk/src/utils";
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { SyncState } from "matrix-js-sdk/src/sync";
import { import {
VoiceBroadcastInfoState, VoiceBroadcastInfoState,

View file

@ -27,8 +27,8 @@ import {
RelationType, RelationType,
Room, Room,
Relations, Relations,
SyncState,
} from "matrix-js-sdk/src/matrix"; } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { uploadFile } from "../../../src/ContentMessages"; import { uploadFile } from "../../../src/ContentMessages";
import { EncryptedFile } from "../../../src/customisations/models/IMediaEventContent"; import { EncryptedFile } from "../../../src/customisations/models/IMediaEventContent";

View file

@ -15,8 +15,7 @@ limitations under the License.
*/ */
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { ClientEvent, MatrixClient, MatrixEvent, RelationType, Room } from "matrix-js-sdk/src/matrix"; import { ClientEvent, MatrixClient, MatrixEvent, RelationType, Room, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import { import {
VoiceBroadcastInfoEventContent, VoiceBroadcastInfoEventContent,

View file

@ -15,8 +15,7 @@ limitations under the License.
*/ */
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { MatrixClient, MatrixEvent, Room, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import Modal from "../../../src/Modal"; import Modal from "../../../src/Modal";
import { import {

View file

@ -15,8 +15,7 @@ limitations under the License.
*/ */
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { EventType, ISendEventResponse, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { EventType, ISendEventResponse, MatrixClient, MatrixEvent, Room, SyncState } from "matrix-js-sdk/src/matrix";
import { SyncState } from "matrix-js-sdk/src/sync";
import Modal from "../../../src/Modal"; import Modal from "../../../src/Modal";
import { import {