1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-07-31 15:24:23 +03:00

Bump eslint-plugin-matrix-org to enable @typescript-eslint/consistent-type-imports rule (#4680)

* Bump eslint-plugin-matrix-org to enable @typescript-eslint/consistent-type-imports rule

* Re-lint after merge
This commit is contained in:
Hugh Nimmo-Smith
2025-02-05 12:15:20 +00:00
committed by GitHub
parent 6e72b3554e
commit ff1db2b538
297 changed files with 1762 additions and 1573 deletions

View File

@ -101,7 +101,7 @@
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^28.0.0", "eslint-plugin-jest": "^28.0.0",
"eslint-plugin-jsdoc": "^50.0.0", "eslint-plugin-jsdoc": "^50.0.0",
"eslint-plugin-matrix-org": "^2.0.1", "eslint-plugin-matrix-org": "^2.1.0",
"eslint-plugin-n": "^14.0.0", "eslint-plugin-n": "^14.0.0",
"eslint-plugin-tsdoc": "^0.4.0", "eslint-plugin-tsdoc": "^0.4.0",
"eslint-plugin-unicorn": "^56.0.0", "eslint-plugin-unicorn": "^56.0.0",

View File

@ -29,11 +29,16 @@ import type { IE2EKeyReceiver } from "./test-utils/E2EKeyReceiver";
import { LocalStorageCryptoStore } from "../src/crypto/store/localStorage-crypto-store"; import { LocalStorageCryptoStore } from "../src/crypto/store/localStorage-crypto-store";
import { logger } from "../src/logger"; import { logger } from "../src/logger";
import { syncPromise } from "./test-utils/test-utils"; import { syncPromise } from "./test-utils/test-utils";
import { createClient, IStartClientOpts } from "../src/matrix"; import { createClient, type IStartClientOpts } from "../src/matrix";
import { ICreateClientOpts, IDownloadKeyResult, MatrixClient, PendingEventOrdering } from "../src/client"; import {
type ICreateClientOpts,
type IDownloadKeyResult,
type MatrixClient,
PendingEventOrdering,
} from "../src/client";
import { MockStorageApi } from "./MockStorageApi"; import { MockStorageApi } from "./MockStorageApi";
import { IKeysUploadResponse, IUploadKeysRequest } from "../src/client"; import { type IKeysUploadResponse, type IUploadKeysRequest } from "../src/client";
import { ISyncResponder } from "./test-utils/SyncResponder"; import { type ISyncResponder } from "./test-utils/SyncResponder";
/** /**
* Wrapper for a MockStorageApi, MockHttpBackend and MatrixClient * Wrapper for a MockStorageApi, MockHttpBackend and MatrixClient

View File

@ -18,13 +18,13 @@ import fetchMock from "fetch-mock-jest";
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import { IDBFactory } from "fake-indexeddb"; import { IDBFactory } from "fake-indexeddb";
import { CRYPTO_BACKENDS, InitCrypto, syncPromise } from "../../test-utils/test-utils"; import { CRYPTO_BACKENDS, type InitCrypto, syncPromise } from "../../test-utils/test-utils";
import { AuthDict, createClient, CryptoEvent, MatrixClient } from "../../../src"; import { type AuthDict, createClient, CryptoEvent, type MatrixClient } from "../../../src";
import { mockInitialApiRequests, mockSetupCrossSigningRequests } from "../../test-utils/mockEndpoints"; import { mockInitialApiRequests, mockSetupCrossSigningRequests } from "../../test-utils/mockEndpoints";
import encryptAESSecretStorageItem from "../../../src/utils/encryptAESSecretStorageItem.ts"; import encryptAESSecretStorageItem from "../../../src/utils/encryptAESSecretStorageItem.ts";
import { CryptoCallbacks, CrossSigningKey } from "../../../src/crypto-api"; import { type CryptoCallbacks, CrossSigningKey } from "../../../src/crypto-api";
import { SECRET_STORAGE_ALGORITHM_V1_AES } from "../../../src/secret-storage"; import { SECRET_STORAGE_ALGORITHM_V1_AES } from "../../../src/secret-storage";
import { ISyncResponder, SyncResponder } from "../../test-utils/SyncResponder"; import { type ISyncResponder, SyncResponder } from "../../test-utils/SyncResponder";
import { E2EKeyReceiver } from "../../test-utils/E2EKeyReceiver"; import { E2EKeyReceiver } from "../../test-utils/E2EKeyReceiver";
import { import {
MASTER_CROSS_SIGNING_PRIVATE_KEY_BASE64, MASTER_CROSS_SIGNING_PRIVATE_KEY_BASE64,

View File

@ -19,16 +19,16 @@ import anotherjson from "another-json";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import { IDBFactory } from "fake-indexeddb"; import { IDBFactory } from "fake-indexeddb";
import FetchMock from "fetch-mock";
import Olm from "@matrix-org/olm";
import type FetchMock from "fetch-mock";
import type Olm from "@matrix-org/olm";
import * as testUtils from "../../test-utils/test-utils"; import * as testUtils from "../../test-utils/test-utils";
import { import {
advanceTimersUntil, advanceTimersUntil,
CRYPTO_BACKENDS, CRYPTO_BACKENDS,
emitPromise, emitPromise,
getSyncResponse, getSyncResponse,
InitCrypto, type InitCrypto,
mkEventCustom, mkEventCustom,
mkMembershipCustom, mkMembershipCustom,
syncPromise, syncPromise,
@ -52,24 +52,24 @@ import {
createClient, createClient,
CryptoEvent, CryptoEvent,
HistoryVisibility, HistoryVisibility,
IClaimOTKsResult, type IClaimOTKsResult,
IContent, type IContent,
IDownloadKeyResult, type IDownloadKeyResult,
IEvent, type IEvent,
IndexedDBCryptoStore, IndexedDBCryptoStore,
IStartClientOpts, type IStartClientOpts,
MatrixClient, type MatrixClient,
MatrixEvent, MatrixEvent,
MatrixEventEvent, MatrixEventEvent,
MsgType, MsgType,
PendingEventOrdering, PendingEventOrdering,
Room, Room,
RoomMember, type RoomMember,
RoomStateEvent, RoomStateEvent,
} from "../../../src/matrix"; } from "../../../src/matrix";
import { DeviceInfo } from "../../../src/crypto/deviceinfo"; import { DeviceInfo } from "../../../src/crypto/deviceinfo";
import { E2EKeyReceiver } from "../../test-utils/E2EKeyReceiver"; import { E2EKeyReceiver } from "../../test-utils/E2EKeyReceiver";
import { ISyncResponder, SyncResponder } from "../../test-utils/SyncResponder"; import { type ISyncResponder, SyncResponder } from "../../test-utils/SyncResponder";
import { defer, escapeRegExp } from "../../../src/utils"; import { defer, escapeRegExp } from "../../../src/utils";
import { downloadDeviceToJsDevice } from "../../../src/rust-crypto/device-converter"; import { downloadDeviceToJsDevice } from "../../../src/rust-crypto/device-converter";
import { flushPromises } from "../../test-utils/flushPromises"; import { flushPromises } from "../../test-utils/flushPromises";
@ -78,15 +78,15 @@ import {
mockSetupCrossSigningRequests, mockSetupCrossSigningRequests,
mockSetupMegolmBackupRequests, mockSetupMegolmBackupRequests,
} from "../../test-utils/mockEndpoints"; } from "../../test-utils/mockEndpoints";
import { SecretStorageKeyDescription } from "../../../src/secret-storage"; import { type SecretStorageKeyDescription } from "../../../src/secret-storage";
import { import {
CrossSigningKey, CrossSigningKey,
CryptoCallbacks, type CryptoCallbacks,
DecryptionFailureCode, DecryptionFailureCode,
DeviceIsolationMode, type DeviceIsolationMode,
EventShieldColour, EventShieldColour,
EventShieldReason, EventShieldReason,
KeyBackupInfo, type KeyBackupInfo,
AllDevicesIsolationMode, AllDevicesIsolationMode,
OnlySignedDevicesIsolationMode, OnlySignedDevicesIsolationMode,
} from "../../../src/crypto-api"; } from "../../../src/crypto-api";
@ -101,11 +101,11 @@ import {
establishOlmSession, establishOlmSession,
getTestOlmAccountKeys, getTestOlmAccountKeys,
} from "./olm-utils"; } from "./olm-utils";
import { ToDevicePayload } from "../../../src/models/ToDeviceMessage"; import { type ToDevicePayload } from "../../../src/models/ToDeviceMessage";
import { AccountDataAccumulator } from "../../test-utils/AccountDataAccumulator"; import { AccountDataAccumulator } from "../../test-utils/AccountDataAccumulator";
import { UNSIGNED_MEMBERSHIP_FIELD } from "../../../src/@types/event"; import { UNSIGNED_MEMBERSHIP_FIELD } from "../../../src/@types/event";
import { KnownMembership } from "../../../src/@types/membership"; import { KnownMembership } from "../../../src/@types/membership";
import { KeyBackup } from "../../../src/rust-crypto/backup.ts"; import { type KeyBackup } from "../../../src/rust-crypto/backup.ts";
afterEach(() => { afterEach(() => {
// reset fake-indexeddb after each test, to make sure we don't leak connections // reset fake-indexeddb after each test, to make sure we don't leak connections

View File

@ -17,10 +17,10 @@ limitations under the License.
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { ClientEvent, createClient, MatrixClient, MatrixEvent } from "../../../src"; import { ClientEvent, createClient, type MatrixClient, MatrixEvent } from "../../../src";
import { CryptoEvent } from "../../../src/crypto-api/index"; import { CryptoEvent } from "../../../src/crypto-api/index";
import { RustCrypto } from "../../../src/rust-crypto/rust-crypto"; import { type RustCrypto } from "../../../src/rust-crypto/rust-crypto";
import { AddSecretStorageKeyOpts } from "../../../src/secret-storage"; import { type AddSecretStorageKeyOpts } from "../../../src/secret-storage";
import { E2EKeyReceiver } from "../../test-utils/E2EKeyReceiver"; import { E2EKeyReceiver } from "../../test-utils/E2EKeyReceiver";
import { E2EKeyResponder } from "../../test-utils/E2EKeyResponder"; import { E2EKeyResponder } from "../../test-utils/E2EKeyResponder";
import { emitPromise, EventCounter } from "../../test-utils/test-utils"; import { emitPromise, EventCounter } from "../../test-utils/test-utils";

View File

@ -17,16 +17,16 @@ limitations under the License.
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import { IDBFactory } from "fake-indexeddb"; import { IDBFactory } from "fake-indexeddb";
import { Mocked } from "jest-mock"; import { type Mocked } from "jest-mock";
import { import {
createClient, createClient,
Crypto, type Crypto,
encodeBase64, encodeBase64,
ICreateClientOpts, type ICreateClientOpts,
IEvent, type IEvent,
IMegolmSessionData, type IMegolmSessionData,
MatrixClient, type MatrixClient,
TypedEventEmitter, TypedEventEmitter,
} from "../../../src"; } from "../../../src";
import { SyncResponder } from "../../test-utils/SyncResponder"; import { SyncResponder } from "../../test-utils/SyncResponder";
@ -37,15 +37,15 @@ import {
advanceTimersUntil, advanceTimersUntil,
awaitDecryption, awaitDecryption,
CRYPTO_BACKENDS, CRYPTO_BACKENDS,
InitCrypto, type InitCrypto,
syncPromise, syncPromise,
} from "../../test-utils/test-utils"; } from "../../test-utils/test-utils";
import * as testData from "../../test-utils/test-data"; import * as testData from "../../test-utils/test-data";
import { KeyBackupInfo, KeyBackupSession } from "../../../src/crypto-api/keybackup"; import { type KeyBackupInfo, type KeyBackupSession } from "../../../src/crypto-api/keybackup";
import { flushPromises } from "../../test-utils/flushPromises"; import { flushPromises } from "../../test-utils/flushPromises";
import { defer, IDeferred } from "../../../src/utils"; import { defer, type IDeferred } from "../../../src/utils";
import { decodeRecoveryKey, DecryptionFailureCode, CryptoEvent } from "../../../src/crypto-api"; import { decodeRecoveryKey, DecryptionFailureCode, CryptoEvent } from "../../../src/crypto-api";
import { KeyBackup } from "../../../src/rust-crypto/backup.ts"; import { type KeyBackup } from "../../../src/rust-crypto/backup.ts";
const ROOM_ID = testData.TEST_ROOM_ID; const ROOM_ID = testData.TEST_ROOM_ID;

View File

@ -33,8 +33,20 @@ import type { IDeviceKeys, IOneTimeKey } from "../../../src/@types/crypto";
import { logger } from "../../../src/logger"; import { logger } from "../../../src/logger";
import * as testUtils from "../../test-utils/test-utils"; import * as testUtils from "../../test-utils/test-utils";
import { TestClient } from "../../TestClient"; import { TestClient } from "../../TestClient";
import { CRYPTO_ENABLED, IClaimKeysRequest, IQueryKeysRequest, IUploadKeysRequest } from "../../../src/client"; import {
import { ClientEvent, IContent, ISendEventResponse, MatrixClient, MatrixEvent, MsgType } from "../../../src/matrix"; CRYPTO_ENABLED,
type IClaimKeysRequest,
type IQueryKeysRequest,
type IUploadKeysRequest,
} from "../../../src/client";
import {
ClientEvent,
type IContent,
type ISendEventResponse,
type MatrixClient,
MatrixEvent,
MsgType,
} from "../../../src/matrix";
import { DeviceInfo } from "../../../src/crypto/deviceinfo"; import { DeviceInfo } from "../../../src/crypto/deviceinfo";
import { KnownMembership } from "../../../src/@types/membership"; import { KnownMembership } from "../../../src/@types/membership";

View File

@ -17,11 +17,19 @@ limitations under the License.
import Olm from "@matrix-org/olm"; import Olm from "@matrix-org/olm";
import anotherjson from "another-json"; import anotherjson from "another-json";
import { IContent, IDeviceKeys, IDownloadKeyResult, IEvent, Keys, MatrixClient, SigningKeys } from "../../../src"; import {
import { IE2EKeyReceiver } from "../../test-utils/E2EKeyReceiver"; type IContent,
import { ISyncResponder } from "../../test-utils/SyncResponder"; type IDeviceKeys,
type IDownloadKeyResult,
type IEvent,
type Keys,
type MatrixClient,
type SigningKeys,
} from "../../../src";
import { type IE2EKeyReceiver } from "../../test-utils/E2EKeyReceiver";
import { type ISyncResponder } from "../../test-utils/SyncResponder";
import { syncPromise } from "../../test-utils/test-utils"; import { syncPromise } from "../../test-utils/test-utils";
import { KeyBackupInfo } from "../../../src/crypto-api"; import { type KeyBackupInfo } from "../../../src/crypto-api";
/** /**
* @module * @module

View File

@ -18,8 +18,8 @@ import fetchMock from "fetch-mock-jest";
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import { IDBFactory } from "fake-indexeddb"; import { IDBFactory } from "fake-indexeddb";
import { CRYPTO_BACKENDS, getSyncResponse, InitCrypto, syncPromise } from "../../test-utils/test-utils"; import { CRYPTO_BACKENDS, getSyncResponse, type InitCrypto, syncPromise } from "../../test-utils/test-utils";
import { createClient, MatrixClient } from "../../../src"; import { createClient, type MatrixClient } from "../../../src";
import * as testData from "../../test-utils/test-data"; import * as testData from "../../test-utils/test-data";
import { E2EKeyResponder } from "../../test-utils/E2EKeyResponder"; import { E2EKeyResponder } from "../../test-utils/E2EKeyResponder";
import { SyncResponder } from "../../test-utils/SyncResponder"; import { SyncResponder } from "../../test-utils/SyncResponder";

View File

@ -17,31 +17,31 @@ limitations under the License.
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import anotherjson from "another-json"; import anotherjson from "another-json";
import FetchMock from "fetch-mock";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { IDBFactory } from "fake-indexeddb"; import { IDBFactory } from "fake-indexeddb";
import { createHash } from "crypto"; import { createHash } from "crypto";
import Olm from "@matrix-org/olm"; import Olm from "@matrix-org/olm";
import type FetchMock from "fetch-mock";
import { import {
createClient, createClient,
CryptoEvent, CryptoEvent,
DeviceVerification, DeviceVerification,
IContent, type IContent,
ICreateClientOpts, type ICreateClientOpts,
IEvent, type IEvent,
MatrixClient, type MatrixClient,
MatrixEvent, MatrixEvent,
MatrixEventEvent, MatrixEventEvent,
} from "../../../src"; } from "../../../src";
import { import {
canAcceptVerificationRequest, canAcceptVerificationRequest,
ShowQrCodeCallbacks, type ShowQrCodeCallbacks,
ShowSasCallbacks, type ShowSasCallbacks,
VerificationPhase, VerificationPhase,
VerificationRequest, type VerificationRequest,
VerificationRequestEvent, VerificationRequestEvent,
Verifier, type Verifier,
VerifierEvent, VerifierEvent,
} from "../../../src/crypto-api/verification"; } from "../../../src/crypto-api/verification";
import { defer, escapeRegExp } from "../../../src/utils"; import { defer, escapeRegExp } from "../../../src/utils";
@ -50,7 +50,7 @@ import {
CRYPTO_BACKENDS, CRYPTO_BACKENDS,
emitPromise, emitPromise,
getSyncResponse, getSyncResponse,
InitCrypto, type InitCrypto,
syncPromise, syncPromise,
} from "../../test-utils/test-utils"; } from "../../test-utils/test-utils";
import { SyncResponder } from "../../test-utils/SyncResponder"; import { SyncResponder } from "../../test-utils/SyncResponder";
@ -79,9 +79,9 @@ import {
encryptMegolmEvent, encryptMegolmEvent,
encryptSecretSend, encryptSecretSend,
getTestOlmAccountKeys, getTestOlmAccountKeys,
ToDeviceEvent, type ToDeviceEvent,
} from "./olm-utils"; } from "./olm-utils";
import { KeyBackupInfo } from "../../../src/crypto-api"; import { type KeyBackupInfo } from "../../../src/crypto-api";
import { encodeBase64 } from "../../../src/base64"; import { encodeBase64 } from "../../../src/base64";
// The verification flows use javascript timers to set timeouts. We tell jest to use mock timer implementations // The verification flows use javascript timers to set timeouts. We tell jest to use mock timer implementations

View File

@ -14,13 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import HttpBackend from "matrix-mock-request"; import type HttpBackend from "matrix-mock-request";
import { import {
ClientEvent, ClientEvent,
HttpApiEvent, HttpApiEvent,
IEvent, type IEvent,
MatrixClient, type MatrixClient,
RoomEvent, RoomEvent,
RoomMemberEvent, RoomMemberEvent,
RoomStateEvent, RoomStateEvent,

View File

@ -23,15 +23,15 @@ import {
EventTimelineSet, EventTimelineSet,
EventType, EventType,
Filter, Filter,
IEvent, type IEvent,
MatrixClient, type MatrixClient,
MatrixEvent, MatrixEvent,
PendingEventOrdering, PendingEventOrdering,
RelationType, RelationType,
Room, Room,
} from "../../src/matrix"; } from "../../src/matrix";
import { logger } from "../../src/logger"; import { logger } from "../../src/logger";
import { encodeParams, encodeUri, QueryDict, replaceParam } from "../../src/utils"; import { encodeParams, encodeUri, type QueryDict, replaceParam } from "../../src/utils";
import { TestClient } from "../TestClient"; import { TestClient } from "../TestClient";
import { FeatureSupport, Thread, ThreadEvent } from "../../src/models/thread"; import { FeatureSupport, Thread, ThreadEvent } from "../../src/models/thread";
import { emitPromise } from "../test-utils/test-utils"; import { emitPromise } from "../test-utils/test-utils";

View File

@ -13,28 +13,28 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import HttpBackend from "matrix-mock-request"; import { type Mocked } from "jest-mock";
import { Mocked } from "jest-mock";
import type HttpBackend from "matrix-mock-request";
import * as utils from "../test-utils/test-utils"; import * as utils from "../test-utils/test-utils";
import { CRYPTO_ENABLED, IStoredClientOpts, MatrixClient } from "../../src/client"; import { CRYPTO_ENABLED, type IStoredClientOpts, MatrixClient } from "../../src/client";
import { MatrixEvent } from "../../src/models/event"; import { MatrixEvent } from "../../src/models/event";
import { import {
Filter, Filter,
JoinRule, JoinRule,
KnockRoomOpts, type KnockRoomOpts,
MemoryStore, MemoryStore,
Method, Method,
Room, Room,
RoomSummary, type RoomSummary,
SERVICE_TYPES, SERVICE_TYPES,
} from "../../src/matrix"; } from "../../src/matrix";
import { TestClient } from "../TestClient"; import { TestClient } from "../TestClient";
import { THREAD_RELATION_TYPE } from "../../src/models/thread"; import { THREAD_RELATION_TYPE } from "../../src/models/thread";
import { IFilterDefinition } from "../../src/filter"; import { type IFilterDefinition } from "../../src/filter";
import { ISearchResults } from "../../src/@types/search"; import { type ISearchResults } from "../../src/@types/search";
import { IStore } from "../../src/store"; import { type IStore } from "../../src/store";
import { CryptoBackend } from "../../src/common-crypto/CryptoBackend"; import { type CryptoBackend } from "../../src/common-crypto/CryptoBackend";
import { SetPresence } from "../../src/sync"; import { SetPresence } from "../../src/sync";
import { KnownMembership } from "../../src/@types/membership"; import { KnownMembership } from "../../src/@types/membership";

View File

@ -5,7 +5,7 @@ import { ClientEvent, MatrixClient } from "../../src/matrix";
import { MatrixScheduler } from "../../src/scheduler"; import { MatrixScheduler } from "../../src/scheduler";
import { MemoryStore } from "../../src/store/memory"; import { MemoryStore } from "../../src/store/memory";
import { MatrixError } from "../../src/http-api"; import { MatrixError } from "../../src/http-api";
import { IStore } from "../../src/store"; import { type IStore } from "../../src/store";
import { KnownMembership } from "../../src/@types/membership"; import { KnownMembership } from "../../src/@types/membership";
describe("MatrixClient opts", function () { describe("MatrixClient opts", function () {

View File

@ -15,9 +15,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import HttpBackend from "matrix-mock-request"; import type HttpBackend from "matrix-mock-request";
import { Direction, type MatrixClient, MatrixScheduler } from "../../src/matrix";
import { Direction, MatrixClient, MatrixScheduler } from "../../src/matrix";
import { TestClient } from "../TestClient"; import { TestClient } from "../TestClient";
describe("MatrixClient relations", () => { describe("MatrixClient relations", () => {

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 HttpBackend from "matrix-mock-request"; import type HttpBackend from "matrix-mock-request";
import { EventStatus, type MatrixClient, MatrixScheduler, MsgType, RoomEvent } from "../../src/matrix";
import { EventStatus, MatrixClient, MatrixScheduler, MsgType, RoomEvent } from "../../src/matrix";
import { Room } from "../../src/models/room"; import { Room } from "../../src/models/room";
import { TestClient } from "../TestClient"; import { TestClient } from "../TestClient";

View File

@ -14,20 +14,19 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import HttpBackend from "matrix-mock-request"; import type HttpBackend from "matrix-mock-request";
import * as utils from "../test-utils/test-utils"; import * as utils from "../test-utils/test-utils";
import { EventStatus } from "../../src/models/event"; import { EventStatus } from "../../src/models/event";
import { import {
MatrixError, MatrixError,
ClientEvent, ClientEvent,
IEvent, type IEvent,
MatrixClient, type MatrixClient,
RoomEvent, RoomEvent,
ISyncResponse, type ISyncResponse,
IMinimalEvent, type IMinimalEvent,
IRoomEvent, type IRoomEvent,
Room, type Room,
} from "../../src"; } from "../../src";
import { TestClient } from "../TestClient"; import { TestClient } from "../TestClient";
import { KnownMembership } from "../../src/@types/membership"; import { KnownMembership } from "../../src/@types/membership";

View File

@ -17,7 +17,7 @@ limitations under the License.
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { MatrixClient, ClientEvent, createClient, SyncState } from "../../src"; import { type MatrixClient, ClientEvent, createClient, SyncState } from "../../src";
const makeQueryablePromise = <T = void>(promise: Promise<T>) => { const makeQueryablePromise = <T = void>(promise: Promise<T>) => {
let resolved = false; let resolved = false;

View File

@ -16,8 +16,7 @@ limitations under the License.
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import HttpBackend from "matrix-mock-request"; import type HttpBackend from "matrix-mock-request";
import { import {
EventTimeline, EventTimeline,
MatrixEvent, MatrixEvent,
@ -25,16 +24,16 @@ import {
RoomStateEvent, RoomStateEvent,
RoomMemberEvent, RoomMemberEvent,
UNSTABLE_MSC2716_MARKER, UNSTABLE_MSC2716_MARKER,
MatrixClient, type MatrixClient,
ClientEvent, ClientEvent,
IndexedDBCryptoStore, IndexedDBCryptoStore,
ISyncResponse, type ISyncResponse,
IRoomEvent, type IRoomEvent,
IJoinedRoom, type IJoinedRoom,
IStateEvent, type IStateEvent,
IMinimalEvent, type IMinimalEvent,
NotificationCountType, NotificationCountType,
IEphemeral, type IEphemeral,
Room, Room,
IndexedDBStore, IndexedDBStore,
RelationType, RelationType,
@ -47,7 +46,7 @@ import * as utils from "../test-utils/test-utils";
import { TestClient } from "../TestClient"; import { TestClient } from "../TestClient";
import { emitPromise, mkEvent, mkMessage } from "../test-utils/test-utils"; import { emitPromise, mkEvent, mkMessage } from "../test-utils/test-utils";
import { THREAD_RELATION_TYPE } from "../../src/models/thread"; import { THREAD_RELATION_TYPE } from "../../src/models/thread";
import { IActionsObject } from "../../src/pushprocessor"; import { type IActionsObject } from "../../src/pushprocessor";
import { KnownMembership } from "../../src/@types/membership"; import { KnownMembership } from "../../src/@types/membership";
declare module "../../src/@types/event" { declare module "../../src/@types/event" {

View File

@ -16,14 +16,13 @@ limitations under the License.
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import HttpBackend from "matrix-mock-request"; import type HttpBackend from "matrix-mock-request";
import { import {
Category, Category,
ClientEvent, ClientEvent,
EventType, EventType,
ISyncResponse, type ISyncResponse,
MatrixClient, type MatrixClient,
MatrixEvent, MatrixEvent,
NotificationCountType, NotificationCountType,
RelationType, RelationType,

View File

@ -30,9 +30,9 @@ import { defer } from "../../../src/utils";
import { import {
ClientPrefix, ClientPrefix,
DEVICE_CODE_SCOPE, DEVICE_CODE_SCOPE,
IHttpOpts, type IHttpOpts,
IMyDevice, type IMyDevice,
MatrixClient, type MatrixClient,
MatrixError, MatrixError,
MatrixHttpApi, MatrixHttpApi,
} from "../../../src"; } from "../../../src";

View File

@ -15,36 +15,42 @@ limitations under the License.
*/ */
// eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports
import MockHttpBackend from "matrix-mock-request";
import { fail } from "assert"; import { fail } from "assert";
import { SlidingSync, SlidingSyncEvent, MSC3575RoomData, SlidingSyncState, Extension } from "../../src/sliding-sync"; import type MockHttpBackend from "matrix-mock-request";
import { TestClient } from "../TestClient";
import { IRoomEvent, IStateEvent } from "../../src";
import { import {
MatrixClient, SlidingSync,
MatrixEvent, SlidingSyncEvent,
type MSC3575RoomData,
SlidingSyncState,
type Extension,
} from "../../src/sliding-sync";
import { TestClient } from "../TestClient";
import { type IRoomEvent, type IStateEvent } from "../../src";
import {
type MatrixClient,
type MatrixEvent,
NotificationCountType, NotificationCountType,
JoinRule, JoinRule,
MatrixError, MatrixError,
EventType, EventType,
IPushRules, type IPushRules,
PushRuleKind, PushRuleKind,
TweakName, TweakName,
ClientEvent, ClientEvent,
RoomMemberEvent, RoomMemberEvent,
RoomEvent, RoomEvent,
Room, type Room,
IRoomTimelineData, type IRoomTimelineData,
} from "../../src"; } from "../../src";
import { SlidingSyncSdk } from "../../src/sliding-sync-sdk"; import { SlidingSyncSdk } from "../../src/sliding-sync-sdk";
import { SyncApiOptions, SyncState } from "../../src/sync"; import { type SyncApiOptions, SyncState } from "../../src/sync";
import { IStoredClientOpts } from "../../src"; import { type IStoredClientOpts } from "../../src";
import { logger } from "../../src/logger"; import { logger } from "../../src/logger";
import { emitPromise } from "../test-utils/test-utils"; import { emitPromise } from "../test-utils/test-utils";
import { defer } from "../../src/utils"; import { defer } from "../../src/utils";
import { KnownMembership } from "../../src/@types/membership"; import { KnownMembership } from "../../src/@types/membership";
import { SyncCryptoCallbacks } from "../../src/common-crypto/CryptoBackend"; import { type SyncCryptoCallbacks } from "../../src/common-crypto/CryptoBackend";
declare module "../../src/@types/event" { declare module "../../src/@types/event" {
interface AccountDataEvents { interface AccountDataEvents {

View File

@ -15,21 +15,20 @@ limitations under the License.
*/ */
// eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports
import EventEmitter from "events"; import type EventEmitter from "events";
import MockHttpBackend from "matrix-mock-request"; import type MockHttpBackend from "matrix-mock-request";
import { import {
SlidingSync, SlidingSync,
SlidingSyncState, SlidingSyncState,
ExtensionState, ExtensionState,
SlidingSyncEvent, SlidingSyncEvent,
Extension, type Extension,
SlidingSyncEventHandlerMap, type SlidingSyncEventHandlerMap,
MSC3575RoomData, type MSC3575RoomData,
} from "../../src/sliding-sync"; } from "../../src/sliding-sync";
import { TestClient } from "../TestClient"; import { TestClient } from "../TestClient";
import { logger } from "../../src/logger"; import { logger } from "../../src/logger";
import { MatrixClient } from "../../src"; import { type MatrixClient } from "../../src";
/** /**
* Tests for sliding sync. These tests are broken down into sub-tests which are reliant upon one another. * Tests for sliding sync. These tests are broken down into sub-tests which are reliant upon one another.

View File

@ -16,7 +16,7 @@ limitations under the License.
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { ISyncResponder } from "./SyncResponder"; import { type ISyncResponder } from "./SyncResponder";
/** /**
* An object which intercepts `account_data` get and set requests via fetch-mock. * An object which intercepts `account_data` get and set requests via fetch-mock.

View File

@ -15,7 +15,7 @@ limitations under the License.
*/ */
import debugFunc from "debug"; import debugFunc from "debug";
import { Debugger } from "debug"; import { type Debugger } from "debug";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import type { IDeviceKeys, IOneTimeKey } from "../../src/@types/crypto"; import type { IDeviceKeys, IOneTimeKey } from "../../src/@types/crypto";

View File

@ -17,9 +17,9 @@ limitations under the License.
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { MapWithDefault } from "../../src/utils"; import { MapWithDefault } from "../../src/utils";
import { IDownloadKeyResult } from "../../src"; import { type IDownloadKeyResult } from "../../src";
import { IDeviceKeys } from "../../src/@types/crypto"; import { type IDeviceKeys } from "../../src/@types/crypto";
import { E2EKeyReceiver } from "./E2EKeyReceiver"; import { type E2EKeyReceiver } from "./E2EKeyReceiver";
/** /**
* An object which intercepts `/keys/query` fetches via fetch-mock. * An object which intercepts `/keys/query` fetches via fetch-mock.

View File

@ -15,9 +15,10 @@ limitations under the License.
*/ */
import debugFunc from "debug"; import debugFunc from "debug";
import { Debugger } from "debug"; import { type Debugger } from "debug";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import FetchMock from "fetch-mock";
import type FetchMock from "fetch-mock";
/** Interface implemented by classes that intercept `/sync` requests from test clients /** Interface implemented by classes that intercept `/sync` requests from test clients
* *

View File

@ -16,7 +16,7 @@ limitations under the License.
import { MatrixEvent } from "../../src"; import { MatrixEvent } from "../../src";
import { M_BEACON, M_BEACON_INFO } from "../../src/@types/beacon"; import { M_BEACON, M_BEACON_INFO } from "../../src/@types/beacon";
import { LocationAssetType } from "../../src/@types/location"; import { type LocationAssetType } from "../../src/@types/location";
import { makeBeaconContent, makeBeaconInfoContent } from "../../src/content-helpers"; import { makeBeaconContent, makeBeaconInfoContent } from "../../src/content-helpers";
type InfoContentProps = { type InfoContentProps = {

View File

@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { MethodLikeKeys, mocked, MockedObject } from "jest-mock"; import { type MethodLikeKeys, mocked, type MockedObject } from "jest-mock";
import { ClientEventHandlerMap, EmittedEvents, MatrixClient } from "../../src/client"; import { type ClientEventHandlerMap, type EmittedEvents, type MatrixClient } from "../../src/client";
import { TypedEventEmitter } from "../../src/models/typed-event-emitter"; import { TypedEventEmitter } from "../../src/models/typed-event-emitter";
import { User } from "../../src/models/user"; import { User } from "../../src/models/user";

View File

@ -16,7 +16,7 @@ limitations under the License.
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { KeyBackupInfo } from "../../src/crypto-api"; import { type KeyBackupInfo } from "../../src/crypto-api";
/** /**
* Mock out the endpoints that the js-sdk calls when we call `MatrixClient.start()`. * Mock out the endpoints that the js-sdk calls when we call `MatrixClient.start()`.

View File

@ -3,9 +3,9 @@
* Do not edit by hand! This file is generated by `./generate-test-data.py` * Do not edit by hand! This file is generated by `./generate-test-data.py`
*/ */
import { IDeviceKeys, IMegolmSessionData } from "../../../src/@types/crypto"; import { type IDeviceKeys, type IMegolmSessionData } from "../../../src/@types/crypto";
import { IDownloadKeyResult, IEvent } from "../../../src"; import { type IDownloadKeyResult, type IEvent } from "../../../src";
import { KeyBackupSession, KeyBackupInfo } from "../../../src/crypto-api/keybackup"; import { type KeyBackupSession, type KeyBackupInfo } from "../../../src/crypto-api/keybackup";
/* eslint-disable comma-dangle */ /* eslint-disable comma-dangle */

View File

@ -1,25 +1,31 @@
// eslint-disable-next-line no-restricted-imports
import EventEmitter from "events";
// load olm before the sdk if possible // load olm before the sdk if possible
import "../olm-loader"; import "../olm-loader";
// eslint-disable-next-line no-restricted-imports
import type EventEmitter from "events";
import { logger } from "../../src/logger"; import { logger } from "../../src/logger";
import { IContent, IEvent, IEventRelation, IUnsigned, MatrixEvent, MatrixEventEvent } from "../../src/models/event"; import {
type IContent,
type IEvent,
type IEventRelation,
type IUnsigned,
MatrixEvent,
MatrixEventEvent,
} from "../../src/models/event";
import { import {
ClientEvent, ClientEvent,
EventType, EventType,
IJoinedRoom, type IJoinedRoom,
IPusher, type IPusher,
ISyncResponse, type ISyncResponse,
MatrixClient, type MatrixClient,
MsgType, MsgType,
RelationType, RelationType,
} from "../../src"; } from "../../src";
import { SyncState } from "../../src/sync"; import { SyncState } from "../../src/sync";
import { eventMapperFor } from "../../src/event-mapper"; import { eventMapperFor } from "../../src/event-mapper";
import { TEST_ROOM_ID } from "./test-data"; import { TEST_ROOM_ID } from "./test-data";
import { KnownMembership, Membership } from "../../src/@types/membership"; import { KnownMembership, type Membership } from "../../src/@types/membership";
/** /**
* Return a promise that is resolved when the client next emits a * Return a promise that is resolved when the client next emits a

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { DumpDataSetInfo } from "../index"; import { type DumpDataSetInfo } from "../index";
/** /**
* A key query response containing the current keys of the tested user. * A key query response containing the current keys of the tested user.

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { DumpDataSetInfo } from "../index"; import { type DumpDataSetInfo } from "../index";
/** /**
* A key query response containing the current keys of the tested user. * A key query response containing the current keys of the tested user.

View File

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { KeyBackupInfo } from "../../../../src/crypto-api/keybackup"; import { type KeyBackupInfo } from "../../../../src/crypto-api/keybackup";
import { DumpDataSetInfo } from "../index"; import { type DumpDataSetInfo } from "../index";
/** /**
* A key query response containing the current keys of the tested user. * A key query response containing the current keys of the tested user.

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { DumpDataSetInfo } from "../index"; import { type DumpDataSetInfo } from "../index";
/** /**
* A key query response containing the current keys of the tested user. * A key query response containing the current keys of the tested user.

View File

@ -15,10 +15,10 @@ limitations under the License.
*/ */
import { RelationType } from "../../src/@types/event"; import { RelationType } from "../../src/@types/event";
import { MatrixClient } from "../../src/client"; import { type MatrixClient } from "../../src/client";
import { MatrixEvent, MatrixEventEvent } from "../../src/models/event"; import { type MatrixEvent, MatrixEventEvent } from "../../src/models/event";
import { Room } from "../../src/models/room"; import { type Room } from "../../src/models/room";
import { Thread, THREAD_RELATION_TYPE } from "../../src/models/thread"; import { type Thread, THREAD_RELATION_TYPE } from "../../src/models/thread";
import { mkMessage } from "./test-utils"; import { mkMessage } from "./test-utils";
export const makeThreadEvent = ({ export const makeThreadEvent = ({

View File

@ -15,33 +15,33 @@ limitations under the License.
*/ */
import { import {
ClientEvent, type ClientEvent,
ClientEventHandlerMap, type ClientEventHandlerMap,
EmptyObject, type EmptyObject,
EventType, EventType,
GroupCall, type GroupCall,
GroupCallIntent, GroupCallIntent,
GroupCallType, GroupCallType,
IContent, type IContent,
ISendEventResponse, type ISendEventResponse,
MatrixClient, type MatrixClient,
MatrixEvent, type MatrixEvent,
Room, type Room,
RoomMember, RoomMember,
RoomState, type RoomState,
RoomStateEvent, RoomStateEvent,
RoomStateEventHandlerMap, type RoomStateEventHandlerMap,
SendToDeviceContentMap, type SendToDeviceContentMap,
} from "../../src"; } from "../../src";
import { TypedEventEmitter } from "../../src/models/typed-event-emitter"; import { TypedEventEmitter } from "../../src/models/typed-event-emitter";
import { ReEmitter } from "../../src/ReEmitter"; import { ReEmitter } from "../../src/ReEmitter";
import { SyncState } from "../../src/sync"; import { SyncState } from "../../src/sync";
import { CallEvent, CallEventHandlerMap, CallState, MatrixCall } from "../../src/webrtc/call"; import { type CallEvent, type CallEventHandlerMap, CallState, type MatrixCall } from "../../src/webrtc/call";
import { CallEventHandlerEvent, CallEventHandlerEventHandlerMap } from "../../src/webrtc/callEventHandler"; import { type CallEventHandlerEvent, type CallEventHandlerEventHandlerMap } from "../../src/webrtc/callEventHandler";
import { CallFeed } from "../../src/webrtc/callFeed"; import { type CallFeed } from "../../src/webrtc/callFeed";
import { GroupCallEventHandlerMap } from "../../src/webrtc/groupCall"; import { type GroupCallEventHandlerMap } from "../../src/webrtc/groupCall";
import { GroupCallEventHandlerEvent } from "../../src/webrtc/groupCallEventHandler"; import { type GroupCallEventHandlerEvent } from "../../src/webrtc/groupCallEventHandler";
import { IScreensharingOpts, MediaHandler } from "../../src/webrtc/mediaHandler"; import { type IScreensharingOpts, type MediaHandler } from "../../src/webrtc/mediaHandler";
export const DUMMY_SDP = export const DUMMY_SDP =
"v=0\r\n" + "v=0\r\n" +

View File

@ -1,9 +1,9 @@
import { ConnectionError } from "../../src/http-api/errors"; import { ConnectionError } from "../../src/http-api/errors";
import { ClientEvent, MatrixClient, Store } from "../../src/client"; import { ClientEvent, type MatrixClient, type Store } from "../../src/client";
import { ToDeviceMessageQueue } from "../../src/ToDeviceMessageQueue"; import { ToDeviceMessageQueue } from "../../src/ToDeviceMessageQueue";
import { getMockClientWithEventEmitter } from "../test-utils/client"; import { getMockClientWithEventEmitter } from "../test-utils/client";
import { StubStore } from "../../src/store/stub"; import { StubStore } from "../../src/store/stub";
import { IndexedToDeviceBatch } from "../../src/models/ToDeviceMessage"; import { type IndexedToDeviceBatch } from "../../src/models/ToDeviceMessage";
import { SyncState } from "../../src/sync"; import { SyncState } from "../../src/sync";
import { defer } from "../../src/utils"; import { defer } from "../../src/utils";

View File

@ -3,7 +3,7 @@ import "../olm-loader";
import { EventEmitter } from "events"; import { EventEmitter } from "events";
import type { PkDecryption, PkSigning } from "@matrix-org/olm"; import type { PkDecryption, PkSigning } from "@matrix-org/olm";
import { IClaimOTKsResult, MatrixClient } from "../../src/client"; import { type IClaimOTKsResult, type MatrixClient } from "../../src/client";
import { Crypto } from "../../src/crypto"; import { Crypto } from "../../src/crypto";
import { MemoryCryptoStore } from "../../src/crypto/store/memory-crypto-store"; import { MemoryCryptoStore } from "../../src/crypto/store/memory-crypto-store";
import { MockStorageApi } from "../MockStorageApi"; import { MockStorageApi } from "../MockStorageApi";
@ -18,12 +18,12 @@ import { logger } from "../../src/logger";
import { DeviceVerification, MemoryStore } from "../../src"; import { DeviceVerification, MemoryStore } from "../../src";
import { RoomKeyRequestState } from "../../src/crypto/OutgoingRoomKeyRequestManager"; import { RoomKeyRequestState } from "../../src/crypto/OutgoingRoomKeyRequestManager";
import { RoomMember } from "../../src/models/room-member"; import { RoomMember } from "../../src/models/room-member";
import { IStore } from "../../src/store"; import { type IStore } from "../../src/store";
import { IRoomEncryption, RoomList } from "../../src/crypto/RoomList"; import { type IRoomEncryption, type RoomList } from "../../src/crypto/RoomList";
import { EventShieldColour, EventShieldReason } from "../../src/crypto-api"; import { EventShieldColour, EventShieldReason } from "../../src/crypto-api";
import { UserTrustLevel } from "../../src/crypto/CrossSigning"; import { UserTrustLevel } from "../../src/crypto/CrossSigning";
import { CryptoBackend } from "../../src/common-crypto/CryptoBackend"; import { type CryptoBackend } from "../../src/common-crypto/CryptoBackend";
import { EventDecryptionResult } from "../../src/common-crypto/CryptoBackend"; import { type EventDecryptionResult } from "../../src/common-crypto/CryptoBackend";
import * as testData from "../test-utils/test-data"; import * as testData from "../test-utils/test-data";
import { KnownMembership } from "../../src/@types/membership"; import { KnownMembership } from "../../src/@types/membership";
import type { DeviceInfoMap } from "../../src/crypto/DeviceList"; import type { DeviceInfoMap } from "../../src/crypto/DeviceList";

View File

@ -20,9 +20,9 @@ import { logger } from "../../../src/logger";
import * as utils from "../../../src/utils"; import * as utils from "../../../src/utils";
import { MemoryCryptoStore } from "../../../src/crypto/store/memory-crypto-store"; import { MemoryCryptoStore } from "../../../src/crypto/store/memory-crypto-store";
import { DeviceList } from "../../../src/crypto/DeviceList"; import { DeviceList } from "../../../src/crypto/DeviceList";
import { IDownloadKeyResult, MatrixClient } from "../../../src"; import { type IDownloadKeyResult, type MatrixClient } from "../../../src";
import { OlmDevice } from "../../../src/crypto/OlmDevice"; import { type OlmDevice } from "../../../src/crypto/OlmDevice";
import { CryptoStore } from "../../../src/crypto/store/base"; import { type CryptoStore } from "../../../src/crypto/store/base";
const signedDeviceList: IDownloadKeyResult = { const signedDeviceList: IDownloadKeyResult = {
failures: {}, failures: {},

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { mocked, MockedObject } from "jest-mock"; import { mocked, type MockedObject } from "jest-mock";
import type { DeviceInfoMap } from "../../../../src/crypto/DeviceList"; import type { DeviceInfoMap } from "../../../../src/crypto/DeviceList";
import "../../../olm-loader"; import "../../../olm-loader";
@ -23,15 +23,15 @@ import * as algorithms from "../../../../src/crypto/algorithms";
import { MemoryCryptoStore } from "../../../../src/crypto/store/memory-crypto-store"; import { MemoryCryptoStore } from "../../../../src/crypto/store/memory-crypto-store";
import * as testUtils from "../../../test-utils/test-utils"; import * as testUtils from "../../../test-utils/test-utils";
import { OlmDevice } from "../../../../src/crypto/OlmDevice"; import { OlmDevice } from "../../../../src/crypto/OlmDevice";
import { Crypto, IncomingRoomKeyRequest } from "../../../../src/crypto"; import { Crypto, type IncomingRoomKeyRequest } from "../../../../src/crypto";
import { logger } from "../../../../src/logger"; import { logger } from "../../../../src/logger";
import { MatrixEvent } from "../../../../src/models/event"; import { MatrixEvent } from "../../../../src/models/event";
import { TestClient } from "../../../TestClient"; import { TestClient } from "../../../TestClient";
import { Room } from "../../../../src/models/room"; import { Room } from "../../../../src/models/room";
import * as olmlib from "../../../../src/crypto/olmlib"; import * as olmlib from "../../../../src/crypto/olmlib";
import { TypedEventEmitter } from "../../../../src/models/typed-event-emitter"; import { TypedEventEmitter } from "../../../../src/models/typed-event-emitter";
import { ClientEvent, MatrixClient, RoomMember } from "../../../../src"; import { ClientEvent, type MatrixClient, RoomMember } from "../../../../src";
import { DeviceInfo, IDevice } from "../../../../src/crypto/deviceinfo"; import { DeviceInfo, type IDevice } from "../../../../src/crypto/deviceinfo";
import { DeviceTrustLevel } from "../../../../src/crypto/CrossSigning"; import { DeviceTrustLevel } from "../../../../src/crypto/CrossSigning";
import { MegolmEncryption as MegolmEncryptionClass } from "../../../../src/crypto/algorithms/megolm"; import { MegolmEncryption as MegolmEncryptionClass } from "../../../../src/crypto/algorithms/megolm";
import { recursiveMapToObject } from "../../../../src/utils"; import { recursiveMapToObject } from "../../../../src/utils";

View File

@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { MockedObject } from "jest-mock"; import { type MockedObject } from "jest-mock";
import "../../../olm-loader"; import "../../../olm-loader";
import { MemoryCryptoStore } from "../../../../src/crypto/store/memory-crypto-store"; import { MemoryCryptoStore } from "../../../../src/crypto/store/memory-crypto-store";
@ -23,7 +23,7 @@ import { logger } from "../../../../src/logger";
import { OlmDevice } from "../../../../src/crypto/OlmDevice"; import { OlmDevice } from "../../../../src/crypto/OlmDevice";
import * as olmlib from "../../../../src/crypto/olmlib"; import * as olmlib from "../../../../src/crypto/olmlib";
import { DeviceInfo } from "../../../../src/crypto/deviceinfo"; import { DeviceInfo } from "../../../../src/crypto/deviceinfo";
import { MatrixClient } from "../../../../src"; import { type MatrixClient } from "../../../../src";
function makeOlmDevice() { function makeOlmDevice() {
const cryptoStore = new MemoryCryptoStore(); const cryptoStore = new MemoryCryptoStore();

View File

@ -28,10 +28,10 @@ import { Crypto } from "../../../src/crypto";
import { resetCrossSigningKeys } from "./crypto-utils"; import { resetCrossSigningKeys } from "./crypto-utils";
import { BackupManager } from "../../../src/crypto/backup"; import { BackupManager } from "../../../src/crypto/backup";
import { StubStore } from "../../../src/store/stub"; import { StubStore } from "../../../src/store/stub";
import { IndexedDBCryptoStore, MatrixScheduler } from "../../../src"; import { IndexedDBCryptoStore, type MatrixScheduler } from "../../../src";
import { CryptoStore } from "../../../src/crypto/store/base"; import { type CryptoStore } from "../../../src/crypto/store/base";
import { MegolmDecryption as MegolmDecryptionClass } from "../../../src/crypto/algorithms/megolm"; import { type MegolmDecryption as MegolmDecryptionClass } from "../../../src/crypto/algorithms/megolm";
import { IKeyBackupInfo } from "../../../src/crypto/keybackup"; import { type IKeyBackupInfo } from "../../../src/crypto/keybackup";
const Olm = globalThis.Olm; const Olm = globalThis.Olm;

View File

@ -17,18 +17,18 @@ limitations under the License.
import "../../olm-loader"; import "../../olm-loader";
import anotherjson from "another-json"; import anotherjson from "another-json";
import { PkSigning } from "@matrix-org/olm"; import { type PkSigning } from "@matrix-org/olm";
import HttpBackend from "matrix-mock-request";
import type HttpBackend from "matrix-mock-request";
import * as olmlib from "../../../src/crypto/olmlib"; import * as olmlib from "../../../src/crypto/olmlib";
import { MatrixError } from "../../../src/http-api"; import { MatrixError } from "../../../src/http-api";
import { logger } from "../../../src/logger"; import { logger } from "../../../src/logger";
import { ICreateClientOpts, ISignedKey, MatrixClient } from "../../../src/client"; import { type ICreateClientOpts, type ISignedKey, type MatrixClient } from "../../../src/client";
import { CryptoEvent } from "../../../src/crypto"; import { CryptoEvent } from "../../../src/crypto";
import { IDevice } from "../../../src/crypto/deviceinfo"; import { type IDevice } from "../../../src/crypto/deviceinfo";
import { TestClient } from "../../TestClient"; import { TestClient } from "../../TestClient";
import { resetCrossSigningKeys } from "./crypto-utils"; import { resetCrossSigningKeys } from "./crypto-utils";
import { BootstrapCrossSigningOpts, CrossSigningKeyInfo } from "../../../src/crypto-api"; import { type BootstrapCrossSigningOpts, type CrossSigningKeyInfo } from "../../../src/crypto-api";
const PUSH_RULES_RESPONSE: Response = { const PUSH_RULES_RESPONSE: Response = {
method: "GET", method: "GET",

View File

@ -1,7 +1,7 @@
import { IRecoveryKey } from "../../../src/crypto/api"; import { type IRecoveryKey } from "../../../src/crypto/api";
import { CrossSigningLevel } from "../../../src/crypto/CrossSigning"; import { type CrossSigningLevel } from "../../../src/crypto/CrossSigning";
import { IndexedDBCryptoStore } from "../../../src/crypto/store/indexeddb-crypto-store"; import { IndexedDBCryptoStore } from "../../../src/crypto/store/indexeddb-crypto-store";
import { MatrixClient } from "../../../src"; import { type MatrixClient } from "../../../src";
import { CryptoEvent } from "../../../src/crypto"; import { CryptoEvent } from "../../../src/crypto";
// needs to be phased out and replaced with bootstrapSecretStorage, // needs to be phased out and replaced with bootstrapSecretStorage,

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { CryptoStore } from "../../../src/crypto/store/base"; import { type CryptoStore } from "../../../src/crypto/store/base";
import { IndexedDBCryptoStore } from "../../../src/crypto/store/indexeddb-crypto-store"; import { IndexedDBCryptoStore } from "../../../src/crypto/store/indexeddb-crypto-store";
import { LocalStorageCryptoStore } from "../../../src/crypto/store/localStorage-crypto-store"; import { LocalStorageCryptoStore } from "../../../src/crypto/store/localStorage-crypto-store";
import { MemoryCryptoStore } from "../../../src/crypto/store/memory-crypto-store"; import { MemoryCryptoStore } from "../../../src/crypto/store/memory-crypto-store";

View File

@ -16,21 +16,21 @@ limitations under the License.
import "../../olm-loader"; import "../../olm-loader";
import * as olmlib from "../../../src/crypto/olmlib"; import * as olmlib from "../../../src/crypto/olmlib";
import { IObject } from "../../../src/crypto/olmlib"; import { type IObject } from "../../../src/crypto/olmlib";
import { MatrixEvent } from "../../../src/models/event"; import { MatrixEvent } from "../../../src/models/event";
import { TestClient } from "../../TestClient"; import { TestClient } from "../../TestClient";
import { makeTestClients } from "./verification/util"; import { makeTestClients } from "./verification/util";
import encryptAESSecretStorageItem from "../../../src/utils/encryptAESSecretStorageItem.ts"; import encryptAESSecretStorageItem from "../../../src/utils/encryptAESSecretStorageItem.ts";
import { createSecretStorageKey, resetCrossSigningKeys } from "./crypto-utils"; import { createSecretStorageKey, resetCrossSigningKeys } from "./crypto-utils";
import { logger } from "../../../src/logger"; import { logger } from "../../../src/logger";
import { ClientEvent, ICreateClientOpts, MatrixClient } from "../../../src/client"; import { ClientEvent, type ICreateClientOpts, type MatrixClient } from "../../../src/client";
import { DeviceInfo } from "../../../src/crypto/deviceinfo"; import { DeviceInfo } from "../../../src/crypto/deviceinfo";
import { ISignatures } from "../../../src/@types/signed"; import { type ISignatures } from "../../../src/@types/signed";
import { ICurve25519AuthData } from "../../../src/crypto/keybackup"; import { type ICurve25519AuthData } from "../../../src/crypto/keybackup";
import { SecretStorageKeyDescription, SECRET_STORAGE_ALGORITHM_V1_AES } from "../../../src/secret-storage"; import { type SecretStorageKeyDescription, SECRET_STORAGE_ALGORITHM_V1_AES } from "../../../src/secret-storage";
import { decodeBase64 } from "../../../src/base64"; import { decodeBase64 } from "../../../src/base64";
import { CrossSigningKeyInfo } from "../../../src/crypto-api"; import { type CrossSigningKeyInfo } from "../../../src/crypto-api";
import { SecretInfo } from "../../../src/secret-storage.ts"; import { type SecretInfo } from "../../../src/secret-storage.ts";
async function makeTestClient( async function makeTestClient(
userInfo: { userId: string; deviceId: string }, userInfo: { userId: string; deviceId: string },

View File

@ -17,7 +17,7 @@ limitations under the License.
import "fake-indexeddb/auto"; import "fake-indexeddb/auto";
import "jest-localstorage-mock"; import "jest-localstorage-mock";
import { IndexedDBCryptoStore, LocalStorageCryptoStore, MemoryCryptoStore } from "../../../../src"; import { IndexedDBCryptoStore, LocalStorageCryptoStore, MemoryCryptoStore } from "../../../../src";
import { CryptoStore, MigrationState, SESSION_BATCH_SIZE } from "../../../../src/crypto/store/base"; import { type CryptoStore, MigrationState, SESSION_BATCH_SIZE } from "../../../../src/crypto/store/base";
describe.each([ describe.each([
["IndexedDBCryptoStore", () => new IndexedDBCryptoStore(globalThis.indexedDB, "tests")], ["IndexedDBCryptoStore", () => new IndexedDBCryptoStore(globalThis.indexedDB, "tests")],

View File

@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { MatrixClient } from "../../../../src/client"; import { type MatrixClient } from "../../../../src/client";
import { InRoomChannel } from "../../../../src/crypto/verification/request/InRoomChannel"; import { InRoomChannel } from "../../../../src/crypto/verification/request/InRoomChannel";
import { MatrixEvent } from "../../../../src/models/event"; import { MatrixEvent } from "../../../../src/models/event";

View File

@ -17,17 +17,17 @@ limitations under the License.
import "../../../olm-loader"; import "../../../olm-loader";
import { makeTestClients } from "./util"; import { makeTestClients } from "./util";
import { MatrixEvent } from "../../../../src/models/event"; import { MatrixEvent } from "../../../../src/models/event";
import { ISasEvent, SAS, SasEvent } from "../../../../src/crypto/verification/SAS"; import { type ISasEvent, SAS, SasEvent } from "../../../../src/crypto/verification/SAS";
import { DeviceInfo, IDevice } from "../../../../src/crypto/deviceinfo"; import { DeviceInfo, type IDevice } from "../../../../src/crypto/deviceinfo";
import { CryptoEvent, verificationMethods } from "../../../../src/crypto"; import { CryptoEvent, verificationMethods } from "../../../../src/crypto";
import * as olmlib from "../../../../src/crypto/olmlib"; import * as olmlib from "../../../../src/crypto/olmlib";
import { logger } from "../../../../src/logger"; import { logger } from "../../../../src/logger";
import { resetCrossSigningKeys } from "../crypto-utils"; import { resetCrossSigningKeys } from "../crypto-utils";
import { VerificationBase } from "../../../../src/crypto/verification/Base"; import { type VerificationBase } from "../../../../src/crypto/verification/Base";
import { IVerificationChannel } from "../../../../src/crypto/verification/request/Channel"; import { type IVerificationChannel } from "../../../../src/crypto/verification/request/Channel";
import { MatrixClient } from "../../../../src"; import { type MatrixClient } from "../../../../src";
import { VerificationRequest } from "../../../../src/crypto/verification/request/VerificationRequest"; import { type VerificationRequest } from "../../../../src/crypto/verification/request/VerificationRequest";
import { TestClient } from "../../../TestClient"; import { type TestClient } from "../../../TestClient";
const Olm = globalThis.Olm; const Olm = globalThis.Olm;

View File

@ -15,12 +15,12 @@ limitations under the License.
*/ */
import "../../../olm-loader"; import "../../../olm-loader";
import { MatrixClient, MatrixEvent } from "../../../../src/matrix"; import { type MatrixClient, type MatrixEvent } from "../../../../src/matrix";
import { encodeBase64 } from "../../../../src/base64"; import { encodeBase64 } from "../../../../src/base64";
import "../../../../src/crypto"; // import this to cycle-break import "../../../../src/crypto"; // import this to cycle-break
import { CrossSigningInfo } from "../../../../src/crypto/CrossSigning"; import { CrossSigningInfo } from "../../../../src/crypto/CrossSigning";
import { VerificationRequest } from "../../../../src/crypto/verification/request/VerificationRequest"; import { type VerificationRequest } from "../../../../src/crypto/verification/request/VerificationRequest";
import { IVerificationChannel } from "../../../../src/crypto/verification/request/Channel"; import { type IVerificationChannel } from "../../../../src/crypto/verification/request/Channel";
import { VerificationBase } from "../../../../src/crypto/verification/Base"; import { VerificationBase } from "../../../../src/crypto/verification/Base";
jest.useFakeTimers(); jest.useFakeTimers();

View File

@ -16,11 +16,16 @@ limitations under the License.
*/ */
import { TestClient } from "../../../TestClient"; import { TestClient } from "../../../TestClient";
import { IContent, MatrixEvent } from "../../../../src/models/event"; import { type IContent, MatrixEvent } from "../../../../src/models/event";
import { IRoomTimelineData } from "../../../../src/models/event-timeline-set"; import { type IRoomTimelineData } from "../../../../src/models/event-timeline-set";
import { Room, RoomEvent } from "../../../../src/models/room"; import { Room, RoomEvent } from "../../../../src/models/room";
import { logger } from "../../../../src/logger"; import { logger } from "../../../../src/logger";
import { MatrixClient, ClientEvent, ICreateClientOpts, SendToDeviceContentMap } from "../../../../src/client"; import {
type MatrixClient,
ClientEvent,
type ICreateClientOpts,
type SendToDeviceContentMap,
} from "../../../../src/client";
interface UserInfo { interface UserInfo {
userId: string; userId: string;

View File

@ -21,9 +21,9 @@ import {
} from "../../../../src/crypto/verification/request/VerificationRequest"; } from "../../../../src/crypto/verification/request/VerificationRequest";
import { InRoomChannel } from "../../../../src/crypto/verification/request/InRoomChannel"; import { InRoomChannel } from "../../../../src/crypto/verification/request/InRoomChannel";
import { ToDeviceChannel } from "../../../../src/crypto/verification/request/ToDeviceChannel"; import { ToDeviceChannel } from "../../../../src/crypto/verification/request/ToDeviceChannel";
import { IContent, MatrixEvent } from "../../../../src/models/event"; import { type IContent, MatrixEvent } from "../../../../src/models/event";
import { MatrixClient } from "../../../../src/client"; import { type MatrixClient } from "../../../../src/client";
import { IVerificationChannel } from "../../../../src/crypto/verification/request/Channel"; import { type IVerificationChannel } from "../../../../src/crypto/verification/request/Channel";
import { VerificationBase } from "../../../../src/crypto/verification/Base"; import { VerificationBase } from "../../../../src/crypto/verification/Base";
import { MapWithDefault } from "../../../../src/utils"; import { MapWithDefault } from "../../../../src/utils";

View File

@ -22,24 +22,24 @@ limitations under the License.
// project, which doesn't know about our TypeEventEmitter implementation at all // project, which doesn't know about our TypeEventEmitter implementation at all
// eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports
import { EventEmitter } from "events"; import { EventEmitter } from "events";
import { MockedObject } from "jest-mock"; import { type MockedObject } from "jest-mock";
import { import {
WidgetApi, type WidgetApi,
WidgetApiToWidgetAction, WidgetApiToWidgetAction,
MatrixCapabilities, MatrixCapabilities,
ITurnServer, type ITurnServer,
IRoomEvent, type IRoomEvent,
IOpenIDCredentials, type IOpenIDCredentials,
ISendEventFromWidgetResponseData, type ISendEventFromWidgetResponseData,
WidgetApiResponseError, WidgetApiResponseError,
} from "matrix-widget-api"; } from "matrix-widget-api";
import { createRoomWidgetClient, MatrixError, MsgType, UpdateDelayedEventAction } from "../../src/matrix"; import { createRoomWidgetClient, MatrixError, MsgType, UpdateDelayedEventAction } from "../../src/matrix";
import { MatrixClient, ClientEvent, ITurnServer as IClientTurnServer } from "../../src/client"; import { MatrixClient, ClientEvent, type ITurnServer as IClientTurnServer } from "../../src/client";
import { SyncState } from "../../src/sync"; import { SyncState } from "../../src/sync";
import { ICapabilities, RoomWidgetClient } from "../../src/embedded"; import { type ICapabilities, type RoomWidgetClient } from "../../src/embedded";
import { MatrixEvent } from "../../src/models/event"; import { MatrixEvent } from "../../src/models/event";
import { ToDeviceBatch } from "../../src/models/ToDeviceMessage"; import { type ToDeviceBatch } from "../../src/models/ToDeviceMessage";
import { DeviceInfo } from "../../src/crypto/deviceinfo"; import { DeviceInfo } from "../../src/crypto/deviceinfo";
import { sleep } from "../../src/utils"; import { sleep } from "../../src/utils";

View File

@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { MatrixClient, MatrixEvent, MatrixEventEvent, MatrixScheduler, Room } from "../../src"; import { MatrixClient, MatrixEvent, MatrixEventEvent, type MatrixScheduler, Room } from "../../src";
import { eventMapperFor } from "../../src/event-mapper"; import { eventMapperFor } from "../../src/event-mapper";
import { IStore } from "../../src/store"; import { type IStore } from "../../src/store";
describe("eventMapperFor", function () { describe("eventMapperFor", function () {
let rooms: Room[] = []; let rooms: Room[] = [];

View File

@ -3,7 +3,7 @@ import { mocked } from "jest-mock";
import * as utils from "../test-utils/test-utils"; import * as utils from "../test-utils/test-utils";
import { Direction, EventTimeline } from "../../src/models/event-timeline"; import { Direction, EventTimeline } from "../../src/models/event-timeline";
import { RoomState } from "../../src/models/room-state"; import { RoomState } from "../../src/models/room-state";
import { MatrixClient } from "../../src/matrix"; import { type MatrixClient } from "../../src/matrix";
import { Room } from "../../src/models/room"; import { Room } from "../../src/models/room";
import { RoomMember } from "../../src/models/room-member"; import { RoomMember } from "../../src/models/room-member";
import { EventTimelineSet } from "../../src/models/event-timeline-set"; import { EventTimelineSet } from "../../src/models/event-timeline-set";

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { ExtensibleEventType, IPartialEvent } from "../../../src/@types/extensible_events"; import { type ExtensibleEventType, type IPartialEvent } from "../../../src/@types/extensible_events";
import { ExtensibleEvent } from "../../../src/extensible_events_v1/ExtensibleEvent"; import { ExtensibleEvent } from "../../../src/extensible_events_v1/ExtensibleEvent";
class MockEvent extends ExtensibleEvent<any> { class MockEvent extends ExtensibleEvent<any> {

View File

@ -15,8 +15,8 @@ limitations under the License.
*/ */
import { import {
ExtensibleAnyMessageEventContent, type ExtensibleAnyMessageEventContent,
IPartialEvent, type IPartialEvent,
M_HTML, M_HTML,
M_MESSAGE, M_MESSAGE,
M_TEXT, M_TEXT,

View File

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { PollEndEventContent, M_POLL_END } from "../../../src/@types/polls"; import { type PollEndEventContent, M_POLL_END } from "../../../src/@types/polls";
import { IPartialEvent, REFERENCE_RELATION, M_TEXT } from "../../../src/@types/extensible_events"; import { type IPartialEvent, REFERENCE_RELATION, M_TEXT } from "../../../src/@types/extensible_events";
import { PollEndEvent } from "../../../src/extensible_events_v1/PollEndEvent"; import { PollEndEvent } from "../../../src/extensible_events_v1/PollEndEvent";
import { InvalidEventError } from "../../../src/extensible_events_v1/InvalidEventError"; import { InvalidEventError } from "../../../src/extensible_events_v1/InvalidEventError";

View File

@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { M_TEXT, IPartialEvent, REFERENCE_RELATION } from "../../../src/@types/extensible_events"; import { M_TEXT, type IPartialEvent, REFERENCE_RELATION } from "../../../src/@types/extensible_events";
import { import {
M_POLL_START, M_POLL_START,
M_POLL_KIND_DISCLOSED, M_POLL_KIND_DISCLOSED,
PollResponseEventContent, type PollResponseEventContent,
M_POLL_RESPONSE, M_POLL_RESPONSE,
} from "../../../src/@types/polls"; } from "../../../src/@types/polls";
import { PollStartEvent } from "../../../src/extensible_events_v1/PollStartEvent"; import { PollStartEvent } from "../../../src/extensible_events_v1/PollStartEvent";

View File

@ -14,12 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { M_TEXT, IPartialEvent } from "../../../src/@types/extensible_events"; import { M_TEXT, type IPartialEvent } from "../../../src/@types/extensible_events";
import { import {
M_POLL_START, M_POLL_START,
M_POLL_KIND_DISCLOSED, M_POLL_KIND_DISCLOSED,
PollAnswer, type PollAnswer,
PollStartEventContent, type PollStartEventContent,
M_POLL_KIND_UNDISCLOSED, M_POLL_KIND_UNDISCLOSED,
} from "../../../src/@types/polls"; } from "../../../src/@types/polls";
import { PollStartEvent, PollAnswerSubevent } from "../../../src/extensible_events_v1/PollStartEvent"; import { PollStartEvent, PollAnswerSubevent } from "../../../src/extensible_events_v1/PollStartEvent";

View File

@ -15,7 +15,7 @@ limitations under the License.
*/ */
import { UNREAD_THREAD_NOTIFICATIONS } from "../../src/@types/sync"; import { UNREAD_THREAD_NOTIFICATIONS } from "../../src/@types/sync";
import { Filter, IFilterDefinition } from "../../src/filter"; import { Filter, type IFilterDefinition } from "../../src/filter";
import { mkEvent } from "../test-utils/test-utils"; import { mkEvent } from "../test-utils/test-utils";
import { EventType } from "../../src"; import { EventType } from "../../src";

View File

@ -14,22 +14,22 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { Mocked } from "jest-mock"; import { type Mocked } from "jest-mock";
import { FetchHttpApi } from "../../../src/http-api/fetch"; import { FetchHttpApi } from "../../../src/http-api/fetch";
import { TypedEventEmitter } from "../../../src/models/typed-event-emitter"; import { TypedEventEmitter } from "../../../src/models/typed-event-emitter";
import { import {
ClientPrefix, ClientPrefix,
HttpApiEvent, HttpApiEvent,
HttpApiEventHandlerMap, type HttpApiEventHandlerMap,
IdentityPrefix, IdentityPrefix,
IHttpOpts, type IHttpOpts,
MatrixError, MatrixError,
Method, Method,
} from "../../../src"; } from "../../../src";
import { emitPromise } from "../../test-utils/test-utils"; import { emitPromise } from "../../test-utils/test-utils";
import { defer, QueryDict } from "../../../src/utils"; import { defer, type QueryDict } from "../../../src/utils";
import { Logger } from "../../../src/logger"; import { type Logger } from "../../../src/logger";
describe("FetchHttpApi", () => { describe("FetchHttpApi", () => {
const baseUrl = "http://baseUrl"; const baseUrl = "http://baseUrl";

View File

@ -16,7 +16,7 @@ limitations under the License.
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { ClientPrefix, MatrixHttpApi, Method, UploadResponse } from "../../../src"; import { ClientPrefix, MatrixHttpApi, Method, type UploadResponse } from "../../../src";
import { TypedEventEmitter } from "../../../src/models/typed-event-emitter"; import { TypedEventEmitter } from "../../../src/models/typed-event-emitter";
type Writeable<T> = { -readonly [P in keyof T]: T[P] }; type Writeable<T> = { -readonly [P in keyof T]: T[P] };

View File

@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { MatrixClient } from "../../src/client"; import { type MatrixClient } from "../../src/client";
import { logger } from "../../src/logger"; import { logger } from "../../src/logger";
import { InteractiveAuth, AuthType } from "../../src/interactive-auth"; import { InteractiveAuth, AuthType } from "../../src/interactive-auth";
import { HTTPError, MatrixError } from "../../src/http-api"; import { HTTPError, MatrixError } from "../../src/http-api";

View File

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { LocalNotificationSettings } from "../../src/@types/local_notifications"; import { type LocalNotificationSettings } from "../../src/@types/local_notifications";
import { LOCAL_NOTIFICATION_SETTINGS_PREFIX, MatrixClient } from "../../src/matrix"; import { LOCAL_NOTIFICATION_SETTINGS_PREFIX, type MatrixClient } from "../../src/matrix";
import { TestClient } from "../TestClient"; import { TestClient } from "../TestClient";
let client: MatrixClient; let client: MatrixClient;

View File

@ -20,7 +20,7 @@ import {
LocationAssetType, LocationAssetType,
M_LOCATION, M_LOCATION,
M_TIMESTAMP, M_TIMESTAMP,
LocationEventWireContent, type LocationEventWireContent,
} from "../../src/@types/location"; } from "../../src/@types/location";
import { M_TEXT } from "../../src/@types/extensible_events"; import { M_TEXT } from "../../src/@types/extensible_events";
import { MsgType } from "../../src/@types/event"; import { MsgType } from "../../src/@types/event";

View File

@ -14,11 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { Mocked, mocked } from "jest-mock"; import { type Mocked, mocked } from "jest-mock";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { logger } from "../../src/logger"; import { logger } from "../../src/logger";
import { ClientEvent, IMatrixClientCreateOpts, ITurnServerResponse, MatrixClient, Store } from "../../src/client"; import {
ClientEvent,
type IMatrixClientCreateOpts,
type ITurnServerResponse,
MatrixClient,
type Store,
} from "../../src/client";
import { Filter } from "../../src/filter"; import { Filter } from "../../src/filter";
import { DEFAULT_TREE_POWER_LEVELS_TEMPLATE } from "../../src/models/MSC3089TreeSpace"; import { DEFAULT_TREE_POWER_LEVELS_TEMPLATE } from "../../src/models/MSC3089TreeSpace";
import { import {
@ -47,12 +53,12 @@ import {
EventTimeline, EventTimeline,
EventTimelineSet, EventTimelineSet,
getHttpUriForMxc, getHttpUriForMxc,
ICreateRoomOpts, type ICreateRoomOpts,
IPushRule, type IPushRule,
IRequestOpts, type IRequestOpts,
MatrixError, MatrixError,
MatrixHttpApi, type MatrixHttpApi,
MatrixScheduler, type MatrixScheduler,
Method, Method,
PushRuleActionName, PushRuleActionName,
Room, Room,
@ -68,15 +74,15 @@ import {
PolicyRecommendation, PolicyRecommendation,
PolicyScope, PolicyScope,
} from "../../src/models/invites-ignorer"; } from "../../src/models/invites-ignorer";
import { IOlmDevice } from "../../src/crypto/algorithms/megolm"; import { type IOlmDevice } from "../../src/crypto/algorithms/megolm";
import { defer, QueryDict } from "../../src/utils"; import { defer, type QueryDict } from "../../src/utils";
import { SyncState } from "../../src/sync"; import { type SyncState } from "../../src/sync";
import * as featureUtils from "../../src/feature"; import * as featureUtils from "../../src/feature";
import { StubStore } from "../../src/store/stub"; import { StubStore } from "../../src/store/stub";
import { SecretStorageKeyDescriptionAesV1, ServerSideSecretStorageImpl } from "../../src/secret-storage"; import { type SecretStorageKeyDescriptionAesV1, type ServerSideSecretStorageImpl } from "../../src/secret-storage";
import { CryptoBackend } from "../../src/common-crypto/CryptoBackend"; import { type CryptoBackend } from "../../src/common-crypto/CryptoBackend";
import { KnownMembership } from "../../src/@types/membership"; import { KnownMembership } from "../../src/@types/membership";
import { RoomMessageEventContent } from "../../src/@types/events"; import { type RoomMessageEventContent } from "../../src/@types/events";
import { mockOpenIdConfiguration } from "../test-utils/oidc.ts"; import { mockOpenIdConfiguration } from "../test-utils/oidc.ts";
jest.useFakeTimers(); jest.useFakeTimers();

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 { MatrixEvent } from "../../../src"; import { type MatrixEvent } from "../../../src";
import { CallMembership, SessionMembershipData, DEFAULT_EXPIRE_DURATION } from "../../../src/matrixrtc/CallMembership"; import {
CallMembership,
type SessionMembershipData,
DEFAULT_EXPIRE_DURATION,
} from "../../../src/matrixrtc/CallMembership";
import { membershipTemplate } from "./mocks"; import { membershipTemplate } from "./mocks";
function makeMockEvent(originTs = 0): MatrixEvent { function makeMockEvent(originTs = 0): MatrixEvent {

View File

@ -14,11 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { encodeBase64, EventType, MatrixClient, MatrixError, MatrixEvent, Room } from "../../../src"; import { encodeBase64, EventType, MatrixClient, MatrixError, type MatrixEvent, type Room } from "../../../src";
import { KnownMembership } from "../../../src/@types/membership"; import { KnownMembership } from "../../../src/@types/membership";
import { DEFAULT_EXPIRE_DURATION, SessionMembershipData } from "../../../src/matrixrtc/CallMembership"; import { DEFAULT_EXPIRE_DURATION, type SessionMembershipData } from "../../../src/matrixrtc/CallMembership";
import { MatrixRTCSession, MatrixRTCSessionEvent } from "../../../src/matrixrtc/MatrixRTCSession"; import { MatrixRTCSession, MatrixRTCSessionEvent } from "../../../src/matrixrtc/MatrixRTCSession";
import { EncryptionKeysEventContent } from "../../../src/matrixrtc/types"; import { type EncryptionKeysEventContent } from "../../../src/matrixrtc/types";
import { secureRandomString } from "../../../src/randomstring"; import { secureRandomString } from "../../../src/randomstring";
import { flushPromises } from "../../test-utils/flushPromises"; import { flushPromises } from "../../test-utils/flushPromises";
import { makeMockRoom, makeMockRoomState, membershipTemplate } from "./mocks"; import { makeMockRoom, makeMockRoomState, membershipTemplate } from "./mocks";

View File

@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { Mock } from "jest-mock"; import { type Mock } from "jest-mock";
import { import {
ClientEvent, ClientEvent,
EventTimeline, EventTimeline,
EventType, EventType,
IRoomTimelineData, type IRoomTimelineData,
MatrixClient, MatrixClient,
MatrixEvent, type MatrixEvent,
RoomEvent, RoomEvent,
} from "../../../src"; } from "../../../src";
import { RoomStateEvent } from "../../../src/models/room-state"; import { RoomStateEvent } from "../../../src/models/room-state";

View File

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { EventType, MatrixEvent, Room } from "../../../src"; import { EventType, type MatrixEvent, type Room } from "../../../src";
import { SessionMembershipData } from "../../../src/matrixrtc/CallMembership"; import { type SessionMembershipData } from "../../../src/matrixrtc/CallMembership";
import { secureRandomString } from "../../../src/randomstring"; import { secureRandomString } from "../../../src/randomstring";
type MembershipData = SessionMembershipData[] | SessionMembershipData | {}; type MembershipData = SessionMembershipData[] | SessionMembershipData | {};

View File

@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { IContent, MatrixClient, MatrixEvent } from "../../../src"; import { type IContent, type MatrixClient, type MatrixEvent } from "../../../src";
import { Room } from "../../../src/models/room"; import { type Room } from "../../../src/models/room";
import { RelationType, UNSTABLE_MSC3089_BRANCH } from "../../../src/@types/event"; import { RelationType, UNSTABLE_MSC3089_BRANCH } from "../../../src/@types/event";
import { EventTimelineSet } from "../../../src/models/event-timeline-set"; import { type EventTimelineSet } from "../../../src/models/event-timeline-set";
import { EventTimeline } from "../../../src/models/event-timeline"; import { type EventTimeline } from "../../../src/models/event-timeline";
import { MSC3089Branch } from "../../../src/models/MSC3089Branch"; import { MSC3089Branch } from "../../../src/models/MSC3089Branch";
import { MSC3089TreeSpace } from "../../../src/models/MSC3089TreeSpace"; import { MSC3089TreeSpace } from "../../../src/models/MSC3089TreeSpace";
import { EncryptedFile } from "../../../src/@types/media"; import { type EncryptedFile } from "../../../src/@types/media";
describe("MSC3089Branch", () => { describe("MSC3089Branch", () => {
let client: MatrixClient; let client: MatrixClient;

View File

@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { IContent, MatrixClient } from "../../../src"; import { type IContent, type MatrixClient } from "../../../src";
import { Room } from "../../../src/models/room"; import { type Room } from "../../../src/models/room";
import { MatrixEvent } from "../../../src/models/event"; import { MatrixEvent } from "../../../src/models/event";
import { EventType, MsgType, UNSTABLE_MSC3089_BRANCH, UNSTABLE_MSC3089_LEAF } from "../../../src/@types/event"; import { EventType, MsgType, UNSTABLE_MSC3089_BRANCH, UNSTABLE_MSC3089_LEAF } from "../../../src/@types/event";
import { import {
@ -26,7 +26,7 @@ import {
import { DEFAULT_ALPHABET } from "../../../src/utils"; import { DEFAULT_ALPHABET } from "../../../src/utils";
import { MatrixError } from "../../../src/http-api"; import { MatrixError } from "../../../src/http-api";
import { KnownMembership } from "../../../src/@types/membership"; import { KnownMembership } from "../../../src/@types/membership";
import { EncryptedFile } from "../../../src/@types/media"; import { type EncryptedFile } from "../../../src/@types/media";
describe("MSC3089TreeSpace", () => { describe("MSC3089TreeSpace", () => {
let client: MatrixClient; let client: MatrixClient;

View File

@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { MockedObject } from "jest-mock"; import { type MockedObject } from "jest-mock";
import { MatrixEvent, MatrixEventEvent } from "../../../src/models/event"; import { MatrixEvent, MatrixEventEvent } from "../../../src/models/event";
import { emitPromise } from "../../test-utils/test-utils"; import { emitPromise } from "../../test-utils/test-utils";
import { Crypto, IEventDecryptionResult } from "../../../src/crypto"; import { type Crypto, type IEventDecryptionResult } from "../../../src/crypto";
import { import {
IAnnotatedPushRule, type IAnnotatedPushRule,
MatrixClient, type MatrixClient,
PushRuleActionName, PushRuleActionName,
Room, Room,
THREAD_RELATION_TYPE, THREAD_RELATION_TYPE,

View File

@ -16,7 +16,7 @@ limitations under the License.
import { M_POLL_START } from "matrix-events-sdk"; import { M_POLL_START } from "matrix-events-sdk";
import { EventType, IEvent, MatrixEvent, PollEvent, Room } from "../../../src"; import { EventType, type IEvent, MatrixEvent, PollEvent, Room } from "../../../src";
import { REFERENCE_RELATION } from "../../../src/@types/extensible_events"; import { REFERENCE_RELATION } from "../../../src/@types/extensible_events";
import { M_POLL_END, M_POLL_KIND_DISCLOSED, M_POLL_RESPONSE } from "../../../src/@types/polls"; import { M_POLL_END, M_POLL_KIND_DISCLOSED, M_POLL_RESPONSE } from "../../../src/@types/polls";
import { PollStartEvent } from "../../../src/extensible_events_v1/PollStartEvent"; import { PollStartEvent } from "../../../src/extensible_events_v1/PollStartEvent";

View File

@ -14,7 +14,14 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { FeatureSupport, MatrixClient, MatrixEvent, ReceiptContent, THREAD_RELATION_TYPE, Thread } from "../../../src"; import {
FeatureSupport,
type MatrixClient,
MatrixEvent,
type ReceiptContent,
THREAD_RELATION_TYPE,
Thread,
} from "../../../src";
import { Room } from "../../../src/models/room"; import { Room } from "../../../src/models/room";
/** /**

View File

@ -19,7 +19,7 @@ import { Feature, ServerSupport } from "../../src/feature";
import { import {
EventType, EventType,
fixNotificationCountOnDecryption, fixNotificationCountOnDecryption,
MatrixClient, type MatrixClient,
MatrixEvent, MatrixEvent,
MsgType, MsgType,
NotificationCountType, NotificationCountType,
@ -27,7 +27,7 @@ import {
Room, Room,
RoomEvent, RoomEvent,
} from "../../src/matrix"; } from "../../src/matrix";
import { IActionsObject } from "../../src/pushprocessor"; import { type IActionsObject } from "../../src/pushprocessor";
import { ReEmitter } from "../../src/ReEmitter"; import { ReEmitter } from "../../src/ReEmitter";
import { getMockClientWithEventEmitter, mockClientMethodsUser } from "../test-utils/client"; import { getMockClientWithEventEmitter, mockClientMethodsUser } from "../test-utils/client";
import { mkEvent, mock } from "../test-utils/test-utils"; import { mkEvent, mock } from "../test-utils/test-utils";

View File

@ -17,7 +17,7 @@ limitations under the License.
import fetchMockJest from "fetch-mock-jest"; import fetchMockJest from "fetch-mock-jest";
import { OidcError } from "../../../src/oidc/error"; import { OidcError } from "../../../src/oidc/error";
import { OidcRegistrationClientMetadata, registerOidcClient } from "../../../src/oidc/register"; import { type OidcRegistrationClientMetadata, registerOidcClient } from "../../../src/oidc/register";
import { makeDelegatedAuthConfig } from "../../test-utils/oidc"; import { makeDelegatedAuthConfig } from "../../test-utils/oidc";
describe("registerOidcClient()", () => { describe("registerOidcClient()", () => {

View File

@ -18,7 +18,7 @@ import { mocked } from "jest-mock";
import { jwtDecode } from "jwt-decode"; import { jwtDecode } from "jwt-decode";
import { logger } from "../../../src/logger"; import { logger } from "../../../src/logger";
import { ValidatedAuthMetadata, validateIdToken, validateAuthMetadata } from "../../../src/oidc/validate"; import { type ValidatedAuthMetadata, validateIdToken, validateAuthMetadata } from "../../../src/oidc/validate";
import { OidcError } from "../../../src/oidc/error"; import { OidcError } from "../../../src/oidc/error";
jest.mock("jwt-decode"); jest.mock("jwt-decode");

View File

@ -1,12 +1,12 @@
import * as utils from "../test-utils/test-utils"; import * as utils from "../test-utils/test-utils";
import { IActionsObject, PushProcessor } from "../../src/pushprocessor"; import { type IActionsObject, PushProcessor } from "../../src/pushprocessor";
import { import {
ConditionKind, ConditionKind,
EventType, EventType,
IContent, type IContent,
IPushRule, type IPushRule,
MatrixClient, type MatrixClient,
MatrixEvent, type MatrixEvent,
PushRuleActionName, PushRuleActionName,
RuleId, RuleId,
TweakName, TweakName,

View File

@ -17,11 +17,11 @@ limitations under the License.
import MockHttpBackend from "matrix-mock-request"; import MockHttpBackend from "matrix-mock-request";
import { indexedDB as fakeIndexedDB } from "fake-indexeddb"; import { indexedDB as fakeIndexedDB } from "fake-indexeddb";
import { IndexedDBStore, MatrixEvent, MemoryStore, Room } from "../../src"; import { IndexedDBStore, MatrixEvent, MemoryStore, type Room } from "../../src";
import { MatrixClient } from "../../src/client"; import { MatrixClient } from "../../src/client";
import { ToDeviceBatch } from "../../src/models/ToDeviceMessage"; import { type ToDeviceBatch } from "../../src/models/ToDeviceMessage";
import { logger } from "../../src/logger"; import { logger } from "../../src/logger";
import { IStore } from "../../src/store"; import { type IStore } from "../../src/store";
import { flushPromises } from "../test-utils/flushPromises"; import { flushPromises } from "../test-utils/flushPromises";
import { removeElement } from "../../src/utils"; import { removeElement } from "../../src/utils";

View File

@ -16,9 +16,9 @@ limitations under the License.
import MockHttpBackend from "matrix-mock-request"; import MockHttpBackend from "matrix-mock-request";
import { MAIN_ROOM_TIMELINE, ReceiptType, WrappedReceipt } from "../../src/@types/read_receipts"; import { MAIN_ROOM_TIMELINE, ReceiptType, type WrappedReceipt } from "../../src/@types/read_receipts";
import { MatrixClient } from "../../src/client"; import { MatrixClient } from "../../src/client";
import { EventType, MatrixEvent, RelationType, Room, threadIdForReceipt } from "../../src/matrix"; import { EventType, type MatrixEvent, RelationType, Room, threadIdForReceipt } from "../../src/matrix";
import { synthesizeReceipt } from "../../src/models/read-receipt"; import { synthesizeReceipt } from "../../src/models/read-receipt";
import { encodeUri } from "../../src/utils"; import { encodeUri } from "../../src/utils";
import * as utils from "../test-utils/test-utils"; import * as utils from "../test-utils/test-utils";

View File

@ -16,10 +16,10 @@ limitations under the License.
import { logger } from "../../../src/logger"; import { logger } from "../../../src/logger";
import { import {
RendezvousFailureListener, type RendezvousFailureListener,
RendezvousFailureReason, type RendezvousFailureReason,
RendezvousTransport, type RendezvousTransport,
RendezvousTransportDetails, type RendezvousTransportDetails,
} from "../../../src/rendezvous"; } from "../../../src/rendezvous";
import { sleep } from "../../../src/utils"; import { sleep } from "../../../src/utils";

View File

@ -16,7 +16,7 @@ limitations under the License.
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { ClientPrefix, IHttpOpts, MatrixClient, MatrixHttpApi } from "../../../src"; import { ClientPrefix, type IHttpOpts, type MatrixClient, MatrixHttpApi } from "../../../src";
import { ClientRendezvousFailureReason, MSC4108RendezvousSession } from "../../../src/rendezvous"; import { ClientRendezvousFailureReason, MSC4108RendezvousSession } from "../../../src/rendezvous";
function makeMockClient(opts: { userId: string; deviceId: string; msc4108Enabled: boolean }): MatrixClient { function makeMockClient(opts: { userId: string; deviceId: string; msc4108Enabled: boolean }): MatrixClient {

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { EstablishedEcies, QrCodeData, QrCodeMode, Ecies } from "@matrix-org/matrix-sdk-crypto-wasm"; import { type EstablishedEcies, QrCodeData, QrCodeMode, Ecies } from "@matrix-org/matrix-sdk-crypto-wasm";
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { MSC4108RendezvousSession, MSC4108SecureChannel, PayloadType } from "../../../../src/rendezvous"; import { MSC4108RendezvousSession, MSC4108SecureChannel, PayloadType } from "../../../../src/rendezvous";

View File

@ -21,8 +21,8 @@ import { RoomMember, RoomMemberEvent } from "../../src/models/room-member";
import { import {
createClient, createClient,
EventType, EventType,
MatrixClient, type MatrixClient,
RoomState, type RoomState,
UNSTABLE_MSC2666_MUTUAL_ROOMS, UNSTABLE_MSC2666_MUTUAL_ROOMS,
UNSTABLE_MSC2666_QUERY_MUTUAL_ROOMS, UNSTABLE_MSC2666_QUERY_MUTUAL_ROOMS,
UNSTABLE_MSC2666_SHARED_ROOMS, UNSTABLE_MSC2666_SHARED_ROOMS,

View File

@ -14,17 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { MockedObject } from "jest-mock"; import { type MockedObject } from "jest-mock";
import * as utils from "../test-utils/test-utils"; import * as utils from "../test-utils/test-utils";
import { makeBeaconEvent, makeBeaconInfoEvent } from "../test-utils/beacon"; import { makeBeaconEvent, makeBeaconInfoEvent } from "../test-utils/beacon";
import { filterEmitCallsByEventType } from "../test-utils/emitter"; import { filterEmitCallsByEventType } from "../test-utils/emitter";
import { RoomState, RoomStateEvent } from "../../src/models/room-state"; import { RoomState, RoomStateEvent } from "../../src/models/room-state";
import { Beacon, BeaconEvent, getBeaconInfoIdentifier } from "../../src/models/beacon"; import { type Beacon, BeaconEvent, getBeaconInfoIdentifier } from "../../src/models/beacon";
import { EventType, RelationType, UNSTABLE_MSC2716_MARKER } from "../../src/@types/event"; import { EventType, RelationType, UNSTABLE_MSC2716_MARKER } from "../../src/@types/event";
import { MatrixEvent, MatrixEventEvent } from "../../src/models/event"; import { MatrixEvent, MatrixEventEvent } from "../../src/models/event";
import { M_BEACON } from "../../src/@types/beacon"; import { M_BEACON } from "../../src/@types/beacon";
import { MatrixClient } from "../../src/client"; import { type MatrixClient } from "../../src/client";
import { defer } from "../../src/utils"; import { defer } from "../../src/utils";
import { Room } from "../../src/models/room"; import { Room } from "../../src/models/room";
import { KnownMembership } from "../../src/@types/membership"; import { KnownMembership } from "../../src/@types/membership";

View File

@ -19,41 +19,41 @@ limitations under the License.
*/ */
import { mocked } from "jest-mock"; import { mocked } from "jest-mock";
import { M_POLL_KIND_DISCLOSED, M_POLL_RESPONSE, M_POLL_START, Optional, PollStartEvent } from "matrix-events-sdk"; import { M_POLL_KIND_DISCLOSED, M_POLL_RESPONSE, M_POLL_START, type Optional, PollStartEvent } from "matrix-events-sdk";
import * as utils from "../test-utils/test-utils"; import * as utils from "../test-utils/test-utils";
import { emitPromise, IMessageOpts } from "../test-utils/test-utils"; import { emitPromise, type IMessageOpts } from "../test-utils/test-utils";
import { import {
Direction, Direction,
DuplicateStrategy, DuplicateStrategy,
EventStatus, EventStatus,
EventTimelineSet, type EventTimelineSet,
EventType, EventType,
Filter, Filter,
FILTER_RELATED_BY_REL_TYPES, FILTER_RELATED_BY_REL_TYPES,
FILTER_RELATED_BY_SENDERS, FILTER_RELATED_BY_SENDERS,
IContent, type IContent,
IEvent, type IEvent,
IRelationsRequestOpts, type IRelationsRequestOpts,
IStateEventWithRoomId, type IStateEventWithRoomId,
JoinRule, JoinRule,
MatrixClient, type MatrixClient,
MatrixEvent, MatrixEvent,
MatrixEventEvent, MatrixEventEvent,
PendingEventOrdering, PendingEventOrdering,
PollEvent, PollEvent,
RelationType, RelationType,
RoomEvent, RoomEvent,
RoomMember, type RoomMember,
} from "../../src"; } from "../../src";
import { EventTimeline } from "../../src/models/event-timeline"; import { EventTimeline } from "../../src/models/event-timeline";
import { NotificationCountType, Room } from "../../src/models/room"; import { NotificationCountType, Room } from "../../src/models/room";
import { RoomState } from "../../src/models/room-state"; import { RoomState } from "../../src/models/room-state";
import { UNSTABLE_ELEMENT_FUNCTIONAL_USERS } from "../../src/@types/event"; import { UNSTABLE_ELEMENT_FUNCTIONAL_USERS } from "../../src/@types/event";
import { TestClient } from "../TestClient"; import { TestClient } from "../TestClient";
import { ReceiptType, WrappedReceipt } from "../../src/@types/read_receipts"; import { ReceiptType, type WrappedReceipt } from "../../src/@types/read_receipts";
import { FeatureSupport, Thread, THREAD_RELATION_TYPE, ThreadEvent } from "../../src/models/thread"; import { FeatureSupport, Thread, THREAD_RELATION_TYPE, ThreadEvent } from "../../src/models/thread";
import { Crypto } from "../../src/crypto"; import { type Crypto } from "../../src/crypto";
import * as threadUtils from "../test-utils/thread"; import * as threadUtils from "../test-utils/thread";
import { getMockClientWithEventEmitter, mockClientMethodsUser } from "../test-utils/client"; import { getMockClientWithEventEmitter, mockClientMethodsUser } from "../test-utils/client";
import { logger } from "../../src/logger"; import { logger } from "../../src/logger";

View File

@ -14,12 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { Mocked } from "jest-mock"; import { type Mocked } from "jest-mock";
import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm"; import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
import { CrossSigningIdentity } from "../../../src/rust-crypto/CrossSigningIdentity"; import { CrossSigningIdentity } from "../../../src/rust-crypto/CrossSigningIdentity";
import { OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor"; import { type OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor";
import { ServerSideSecretStorage } from "../../../src/secret-storage"; import { type ServerSideSecretStorage } from "../../../src/secret-storage";
describe("CrossSigningIdentity", () => { describe("CrossSigningIdentity", () => {
describe("bootstrapCrossSigning", () => { describe("bootstrapCrossSigning", () => {

View File

@ -14,15 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { Mocked } from "jest-mock"; import { type Mocked } from "jest-mock";
import { KeysClaimRequest, UserId } from "@matrix-org/matrix-sdk-crypto-wasm"; import { KeysClaimRequest, UserId } from "@matrix-org/matrix-sdk-crypto-wasm";
import type * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
import { OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor"; import { OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor";
import { KeyClaimManager } from "../../../src/rust-crypto/KeyClaimManager"; import { KeyClaimManager } from "../../../src/rust-crypto/KeyClaimManager";
import { TypedEventEmitter } from "../../../src/models/typed-event-emitter"; import { TypedEventEmitter } from "../../../src/models/typed-event-emitter";
import { HttpApiEvent, HttpApiEventHandlerMap, MatrixHttpApi } from "../../../src"; import { type HttpApiEvent, type HttpApiEventHandlerMap, MatrixHttpApi } from "../../../src";
import { logger, LogSpan } from "../../../src/logger"; import { logger, LogSpan } from "../../../src/logger";
afterEach(() => { afterEach(() => {

View File

@ -15,7 +15,7 @@ limitations under the License.
*/ */
import MockHttpBackend from "matrix-mock-request"; import MockHttpBackend from "matrix-mock-request";
import { Mocked } from "jest-mock"; import { type Mocked } from "jest-mock";
import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm"; import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
import { import {
KeysBackupRequest, KeysBackupRequest,
@ -31,7 +31,13 @@ import {
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { TypedEventEmitter } from "../../../src"; import { TypedEventEmitter } from "../../../src";
import { HttpApiEvent, HttpApiEventHandlerMap, IHttpOpts, MatrixHttpApi, UIAuthCallback } from "../../../src"; import {
type HttpApiEvent,
type HttpApiEventHandlerMap,
type IHttpOpts,
MatrixHttpApi,
type UIAuthCallback,
} from "../../../src";
import { OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor"; import { OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor";
import { defer } from "../../../src/utils"; import { defer } from "../../../src/utils";

View File

@ -14,12 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { Mocked } from "jest-mock"; import { type Mocked } from "jest-mock";
import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm"; import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
import { OutgoingRequest, OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor"; import { type OutgoingRequest, type OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor";
import { OutgoingRequestsManager } from "../../../src/rust-crypto/OutgoingRequestsManager"; import { OutgoingRequestsManager } from "../../../src/rust-crypto/OutgoingRequestsManager";
import { defer, IDeferred } from "../../../src/utils"; import { defer, type IDeferred } from "../../../src/utils";
import { logger } from "../../../src/logger"; import { logger } from "../../../src/logger";
describe("OutgoingRequestsManager", () => { describe("OutgoingRequestsManager", () => {

View File

@ -14,28 +14,32 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { Mocked, SpyInstance } from "jest-mock"; import { type Mocked, type SpyInstance } from "jest-mock";
import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm"; import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
import { OlmMachine } from "@matrix-org/matrix-sdk-crypto-wasm"; import { type OlmMachine } from "@matrix-org/matrix-sdk-crypto-wasm";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { PerSessionKeyBackupDownloader } from "../../../src/rust-crypto/PerSessionKeyBackupDownloader"; import { PerSessionKeyBackupDownloader } from "../../../src/rust-crypto/PerSessionKeyBackupDownloader";
import { logger } from "../../../src/logger"; import { logger } from "../../../src/logger";
import { defer, IDeferred } from "../../../src/utils"; import { defer, type IDeferred } from "../../../src/utils";
import { RustBackupCryptoEventMap, RustBackupCryptoEvents, RustBackupManager } from "../../../src/rust-crypto/backup"; import {
type RustBackupCryptoEventMap,
type RustBackupCryptoEvents,
type RustBackupManager,
} from "../../../src/rust-crypto/backup";
import * as TestData from "../../test-utils/test-data"; import * as TestData from "../../test-utils/test-data";
import { import {
ConnectionError, ConnectionError,
HttpApiEvent, type HttpApiEvent,
HttpApiEventHandlerMap, type HttpApiEventHandlerMap,
IHttpOpts, type IHttpOpts,
IMegolmSessionData, type IMegolmSessionData,
MatrixHttpApi, MatrixHttpApi,
TypedEventEmitter, TypedEventEmitter,
} from "../../../src"; } from "../../../src";
import * as testData from "../../test-utils/test-data"; import * as testData from "../../test-utils/test-data";
import { BackupDecryptor } from "../../../src/common-crypto/CryptoBackend"; import { type BackupDecryptor } from "../../../src/common-crypto/CryptoBackend";
import { KeyBackupSession } from "../../../src/crypto-api/keybackup"; import { type KeyBackupSession } from "../../../src/crypto-api/keybackup";
import { CryptoEvent } from "../../../src/crypto-api/index.ts"; import { CryptoEvent } from "../../../src/crypto-api/index.ts";
describe("PerSessionKeyBackupDownloader", () => { describe("PerSessionKeyBackupDownloader", () => {

View File

@ -18,21 +18,25 @@
import { import {
CollectStrategy, CollectStrategy,
Curve25519PublicKey, type Curve25519PublicKey,
Ed25519PublicKey, type Ed25519PublicKey,
HistoryVisibility as RustHistoryVisibility, HistoryVisibility as RustHistoryVisibility,
IdentityKeys, type IdentityKeys,
OlmMachine, type OlmMachine,
} from "@matrix-org/matrix-sdk-crypto-wasm"; } from "@matrix-org/matrix-sdk-crypto-wasm";
import { Mocked } from "jest-mock"; import { type Mocked } from "jest-mock";
import { HistoryVisibility, MatrixEvent, Room, RoomMember } from "../../../src"; import { HistoryVisibility, type MatrixEvent, type Room, type RoomMember } from "../../../src";
import { RoomEncryptor, toRustHistoryVisibility } from "../../../src/rust-crypto/RoomEncryptor"; import { RoomEncryptor, toRustHistoryVisibility } from "../../../src/rust-crypto/RoomEncryptor";
import { KeyClaimManager } from "../../../src/rust-crypto/KeyClaimManager"; import { type KeyClaimManager } from "../../../src/rust-crypto/KeyClaimManager";
import { defer } from "../../../src/utils"; import { defer } from "../../../src/utils";
import { OutgoingRequestsManager } from "../../../src/rust-crypto/OutgoingRequestsManager"; import { type OutgoingRequestsManager } from "../../../src/rust-crypto/OutgoingRequestsManager";
import { KnownMembership } from "../../../src/@types/membership"; import { KnownMembership } from "../../../src/@types/membership";
import { DeviceIsolationMode, AllDevicesIsolationMode, OnlySignedDevicesIsolationMode } from "../../../src/crypto-api"; import {
type DeviceIsolationMode,
AllDevicesIsolationMode,
OnlySignedDevicesIsolationMode,
} from "../../../src/crypto-api";
describe("RoomEncryptor", () => { describe("RoomEncryptor", () => {
describe("History Visibility", () => { describe("History Visibility", () => {

View File

@ -1,13 +1,13 @@
import { Mocked } from "jest-mock"; import { type Mocked } from "jest-mock";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm"; import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-wasm";
import { HttpApiEvent, HttpApiEventHandlerMap, MatrixHttpApi, TypedEventEmitter } from "../../../src"; import { type HttpApiEvent, type HttpApiEventHandlerMap, MatrixHttpApi, TypedEventEmitter } from "../../../src";
import { CryptoEvent, KeyBackupSession } from "../../../src/crypto-api/index.ts"; import { CryptoEvent, type KeyBackupSession } from "../../../src/crypto-api/index.ts";
import { OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor"; import { type OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor";
import * as testData from "../../test-utils/test-data"; import * as testData from "../../test-utils/test-data";
import * as TestData from "../../test-utils/test-data"; import * as TestData from "../../test-utils/test-data";
import { RustBackupManager, KeyBackup } from "../../../src/rust-crypto/backup"; import { RustBackupManager, type KeyBackup } from "../../../src/rust-crypto/backup";
describe("Upload keys to backup", () => { describe("Upload keys to backup", () => {
/** The backup manager under test */ /** The backup manager under test */

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { DeviceKeys, DeviceVerification } from "../../../src"; import { type DeviceKeys, DeviceVerification } from "../../../src";
import { downloadDeviceToJsDevice } from "../../../src/rust-crypto/device-converter"; import { downloadDeviceToJsDevice } from "../../../src/rust-crypto/device-converter";
describe("device-converter", () => { describe("device-converter", () => {

View File

@ -20,50 +20,50 @@ import {
KeysQueryRequest, KeysQueryRequest,
Migration, Migration,
OlmMachine, OlmMachine,
PickledInboundGroupSession, type PickledInboundGroupSession,
PickledSession, type PickledSession,
StoreHandle, StoreHandle,
} from "@matrix-org/matrix-sdk-crypto-wasm"; } from "@matrix-org/matrix-sdk-crypto-wasm";
import { mocked, Mocked } from "jest-mock"; import { mocked, type Mocked } from "jest-mock";
import fetchMock from "fetch-mock-jest"; import fetchMock from "fetch-mock-jest";
import { RustCrypto } from "../../../src/rust-crypto/rust-crypto"; import { RustCrypto } from "../../../src/rust-crypto/rust-crypto";
import { initRustCrypto } from "../../../src/rust-crypto"; import { initRustCrypto } from "../../../src/rust-crypto";
import { import {
AccountDataEvents, type AccountDataEvents,
Device, type Device,
DeviceVerification, DeviceVerification,
EmptyObject, type EmptyObject,
encodeBase64, encodeBase64,
HttpApiEvent, type HttpApiEvent,
HttpApiEventHandlerMap, type HttpApiEventHandlerMap,
IHttpOpts, type IHttpOpts,
IToDeviceEvent, type IToDeviceEvent,
MatrixClient, type MatrixClient,
MatrixEvent, MatrixEvent,
MatrixHttpApi, MatrixHttpApi,
MemoryCryptoStore, MemoryCryptoStore,
TypedEventEmitter, TypedEventEmitter,
} from "../../../src"; } from "../../../src";
import { emitPromise, mkEvent } from "../../test-utils/test-utils"; import { emitPromise, mkEvent } from "../../test-utils/test-utils";
import { CryptoBackend } from "../../../src/common-crypto/CryptoBackend"; import { type CryptoBackend } from "../../../src/common-crypto/CryptoBackend";
import { IEventDecryptionResult, IMegolmSessionData } from "../../../src/@types/crypto"; import { type IEventDecryptionResult, type IMegolmSessionData } from "../../../src/@types/crypto";
import { OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor"; import { type OutgoingRequestProcessor } from "../../../src/rust-crypto/OutgoingRequestProcessor";
import { import {
AccountDataClient, type AccountDataClient,
AddSecretStorageKeyOpts, type AddSecretStorageKeyOpts,
SecretStorageCallbacks, type SecretStorageCallbacks,
ServerSideSecretStorage, type ServerSideSecretStorage,
ServerSideSecretStorageImpl, ServerSideSecretStorageImpl,
} from "../../../src/secret-storage"; } from "../../../src/secret-storage";
import { import {
CryptoCallbacks, type CryptoCallbacks,
EventShieldColour, EventShieldColour,
EventShieldReason, EventShieldReason,
ImportRoomKeysOpts, type ImportRoomKeysOpts,
KeyBackupCheck, type KeyBackupCheck,
KeyBackupInfo, type KeyBackupInfo,
VerificationRequest, type VerificationRequest,
} from "../../../src/crypto-api"; } from "../../../src/crypto-api";
import * as testData from "../../test-utils/test-data"; import * as testData from "../../test-utils/test-data";
import { E2EKeyReceiver } from "../../test-utils/E2EKeyReceiver"; import { E2EKeyReceiver } from "../../test-utils/E2EKeyReceiver";
@ -71,10 +71,10 @@ import { E2EKeyResponder } from "../../test-utils/E2EKeyResponder";
import { defer } from "../../../src/utils"; import { defer } from "../../../src/utils";
import { logger } from "../../../src/logger"; import { logger } from "../../../src/logger";
import { OutgoingRequestsManager } from "../../../src/rust-crypto/OutgoingRequestsManager"; import { OutgoingRequestsManager } from "../../../src/rust-crypto/OutgoingRequestsManager";
import { ClientEvent, ClientEventHandlerMap } from "../../../src/client"; import { ClientEvent, type ClientEventHandlerMap } from "../../../src/client";
import { Curve25519AuthData } from "../../../src/crypto-api/keybackup"; import { type Curve25519AuthData } from "../../../src/crypto-api/keybackup";
import encryptAESSecretStorageItem from "../../../src/utils/encryptAESSecretStorageItem.ts"; import encryptAESSecretStorageItem from "../../../src/utils/encryptAESSecretStorageItem.ts";
import { CryptoStore, SecretStorePrivateKeys } from "../../../src/crypto/store/base"; import { type CryptoStore, type SecretStorePrivateKeys } from "../../../src/crypto/store/base";
import { CryptoEvent } from "../../../src/crypto-api/index.ts"; import { CryptoEvent } from "../../../src/crypto-api/index.ts";
import { RustBackupManager } from "../../../src/rust-crypto/backup.ts"; import { RustBackupManager } from "../../../src/rust-crypto/backup.ts";

View File

@ -18,8 +18,8 @@ import {
secretStorageCanAccessSecrets, secretStorageCanAccessSecrets,
secretStorageContainsCrossSigningKeys, secretStorageContainsCrossSigningKeys,
} from "../../../src/rust-crypto/secret-storage"; } from "../../../src/rust-crypto/secret-storage";
import { ServerSideSecretStorage } from "../../../src/secret-storage"; import { type ServerSideSecretStorage } from "../../../src/secret-storage";
import { SecretInfo } from "../../../src/secret-storage.ts"; import { type SecretInfo } from "../../../src/secret-storage.ts";
declare module "../../../src/@types/event" { declare module "../../../src/@types/event" {
interface SecretStorageAccountDataEvents { interface SecretStorageAccountDataEvents {

Some files were not shown because too many files have changed in this diff Show More