Consume more imports from matrix-js-sdk/src/matrix (#11449)

This commit is contained in:
Michael Telatynski 2023-08-23 10:04:25 +01:00 committed by GitHub
parent aa6e3654b8
commit 99e80dd296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
89 changed files with 236 additions and 172 deletions

View file

@ -17,9 +17,16 @@ limitations under the License.
import React, { createRef, ReactNode, TransitionEvent } from "react";
import ReactDOM from "react-dom";
import classNames from "classnames";
import { Room, MatrixClient, RoomStateEvent, EventStatus, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix";
import {
Room,
MatrixClient,
RoomStateEvent,
EventStatus,
MatrixEvent,
EventType,
M_BEACON_INFO,
} from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon";
import { isSupportedReceiptType } from "matrix-js-sdk/src/utils";
import { Optional } from "matrix-events-sdk";

View file

@ -37,10 +37,10 @@ import {
TimelineWindow,
Thread,
ThreadEvent,
ReceiptType,
} from "matrix-js-sdk/src/matrix";
import { debounce, findLastIndex, throttle } from "lodash";
import { logger } from "matrix-js-sdk/src/logger";
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
import SettingsStore from "../../settings/SettingsStore";
import { Layout } from "../../settings/enums/Layout";

View file

@ -26,11 +26,11 @@ import {
MatrixClient,
SSOFlow,
SSOAction,
RegisterResponse,
} from "matrix-js-sdk/src/matrix";
import React, { Fragment, ReactNode } from "react";
import classNames from "classnames";
import { logger } from "matrix-js-sdk/src/logger";
import { RegisterResponse } from "matrix-js-sdk/src/@types/registration";
import { _t } from "../../../languageHandler";
import { adminContactStrings, messageForResourceLimitError, resourceLimitStrings } from "../../../utils/ErrorUtils";

View file

@ -26,8 +26,8 @@ import {
RelationType,
Relations,
Thread,
M_POLL_START,
} from "matrix-js-sdk/src/matrix";
import { M_POLL_START } from "matrix-js-sdk/src/@types/polls";
import { MatrixClientPeg } from "../../../MatrixClientPeg";
import dis from "../../../dispatcher/dispatcher";

View file

@ -24,9 +24,11 @@ import {
EventType,
MatrixClient,
ContentHelpers,
ILocationContent,
LocationAssetType,
M_TIMESTAMP,
M_BEACON,
} from "matrix-js-sdk/src/matrix";
import { ILocationContent, LocationAssetType, M_TIMESTAMP } from "matrix-js-sdk/src/@types/location";
import { M_BEACON } from "matrix-js-sdk/src/@types/beacon";
import { _t } from "../../../languageHandler";
import dis from "../../../dispatcher/dispatcher";

View file

@ -14,9 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { NotificationCountType, Room, Thread } from "matrix-js-sdk/src/matrix";
import { NotificationCountType, Room, Thread, ReceiptType } from "matrix-js-sdk/src/matrix";
import React, { useContext } from "react";
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
import { ReadReceipt } from "matrix-js-sdk/src/models/read-receipt";
import MatrixClientContext from "../../../../contexts/MatrixClientContext";

View file

@ -15,15 +15,16 @@ limitations under the License.
*/
import React, { ChangeEvent, createRef } from "react";
import { Room, MatrixEvent } from "matrix-js-sdk/src/matrix";
import {
Room,
MatrixEvent,
KnownPollKind,
M_POLL_KIND_DISCLOSED,
M_POLL_KIND_UNDISCLOSED,
M_POLL_START,
} from "matrix-js-sdk/src/@types/polls";
IPartialEvent,
} from "matrix-js-sdk/src/matrix";
import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent";
import { IPartialEvent } from "matrix-js-sdk/src/@types/extensible_events";
import ScrollableBaseModal, { IScrollableBaseState } from "../dialogs/ScrollableBaseModal";
import QuestionDialog from "../dialogs/QuestionDialog";

View file

@ -17,9 +17,15 @@ limitations under the License.
import React from "react";
import { chunk } from "lodash";
import classNames from "classnames";
import { MatrixClient, IdentityProviderBrand, SSOFlow, SSOAction } from "matrix-js-sdk/src/matrix";
import {
MatrixClient,
IdentityProviderBrand,
SSOFlow,
SSOAction,
IIdentityProvider,
DELEGATED_OIDC_COMPATIBILITY,
} from "matrix-js-sdk/src/matrix";
import { Signup } from "@matrix-org/analytics-events/types/typescript/Signup";
import { IIdentityProvider, DELEGATED_OIDC_COMPATIBILITY } from "matrix-js-sdk/src/@types/auth";
import PlatformPeg from "../../../PlatformPeg";
import AccessibleButton from "./AccessibleButton";

View file

@ -24,9 +24,9 @@ import {
RelationType,
IRedactOpts,
ContentHelpers,
M_BEACON,
} from "matrix-js-sdk/src/matrix";
import { randomString } from "matrix-js-sdk/src/randomstring";
import { M_BEACON } from "matrix-js-sdk/src/@types/beacon";
import classNames from "classnames";
import MatrixClientContext from "../../../contexts/MatrixClientContext";

View file

@ -16,8 +16,16 @@ limitations under the License.
import React, { ReactNode } from "react";
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixEvent, MatrixClient, Relations, Poll, PollEvent } from "matrix-js-sdk/src/matrix";
import { M_POLL_KIND_DISCLOSED, M_POLL_RESPONSE, M_POLL_START } from "matrix-js-sdk/src/@types/polls";
import {
MatrixEvent,
MatrixClient,
Relations,
Poll,
PollEvent,
M_POLL_KIND_DISCLOSED,
M_POLL_RESPONSE,
M_POLL_START,
} from "matrix-js-sdk/src/matrix";
import { RelatedRelations } from "matrix-js-sdk/src/models/related-relations";
import { PollStartEvent, PollAnswerSubevent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent";
import { PollResponseEvent } from "matrix-js-sdk/src/extensible_events_v1/PollResponseEvent";

View file

@ -15,8 +15,7 @@ limitations under the License.
*/
import React, { useEffect, useState, useContext, ForwardRefExoticComponent } from "react";
import { MatrixEvent } from "matrix-js-sdk/src/matrix";
import { M_TEXT } from "matrix-js-sdk/src/@types/extensible_events";
import { MatrixEvent, M_TEXT } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { Icon as PollIcon } from "../../../../res/img/element-icons/room/composer/poll.svg";

View file

@ -17,9 +17,15 @@ limitations under the License.
*/
import React, { ReactElement, useCallback, useContext, useEffect } from "react";
import { EventStatus, MatrixEvent, MatrixEventEvent, MsgType, RelationType } from "matrix-js-sdk/src/matrix";
import {
EventStatus,
MatrixEvent,
MatrixEventEvent,
MsgType,
RelationType,
M_BEACON_INFO,
} from "matrix-js-sdk/src/matrix";
import classNames from "classnames";
import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon";
import { Icon as ContextMenuIcon } from "../../../../res/img/element-icons/context-menu.svg";
import { Icon as EditIcon } from "../../../../res/img/element-icons/room/message-bar/edit.svg";

View file

@ -15,10 +15,15 @@ limitations under the License.
*/
import React, { createRef } from "react";
import { EventType, MsgType, MatrixEventEvent } from "matrix-js-sdk/src/matrix";
import { M_BEACON_INFO } from "matrix-js-sdk/src/@types/beacon";
import { M_LOCATION } from "matrix-js-sdk/src/@types/location";
import { M_POLL_END, M_POLL_START } from "matrix-js-sdk/src/@types/polls";
import {
EventType,
MsgType,
MatrixEventEvent,
M_BEACON_INFO,
M_LOCATION,
M_POLL_END,
M_POLL_START,
} from "matrix-js-sdk/src/matrix";
import SettingsStore from "../../../settings/SettingsStore";
import { Mjolnir } from "../../../mjolnir/Mjolnir";

View file

@ -15,8 +15,8 @@ limitations under the License.
*/
import { useCallback, useEffect, useState } from "react";
import { M_POLL_START } from "matrix-js-sdk/src/@types/polls";
import {
M_POLL_START,
MatrixClient,
Direction,
EventTimeline,

View file

@ -15,8 +15,7 @@ limitations under the License.
*/
import classNames from "classnames";
import { IEventRelation, Room, MatrixClient, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix";
import { M_POLL_START } from "matrix-js-sdk/src/@types/polls";
import { IEventRelation, Room, MatrixClient, THREAD_RELATION_TYPE, M_POLL_START } from "matrix-js-sdk/src/matrix";
import React, { createContext, ReactElement, ReactNode, useContext, useRef } from "react";
import { _t } from "../../../languageHandler";

View file

@ -15,10 +15,17 @@ limitations under the License.
*/
import React, { ReactNode } from "react";
import { IAnnotatedPushRule, IPusher, PushRuleAction, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix";
import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import {
IAnnotatedPushRule,
IPusher,
PushRuleAction,
PushRuleKind,
RuleId,
IThreepid,
ThreepidMedium,
LocalNotificationSettings,
} from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications";
import Spinner from "../elements/Spinner";
import { MatrixClientPeg } from "../../../MatrixClientPeg";

View file

@ -16,7 +16,7 @@ limitations under the License.
import React, { ReactNode } from "react";
import { logger } from "matrix-js-sdk/src/logger";
import { IThreepid } from "matrix-js-sdk/src/@types/threepids";
import { IThreepid } from "matrix-js-sdk/src/matrix";
import { _t } from "../../../languageHandler";
import { MatrixClientPeg } from "../../../MatrixClientPeg";

View file

@ -16,9 +16,8 @@ limitations under the License.
*/
import React from "react";
import { ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import { ThreepidMedium, MatrixError } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { MatrixError } from "matrix-js-sdk/src/matrix";
import { _t, UserFriendlyError } from "../../../../languageHandler";
import { MatrixClientPeg } from "../../../../MatrixClientPeg";

View file

@ -16,7 +16,7 @@ limitations under the License.
*/
import React from "react";
import { ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import { ThreepidMedium } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { _t, UserFriendlyError } from "../../../../languageHandler";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import React, { useState } from "react";
import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications";
import { LocalNotificationSettings } from "matrix-js-sdk/src/matrix";
import { _t } from "../../../../languageHandler";
import Spinner from "../../elements/Spinner";

View file

@ -16,8 +16,7 @@ limitations under the License.
import React from "react";
import classNames from "classnames";
import { IPusher, PUSHER_ENABLED } from "matrix-js-sdk/src/matrix";
import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications";
import { IPusher, PUSHER_ENABLED, LocalNotificationSettings } from "matrix-js-sdk/src/matrix";
import { formatDate } from "../../../../DateUtils";
import { _t } from "../../../../languageHandler";

View file

@ -15,8 +15,7 @@ limitations under the License.
*/
import React, { ForwardedRef, forwardRef } from "react";
import { IPusher, PUSHER_DEVICE_ID } from "matrix-js-sdk/src/matrix";
import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications";
import { IPusher, PUSHER_DEVICE_ID, LocalNotificationSettings } from "matrix-js-sdk/src/matrix";
import { _t } from "../../../../languageHandler";
import AccessibleButton from "../../elements/AccessibleButton";

View file

@ -26,10 +26,10 @@ import {
PUSHER_ENABLED,
UNSTABLE_MSC3852_LAST_SEEN_UA,
MatrixError,
LocalNotificationSettings,
} from "matrix-js-sdk/src/matrix";
import { VerificationRequest } from "matrix-js-sdk/src/crypto-api";
import { logger } from "matrix-js-sdk/src/logger";
import { LocalNotificationSettings } from "matrix-js-sdk/src/@types/local_notifications";
import { CryptoEvent } from "matrix-js-sdk/src/crypto";
import MatrixClientContext from "../../../../contexts/MatrixClientContext";

View file

@ -14,8 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import { IPusher } from "matrix-js-sdk/src/matrix";
import { ThreepidMedium, IPusher } from "matrix-js-sdk/src/matrix";
import React, { useCallback, useMemo } from "react";
import { useMatrixClientContext } from "../../../../contexts/MatrixClientContext";

View file

@ -17,8 +17,7 @@ limitations under the License.
*/
import React, { ReactNode } from "react";
import { SERVICE_TYPES, HTTPError } from "matrix-js-sdk/src/matrix";
import { IThreepid, ThreepidMedium } from "matrix-js-sdk/src/@types/threepids";
import { SERVICE_TYPES, HTTPError, IThreepid, ThreepidMedium } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { Icon as WarningIcon } from "../../../../../../res/img/feather-customised/warning-triangle.svg";