Merge remote-tracking branch 'origin/develop' into dbkr/key_storage_toggle

This commit is contained in:
David Baker
2025-02-06 14:11:56 +01:00
1418 changed files with 4680 additions and 4185 deletions

View File

@@ -9,10 +9,10 @@ Please see LICENSE files in the repository root for full details.
import EventEmitter from "events";
import { SimpleObservable } from "matrix-widget-api";
import { Playback, PlaybackState } from "../../src/audio/Playback";
import { PlaybackClock } from "../../src/audio/PlaybackClock";
import { type Playback, PlaybackState } from "../../src/audio/Playback";
import { type PlaybackClock } from "../../src/audio/PlaybackClock";
import { UPDATE_EVENT } from "../../src/stores/AsyncStore";
import { PublicInterface } from "../@types/common";
import { type PublicInterface } from "../@types/common";
export const createTestPlayback = (overrides: Partial<Playback> = {}): Playback => {
const eventEmitter = new EventEmitter();

View File

@@ -6,14 +6,14 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { MockedObject } from "jest-mock";
import { type MockedObject } from "jest-mock";
import {
MatrixClient,
type MatrixClient,
MatrixEvent,
Beacon,
type Beacon,
getBeaconInfoIdentifier,
ContentHelpers,
LocationAssetType,
type LocationAssetType,
M_BEACON,
M_BEACON_INFO,
} from "matrix-js-sdk/src/matrix";

View File

@@ -10,7 +10,7 @@ import { MatrixWidgetType } from "matrix-widget-api";
import type { GroupCall, Room, RoomMember, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { mkEvent } from "./test-utils";
import { Call, ConnectionState, ElementCall, JitsiCall } from "../../src/models/Call";
import { Call, type ConnectionState, ElementCall, JitsiCall } from "../../src/models/Call";
import { CallStore } from "../../src/stores/CallStore";
export class MockedCall extends Call {

View File

@@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details.
*/
import EventEmitter from "events";
import { MethodLikeKeys, mocked, MockedObject, PropertyLikeKeys } from "jest-mock";
import { type MethodLikeKeys, mocked, type MockedObject, type PropertyLikeKeys } from "jest-mock";
import { Feature, ServerSupport } from "matrix-js-sdk/src/feature";
import { MatrixClient, Room, MatrixError, User } from "matrix-js-sdk/src/matrix";
import { type MatrixClient, type Room, MatrixError, User } from "matrix-js-sdk/src/matrix";
import { MatrixClientPeg } from "../../src/MatrixClientPeg";

View File

@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { act, fireEvent, RenderResult } from "jest-matrix-react";
import { act, fireEvent, type RenderResult } from "jest-matrix-react";
import userEvent from "@testing-library/user-event";
export const addTextToComposer = (container: HTMLElement, text: string) =>

View File

@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { RenderResult, screen, waitFor } from "jest-matrix-react";
import { type RenderResult, screen, waitFor } from "jest-matrix-react";
export * from "./beacon";
export * from "./client";

View File

@@ -6,9 +6,9 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import React, { ReactElement } from "react";
import React, { type ReactElement } from "react";
// eslint-disable-next-line no-restricted-imports
import { render, RenderOptions } from "@testing-library/react";
import { render, type RenderOptions } from "@testing-library/react";
import { TooltipProvider } from "@vector-im/compound-web";
const wrapWithTooltipProvider = (Wrapper: RenderOptions["wrapper"]) => {

View File

@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { LocationAssetType, M_LOCATION, MatrixEvent, EventType, ContentHelpers } from "matrix-js-sdk/src/matrix";
import { type LocationAssetType, M_LOCATION, MatrixEvent, EventType, ContentHelpers } from "matrix-js-sdk/src/matrix";
let id = 1;
export const makeLegacyLocationEvent = (geoUri: string): MatrixEvent => {

View File

@@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { MethodLikeKeys, mocked, MockedObject } from "jest-mock";
import { type MethodLikeKeys, mocked, type MockedObject } from "jest-mock";
import BasePlatform from "../../src/BasePlatform";
import PlatformPeg from "../../src/PlatformPeg";

View File

@@ -6,13 +6,13 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { Mocked } from "jest-mock";
import { type Mocked } from "jest-mock";
import {
MatrixClient,
type MatrixClient,
MatrixEvent,
Room,
M_POLL_START,
PollAnswer,
type PollAnswer,
M_POLL_KIND_DISCLOSED,
M_POLL_END,
M_POLL_RESPONSE,

View File

@@ -6,7 +6,13 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { IAnnotatedPushRule, IPushRule, IPushRules, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix";
import {
type IAnnotatedPushRule,
type IPushRule,
type IPushRules,
type PushRuleKind,
type RuleId,
} from "matrix-js-sdk/src/matrix";
/**
* Default set of push rules for a new account

View File

@@ -6,10 +6,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { Relations } from "matrix-js-sdk/src/matrix";
import { RelationsContainer } from "matrix-js-sdk/src/models/relations-container";
import { type Relations } from "matrix-js-sdk/src/matrix";
import { type RelationsContainer } from "matrix-js-sdk/src/models/relations-container";
import { PublicInterface } from "../@types/common";
import { type PublicInterface } from "../@types/common";
export const mkRelations = (): Relations => {
return {} as PublicInterface<Relations> as Relations;

View File

@@ -6,11 +6,11 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { MockedObject } from "jest-mock";
import { EventTimeline, EventType, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { type MockedObject } from "jest-mock";
import { type EventTimeline, EventType, type MatrixClient, type MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import { KnownMembership } from "matrix-js-sdk/src/types";
import { IRoomState, MainSplitContentType } from "../../src/components/structures/RoomView";
import { type IRoomState, MainSplitContentType } from "../../src/components/structures/RoomView";
import { TimelineRenderingType } from "../../src/contexts/RoomContext";
import { Layout } from "../../src/settings/enums/Layout";
import { mkEvent } from "./test-utils";

View File

@@ -7,43 +7,43 @@ Please see LICENSE files in the repository root for full details.
*/
import EventEmitter from "events";
import { mocked, MockedObject } from "jest-mock";
import { mocked, type MockedObject } from "jest-mock";
import {
MatrixEvent,
Room,
User,
IContent,
IEvent,
RoomMember,
MatrixClient,
EventTimeline,
RoomState,
type Room,
type User,
type IContent,
type IEvent,
type RoomMember,
type MatrixClient,
type EventTimeline,
type RoomState,
EventType,
IEventRelation,
IUnsigned,
IPusher,
type IEventRelation,
type IUnsigned,
type IPusher,
RoomType,
KNOWN_SAFE_ROOM_VERSION,
ConditionKind,
IPushRules,
type IPushRules,
RelationType,
JoinRule,
OidcClientConfig,
type OidcClientConfig,
type GroupCall,
} from "matrix-js-sdk/src/matrix";
import { KnownMembership } from "matrix-js-sdk/src/types";
import { normalize } from "matrix-js-sdk/src/utils";
import { ReEmitter } from "matrix-js-sdk/src/ReEmitter";
import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler";
import { type MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler";
import { Feature, ServerSupport } from "matrix-js-sdk/src/feature";
import { MapperOpts } from "matrix-js-sdk/src/event-mapper";
import { MatrixRTCSessionManager, MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc";
import { type MapperOpts } from "matrix-js-sdk/src/event-mapper";
import { type MatrixRTCSessionManager, type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc";
import type { GroupCall } from "matrix-js-sdk/src/matrix";
import type { Membership } from "matrix-js-sdk/src/types";
import { MatrixClientPeg as peg } from "../../src/MatrixClientPeg";
import { ValidatedServerConfig } from "../../src/utils/ValidatedServerConfig";
import { type ValidatedServerConfig } from "../../src/utils/ValidatedServerConfig";
import { EnhancedMap } from "../../src/utils/maps";
import { AsyncStoreWithClient } from "../../src/stores/AsyncStoreWithClient";
import { type AsyncStoreWithClient } from "../../src/stores/AsyncStoreWithClient";
import MatrixClientBackedSettingsHandler from "../../src/settings/handlers/MatrixClientBackedSettingsHandler";
/**

View File

@@ -6,9 +6,16 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import { MatrixClient, MatrixEvent, MatrixEventEvent, RelationType, Room, Thread } from "matrix-js-sdk/src/matrix";
import {
type MatrixClient,
type MatrixEvent,
MatrixEventEvent,
RelationType,
type Room,
type Thread,
} from "matrix-js-sdk/src/matrix";
import { mkMessage, MessageEventProps } from "./test-utils";
import { mkMessage, type MessageEventProps } from "./test-utils";
export const makeThreadEvent = ({
rootEventId,

View File

@@ -6,12 +6,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import EventEmitter from "events";
import { act } from "jest-matrix-react";
import { ActionPayload } from "../../src/dispatcher/payloads";
import type EventEmitter from "events";
import { type ActionPayload } from "../../src/dispatcher/payloads";
import defaultDispatcher from "../../src/dispatcher/dispatcher";
import { DispatcherAction } from "../../src/dispatcher/actions";
import { type DispatcherAction } from "../../src/dispatcher/actions";
import Modal from "../../src/Modal";
export const emitPromise = (e: EventEmitter, k: string | symbol) => new Promise((r) => e.once(k, r));

View File

@@ -6,13 +6,13 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/
import React, { ComponentType, Ref } from "react";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
import { RenderOptions } from "jest-matrix-react";
import React, { type ComponentType, type Ref } from "react";
import { type MatrixClient } from "matrix-js-sdk/src/matrix";
import { type RenderOptions } from "jest-matrix-react";
import { MatrixClientPeg as peg } from "../../src/MatrixClientPeg";
import MatrixClientContext from "../../src/contexts/MatrixClientContext";
import { SDKContext, SdkContextClass } from "../../src/contexts/SDKContext";
import { SDKContext, type SdkContextClass } from "../../src/contexts/SDKContext";
type WrapperProps<T> = { wrappedRef?: Ref<ComponentType<T>> } & T;