Switch to importing models/Room from main js-sdk export (#11361)

* Switch to importing TypedEventEmitter from main js-sdk export

* Switch to importing js-sdk/matrix in cypress

* Remove duplicated imports

* Fix lint:js-fix to run prettier last otherwise ESLint --fix may cause a mess

* Add lint rule

* Switch to importing models/Room from main js-sdk export

* Fix cypress-axe import

* Fix more imports

* Fix cypress-axe import

* Fix duplicated lint rule
This commit is contained in:
Michael Telatynski 2023-08-04 08:36:16 +01:00 committed by GitHub
parent 5ee8e61bf5
commit e67ca33c4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
233 changed files with 282 additions and 314 deletions

View file

@ -18,7 +18,7 @@ limitations under the License.
import React from "react";
import classNames from "classnames";
import { Resizable, Size } from "re-resizable";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { IWidget } from "matrix-widget-api";
import AppTile from "../elements/AppTile";

View file

@ -18,7 +18,7 @@ limitations under the License.
import React, { createRef, KeyboardEvent } from "react";
import classNames from "classnames";
import { flatMap } from "lodash";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import Autocompleter, { ICompletion, ISelectionRange, IProviderCompletions } from "../../../autocomplete/Autocompleter";
import SettingsStore from "../../../settings/SettingsStore";

View file

@ -16,7 +16,7 @@ limitations under the License.
import React, { ReactNode } from "react";
import { lexicographicCompare } from "matrix-js-sdk/src/utils";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { throttle } from "lodash";
import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";

View file

@ -16,7 +16,7 @@ limitations under the License.
import classNames from "classnames";
import React, { createRef, ClipboardEvent, SyntheticEvent } from "react";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import EMOTICON_REGEX from "emojibase-regex/emoticon";
import { logger } from "matrix-js-sdk/src/logger";

View file

@ -18,7 +18,7 @@ import React, { createRef, KeyboardEvent } from "react";
import classNames from "classnames";
import { EventStatus, IContent, MatrixEvent } from "matrix-js-sdk/src/models/event";
import { MsgType } from "matrix-js-sdk/src/@types/event";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { Composer as ComposerEvent } from "@matrix-org/analytics-events/types/typescript/Composer";

View file

@ -23,7 +23,7 @@ import { Relations } from "matrix-js-sdk/src/models/relations";
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
import { Thread, ThreadEvent } from "matrix-js-sdk/src/models/thread";
import { logger } from "matrix-js-sdk/src/logger";
import { NotificationCountType, Room, RoomEvent } from "matrix-js-sdk/src/models/room";
import { NotificationCountType, Room, RoomEvent } from "matrix-js-sdk/src/matrix";
import { CallErrorCode } from "matrix-js-sdk/src/webrtc/call";
import { CryptoEvent } from "matrix-js-sdk/src/crypto";
import { UserTrustLevel } from "matrix-js-sdk/src/crypto/CrossSigning";

View file

@ -23,7 +23,7 @@ import { CallType } from "matrix-js-sdk/src/webrtc/call";
import { ISearchResults } from "matrix-js-sdk/src/@types/search";
import type { MatrixEvent } from "matrix-js-sdk/src/models/event";
import type { Room } from "matrix-js-sdk/src/models/room";
import type { Room } from "matrix-js-sdk/src/matrix";
import { _t } from "../../../languageHandler";
import defaultDispatcher from "../../../dispatcher/dispatcher";
import { Action } from "../../../dispatcher/actions";

View file

@ -19,7 +19,7 @@ limitations under the License.
import React from "react";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room, RoomEvent } from "matrix-js-sdk/src/models/room";
import { Room, RoomEvent } from "matrix-js-sdk/src/matrix";
import { RoomMember, RoomMemberEvent } from "matrix-js-sdk/src/models/room-member";
import { RoomState, RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
import { User, UserEvent } from "matrix-js-sdk/src/models/user";

View file

@ -17,7 +17,7 @@ limitations under the License.
import React, { createRef, ReactNode } from "react";
import classNames from "classnames";
import { IEventRelation, MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { Optional } from "matrix-events-sdk";

View file

@ -18,7 +18,7 @@ import classNames from "classnames";
import { IEventRelation } from "matrix-js-sdk/src/models/event";
import { M_POLL_START } from "matrix-js-sdk/src/@types/polls";
import React, { createContext, ReactElement, ReactNode, useContext, useRef } from "react";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread";

View file

@ -17,7 +17,7 @@ limitations under the License.
import React, { useContext } from "react";
import { EventType } from "matrix-js-sdk/src/@types/event";
import { MatrixClient } from "matrix-js-sdk/src/client";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { User } from "matrix-js-sdk/src/models/user";
import MatrixClientContext from "../../../contexts/MatrixClientContext";

View file

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import React from "react";
import { useUnreadNotifications } from "../../../../hooks/useUnreadNotifications";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import React from "react";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { CSSTransition } from "react-transition-group";
import { BreadcrumbsStore } from "../../../stores/BreadcrumbsStore";

View file

@ -17,7 +17,7 @@ limitations under the License.
import React from "react";
import { Body as BodyText } from "@vector-im/compound-web";
import type { Room } from "matrix-js-sdk/src/models/room";
import type { Room } from "matrix-js-sdk/src/matrix";
import { useRoomName } from "../../../hooks/useRoomName";
import DecoratedRoomAvatar from "../avatars/DecoratedRoomAvatar";
import { RightPanelPhases } from "../../../stores/right-panel/RightPanelStorePhases";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import React, { FC } from "react";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { JoinRule } from "matrix-js-sdk/src/@types/partials";
import { MatrixClient } from "matrix-js-sdk/src/client";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import { EventType, RoomType } from "matrix-js-sdk/src/@types/event";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import React, { ComponentType, createRef, ReactComponentElement, SyntheticEvent } from "react";
import { IState as IRovingTabIndexState, RovingTabIndexProvider } from "../../../accessibility/RovingTabIndex";

View file

@ -16,7 +16,7 @@ limitations under the License.
import { EventType, RoomType } from "matrix-js-sdk/src/@types/event";
import { ClientEvent } from "matrix-js-sdk/src/client";
import { Room, RoomEvent } from "matrix-js-sdk/src/models/room";
import { Room, RoomEvent } from "matrix-js-sdk/src/matrix";
import React, { useContext, useEffect, useState } from "react";
import MatrixClientContext from "../../../contexts/MatrixClientContext";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import React, { ReactNode } from "react";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { MatrixError } from "matrix-js-sdk/src/http-api";
import { EventType, RoomType } from "matrix-js-sdk/src/@types/event";
import { IJoinRuleEventContent, JoinRule } from "matrix-js-sdk/src/@types/partials";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import React, { FC, useContext, useState } from "react";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { JoinRule } from "matrix-js-sdk/src/@types/partials";
import { _t } from "../../../languageHandler";

View file

@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import classNames from "classnames";
import { Enable, Resizable } from "re-resizable";
import { Direction } from "re-resizable/lib/resizer";

View file

@ -16,7 +16,7 @@ limitations under the License.
*/
import React, { createRef } from "react";
import { Room, RoomEvent } from "matrix-js-sdk/src/models/room";
import { Room, RoomEvent } from "matrix-js-sdk/src/matrix";
import classNames from "classnames";
import type { Call } from "../../../models/Call";

View file

@ -16,7 +16,7 @@ limitations under the License.
import React from "react";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
import Modal from "../../../Modal";

View file

@ -20,7 +20,7 @@ import { IContent, MatrixEvent, IEventRelation, IMentions } from "matrix-js-sdk/
import { DebouncedFunc, throttle } from "lodash";
import { EventType, MsgType, RelationType } from "matrix-js-sdk/src/@types/event";
import { logger } from "matrix-js-sdk/src/logger";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { Composer as ComposerEvent } from "@matrix-org/analytics-events/types/typescript/Composer";
import { THREAD_RELATION_TYPE } from "matrix-js-sdk/src/models/thread";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import React from "react";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { IWidget } from "matrix-widget-api";
import { ClientEvent } from "matrix-js-sdk/src/client";

View file

@ -16,7 +16,7 @@ limitations under the License.
import React from "react";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
import { EventType } from "matrix-js-sdk/src/@types/event";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/
import React, { ReactNode } from "react";
import { Room } from "matrix-js-sdk/src/models/room";
import { Room } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";
import { Optional } from "matrix-events-sdk";
import { IEventRelation, MatrixEvent } from "matrix-js-sdk/src/models/event";

View file

@ -16,7 +16,7 @@ limitations under the License.
*/
import React from "react";
import { Room, RoomEvent } from "matrix-js-sdk/src/models/room";
import { Room, RoomEvent } from "matrix-js-sdk/src/matrix";
import { RoomMember, RoomMemberEvent } from "matrix-js-sdk/src/models/room-member";
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
import { compare } from "matrix-js-sdk/src/utils";