From 4a381c2a105c4f26d8e6975ee53c75b7ad204ad7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 13:25:06 +0000 Subject: [PATCH] Update all non-major dependencies (#29194) * Update all non-major dependencies * Delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Prettier Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --- module_system/installer.ts | 2 +- .../e2e/audio-player/audio-player.spec.ts | 2 +- playwright/e2e/crypto/crypto.spec.ts | 4 +- playwright/e2e/crypto/dehydration.spec.ts | 4 +- .../e2e/crypto/device-verification.spec.ts | 2 +- playwright/e2e/crypto/event-shields.spec.ts | 4 +- playwright/e2e/crypto/toasts.spec.ts | 2 +- .../e2e/crypto/user-verification.spec.ts | 2 +- playwright/e2e/crypto/utils.ts | 8 +-- playwright/e2e/csAPI.ts | 6 +- playwright/e2e/editing/editing.spec.ts | 4 +- .../forgot-password/forgot-password.spec.ts | 2 +- .../e2e/lazy-loading/lazy-loading.spec.ts | 2 +- playwright/e2e/location/location.spec.ts | 2 +- playwright/e2e/login/login-consent.spec.ts | 4 +- playwright/e2e/login/utils.ts | 4 +- playwright/e2e/messages/messages.spec.ts | 2 +- playwright/e2e/oidc/index.ts | 4 +- .../one-to-one-chat/one-to-one-chat.spec.ts | 2 +- playwright/e2e/pinned-messages/index.ts | 8 +-- playwright/e2e/polls/pollHistory.spec.ts | 2 +- playwright/e2e/read-receipts/index.ts | 6 +- .../e2e/read-receipts/read-receipts.spec.ts | 4 +- playwright/e2e/release-announcement/index.ts | 2 +- playwright/e2e/right-panel/file-panel.spec.ts | 2 +- .../e2e/right-panel/right-panel.spec.ts | 2 +- playwright/e2e/right-panel/utils.ts | 2 +- playwright/e2e/room/room-header.spec.ts | 4 +- .../appearance-user-settings-tab/index.ts | 4 +- .../encryption-tab.spec.ts | 2 +- .../e2e/settings/encryption-user-tab/index.ts | 6 +- ...oles-permissions-room-settings-tab.spec.ts | 2 +- .../e2e/sliding-sync/sliding-sync.spec.ts | 4 +- playwright/e2e/spaces/spaces.spec.ts | 2 +- .../spaces/threads-activity-centre/index.ts | 10 +-- playwright/e2e/timeline/timeline.spec.ts | 4 +- playwright/e2e/utils.ts | 2 +- playwright/e2e/widgets/stickers.spec.ts | 4 +- .../e2e/widgets/widget-pip-close.spec.ts | 2 +- playwright/element-web-test.ts | 18 ++--- playwright/logger.ts | 4 +- playwright/pages/bot.ts | 2 +- playwright/pages/client.ts | 6 +- playwright/pages/crypto.ts | 4 +- playwright/pages/settings.ts | 2 +- playwright/pages/toasts.ts | 2 +- .../plugins/homeserver/dendrite/index.ts | 2 +- playwright/plugins/homeserver/index.ts | 2 +- .../homeserver/synapse/consentHomeserver.ts | 2 +- .../homeserver/synapse/emailHomeserver.ts | 2 +- .../synapse/legacyOAuthHomeserver.ts | 2 +- .../homeserver/synapse/masHomeserver.ts | 2 +- .../uiaLongSessionTimeoutHomeserver.ts | 2 +- playwright/plugins/oauth_server/index.ts | 4 +- playwright/plugins/utils/api.ts | 4 +- playwright/plugins/webserver/index.ts | 2 +- playwright/services.ts | 18 ++--- .../testcontainers/HomeserverContainer.ts | 8 +-- playwright/testcontainers/dendrite.ts | 4 +- playwright/testcontainers/mailpit.ts | 2 +- playwright/testcontainers/mas.ts | 12 +++- playwright/testcontainers/synapse.ts | 18 +++-- src/@types/common.ts | 2 +- src/@types/commonmark.ts | 2 +- src/@types/global.d.ts | 68 +++++++++---------- src/@types/react.d.ts | 4 +- src/AddThreepid.ts | 16 +++-- src/AsyncWrapper.tsx | 2 +- src/Avatar.ts | 2 +- src/BasePlatform.ts | 20 +++--- src/BlurhashEncoder.ts | 2 +- src/ContentMessages.ts | 34 +++++----- src/CreateCrossSigning.ts | 2 +- src/DateUtils.ts | 2 +- src/DecryptionFailureTracker.ts | 4 +- src/DeviceListener.ts | 14 ++-- src/Editing.ts | 2 +- src/HtmlUtils.tsx | 8 +-- src/IConfigOptions.ts | 4 +- src/IdentityAuthClient.tsx | 2 +- src/KeyBindingsDefaults.ts | 2 +- src/KeyBindingsManager.ts | 2 +- src/Keyboard.ts | 2 +- src/LegacyCallHandler.tsx | 8 +-- src/Lifecycle.ts | 20 ++++-- src/Linkify.tsx | 4 +- src/Livestream.ts | 4 +- src/Login.ts | 14 ++-- src/MatrixClientPeg.ts | 10 +-- src/Modal.tsx | 8 +-- src/NodeAnimator.tsx | 2 +- src/Notifier.ts | 10 +-- src/PasswordReset.ts | 2 +- src/PlatformPeg.ts | 4 +- src/PlaybackEncoder.ts | 2 +- src/PosthogAnalytics.ts | 14 ++-- src/PosthogTrackers.ts | 8 +-- src/Presence.ts | 2 +- src/Resend.ts | 2 +- src/RoomInvite.tsx | 8 +-- src/Rooms.ts | 2 +- src/ScalarAuthClient.ts | 6 +- src/ScalarMessaging.ts | 2 +- src/SdkConfig.ts | 6 +- src/Searching.ts | 18 ++--- src/SecurityManager.ts | 8 ++- src/SendHistoryManager.ts | 6 +- src/SlashCommands.tsx | 15 ++-- src/SlidingSyncManager.ts | 6 +- src/Terms.ts | 8 ++- src/TextForEvent.tsx | 6 +- src/Unread.ts | 2 +- src/VoipUserMapper.ts | 2 +- src/WhoIsTyping.ts | 2 +- src/WorkerManager.ts | 4 +- src/accessibility/KeyboardShortcutUtils.ts | 6 +- src/accessibility/KeyboardShortcuts.ts | 6 +- src/accessibility/RovingTabIndex.tsx | 12 ++-- .../context_menu/ContextMenuButton.tsx | 4 +- .../context_menu/ContextMenuTooltipButton.tsx | 4 +- .../roving/RovingAccessibleButton.tsx | 4 +- .../roving/RovingTabIndexWrapper.tsx | 5 +- src/accessibility/roving/types.ts | 2 +- src/actions/MatrixActionCreators.ts | 12 ++-- src/actions/RoomListActions.ts | 6 +- src/actions/actionCreators.ts | 2 +- src/async-components/structures/ErrorView.tsx | 2 +- .../eventindex/ManageEventIndexDialog.tsx | 6 +- .../security/CreateSecretStorageDialog.tsx | 14 ++-- .../dialogs/security/ExportE2eKeysDialog.tsx | 8 +-- .../dialogs/security/ImportE2eKeysDialog.tsx | 2 +- .../security/NewRecoveryMethodDialog.tsx | 2 +- src/audio/ManagedPlayback.ts | 2 +- src/audio/Playback.ts | 2 +- src/audio/PlaybackClock.ts | 4 +- src/audio/PlaybackManager.ts | 2 +- src/audio/PlaybackQueue.ts | 4 +- src/audio/RecorderWorklet.ts | 2 +- src/audio/VoiceMessageRecording.ts | 10 +-- src/audio/VoiceRecording.ts | 2 +- src/autocomplete/AutocompleteProvider.tsx | 3 +- src/autocomplete/Autocompleter.ts | 7 +- src/autocomplete/CommandProvider.tsx | 8 +-- src/autocomplete/EmojiProvider.tsx | 10 +-- src/autocomplete/NotifProvider.tsx | 6 +- src/autocomplete/QueryMatcher.ts | 4 +- src/autocomplete/RoomProvider.tsx | 6 +- src/autocomplete/SpaceProvider.tsx | 2 +- src/autocomplete/UserProvider.tsx | 14 ++-- src/boundThreepids.ts | 2 +- .../structures/AutoHideScrollbar.tsx | 2 +- .../structures/AutocompleteInput.tsx | 13 +++- src/components/structures/BackdropPanel.tsx | 2 +- src/components/structures/ContextMenu.tsx | 4 +- src/components/structures/EmbeddedPage.tsx | 4 +- src/components/structures/ErrorMessage.tsx | 2 +- src/components/structures/FilePanel.tsx | 14 ++-- .../structures/GenericDropdownMenu.tsx | 4 +- src/components/structures/HomePage.tsx | 2 +- .../structures/IndicatorScrollbar.tsx | 2 +- src/components/structures/InteractiveAuth.tsx | 16 ++--- src/components/structures/LeftPanel.tsx | 10 +-- .../structures/LegacyCallEventGrouper.ts | 4 +- src/components/structures/LoggedInView.tsx | 32 ++++----- src/components/structures/MainSplit.tsx | 10 +-- src/components/structures/MatrixChat.tsx | 51 +++++++------- .../MatrixClientContextProvider.tsx | 4 +- src/components/structures/MessagePanel.tsx | 31 +++++---- .../structures/NonUrgentToastContainer.tsx | 4 +- src/components/structures/PipContainer.tsx | 10 +-- .../structures/ReleaseAnnouncement.tsx | 4 +- src/components/structures/RightPanel.tsx | 14 ++-- src/components/structures/RoomSearch.tsx | 2 +- src/components/structures/RoomSearchView.tsx | 8 +-- src/components/structures/RoomStatusBar.tsx | 12 ++-- .../RoomStatusBarUnsentMessages.tsx | 4 +- src/components/structures/RoomView.tsx | 66 ++++++++++-------- src/components/structures/ScrollPanel.tsx | 4 +- src/components/structures/SearchBox.tsx | 2 +- src/components/structures/SpaceHierarchy.tsx | 32 ++++----- src/components/structures/SpaceRoomView.tsx | 14 ++-- src/components/structures/SplashPage.tsx | 2 +- src/components/structures/TabbedView.tsx | 6 +- src/components/structures/ThreadPanel.tsx | 10 +-- src/components/structures/ThreadView.tsx | 26 +++---- src/components/structures/TimelinePanel.tsx | 39 +++++------ src/components/structures/ToastContainer.tsx | 4 +- src/components/structures/UploadBar.tsx | 12 ++-- src/components/structures/UserMenu.tsx | 14 ++-- src/components/structures/UserView.tsx | 4 +- src/components/structures/ViewSource.tsx | 2 +- .../WaitingForThirdPartyRoomView.tsx | 6 +- .../structures/auth/ForgotPassword.tsx | 6 +- src/components/structures/auth/Login.tsx | 12 ++-- .../structures/auth/LoginSplashView.tsx | 4 +- .../structures/auth/Registration.tsx | 28 ++++---- .../structures/auth/SetupEncryptionBody.tsx | 6 +- src/components/structures/auth/SoftLogout.tsx | 8 +-- .../auth/forgot-password/CheckEmail.tsx | 2 +- .../auth/forgot-password/EnterEmail.tsx | 6 +- .../auth/forgot-password/VerifyEmailModal.tsx | 2 +- .../auth/header/AuthHeaderContext.tsx | 2 +- .../auth/header/AuthHeaderDisplay.tsx | 2 +- .../auth/header/AuthHeaderModifier.tsx | 2 +- .../auth/header/AuthHeaderProvider.tsx | 4 +- .../structures/grouper/BaseGrouper.ts | 7 +- .../structures/grouper/CreationGrouper.tsx | 7 +- .../structures/grouper/LateEventGrouper.ts | 2 +- .../structures/grouper/MainGrouper.tsx | 4 +- src/components/utils/Flex.tsx | 2 +- .../memberlist/MemberListViewModel.tsx | 20 +++--- .../memberlist/tiles/MemberTileViewModel.tsx | 8 +-- .../tiles/ThreePidTileViewModel.tsx | 2 +- .../rooms/UserIdentityWarningViewModel.tsx | 4 +- .../views/audio_messages/AudioPlayer.tsx | 2 +- .../views/audio_messages/AudioPlayerBase.tsx | 8 +-- src/components/views/audio_messages/Clock.tsx | 2 +- .../views/audio_messages/DurationClock.tsx | 2 +- .../audio_messages/LiveRecordingClock.tsx | 4 +- .../audio_messages/LiveRecordingWaveform.tsx | 4 +- .../views/audio_messages/PlayPauseButton.tsx | 6 +- .../views/audio_messages/PlaybackClock.tsx | 2 +- .../views/audio_messages/PlaybackWaveform.tsx | 2 +- .../audio_messages/RecordingPlayback.tsx | 4 +- .../views/audio_messages/SeekBar.tsx | 4 +- .../views/audio_messages/Waveform.tsx | 2 +- src/components/views/auth/AuthBody.tsx | 2 +- src/components/views/auth/AuthFooter.tsx | 2 +- .../views/auth/CompleteSecurityBody.tsx | 2 +- src/components/views/auth/CountryDropdown.tsx | 6 +- src/components/views/auth/EmailField.tsx | 8 +-- .../auth/InteractiveAuthEntryComponents.tsx | 8 +-- src/components/views/auth/LoginWithQR.tsx | 4 +- src/components/views/auth/LoginWithQRFlow.tsx | 4 +- .../views/auth/PassphraseConfirmField.tsx | 8 +-- src/components/views/auth/PassphraseField.tsx | 8 +-- src/components/views/auth/PasswordLogin.tsx | 10 +-- .../views/auth/RegistrationForm.tsx | 10 +-- src/components/views/auth/Welcome.tsx | 2 +- src/components/views/avatars/BaseAvatar.tsx | 6 +- .../views/avatars/DecoratedRoomAvatar.tsx | 14 +++- src/components/views/avatars/MemberAvatar.tsx | 4 +- src/components/views/avatars/RoomAvatar.tsx | 6 +- .../views/avatars/SearchResultAvatar.tsx | 4 +- src/components/views/avatars/WidgetAvatar.tsx | 8 +-- .../views/avatars/WithPresenceIndicator.tsx | 4 +- .../views/beacon/BeaconListItem.tsx | 4 +- src/components/views/beacon/BeaconMarker.tsx | 6 +- src/components/views/beacon/BeaconStatus.tsx | 4 +- .../views/beacon/BeaconStatusTooltip.tsx | 2 +- .../views/beacon/BeaconViewDialog.tsx | 8 +-- .../views/beacon/DialogOwnBeaconStatus.tsx | 2 +- src/components/views/beacon/DialogSidebar.tsx | 2 +- .../beacon/LeftPanelLiveShareWarning.tsx | 6 +- .../views/beacon/LiveTimeRemaining.tsx | 2 +- .../views/beacon/OwnBeaconStatus.tsx | 6 +- .../views/beacon/RoomCallBanner.tsx | 8 +-- .../views/beacon/ShareLatestLocation.tsx | 2 +- src/components/views/beacon/displayStatus.ts | 2 +- src/components/views/beacon/index.tsx | 2 +- src/components/views/beta/BetaCard.tsx | 4 +- .../views/context_menus/DeviceContextMenu.tsx | 4 +- .../context_menus/DialpadContextMenu.tsx | 6 +- .../context_menus/IconizedContextMenu.tsx | 4 +- .../views/context_menus/KebabContextMenu.tsx | 4 +- .../context_menus/LegacyCallContextMenu.tsx | 4 +- .../context_menus/MessageContextMenu.tsx | 20 +++--- .../context_menus/RoomGeneralContextMenu.tsx | 8 +-- .../RoomNotificationContextMenu.tsx | 6 +- .../views/context_menus/SpaceContextMenu.tsx | 8 +-- .../context_menus/ThreadListContextMenu.tsx | 10 +-- .../views/context_menus/WidgetContextMenu.tsx | 8 +-- .../dialogs/AddExistingSubspaceDialog.tsx | 2 +- .../dialogs/AddExistingToSpaceDialog.tsx | 10 +-- .../dialogs/AnalyticsLearnMoreDialog.tsx | 2 +- src/components/views/dialogs/BaseDialog.tsx | 4 +- .../views/dialogs/BetaFeedbackDialog.tsx | 2 +- .../views/dialogs/BulkRedactDialog.tsx | 9 ++- .../dialogs/ConfirmAndWaitRedactDialog.tsx | 2 +- .../views/dialogs/ConfirmRedactDialog.tsx | 2 +- .../dialogs/ConfirmSpaceUserActionDialog.tsx | 4 +- .../views/dialogs/ConfirmUserActionDialog.tsx | 4 +- .../views/dialogs/CreateRoomDialog.tsx | 8 +-- .../views/dialogs/CreateSubspaceDialog.tsx | 8 +-- .../views/dialogs/DeactivateAccountDialog.tsx | 8 +-- .../views/dialogs/DevtoolsDialog.tsx | 4 +- .../views/dialogs/EndPollDialog.tsx | 4 +- src/components/views/dialogs/ExportDialog.tsx | 12 ++-- .../views/dialogs/ForwardDialog.tsx | 20 +++--- .../dialogs/GenericFeatureFeedbackDialog.tsx | 2 +- .../views/dialogs/IncomingSasDialog.tsx | 4 +- src/components/views/dialogs/InfoDialog.tsx | 2 +- .../views/dialogs/InteractiveAuthDialog.tsx | 10 +-- src/components/views/dialogs/InviteDialog.tsx | 22 +++--- .../views/dialogs/LeaveSpaceDialog.tsx | 2 +- src/components/views/dialogs/LogoutDialog.tsx | 2 +- .../dialogs/MessageEditHistoryDialog.tsx | 2 +- .../views/dialogs/ModalWidgetDialog.tsx | 18 ++--- .../views/dialogs/ModuleUiDialog.tsx | 8 +-- .../views/dialogs/PollHistoryDialog.tsx | 4 +- .../dialogs/RegistrationEmailPromptDialog.tsx | 4 +- .../views/dialogs/ReportEventDialog.tsx | 4 +- .../views/dialogs/RoomSettingsDialog.tsx | 6 +- .../views/dialogs/RoomUpgradeDialog.tsx | 2 +- .../dialogs/RoomUpgradeWarningDialog.tsx | 2 +- .../views/dialogs/ScrollableBaseModal.tsx | 4 +- .../views/dialogs/ServerOfflineDialog.tsx | 2 +- .../views/dialogs/ServerPickerDialog.tsx | 6 +- src/components/views/dialogs/ShareDialog.tsx | 4 +- .../views/dialogs/SlashCommandHelpDialog.tsx | 2 +- .../views/dialogs/SpacePreferencesDialog.tsx | 6 +- .../views/dialogs/SpaceSettingsDialog.tsx | 4 +- .../views/dialogs/StorageEvictedDialog.tsx | 2 +- src/components/views/dialogs/TermsDialog.tsx | 2 +- .../views/dialogs/TextInputDialog.tsx | 6 +- .../views/dialogs/UnpinAllDialog.tsx | 4 +- .../views/dialogs/UntrustedDeviceDialog.tsx | 4 +- .../views/dialogs/UploadFailureDialog.tsx | 2 +- .../views/dialogs/UserSettingsDialog.tsx | 4 +- .../dialogs/VerificationRequestDialog.tsx | 4 +- .../WidgetCapabilitiesPromptDialog.tsx | 8 ++- .../dialogs/WidgetOpenIDPermissionsDialog.tsx | 2 +- .../views/dialogs/devtools/AccountData.tsx | 8 +-- .../views/dialogs/devtools/BaseTool.tsx | 10 +-- .../views/dialogs/devtools/Crypto.tsx | 2 +- .../views/dialogs/devtools/Event.tsx | 8 +-- .../views/dialogs/devtools/FilteredList.tsx | 2 +- .../dialogs/devtools/RoomNotifications.tsx | 6 +- .../views/dialogs/devtools/RoomState.tsx | 6 +- .../views/dialogs/devtools/ServerInfo.tsx | 4 +- .../views/dialogs/devtools/ServersInRoom.tsx | 2 +- .../dialogs/devtools/SettingExplorer.tsx | 8 +-- .../views/dialogs/devtools/WidgetExplorer.tsx | 6 +- .../security/AccessSecretStorageDialog.tsx | 6 +- .../security/RestoreKeyBackupDialog.tsx | 4 +- .../views/dialogs/spotlight/Option.tsx | 4 +- .../spotlight/PublicRoomResultDetails.tsx | 2 +- .../spotlight/RoomResultContextMenus.tsx | 4 +- .../dialogs/spotlight/SpotlightDialog.tsx | 20 +++--- .../views/dialogs/spotlight/TooltipOption.tsx | 6 +- .../views/directory/NetworkDropdown.tsx | 8 +-- .../views/elements/AccessibleButton.tsx | 12 ++-- .../views/elements/AppPermission.tsx | 2 +- src/components/views/elements/AppTile.tsx | 12 ++-- .../views/elements/CopyableText.tsx | 2 +- .../elements/DesktopCapturerSourcePicker.tsx | 4 +- .../views/elements/DialPadBackspaceButton.tsx | 2 +- .../views/elements/DialogButtons.tsx | 2 +- src/components/views/elements/Dropdown.tsx | 13 +++- .../views/elements/EditableItemList.tsx | 4 +- .../views/elements/EffectsOverlay.tsx | 6 +- .../views/elements/ErrorBoundary.tsx | 2 +- .../views/elements/EventListSummary.tsx | 4 +- .../views/elements/EventTilePreview.tsx | 2 +- .../views/elements/ExternalLink.tsx | 2 +- src/components/views/elements/FacePile.tsx | 6 +- src/components/views/elements/Field.tsx | 18 ++--- .../views/elements/FilterDropdown.tsx | 6 +- .../views/elements/FilterTabGroup.tsx | 2 +- .../elements/GenericEventListSummary.tsx | 4 +- .../elements/IRCTimelineProfileResizer.tsx | 2 +- src/components/views/elements/ImageView.tsx | 8 +-- src/components/views/elements/InfoTooltip.tsx | 2 +- .../views/elements/JoinRuleDropdown.tsx | 4 +- .../views/elements/LanguageDropdown.tsx | 4 +- src/components/views/elements/LearnMore.tsx | 2 +- src/components/views/elements/Measured.tsx | 2 +- .../views/elements/MiniAvatarUploader.tsx | 2 +- .../views/elements/PersistedElement.tsx | 6 +- .../views/elements/PersistentApp.tsx | 4 +- src/components/views/elements/Pill.tsx | 4 +- .../views/elements/PollCreateDialog.tsx | 14 ++-- src/components/views/elements/QRCode.tsx | 2 +- src/components/views/elements/ReplyChain.tsx | 8 +-- .../views/elements/RoomAliasField.tsx | 6 +- .../views/elements/RoomFacePile.tsx | 6 +- src/components/views/elements/RoomName.tsx | 2 +- src/components/views/elements/RoomTopic.tsx | 2 +- src/components/views/elements/SSOButtons.tsx | 10 +-- .../views/elements/SearchWarning.tsx | 4 +- .../views/elements/ServerPicker.tsx | 2 +- .../views/elements/SettingsFlag.tsx | 4 +- .../elements/SpellCheckLanguagesDropdown.tsx | 4 +- .../views/elements/StyledCheckbox.tsx | 2 +- .../views/elements/StyledRadioButton.tsx | 2 +- .../views/elements/StyledRadioGroup.tsx | 2 +- src/components/views/elements/Tag.tsx | 2 +- src/components/views/elements/TagComposer.tsx | 2 +- .../views/elements/TextWithTooltip.tsx | 2 +- .../views/elements/TruncatedList.tsx | 2 +- src/components/views/elements/Validation.tsx | 2 +- src/components/views/emojipicker/Category.tsx | 6 +- src/components/views/emojipicker/Emoji.tsx | 4 +- .../views/emojipicker/EmojiPicker.tsx | 12 ++-- src/components/views/emojipicker/Header.tsx | 2 +- src/components/views/emojipicker/Preview.tsx | 2 +- .../views/emojipicker/QuickReactions.tsx | 4 +- .../views/emojipicker/ReactionPicker.tsx | 4 +- .../views/location/LiveDurationDropdown.tsx | 4 +- .../views/location/LocationButton.tsx | 6 +- .../views/location/LocationPicker.tsx | 10 +-- .../views/location/LocationShareMenu.tsx | 8 +-- .../views/location/LocationViewDialog.tsx | 2 +- src/components/views/location/Map.tsx | 6 +- src/components/views/location/MapError.tsx | 2 +- src/components/views/location/Marker.tsx | 4 +- src/components/views/location/ShareType.tsx | 4 +- src/components/views/location/SmartMarker.tsx | 6 +- src/components/views/location/ZoomButtons.tsx | 2 +- src/components/views/location/index.tsx | 2 +- .../views/location/shareLocation.ts | 10 +-- src/components/views/messages/CallEvent.tsx | 4 +- .../views/messages/DateSeparator.tsx | 4 +- .../views/messages/DecryptionFailureBody.tsx | 6 +- .../views/messages/DownloadActionButton.tsx | 6 +- .../views/messages/EditHistoryMessage.tsx | 2 +- .../views/messages/EncryptionEvent.tsx | 2 +- .../views/messages/EventTileBubble.tsx | 2 +- src/components/views/messages/HiddenBody.tsx | 4 +- src/components/views/messages/IBodyProps.ts | 13 ++-- src/components/views/messages/IMediaBody.ts | 2 +- .../views/messages/JumpToDatePicker.tsx | 2 +- .../views/messages/LegacyCallEvent.tsx | 5 +- src/components/views/messages/MAudioBody.tsx | 8 +-- src/components/views/messages/MBeaconBody.tsx | 16 ++--- src/components/views/messages/MFileBody.tsx | 6 +- src/components/views/messages/MImageBody.tsx | 10 +-- .../views/messages/MImageReplyBody.tsx | 2 +- .../views/messages/MJitsiWidgetEvent.tsx | 2 +- .../messages/MKeyVerificationRequest.tsx | 2 +- .../views/messages/MLocationBody.tsx | 4 +- src/components/views/messages/MPollBody.tsx | 18 ++--- .../views/messages/MPollEndBody.tsx | 4 +- .../views/messages/MStickerBody.tsx | 6 +- src/components/views/messages/MVideoBody.tsx | 8 +-- .../views/messages/MVoiceOrAudioBody.tsx | 2 +- .../views/messages/MessageActionBar.tsx | 16 ++--- .../views/messages/MessageEvent.tsx | 8 +-- .../views/messages/MessageTimestamp.tsx | 2 +- src/components/views/messages/MjolnirBody.tsx | 4 +- .../views/messages/PinnedMessageBadge.tsx | 2 +- .../views/messages/ReactionsRow.tsx | 4 +- .../views/messages/ReactionsRowButton.tsx | 2 +- .../messages/ReactionsRowButtonTooltip.tsx | 4 +- .../views/messages/RedactedBody.tsx | 6 +- .../views/messages/RoomAvatarEvent.tsx | 2 +- .../views/messages/RoomPredecessorTile.tsx | 4 +- .../views/messages/SenderProfile.tsx | 2 +- src/components/views/messages/TextualBody.tsx | 6 +- .../views/messages/TextualEvent.tsx | 2 +- .../views/messages/TileErrorBoundary.tsx | 6 +- .../views/messages/TimelineSeparator.tsx | 2 +- src/components/views/messages/UnknownBody.tsx | 4 +- .../views/messages/ViewSourceEvent.tsx | 4 +- src/components/views/pips/WidgetPip.tsx | 8 +-- src/components/views/polls/PollOption.tsx | 4 +- .../views/polls/pollHistory/PollDetail.tsx | 10 +-- .../polls/pollHistory/PollDetailHeader.tsx | 2 +- .../views/polls/pollHistory/PollHistory.tsx | 6 +- .../polls/pollHistory/PollHistoryList.tsx | 4 +- .../views/polls/pollHistory/PollListItem.tsx | 4 +- .../polls/pollHistory/PollListItemEnded.tsx | 4 +- .../views/polls/pollHistory/fetchPastPolls.ts | 8 +-- .../views/polls/pollHistory/usePollHistory.ts | 2 +- src/components/views/right_panel/BaseCard.tsx | 2 +- .../views/right_panel/EmptyState.tsx | 2 +- .../views/right_panel/EncryptionInfo.tsx | 2 +- .../views/right_panel/EncryptionPanel.tsx | 4 +- .../views/right_panel/ExtensionsCard.tsx | 4 +- .../views/right_panel/PinnedMessagesCard.tsx | 6 +- .../views/right_panel/RoomSummaryCard.tsx | 6 +- .../views/right_panel/TimelineCard.tsx | 22 +++--- src/components/views/right_panel/UserInfo.tsx | 20 +++--- .../views/right_panel/VerificationPanel.tsx | 8 +-- .../views/right_panel/WidgetCard.tsx | 2 +- .../views/room_settings/AliasSettings.tsx | 6 +- .../room_settings/RoomProfileSettings.tsx | 2 +- .../room_settings/UrlPreviewSettings.tsx | 6 +- src/components/views/rooms/AppsDrawer.tsx | 14 ++-- src/components/views/rooms/Autocomplete.tsx | 10 ++- src/components/views/rooms/AuxPanel.tsx | 6 +- .../views/rooms/BasicMessageComposer.tsx | 20 +++--- .../views/rooms/CollapsibleButton.tsx | 4 +- src/components/views/rooms/E2EIcon.tsx | 4 +- .../views/rooms/EditMessageComposer.tsx | 22 +++--- src/components/views/rooms/EmojiButton.tsx | 2 +- src/components/views/rooms/EventPreview.tsx | 4 +- src/components/views/rooms/EventTile.tsx | 34 +++++----- .../EventTile/EventTileThreadToolbar.tsx | 2 +- src/components/views/rooms/ExtraTile.tsx | 4 +- .../views/rooms/JumpToBottomButton.tsx | 2 +- .../views/rooms/LinkPreviewGroup.tsx | 2 +- .../views/rooms/LinkPreviewWidget.tsx | 4 +- .../views/rooms/LiveContentSummary.tsx | 4 +- .../rooms/MemberList/MemberListHeaderView.tsx | 2 +- .../views/rooms/MemberList/MemberListView.tsx | 4 +- .../MemberList/tiles/RoomMemberTileView.tsx | 2 +- .../tiles/ThreePidInviteTileView.tsx | 2 +- .../views/rooms/MessageComposer.tsx | 38 +++++------ .../views/rooms/MessageComposerButtons.tsx | 14 ++-- src/components/views/rooms/NewRoomIntro.tsx | 8 +-- .../views/rooms/NotificationBadge.tsx | 6 +- .../StatelessNotificationBadge.tsx | 4 +- .../UnreadNotificationBadge.tsx | 2 +- .../views/rooms/PinnedEventTile.tsx | 12 ++-- .../views/rooms/PinnedMessageBanner.tsx | 10 +-- .../views/rooms/ReadReceiptGroup.tsx | 8 +-- .../views/rooms/ReadReceiptMarker.tsx | 2 +- src/components/views/rooms/ReplyPreview.tsx | 6 +- src/components/views/rooms/ReplyTile.tsx | 8 +-- .../views/rooms/RoomBreadcrumbs.tsx | 6 +- .../views/rooms/RoomContextDetails.tsx | 4 +- .../rooms/RoomHeader/CallGuestLinkButton.tsx | 2 +- .../views/rooms/RoomHeader/RoomHeader.tsx | 6 +- .../rooms/RoomHeader/VideoRoomChatButton.tsx | 4 +- .../RoomHeader/toggle/ToggleableIcon.tsx | 2 +- .../rooms/RoomHeader/toggle/useToggled.tsx | 2 +- src/components/views/rooms/RoomInfoLine.tsx | 4 +- src/components/views/rooms/RoomKnocksBar.tsx | 4 +- src/components/views/rooms/RoomList.tsx | 28 ++++---- src/components/views/rooms/RoomListHeader.tsx | 8 +-- src/components/views/rooms/RoomPreviewBar.tsx | 13 ++-- .../views/rooms/RoomPreviewCard.tsx | 4 +- .../views/rooms/RoomSearchAuxPanel.tsx | 2 +- src/components/views/rooms/RoomSublist.tsx | 26 +++---- src/components/views/rooms/RoomTile.tsx | 18 ++--- .../views/rooms/RoomTileCallSummary.tsx | 2 +- .../views/rooms/RoomTileSubtitle.tsx | 4 +- .../views/rooms/RoomUpgradeWarningBar.tsx | 2 +- .../views/rooms/SearchResultTile.tsx | 7 +- .../views/rooms/SendMessageComposer.tsx | 28 ++++---- src/components/views/rooms/Stickerpicker.tsx | 12 ++-- .../views/rooms/ThirdPartyMemberInfo.tsx | 2 +- src/components/views/rooms/ThreadSummary.tsx | 6 +- .../views/rooms/TopUnreadMessagesBar.tsx | 2 +- .../views/rooms/UserIdentityWarning.tsx | 6 +- .../views/rooms/VoiceRecordComposerTile.tsx | 8 +-- .../views/rooms/WhoIsTypingTile.tsx | 2 +- .../rooms/wysiwyg_composer/ComposerContext.ts | 6 +- .../DynamicImportWysiwygComposer.tsx | 6 +- .../wysiwyg_composer/EditWysiwygComposer.tsx | 6 +- .../wysiwyg_composer/SendWysiwygComposer.tsx | 10 +-- .../components/EditionButtons.tsx | 2 +- .../wysiwyg_composer/components/Editor.tsx | 2 +- .../wysiwyg_composer/components/Emoji.tsx | 4 +- .../components/FormattingButtons.tsx | 8 +-- .../wysiwyg_composer/components/LinkModal.tsx | 6 +- .../components/PlainTextComposer.tsx | 6 +- .../components/WysiwygAutocomplete.tsx | 6 +- .../components/WysiwygComposer.tsx | 8 +-- .../hooks/useComposerFunctions.ts | 2 +- .../wysiwyg_composer/hooks/useEditing.ts | 4 +- .../hooks/useInitialContent.ts | 6 +- .../hooks/useInputEventProcessor.ts | 12 ++-- .../wysiwyg_composer/hooks/useIsExpanded.ts | 2 +- .../wysiwyg_composer/hooks/useIsFocused.ts | 2 +- .../hooks/usePlainTextInitialization.ts | 2 +- .../hooks/usePlainTextListeners.ts | 8 +-- .../wysiwyg_composer/hooks/useSelection.ts | 2 +- .../hooks/useSetCursorPosition.ts | 2 +- .../wysiwyg_composer/hooks/useSuggestion.ts | 4 +- .../hooks/useWysiwygEditActionHandler.ts | 6 +- .../hooks/useWysiwygSendActionHandler.ts | 6 +- .../rooms/wysiwyg_composer/hooks/utils.ts | 12 ++-- .../wysiwyg_composer/utils/autocomplete.ts | 6 +- .../utils/createMessageContent.ts | 8 ++- .../rooms/wysiwyg_composer/utils/editing.ts | 6 +- .../rooms/wysiwyg_composer/utils/event.ts | 8 +-- .../utils/isContentModified.ts | 4 +- .../rooms/wysiwyg_composer/utils/message.ts | 16 ++--- .../rooms/wysiwyg_composer/utils/selection.ts | 2 +- .../views/settings/AddPrivilegedUsers.tsx | 6 +- .../views/settings/AddRemoveThreepids.tsx | 10 +-- .../views/settings/AvatarSetting.tsx | 2 +- src/components/views/settings/BridgeTile.tsx | 4 +- .../views/settings/ChangePassword.tsx | 6 +- .../views/settings/CrossSigningPanel.tsx | 2 +- .../views/settings/CryptographyPanel.tsx | 2 +- .../views/settings/EventIndexPanel.tsx | 2 +- .../views/settings/FontScalingPanel.tsx | 4 +- .../views/settings/ImageSizePanel.tsx | 2 +- .../views/settings/IntegrationManager.tsx | 2 +- .../views/settings/JoinRuleSettings.tsx | 12 ++-- .../views/settings/KeyboardShortcut.tsx | 2 +- .../views/settings/LayoutSwitcher.tsx | 2 +- .../views/settings/Notifications.tsx | 20 +++--- .../views/settings/PowerLevelSelector.tsx | 2 +- .../views/settings/SecureBackupPanel.tsx | 6 +- src/components/views/settings/SetIdServer.tsx | 6 +- .../views/settings/SetIntegrationManager.tsx | 4 +- .../views/settings/SettingsFieldset.tsx | 2 +- .../views/settings/SettingsHeader.tsx | 2 +- .../views/settings/SettingsSubheader.tsx | 2 +- .../views/settings/SpellCheckSettings.tsx | 2 +- .../views/settings/ThemeChoicePanel.tsx | 11 ++- .../views/settings/UpdateCheckButton.tsx | 4 +- .../settings/UserPersonalInfoSettings.tsx | 2 +- .../views/settings/UserProfileSettings.tsx | 2 +- .../settings/devices/CurrentDeviceSection.tsx | 4 +- .../settings/devices/DeviceDetailHeading.tsx | 4 +- .../views/settings/devices/DeviceDetails.tsx | 4 +- .../devices/DeviceExpandDetailsButton.tsx | 2 +- .../views/settings/devices/DeviceMetaData.tsx | 2 +- .../devices/DeviceSecurityLearnMore.tsx | 2 +- .../views/settings/devices/DeviceTile.tsx | 2 +- .../views/settings/devices/DeviceTypeIcon.tsx | 4 +- .../devices/DeviceVerificationStatusCard.tsx | 2 +- .../settings/devices/FilteredDeviceList.tsx | 12 ++-- .../devices/FilteredDeviceListHeader.tsx | 2 +- .../settings/devices/LoginWithQRSection.tsx | 7 +- .../devices/SecurityRecommendations.tsx | 4 +- .../settings/devices/SelectableDeviceTile.tsx | 2 +- .../views/settings/devices/deleteDevices.tsx | 6 +- .../views/settings/devices/filter.ts | 2 +- .../views/settings/devices/types.ts | 4 +- .../views/settings/devices/useOwnDevices.ts | 16 ++--- .../settings/discovery/DiscoverySettings.tsx | 6 +- .../settings/encryption/AdvancedPanel.tsx | 2 +- .../settings/encryption/ChangeRecoveryKey.tsx | 2 +- .../settings/encryption/EncryptionCard.tsx | 2 +- .../settings/encryption/RecoveryPanel.tsx | 2 +- .../encryption/RecoveryPanelOutOfSync.tsx | 2 +- .../encryption/ResetIdentityPanel.tsx | 2 +- .../NotificationPusherSettings.tsx | 2 +- .../notifications/NotificationSettings2.tsx | 2 +- .../views/settings/shared/SettingsBanner.tsx | 2 +- .../views/settings/shared/SettingsIndent.tsx | 2 +- .../views/settings/shared/SettingsSection.tsx | 2 +- .../settings/shared/SettingsSubsection.tsx | 2 +- .../shared/SettingsSubsectionHeading.tsx | 2 +- .../views/settings/tabs/SettingsTab.tsx | 2 +- .../tabs/room/AdvancedRoomSettingsTab.tsx | 6 +- .../settings/tabs/room/BridgeSettingsTab.tsx | 4 +- .../tabs/room/GeneralRoomSettingsTab.tsx | 6 +- .../tabs/room/NotificationSettingsTab.tsx | 4 +- .../tabs/room/PeopleRoomSettingsTab.tsx | 6 +- .../settings/tabs/room/PollHistoryTab.tsx | 2 +- .../tabs/room/RolesRoomSettingsTab.tsx | 13 +++- .../tabs/room/SecurityRoomSettingsTab.tsx | 6 +- .../tabs/room/VoipRoomSettingsTab.tsx | 4 +- .../tabs/user/AppearanceUserSettingsTab.tsx | 4 +- .../tabs/user/EncryptionUserSettingsTab.tsx | 2 +- .../tabs/user/HelpUserSettingsTab.tsx | 4 +- .../tabs/user/KeyboardUserSettingsTab.tsx | 7 +- .../tabs/user/LabsUserSettingsTab.tsx | 4 +- .../tabs/user/MjolnirUserSettingsTab.tsx | 8 +-- .../tabs/user/PreferencesUserSettingsTab.tsx | 8 +-- .../tabs/user/SecurityUserSettingsTab.tsx | 9 ++- .../settings/tabs/user/SessionManagerTab.tsx | 6 +- .../tabs/user/SidebarUserSettingsTab.tsx | 2 +- .../tabs/user/VoiceUserSettingsTab.tsx | 6 +- .../views/spaces/QuickThemeSwitcher.tsx | 6 +- .../views/spaces/SpaceBasicSettings.tsx | 2 +- .../views/spaces/SpaceChildrenPicker.tsx | 2 +- .../views/spaces/SpaceCreateMenu.tsx | 25 +++---- src/components/views/spaces/SpacePanel.tsx | 22 +++--- .../views/spaces/SpacePublicShare.tsx | 2 +- .../views/spaces/SpaceSettingsGeneralTab.tsx | 2 +- .../spaces/SpaceSettingsVisibilityTab.tsx | 9 ++- .../views/spaces/SpaceTreeLevel.tsx | 25 ++++--- .../ThreadsActivityCentre.tsx | 8 +-- .../ThreadsActivityCentreButton.tsx | 4 +- .../useUnreadThreadRooms.ts | 2 +- .../views/terms/InlineTermsAgreement.tsx | 2 +- .../views/toasts/GenericExpiringToast.tsx | 2 +- src/components/views/toasts/GenericToast.tsx | 4 +- .../views/toasts/VerificationRequestToast.tsx | 6 +- src/components/views/typography/Caption.tsx | 2 +- src/components/views/typography/Heading.tsx | 2 +- .../verification/VerificationShowSas.tsx | 4 +- src/components/views/voip/AudioFeed.tsx | 2 +- .../voip/AudioFeedArrayForLegacyCall.tsx | 4 +- src/components/views/voip/CallDuration.tsx | 4 +- src/components/views/voip/CallView.tsx | 4 +- src/components/views/voip/DialPad.tsx | 4 +- src/components/views/voip/DialPadModal.tsx | 4 +- src/components/views/voip/LegacyCallView.tsx | 6 +- .../LegacyCallView/LegacyCallViewButtons.tsx | 7 +- .../LegacyCallView/LegacyCallViewHeader.tsx | 2 +- .../views/voip/LegacyCallViewForRoom.tsx | 4 +- .../views/voip/LegacyCallViewSidebar.tsx | 4 +- src/components/views/voip/VideoFeed.tsx | 4 +- .../CurrentRightPanelPhaseContext.tsx | 2 +- src/contexts/MatrixClientContext.tsx | 4 +- src/contexts/RoomContext.ts | 2 +- src/contexts/SDKContext.ts | 4 +- src/contexts/ScopedRoomContext.tsx | 11 ++- src/contexts/ToastContext.tsx | 2 +- src/createRoom.ts | 10 +-- src/customisations/ChatExport.ts | 2 +- src/customisations/ComponentVisibility.ts | 2 +- src/customisations/Media.ts | 8 +-- src/customisations/RoomList.ts | 2 +- src/customisations/WidgetPermissions.ts | 2 +- src/customisations/WidgetVariables.ts | 2 +- src/customisations/helpers/UIComponents.ts | 2 +- .../models/IMediaEventContent.ts | 2 +- src/dispatcher/dispatcher.ts | 4 +- src/dispatcher/payloads.ts | 2 +- .../payloads/ActiveRoomChangedPayload.ts | 6 +- .../payloads/AfterLeaveRoomPayload.ts | 6 +- .../payloads/CancelAskToJoinPayload.ts | 4 +- .../payloads/CheckUpdatesPayload.ts | 6 +- .../payloads/ComposerInsertPayload.ts | 6 +- .../payloads/DoAfterSyncPreparedPayload.ts | 4 +- .../payloads/FocusComposerPayload.ts | 6 +- .../payloads/JoinRoomErrorPayload.ts | 6 +- src/dispatcher/payloads/JoinRoomPayload.ts | 8 +-- .../payloads/JoinRoomReadyPayload.ts | 6 +- .../OpenAddExistingToSpaceDialogPayload.ts | 6 +- .../payloads/OpenForwardDialogPayload.ts | 10 +-- .../payloads/OpenInviteDialogPayload.ts | 10 +-- .../payloads/OpenReportEventDialogPayload.ts | 6 +- .../payloads/OpenSpacePreferencesPayload.ts | 6 +- .../payloads/OpenSpaceSettingsPayload.ts | 6 +- .../payloads/OpenSpotlightPayload.ts | 6 +- src/dispatcher/payloads/OpenToTabPayload.ts | 4 +- .../payloads/OverwriteLoginPayload.ts | 6 +- src/dispatcher/payloads/PlatformSetPayload.ts | 6 +- .../payloads/RecheckThemePayload.ts | 4 +- .../payloads/SettingUpdatedPayload.ts | 8 +-- src/dispatcher/payloads/ShowThreadPayload.ts | 6 +- .../payloads/SubmitAskToJoinPayload.ts | 6 +- src/dispatcher/payloads/SwitchSpacePayload.ts | 4 +- src/dispatcher/payloads/ThreadPayload.ts | 4 +- .../payloads/UpdateFontSizeDeltaPayload.ts | 4 +- .../payloads/UpdateSystemFontPayload.ts | 4 +- src/dispatcher/payloads/UploadPayload.ts | 6 +- .../payloads/ViewHomePagePayload.ts | 4 +- .../payloads/ViewRoomDeltaPayload.ts | 4 +- .../payloads/ViewRoomErrorPayload.ts | 6 +- src/dispatcher/payloads/ViewRoomPayload.ts | 16 ++--- .../payloads/ViewStartChatOrReusePayload.ts | 6 +- src/dispatcher/payloads/ViewUserPayload.ts | 6 +- src/editor/autocomplete.ts | 11 ++- src/editor/caret.ts | 7 +- src/editor/commands.tsx | 8 +-- src/editor/deserialize.ts | 4 +- src/editor/dom.ts | 4 +- src/editor/history.ts | 8 +-- src/editor/model.ts | 13 ++-- src/editor/offset.ts | 4 +- src/editor/operations.ts | 4 +- src/editor/parts.ts | 8 ++- src/editor/position.ts | 4 +- src/editor/range.ts | 7 +- src/editor/render.ts | 4 +- src/editor/serialize.ts | 2 +- src/effects/confetti/index.ts | 2 +- src/effects/effect.ts | 2 +- src/effects/fireworks/index.ts | 2 +- src/effects/hearts/index.ts | 2 +- src/effects/index.ts | 14 ++-- src/effects/rainfall/index.ts | 2 +- src/effects/snowfall/index.ts | 2 +- src/effects/spaceinvaders/index.ts | 2 +- src/effects/utils.ts | 2 +- src/events/EventTileFactory.tsx | 10 +-- src/events/RelationsHelper.ts | 10 +-- src/events/forward/getForwardableEvent.ts | 2 +- .../location/getShareableLocationEvent.ts | 2 +- src/hooks/right-panel/useCurrentPhase.ts | 2 +- src/hooks/room/useGuestAccessInformation.ts | 2 +- src/hooks/room/useRoomCall.tsx | 10 +-- src/hooks/room/useRoomMemberProfile.ts | 2 +- src/hooks/room/useRoomThreadNotifications.ts | 2 +- src/hooks/room/useTopic.ts | 8 +-- src/hooks/spotlight/useRecentSearches.ts | 2 +- src/hooks/useAccountData.ts | 2 +- src/hooks/useAsyncMemo.ts | 2 +- src/hooks/useAsyncRefreshMemo.ts | 2 +- src/hooks/useCall.ts | 2 +- src/hooks/useDispatcher.ts | 4 +- src/hooks/useEncryptionStatus.ts | 4 +- src/hooks/useEventEmitter.ts | 2 +- src/hooks/useGlobalNotificationState.ts | 2 +- src/hooks/useIsEncrypted.ts | 2 +- src/hooks/useIsReleaseAnnouncementOpen.ts | 2 +- src/hooks/useLocalStorageState.ts | 2 +- src/hooks/useNotificationSettings.tsx | 6 +- src/hooks/usePermalink.ts | 6 +- src/hooks/usePermalinkEvent.ts | 4 +- src/hooks/usePermalinkMember.ts | 4 +- src/hooks/usePermalinkTargetRoom.ts | 4 +- src/hooks/usePinnedEvents.ts | 4 +- src/hooks/usePublicRoomDirectory.ts | 11 ++- src/hooks/usePushers.ts | 2 +- src/hooks/useRoomMembers.ts | 4 +- src/hooks/useRoomName.ts | 4 +- src/hooks/useRoomNotificationState.ts | 4 +- src/hooks/useRoomState.ts | 2 +- src/hooks/useSettings.ts | 4 +- src/hooks/useSlidingSyncRoomSearch.ts | 2 +- src/hooks/useSpaceResults.ts | 2 +- src/hooks/useStateCallback.ts | 2 +- src/hooks/useStateToggle.ts | 2 +- src/hooks/useThreepids.ts | 2 +- src/hooks/useTransition.ts | 2 +- src/hooks/useUserTimezone.ts | 2 +- src/indexing/BaseEventIndexManager.ts | 8 +-- src/indexing/EventIndex.ts | 34 ++++++---- .../IntegrationManagerInstance.ts | 2 +- src/integrations/IntegrationManagers.ts | 3 +- src/languageHandler.tsx | 6 +- src/linkify-matrix.ts | 6 +- src/mjolnir/Mjolnir.ts | 6 +- src/models/Call.ts | 19 +++--- src/models/LocalRoom.ts | 4 +- src/models/RoomUpload.ts | 4 +- .../notificationsettings/PushRuleDiff.ts | 2 +- .../notificationsettings/PushRuleMap.ts | 2 +- .../reconcileNotificationSettings.ts | 6 +- .../toNotificationSettings.ts | 4 +- src/models/rooms/RoomMember.ts | 2 +- src/models/rooms/ThreePIDInvite.ts | 2 +- src/modules.d.ts | 2 +- src/modules/AppModule.ts | 4 +- src/modules/ModuleComponents.tsx | 2 +- src/modules/ModuleFactory.ts | 4 +- src/modules/ModuleRunner.ts | 10 +-- src/modules/ProxiedModuleApi.ts | 29 ++++---- src/notifications/ContentRules.ts | 2 +- src/notifications/NotificationUtils.ts | 7 +- src/notifications/PushRuleVectorState.ts | 2 +- src/notifications/StandardActions.ts | 2 +- .../VectorPushRulesDefinitions.ts | 4 +- src/rageshake/submit-rageshake.ts | 4 +- src/resizer/distributors/collapse.ts | 5 +- src/resizer/distributors/fixed.ts | 3 +- src/resizer/distributors/percentage.ts | 2 +- src/resizer/item.ts | 5 +- src/resizer/resizer.ts | 6 +- src/sendTimePerformanceMetrics.ts | 2 +- src/sentry.ts | 4 +- src/settings/Settings.tsx | 20 +++--- src/settings/SettingsStore.ts | 18 +++-- src/settings/WatchManager.ts | 2 +- .../controllers/AnalyticsController.ts | 4 +- .../DeviceIsolationModeController.ts | 4 +- .../FallbackIceServerController.ts | 4 +- .../controllers/FontSizeController.ts | 2 +- .../controllers/IncompatibleController.ts | 4 +- .../MatrixClientBackedController.ts | 2 +- .../controllers/NotificationControllers.ts | 2 +- .../controllers/ReducedMotionController.ts | 2 +- .../controllers/ReloadOnChangeController.ts | 2 +- .../ServerSupportUnstableFeatureController.ts | 6 +- src/settings/controllers/SettingController.ts | 2 +- .../controllers/SystemFontController.ts | 2 +- src/settings/controllers/ThemeController.ts | 2 +- .../controllers/UIFeatureController.ts | 4 +- .../handlers/AccountSettingsHandler.ts | 4 +- .../handlers/ConfigSettingsHandler.ts | 2 +- .../handlers/DeviceSettingsHandler.ts | 2 +- src/settings/handlers/LocalEchoWrapper.ts | 2 +- .../MatrixClientBackedSettingsHandler.ts | 2 +- .../handlers/PlatformSettingsHandler.ts | 2 +- .../handlers/RoomAccountSettingsHandler.ts | 4 +- .../handlers/RoomDeviceSettingsHandler.ts | 2 +- src/settings/handlers/RoomSettingsHandler.ts | 10 ++- src/settings/handlers/SettingsHandler.ts | 2 +- src/settings/watchers/FontWatcher.ts | 6 +- src/settings/watchers/ThemeWatcher.ts | 2 +- src/shouldHideEvent.ts | 6 +- src/slash-commands/command.ts | 8 +-- src/slash-commands/interface.ts | 4 +- src/slash-commands/join.ts | 6 +- src/slash-commands/op.ts | 4 +- src/slash-commands/utils.ts | 4 +- src/stores/ActiveWidgetStore.ts | 2 +- src/stores/AsyncStore.ts | 4 +- src/stores/AsyncStoreWithClient.ts | 6 +- src/stores/AutoRageshakeStore.ts | 8 +-- src/stores/BreadcrumbsStore.ts | 8 +-- src/stores/CallStore.ts | 2 +- src/stores/InitialCryptoSetupStore.ts | 2 +- src/stores/LifecycleStore.ts | 4 +- src/stores/MemberListStore.ts | 4 +- src/stores/ModalWidgetStore.ts | 6 +- src/stores/NonUrgentToastStore.ts | 2 +- src/stores/OwnBeaconStore.ts | 20 +++--- src/stores/OwnProfileStore.ts | 11 ++- src/stores/ReadyWatchingStore.ts | 8 +-- src/stores/RoomViewStore.tsx | 39 ++++++----- src/stores/SetupEncryptionStore.ts | 6 +- src/stores/ThreepidInviteStore.ts | 2 +- src/stores/ToastStore.ts | 4 +- src/stores/TypingStore.ts | 2 +- src/stores/UserProfilesStore.ts | 8 +-- src/stores/VoiceRecordingStore.ts | 8 +-- src/stores/WidgetEchoStore.ts | 6 +- src/stores/WidgetStore.ts | 8 +-- src/stores/local-echo/EchoChamber.ts | 4 +- src/stores/local-echo/EchoContext.ts | 4 +- src/stores/local-echo/EchoStore.ts | 10 +-- src/stores/local-echo/GenericEchoChamber.ts | 6 +- src/stores/local-echo/RoomEchoChamber.ts | 6 +- src/stores/local-echo/RoomEchoContext.ts | 2 +- .../notifications/ListNotificationState.ts | 4 +- src/stores/notifications/NotificationState.ts | 2 +- .../RoomNotificationStateStore.ts | 10 +-- .../notifications/SpaceNotificationState.ts | 6 +- src/stores/oidc/OidcClientStore.ts | 2 +- src/stores/right-panel/RightPanelStore.ts | 12 ++-- .../right-panel/RightPanelStoreIPanelState.ts | 6 +- .../action-handlers/View3pidInvite.ts | 4 +- src/stores/room-list/Interface.ts | 6 +- src/stores/room-list/ListLayout.ts | 2 +- src/stores/room-list/MessagePreviewStore.ts | 14 ++-- src/stores/room-list/RoomListLayoutStore.ts | 6 +- src/stores/room-list/RoomListStore.ts | 22 +++--- src/stores/room-list/SlidingRoomListStore.ts | 22 +++--- src/stores/room-list/SpaceWatcher.ts | 4 +- src/stores/room-list/algorithms/Algorithm.ts | 18 ++--- .../list-ordering/ImportanceAlgorithm.ts | 4 +- .../list-ordering/NaturalAlgorithm.ts | 6 +- .../list-ordering/OrderingAlgorithm.ts | 4 +- .../algorithms/list-ordering/index.ts | 6 +- src/stores/room-list/algorithms/models.ts | 6 +- .../tag-sorting/AlphabeticAlgorithm.ts | 6 +- .../algorithms/tag-sorting/IAlgorithm.ts | 4 +- .../algorithms/tag-sorting/ManualAlgorithm.ts | 6 +- .../algorithms/tag-sorting/RecentAlgorithm.ts | 6 +- .../room-list/algorithms/tag-sorting/index.ts | 6 +- .../room-list/filters/IFilterCondition.ts | 4 +- .../room-list/filters/SpaceFilterCondition.ts | 8 +-- .../room-list/filters/VisibilityProvider.ts | 2 +- src/stores/room-list/previews/IPreview.ts | 4 +- .../previews/LegacyCallAnswerEventPreview.ts | 6 +- .../previews/LegacyCallHangupEvent.ts | 6 +- .../previews/LegacyCallInviteEventPreview.ts | 6 +- .../room-list/previews/MessageEventPreview.ts | 6 +- .../previews/PollStartEventPreview.ts | 6 +- .../previews/ReactionEventPreview.ts | 6 +- .../room-list/previews/StickerEventPreview.ts | 6 +- src/stores/room-list/previews/utils.ts | 4 +- src/stores/room-list/utils/roomMute.ts | 4 +- src/stores/spaces/SpaceStore.ts | 32 ++++----- src/stores/spaces/flattenSpaceHierarchy.ts | 2 +- src/stores/spaces/index.ts | 2 +- src/stores/widgets/ElementWidgetActions.ts | 2 +- src/stores/widgets/StopGapWidget.ts | 32 ++++----- src/stores/widgets/StopGapWidgetDriver.ts | 44 ++++++------ src/stores/widgets/WidgetLayoutStore.ts | 16 +++-- src/stores/widgets/WidgetMessagingStore.ts | 6 +- src/stores/widgets/WidgetPermissionStore.ts | 4 +- src/toasts/IncomingCallToast.tsx | 10 +-- src/toasts/IncomingLegacyCallToast.tsx | 4 +- src/toasts/SetupEncryptionToast.ts | 2 +- src/utils/AutoDiscoveryUtils.tsx | 12 ++-- src/utils/BrowserWorkarounds.ts | 2 +- src/utils/DMRoomMap.ts | 4 +- src/utils/DecryptFile.ts | 2 +- src/utils/DialogOpener.ts | 8 +-- src/utils/DirectoryUtils.ts | 2 +- src/utils/EditorStateTransfer.ts | 6 +- src/utils/ErrorUtils.tsx | 6 +- src/utils/EventRenderingUtils.ts | 6 +- src/utils/EventUtils.ts | 8 +-- src/utils/FileUtils.ts | 16 ++--- src/utils/FormattingUtils.ts | 2 +- src/utils/IdentityServerUtils.ts | 2 +- src/utils/KeyVerificationStateObserver.ts | 2 +- src/utils/MediaEventHelper.ts | 8 +-- src/utils/MessageDiffUtils.tsx | 6 +- src/utils/MultiInviter.ts | 4 +- src/utils/NativeEventUtils.ts | 2 +- src/utils/PasswordScorer.ts | 4 +- src/utils/PinningUtils.ts | 8 +-- src/utils/ReactUtils.tsx | 2 +- src/utils/Reply.ts | 2 +- src/utils/RoomUpgrade.ts | 4 +- src/utils/ShieldUtils.ts | 2 +- src/utils/SortMembers.ts | 4 +- src/utils/Timer.ts | 2 +- src/utils/ValidatedServerConfig.ts | 2 +- src/utils/WellKnownUtils.ts | 2 +- src/utils/Whenable.ts | 2 +- src/utils/WidgetUtils-types.ts | 2 +- src/utils/WidgetUtils.ts | 8 +-- src/utils/beacon/bounds.ts | 2 +- src/utils/beacon/duration.ts | 2 +- src/utils/beacon/getShareableLocation.ts | 2 +- src/utils/beacon/timeline.ts | 2 +- src/utils/beacon/useBeacon.ts | 2 +- src/utils/beacon/useLiveBeacons.ts | 2 +- src/utils/beacon/useOwnLiveBeacons.ts | 2 +- src/utils/connection.ts | 2 +- src/utils/createMatrixClient.ts | 4 +- src/utils/createVoiceMessageContent.ts | 2 +- src/utils/crypto/deviceInfo.ts | 2 +- .../crypto/shouldForceDisableEncryption.ts | 2 +- src/utils/crypto/shouldSkipSetupEncryption.ts | 2 +- src/utils/device/clientInformation.ts | 10 +-- src/utils/device/dehydration.ts | 2 +- src/utils/device/isDeviceVerified.ts | 2 +- src/utils/direct-messages.ts | 6 +- src/utils/dm/createDmLocalRoom.ts | 4 +- src/utils/dm/findDMForUser.ts | 2 +- src/utils/dm/findDMRoom.ts | 4 +- src/utils/dm/startDm.ts | 10 +-- src/utils/event/getSenderName.ts | 2 +- src/utils/exportUtils/Exporter.ts | 6 +- src/utils/exportUtils/HtmlExport.tsx | 4 +- src/utils/exportUtils/JSONExport.ts | 4 +- src/utils/exportUtils/PlainTextExport.ts | 6 +- src/utils/i18n-helpers.ts | 2 +- src/utils/image-media.ts | 2 +- src/utils/leave-behaviour.ts | 12 ++-- src/utils/local-room.ts | 4 +- src/utils/localRoom/isLocalRoom.ts | 2 +- src/utils/localRoom/isRoomReady.ts | 4 +- src/utils/location/findMapStyleUrl.ts | 2 +- src/utils/location/isSelfLocation.ts | 2 +- src/utils/location/links.ts | 2 +- src/utils/location/locationEventGeoUri.ts | 2 +- src/utils/location/map.ts | 2 +- src/utils/membership.ts | 11 ++- src/utils/notifications.ts | 14 ++-- src/utils/oidc/TokenRefresher.ts | 4 +- src/utils/oidc/authorize.ts | 6 +- src/utils/oidc/error.ts | 2 +- src/utils/oidc/isUserRegistrationSupported.ts | 2 +- src/utils/oidc/persistOidcSettings.ts | 2 +- src/utils/oidc/registerClient.ts | 4 +- src/utils/pages.ts | 4 +- src/utils/permalinks/Permalinks.ts | 5 +- src/utils/pillify.tsx | 6 +- src/utils/presence.ts | 2 +- src/utils/pushRules/monitorSyncedPushRules.ts | 10 ++- src/utils/pushRules/updatePushRuleActions.ts | 2 +- src/utils/react.tsx | 4 +- src/utils/read-receipts.ts | 2 +- src/utils/room/canInviteTo.ts | 2 +- src/utils/room/getFunctionalMembers.ts | 2 +- .../room/getJoinedNonFunctionalMembers.ts | 2 +- src/utils/room/inviteToRoom.ts | 2 +- src/utils/room/placeCall.ts | 6 +- ...ouldEncryptRoomWithSingle3rdPartyInvite.ts | 2 +- src/utils/room/tagRoom.ts | 4 +- src/utils/rooms.ts | 2 +- src/utils/sets.ts | 2 +- src/utils/space.tsx | 11 +-- src/utils/threepids.ts | 4 +- src/utils/tokens/tokens.ts | 2 +- src/utils/tooltipify.tsx | 2 +- src/vector/app.tsx | 10 +-- src/vector/init.tsx | 2 +- src/vector/jitsi/index.ts | 12 ++-- src/vector/platform/ElectronPlatform.tsx | 17 +++-- src/vector/platform/IPCManager.ts | 4 +- src/vector/platform/SeshatIndexManager.ts | 16 +++-- src/vector/platform/WebPlatform.ts | 4 +- src/vector/routing.ts | 2 +- src/vector/url_utils.ts | 2 +- src/verification.ts | 8 +-- src/widgets/CapabilityText.tsx | 4 +- src/widgets/Jitsi.ts | 2 +- src/widgets/ManagedHybrid.ts | 8 +-- src/workers/blurhash.worker.ts | 2 +- src/workers/playback.worker.ts | 2 +- test/CreateCrossSigning-test.ts | 2 +- test/app-tests/wrapper-test.tsx | 4 +- test/test-utils/audio.ts | 6 +- test/test-utils/beacon.ts | 8 +-- test/test-utils/call.ts | 2 +- test/test-utils/client.ts | 4 +- test/test-utils/composer.ts | 2 +- test/test-utils/index.ts | 2 +- test/test-utils/jest-matrix-react.tsx | 4 +- test/test-utils/location.ts | 2 +- test/test-utils/platform.ts | 2 +- test/test-utils/poll.ts | 6 +- test/test-utils/pushRules.ts | 8 ++- test/test-utils/relations.ts | 6 +- test/test-utils/room.ts | 6 +- test/test-utils/test-utils.ts | 40 +++++------ test/test-utils/threads.ts | 11 ++- test/test-utils/utilities.ts | 6 +- test/test-utils/wrappers.tsx | 8 +-- test/unit-tests/Avatar-test.ts | 4 +- test/unit-tests/ContentMessages-test.ts | 11 ++- .../DecryptionFailureTracker-test.ts | 13 ++-- test/unit-tests/DeviceListener-test.ts | 12 ++-- test/unit-tests/HtmlUtils-test.tsx | 4 +- test/unit-tests/KeyBindingsManager-test.ts | 2 +- test/unit-tests/LegacyCallHandler-test.ts | 4 +- test/unit-tests/Lifecycle-test.ts | 2 +- test/unit-tests/MatrixClientPeg-test.ts | 2 +- test/unit-tests/Notifier-test.ts | 12 ++-- test/unit-tests/PosthogAnalytics-test.ts | 13 ++-- test/unit-tests/RoomNotifs-test.ts | 4 +- test/unit-tests/Rooms-test.ts | 2 +- test/unit-tests/ScalarAuthClient-test.ts | 2 +- test/unit-tests/SecurityManager-test.ts | 4 +- test/unit-tests/SlashCommands-test.tsx | 4 +- test/unit-tests/SlidingSyncManager-test.ts | 2 +- test/unit-tests/Terms-test.tsx | 2 +- test/unit-tests/TestSdkContext.ts | 18 ++--- test/unit-tests/TextForEvent-test.ts | 10 +-- .../accessibility/RovingTabIndex-test.tsx | 4 +- .../security/NewRecoveryMethodDialog-test.tsx | 2 +- .../audio/VoiceMessageRecording-test.ts | 6 +- .../autocomplete/RoomProvider-test.ts | 2 +- .../autocomplete/SpaceProvider-test.ts | 2 +- .../structures/AutocompleteInput-test.tsx | 4 +- .../components/structures/LeftPanel-test.tsx | 2 +- .../structures/LegacyCallEventGrouper-test.ts | 2 +- .../structures/LoggedInView-test.tsx | 11 ++- .../components/structures/MatrixChat-test.tsx | 18 ++--- .../MatrixClientContextProvider-test.tsx | 2 +- .../structures/MessagePanel-test.tsx | 6 +- .../PictureInPictureDragger-test.tsx | 6 +- .../structures/PipContainer-test.tsx | 17 +++-- .../components/structures/RightPanel-test.tsx | 4 +- .../structures/RoomSearchView-test.tsx | 6 +- .../structures/RoomStatusBar-test.tsx | 4 +- .../components/structures/RoomView-test.tsx | 20 +++--- .../structures/SpaceHierarchy-test.tsx | 2 +- .../structures/SpaceRoomView-test.tsx | 4 +- .../components/structures/TabbedView-test.tsx | 2 +- .../structures/ThreadPanel-test.tsx | 6 +- .../components/structures/ThreadView-test.tsx | 6 +- .../structures/TimelinePanel-test.tsx | 4 +- .../components/structures/UserMenu-test.tsx | 4 +- .../structures/auth/ForgotPassword-test.tsx | 6 +- .../components/structures/auth/Login-test.tsx | 6 +- .../structures/auth/LoginSplashView-test.tsx | 4 +- .../structures/auth/Registration-test.tsx | 4 +- .../views/VerificationShowSas-test.tsx | 2 +- .../audio_messages/RecordingPlayback-test.tsx | 4 +- .../views/audio_messages/SeekBar-test.tsx | 6 +- .../InteractiveAuthEntryComponents-test.tsx | 2 +- .../views/auth/RegistrationToken-test.tsx | 2 +- .../avatars/DecoratedRoomAvatar-test.tsx | 2 +- .../views/avatars/MemberAvatar-test.tsx | 4 +- .../views/avatars/RoomAvatar-test.tsx | 2 +- .../avatars/WithPresenceIndicator-test.tsx | 2 +- .../views/beacon/BeaconListItem-test.tsx | 2 +- .../views/beacon/BeaconMarker-test.tsx | 2 +- .../views/beacon/BeaconViewDialog-test.tsx | 10 ++- .../views/beacon/DialogSidebar-test.tsx | 2 +- .../beacon/LeftPanelLiveShareWarning-test.tsx | 2 +- .../views/beacon/RoomCallBanner-test.tsx | 12 +++- .../components/views/beta/BetaCard-test.tsx | 4 +- .../context_menus/MessageContextMenu-test.tsx | 6 +- .../RoomGeneralContextMenu-test.tsx | 4 +- .../context_menus/SpaceContextMenu-test.tsx | 6 +- .../ThreadListContextMenu-test.tsx | 4 +- .../context_menus/WidgetContextMenu-test.tsx | 10 +-- .../AccessSecretStorageDialog-test.tsx | 4 +- .../dialogs/AskInviteAnywayDialog-test.tsx | 4 +- .../views/dialogs/ChangelogDialog-test.tsx | 2 +- .../dialogs/ConfirmRedactDialog-test.tsx | 2 +- .../views/dialogs/DevtoolsDialog-test.tsx | 2 +- .../views/dialogs/ExportDialog-test.tsx | 4 +- .../views/dialogs/ForwardDialog-test.tsx | 2 +- .../views/dialogs/IncomingSasDialog-test.tsx | 10 +-- .../views/dialogs/InviteDialog-test.tsx | 10 +-- .../views/dialogs/LogoutDialog-test.tsx | 8 +-- .../dialogs/MessageEditHistoryDialog-test.tsx | 2 +- .../views/dialogs/ServerPickerDialog-test.tsx | 2 +- .../views/dialogs/ShareDialog-test.tsx | 2 +- .../views/dialogs/SpotlightDialog-test.tsx | 8 +-- .../dialogs/UntrustedDeviceDialog-test.tsx | 2 +- .../views/dialogs/UserSettingsDialog-test.tsx | 10 +-- .../views/dialogs/devtools/Crypto-test.tsx | 4 +- .../CreateSecretStorageDialog-test.tsx | 6 +- .../security/ExportE2eKeysDialog-test.tsx | 4 +- .../security/ImportE2eKeysDialog-test.tsx | 2 +- .../security/RestoreKeyBackupDialog-test.tsx | 4 +- .../PublicRoomResultDetails-test.tsx | 2 +- .../spotlight/RoomResultContextMenus-test.tsx | 4 +- .../views/elements/AppTile-test.tsx | 14 ++-- .../DesktopCapturerSourcePicker-test.tsx | 2 +- .../views/elements/EventListSummary-test.tsx | 8 +-- .../components/views/elements/Pill-test.tsx | 10 +-- .../views/elements/PollCreateDialog-test.tsx | 4 +- .../views/elements/StyledRadioGroup-test.tsx | 2 +- .../views/location/LocationPicker-test.tsx | 4 +- .../views/location/LocationShareMenu-test.tsx | 4 +- .../location/LocationViewDialog-test.tsx | 2 +- .../views/location/MapError-test.tsx | 4 +- .../views/location/shareLocation-test.ts | 8 +-- .../views/messages/CallEvent-test.tsx | 13 ++-- .../views/messages/DateSeparator-test.tsx | 4 +- .../messages/DecryptionFailureBody-test.tsx | 2 +- .../views/messages/EncryptionEvent-test.tsx | 2 +- .../views/messages/LegacyCallEvent-test.tsx | 4 +- .../views/messages/MBeaconBody-test.tsx | 8 +-- .../messages/MKeyVerificationRequest-test.tsx | 4 +- .../views/messages/MLocationBody-test.tsx | 4 +- .../views/messages/MPollBody-test.tsx | 12 ++-- .../views/messages/MPollEndBody-test.tsx | 8 +-- .../views/messages/MVideoBody-test.tsx | 6 +- .../views/messages/MessageActionBar-test.tsx | 2 +- .../views/messages/MessageEvent-test.tsx | 4 +- .../messages/ReactionsRowButton-test.tsx | 4 +- .../views/messages/TextualBody-test.tsx | 6 +- .../polls/pollHistory/PollHistory-test.tsx | 2 +- .../pollHistory/PollListItemEnded-test.tsx | 2 +- .../views/right_panel/ExtensionsCard-test.tsx | 6 +- .../right_panel/PinnedMessagesCard-test.tsx | 8 +-- .../right_panel/RoomSummaryCard-test.tsx | 4 +- .../views/right_panel/UserInfo-test.tsx | 18 +++-- .../right_panel/VerificationPanel-test.tsx | 18 ++--- .../RoomProfileSettings-test.tsx | 2 +- .../room_settings/UrlPreviewSettings-test.tsx | 2 +- .../views/rooms/AppsDrawer-test.tsx | 2 +- .../views/rooms/BasicMessageComposer-test.tsx | 2 +- .../views/rooms/EditMessageComposer-test.tsx | 6 +- .../components/views/rooms/EventTile-test.tsx | 12 ++-- .../EventTile/EventTileThreadToolbar-test.tsx | 4 +- .../components/views/rooms/ExtraTile-test.tsx | 2 +- .../views/rooms/MessageComposer-test.tsx | 4 +- .../rooms/MessageComposerButtons-test.tsx | 2 +- .../views/rooms/NewRoomIntro-test.tsx | 4 +- .../views/rooms/PinnedEventTile-test.tsx | 2 +- .../views/rooms/PinnedMessageBanner-test.tsx | 2 +- .../views/rooms/ReadReceiptGroup-test.tsx | 2 +- .../views/rooms/ReadReceiptMarker-test.tsx | 4 +- .../RoomHeader/CallGuestLinkButton-test.tsx | 2 +- .../rooms/RoomHeader/RoomHeader-test.tsx | 10 +-- .../RoomHeader/VideoRoomChatButton-test.tsx | 4 +- .../components/views/rooms/RoomList-test.tsx | 4 +- .../views/rooms/RoomListHeader-test.tsx | 4 +- .../views/rooms/RoomPreviewBar-test.tsx | 6 +- .../views/rooms/RoomPreviewCard-test.tsx | 2 +- .../components/views/rooms/RoomTile-test.tsx | 16 +++-- .../views/rooms/SendMessageComposer-test.tsx | 4 +- .../views/rooms/ThirdPartyMemberInfo-test.tsx | 2 +- .../views/rooms/UserIdentityWarning-test.tsx | 6 +- .../rooms/VoiceRecordComposerTile-test.tsx | 8 +-- .../memberlist/MemberListHeaderView-test.tsx | 4 +- .../rooms/memberlist/MemberListView-test.tsx | 7 +- .../rooms/memberlist/MemberTileView-test.tsx | 6 +- .../views/rooms/memberlist/common.tsx | 12 +++- .../EditWysiwygComposer-test.tsx | 7 +- .../SendWysiwygComposer-test.tsx | 5 +- .../components/FormattingButtons-test.tsx | 7 +- .../components/LinkModal-test.tsx | 4 +- .../components/WysiwygAutocomplete-test.tsx | 6 +- .../components/WysiwygComposer-test.tsx | 10 +-- .../hooks/useSuggestion-test.tsx | 5 +- .../wysiwyg_composer/hooks/utils-test.tsx | 4 +- .../views/rooms/wysiwyg_composer/utils.ts | 4 +- .../utils/autocomplete-test.ts | 2 +- .../wysiwyg_composer/utils/message-test.ts | 4 +- .../settings/AddPrivilegedUsers-test.tsx | 2 +- .../settings/AddRemoveThreepids-test.tsx | 2 +- .../views/settings/CrossSigningPanel-test.tsx | 4 +- .../views/settings/CryptographyPanel-test.tsx | 2 +- .../views/settings/EventIndexPanel-test.tsx | 2 +- .../views/settings/JoinRuleSettings-test.tsx | 10 +-- .../views/settings/Notifications-test.tsx | 10 +-- .../settings/PowerLevelSelector-test.tsx | 2 +- .../views/settings/ThemeChoicePanel-test.tsx | 2 +- .../settings/UserProfileSettings-test.tsx | 6 +- .../devices/DeviceDetailHeading-test.tsx | 2 +- .../settings/devices/DeviceDetails-test.tsx | 2 +- .../settings/devices/DeviceTile-test.tsx | 2 +- .../DeviceVerificationStatusCard-test.tsx | 4 +- .../devices/FilteredDeviceList-test.tsx | 2 +- .../settings/devices/LoginWithQR-test.tsx | 4 +- .../settings/devices/LoginWithQRFlow-test.tsx | 2 +- .../devices/LoginWithQRSection-test.tsx | 2 +- .../settings/devices/deleteDevices-test.tsx | 2 +- .../discovery/DiscoverySettings-test.tsx | 2 +- .../encryption/AdvancedPanel-test.tsx | 2 +- .../encryption/ChangeRecoveryKey-test.tsx | 2 +- .../encryption/RecoveryPanel-test.tsx | 2 +- .../encryption/ResetIdentityPanel-test.tsx | 2 +- .../notifications/Notifications2-test.tsx | 4 +- .../views/settings/tabs/SettingsTab-test.tsx | 4 +- .../room/AdvancedRoomSettingsTab-test.tsx | 4 +- .../room/NotificationSettingsTab-test.tsx | 6 +- .../tabs/room/RolesRoomSettingsTab-test.tsx | 11 ++- .../tabs/room/VoipRoomSettingsTab-test.tsx | 4 +- .../tabs/user/AccountUserSettingsTab-test.tsx | 6 +- .../user/AppearanceUserSettingsTab-test.tsx | 2 +- .../user/EncryptionUserSettingsTab-test.tsx | 4 +- .../user/PreferencesUserSettingsTab-test.tsx | 4 +- .../tabs/user/SessionManagerTab-test.tsx | 16 ++--- .../tabs/user/VoiceUserSettingsTab-test.tsx | 5 +- .../spaces/AddExistingToSpaceDialog-test.tsx | 2 +- .../views/spaces/SpacePanel-test.tsx | 6 +- .../SpaceSettingsVisibilityTab-test.tsx | 11 ++- .../views/spaces/SpaceTreeLevel-test.tsx | 2 +- .../spaces/ThreadsActivityCentre-test.tsx | 2 +- .../spaces/useUnreadThreadRooms-test.tsx | 2 +- .../views/toasts/GenericToast-test.tsx | 4 +- .../toasts/VerificationRequestToast-test.tsx | 10 +-- .../components/views/voip/CallView-test.tsx | 11 ++- .../components/views/voip/VideoFeed-test.tsx | 8 +-- test/unit-tests/contexts/SdkContext-test.ts | 2 +- test/unit-tests/createRoom-test.ts | 6 +- test/unit-tests/editor/deserialize-test.ts | 4 +- test/unit-tests/editor/history-test.ts | 4 +- test/unit-tests/editor/mock.ts | 9 +-- test/unit-tests/editor/model-test.ts | 6 +- test/unit-tests/editor/operations-test.ts | 2 +- test/unit-tests/editor/roundtrip-test.ts | 2 +- test/unit-tests/editor/serialize-test.ts | 2 +- .../events/EventTileFactory-test.ts | 2 +- .../unit-tests/events/RelationsHelper-test.ts | 9 ++- .../room/useRoomThreadNotifications-test.tsx | 2 +- .../unit-tests/hooks/useLatestResult-test.tsx | 2 +- .../hooks/useNotificationSettings-test.tsx | 4 +- test/unit-tests/hooks/useProfileInfo-test.tsx | 2 +- .../hooks/usePublicRoomDirectory-test.tsx | 2 +- test/unit-tests/hooks/useRoomMembers-test.tsx | 2 +- .../hooks/useSlidingSyncRoomSearch-test.tsx | 2 +- .../hooks/useUserDirectory-test.tsx | 2 +- .../integrations/IntegrationManagers-test.ts | 2 +- test/unit-tests/languageHandler-test.tsx | 12 ++-- test/unit-tests/linkify-matrix-test.ts | 2 +- test/unit-tests/models/Call-test.ts | 12 ++-- test/unit-tests/models/LocalRoom-test.ts | 2 +- .../NotificationSettings-test.ts | 4 +- test/unit-tests/modules/MockModule.ts | 8 +-- test/unit-tests/modules/ModuleRunner-test.ts | 7 +- .../modules/ProxiedModuleApi-test.tsx | 12 ++-- .../notifications/ContentRules-test.ts | 2 +- .../notifications/PushRuleVectorState-test.ts | 2 +- .../unit-tests/settings/SettingsStore-test.ts | 6 +- .../IncompatibleController-test.ts | 2 +- ...erSupportUnstableFeatureController-test.ts | 6 +- .../handlers/DeviceSettingsHandler-test.ts | 2 +- .../RoomDeviceSettingsHandler-test.ts | 2 +- .../settings/watchers/ThemeWatcher-test.tsx | 4 +- .../stores/AutoRageshakeStore-test.ts | 4 +- .../stores/BreadcrumbsStore-test.ts | 2 +- .../stores/InitialCryptoSetupStore-test.ts | 2 +- .../unit-tests/stores/MemberListStore-test.ts | 2 +- test/unit-tests/stores/OwnBeaconStore-test.ts | 4 +- .../unit-tests/stores/OwnProfileStore-test.ts | 4 +- .../stores/ReleaseAnnouncementStore-test.tsx | 6 +- .../stores/RoomNotificationStateStore-test.ts | 2 +- test/unit-tests/stores/RoomViewStore-test.ts | 15 ++-- .../stores/SetupEncryptionStore-test.ts | 8 +-- test/unit-tests/stores/SpaceStore-test.ts | 8 +-- test/unit-tests/stores/ToastStore-test.ts | 2 +- test/unit-tests/stores/TypingStore-test.ts | 2 +- .../stores/UserProfilesStore-test.ts | 8 +-- .../stores/VoiceRecordingStore-test.ts | 2 +- .../stores/WidgetLayoutStore-test.ts | 4 +- .../right-panel/RightPanelStore-test.ts | 6 +- .../action-handlers/View3pidInvite-test.ts | 4 +- .../room-list/MessagePreviewStore-test.ts | 6 +- .../stores/room-list/RoomListStore-test.ts | 6 +- .../room-list/SlidingRoomListStore-test.ts | 8 +-- .../stores/room-list/SpaceWatcher-test.ts | 2 +- .../room-list/algorithms/Algorithm-test.ts | 2 +- .../algorithms/RecentAlgorithm-test.ts | 2 +- .../filters/SpaceFilterCondition-test.ts | 4 +- .../filters/VisibilityProvider-test.ts | 2 +- .../previews/PollStartEventPreview-test.ts | 2 +- .../stores/room-list/utils/roomMute-test.ts | 2 +- .../stores/widgets/StopGapWidget-test.ts | 10 +-- .../widgets/StopGapWidgetDriver-test.ts | 18 ++--- .../widgets/WidgetPermissionStore-test.ts | 4 +- test/unit-tests/submit-rageshake-test.ts | 14 ++-- .../toasts/IncomingCallToast-test.tsx | 16 +++-- .../toasts/UnverifiedSessionToast-test.tsx | 8 +-- .../utils/AutoDiscoveryUtils-test.tsx | 2 +- test/unit-tests/utils/DMRoomMap-test.ts | 11 ++- test/unit-tests/utils/ErrorUtils-test.ts | 2 +- test/unit-tests/utils/EventUtils-test.ts | 4 +- test/unit-tests/utils/FileUtils-test.ts | 2 +- test/unit-tests/utils/MultiInviter-test.ts | 8 +-- test/unit-tests/utils/PinningUtils-test.ts | 2 +- test/unit-tests/utils/ShieldUtils-test.ts | 2 +- test/unit-tests/utils/beacon/bounds-test.ts | 2 +- .../utils/beacon/geolocation-test.ts | 4 +- test/unit-tests/utils/connection-test.ts | 2 +- .../utils/createVoiceMessageContent-test.ts | 2 +- .../utils/crypto/deviceInfo-test.ts | 4 +- .../utils/device/clientInformation-test.ts | 6 +- .../utils/device/parseUserAgent-test.ts | 6 +- test/unit-tests/utils/direct-messages-test.ts | 4 +- .../utils/dm/createDmLocalRoom-test.ts | 6 +- .../unit-tests/utils/dm/findDMForUser-test.ts | 2 +- test/unit-tests/utils/dm/findDMRoom-test.ts | 2 +- test/unit-tests/utils/export-test.tsx | 8 +-- .../utils/exportUtils/HTMLExport-test.ts | 10 +-- .../utils/exportUtils/JSONExport-test.ts | 2 +- .../utils/exportUtils/PlainTextExport-test.ts | 4 +- test/unit-tests/utils/leave-behaviour-test.ts | 8 +-- test/unit-tests/utils/local-room-test.ts | 2 +- .../utils/localRoom/isRoomReady-test.ts | 2 +- .../utils/location/isSelfLocation-test.ts | 4 +- test/unit-tests/utils/membership-test.ts | 9 ++- test/unit-tests/utils/notifications-test.ts | 6 +- test/unit-tests/utils/oidc/authorize-test.ts | 2 +- .../utils/oidc/persistOidcSettings-test.ts | 2 +- .../utils/oidc/registerClient-test.ts | 2 +- .../utils/permalinks/Permalinks-test.ts | 4 +- .../getJoinedNonFunctionalMembers-test.ts | 2 +- ...ncryptRoomWithSingle3rdPartyInvite-test.ts | 2 +- test/unit-tests/utils/room/tagRoom-test.ts | 2 +- test/unit-tests/utils/threepids-test.ts | 4 +- test/unit-tests/utils/tooltipify-test.tsx | 2 +- test/unit-tests/vector/routing-test.ts | 2 +- yarn.lock | 16 ++--- 1404 files changed, 4120 insertions(+), 3708 deletions(-) diff --git a/module_system/installer.ts b/module_system/installer.ts index 48dad8d908..66df4e92b6 100644 --- a/module_system/installer.ts +++ b/module_system/installer.ts @@ -9,7 +9,7 @@ import * as fs from "fs"; import * as childProcess from "child_process"; import * as semver from "semver"; -import { BuildConfig } from "./BuildConfig"; +import { type BuildConfig } from "./BuildConfig"; // This expects to be run from ./scripts/install.ts diff --git a/playwright/e2e/audio-player/audio-player.spec.ts b/playwright/e2e/audio-player/audio-player.spec.ts index bb766d6b88..a8cb15a5da 100644 --- a/playwright/e2e/audio-player/audio-player.spec.ts +++ b/playwright/e2e/audio-player/audio-player.spec.ts @@ -11,7 +11,7 @@ import type { Locator, Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; import { SettingLevel } from "../../../src/settings/SettingLevel"; import { Layout } from "../../../src/settings/enums/Layout"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; // Find and click "Reply" button const clickButtonReply = async (tile: Locator) => { diff --git a/playwright/e2e/crypto/crypto.spec.ts b/playwright/e2e/crypto/crypto.spec.ts index babee2aeea..7cc61c927d 100644 --- a/playwright/e2e/crypto/crypto.spec.ts +++ b/playwright/e2e/crypto/crypto.spec.ts @@ -16,8 +16,8 @@ import { enableKeyBackup, verify, } from "./utils"; -import { Bot } from "../../pages/bot"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type Bot } from "../../pages/bot"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; import { isDendrite } from "../../plugins/homeserver/dendrite"; const checkDMRoom = async (page: Page) => { diff --git a/playwright/e2e/crypto/dehydration.spec.ts b/playwright/e2e/crypto/dehydration.spec.ts index b3ac82a19d..a0509434a4 100644 --- a/playwright/e2e/crypto/dehydration.spec.ts +++ b/playwright/e2e/crypto/dehydration.spec.ts @@ -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 { Locator, type Page } from "@playwright/test"; +import { type Locator, type Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; import { viewRoomSummaryByName } from "../right-panel/utils"; import { isDendrite } from "../../plugins/homeserver/dendrite"; import { completeCreateSecretStorageDialog, createBot, logIntoElement } from "./utils.ts"; -import { Client } from "../../pages/client.ts"; +import { type Client } from "../../pages/client.ts"; const ROOM_NAME = "Test room"; const NAME = "Alice"; diff --git a/playwright/e2e/crypto/device-verification.spec.ts b/playwright/e2e/crypto/device-verification.spec.ts index ffa269a0c5..551f9302a9 100644 --- a/playwright/e2e/crypto/device-verification.spec.ts +++ b/playwright/e2e/crypto/device-verification.spec.ts @@ -20,7 +20,7 @@ import { logIntoElement, waitForVerificationRequest, } from "./utils"; -import { Bot } from "../../pages/bot"; +import { type Bot } from "../../pages/bot"; test.describe("Device verification", { tag: "@no-webkit" }, () => { let aliceBotClient: Bot; diff --git a/playwright/e2e/crypto/event-shields.spec.ts b/playwright/e2e/crypto/event-shields.spec.ts index c0f1e280a2..6c33554a94 100644 --- a/playwright/e2e/crypto/event-shields.spec.ts +++ b/playwright/e2e/crypto/event-shields.spec.ts @@ -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 { Locator } from "@playwright/test"; +import { type Locator } from "@playwright/test"; import { expect, test } from "../../element-web-test"; import { @@ -19,7 +19,7 @@ import { verify, } from "./utils"; import { bootstrapCrossSigningForClient } from "../../pages/client.ts"; -import { ElementAppPage } from "../../pages/ElementAppPage.ts"; +import { type ElementAppPage } from "../../pages/ElementAppPage.ts"; test.describe("Cryptography", function () { test.use({ diff --git a/playwright/e2e/crypto/toasts.spec.ts b/playwright/e2e/crypto/toasts.spec.ts index 7763cc29c2..76d9ebea7a 100644 --- a/playwright/e2e/crypto/toasts.spec.ts +++ b/playwright/e2e/crypto/toasts.spec.ts @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api"; +import { type GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api"; import { test, expect } from "../../element-web-test"; import { createBot, deleteCachedSecrets, logIntoElement } from "./utils"; diff --git a/playwright/e2e/crypto/user-verification.spec.ts b/playwright/e2e/crypto/user-verification.spec.ts index 175c8d5fdf..46bdefb8fb 100644 --- a/playwright/e2e/crypto/user-verification.spec.ts +++ b/playwright/e2e/crypto/user-verification.spec.ts @@ -11,7 +11,7 @@ import { type Preset, type Visibility } from "matrix-js-sdk/src/matrix"; import type { Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; import { doTwoWaySasVerification, awaitVerifier } from "./utils"; -import { Client } from "../../pages/client"; +import { type Client } from "../../pages/client"; test.describe("User verification", () => { // note that there are other tests that check user verification works in `crypto.spec.ts`. diff --git a/playwright/e2e/crypto/utils.ts b/playwright/e2e/crypto/utils.ts index d4e276094f..ccdb320b94 100644 --- a/playwright/e2e/crypto/utils.ts +++ b/playwright/e2e/crypto/utils.ts @@ -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 { expect, JSHandle, type Page } from "@playwright/test"; +import { expect, type JSHandle, type Page } from "@playwright/test"; import type { ICreateRoomOpts, MatrixClient } from "matrix-js-sdk/src/matrix"; import type { @@ -18,9 +18,9 @@ import type { Verifier, VerifierEvent, } from "matrix-js-sdk/src/crypto-api"; -import { Credentials, HomeserverInstance } from "../../plugins/homeserver"; -import { Client } from "../../pages/client"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type Credentials, type HomeserverInstance } from "../../plugins/homeserver"; +import { type Client } from "../../pages/client"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; import { Bot } from "../../pages/bot"; /** diff --git a/playwright/e2e/csAPI.ts b/playwright/e2e/csAPI.ts index 4153d09199..4f12076139 100644 --- a/playwright/e2e/csAPI.ts +++ b/playwright/e2e/csAPI.ts @@ -5,10 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only Please see LICENSE files in the repository root for full details. */ -import { APIRequestContext } from "playwright-core"; -import { KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; +import { type APIRequestContext } from "playwright-core"; +import { type KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; -import { HomeserverInstance } from "../plugins/homeserver"; +import { type HomeserverInstance } from "../plugins/homeserver"; import { ClientServerApi } from "../plugins/utils/api.ts"; /** diff --git a/playwright/e2e/editing/editing.spec.ts b/playwright/e2e/editing/editing.spec.ts index 934c4aa42e..528bcc5962 100644 --- a/playwright/e2e/editing/editing.spec.ts +++ b/playwright/e2e/editing/editing.spec.ts @@ -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 { Locator, Page } from "@playwright/test"; +import { type Locator, type Page } from "@playwright/test"; import type { EventType, IContent, ISendEventResponse, MsgType, Visibility } from "matrix-js-sdk/src/matrix"; import { expect, test } from "../../element-web-test"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; import { SettingLevel } from "../../../src/settings/SettingLevel"; import { isDendrite } from "../../plugins/homeserver/dendrite"; diff --git a/playwright/e2e/forgot-password/forgot-password.spec.ts b/playwright/e2e/forgot-password/forgot-password.spec.ts index af4e6def7e..14d1a816c7 100644 --- a/playwright/e2e/forgot-password/forgot-password.spec.ts +++ b/playwright/e2e/forgot-password/forgot-password.spec.ts @@ -10,7 +10,7 @@ import { expect, test as base } from "../../element-web-test"; import { selectHomeserver } from "../utils"; import { emailHomeserver } from "../../plugins/homeserver/synapse/emailHomeserver.ts"; import { isDendrite } from "../../plugins/homeserver/dendrite"; -import { Credentials } from "../../plugins/homeserver"; +import { type Credentials } from "../../plugins/homeserver"; const email = "user@nowhere.dummy"; diff --git a/playwright/e2e/lazy-loading/lazy-loading.spec.ts b/playwright/e2e/lazy-loading/lazy-loading.spec.ts index 06fb0b3a71..7c31c288fa 100644 --- a/playwright/e2e/lazy-loading/lazy-loading.spec.ts +++ b/playwright/e2e/lazy-loading/lazy-loading.spec.ts @@ -10,7 +10,7 @@ import { Bot } from "../../pages/bot"; import type { Locator, Page } from "@playwright/test"; import type { ElementAppPage } from "../../pages/ElementAppPage"; import { test, expect } from "../../element-web-test"; -import { Credentials } from "../../plugins/homeserver"; +import { type Credentials } from "../../plugins/homeserver"; import { isDendrite } from "../../plugins/homeserver/dendrite"; test.describe("Lazy Loading", () => { diff --git a/playwright/e2e/location/location.spec.ts b/playwright/e2e/location/location.spec.ts index 6f4db3ae72..52afd5e173 100644 --- a/playwright/e2e/location/location.spec.ts +++ b/playwright/e2e/location/location.spec.ts @@ -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 { Locator, Page } from "@playwright/test"; +import { type Locator, type Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; diff --git a/playwright/e2e/login/login-consent.spec.ts b/playwright/e2e/login/login-consent.spec.ts index d92b427b93..ec6dfbf7c2 100644 --- a/playwright/e2e/login/login-consent.spec.ts +++ b/playwright/e2e/login/login-consent.spec.ts @@ -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 { Page } from "playwright-core"; +import { type Page } from "playwright-core"; import { expect, test } from "../../element-web-test"; import { selectHomeserver } from "../utils"; -import { Credentials, HomeserverInstance } from "../../plugins/homeserver"; +import { type Credentials, type HomeserverInstance } from "../../plugins/homeserver"; import { consentHomeserver } from "../../plugins/homeserver/synapse/consentHomeserver.ts"; import { isDendrite } from "../../plugins/homeserver/dendrite"; diff --git a/playwright/e2e/login/utils.ts b/playwright/e2e/login/utils.ts index 59a5c330f3..d74300908a 100644 --- a/playwright/e2e/login/utils.ts +++ b/playwright/e2e/login/utils.ts @@ -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 { Page, expect, TestInfo } from "@playwright/test"; +import { type Page, expect, type TestInfo } from "@playwright/test"; -import { Credentials, HomeserverInstance } from "../../plugins/homeserver"; +import { type Credentials, type HomeserverInstance } from "../../plugins/homeserver"; /** Visit the login page, choose to log in with "OAuth test", register a new account, and redirect back to Element */ diff --git a/playwright/e2e/messages/messages.spec.ts b/playwright/e2e/messages/messages.spec.ts index 5185be43c9..e5d65caff5 100644 --- a/playwright/e2e/messages/messages.spec.ts +++ b/playwright/e2e/messages/messages.spec.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. /* See readme.md for tips on writing these tests. */ -import { Locator, Page } from "playwright-core"; +import { type Locator, type Page } from "playwright-core"; import { test, expect } from "../../element-web-test"; diff --git a/playwright/e2e/oidc/index.ts b/playwright/e2e/oidc/index.ts index 1dcae1c21d..b1635fbd78 100644 --- a/playwright/e2e/oidc/index.ts +++ b/playwright/e2e/oidc/index.ts @@ -6,8 +6,8 @@ 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 { MailpitClient } from "mailpit-api"; -import { Page } from "@playwright/test"; +import { type MailpitClient } from "mailpit-api"; +import { type Page } from "@playwright/test"; import { expect } from "../../element-web-test"; diff --git a/playwright/e2e/one-to-one-chat/one-to-one-chat.spec.ts b/playwright/e2e/one-to-one-chat/one-to-one-chat.spec.ts index d03767205a..6ad69deba9 100644 --- a/playwright/e2e/one-to-one-chat/one-to-one-chat.spec.ts +++ b/playwright/e2e/one-to-one-chat/one-to-one-chat.spec.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import { test as base, expect } from "../../element-web-test"; -import { Credentials } from "../../plugins/homeserver"; +import { type Credentials } from "../../plugins/homeserver"; import { isDendrite } from "../../plugins/homeserver/dendrite"; const test = base.extend<{ diff --git a/playwright/e2e/pinned-messages/index.ts b/playwright/e2e/pinned-messages/index.ts index bb65f31627..198ab24118 100644 --- a/playwright/e2e/pinned-messages/index.ts +++ b/playwright/e2e/pinned-messages/index.ts @@ -6,12 +6,12 @@ * Please see LICENSE files in the repository root for full details. */ -import { Page } from "@playwright/test"; +import { type Page } from "@playwright/test"; import { test as base, expect } from "../../element-web-test"; -import { Client } from "../../pages/client"; -import { ElementAppPage } from "../../pages/ElementAppPage"; -import { Bot } from "../../pages/bot"; +import { type Client } from "../../pages/client"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; +import { type Bot } from "../../pages/bot"; type RoomRef = { name: string; roomId: string }; diff --git a/playwright/e2e/polls/pollHistory.spec.ts b/playwright/e2e/polls/pollHistory.spec.ts index 319a08cda9..4f2adff40d 100644 --- a/playwright/e2e/polls/pollHistory.spec.ts +++ b/playwright/e2e/polls/pollHistory.spec.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { test, expect } from "../../element-web-test"; import type { Bot } from "../../pages/bot"; import type { Client } from "../../pages/client"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; test.describe("Poll history", () => { type CreatePollOptions = { diff --git a/playwright/e2e/read-receipts/index.ts b/playwright/e2e/read-receipts/index.ts index 384cef1d5e..067d3d16d2 100644 --- a/playwright/e2e/read-receipts/index.ts +++ b/playwright/e2e/read-receipts/index.ts @@ -9,9 +9,9 @@ Please see LICENSE files in the repository root for full details. import type { JSHandle, Page } from "@playwright/test"; import type { MatrixEvent, Room, IndexedDBStore, ReceiptType } from "matrix-js-sdk/src/matrix"; import { test as base, expect } from "../../element-web-test"; -import { Bot } from "../../pages/bot"; -import { Client } from "../../pages/client"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type Bot } from "../../pages/bot"; +import { type Client } from "../../pages/client"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; type RoomRef = { name: string; roomId: string }; diff --git a/playwright/e2e/read-receipts/read-receipts.spec.ts b/playwright/e2e/read-receipts/read-receipts.spec.ts index 6b9415e7ba..8ebce22b52 100644 --- a/playwright/e2e/read-receipts/read-receipts.spec.ts +++ b/playwright/e2e/read-receipts/read-receipts.spec.ts @@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details. import type { JSHandle } from "@playwright/test"; import type { MatrixEvent, ISendEventResponse, ReceiptType } from "matrix-js-sdk/src/matrix"; import { expect } from "../../element-web-test"; -import { ElementAppPage } from "../../pages/ElementAppPage"; -import { Bot } from "../../pages/bot"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; +import { type Bot } from "../../pages/bot"; import { test } from "."; import { isDendrite } from "../../plugins/homeserver/dendrite"; diff --git a/playwright/e2e/release-announcement/index.ts b/playwright/e2e/release-announcement/index.ts index e20dfb85b4..3b6c2dd38a 100644 --- a/playwright/e2e/release-announcement/index.ts +++ b/playwright/e2e/release-announcement/index.ts @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { Page } from "@playwright/test"; +import { type Page } from "@playwright/test"; import { test as base, expect } from "../../element-web-test"; diff --git a/playwright/e2e/right-panel/file-panel.spec.ts b/playwright/e2e/right-panel/file-panel.spec.ts index 1c936f43b8..d69b7d4731 100644 --- a/playwright/e2e/right-panel/file-panel.spec.ts +++ b/playwright/e2e/right-panel/file-panel.spec.ts @@ -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 { Download, type Page } from "@playwright/test"; +import { type Download, type Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; import { viewRoomSummaryByName } from "./utils"; diff --git a/playwright/e2e/right-panel/right-panel.spec.ts b/playwright/e2e/right-panel/right-panel.spec.ts index de86d6bfe6..363aedae20 100644 --- a/playwright/e2e/right-panel/right-panel.spec.ts +++ b/playwright/e2e/right-panel/right-panel.spec.ts @@ -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 { Locator, type Page } from "@playwright/test"; +import { type Locator, type Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; import { checkRoomSummaryCard, viewRoomSummaryByName } from "./utils"; diff --git a/playwright/e2e/right-panel/utils.ts b/playwright/e2e/right-panel/utils.ts index 0f57178f50..f4745b0158 100644 --- a/playwright/e2e/right-panel/utils.ts +++ b/playwright/e2e/right-panel/utils.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { type Page, expect } from "@playwright/test"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; export async function viewRoomSummaryByName(page: Page, app: ElementAppPage, name: string): Promise { await app.viewRoomByName(name); diff --git a/playwright/e2e/room/room-header.spec.ts b/playwright/e2e/room/room-header.spec.ts index f19bd68f14..790d97545c 100644 --- a/playwright/e2e/room/room-header.spec.ts +++ b/playwright/e2e/room/room-header.spec.ts @@ -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 { Page } from "@playwright/test"; +import { type Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; test.describe("Room Header", () => { test.use({ diff --git a/playwright/e2e/settings/appearance-user-settings-tab/index.ts b/playwright/e2e/settings/appearance-user-settings-tab/index.ts index be609edf9f..29e51fb0dd 100644 --- a/playwright/e2e/settings/appearance-user-settings-tab/index.ts +++ b/playwright/e2e/settings/appearance-user-settings-tab/index.ts @@ -6,9 +6,9 @@ * Please see LICENSE files in the repository root for full details. */ -import { Locator, Page } from "@playwright/test"; +import { type Locator, type Page } from "@playwright/test"; -import { ElementAppPage } from "../../../pages/ElementAppPage"; +import { type ElementAppPage } from "../../../pages/ElementAppPage"; import { test as base, expect } from "../../../element-web-test"; import { SettingLevel } from "../../../../src/settings/SettingLevel"; import { Layout } from "../../../../src/settings/enums/Layout"; diff --git a/playwright/e2e/settings/encryption-user-tab/encryption-tab.spec.ts b/playwright/e2e/settings/encryption-user-tab/encryption-tab.spec.ts index 79ee3fc7a5..6bffd793f6 100644 --- a/playwright/e2e/settings/encryption-user-tab/encryption-tab.spec.ts +++ b/playwright/e2e/settings/encryption-user-tab/encryption-tab.spec.ts @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api"; +import { type GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api"; import { test, expect } from "."; import { diff --git a/playwright/e2e/settings/encryption-user-tab/index.ts b/playwright/e2e/settings/encryption-user-tab/index.ts index ea960b3431..1a83097e55 100644 --- a/playwright/e2e/settings/encryption-user-tab/index.ts +++ b/playwright/e2e/settings/encryption-user-tab/index.ts @@ -5,10 +5,10 @@ * Please see LICENSE files in the repository root for full details. */ -import { Page } from "@playwright/test"; -import { GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api"; +import { type Page } from "@playwright/test"; +import { type GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api"; -import { ElementAppPage } from "../../../pages/ElementAppPage"; +import { type ElementAppPage } from "../../../pages/ElementAppPage"; import { test as base, expect } from "../../../element-web-test"; export { expect }; diff --git a/playwright/e2e/settings/roles-permissions-room-settings-tab.spec.ts b/playwright/e2e/settings/roles-permissions-room-settings-tab.spec.ts index 1193afe135..7cc4001c58 100644 --- a/playwright/e2e/settings/roles-permissions-room-settings-tab.spec.ts +++ b/playwright/e2e/settings/roles-permissions-room-settings-tab.spec.ts @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { Locator } from "@playwright/test"; +import { type Locator } from "@playwright/test"; import { test, expect } from "../../element-web-test"; diff --git a/playwright/e2e/sliding-sync/sliding-sync.spec.ts b/playwright/e2e/sliding-sync/sliding-sync.spec.ts index 0fde7ddefb..bf992a0edd 100644 --- a/playwright/e2e/sliding-sync/sliding-sync.spec.ts +++ b/playwright/e2e/sliding-sync/sliding-sync.spec.ts @@ -6,8 +6,8 @@ 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 { Page, Request } from "@playwright/test"; -import { GenericContainer, StartedTestContainer, Wait } from "testcontainers"; +import { type Page, type Request } from "@playwright/test"; +import { GenericContainer, type StartedTestContainer, Wait } from "testcontainers"; import { test as base, expect } from "../../element-web-test"; import type { ElementAppPage } from "../../pages/ElementAppPage"; diff --git a/playwright/e2e/spaces/spaces.spec.ts b/playwright/e2e/spaces/spaces.spec.ts index 37e5606cc1..01a385c9df 100644 --- a/playwright/e2e/spaces/spaces.spec.ts +++ b/playwright/e2e/spaces/spaces.spec.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import type { Locator, Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; import type { Preset, ICreateRoomOpts } from "matrix-js-sdk/src/matrix"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; import { isDendrite } from "../../plugins/homeserver/dendrite"; async function openSpaceCreateMenu(page: Page): Promise { diff --git a/playwright/e2e/spaces/threads-activity-centre/index.ts b/playwright/e2e/spaces/threads-activity-centre/index.ts index 7da6974a92..a050175c83 100644 --- a/playwright/e2e/spaces/threads-activity-centre/index.ts +++ b/playwright/e2e/spaces/threads-activity-centre/index.ts @@ -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 { JSHandle, Locator, Page } from "@playwright/test"; +import { type JSHandle, type Locator, type Page } from "@playwright/test"; import type { MatrixEvent, IContent, Room } from "matrix-js-sdk/src/matrix"; import { test as base, expect } from "../../../element-web-test"; -import { Bot } from "../../../pages/bot"; -import { Client } from "../../../pages/client"; -import { ElementAppPage } from "../../../pages/ElementAppPage"; -import { Credentials } from "../../../plugins/homeserver"; +import { type Bot } from "../../../pages/bot"; +import { type Client } from "../../../pages/client"; +import { type ElementAppPage } from "../../../pages/ElementAppPage"; +import { type Credentials } from "../../../plugins/homeserver"; type RoomRef = { name: string; roomId: string }; diff --git a/playwright/e2e/timeline/timeline.spec.ts b/playwright/e2e/timeline/timeline.spec.ts index 3de0f7c0f2..8f4af33da8 100644 --- a/playwright/e2e/timeline/timeline.spec.ts +++ b/playwright/e2e/timeline/timeline.spec.ts @@ -13,8 +13,8 @@ import type { ISendEventResponse, EventType, MsgType } from "matrix-js-sdk/src/m import { test, expect } from "../../element-web-test"; import { SettingLevel } from "../../../src/settings/SettingLevel"; import { Layout } from "../../../src/settings/enums/Layout"; -import { Client } from "../../pages/client"; -import { ElementAppPage } from "../../pages/ElementAppPage"; +import { type Client } from "../../pages/client"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; import { Bot } from "../../pages/bot"; // The avatar size used in the timeline diff --git a/playwright/e2e/utils.ts b/playwright/e2e/utils.ts index 49e7577bf6..49561ed1b4 100644 --- a/playwright/e2e/utils.ts +++ b/playwright/e2e/utils.ts @@ -12,7 +12,7 @@ import { uniqueId } from "lodash"; import { expect, type Page } from "@playwright/test"; import type { ClientEvent, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; -import { Client } from "../pages/client"; +import { type Client } from "../pages/client"; /** * Resolves when room state matches predicate. diff --git a/playwright/e2e/widgets/stickers.spec.ts b/playwright/e2e/widgets/stickers.spec.ts index 601dcd8b79..e7b86e411d 100644 --- a/playwright/e2e/widgets/stickers.spec.ts +++ b/playwright/e2e/widgets/stickers.spec.ts @@ -10,8 +10,8 @@ import * as fs from "node:fs"; import type { Page } from "@playwright/test"; import { test, expect } from "../../element-web-test"; -import { ElementAppPage } from "../../pages/ElementAppPage"; -import { Credentials } from "../../plugins/homeserver"; +import { type ElementAppPage } from "../../pages/ElementAppPage"; +import { type Credentials } from "../../plugins/homeserver"; import type { UserWidget } from "../../../src/utils/WidgetUtils-types.ts"; const STICKER_PICKER_WIDGET_ID = "fake-sticker-picker"; diff --git a/playwright/e2e/widgets/widget-pip-close.spec.ts b/playwright/e2e/widgets/widget-pip-close.spec.ts index ec3184ed6c..e8163b5ee2 100644 --- a/playwright/e2e/widgets/widget-pip-close.spec.ts +++ b/playwright/e2e/widgets/widget-pip-close.spec.ts @@ -11,7 +11,7 @@ Please see LICENSE files in the repository root for full details. import type { IWidget } from "matrix-widget-api/src/interfaces/IWidget"; import type { MatrixEvent, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import { test, expect } from "../../element-web-test"; -import { Client } from "../../pages/client"; +import { type Client } from "../../pages/client"; const DEMO_WIDGET_ID = "demo-widget-id"; const DEMO_WIDGET_NAME = "Demo Widget"; diff --git a/playwright/element-web-test.ts b/playwright/element-web-test.ts index 9468ddeec3..24124d5474 100644 --- a/playwright/element-web-test.ts +++ b/playwright/element-web-test.ts @@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details. import { expect as baseExpect, - Locator, - Page, - ExpectMatcherState, - ElementHandle, - PlaywrightTestArgs, - Fixtures as _Fixtures, + type Locator, + type Page, + type ExpectMatcherState, + type ElementHandle, + type PlaywrightTestArgs, + type Fixtures as _Fixtures, } from "@playwright/test"; import { sanitizeForFilePath } from "playwright-core/lib/utils"; import AxeBuilder from "@axe-core/playwright"; @@ -21,13 +21,13 @@ import _ from "lodash"; import { extname } from "node:path"; import type { IConfigOptions } from "../src/IConfigOptions"; -import { Credentials } from "./plugins/homeserver"; +import { type Credentials } from "./plugins/homeserver"; import { ElementAppPage } from "./pages/ElementAppPage"; import { Crypto } from "./pages/crypto"; import { Toasts } from "./pages/toasts"; -import { Bot, CreateBotOpts } from "./pages/bot"; +import { Bot, type CreateBotOpts } from "./pages/bot"; import { Webserver } from "./plugins/webserver"; -import { Options, Services, test as base } from "./services.ts"; +import { type Options, type Services, test as base } from "./services.ts"; // Enable experimental service worker support // See https://playwright.dev/docs/service-workers-experimental#how-to-enable diff --git a/playwright/logger.ts b/playwright/logger.ts index 857faaca69..da70582c38 100644 --- a/playwright/logger.ts +++ b/playwright/logger.ts @@ -5,8 +5,8 @@ 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 { BrowserContext, Page, TestInfo } from "@playwright/test"; -import { Readable } from "stream"; +import { type BrowserContext, type Page, type TestInfo } from "@playwright/test"; +import { type Readable } from "stream"; import stripAnsi from "strip-ansi"; export class Logger { diff --git a/playwright/pages/bot.ts b/playwright/pages/bot.ts index 28546bf546..ef6fc3861d 100644 --- a/playwright/pages/bot.ts +++ b/playwright/pages/bot.ts @@ -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 { JSHandle, Page } from "@playwright/test"; +import { type JSHandle, type Page } from "@playwright/test"; import { uniqueId } from "lodash"; import { type MatrixClient } from "matrix-js-sdk/src/matrix"; diff --git a/playwright/pages/client.ts b/playwright/pages/client.ts index d1ce3709d3..8296e9111e 100644 --- a/playwright/pages/client.ts +++ b/playwright/pages/client.ts @@ -6,8 +6,8 @@ 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 { JSHandle, Page } from "@playwright/test"; -import { PageFunctionOn } from "playwright-core/types/structs"; +import { type JSHandle, type Page } from "@playwright/test"; +import { type PageFunctionOn } from "playwright-core/types/structs"; import { Network } from "./network"; import type { @@ -28,7 +28,7 @@ import type { EmptyObject, } from "matrix-js-sdk/src/matrix"; import type { RoomMessageEventContent } from "matrix-js-sdk/src/types"; -import { Credentials } from "../plugins/homeserver"; +import { type Credentials } from "../plugins/homeserver"; export class Client { public network: Network; diff --git a/playwright/pages/crypto.ts b/playwright/pages/crypto.ts index c31e7fbedb..c882040987 100644 --- a/playwright/pages/crypto.ts +++ b/playwright/pages/crypto.ts @@ -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 { APIRequestContext, Page, expect } from "@playwright/test"; +import { type APIRequestContext, type Page, expect } from "@playwright/test"; -import { HomeserverInstance } from "../plugins/homeserver"; +import { type HomeserverInstance } from "../plugins/homeserver"; export class Crypto { public constructor( diff --git a/playwright/pages/settings.ts b/playwright/pages/settings.ts index 7dbd183233..a08ca65f34 100644 --- a/playwright/pages/settings.ts +++ b/playwright/pages/settings.ts @@ -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 { Locator, Page } from "@playwright/test"; +import { type Locator, type Page } from "@playwright/test"; import type { SettingLevel } from "../../src/settings/SettingLevel"; diff --git a/playwright/pages/toasts.ts b/playwright/pages/toasts.ts index 4fadfb9a9b..cfab354aaf 100644 --- a/playwright/pages/toasts.ts +++ b/playwright/pages/toasts.ts @@ -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 { Page, expect, Locator } from "@playwright/test"; +import { type Page, expect, type Locator } from "@playwright/test"; export class Toasts { public constructor(private readonly page: Page) {} diff --git a/playwright/plugins/homeserver/dendrite/index.ts b/playwright/plugins/homeserver/dendrite/index.ts index fb3537f417..bad52a869d 100644 --- a/playwright/plugins/homeserver/dendrite/index.ts +++ b/playwright/plugins/homeserver/dendrite/index.ts @@ -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 { Options } from "../../../services.ts"; +import { type Options } from "../../../services.ts"; export const isDendrite = ({ homeserverType }: Options): boolean => { return homeserverType === "dendrite" || homeserverType === "pinecone"; diff --git a/playwright/plugins/homeserver/index.ts b/playwright/plugins/homeserver/index.ts index e5359ad454..04b1ad77f3 100644 --- a/playwright/plugins/homeserver/index.ts +++ b/playwright/plugins/homeserver/index.ts @@ -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 { ClientServerApi } from "../utils/api.ts"; +import { type ClientServerApi } from "../utils/api.ts"; export interface HomeserverInstance { readonly baseUrl: string; diff --git a/playwright/plugins/homeserver/synapse/consentHomeserver.ts b/playwright/plugins/homeserver/synapse/consentHomeserver.ts index 7c57e16d22..83d47512cf 100644 --- a/playwright/plugins/homeserver/synapse/consentHomeserver.ts +++ b/playwright/plugins/homeserver/synapse/consentHomeserver.ts @@ -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 { Fixtures } from "../../../element-web-test.ts"; +import { type Fixtures } from "../../../element-web-test.ts"; export const consentHomeserver: Fixtures = { _homeserver: [ diff --git a/playwright/plugins/homeserver/synapse/emailHomeserver.ts b/playwright/plugins/homeserver/synapse/emailHomeserver.ts index b6602b977b..889d2a57d8 100644 --- a/playwright/plugins/homeserver/synapse/emailHomeserver.ts +++ b/playwright/plugins/homeserver/synapse/emailHomeserver.ts @@ -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 { Fixtures } from "../../../element-web-test.ts"; +import { type Fixtures } from "../../../element-web-test.ts"; export const emailHomeserver: Fixtures = { _homeserver: [ diff --git a/playwright/plugins/homeserver/synapse/legacyOAuthHomeserver.ts b/playwright/plugins/homeserver/synapse/legacyOAuthHomeserver.ts index 7414fdb015..b6ef7243fd 100644 --- a/playwright/plugins/homeserver/synapse/legacyOAuthHomeserver.ts +++ b/playwright/plugins/homeserver/synapse/legacyOAuthHomeserver.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import { TestContainers } from "testcontainers"; import { OAuthServer } from "../../oauth_server"; -import { Fixtures } from "../../../element-web-test.ts"; +import { type Fixtures } from "../../../element-web-test.ts"; export const legacyOAuthHomeserver: Fixtures = { oAuthServer: [ diff --git a/playwright/plugins/homeserver/synapse/masHomeserver.ts b/playwright/plugins/homeserver/synapse/masHomeserver.ts index 0cb70835c7..96fcc80bdd 100644 --- a/playwright/plugins/homeserver/synapse/masHomeserver.ts +++ b/playwright/plugins/homeserver/synapse/masHomeserver.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { MatrixAuthenticationServiceContainer } from "../../../testcontainers/mas.ts"; -import { Fixtures } from "../../../element-web-test.ts"; +import { type Fixtures } from "../../../element-web-test.ts"; export const masHomeserver: Fixtures = { mas: [ diff --git a/playwright/plugins/homeserver/synapse/uiaLongSessionTimeoutHomeserver.ts b/playwright/plugins/homeserver/synapse/uiaLongSessionTimeoutHomeserver.ts index 87d2a0f752..ee11a966fd 100644 --- a/playwright/plugins/homeserver/synapse/uiaLongSessionTimeoutHomeserver.ts +++ b/playwright/plugins/homeserver/synapse/uiaLongSessionTimeoutHomeserver.ts @@ -5,7 +5,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 { Fixtures } from "../../../element-web-test.ts"; +import { type Fixtures } from "../../../element-web-test.ts"; export const uiaLongSessionTimeoutHomeserver: Fixtures = { synapseConfig: [ diff --git a/playwright/plugins/oauth_server/index.ts b/playwright/plugins/oauth_server/index.ts index df5ee0f461..8a7e9cd8ba 100644 --- a/playwright/plugins/oauth_server/index.ts +++ b/playwright/plugins/oauth_server/index.ts @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import http from "http"; import express from "express"; -import { AddressInfo } from "net"; -import { TestInfo } from "@playwright/test"; +import { type AddressInfo } from "net"; +import { type TestInfo } from "@playwright/test"; import { randB64Bytes } from "../utils/rand.ts"; diff --git a/playwright/plugins/utils/api.ts b/playwright/plugins/utils/api.ts index 40dade1302..90c0e2739f 100644 --- a/playwright/plugins/utils/api.ts +++ b/playwright/plugins/utils/api.ts @@ -5,9 +5,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 { APIRequestContext } from "@playwright/test"; +import { type APIRequestContext } from "@playwright/test"; -import { Credentials } from "../homeserver"; +import { type Credentials } from "../homeserver"; export type Verb = "GET" | "POST" | "PUT" | "DELETE"; diff --git a/playwright/plugins/webserver/index.ts b/playwright/plugins/webserver/index.ts index 7645e9cff3..ba9b9e9706 100644 --- a/playwright/plugins/webserver/index.ts +++ b/playwright/plugins/webserver/index.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import * as http from "http"; -import { AddressInfo } from "net"; +import { type AddressInfo } from "net"; export class Webserver { private server?: http.Server; diff --git a/playwright/services.ts b/playwright/services.ts index 1b7514662a..162f4e9fbb 100644 --- a/playwright/services.ts +++ b/playwright/services.ts @@ -6,18 +6,18 @@ Please see LICENSE files in the repository root for full details. */ import { test as base } from "@playwright/test"; -import { MailpitClient } from "mailpit-api"; -import { Network, StartedNetwork } from "testcontainers"; -import { PostgreSqlContainer, StartedPostgreSqlContainer } from "@testcontainers/postgresql"; +import { type MailpitClient } from "mailpit-api"; +import { Network, type StartedNetwork } from "testcontainers"; +import { PostgreSqlContainer, type StartedPostgreSqlContainer } from "@testcontainers/postgresql"; -import { SynapseConfig, SynapseContainer } from "./testcontainers/synapse.ts"; +import { type SynapseConfig, SynapseContainer } from "./testcontainers/synapse.ts"; import { Logger } from "./logger.ts"; -import { StartedMatrixAuthenticationServiceContainer } from "./testcontainers/mas.ts"; -import { HomeserverContainer, StartedHomeserverContainer } from "./testcontainers/HomeserverContainer.ts"; -import { MailhogContainer, StartedMailhogContainer } from "./testcontainers/mailpit.ts"; -import { OAuthServer } from "./plugins/oauth_server"; +import { type StartedMatrixAuthenticationServiceContainer } from "./testcontainers/mas.ts"; +import { type HomeserverContainer, type StartedHomeserverContainer } from "./testcontainers/HomeserverContainer.ts"; +import { MailhogContainer, type StartedMailhogContainer } from "./testcontainers/mailpit.ts"; +import { type OAuthServer } from "./plugins/oauth_server"; import { DendriteContainer, PineconeContainer } from "./testcontainers/dendrite.ts"; -import { HomeserverType } from "./plugins/homeserver"; +import { type HomeserverType } from "./plugins/homeserver"; export interface TestFixtures { mailpitClient: MailpitClient; diff --git a/playwright/testcontainers/HomeserverContainer.ts b/playwright/testcontainers/HomeserverContainer.ts index 259ecb7fe0..d5be8c5301 100644 --- a/playwright/testcontainers/HomeserverContainer.ts +++ b/playwright/testcontainers/HomeserverContainer.ts @@ -5,11 +5,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 { AbstractStartedContainer, GenericContainer } from "testcontainers"; -import { APIRequestContext, TestInfo } from "@playwright/test"; +import { type AbstractStartedContainer, type GenericContainer } from "testcontainers"; +import { type APIRequestContext, type TestInfo } from "@playwright/test"; -import { HomeserverInstance } from "../plugins/homeserver"; -import { StartedMatrixAuthenticationServiceContainer } from "./mas.ts"; +import { type HomeserverInstance } from "../plugins/homeserver"; +import { type StartedMatrixAuthenticationServiceContainer } from "./mas.ts"; export interface HomeserverContainer extends GenericContainer { withConfigField(key: string, value: any): this; diff --git a/playwright/testcontainers/dendrite.ts b/playwright/testcontainers/dendrite.ts index 58ab844a7c..edf9dba91d 100644 --- a/playwright/testcontainers/dendrite.ts +++ b/playwright/testcontainers/dendrite.ts @@ -12,8 +12,8 @@ import { set } from "lodash"; import { randB64Bytes } from "../plugins/utils/rand.ts"; import { StartedSynapseContainer } from "./synapse.ts"; import { deepCopy } from "../plugins/utils/object.ts"; -import { HomeserverContainer } from "./HomeserverContainer.ts"; -import { StartedMatrixAuthenticationServiceContainer } from "./mas.ts"; +import { type HomeserverContainer } from "./HomeserverContainer.ts"; +import { type StartedMatrixAuthenticationServiceContainer } from "./mas.ts"; const DEFAULT_CONFIG = { version: 2, diff --git a/playwright/testcontainers/mailpit.ts b/playwright/testcontainers/mailpit.ts index c4c025c05c..6c47f9ab37 100644 --- a/playwright/testcontainers/mailpit.ts +++ b/playwright/testcontainers/mailpit.ts @@ -5,7 +5,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 { AbstractStartedContainer, GenericContainer, StartedTestContainer, Wait } from "testcontainers"; +import { AbstractStartedContainer, GenericContainer, type StartedTestContainer, Wait } from "testcontainers"; import { MailpitClient } from "mailpit-api"; export class MailhogContainer extends GenericContainer { diff --git a/playwright/testcontainers/mas.ts b/playwright/testcontainers/mas.ts index 9162bc96e3..bdd071ebc2 100644 --- a/playwright/testcontainers/mas.ts +++ b/playwright/testcontainers/mas.ts @@ -5,13 +5,19 @@ 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 { AbstractStartedContainer, GenericContainer, StartedTestContainer, Wait, ExecResult } from "testcontainers"; -import { StartedPostgreSqlContainer } from "@testcontainers/postgresql"; +import { + AbstractStartedContainer, + GenericContainer, + type StartedTestContainer, + Wait, + type ExecResult, +} from "testcontainers"; +import { type StartedPostgreSqlContainer } from "@testcontainers/postgresql"; import * as YAML from "yaml"; import { getFreePort } from "../plugins/utils/port.ts"; import { deepCopy } from "../plugins/utils/object.ts"; -import { Credentials } from "../plugins/homeserver"; +import { type Credentials } from "../plugins/homeserver"; const DEFAULT_CONFIG = { http: { diff --git a/playwright/testcontainers/synapse.ts b/playwright/testcontainers/synapse.ts index f4ee2d8e08..c469c6d6a7 100644 --- a/playwright/testcontainers/synapse.ts +++ b/playwright/testcontainers/synapse.ts @@ -5,19 +5,25 @@ 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 { AbstractStartedContainer, GenericContainer, RestartOptions, StartedTestContainer, Wait } from "testcontainers"; -import { APIRequestContext, TestInfo } from "@playwright/test"; +import { + AbstractStartedContainer, + GenericContainer, + type RestartOptions, + type StartedTestContainer, + Wait, +} from "testcontainers"; +import { type APIRequestContext, type TestInfo } from "@playwright/test"; import crypto from "node:crypto"; import * as YAML from "yaml"; import { set } from "lodash"; import { getFreePort } from "../plugins/utils/port.ts"; import { randB64Bytes } from "../plugins/utils/rand.ts"; -import { Credentials } from "../plugins/homeserver"; +import { type Credentials } from "../plugins/homeserver"; import { deepCopy } from "../plugins/utils/object.ts"; -import { HomeserverContainer, StartedHomeserverContainer } from "./HomeserverContainer.ts"; -import { StartedMatrixAuthenticationServiceContainer } from "./mas.ts"; -import { Api, ClientServerApi, Verb } from "../plugins/utils/api.ts"; +import { type HomeserverContainer, type StartedHomeserverContainer } from "./HomeserverContainer.ts"; +import { type StartedMatrixAuthenticationServiceContainer } from "./mas.ts"; +import { Api, ClientServerApi, type Verb } from "../plugins/utils/api.ts"; const TAG = "develop@sha256:06b88d1ca4985c50db14aa5cf4ec83d19dc1ad30ad33b79233493ccd169a477f"; diff --git a/src/@types/common.ts b/src/@types/common.ts index cdf969a698..85e0b95043 100644 --- a/src/@types/common.ts +++ b/src/@types/common.ts @@ -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 { JSXElementConstructor } from "react"; +import { type JSXElementConstructor } from "react"; export type { NonEmptyArray, XOR, Writeable } from "matrix-js-sdk/src/matrix"; diff --git a/src/@types/commonmark.ts b/src/@types/commonmark.ts index 2d3be1b243..dde24d0251 100644 --- a/src/@types/commonmark.ts +++ b/src/@types/commonmark.ts @@ -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 * as commonmark from "commonmark"; +import type * as commonmark from "commonmark"; declare module "commonmark" { export type Attr = [key: string, value: string]; diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index c76c43f829..0829a8d47e 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -11,40 +11,40 @@ import "matrix-js-sdk/src/@types/global"; // load matrix-js-sdk's type extension import "@types/modernizr"; import type { logger } from "matrix-js-sdk/src/logger"; -import ContentMessages from "../ContentMessages"; -import { IMatrixClientPeg } from "../MatrixClientPeg"; -import ToastStore from "../stores/ToastStore"; -import DeviceListener from "../DeviceListener"; -import { RoomListStore } from "../stores/room-list/Interface"; -import { PlatformPeg } from "../PlatformPeg"; -import RoomListLayoutStore from "../stores/room-list/RoomListLayoutStore"; -import { IntegrationManagers } from "../integrations/IntegrationManagers"; -import { ModalManager } from "../Modal"; -import SettingsStore from "../settings/SettingsStore"; -import { Notifier } from "../Notifier"; -import RightPanelStore from "../stores/right-panel/RightPanelStore"; -import WidgetStore from "../stores/WidgetStore"; -import LegacyCallHandler from "../LegacyCallHandler"; -import UserActivity from "../UserActivity"; -import { ModalWidgetStore } from "../stores/ModalWidgetStore"; -import { WidgetLayoutStore } from "../stores/widgets/WidgetLayoutStore"; -import VoipUserMapper from "../VoipUserMapper"; -import { SpaceStoreClass } from "../stores/spaces/SpaceStore"; -import TypingStore from "../stores/TypingStore"; -import { EventIndexPeg } from "../indexing/EventIndexPeg"; -import { VoiceRecordingStore } from "../stores/VoiceRecordingStore"; -import PerformanceMonitor from "../performance"; -import UIStore from "../stores/UIStore"; -import { SetupEncryptionStore } from "../stores/SetupEncryptionStore"; -import { RoomScrollStateStore } from "../stores/RoomScrollStateStore"; -import { ConsoleLogger, IndexedDBLogStore } from "../rageshake/rageshake"; -import ActiveWidgetStore from "../stores/ActiveWidgetStore"; -import AutoRageshakeStore from "../stores/AutoRageshakeStore"; -import { IConfigOptions } from "../IConfigOptions"; -import { MatrixDispatcher } from "../dispatcher/dispatcher"; -import { DeepReadonly } from "./common"; -import MatrixChat from "../components/structures/MatrixChat"; -import { InitialCryptoSetupStore } from "../stores/InitialCryptoSetupStore"; +import type ContentMessages from "../ContentMessages"; +import { type IMatrixClientPeg } from "../MatrixClientPeg"; +import type ToastStore from "../stores/ToastStore"; +import type DeviceListener from "../DeviceListener"; +import { type RoomListStore } from "../stores/room-list/Interface"; +import { type PlatformPeg } from "../PlatformPeg"; +import type RoomListLayoutStore from "../stores/room-list/RoomListLayoutStore"; +import { type IntegrationManagers } from "../integrations/IntegrationManagers"; +import { type ModalManager } from "../Modal"; +import type SettingsStore from "../settings/SettingsStore"; +import { type Notifier } from "../Notifier"; +import type RightPanelStore from "../stores/right-panel/RightPanelStore"; +import type WidgetStore from "../stores/WidgetStore"; +import type LegacyCallHandler from "../LegacyCallHandler"; +import type UserActivity from "../UserActivity"; +import { type ModalWidgetStore } from "../stores/ModalWidgetStore"; +import { type WidgetLayoutStore } from "../stores/widgets/WidgetLayoutStore"; +import type VoipUserMapper from "../VoipUserMapper"; +import { type SpaceStoreClass } from "../stores/spaces/SpaceStore"; +import type TypingStore from "../stores/TypingStore"; +import { type EventIndexPeg } from "../indexing/EventIndexPeg"; +import { type VoiceRecordingStore } from "../stores/VoiceRecordingStore"; +import type PerformanceMonitor from "../performance"; +import type UIStore from "../stores/UIStore"; +import { type SetupEncryptionStore } from "../stores/SetupEncryptionStore"; +import { type RoomScrollStateStore } from "../stores/RoomScrollStateStore"; +import { type ConsoleLogger, type IndexedDBLogStore } from "../rageshake/rageshake"; +import type ActiveWidgetStore from "../stores/ActiveWidgetStore"; +import type AutoRageshakeStore from "../stores/AutoRageshakeStore"; +import { type IConfigOptions } from "../IConfigOptions"; +import { type MatrixDispatcher } from "../dispatcher/dispatcher"; +import { type DeepReadonly } from "./common"; +import type MatrixChat from "../components/structures/MatrixChat"; +import { type InitialCryptoSetupStore } from "../stores/InitialCryptoSetupStore"; /* eslint-disable @typescript-eslint/naming-convention */ diff --git a/src/@types/react.d.ts b/src/@types/react.d.ts index b1f6352adb..d66c22e56f 100644 --- a/src/@types/react.d.ts +++ b/src/@types/react.d.ts @@ -6,7 +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, { PropsWithChildren } from "react"; +import { type PropsWithChildren } from "react"; + +import type React from "react"; declare module "react" { // Fix forwardRef types for Generic components - https://stackoverflow.com/a/58473012 diff --git a/src/AddThreepid.ts b/src/AddThreepid.ts index 10c28bfc4a..8924399886 100644 --- a/src/AddThreepid.ts +++ b/src/AddThreepid.ts @@ -9,21 +9,23 @@ Please see LICENSE files in the repository root for full details. */ import { - IAddThreePidOnlyBody, - IRequestMsisdnTokenResponse, - IRequestTokenResponse, - MatrixClient, + type IAddThreePidOnlyBody, + type IRequestMsisdnTokenResponse, + type IRequestTokenResponse, + type MatrixClient, MatrixError, HTTPError, - IThreepid, - UIAResponse, + type IThreepid, + type UIAResponse, } from "matrix-js-sdk/src/matrix"; import Modal from "./Modal"; import { _t, UserFriendlyError } from "./languageHandler"; import IdentityAuthClient from "./IdentityAuthClient"; import { SSOAuthEntry } from "./components/views/auth/InteractiveAuthEntryComponents"; -import InteractiveAuthDialog, { InteractiveAuthDialogProps } from "./components/views/dialogs/InteractiveAuthDialog"; +import InteractiveAuthDialog, { + type InteractiveAuthDialogProps, +} from "./components/views/dialogs/InteractiveAuthDialog"; function getIdServerDomain(matrixClient: MatrixClient): string { const idBaseUrl = matrixClient.getIdentityServerUrl(true); diff --git a/src/AsyncWrapper.tsx b/src/AsyncWrapper.tsx index e1b80c9d5a..e3d9c2f524 100644 --- a/src/AsyncWrapper.tsx +++ b/src/AsyncWrapper.tsx @@ -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 React, { ReactNode, Suspense } from "react"; +import React, { type ReactNode, Suspense } from "react"; import { _t } from "./languageHandler"; import BaseDialog from "./components/views/dialogs/BaseDialog"; diff --git a/src/Avatar.ts b/src/Avatar.ts index a6725710d1..abddfd87f1 100644 --- a/src/Avatar.ts +++ b/src/Avatar.ts @@ -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 { RoomMember, User, Room, ResizeMethod } from "matrix-js-sdk/src/matrix"; +import { type RoomMember, type User, type Room, type ResizeMethod } from "matrix-js-sdk/src/matrix"; import { useIdColorHash } from "@vector-im/compound-web"; import DMRoomMap from "./utils/DMRoomMap"; diff --git a/src/BasePlatform.ts b/src/BasePlatform.ts index db4802d4bb..2093881cc5 100644 --- a/src/BasePlatform.ts +++ b/src/BasePlatform.ts @@ -10,25 +10,25 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixClient, - MatrixEvent, - Room, - SSOAction, + type MatrixClient, + type MatrixEvent, + type Room, + type SSOAction, encodeUnpaddedBase64, - OidcRegistrationClientMetadata, + type OidcRegistrationClientMetadata, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import dis from "./dispatcher/dispatcher"; -import BaseEventIndexManager from "./indexing/BaseEventIndexManager"; -import { ActionPayload } from "./dispatcher/payloads"; -import { CheckUpdatesPayload } from "./dispatcher/payloads/CheckUpdatesPayload"; +import type BaseEventIndexManager from "./indexing/BaseEventIndexManager"; +import { type ActionPayload } from "./dispatcher/payloads"; +import { type CheckUpdatesPayload } from "./dispatcher/payloads/CheckUpdatesPayload"; import { Action } from "./dispatcher/actions"; import { hideToast as hideUpdateToast } from "./toasts/UpdateToast"; import { MatrixClientPeg } from "./MatrixClientPeg"; import { idbLoad, idbSave, idbDelete } from "./utils/StorageAccess"; -import { ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; -import { IConfigOptions } from "./IConfigOptions"; +import { type ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; +import { type IConfigOptions } from "./IConfigOptions"; import SdkConfig from "./SdkConfig"; import { buildAndEncodePickleKey, encryptPickleKey } from "./utils/tokens/pickling"; import Favicon from "./favicon.ts"; diff --git a/src/BlurhashEncoder.ts b/src/BlurhashEncoder.ts index aef0746dbe..ab6969d0c8 100644 --- a/src/BlurhashEncoder.ts +++ b/src/BlurhashEncoder.ts @@ -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 { Request, Response } from "./workers/blurhash.worker.ts"; +import { type Request, type Response } from "./workers/blurhash.worker.ts"; import { WorkerManager } from "./WorkerManager"; import blurhashWorkerFactory from "./workers/blurhashWorkerFactory"; diff --git a/src/ContentMessages.ts b/src/ContentMessages.ts index 060c8ab994..c5e34d7130 100644 --- a/src/ContentMessages.ts +++ b/src/ContentMessages.ts @@ -9,23 +9,23 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixClient, + type MatrixClient, MsgType, HTTPError, - IEventRelation, - ISendEventResponse, - MatrixEvent, - UploadOpts, - UploadProgress, + type IEventRelation, + type ISendEventResponse, + type MatrixEvent, + type UploadOpts, + type UploadProgress, THREAD_RELATION_TYPE, } from "matrix-js-sdk/src/matrix"; import { - ImageInfo, - AudioInfo, - VideoInfo, - EncryptedFile, - MediaEventContent, - MediaEventInfo, + type ImageInfo, + type AudioInfo, + type VideoInfo, + type EncryptedFile, + type MediaEventContent, + type MediaEventInfo, } from "matrix-js-sdk/src/types"; import encrypt from "matrix-encrypt-attachment"; import extractPngChunks from "png-chunks-extract"; @@ -38,11 +38,11 @@ import Modal from "./Modal"; import Spinner from "./components/views/elements/Spinner"; import { Action } from "./dispatcher/actions"; import { - UploadCanceledPayload, - UploadErrorPayload, - UploadFinishedPayload, - UploadProgressPayload, - UploadStartedPayload, + type UploadCanceledPayload, + type UploadErrorPayload, + type UploadFinishedPayload, + type UploadProgressPayload, + type UploadStartedPayload, } from "./dispatcher/payloads/UploadPayload"; import { RoomUpload } from "./models/RoomUpload"; import SettingsStore from "./settings/SettingsStore"; diff --git a/src/CreateCrossSigning.ts b/src/CreateCrossSigning.ts index d3834bd260..cb1eb528af 100644 --- a/src/CreateCrossSigning.ts +++ b/src/CreateCrossSigning.ts @@ -7,7 +7,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 { AuthDict, MatrixClient, MatrixError, UIAResponse } from "matrix-js-sdk/src/matrix"; +import { type AuthDict, type MatrixClient, MatrixError, type UIAResponse } from "matrix-js-sdk/src/matrix"; import { SSOAuthEntry } from "./components/views/auth/InteractiveAuthEntryComponents"; import Modal from "./Modal"; diff --git a/src/DateUtils.ts b/src/DateUtils.ts index 7c7b7dd7e6..821b866e0b 100644 --- a/src/DateUtils.ts +++ b/src/DateUtils.ts @@ -8,7 +8,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 { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import { _t, getUserLanguage } from "./languageHandler"; import { getUserTimezone } from "./TimezoneHandler"; diff --git a/src/DecryptionFailureTracker.ts b/src/DecryptionFailureTracker.ts index 6a226ad3fe..8725a0db0d 100644 --- a/src/DecryptionFailureTracker.ts +++ b/src/DecryptionFailureTracker.ts @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import ScalableBloomFilter from "bloom-filters/dist/bloom/scalable-bloom-filter"; -import { HttpApiEvent, MatrixClient, MatrixEventEvent, MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { Error as ErrorEvent } from "@matrix-org/analytics-events/types/typescript/Error"; +import { HttpApiEvent, type MatrixClient, MatrixEventEvent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type Error as ErrorEvent } from "@matrix-org/analytics-events/types/typescript/Error"; import { DecryptionFailureCode, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; import { PosthogAnalytics } from "./PosthogAnalytics"; diff --git a/src/DeviceListener.ts b/src/DeviceListener.ts index e50f0d3f9b..d4d40a9124 100644 --- a/src/DeviceListener.ts +++ b/src/DeviceListener.ts @@ -7,17 +7,17 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixEvent, + type MatrixEvent, ClientEvent, EventType, - MatrixClient, + type MatrixClient, RoomStateEvent, - SyncState, + type SyncState, ClientStoppedError, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { CryptoEvent, KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; -import { CryptoSessionStateChange } from "@matrix-org/analytics-events/types/typescript/CryptoSessionStateChange"; +import { CryptoEvent, type KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; +import { type CryptoSessionStateChange } from "@matrix-org/analytics-events/types/typescript/CryptoSessionStateChange"; import { PosthogAnalytics } from "./PosthogAnalytics"; import dis from "./dispatcher/dispatcher"; @@ -35,12 +35,12 @@ import { showToast as showUnverifiedSessionsToast, } from "./toasts/UnverifiedSessionToast"; import { isSecretStorageBeingAccessed } from "./SecurityManager"; -import { ActionPayload } from "./dispatcher/payloads"; +import { type ActionPayload } from "./dispatcher/payloads"; import { Action } from "./dispatcher/actions"; import SdkConfig from "./SdkConfig"; import PlatformPeg from "./PlatformPeg"; import { recordClientInformation, removeClientInformation } from "./utils/device/clientInformation"; -import SettingsStore, { CallbackFn } from "./settings/SettingsStore"; +import SettingsStore, { type CallbackFn } from "./settings/SettingsStore"; import { UIFeature } from "./settings/UIFeature"; import { isBulkUnverifiedDeviceReminderSnoozed } from "./utils/device/snoozeBulkUnverifiedDeviceReminder"; import { getUserDeviceIds } from "./utils/crypto/deviceInfo"; diff --git a/src/Editing.ts b/src/Editing.ts index 3b8d2d393a..063533f7e5 100644 --- a/src/Editing.ts +++ b/src/Editing.ts @@ -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 { TimelineRenderingType } from "./contexts/RoomContext"; +import { type TimelineRenderingType } from "./contexts/RoomContext"; export const editorRoomKey = (roomId: string, context: TimelineRenderingType): string => `mx_edit_room_${roomId}_${context}`; diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx index d635b23221..0a6243a12d 100644 --- a/src/HtmlUtils.tsx +++ b/src/HtmlUtils.tsx @@ -9,13 +9,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, { LegacyRef, ReactNode } from "react"; -import sanitizeHtml, { IOptions } from "sanitize-html"; +import React, { type LegacyRef, type ReactNode } from "react"; +import sanitizeHtml, { type IOptions } from "sanitize-html"; import classNames from "classnames"; import katex from "katex"; import { decode } from "html-entities"; -import { IContent } from "matrix-js-sdk/src/matrix"; -import { Optional } from "matrix-events-sdk"; +import { type IContent } from "matrix-js-sdk/src/matrix"; +import { type Optional } from "matrix-events-sdk"; import escapeHtml from "escape-html"; import { getEmojiFromUnicode } from "@matrix-org/emojibase-bindings"; diff --git a/src/IConfigOptions.ts b/src/IConfigOptions.ts index bbb377e07b..33ebba98e3 100644 --- a/src/IConfigOptions.ts +++ b/src/IConfigOptions.ts @@ -7,9 +7,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 { IClientWellKnown } from "matrix-js-sdk/src/matrix"; +import { type IClientWellKnown } from "matrix-js-sdk/src/matrix"; -import { ValidatedServerConfig } from "./utils/ValidatedServerConfig"; +import { type ValidatedServerConfig } from "./utils/ValidatedServerConfig"; // Convention decision: All config options are lower_snake_case // We use an isolated file for the interface so we can mess around with the eslint options. diff --git a/src/IdentityAuthClient.tsx b/src/IdentityAuthClient.tsx index ce20bc92ed..76c151c282 100644 --- a/src/IdentityAuthClient.tsx +++ b/src/IdentityAuthClient.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { SERVICE_TYPES, createClient, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { SERVICE_TYPES, createClient, type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "./MatrixClientPeg"; diff --git a/src/KeyBindingsDefaults.ts b/src/KeyBindingsDefaults.ts index 3a4412c5db..0ab6acf030 100644 --- a/src/KeyBindingsDefaults.ts +++ b/src/KeyBindingsDefaults.ts @@ -10,7 +10,7 @@ Please see LICENSE files in the repository root for full details. import { IS_MAC, Key } from "./Keyboard"; import SettingsStore from "./settings/SettingsStore"; import SdkConfig from "./SdkConfig"; -import { IKeyBindingsProvider, KeyBinding } from "./KeyBindingsManager"; +import { type IKeyBindingsProvider, type KeyBinding } from "./KeyBindingsManager"; import { CATEGORIES, CategoryName, KeyBindingAction } from "./accessibility/KeyboardShortcuts"; import { getKeyboardShortcuts } from "./accessibility/KeyboardShortcutUtils"; diff --git a/src/KeyBindingsManager.ts b/src/KeyBindingsManager.ts index 5c8bccbfd0..bef954f8fe 100644 --- a/src/KeyBindingsManager.ts +++ b/src/KeyBindingsManager.ts @@ -7,7 +7,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 { KeyBindingAction } from "./accessibility/KeyboardShortcuts"; +import { type KeyBindingAction } from "./accessibility/KeyboardShortcuts"; import { defaultBindingsProvider } from "./KeyBindingsDefaults"; import { IS_MAC } from "./Keyboard"; diff --git a/src/Keyboard.ts b/src/Keyboard.ts index 59c6bf77cf..de7ab059c6 100644 --- a/src/Keyboard.ts +++ b/src/Keyboard.ts @@ -8,7 +8,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 React from "react"; +import type React from "react"; export const Key = { HOME: "Home", diff --git a/src/LegacyCallHandler.tsx b/src/LegacyCallHandler.tsx index 8aaa32f471..4361d3d027 100644 --- a/src/LegacyCallHandler.tsx +++ b/src/LegacyCallHandler.tsx @@ -12,14 +12,14 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { MatrixError, RuleId, TweakName, SyncState, TypedEventEmitter } from "matrix-js-sdk/src/matrix"; import { - CallError, + type CallError, CallErrorCode, CallEvent, CallParty, CallState, CallType, FALLBACK_ICE_SERVER, - MatrixCall, + type MatrixCall, } from "matrix-js-sdk/src/webrtc/call"; import { logger } from "matrix-js-sdk/src/logger"; import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; @@ -48,9 +48,9 @@ import { Container, WidgetLayoutStore } from "./stores/widgets/WidgetLayoutStore import IncomingLegacyCallToast, { getIncomingLegacyCallToastKey } from "./toasts/IncomingLegacyCallToast"; import ToastStore from "./stores/ToastStore"; import Resend from "./Resend"; -import { ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; import { InviteKind } from "./components/views/dialogs/InviteDialogTypes"; -import { OpenInviteDialogPayload } from "./dispatcher/payloads/OpenInviteDialogPayload"; +import { type OpenInviteDialogPayload } from "./dispatcher/payloads/OpenInviteDialogPayload"; import { findDMForUser } from "./utils/dm/findDMForUser"; import { getJoinedNonFunctionalMembers } from "./utils/room/getJoinedNonFunctionalMembers"; import { localNotificationsAreSilenced } from "./utils/notifications"; diff --git a/src/Lifecycle.ts b/src/Lifecycle.ts index 80b08c8840..3ef7c56e82 100644 --- a/src/Lifecycle.ts +++ b/src/Lifecycle.ts @@ -9,13 +9,19 @@ 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 { ReactNode } from "react"; -import { createClient, MatrixClient, SSOAction, OidcTokenRefresher, decodeBase64 } from "matrix-js-sdk/src/matrix"; -import { AESEncryptedSecretStoragePayload } from "matrix-js-sdk/src/types"; -import { QueryDict } from "matrix-js-sdk/src/utils"; +import { type ReactNode } from "react"; +import { + createClient, + type MatrixClient, + SSOAction, + type OidcTokenRefresher, + decodeBase64, +} from "matrix-js-sdk/src/matrix"; +import { type AESEncryptedSecretStoragePayload } from "matrix-js-sdk/src/types"; +import { type QueryDict } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; -import { IMatrixClientCreds, MatrixClientPeg, MatrixClientPegAssignOpts } from "./MatrixClientPeg"; +import { type IMatrixClientCreds, MatrixClientPeg, type MatrixClientPegAssignOpts } from "./MatrixClientPeg"; import { ModuleRunner } from "./modules/ModuleRunner"; import EventIndexPeg from "./indexing/EventIndexPeg"; import createMatrixClient from "./utils/createMatrixClient"; @@ -50,12 +56,12 @@ import { setSentryUser } from "./sentry"; import SdkConfig from "./SdkConfig"; import { DialogOpener } from "./utils/DialogOpener"; import { Action } from "./dispatcher/actions"; -import { OverwriteLoginPayload } from "./dispatcher/payloads/OverwriteLoginPayload"; +import { type OverwriteLoginPayload } from "./dispatcher/payloads/OverwriteLoginPayload"; import { SdkContextClass } from "./contexts/SDKContext"; import { messageForLoginError } from "./utils/ErrorUtils"; import { completeOidcLogin } from "./utils/oidc/authorize"; import { getOidcErrorMessage } from "./utils/oidc/error"; -import { OidcClientStore } from "./stores/oidc/OidcClientStore"; +import { type OidcClientStore } from "./stores/oidc/OidcClientStore"; import { getStoredOidcClientId, getStoredOidcIdTokenClaims, diff --git a/src/Linkify.tsx b/src/Linkify.tsx index db4c70228a..a51b312d48 100644 --- a/src/Linkify.tsx +++ b/src/Linkify.tsx @@ -6,8 +6,8 @@ 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 sanitizeHtml, { IOptions } from "sanitize-html"; +import React, { type ReactElement } from "react"; +import sanitizeHtml, { type IOptions } from "sanitize-html"; import { merge } from "lodash"; import _Linkify from "linkify-react"; diff --git a/src/Livestream.ts b/src/Livestream.ts index 9cda793385..5fa315b442 100644 --- a/src/Livestream.ts +++ b/src/Livestream.ts @@ -6,8 +6,8 @@ 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 { ClientWidgetApi } from "matrix-widget-api"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type ClientWidgetApi } from "matrix-widget-api"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import SdkConfig from "./SdkConfig"; import { ElementWidgetActions } from "./stores/widgets/ElementWidgetActions"; diff --git a/src/Login.ts b/src/Login.ts index aa84ad3c86..cbaab1cb34 100644 --- a/src/Login.ts +++ b/src/Login.ts @@ -9,19 +9,19 @@ Please see LICENSE files in the repository root for full details. import { createClient, - MatrixClient, - LoginFlow, + type MatrixClient, + type LoginFlow, DELEGATED_OIDC_COMPATIBILITY, - ILoginFlow, - LoginRequest, - OidcClientConfig, + type ILoginFlow, + type LoginRequest, + type OidcClientConfig, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { IMatrixClientCreds } from "./MatrixClientPeg"; +import { type IMatrixClientCreds } from "./MatrixClientPeg"; import { ModuleRunner } from "./modules/ModuleRunner"; import { getOidcClientId } from "./utils/oidc/registerClient"; -import { IConfigOptions } from "./IConfigOptions"; +import { type IConfigOptions } from "./IConfigOptions"; import SdkConfig from "./SdkConfig"; import { isUserRegistrationSupported } from "./utils/oidc/isUserRegistrationSupported"; diff --git a/src/MatrixClientPeg.ts b/src/MatrixClientPeg.ts index e14bfdcf30..81a73ffccc 100644 --- a/src/MatrixClientPeg.ts +++ b/src/MatrixClientPeg.ts @@ -12,14 +12,14 @@ Please see LICENSE files in the repository root for full details. import { EventTimeline, EventTimelineSet, - ICreateClientOpts, - IStartClientOpts, - MatrixClient, + type ICreateClientOpts, + type IStartClientOpts, + type MatrixClient, MemoryStore, PendingEventOrdering, - RoomNameState, + type RoomNameState, RoomNameType, - TokenRefreshFunction, + type TokenRefreshFunction, } from "matrix-js-sdk/src/matrix"; import { VerificationMethod } from "matrix-js-sdk/src/types"; import * as utils from "matrix-js-sdk/src/utils"; diff --git a/src/Modal.tsx b/src/Modal.tsx index 31ad6b9bfc..d40f286da7 100644 --- a/src/Modal.tsx +++ b/src/Modal.tsx @@ -8,16 +8,16 @@ Please see LICENSE files in the repository root for full details. */ import React, { StrictMode } from "react"; -import { createRoot, Root } from "react-dom/client"; +import { createRoot, type Root } from "react-dom/client"; import classNames from "classnames"; -import { IDeferred, defer } from "matrix-js-sdk/src/utils"; +import { type IDeferred, defer } from "matrix-js-sdk/src/utils"; import { TypedEventEmitter } from "matrix-js-sdk/src/matrix"; import { Glass, TooltipProvider } from "@vector-im/compound-web"; import defaultDispatcher from "./dispatcher/dispatcher"; import AsyncWrapper from "./AsyncWrapper"; -import { Defaultize } from "./@types/common"; -import { ActionPayload } from "./dispatcher/payloads"; +import { type Defaultize } from "./@types/common"; +import { type ActionPayload } from "./dispatcher/payloads"; const DIALOG_CONTAINER_ID = "mx_Dialog_Container"; const STATIC_DIALOG_CONTAINER_ID = "mx_Dialog_StaticContainer"; diff --git a/src/NodeAnimator.tsx b/src/NodeAnimator.tsx index 16c5a716ff..6ce0cf177c 100644 --- a/src/NodeAnimator.tsx +++ b/src/NodeAnimator.tsx @@ -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 React, { Key, MutableRefObject, ReactElement, RefCallback } from "react"; +import React, { type Key, type MutableRefObject, type ReactElement, type RefCallback } from "react"; interface IChildProps { style: React.CSSProperties; diff --git a/src/Notifier.ts b/src/Notifier.ts index 377559a6fc..b24e146fbc 100644 --- a/src/Notifier.ts +++ b/src/Notifier.ts @@ -10,21 +10,21 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixEvent, + type MatrixEvent, MatrixEventEvent, - Room, + type Room, RoomEvent, ClientEvent, MsgType, SyncState, - SyncStateData, - IRoomTimelineData, + type SyncStateData, + type IRoomTimelineData, M_LOCATION, EventType, TypedEventEmitter, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { PermissionChanged as PermissionChangedEvent } from "@matrix-org/analytics-events/types/typescript/PermissionChanged"; +import { type PermissionChanged as PermissionChangedEvent } from "@matrix-org/analytics-events/types/typescript/PermissionChanged"; import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; import { MatrixClientPeg } from "./MatrixClientPeg"; diff --git a/src/PasswordReset.ts b/src/PasswordReset.ts index f23d14799b..9fb841ed4b 100644 --- a/src/PasswordReset.ts +++ b/src/PasswordReset.ts @@ -7,7 +7,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 { createClient, IRequestTokenResponse, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { createClient, type IRequestTokenResponse, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { _t } from "./languageHandler"; diff --git a/src/PlatformPeg.ts b/src/PlatformPeg.ts index 493fde8f84..9e8852170c 100644 --- a/src/PlatformPeg.ts +++ b/src/PlatformPeg.ts @@ -7,10 +7,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 BasePlatform from "./BasePlatform"; +import type BasePlatform from "./BasePlatform"; import defaultDispatcher from "./dispatcher/dispatcher"; import { Action } from "./dispatcher/actions"; -import { PlatformSetPayload } from "./dispatcher/payloads/PlatformSetPayload"; +import { type PlatformSetPayload } from "./dispatcher/payloads/PlatformSetPayload"; /* * Holds the current instance of the `Platform` to use across the codebase. diff --git a/src/PlaybackEncoder.ts b/src/PlaybackEncoder.ts index dc212e6a28..1cb423dc30 100644 --- a/src/PlaybackEncoder.ts +++ b/src/PlaybackEncoder.ts @@ -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 { Request, Response } from "./workers/playback.worker"; +import { type Request, type Response } from "./workers/playback.worker"; import { WorkerManager } from "./WorkerManager"; import playbackWorkerFactory from "./workers/playbackWorkerFactory"; diff --git a/src/PosthogAnalytics.ts b/src/PosthogAnalytics.ts index 91208e253d..546674bbcb 100644 --- a/src/PosthogAnalytics.ts +++ b/src/PosthogAnalytics.ts @@ -6,20 +6,20 @@ 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 posthog, { CaptureOptions, PostHog, Properties } from "posthog-js"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import posthog, { type CaptureOptions, type PostHog, type Properties } from "posthog-js"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { UserProperties } from "@matrix-org/analytics-events/types/typescript/UserProperties"; -import { Signup } from "@matrix-org/analytics-events/types/typescript/Signup"; +import { type UserProperties } from "@matrix-org/analytics-events/types/typescript/UserProperties"; +import { type Signup } from "@matrix-org/analytics-events/types/typescript/Signup"; import PlatformPeg from "./PlatformPeg"; import SdkConfig from "./SdkConfig"; import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; -import { ScreenName } from "./PosthogTrackers"; -import { ActionPayload } from "./dispatcher/payloads"; +import { type ScreenName } from "./PosthogTrackers"; +import { type ActionPayload } from "./dispatcher/payloads"; import { Action } from "./dispatcher/actions"; -import { SettingUpdatedPayload } from "./dispatcher/payloads/SettingUpdatedPayload"; +import { type SettingUpdatedPayload } from "./dispatcher/payloads/SettingUpdatedPayload"; import dis from "./dispatcher/dispatcher"; import { Layout } from "./settings/enums/Layout"; diff --git a/src/PosthogTrackers.ts b/src/PosthogTrackers.ts index 02faa6b5ec..5eddeecb2a 100644 --- a/src/PosthogTrackers.ts +++ b/src/PosthogTrackers.ts @@ -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 { PureComponent, SyntheticEvent } from "react"; -import { WebScreen as ScreenEvent } from "@matrix-org/analytics-events/types/typescript/WebScreen"; -import { Interaction as InteractionEvent } from "@matrix-org/analytics-events/types/typescript/Interaction"; -import { PinUnpinAction } from "@matrix-org/analytics-events/types/typescript/PinUnpinAction"; +import { PureComponent, type SyntheticEvent } from "react"; +import { type WebScreen as ScreenEvent } from "@matrix-org/analytics-events/types/typescript/WebScreen"; +import { type Interaction as InteractionEvent } from "@matrix-org/analytics-events/types/typescript/Interaction"; +import { type PinUnpinAction } from "@matrix-org/analytics-events/types/typescript/PinUnpinAction"; import PageType from "./PageTypes"; import Views from "./Views"; diff --git a/src/Presence.ts b/src/Presence.ts index 8057a0f737..7388e2d165 100644 --- a/src/Presence.ts +++ b/src/Presence.ts @@ -14,7 +14,7 @@ import { SetPresence } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "./MatrixClientPeg"; import dis from "./dispatcher/dispatcher"; import Timer from "./utils/Timer"; -import { ActionPayload } from "./dispatcher/payloads"; +import { type ActionPayload } from "./dispatcher/payloads"; // Time in ms after that a user is considered as unavailable/away const UNAVAILABLE_TIME_MS = 3 * 60 * 1000; // 3 mins diff --git a/src/Resend.ts b/src/Resend.ts index 109aea632f..e93082f397 100644 --- a/src/Resend.ts +++ b/src/Resend.ts @@ -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 { MatrixEvent, EventStatus, Room, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, EventStatus, type Room, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import dis from "./dispatcher/dispatcher"; diff --git a/src/RoomInvite.tsx b/src/RoomInvite.tsx index 91ea459230..a02530a1cf 100644 --- a/src/RoomInvite.tsx +++ b/src/RoomInvite.tsx @@ -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 React, { ComponentProps } from "react"; -import { Room, MatrixEvent, MatrixClient, User, EventType } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentProps } from "react"; +import { type Room, type MatrixEvent, type MatrixClient, type User, EventType } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import MultiInviter, { CompletionStates } from "./utils/MultiInviter"; +import MultiInviter, { type CompletionStates } from "./utils/MultiInviter"; import Modal from "./Modal"; import { _t } from "./languageHandler"; import InviteDialog from "./components/views/dialogs/InviteDialog"; @@ -18,7 +18,7 @@ import BaseAvatar from "./components/views/avatars/BaseAvatar"; import { mediaFromMxc } from "./customisations/Media"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; import { InviteKind } from "./components/views/dialogs/InviteDialogTypes"; -import { Member } from "./utils/direct-messages"; +import { type Member } from "./utils/direct-messages"; export interface IInviteResult { states: CompletionStates; diff --git a/src/Rooms.ts b/src/Rooms.ts index 347316c4c9..cf458fef84 100644 --- a/src/Rooms.ts +++ b/src/Rooms.ts @@ -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 { Room, EventType, RoomMember, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Room, EventType, type RoomMember, type MatrixClient } from "matrix-js-sdk/src/matrix"; import AliasCustomisations from "./customisations/Alias"; diff --git a/src/ScalarAuthClient.ts b/src/ScalarAuthClient.ts index 094bb6fe59..26ee94de40 100644 --- a/src/ScalarAuthClient.ts +++ b/src/ScalarAuthClient.ts @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { SERVICE_TYPES, Room, IOpenIDToken } from "matrix-js-sdk/src/matrix"; +import { SERVICE_TYPES, type Room, type IOpenIDToken } from "matrix-js-sdk/src/matrix"; import SettingsStore from "./settings/SettingsStore"; -import { Service, startTermsFlow, TermsInteractionCallback, TermsNotSignedError } from "./Terms"; +import { Service, startTermsFlow, type TermsInteractionCallback, TermsNotSignedError } from "./Terms"; import { MatrixClientPeg } from "./MatrixClientPeg"; import SdkConfig from "./SdkConfig"; -import { WidgetType } from "./widgets/WidgetType"; +import { type WidgetType } from "./widgets/WidgetType"; import { parseUrl } from "./utils/UrlUtils"; // The version of the integration manager API we're intending to work with diff --git a/src/ScalarMessaging.ts b/src/ScalarMessaging.ts index 003d02f2dd..840717dead 100644 --- a/src/ScalarMessaging.ts +++ b/src/ScalarMessaging.ts @@ -282,7 +282,7 @@ Response: */ -import { IContent, MatrixEvent, IEvent, StateEvents } from "matrix-js-sdk/src/matrix"; +import { type IContent, type MatrixEvent, type IEvent, type StateEvents } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/SdkConfig.ts b/src/SdkConfig.ts index ee1c4eab8a..33d3f98683 100644 --- a/src/SdkConfig.ts +++ b/src/SdkConfig.ts @@ -7,13 +7,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 { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import { mergeWith } from "lodash"; import { SnakedObject } from "./utils/SnakedObject"; -import { IConfigOptions, ISsoRedirectOptions } from "./IConfigOptions"; +import { type IConfigOptions, type ISsoRedirectOptions } from "./IConfigOptions"; import { isObject, objectClone } from "./utils/objects"; -import { DeepReadonly, Defaultize } from "./@types/common"; +import { type DeepReadonly, type Defaultize } from "./@types/common"; // see element-web config.md for docs, or the IConfigOptions interface for dev docs export const DEFAULTS: DeepReadonly = { diff --git a/src/Searching.ts b/src/Searching.ts index dea724fbdf..f9b2830e85 100644 --- a/src/Searching.ts +++ b/src/Searching.ts @@ -7,19 +7,19 @@ Please see LICENSE files in the repository root for full details. */ import { - IResultRoomEvents, - ISearchRequestBody, - ISearchResponse, - ISearchResult, - ISearchResults, + type IResultRoomEvents, + type ISearchRequestBody, + type ISearchResponse, + type ISearchResult, + type ISearchResults, SearchOrderBy, - IRoomEventFilter, + type IRoomEventFilter, EventType, - MatrixClient, - SearchResult, + type MatrixClient, + type SearchResult, } from "matrix-js-sdk/src/matrix"; -import { ISearchArgs } from "./indexing/BaseEventIndexManager"; +import { type ISearchArgs } from "./indexing/BaseEventIndexManager"; import EventIndexPeg from "./indexing/EventIndexPeg"; import { isNotUndefined } from "./Typeguards"; diff --git a/src/SecurityManager.ts b/src/SecurityManager.ts index 370d0e9453..b497c57a10 100644 --- a/src/SecurityManager.ts +++ b/src/SecurityManager.ts @@ -7,15 +7,17 @@ Please see LICENSE files in the repository root for full details. */ import { lazy } from "react"; -import { SecretStorage } from "matrix-js-sdk/src/matrix"; -import { deriveRecoveryKeyFromPassphrase, decodeRecoveryKey, CryptoCallbacks } from "matrix-js-sdk/src/crypto-api"; +import { type SecretStorage } from "matrix-js-sdk/src/matrix"; +import { deriveRecoveryKeyFromPassphrase, decodeRecoveryKey, type CryptoCallbacks } from "matrix-js-sdk/src/crypto-api"; import { logger as rootLogger } from "matrix-js-sdk/src/logger"; import Modal from "./Modal"; import { MatrixClientPeg } from "./MatrixClientPeg"; import { _t } from "./languageHandler"; import { isSecureBackupRequired } from "./utils/WellKnownUtils"; -import AccessSecretStorageDialog, { KeyParams } from "./components/views/dialogs/security/AccessSecretStorageDialog"; +import AccessSecretStorageDialog, { + type KeyParams, +} from "./components/views/dialogs/security/AccessSecretStorageDialog"; import { ModuleRunner } from "./modules/ModuleRunner"; import QuestionDialog from "./components/views/dialogs/QuestionDialog"; import InteractiveAuthDialog from "./components/views/dialogs/InteractiveAuthDialog"; diff --git a/src/SendHistoryManager.ts b/src/SendHistoryManager.ts index 517e1b45e3..149dbe42d2 100644 --- a/src/SendHistoryManager.ts +++ b/src/SendHistoryManager.ts @@ -7,11 +7,11 @@ Please see LICENSE files in the repository root for full details. */ import { clamp } from "lodash"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { SerializedPart } from "./editor/parts"; -import EditorModel from "./editor/model"; +import { type SerializedPart } from "./editor/parts"; +import type EditorModel from "./editor/model"; interface IHistoryItem { parts: SerializedPart[]; diff --git a/src/SlashCommands.tsx b/src/SlashCommands.tsx index 08ecd0562b..4a4a80f723 100644 --- a/src/SlashCommands.tsx +++ b/src/SlashCommands.tsx @@ -10,9 +10,16 @@ Please see LICENSE files in the repository root for full details. */ import * as React from "react"; -import { ContentHelpers, Direction, EventType, IContent, MRoomTopicEventContent, User } from "matrix-js-sdk/src/matrix"; +import { + ContentHelpers, + Direction, + EventType, + type IContent, + type MRoomTopicEventContent, + type User, +} from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { KnownMembership, RoomMemberEventContent } from "matrix-js-sdk/src/types"; +import { KnownMembership, type RoomMemberEventContent } from "matrix-js-sdk/src/types"; import dis from "./dispatcher/dispatcher"; import { _t, _td, UserFriendlyError } from "./languageHandler"; @@ -29,7 +36,7 @@ import { WidgetType } from "./widgets/WidgetType"; import { Jitsi } from "./widgets/Jitsi"; import BugReportDialog from "./components/views/dialogs/BugReportDialog"; import { ensureDMExists } from "./createRoom"; -import { ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload"; +import { type ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload"; import { Action } from "./dispatcher/actions"; import SdkConfig from "./SdkConfig"; import SettingsStore from "./settings/SettingsStore"; @@ -44,7 +51,7 @@ import InfoDialog from "./components/views/dialogs/InfoDialog"; import SlashCommandHelpDialog from "./components/views/dialogs/SlashCommandHelpDialog"; import { shouldShowComponent } from "./customisations/helpers/UIComponents"; import { TimelineRenderingType } from "./contexts/RoomContext"; -import { ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; import VoipUserMapper from "./VoipUserMapper"; import { htmlSerializeFromMdIfNeeded } from "./editor/serialize"; import { leaveRoomBehaviour } from "./utils/leave-behaviour"; diff --git a/src/SlidingSyncManager.ts b/src/SlidingSyncManager.ts index b9922e2290..adfca7c3c3 100644 --- a/src/SlidingSyncManager.ts +++ b/src/SlidingSyncManager.ts @@ -36,10 +36,10 @@ Please see LICENSE files in the repository root for full details. * list ops) */ -import { MatrixClient, EventType, AutoDiscovery, Method, timeoutSignal } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, EventType, AutoDiscovery, Method, timeoutSignal } from "matrix-js-sdk/src/matrix"; import { - MSC3575Filter, - MSC3575List, + type MSC3575Filter, + type MSC3575List, MSC3575_STATE_KEY_LAZY, MSC3575_STATE_KEY_ME, MSC3575_WILDCARD, diff --git a/src/Terms.ts b/src/Terms.ts index a1870ebe21..002ad0464f 100644 --- a/src/Terms.ts +++ b/src/Terms.ts @@ -7,7 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import { SERVICE_TYPES, MatrixClient, Terms, Policy, InternationalisedPolicy } from "matrix-js-sdk/src/matrix"; +import { + type SERVICE_TYPES, + type MatrixClient, + type Terms, + type Policy, + type InternationalisedPolicy, +} from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import Modal from "./Modal"; diff --git a/src/TextForEvent.tsx b/src/TextForEvent.tsx index 5b34fe83b2..d319114c8e 100644 --- a/src/TextForEvent.tsx +++ b/src/TextForEvent.tsx @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { - MatrixEvent, - MatrixClient, + type MatrixEvent, + type MatrixClient, GuestAccess, HistoryVisibility, JoinRule, @@ -22,7 +22,7 @@ import { import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import { removeDirectionOverrideChars } from "matrix-js-sdk/src/utils"; -import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; +import { type PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; import { _t } from "./languageHandler"; import * as Roles from "./Roles"; diff --git a/src/Unread.ts b/src/Unread.ts index e79a9cb75f..2c8fa0cff3 100644 --- a/src/Unread.ts +++ b/src/Unread.ts @@ -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 { M_BEACON, Room, Thread, MatrixEvent, EventType, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { M_BEACON, type Room, Thread, type MatrixEvent, EventType, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import shouldHideEvent from "./shouldHideEvent"; diff --git a/src/VoipUserMapper.ts b/src/VoipUserMapper.ts index a0290a3eb1..c2a7810d96 100644 --- a/src/VoipUserMapper.ts +++ b/src/VoipUserMapper.ts @@ -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 { Room, EventType } from "matrix-js-sdk/src/matrix"; +import { type Room, EventType } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/WhoIsTyping.ts b/src/WhoIsTyping.ts index c209253206..000cfa29e5 100644 --- a/src/WhoIsTyping.ts +++ b/src/WhoIsTyping.ts @@ -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 { Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type Room, type RoomMember } from "matrix-js-sdk/src/matrix"; import { _t } from "./languageHandler"; diff --git a/src/WorkerManager.ts b/src/WorkerManager.ts index f34d8dbfd1..a8a95ca727 100644 --- a/src/WorkerManager.ts +++ b/src/WorkerManager.ts @@ -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 { defer, IDeferred } from "matrix-js-sdk/src/utils"; +import { defer, type IDeferred } from "matrix-js-sdk/src/utils"; -import { WorkerPayload } from "./workers/worker"; +import { type WorkerPayload } from "./workers/worker"; export class WorkerManager { private readonly worker: Worker; diff --git a/src/accessibility/KeyboardShortcutUtils.ts b/src/accessibility/KeyboardShortcutUtils.ts index 4eafb80f36..a261bf361b 100644 --- a/src/accessibility/KeyboardShortcutUtils.ts +++ b/src/accessibility/KeyboardShortcutUtils.ts @@ -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 { KeyCombo } from "../KeyBindingsManager"; +import { type KeyCombo } from "../KeyBindingsManager"; import { IS_MAC, Key } from "../Keyboard"; import { _t, _td } from "../languageHandler"; import PlatformPeg from "../PlatformPeg"; @@ -14,10 +14,10 @@ import SettingsStore from "../settings/SettingsStore"; import { DESKTOP_SHORTCUTS, DIGITS, - IKeyboardShortcuts, + type IKeyboardShortcuts, KeyBindingAction, KEYBOARD_SHORTCUTS, - KeyboardShortcutSetting, + type KeyboardShortcutSetting, MAC_ONLY_SHORTCUTS, } from "./KeyboardShortcuts"; diff --git a/src/accessibility/KeyboardShortcuts.ts b/src/accessibility/KeyboardShortcuts.ts index 1e8febb0bb..e3c83d72ac 100644 --- a/src/accessibility/KeyboardShortcuts.ts +++ b/src/accessibility/KeyboardShortcuts.ts @@ -8,10 +8,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 { _td, TranslationKey } from "../languageHandler"; +import { _td, type TranslationKey } from "../languageHandler"; import { IS_MAC, IS_ELECTRON, Key } from "../Keyboard"; -import { IBaseSetting } from "../settings/Settings"; -import { KeyCombo } from "../KeyBindingsManager"; +import { type IBaseSetting } from "../settings/Settings"; +import { type KeyCombo } from "../KeyBindingsManager"; export enum KeyBindingAction { /** Send a message */ diff --git a/src/accessibility/RovingTabIndex.tsx b/src/accessibility/RovingTabIndex.tsx index e2227ea42d..45f3367aab 100644 --- a/src/accessibility/RovingTabIndex.tsx +++ b/src/accessibility/RovingTabIndex.tsx @@ -13,16 +13,16 @@ import React, { useMemo, useRef, useReducer, - Reducer, - Dispatch, - RefObject, - ReactNode, - RefCallback, + type Reducer, + type Dispatch, + type RefObject, + type ReactNode, + type RefCallback, } from "react"; import { getKeyBindingsManager } from "../KeyBindingsManager"; import { KeyBindingAction } from "./KeyboardShortcuts"; -import { FocusHandler } from "./roving/types"; +import { type FocusHandler } from "./roving/types"; /** * Module to simplify implementing the Roving TabIndex accessibility technique diff --git a/src/accessibility/context_menu/ContextMenuButton.tsx b/src/accessibility/context_menu/ContextMenuButton.tsx index e326e087b9..8096203d0e 100644 --- a/src/accessibility/context_menu/ContextMenuButton.tsx +++ b/src/accessibility/context_menu/ContextMenuButton.tsx @@ -8,9 +8,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, { forwardRef, Ref } from "react"; +import React, { forwardRef, type Ref } from "react"; -import AccessibleButton, { ButtonProps } from "../../components/views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonProps } from "../../components/views/elements/AccessibleButton"; type Props = ButtonProps & { label?: string; diff --git a/src/accessibility/context_menu/ContextMenuTooltipButton.tsx b/src/accessibility/context_menu/ContextMenuTooltipButton.tsx index 7a4230ddf7..f58fbea171 100644 --- a/src/accessibility/context_menu/ContextMenuTooltipButton.tsx +++ b/src/accessibility/context_menu/ContextMenuTooltipButton.tsx @@ -8,9 +8,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, { forwardRef, Ref } from "react"; +import React, { forwardRef, type Ref } from "react"; -import AccessibleButton, { ButtonProps } from "../../components/views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonProps } from "../../components/views/elements/AccessibleButton"; type Props = ButtonProps & { // whether the context menu is currently open diff --git a/src/accessibility/roving/RovingAccessibleButton.tsx b/src/accessibility/roving/RovingAccessibleButton.tsx index 70e569e335..8bcf71dd4d 100644 --- a/src/accessibility/roving/RovingAccessibleButton.tsx +++ b/src/accessibility/roving/RovingAccessibleButton.tsx @@ -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, { RefObject } from "react"; +import React, { type RefObject } from "react"; -import AccessibleButton, { ButtonProps } from "../../components/views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonProps } from "../../components/views/elements/AccessibleButton"; import { useRovingTabIndex } from "../RovingTabIndex"; type Props = Omit, "tabIndex"> & { diff --git a/src/accessibility/roving/RovingTabIndexWrapper.tsx b/src/accessibility/roving/RovingTabIndexWrapper.tsx index a47c1cb3ef..aa9b1ad8c1 100644 --- a/src/accessibility/roving/RovingTabIndexWrapper.tsx +++ b/src/accessibility/roving/RovingTabIndexWrapper.tsx @@ -6,10 +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 React, { ReactElement, RefCallback } from "react"; +import { type ReactElement, type RefCallback } from "react"; +import type React from "react"; import { useRovingTabIndex } from "../RovingTabIndex"; -import { FocusHandler, Ref } from "./types"; +import { type FocusHandler, type Ref } from "./types"; interface IProps { inputRef?: Ref; diff --git a/src/accessibility/roving/types.ts b/src/accessibility/roving/types.ts index 3cf8cdf6c0..e3fa694f11 100644 --- a/src/accessibility/roving/types.ts +++ b/src/accessibility/roving/types.ts @@ -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 { RefObject } from "react"; +import { type RefObject } from "react"; export type Ref = RefObject; diff --git a/src/actions/MatrixActionCreators.ts b/src/actions/MatrixActionCreators.ts index ccda4853f6..9dc0127bff 100644 --- a/src/actions/MatrixActionCreators.ts +++ b/src/actions/MatrixActionCreators.ts @@ -8,18 +8,18 @@ Please see LICENSE files in the repository root for full details. import { ClientEvent, - MatrixClient, - MatrixEvent, + type MatrixClient, + type MatrixEvent, MatrixEventEvent, - Room, + type Room, RoomEvent, - IRoomTimelineData, - RoomState, + type IRoomTimelineData, + type RoomState, RoomStateEvent, } from "matrix-js-sdk/src/matrix"; import dis from "../dispatcher/dispatcher"; -import { ActionPayload } from "../dispatcher/payloads"; +import { type ActionPayload } from "../dispatcher/payloads"; /** * Create a MatrixActions.sync action that represents a MatrixClient `sync` event, diff --git a/src/actions/RoomListActions.ts b/src/actions/RoomListActions.ts index 7418ec2cdd..255518a7dc 100644 --- a/src/actions/RoomListActions.ts +++ b/src/actions/RoomListActions.ts @@ -7,17 +7,17 @@ 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, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { asyncAction } from "./actionCreators"; import Modal from "../Modal"; import * as Rooms from "../Rooms"; import { _t } from "../languageHandler"; -import { AsyncActionPayload } from "../dispatcher/payloads"; +import { type AsyncActionPayload } from "../dispatcher/payloads"; import RoomListStore from "../stores/room-list/RoomListStore"; import { SortAlgorithm } from "../stores/room-list/algorithms/models"; -import { DefaultTagID, TagID } from "../stores/room-list/models"; +import { DefaultTagID, type TagID } from "../stores/room-list/models"; import ErrorDialog from "../components/views/dialogs/ErrorDialog"; export default class RoomListActions { diff --git a/src/actions/actionCreators.ts b/src/actions/actionCreators.ts index f3a097d06f..ed8eb6b265 100644 --- a/src/actions/actionCreators.ts +++ b/src/actions/actionCreators.ts @@ -7,7 +7,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 { AsyncActionFn, AsyncActionPayload } from "../dispatcher/payloads"; +import { type AsyncActionFn, AsyncActionPayload } from "../dispatcher/payloads"; /** * Create an action thunk that will dispatch actions indicating the current diff --git a/src/async-components/structures/ErrorView.tsx b/src/async-components/structures/ErrorView.tsx index cee6c6345b..90c03c12dd 100644 --- a/src/async-components/structures/ErrorView.tsx +++ b/src/async-components/structures/ErrorView.tsx @@ -5,7 +5,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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { Text, Heading, Button, Separator } from "@vector-im/compound-web"; import PopOutIcon from "@vector-im/compound-design-tokens/assets/web/icons/pop-out"; diff --git a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx index a740523549..d0680fb4cd 100644 --- a/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx +++ b/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx @@ -6,8 +6,8 @@ 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, { ChangeEvent } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../languageHandler"; import SdkConfig from "../../../../SdkConfig"; @@ -19,7 +19,7 @@ import { SettingLevel } from "../../../../settings/SettingLevel"; import Field from "../../../../components/views/elements/Field"; import BaseDialog from "../../../../components/views/dialogs/BaseDialog"; import DialogButtons from "../../../../components/views/elements/DialogButtons"; -import { IIndexStats } from "../../../../indexing/BaseEventIndexManager"; +import { type IIndexStats } from "../../../../indexing/BaseEventIndexManager"; interface IProps { onFinished(): void; diff --git a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx index 7f93a03339..5d40967bb4 100644 --- a/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx +++ b/src/async-components/views/dialogs/security/CreateSecretStorageDialog.tsx @@ -10,8 +10,14 @@ Please see LICENSE files in the repository root for full details. import React, { createRef } from "react"; import FileSaver from "file-saver"; import { logger } from "matrix-js-sdk/src/logger"; -import { AuthDict, CrossSigningKeys, MatrixError, UIAFlow, UIAResponse } from "matrix-js-sdk/src/matrix"; -import { GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api"; +import { + type AuthDict, + type CrossSigningKeys, + MatrixError, + type UIAFlow, + type UIAResponse, +} from "matrix-js-sdk/src/matrix"; +import { type GeneratedSecretStorageKey } from "matrix-js-sdk/src/crypto-api"; import classNames from "classnames"; import CheckmarkIcon from "@vector-im/compound-design-tokens/assets/web/icons/check"; @@ -31,11 +37,11 @@ import { SecureBackupSetupMethod, } from "../../../../utils/WellKnownUtils"; import { ModuleRunner } from "../../../../modules/ModuleRunner"; -import Field from "../../../../components/views/elements/Field"; +import type Field from "../../../../components/views/elements/Field"; import BaseDialog from "../../../../components/views/dialogs/BaseDialog"; import Spinner from "../../../../components/views/elements/Spinner"; import InteractiveAuthDialog from "../../../../components/views/dialogs/InteractiveAuthDialog"; -import { IValidationResult } from "../../../../components/views/elements/Validation"; +import { type IValidationResult } from "../../../../components/views/elements/Validation"; import PassphraseConfirmField from "../../../../components/views/auth/PassphraseConfirmField"; import { initialiseDehydration } from "../../../../utils/device/dehydration"; diff --git a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx index 18dd507b5a..c2a2510173 100644 --- a/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx +++ b/src/async-components/views/dialogs/security/ExportE2eKeysDialog.tsx @@ -8,17 +8,17 @@ Please see LICENSE files in the repository root for full details. */ import FileSaver from "file-saver"; -import React, { ChangeEvent } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent } from "react"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from "../../../../languageHandler"; import * as MegolmExportEncryption from "../../../../utils/MegolmExportEncryption"; import BaseDialog from "../../../../components/views/dialogs/BaseDialog"; -import { KeysStartingWith } from "../../../../@types/common"; +import { type KeysStartingWith } from "../../../../@types/common"; import PassphraseField from "../../../../components/views/auth/PassphraseField"; import PassphraseConfirmField from "../../../../components/views/auth/PassphraseConfirmField"; -import Field from "../../../../components/views/elements/Field"; +import type Field from "../../../../components/views/elements/Field"; enum Phase { Edit = "edit", diff --git a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx index 16d50640f5..fff841d8a6 100644 --- a/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx +++ b/src/async-components/views/dialogs/security/ImportE2eKeysDialog.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import * as MegolmExportEncryption from "../../../../utils/MegolmExportEncryption"; diff --git a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx index bec708e664..9b9683b798 100644 --- a/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx +++ b/src/async-components/views/dialogs/security/NewRecoveryMethodDialog.tsx @@ -7,7 +7,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 React, { JSX, useEffect, useState } from "react"; +import React, { type JSX, useEffect, useState } from "react"; import dis from "../../../../dispatcher/dispatcher"; import { _t } from "../../../../languageHandler"; diff --git a/src/audio/ManagedPlayback.ts b/src/audio/ManagedPlayback.ts index 0f0b420d1e..43cea38f5f 100644 --- a/src/audio/ManagedPlayback.ts +++ b/src/audio/ManagedPlayback.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { Playback } from "./Playback"; -import { PlaybackManager } from "./PlaybackManager"; +import { type PlaybackManager } from "./PlaybackManager"; import { DEFAULT_WAVEFORM } from "./consts"; /** diff --git a/src/audio/Playback.ts b/src/audio/Playback.ts index af777a8c01..58b8a23c22 100644 --- a/src/audio/Playback.ts +++ b/src/audio/Playback.ts @@ -13,7 +13,7 @@ import { defer } from "matrix-js-sdk/src/utils"; import { UPDATE_EVENT } from "../stores/AsyncStore"; import { arrayFastResample } from "../utils/arrays"; -import { IDestroyable } from "../utils/IDestroyable"; +import { type IDestroyable } from "../utils/IDestroyable"; import { PlaybackClock } from "./PlaybackClock"; import { createAudioContext, decodeOgg } from "./compat"; import { clamp } from "../utils/numbers"; diff --git a/src/audio/PlaybackClock.ts b/src/audio/PlaybackClock.ts index ceb06987c8..4099483c8e 100644 --- a/src/audio/PlaybackClock.ts +++ b/src/audio/PlaybackClock.ts @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import { SimpleObservable } from "matrix-widget-api"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { IDestroyable } from "../utils/IDestroyable"; +import { type IDestroyable } from "../utils/IDestroyable"; /** * Tracks accurate human-perceptible time for an audio clip, as informed diff --git a/src/audio/PlaybackManager.ts b/src/audio/PlaybackManager.ts index 80d28f1196..85677d68aa 100644 --- a/src/audio/PlaybackManager.ts +++ b/src/audio/PlaybackManager.ts @@ -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 { Playback, PlaybackState } from "./Playback"; +import { type Playback, PlaybackState } from "./Playback"; import { ManagedPlayback } from "./ManagedPlayback"; import { DEFAULT_WAVEFORM } from "./consts"; diff --git a/src/audio/PlaybackQueue.ts b/src/audio/PlaybackQueue.ts index f84f6add3c..fbca9d7872 100644 --- a/src/audio/PlaybackQueue.ts +++ b/src/audio/PlaybackQueue.ts @@ -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 { MatrixEvent, Room, EventType } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type Room, EventType } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { Playback, PlaybackState } from "./Playback"; +import { type Playback, PlaybackState } from "./Playback"; import { UPDATE_EVENT } from "../stores/AsyncStore"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { arrayFastClone } from "../utils/arrays"; diff --git a/src/audio/RecorderWorklet.ts b/src/audio/RecorderWorklet.ts index acf23f4dcd..ec4a143c4e 100644 --- a/src/audio/RecorderWorklet.ts +++ b/src/audio/RecorderWorklet.ts @@ -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 { IAmplitudePayload, ITimingPayload, PayloadEvent, WORKLET_NAME } from "./consts"; +import { type IAmplitudePayload, type ITimingPayload, PayloadEvent, WORKLET_NAME } from "./consts"; import { percentageOf } from "../utils/numbers"; // from AudioWorkletGlobalScope: https://developer.mozilla.org/en-US/docs/Web/API/AudioWorkletGlobalScope diff --git a/src/audio/VoiceMessageRecording.ts b/src/audio/VoiceMessageRecording.ts index 2dac4ac9c3..1b15896e97 100644 --- a/src/audio/VoiceMessageRecording.ts +++ b/src/audio/VoiceMessageRecording.ts @@ -6,16 +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 } from "matrix-js-sdk/src/matrix"; -import { EncryptedFile } from "matrix-js-sdk/src/types"; -import { SimpleObservable } from "matrix-widget-api"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type EncryptedFile } from "matrix-js-sdk/src/types"; +import { type SimpleObservable } from "matrix-widget-api"; import { uploadFile } from "../ContentMessages"; import { concat } from "../utils/arrays"; -import { IDestroyable } from "../utils/IDestroyable"; +import { type IDestroyable } from "../utils/IDestroyable"; import { Singleflight } from "../utils/Singleflight"; import { Playback } from "./Playback"; -import { IRecordingUpdate, RecordingState, VoiceRecording } from "./VoiceRecording"; +import { type IRecordingUpdate, RecordingState, VoiceRecording } from "./VoiceRecording"; export interface IUpload { mxc?: string; // for unencrypted uploads diff --git a/src/audio/VoiceRecording.ts b/src/audio/VoiceRecording.ts index 0a48c27e06..bde86f9dd7 100644 --- a/src/audio/VoiceRecording.ts +++ b/src/audio/VoiceRecording.ts @@ -13,7 +13,7 @@ import EventEmitter from "events"; import { logger } from "matrix-js-sdk/src/logger"; import MediaDeviceHandler from "../MediaDeviceHandler"; -import { IDestroyable } from "../utils/IDestroyable"; +import { type IDestroyable } from "../utils/IDestroyable"; import { Singleflight } from "../utils/Singleflight"; import { PayloadEvent, WORKLET_NAME } from "./consts"; import { UPDATE_EVENT } from "../stores/AsyncStore"; diff --git a/src/autocomplete/AutocompleteProvider.tsx b/src/autocomplete/AutocompleteProvider.tsx index 0161a64dce..94614f0ae7 100644 --- a/src/autocomplete/AutocompleteProvider.tsx +++ b/src/autocomplete/AutocompleteProvider.tsx @@ -7,8 +7,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 React from "react"; - +import type React from "react"; import { TimelineRenderingType } from "../contexts/RoomContext"; import type { ICompletion, ISelectionRange } from "./Autocompleter"; diff --git a/src/autocomplete/Autocompleter.ts b/src/autocomplete/Autocompleter.ts index 7ac11e9539..b3ab0ade46 100644 --- a/src/autocomplete/Autocompleter.ts +++ b/src/autocomplete/Autocompleter.ts @@ -6,8 +6,8 @@ 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 { ReactElement } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type ReactElement } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import CommandProvider from "./CommandProvider"; import RoomProvider from "./RoomProvider"; @@ -15,7 +15,8 @@ import UserProvider from "./UserProvider"; import EmojiProvider from "./EmojiProvider"; import NotifProvider from "./NotifProvider"; import { timeout } from "../utils/promise"; -import AutocompleteProvider, { ICommand } from "./AutocompleteProvider"; +import { type ICommand } from "./AutocompleteProvider"; +import type AutocompleteProvider from "./AutocompleteProvider"; import SpaceProvider from "./SpaceProvider"; import { TimelineRenderingType } from "../contexts/RoomContext"; import { filterBoolean } from "../utils/arrays"; diff --git a/src/autocomplete/CommandProvider.tsx b/src/autocomplete/CommandProvider.tsx index d2b9f18f15..76d53bb865 100644 --- a/src/autocomplete/CommandProvider.tsx +++ b/src/autocomplete/CommandProvider.tsx @@ -10,15 +10,15 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { _t } from "../languageHandler"; import AutocompleteProvider from "./AutocompleteProvider"; import QueryMatcher from "./QueryMatcher"; import { TextualCompletion } from "./Components"; -import { ICompletion, ISelectionRange } from "./Autocompleter"; -import { Command, Commands, CommandMap } from "../SlashCommands"; -import { TimelineRenderingType } from "../contexts/RoomContext"; +import { type ICompletion, type ISelectionRange } from "./Autocompleter"; +import { type Command, Commands, CommandMap } from "../SlashCommands"; +import { type TimelineRenderingType } from "../contexts/RoomContext"; import { MatrixClientPeg } from "../MatrixClientPeg"; const COMMAND_RE = /(^\/\w*)(?: .*)?/g; diff --git a/src/autocomplete/EmojiProvider.tsx b/src/autocomplete/EmojiProvider.tsx index f976fd37db..2d31095acd 100644 --- a/src/autocomplete/EmojiProvider.tsx +++ b/src/autocomplete/EmojiProvider.tsx @@ -11,18 +11,18 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { uniq, sortBy, uniqBy, ListIteratee } from "lodash"; +import { uniq, sortBy, uniqBy, type ListIteratee } from "lodash"; import EMOTICON_REGEX from "emojibase-regex/emoticon"; -import { Room } from "matrix-js-sdk/src/matrix"; -import { EMOJI, Emoji, getEmojiFromUnicode } from "@matrix-org/emojibase-bindings"; +import { type Room } from "matrix-js-sdk/src/matrix"; +import { EMOJI, type Emoji, getEmojiFromUnicode } from "@matrix-org/emojibase-bindings"; import { _t } from "../languageHandler"; import AutocompleteProvider from "./AutocompleteProvider"; import QueryMatcher from "./QueryMatcher"; import { PillCompletion } from "./Components"; -import { ICompletion, ISelectionRange } from "./Autocompleter"; +import { type ICompletion, type ISelectionRange } from "./Autocompleter"; import SettingsStore from "../settings/SettingsStore"; -import { TimelineRenderingType } from "../contexts/RoomContext"; +import { type TimelineRenderingType } from "../contexts/RoomContext"; import * as recent from "../emojipicker/recent"; import { filterBoolean } from "../utils/arrays"; diff --git a/src/autocomplete/NotifProvider.tsx b/src/autocomplete/NotifProvider.tsx index 4919045578..2a6e070efa 100644 --- a/src/autocomplete/NotifProvider.tsx +++ b/src/autocomplete/NotifProvider.tsx @@ -6,15 +6,15 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import AutocompleteProvider from "./AutocompleteProvider"; import { _t } from "../languageHandler"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { PillCompletion } from "./Components"; -import { ICompletion, ISelectionRange } from "./Autocompleter"; +import { type ICompletion, type ISelectionRange } from "./Autocompleter"; import RoomAvatar from "../components/views/avatars/RoomAvatar"; -import { TimelineRenderingType } from "../contexts/RoomContext"; +import { type TimelineRenderingType } from "../contexts/RoomContext"; const AT_ROOM_REGEX = /@\S*/g; diff --git a/src/autocomplete/QueryMatcher.ts b/src/autocomplete/QueryMatcher.ts index d23bac2128..0012beacfa 100644 --- a/src/autocomplete/QueryMatcher.ts +++ b/src/autocomplete/QueryMatcher.ts @@ -11,8 +11,8 @@ Please see LICENSE files in the repository root for full details. import { at, uniq } from "lodash"; import { removeHiddenChars } from "matrix-js-sdk/src/utils"; -import { TimelineRenderingType } from "../contexts/RoomContext"; -import { Leaves } from "../@types/common"; +import { type TimelineRenderingType } from "../contexts/RoomContext"; +import { type Leaves } from "../@types/common"; interface IOptions { keys: Array>; diff --git a/src/autocomplete/RoomProvider.tsx b/src/autocomplete/RoomProvider.tsx index 84a4a8a023..5c06856b08 100644 --- a/src/autocomplete/RoomProvider.tsx +++ b/src/autocomplete/RoomProvider.tsx @@ -10,7 +10,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { sortBy, uniqBy } from "lodash"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { _t } from "../languageHandler"; import AutocompleteProvider from "./AutocompleteProvider"; @@ -18,9 +18,9 @@ import { MatrixClientPeg } from "../MatrixClientPeg"; import QueryMatcher from "./QueryMatcher"; import { PillCompletion } from "./Components"; import { makeRoomPermalink } from "../utils/permalinks/Permalinks"; -import { ICompletion, ISelectionRange } from "./Autocompleter"; +import { type ICompletion, type ISelectionRange } from "./Autocompleter"; import RoomAvatar from "../components/views/avatars/RoomAvatar"; -import { TimelineRenderingType } from "../contexts/RoomContext"; +import { type TimelineRenderingType } from "../contexts/RoomContext"; import SettingsStore from "../settings/SettingsStore"; const ROOM_REGEX = /\B#\S*/g; diff --git a/src/autocomplete/SpaceProvider.tsx b/src/autocomplete/SpaceProvider.tsx index 273d9ace00..b031f37c86 100644 --- a/src/autocomplete/SpaceProvider.tsx +++ b/src/autocomplete/SpaceProvider.tsx @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import React from "react"; import { _t } from "../languageHandler"; diff --git a/src/autocomplete/UserProvider.tsx b/src/autocomplete/UserProvider.tsx index 673bee7bf2..9cd5564795 100644 --- a/src/autocomplete/UserProvider.tsx +++ b/src/autocomplete/UserProvider.tsx @@ -12,13 +12,13 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { sortBy } from "lodash"; import { - MatrixEvent, - Room, + type MatrixEvent, + type Room, RoomEvent, - RoomMember, - RoomState, + type RoomMember, + type RoomState, RoomStateEvent, - IRoomTimelineData, + type IRoomTimelineData, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; @@ -28,9 +28,9 @@ import { PillCompletion } from "./Components"; import AutocompleteProvider from "./AutocompleteProvider"; import { _t } from "../languageHandler"; import { makeUserPermalink } from "../utils/permalinks/Permalinks"; -import { ICompletion, ISelectionRange } from "./Autocompleter"; +import { type ICompletion, type ISelectionRange } from "./Autocompleter"; import MemberAvatar from "../components/views/avatars/MemberAvatar"; -import { TimelineRenderingType } from "../contexts/RoomContext"; +import { type TimelineRenderingType } from "../contexts/RoomContext"; import UserIdentifierCustomisations from "../customisations/UserIdentifier"; const USER_REGEX = /\B@\S*/g; diff --git a/src/boundThreepids.ts b/src/boundThreepids.ts index b7c749a020..2d8de4817e 100644 --- a/src/boundThreepids.ts +++ b/src/boundThreepids.ts @@ -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 { IThreepid, ThreepidMedium, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { type IThreepid, type ThreepidMedium, type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import IdentityAuthClient from "./IdentityAuthClient"; diff --git a/src/components/structures/AutoHideScrollbar.tsx b/src/components/structures/AutoHideScrollbar.tsx index da27f25cdb..7e52e9b192 100644 --- a/src/components/structures/AutoHideScrollbar.tsx +++ b/src/components/structures/AutoHideScrollbar.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { HTMLAttributes, ReactHTML, ReactNode, WheelEvent } from "react"; +import React, { type HTMLAttributes, type ReactHTML, type ReactNode, type WheelEvent } from "react"; type DynamicHtmlElementProps = JSX.IntrinsicElements[T] extends HTMLAttributes ? DynamicElementProps : DynamicElementProps<"div">; diff --git a/src/components/structures/AutocompleteInput.tsx b/src/components/structures/AutocompleteInput.tsx index 25e0d7d1a1..9767bd5761 100644 --- a/src/components/structures/AutocompleteInput.tsx +++ b/src/components/structures/AutocompleteInput.tsx @@ -6,13 +6,20 @@ 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, { useState, ReactNode, ChangeEvent, KeyboardEvent, useRef, ReactElement } from "react"; +import React, { + useState, + type ReactNode, + type ChangeEvent, + type KeyboardEvent, + useRef, + type ReactElement, +} from "react"; import classNames from "classnames"; import { SearchIcon, CloseIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; -import Autocompleter from "../../autocomplete/AutocompleteProvider"; +import type Autocompleter from "../../autocomplete/AutocompleteProvider"; import { Key } from "../../Keyboard"; -import { ICompletion } from "../../autocomplete/Autocompleter"; +import { type ICompletion } from "../../autocomplete/Autocompleter"; import AccessibleButton from "../../components/views/elements/AccessibleButton"; import useFocus from "../../hooks/useFocus"; diff --git a/src/components/structures/BackdropPanel.tsx b/src/components/structures/BackdropPanel.tsx index 64b2ab0fce..f3a44521fa 100644 --- a/src/components/structures/BackdropPanel.tsx +++ b/src/components/structures/BackdropPanel.tsx @@ -5,7 +5,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 React, { CSSProperties } from "react"; +import React, { type CSSProperties } from "react"; interface IProps { backgroundImage?: string; diff --git a/src/components/structures/ContextMenu.tsx b/src/components/structures/ContextMenu.tsx index 51aef8f454..5a6ca20e35 100644 --- a/src/components/structures/ContextMenu.tsx +++ b/src/components/structures/ContextMenu.tsx @@ -8,12 +8,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 React, { CSSProperties, RefObject, SyntheticEvent, useRef, useState } from "react"; +import React, { type CSSProperties, type RefObject, type SyntheticEvent, useRef, useState } from "react"; import ReactDOM from "react-dom"; import classNames from "classnames"; import FocusLock from "react-focus-lock"; -import { Writeable } from "../../@types/common"; +import { type Writeable } from "../../@types/common"; import UIStore from "../../stores/UIStore"; import { checkInputableElement, RovingTabIndexProvider } from "../../accessibility/RovingTabIndex"; import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts"; diff --git a/src/components/structures/EmbeddedPage.tsx b/src/components/structures/EmbeddedPage.tsx index 2833f79626..4b89102d6f 100644 --- a/src/components/structures/EmbeddedPage.tsx +++ b/src/components/structures/EmbeddedPage.tsx @@ -12,12 +12,12 @@ import sanitizeHtml from "sanitize-html"; import classnames from "classnames"; import { logger } from "matrix-js-sdk/src/logger"; -import { _t, TranslationKey } from "../../languageHandler"; +import { _t, type TranslationKey } from "../../languageHandler"; import dis from "../../dispatcher/dispatcher"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import AutoHideScrollbar from "./AutoHideScrollbar"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; interface IProps { // URL to request embedded page content from diff --git a/src/components/structures/ErrorMessage.tsx b/src/components/structures/ErrorMessage.tsx index ce4788c0fa..c721e67fc5 100644 --- a/src/components/structures/ErrorMessage.tsx +++ b/src/components/structures/ErrorMessage.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { WarningIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; interface ErrorMessageProps { diff --git a/src/components/structures/FilePanel.tsx b/src/components/structures/FilePanel.tsx index c1eb34597f..5930490c34 100644 --- a/src/components/structures/FilePanel.tsx +++ b/src/components/structures/FilePanel.tsx @@ -10,14 +10,14 @@ Please see LICENSE files in the repository root for full details. import React, { createRef } from "react"; import { Filter, - EventTimelineSet, - IRoomTimelineData, - Direction, - MatrixEvent, + type EventTimelineSet, + type IRoomTimelineData, + type Direction, + type MatrixEvent, MatrixEventEvent, - Room, + type Room, RoomEvent, - TimelineWindow, + type TimelineWindow, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import FilesIcon from "@vector-im/compound-design-tokens/assets/web/icons/files"; @@ -27,7 +27,7 @@ import EventIndexPeg from "../../indexing/EventIndexPeg"; import { _t } from "../../languageHandler"; import SearchWarning, { WarningKind } from "../views/elements/SearchWarning"; import BaseCard from "../views/right_panel/BaseCard"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import TimelinePanel from "./TimelinePanel"; import Spinner from "../views/elements/Spinner"; import { Layout } from "../../settings/enums/Layout"; diff --git a/src/components/structures/GenericDropdownMenu.tsx b/src/components/structures/GenericDropdownMenu.tsx index 5c617e8015..63846e9e3c 100644 --- a/src/components/structures/GenericDropdownMenu.tsx +++ b/src/components/structures/GenericDropdownMenu.tsx @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { FunctionComponent, Key, PropsWithChildren, ReactNode } from "react"; +import React, { type FunctionComponent, type Key, type PropsWithChildren, type ReactNode } from "react"; import { MenuItemRadio } from "../../accessibility/context_menu/MenuItemRadio"; -import { ButtonEvent } from "../views/elements/AccessibleButton"; +import { type ButtonEvent } from "../views/elements/AccessibleButton"; import ContextMenu, { aboveLeftOf, ChevronFace, ContextMenuButton, useContextMenu } from "./ContextMenu"; export type GenericDropdownMenuOption = { diff --git a/src/components/structures/HomePage.tsx b/src/components/structures/HomePage.tsx index f8dcc7b70d..720a78cf62 100644 --- a/src/components/structures/HomePage.tsx +++ b/src/components/structures/HomePage.tsx @@ -17,7 +17,7 @@ import dis from "../../dispatcher/dispatcher"; import { Action } from "../../dispatcher/actions"; import BaseAvatar from "../views/avatars/BaseAvatar"; import { OwnProfileStore } from "../../stores/OwnProfileStore"; -import AccessibleButton, { ButtonEvent } from "../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../views/elements/AccessibleButton"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; import { useEventEmitter } from "../../hooks/useEventEmitter"; import MatrixClientContext, { useMatrixClientContext } from "../../contexts/MatrixClientContext"; diff --git a/src/components/structures/IndicatorScrollbar.tsx b/src/components/structures/IndicatorScrollbar.tsx index 1d0a90a14e..5244074bf8 100644 --- a/src/components/structures/IndicatorScrollbar.tsx +++ b/src/components/structures/IndicatorScrollbar.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. import React, { createRef } from "react"; -import AutoHideScrollbar, { IProps as AutoHideScrollbarProps } from "./AutoHideScrollbar"; +import AutoHideScrollbar, { type IProps as AutoHideScrollbarProps } from "./AutoHideScrollbar"; import UIStore, { UI_EVENTS } from "../../stores/UIStore"; export type IProps = Omit, "onWheel" | "element"> & { diff --git a/src/components/structures/InteractiveAuth.tsx b/src/components/structures/InteractiveAuth.tsx index 08aa4eeafa..f9c389679c 100644 --- a/src/components/structures/InteractiveAuth.tsx +++ b/src/components/structures/InteractiveAuth.tsx @@ -9,19 +9,19 @@ Please see LICENSE files in the repository root for full details. import React, { createRef } from "react"; import { AuthType, - IAuthData, - AuthDict, - IInputs, + type IAuthData, + type AuthDict, + type IInputs, InteractiveAuth, - IStageStatus, + type IStageStatus, } from "matrix-js-sdk/src/interactive-auth"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import getEntryComponentForLoginType, { - ContinueKind, - CustomAuthType, - IStageComponent, + type ContinueKind, + type CustomAuthType, + type IStageComponent, } from "../views/auth/InteractiveAuthEntryComponents"; import Spinner from "../views/elements/Spinner"; diff --git a/src/components/structures/LeftPanel.tsx b/src/components/structures/LeftPanel.tsx index de591a6b22..62cea32e45 100644 --- a/src/components/structures/LeftPanel.tsx +++ b/src/components/structures/LeftPanel.tsx @@ -17,12 +17,12 @@ import LegacyCallHandler, { LegacyCallHandlerEvent } from "../../LegacyCallHandl import { HEADER_HEIGHT } from "../views/rooms/RoomSublist"; import { Action } from "../../dispatcher/actions"; import RoomSearch from "./RoomSearch"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import SpaceStore from "../../stores/spaces/SpaceStore"; -import { MetaSpace, SpaceKey, UPDATE_SELECTED_SPACE } from "../../stores/spaces"; +import { MetaSpace, type SpaceKey, UPDATE_SELECTED_SPACE } from "../../stores/spaces"; import { getKeyBindingsManager } from "../../KeyBindingsManager"; import UIStore from "../../stores/UIStore"; -import { IState as IRovingTabIndexState } from "../../accessibility/RovingTabIndex"; +import { type IState as IRovingTabIndexState } from "../../accessibility/RovingTabIndex"; import RoomListHeader from "../views/rooms/RoomListHeader"; import { BreadcrumbsStore } from "../../stores/BreadcrumbsStore"; import RoomListStore, { LISTS_UPDATE_EVENT } from "../../stores/room-list/RoomListStore"; @@ -32,9 +32,9 @@ import RoomBreadcrumbs from "../views/rooms/RoomBreadcrumbs"; import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts"; import { shouldShowComponent } from "../../customisations/helpers/UIComponents"; import { UIComponent } from "../../settings/UIFeature"; -import AccessibleButton, { ButtonEvent } from "../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../views/elements/AccessibleButton"; import PosthogTrackers from "../../PosthogTrackers"; -import PageType from "../../PageTypes"; +import type PageType from "../../PageTypes"; import { Landmark, LandmarkNavigation } from "../../accessibility/LandmarkNavigation"; interface IProps { diff --git a/src/components/structures/LegacyCallEventGrouper.ts b/src/components/structures/LegacyCallEventGrouper.ts index 9647158921..76caea692e 100644 --- a/src/components/structures/LegacyCallEventGrouper.ts +++ b/src/components/structures/LegacyCallEventGrouper.ts @@ -6,8 +6,8 @@ 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 { EventType, MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { CallEvent, CallState, CallType, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { EventType, type MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { CallEvent, CallState, CallType, type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { EventEmitter } from "events"; import LegacyCallHandler, { LegacyCallHandlerEvent } from "../../LegacyCallHandler"; diff --git a/src/components/structures/LoggedInView.tsx b/src/components/structures/LoggedInView.tsx index fa1cb17ebe..3422598503 100644 --- a/src/components/structures/LoggedInView.tsx +++ b/src/components/structures/LoggedInView.tsx @@ -6,44 +6,44 @@ 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, { ClipboardEvent } from "react"; +import React, { type ClipboardEvent } from "react"; import { ClientEvent, - MatrixClient, - MatrixEvent, + type MatrixClient, + type MatrixEvent, RoomStateEvent, - MatrixError, - IUsageLimit, - SyncStateData, + type MatrixError, + type IUsageLimit, + type SyncStateData, SyncState, EventType, } from "matrix-js-sdk/src/matrix"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import classNames from "classnames"; import { isOnlyCtrlOrCmdKeyEvent, Key } from "../../Keyboard"; import PageTypes from "../../PageTypes"; import MediaDeviceHandler from "../../MediaDeviceHandler"; import dis from "../../dispatcher/dispatcher"; -import { IMatrixClientCreds } from "../../MatrixClientPeg"; +import { type IMatrixClientCreds } from "../../MatrixClientPeg"; import SettingsStore from "../../settings/SettingsStore"; import { SettingLevel } from "../../settings/SettingLevel"; import ResizeHandle from "../views/elements/ResizeHandle"; import { CollapseDistributor, Resizer } from "../../resizer"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import PlatformPeg from "../../PlatformPeg"; import { DefaultTagID } from "../../stores/room-list/models"; import { hideToast as hideServerLimitToast, showToast as showServerLimitToast } from "../../toasts/ServerLimitToast"; import { Action } from "../../dispatcher/actions"; import LeftPanel from "./LeftPanel"; -import { ViewRoomDeltaPayload } from "../../dispatcher/payloads/ViewRoomDeltaPayload"; +import { type ViewRoomDeltaPayload } from "../../dispatcher/payloads/ViewRoomDeltaPayload"; import RoomListStore from "../../stores/room-list/RoomListStore"; import NonUrgentToastContainer from "./NonUrgentToastContainer"; -import { IOOBData, IThreepidInvite } from "../../stores/ThreepidInviteStore"; +import { type IOOBData, type IThreepidInvite } from "../../stores/ThreepidInviteStore"; import Modal from "../../Modal"; -import { CollapseItem, ICollapseConfig } from "../../resizer/distributors/collapse"; +import { type CollapseItem, type ICollapseConfig } from "../../resizer/distributors/collapse"; import { getKeyBindingsManager } from "../../KeyBindingsManager"; -import { IOpts } from "../../createRoom"; +import { type IOpts } from "../../createRoom"; import SpacePanel from "../views/spaces/SpacePanel"; import LegacyCallHandler, { LegacyCallHandlerEvent } from "../../LegacyCallHandler"; import AudioFeedArrayForLegacyCall from "../views/voip/AudioFeedArrayForLegacyCall"; @@ -55,16 +55,16 @@ import UserView from "./UserView"; import { BackdropPanel } from "./BackdropPanel"; import { mediaFromMxc } from "../../customisations/Media"; import { UserTab } from "../views/dialogs/UserTab"; -import { OpenToTabPayload } from "../../dispatcher/payloads/OpenToTabPayload"; +import { type OpenToTabPayload } from "../../dispatcher/payloads/OpenToTabPayload"; import RightPanelStore from "../../stores/right-panel/RightPanelStore"; import { TimelineRenderingType } from "../../contexts/RoomContext"; import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts"; -import { SwitchSpacePayload } from "../../dispatcher/payloads/SwitchSpacePayload"; +import { type SwitchSpacePayload } from "../../dispatcher/payloads/SwitchSpacePayload"; import LeftPanelLiveShareWarning from "../views/beacon/LeftPanelLiveShareWarning"; import HomePage from "./HomePage"; import { PipContainer } from "./PipContainer"; import { monitorSyncedPushRules } from "../../utils/pushRules/monitorSyncedPushRules"; -import { ConfigOptions } from "../../SdkConfig"; +import { type ConfigOptions } from "../../SdkConfig"; import { MatrixClientContextProvider } from "./MatrixClientContextProvider"; import { Landmark, LandmarkNavigation } from "../../accessibility/LandmarkNavigation"; diff --git a/src/components/structures/MainSplit.tsx b/src/components/structures/MainSplit.tsx index 540aec251f..291201f510 100644 --- a/src/components/structures/MainSplit.tsx +++ b/src/components/structures/MainSplit.tsx @@ -7,12 +7,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 React, { ReactNode } from "react"; -import { NumberSize, Resizable } from "re-resizable"; -import { Direction } from "re-resizable/lib/resizer"; -import { WebPanelResize } from "@matrix-org/analytics-events/types/typescript/WebPanelResize"; +import React, { type ReactNode } from "react"; +import { type NumberSize, Resizable } from "re-resizable"; +import { type Direction } from "re-resizable/lib/resizer"; +import { type WebPanelResize } from "@matrix-org/analytics-events/types/typescript/WebPanelResize"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import { PosthogAnalytics } from "../../PosthogAnalytics.ts"; interface IProps { diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 1d9637fa49..d176afc9a2 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -12,17 +12,17 @@ import { createClient, EventType, HttpApiEvent, - MatrixClient, - MatrixEvent, - RoomType, + type MatrixClient, + type MatrixEvent, + type RoomType, SyncState, - SyncStateData, - TimelineEvents, + type SyncStateData, + type TimelineEvents, } from "matrix-js-sdk/src/matrix"; -import { defer, IDeferred, QueryDict } from "matrix-js-sdk/src/utils"; +import { defer, type IDeferred, type QueryDict } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; import { throttle } from "lodash"; -import { CryptoEvent, KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; +import { CryptoEvent, type KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; import { TooltipProvider } from "@vector-im/compound-web"; // what-input helps improve keyboard accessibility @@ -30,9 +30,9 @@ import "what-input"; import PosthogTrackers from "../../PosthogTrackers"; import { DecryptionFailureTracker } from "../../DecryptionFailureTracker"; -import { IMatrixClientCreds, MatrixClientPeg } from "../../MatrixClientPeg"; +import { type IMatrixClientCreds, MatrixClientPeg } from "../../MatrixClientPeg"; import PlatformPeg from "../../PlatformPeg"; -import SdkConfig, { ConfigOptions } from "../../SdkConfig"; +import SdkConfig, { type ConfigOptions } from "../../SdkConfig"; import dis from "../../dispatcher/dispatcher"; import Notifier from "../../Notifier"; import Modal from "../../Modal"; @@ -43,7 +43,7 @@ import * as Lifecycle from "../../Lifecycle"; import "../../stores/LifecycleStore"; import "../../stores/AutoRageshakeStore"; import PageType from "../../PageTypes"; -import createRoom, { IOpts } from "../../createRoom"; +import createRoom, { type IOpts } from "../../createRoom"; import { _t, _td } from "../../languageHandler"; import SettingsStore from "../../settings/SettingsStore"; import ThemeController from "../../settings/controllers/ThemeController"; @@ -60,14 +60,17 @@ import LoggedInView from "./LoggedInView"; import { Action } from "../../dispatcher/actions"; import { hideToast as hideAnalyticsToast, showToast as showAnalyticsToast } from "../../toasts/AnalyticsToast"; import { showToast as showNotificationsToast } from "../../toasts/DesktopNotificationsToast"; -import { OpenToTabPayload } from "../../dispatcher/payloads/OpenToTabPayload"; +import { type OpenToTabPayload } from "../../dispatcher/payloads/OpenToTabPayload"; import ErrorDialog from "../views/dialogs/ErrorDialog"; import { RoomNotificationStateStore, UPDATE_STATUS_INDICATOR, } from "../../stores/notifications/RoomNotificationStateStore"; import { SettingLevel } from "../../settings/SettingLevel"; -import ThreepidInviteStore, { IThreepidInvite, IThreepidInviteWireFormat } from "../../stores/ThreepidInviteStore"; +import ThreepidInviteStore, { + type IThreepidInvite, + type IThreepidInviteWireFormat, +} from "../../stores/ThreepidInviteStore"; import { UIFeature } from "../../settings/UIFeature"; import DialPadModal from "../views/voip/DialPadModal"; import { showToast as showMobileGuideToast } from "../../toasts/MobileGuideToast"; @@ -97,23 +100,23 @@ import { PosthogAnalytics } from "../../PosthogAnalytics"; import { initSentry } from "../../sentry"; import LegacyCallHandler from "../../LegacyCallHandler"; import { showSpaceInvite } from "../../utils/space"; -import { ButtonEvent } from "../views/elements/AccessibleButton"; -import { ActionPayload } from "../../dispatcher/payloads"; -import { SummarizedNotificationState } from "../../stores/notifications/SummarizedNotificationState"; +import { type ButtonEvent } from "../views/elements/AccessibleButton"; +import { type ActionPayload } from "../../dispatcher/payloads"; +import { type SummarizedNotificationState } from "../../stores/notifications/SummarizedNotificationState"; import Views from "../../Views"; -import { FocusNextType, ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; -import { ViewHomePagePayload } from "../../dispatcher/payloads/ViewHomePagePayload"; -import { AfterLeaveRoomPayload } from "../../dispatcher/payloads/AfterLeaveRoomPayload"; -import { DoAfterSyncPreparedPayload } from "../../dispatcher/payloads/DoAfterSyncPreparedPayload"; -import { ViewStartChatOrReusePayload } from "../../dispatcher/payloads/ViewStartChatOrReusePayload"; +import { type FocusNextType, type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewHomePagePayload } from "../../dispatcher/payloads/ViewHomePagePayload"; +import { type AfterLeaveRoomPayload } from "../../dispatcher/payloads/AfterLeaveRoomPayload"; +import { type DoAfterSyncPreparedPayload } from "../../dispatcher/payloads/DoAfterSyncPreparedPayload"; +import { type ViewStartChatOrReusePayload } from "../../dispatcher/payloads/ViewStartChatOrReusePayload"; import { leaveRoomBehaviour } from "../../utils/leave-behaviour"; import { CallStore } from "../../stores/CallStore"; -import { IRoomStateEventsActionPayload } from "../../actions/MatrixActionCreators"; -import { ShowThreadPayload } from "../../dispatcher/payloads/ShowThreadPayload"; +import { type IRoomStateEventsActionPayload } from "../../actions/MatrixActionCreators"; +import { type ShowThreadPayload } from "../../dispatcher/payloads/ShowThreadPayload"; import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases"; import RightPanelStore from "../../stores/right-panel/RightPanelStore"; import { TimelineRenderingType } from "../../contexts/RoomContext"; -import { ValidatedServerConfig } from "../../utils/ValidatedServerConfig"; +import { type ValidatedServerConfig } from "../../utils/ValidatedServerConfig"; import { isLocalRoom } from "../../utils/localRoom/isLocalRoom"; import { SDKContext, SdkContextClass } from "../../contexts/SDKContext"; import { viewUserDeviceSettings } from "../../actions/handlers/viewUserDeviceSettings"; @@ -122,7 +125,7 @@ import RovingSpotlightDialog from "../views/dialogs/spotlight/SpotlightDialog"; import { findDMForUser } from "../../utils/dm/findDMForUser"; import { Linkify } from "../../HtmlUtils"; import { NotificationLevel } from "../../stores/notifications/NotificationLevel"; -import { UserTab } from "../views/dialogs/UserTab"; +import { type UserTab } from "../views/dialogs/UserTab"; import { shouldSkipSetupEncryption } from "../../utils/crypto/shouldSkipSetupEncryption"; import { Filter } from "../views/dialogs/spotlight/Filter"; import { checkSessionLockFree, getSessionLock } from "../../utils/SessionLock"; diff --git a/src/components/structures/MatrixClientContextProvider.tsx b/src/components/structures/MatrixClientContextProvider.tsx index edd0daaaba..e22d6bfcde 100644 --- a/src/components/structures/MatrixClientContextProvider.tsx +++ b/src/components/structures/MatrixClientContextProvider.tsx @@ -6,8 +6,8 @@ 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, { PropsWithChildren, useEffect, useState } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import React, { type PropsWithChildren, useEffect, useState } from "react"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { CryptoEvent } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 67c1b98d68..9f535da257 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -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 React, { createRef, ReactNode, TransitionEvent } from "react"; +import React, { createRef, type ReactNode, type TransitionEvent } from "react"; import classNames from "classnames"; -import { Room, MatrixClient, RoomStateEvent, EventStatus, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { + type Room, + type MatrixClient, + RoomStateEvent, + EventStatus, + type MatrixEvent, + EventType, +} from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { isSupportedReceiptType } from "matrix-js-sdk/src/utils"; @@ -19,30 +26,30 @@ import SettingsStore from "../../settings/SettingsStore"; import RoomContext, { TimelineRenderingType } from "../../contexts/RoomContext"; import { Layout } from "../../settings/enums/Layout"; import EventTile, { - GetRelationsForEvent, - IReadReceiptProps, + type GetRelationsForEvent, + type IReadReceiptProps, isEligibleForSpecialReceipt, - UnwrappedEventTile, + type UnwrappedEventTile, } from "../views/rooms/EventTile"; import IRCTimelineProfileResizer from "../views/elements/IRCTimelineProfileResizer"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import LegacyCallEventGrouper from "./LegacyCallEventGrouper"; +import type LegacyCallEventGrouper from "./LegacyCallEventGrouper"; import WhoIsTypingTile from "../views/rooms/WhoIsTypingTile"; -import ScrollPanel, { IScrollState } from "./ScrollPanel"; +import ScrollPanel, { type IScrollState } from "./ScrollPanel"; import DateSeparator from "../views/messages/DateSeparator"; import TimelineSeparator, { SeparatorKind } from "../views/messages/TimelineSeparator"; import ErrorBoundary from "../views/elements/ErrorBoundary"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import Spinner from "../views/elements/Spinner"; -import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; -import EditorStateTransfer from "../../utils/EditorStateTransfer"; +import { type RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; +import type EditorStateTransfer from "../../utils/EditorStateTransfer"; import { Action } from "../../dispatcher/actions"; import { getEventDisplayInfo } from "../../utils/EventRenderingUtils"; -import { IReadReceiptPosition } from "../views/rooms/ReadReceiptMarker"; +import { type IReadReceiptPosition } from "../views/rooms/ReadReceiptMarker"; import { haveRendererForEvent } from "../../events/EventTileFactory"; import { editorRoomKey } from "../../Editing"; import { hasThreadSummary } from "../../utils/EventUtils"; -import { BaseGrouper } from "./grouper/BaseGrouper"; +import { type BaseGrouper } from "./grouper/BaseGrouper"; import { MainGrouper } from "./grouper/MainGrouper"; import { CreationGrouper } from "./grouper/CreationGrouper"; import { _t } from "../../languageHandler"; diff --git a/src/components/structures/NonUrgentToastContainer.tsx b/src/components/structures/NonUrgentToastContainer.tsx index eac92f8af6..4e37110160 100644 --- a/src/components/structures/NonUrgentToastContainer.tsx +++ b/src/components/structures/NonUrgentToastContainer.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import * as React from "react"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; -import { ComponentClass } from "../../@types/common"; +import { type ComponentClass } from "../../@types/common"; import NonUrgentToastStore from "../../stores/NonUrgentToastStore"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; diff --git a/src/components/structures/PipContainer.tsx b/src/components/structures/PipContainer.tsx index c68aa561d8..54129bd493 100644 --- a/src/components/structures/PipContainer.tsx +++ b/src/components/structures/PipContainer.tsx @@ -6,20 +6,20 @@ 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, { MutableRefObject, ReactNode, useRef } from "react"; -import { CallEvent, CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import React, { type MutableRefObject, type ReactNode, useRef } from "react"; +import { CallEvent, CallState, type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { logger } from "matrix-js-sdk/src/logger"; -import { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import LegacyCallView from "../views/voip/LegacyCallView"; import LegacyCallHandler, { LegacyCallHandlerEvent } from "../../LegacyCallHandler"; import { MatrixClientPeg } from "../../MatrixClientPeg"; -import PictureInPictureDragger, { CreatePipChildren } from "./PictureInPictureDragger"; +import PictureInPictureDragger, { type CreatePipChildren } from "./PictureInPictureDragger"; import dis from "../../dispatcher/dispatcher"; import { Action } from "../../dispatcher/actions"; import { WidgetLayoutStore } from "../../stores/widgets/WidgetLayoutStore"; import ActiveWidgetStore, { ActiveWidgetStoreEvent } from "../../stores/ActiveWidgetStore"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; import { SdkContextClass } from "../../contexts/SDKContext"; import { WidgetPip } from "../views/pips/WidgetPip"; diff --git a/src/components/structures/ReleaseAnnouncement.tsx b/src/components/structures/ReleaseAnnouncement.tsx index cc21407c60..da41b3c1dd 100644 --- a/src/components/structures/ReleaseAnnouncement.tsx +++ b/src/components/structures/ReleaseAnnouncement.tsx @@ -6,10 +6,10 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { ComponentProps, JSX, PropsWithChildren } from "react"; +import React, { type ComponentProps, type JSX, type PropsWithChildren } from "react"; import { ReleaseAnnouncement as ReleaseAnnouncementCompound } from "@vector-im/compound-web"; -import { ReleaseAnnouncementStore, Feature } from "../../stores/ReleaseAnnouncementStore"; +import { ReleaseAnnouncementStore, type Feature } from "../../stores/ReleaseAnnouncementStore"; import { useIsReleaseAnnouncementOpen } from "../../hooks/useIsReleaseAnnouncementOpen"; interface ReleaseAnnouncementProps diff --git a/src/components/structures/RightPanel.tsx b/src/components/structures/RightPanel.tsx index b5cf0529b5..8d46c9b1e3 100644 --- a/src/components/structures/RightPanel.tsx +++ b/src/components/structures/RightPanel.tsx @@ -7,8 +7,8 @@ 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, { ChangeEvent } from "react"; -import { Room, RoomState, RoomStateEvent, RoomMember, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent } from "react"; +import { type Room, type RoomState, RoomStateEvent, RoomMember, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { throttle } from "lodash"; import dis from "../../dispatcher/dispatcher"; @@ -23,15 +23,15 @@ import FilePanel from "./FilePanel"; import ThreadView from "./ThreadView"; import ThreadPanel from "./ThreadPanel"; import NotificationPanel from "./NotificationPanel"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import { PinnedMessagesCard } from "../views/right_panel/PinnedMessagesCard"; -import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; -import { E2EStatus } from "../../utils/ShieldUtils"; +import { type RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; +import { type E2EStatus } from "../../utils/ShieldUtils"; import TimelineCard from "../views/right_panel/TimelineCard"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; -import { IRightPanelCard, IRightPanelCardState } from "../../stores/right-panel/RightPanelStoreIPanelState"; +import { type IRightPanelCard, type IRightPanelCardState } from "../../stores/right-panel/RightPanelStoreIPanelState"; import { Action } from "../../dispatcher/actions"; -import { XOR } from "../../@types/common"; +import { type XOR } from "../../@types/common"; import ExtensionsCard from "../views/right_panel/ExtensionsCard"; import MemberListView from "../views/rooms/MemberList/MemberListView"; diff --git a/src/components/structures/RoomSearch.tsx b/src/components/structures/RoomSearch.tsx index 1e36dc84db..05731c79a0 100644 --- a/src/components/structures/RoomSearch.tsx +++ b/src/components/structures/RoomSearch.tsx @@ -11,7 +11,7 @@ import * as React from "react"; import { ALTERNATE_KEY_NAME } from "../../accessibility/KeyboardShortcuts"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { IS_MAC, Key } from "../../Keyboard"; import { _t } from "../../languageHandler"; import AccessibleButton from "../views/elements/AccessibleButton"; diff --git a/src/components/structures/RoomSearchView.tsx b/src/components/structures/RoomSearchView.tsx index 14f34c9146..d37cd3f19d 100644 --- a/src/components/structures/RoomSearchView.tsx +++ b/src/components/structures/RoomSearchView.tsx @@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details. import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; import { - ISearchResults, - IThreadBundledRelationship, - MatrixEvent, + type ISearchResults, + type IThreadBundledRelationship, + type MatrixEvent, THREAD_RELATION_TYPE, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; @@ -23,7 +23,7 @@ import SearchResultTile from "../views/rooms/SearchResultTile"; import { searchPagination, SearchScope } from "../../Searching"; import Modal from "../../Modal"; import ErrorDialog from "../views/dialogs/ErrorDialog"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import { useScopedRoomContext } from "../../contexts/ScopedRoomContext.tsx"; diff --git a/src/components/structures/RoomStatusBar.tsx b/src/components/structures/RoomStatusBar.tsx index 095c359566..ad5d5c1cdf 100644 --- a/src/components/structures/RoomStatusBar.tsx +++ b/src/components/structures/RoomStatusBar.tsx @@ -6,16 +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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { ClientEvent, EventStatus, - MatrixError, - MatrixEvent, - Room, + type MatrixError, + type MatrixEvent, + type Room, RoomEvent, - SyncState, - SyncStateData, + type SyncState, + type SyncStateData, } from "matrix-js-sdk/src/matrix"; import { WarningIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; diff --git a/src/components/structures/RoomStatusBarUnsentMessages.tsx b/src/components/structures/RoomStatusBarUnsentMessages.tsx index 8cb80c894c..0845f2550a 100644 --- a/src/components/structures/RoomStatusBarUnsentMessages.tsx +++ b/src/components/structures/RoomStatusBarUnsentMessages.tsx @@ -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, ReactNode } from "react"; +import React, { type ReactElement, type ReactNode } from "react"; -import { StaticNotificationState } from "../../stores/notifications/StaticNotificationState"; +import { type StaticNotificationState } from "../../stores/notifications/StaticNotificationState"; import NotificationBadge from "../views/rooms/NotificationBadge"; interface RoomStatusBarUnsentMessagesProps { diff --git a/src/components/structures/RoomView.tsx b/src/components/structures/RoomView.tsx index 5695c7a404..a64b118c2c 100644 --- a/src/components/structures/RoomView.tsx +++ b/src/components/structures/RoomView.tsx @@ -9,40 +9,48 @@ 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, { ChangeEvent, ComponentProps, createRef, ReactElement, ReactNode, RefObject, JSX } from "react"; +import React, { + type ChangeEvent, + type ComponentProps, + createRef, + type ReactElement, + type ReactNode, + type RefObject, + type JSX, +} from "react"; import classNames from "classnames"; import { - IRecommendedVersion, + type IRecommendedVersion, NotificationCountType, - Room, + type Room, RoomEvent, - RoomState, + type RoomState, RoomStateEvent, - MatrixEvent, + type MatrixEvent, MatrixEventEvent, - EventTimeline, - IRoomTimelineData, + type EventTimeline, + type IRoomTimelineData, EventType, HistoryVisibility, JoinRule, ClientEvent, - MatrixError, - ISearchResults, + type MatrixError, + type ISearchResults, THREAD_RELATION_TYPE, - MatrixClient, + type MatrixClient, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; -import { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type CallState, type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { debounce, throttle } from "lodash"; import { CryptoEvent } from "matrix-js-sdk/src/crypto-api"; -import { ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; +import { type ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; import shouldHideEvent from "../../shouldHideEvent"; import { _t } from "../../languageHandler"; import * as TimezoneHandler from "../../TimezoneHandler"; import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import ContentMessages from "../../ContentMessages"; import Modal from "../../Modal"; import { LegacyCallHandlerEvent } from "../../LegacyCallHandler"; @@ -50,15 +58,15 @@ import defaultDispatcher from "../../dispatcher/dispatcher"; import * as Rooms from "../../Rooms"; import MainSplit from "./MainSplit"; import RightPanel from "./RightPanel"; -import RoomScrollStateStore, { ScrollState } from "../../stores/RoomScrollStateStore"; +import RoomScrollStateStore, { type ScrollState } from "../../stores/RoomScrollStateStore"; import WidgetEchoStore from "../../stores/WidgetEchoStore"; import SettingsStore from "../../settings/SettingsStore"; import { Layout } from "../../settings/enums/Layout"; -import AccessibleButton, { ButtonEvent } from "../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../views/elements/AccessibleButton"; import { TimelineRenderingType, MainSplitContentType } from "../../contexts/RoomContext"; import { E2EStatus, shieldStatusForRoom } from "../../utils/ShieldUtils"; import { Action } from "../../dispatcher/actions"; -import { IMatrixClientCreds } from "../../MatrixClientPeg"; +import { type IMatrixClientCreds } from "../../MatrixClientPeg"; import ScrollPanel from "./ScrollPanel"; import TimelinePanel from "./TimelinePanel"; import ErrorBoundary from "../views/elements/ErrorBoundary"; @@ -67,7 +75,7 @@ import RoomPreviewCard from "../views/rooms/RoomPreviewCard"; import RoomUpgradeWarningBar from "../views/rooms/RoomUpgradeWarningBar"; import AuxPanel from "../views/rooms/AuxPanel"; import RoomHeader from "../views/rooms/RoomHeader/RoomHeader"; -import { IOOBData, IThreepidInvite } from "../../stores/ThreepidInviteStore"; +import { type IOOBData, type IThreepidInvite } from "../../stores/ThreepidInviteStore"; import EffectsOverlay from "../views/elements/EffectsOverlay"; import { containsEmoji } from "../../effects/utils"; import { CHAT_EFFECTS } from "../../effects"; @@ -79,7 +87,7 @@ import { Container, WidgetLayoutStore } from "../../stores/widgets/WidgetLayoutS import { getKeyBindingsManager } from "../../KeyBindingsManager"; import { objectHasDiff } from "../../utils/objects"; import SpaceRoomView from "./SpaceRoomView"; -import { IOpts } from "../../createRoom"; +import { type IOpts } from "../../createRoom"; import EditorStateTransfer from "../../utils/EditorStateTransfer"; import ErrorDialog from "../views/dialogs/ErrorDialog"; import UploadBar from "./UploadBar"; @@ -88,32 +96,32 @@ import MessageComposer from "../views/rooms/MessageComposer"; import JumpToBottomButton from "../views/rooms/JumpToBottomButton"; import TopUnreadMessagesBar from "../views/rooms/TopUnreadMessagesBar"; import { fetchInitialEvent } from "../../utils/EventUtils"; -import { ComposerInsertPayload, ComposerType } from "../../dispatcher/payloads/ComposerInsertPayload"; +import { type ComposerInsertPayload, ComposerType } from "../../dispatcher/payloads/ComposerInsertPayload"; import AppsDrawer from "../views/rooms/AppsDrawer"; import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; -import { JoinRoomPayload } from "../../dispatcher/payloads/JoinRoomPayload"; -import { DoAfterSyncPreparedPayload } from "../../dispatcher/payloads/DoAfterSyncPreparedPayload"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type JoinRoomPayload } from "../../dispatcher/payloads/JoinRoomPayload"; +import { type DoAfterSyncPreparedPayload } from "../../dispatcher/payloads/DoAfterSyncPreparedPayload"; import FileDropTarget from "./FileDropTarget"; import Measured from "../views/elements/Measured"; -import { FocusComposerPayload } from "../../dispatcher/payloads/FocusComposerPayload"; +import { type FocusComposerPayload } from "../../dispatcher/payloads/FocusComposerPayload"; import { LocalRoom, LocalRoomState } from "../../models/LocalRoom"; import { createRoomFromLocalRoom } from "../../utils/direct-messages"; import NewRoomIntro from "../views/rooms/NewRoomIntro"; import EncryptionEvent from "../views/messages/EncryptionEvent"; import { StaticNotificationState } from "../../stores/notifications/StaticNotificationState"; import { isLocalRoom } from "../../utils/localRoom/isLocalRoom"; -import { ShowThreadPayload } from "../../dispatcher/payloads/ShowThreadPayload"; +import { type ShowThreadPayload } from "../../dispatcher/payloads/ShowThreadPayload"; import { RoomStatusBarUnsentMessages } from "./RoomStatusBarUnsentMessages"; import { LargeLoader } from "./LargeLoader"; import { isVideoRoom } from "../../utils/video-rooms"; import { SDKContext } from "../../contexts/SDKContext"; import { CallStore, CallStoreEvent } from "../../stores/CallStore"; -import { Call } from "../../models/Call"; +import { type Call } from "../../models/Call"; import { RoomSearchView } from "./RoomSearchView"; -import eventSearch, { SearchInfo, SearchScope } from "../../Searching"; +import eventSearch, { type SearchInfo, SearchScope } from "../../Searching"; import VoipUserMapper from "../../VoipUserMapper"; import { isCallEvent } from "./LegacyCallEventGrouper"; import { WidgetType } from "../../widgets/WidgetType"; @@ -121,8 +129,8 @@ import WidgetUtils from "../../utils/WidgetUtils"; import { shouldEncryptRoomWithSingle3rdPartyInvite } from "../../utils/room/shouldEncryptRoomWithSingle3rdPartyInvite"; import { WaitingForThirdPartyRoomView } from "./WaitingForThirdPartyRoomView"; import { isNotUndefined } from "../../Typeguards"; -import { CancelAskToJoinPayload } from "../../dispatcher/payloads/CancelAskToJoinPayload"; -import { SubmitAskToJoinPayload } from "../../dispatcher/payloads/SubmitAskToJoinPayload"; +import { type CancelAskToJoinPayload } from "../../dispatcher/payloads/CancelAskToJoinPayload"; +import { type SubmitAskToJoinPayload } from "../../dispatcher/payloads/SubmitAskToJoinPayload"; import RightPanelStore from "../../stores/right-panel/RightPanelStore"; import { onView3pidInvite } from "../../stores/right-panel/action-handlers"; import RoomSearchAuxPanel from "../views/rooms/RoomSearchAuxPanel"; diff --git a/src/components/structures/ScrollPanel.tsx b/src/components/structures/ScrollPanel.tsx index 413d081746..a92b24fc55 100644 --- a/src/components/structures/ScrollPanel.tsx +++ b/src/components/structures/ScrollPanel.tsx @@ -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 React, { createRef, CSSProperties, ReactNode } from "react"; +import React, { createRef, type CSSProperties, type ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "../../settings/SettingsStore"; import Timer from "../../utils/Timer"; import AutoHideScrollbar from "./AutoHideScrollbar"; import { getKeyBindingsManager } from "../../KeyBindingsManager"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts"; // The amount of extra scroll distance to allow prior to unfilling. diff --git a/src/components/structures/SearchBox.tsx b/src/components/structures/SearchBox.tsx index a5bbb7865e..ec85314349 100644 --- a/src/components/structures/SearchBox.tsx +++ b/src/components/structures/SearchBox.tsx @@ -7,7 +7,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 React, { createRef, HTMLProps } from "react"; +import React, { createRef, type HTMLProps } from "react"; import { throttle } from "lodash"; import classNames from "classnames"; diff --git a/src/components/structures/SpaceHierarchy.tsx b/src/components/structures/SpaceHierarchy.tsx index 362fe82dce..d1f3677816 100644 --- a/src/components/structures/SpaceHierarchy.tsx +++ b/src/components/structures/SpaceHierarchy.tsx @@ -7,12 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import React, { - Dispatch, - KeyboardEvent, - KeyboardEventHandler, - ReactElement, - ReactNode, - SetStateAction, + type Dispatch, + type KeyboardEvent, + type KeyboardEventHandler, + type ReactElement, + type ReactNode, + type SetStateAction, useCallback, useContext, useEffect, @@ -21,28 +21,28 @@ import React, { useState, } from "react"; import { - Room, + type Room, RoomEvent, ClientEvent, - MatrixClient, + type MatrixClient, MatrixError, EventType, RoomType, GuestAccess, HistoryVisibility, - HierarchyRelation, - HierarchyRoom, + type HierarchyRelation, + type HierarchyRoom, JoinRule, } from "matrix-js-sdk/src/matrix"; import { RoomHierarchy } from "matrix-js-sdk/src/room-hierarchy"; import classNames from "classnames"; import { sortBy, uniqBy } from "lodash"; import { logger } from "matrix-js-sdk/src/logger"; -import { KnownMembership, SpaceChildEventContent } from "matrix-js-sdk/src/types"; +import { KnownMembership, type SpaceChildEventContent } from "matrix-js-sdk/src/types"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { _t } from "../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../views/elements/AccessibleButton"; import Spinner from "../views/elements/Spinner"; import SearchBox from "./SearchBox"; import RoomAvatar from "../views/avatars/RoomAvatar"; @@ -56,13 +56,13 @@ import { getChildOrder } from "../../stores/spaces/SpaceStore"; import { Linkify, topicToHtml } from "../../HtmlUtils"; import { useDispatcher } from "../../hooks/useDispatcher"; import { Action } from "../../dispatcher/actions"; -import { IState, RovingTabIndexProvider, useRovingTabIndex } from "../../accessibility/RovingTabIndex"; +import { type IState, RovingTabIndexProvider, useRovingTabIndex } from "../../accessibility/RovingTabIndex"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import { useTypedEventEmitterState } from "../../hooks/useEventEmitter"; -import { IOOBData } from "../../stores/ThreepidInviteStore"; +import { type IOOBData } from "../../stores/ThreepidInviteStore"; import { awaitRoomDownSync } from "../../utils/RoomUpgrade"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; -import { JoinRoomReadyPayload } from "../../dispatcher/payloads/JoinRoomReadyPayload"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type JoinRoomReadyPayload } from "../../dispatcher/payloads/JoinRoomReadyPayload"; import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts"; import { getKeyBindingsManager } from "../../KeyBindingsManager"; import { getTopic } from "../../hooks/room/useTopic"; diff --git a/src/components/structures/SpaceRoomView.tsx b/src/components/structures/SpaceRoomView.tsx index 1424df2c98..170cb4615d 100644 --- a/src/components/structures/SpaceRoomView.tsx +++ b/src/components/structures/SpaceRoomView.tsx @@ -6,18 +6,18 @@ 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 { EventType, RoomType, JoinRule, Preset, Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import { EventType, RoomType, JoinRule, Preset, type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import React, { useCallback, useContext, useRef, useState } from "react"; import MatrixClientContext from "../../contexts/MatrixClientContext"; -import createRoom, { IOpts } from "../../createRoom"; +import createRoom, { type IOpts } from "../../createRoom"; import { shouldShowComponent } from "../../customisations/helpers/UIComponents"; import { Action } from "../../dispatcher/actions"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import { ActionPayload } from "../../dispatcher/payloads"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type ActionPayload } from "../../dispatcher/payloads"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; import * as Email from "../../email"; import { useEventEmitterState } from "../../hooks/useEventEmitter"; import { useMyRoomMembership } from "../../hooks/useRoomMembers"; @@ -30,7 +30,7 @@ import { UIComponent } from "../../settings/UIFeature"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; import RightPanelStore from "../../stores/right-panel/RightPanelStore"; import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import { shouldShowSpaceInvite, shouldShowSpaceSettings, @@ -51,7 +51,7 @@ import { defaultDmsRenderer, defaultRoomsRenderer, } from "../views/dialogs/AddExistingToSpaceDialog"; -import AccessibleButton, { ButtonEvent } from "../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../views/elements/AccessibleButton"; import ErrorBoundary from "../views/elements/ErrorBoundary"; import Field from "../views/elements/Field"; import RoomFacePile from "../views/elements/RoomFacePile"; @@ -65,7 +65,7 @@ import { ChevronFace, ContextMenuButton, useContextMenu } from "./ContextMenu"; import MainSplit from "./MainSplit"; import RightPanel from "./RightPanel"; import SpaceHierarchy, { showRoom } from "./SpaceHierarchy"; -import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; interface IProps { space: Room; diff --git a/src/components/structures/SplashPage.tsx b/src/components/structures/SplashPage.tsx index 1ce0724dab..7b419bbf47 100644 --- a/src/components/structures/SplashPage.tsx +++ b/src/components/structures/SplashPage.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { DetailedHTMLProps, HTMLAttributes, ReactNode } from "react"; +import React, { type DetailedHTMLProps, type HTMLAttributes, type ReactNode } from "react"; interface Props extends DetailedHTMLProps, HTMLElement> { className?: string; diff --git a/src/components/structures/TabbedView.tsx b/src/components/structures/TabbedView.tsx index 71161fec52..0778d7c92f 100644 --- a/src/components/structures/TabbedView.tsx +++ b/src/components/structures/TabbedView.tsx @@ -11,10 +11,10 @@ Please see LICENSE files in the repository root for full details. import * as React from "react"; import classNames from "classnames"; -import { _t, TranslationKey } from "../../languageHandler"; +import { _t, type TranslationKey } from "../../languageHandler"; import AutoHideScrollbar from "./AutoHideScrollbar"; -import { PosthogScreenTracker, ScreenName } from "../../PosthogTrackers"; -import { NonEmptyArray } from "../../@types/common"; +import { PosthogScreenTracker, type ScreenName } from "../../PosthogTrackers"; +import { type NonEmptyArray } from "../../@types/common"; import { RovingAccessibleButton, RovingTabIndexProvider } from "../../accessibility/RovingTabIndex"; import { useWindowWidth } from "../../hooks/useWindowWidth"; diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index edb4393ee4..892dc82c75 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -6,16 +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 { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import React, { useContext, useEffect, useRef, useState } from "react"; -import { EventTimelineSet, Room, Thread } from "matrix-js-sdk/src/matrix"; +import { type EventTimelineSet, type Room, Thread } from "matrix-js-sdk/src/matrix"; import { IconButton, Tooltip } from "@vector-im/compound-web"; import { logger } from "matrix-js-sdk/src/logger"; import ThreadsIcon from "@vector-im/compound-design-tokens/assets/web/icons/threads"; import { Icon as MarkAllThreadsReadIcon } from "../../../res/img/element-icons/check-all.svg"; import BaseCard from "../views/right_panel/BaseCard"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import MatrixClientContext, { useMatrixClientContext } from "../../contexts/MatrixClientContext"; import { _t } from "../../languageHandler"; import { ContextMenuButton } from "../../accessibility/context_menu/ContextMenuButton"; @@ -23,10 +23,10 @@ import ContextMenu, { ChevronFace, MenuItemRadio, useContextMenu } from "./Conte import RoomContext, { TimelineRenderingType } from "../../contexts/RoomContext"; import TimelinePanel from "./TimelinePanel"; import { Layout } from "../../settings/enums/Layout"; -import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import Measured from "../views/elements/Measured"; import PosthogTrackers from "../../PosthogTrackers"; -import { ButtonEvent } from "../views/elements/AccessibleButton"; +import { type ButtonEvent } from "../views/elements/AccessibleButton"; import Spinner from "../views/elements/Spinner"; import { clearRoomNotification } from "../../utils/notifications"; import EmptyState from "../views/right_panel/EmptyState"; diff --git a/src/components/structures/ThreadView.tsx b/src/components/structures/ThreadView.tsx index f7c34c4112..512a1156a5 100644 --- a/src/components/structures/ThreadView.tsx +++ b/src/components/structures/ThreadView.tsx @@ -6,31 +6,31 @@ 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, { createRef, KeyboardEvent } from "react"; +import React, { createRef, type KeyboardEvent } from "react"; import { - Thread, + type Thread, THREAD_RELATION_TYPE, ThreadEvent, - Room, + type Room, RoomEvent, - IEventRelation, - MatrixEvent, + type IEventRelation, + type MatrixEvent, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import classNames from "classnames"; import BaseCard from "../views/right_panel/BaseCard"; import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import MessageComposer from "../views/rooms/MessageComposer"; -import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import { Layout } from "../../settings/enums/Layout"; import TimelinePanel from "./TimelinePanel"; import dis from "../../dispatcher/dispatcher"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { Action } from "../../dispatcher/actions"; import { MatrixClientPeg } from "../../MatrixClientPeg"; -import { E2EStatus } from "../../utils/ShieldUtils"; +import { type E2EStatus } from "../../utils/ShieldUtils"; import EditorStateTransfer from "../../utils/EditorStateTransfer"; import RoomContext, { TimelineRenderingType } from "../../contexts/RoomContext"; import ContentMessages from "../../ContentMessages"; @@ -39,18 +39,18 @@ import { _t } from "../../languageHandler"; import ThreadListContextMenu from "../views/context_menus/ThreadListContextMenu"; import RightPanelStore from "../../stores/right-panel/RightPanelStore"; import SettingsStore from "../../settings/SettingsStore"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; import FileDropTarget from "./FileDropTarget"; import { getKeyBindingsManager } from "../../KeyBindingsManager"; import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts"; import Measured from "../views/elements/Measured"; import PosthogTrackers from "../../PosthogTrackers"; -import { ButtonEvent } from "../views/elements/AccessibleButton"; +import { type ButtonEvent } from "../views/elements/AccessibleButton"; import Spinner from "../views/elements/Spinner"; -import { ComposerInsertPayload, ComposerType } from "../../dispatcher/payloads/ComposerInsertPayload"; +import { type ComposerInsertPayload, ComposerType } from "../../dispatcher/payloads/ComposerInsertPayload"; import Heading from "../views/typography/Heading"; import { SdkContextClass } from "../../contexts/SDKContext"; -import { ThreadPayload } from "../../dispatcher/payloads/ThreadPayload"; +import { type ThreadPayload } from "../../dispatcher/payloads/ThreadPayload"; import { ScopedRoomContextProvider } from "../../contexts/ScopedRoomContext.tsx"; interface IProps { diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index 31ce65cfa7..c41240079a 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -6,25 +6,25 @@ 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, { createRef, ReactNode } from "react"; +import React, { createRef, type ReactNode } from "react"; import { - Room, + type Room, RoomEvent, - RoomMember, + type RoomMember, RoomMemberEvent, - MatrixEvent, + type MatrixEvent, MatrixEventEvent, - EventTimelineSet, - IRoomTimelineData, + type EventTimelineSet, + type IRoomTimelineData, Direction, EventTimeline, EventType, - RelationType, + type RelationType, ClientEvent, - MatrixClient, - Relations, - MatrixError, - SyncState, + type MatrixClient, + type Relations, + type MatrixError, + type SyncState, TimelineWindow, Thread, ThreadEvent, @@ -34,7 +34,7 @@ import { debounce, findLastIndex } from "lodash"; import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "../../settings/SettingsStore"; -import { Layout } from "../../settings/enums/Layout"; +import { type Layout } from "../../settings/enums/Layout"; import { _t } from "../../languageHandler"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import RoomContext, { TimelineRenderingType } from "../../contexts/RoomContext"; @@ -45,15 +45,16 @@ import { Action } from "../../dispatcher/actions"; import Timer from "../../utils/Timer"; import shouldHideEvent from "../../shouldHideEvent"; import MessagePanel from "./MessagePanel"; -import { IScrollState } from "./ScrollPanel"; -import { ActionPayload } from "../../dispatcher/payloads"; -import ResizeNotifier from "../../utils/ResizeNotifier"; -import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; +import { type IScrollState } from "./ScrollPanel"; +import { type ActionPayload } from "../../dispatcher/payloads"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; +import { type RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; import Spinner from "../views/elements/Spinner"; -import EditorStateTransfer from "../../utils/EditorStateTransfer"; +import type EditorStateTransfer from "../../utils/EditorStateTransfer"; import ErrorDialog from "../views/dialogs/ErrorDialog"; -import LegacyCallEventGrouper, { buildLegacyCallEventGroupers } from "./LegacyCallEventGrouper"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import type LegacyCallEventGrouper from "./LegacyCallEventGrouper"; +import { buildLegacyCallEventGroupers } from "./LegacyCallEventGrouper"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; import { getKeyBindingsManager } from "../../KeyBindingsManager"; import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts"; import { haveRendererForEvent } from "../../events/EventTileFactory"; diff --git a/src/components/structures/ToastContainer.tsx b/src/components/structures/ToastContainer.tsx index 862e4150aa..43c12d9cf6 100644 --- a/src/components/structures/ToastContainer.tsx +++ b/src/components/structures/ToastContainer.tsx @@ -9,9 +9,9 @@ Please see LICENSE files in the repository root for full details. import * as React from "react"; import classNames from "classnames"; import { Text } from "@vector-im/compound-web"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; -import ToastStore, { IToast } from "../../stores/ToastStore"; +import ToastStore, { type IToast } from "../../stores/ToastStore"; interface IState { toasts: IToast[]; diff --git a/src/components/structures/UploadBar.tsx b/src/components/structures/UploadBar.tsx index 7618862798..a28ff2ba44 100644 --- a/src/components/structures/UploadBar.tsx +++ b/src/components/structures/UploadBar.tsx @@ -7,18 +7,18 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room, IEventRelation } from "matrix-js-sdk/src/matrix"; -import { Optional } from "matrix-events-sdk"; +import { type Room, type IEventRelation } from "matrix-js-sdk/src/matrix"; +import { type Optional } from "matrix-events-sdk"; import ContentMessages from "../../ContentMessages"; import dis from "../../dispatcher/dispatcher"; import { _t } from "../../languageHandler"; import { Action } from "../../dispatcher/actions"; import ProgressBar from "../views/elements/ProgressBar"; -import AccessibleButton, { ButtonEvent } from "../views/elements/AccessibleButton"; -import { RoomUpload } from "../../models/RoomUpload"; -import { ActionPayload } from "../../dispatcher/payloads"; -import { UploadPayload } from "../../dispatcher/payloads/UploadPayload"; +import AccessibleButton, { type ButtonEvent } from "../views/elements/AccessibleButton"; +import { type RoomUpload } from "../../models/RoomUpload"; +import { type ActionPayload } from "../../dispatcher/payloads"; +import { type UploadPayload } from "../../dispatcher/payloads/UploadPayload"; import { fileSize } from "../../utils/FileUtils"; interface IProps { diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index e266352393..08a519e182 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -6,24 +6,24 @@ 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, { createRef, ReactNode } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { createRef, type ReactNode } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { Action } from "../../dispatcher/actions"; import { _t } from "../../languageHandler"; -import { ChevronFace, ContextMenuButton, MenuProps } from "./ContextMenu"; +import { ChevronFace, ContextMenuButton, type MenuProps } from "./ContextMenu"; import { UserTab } from "../views/dialogs/UserTab"; -import { OpenToTabPayload } from "../../dispatcher/payloads/OpenToTabPayload"; +import { type OpenToTabPayload } from "../../dispatcher/payloads/OpenToTabPayload"; import FeedbackDialog from "../views/dialogs/FeedbackDialog"; import Modal from "../../Modal"; import LogoutDialog, { shouldShowLogoutDialog } from "../views/dialogs/LogoutDialog"; import SettingsStore from "../../settings/SettingsStore"; import { findHighContrastTheme, getCustomTheme, isHighContrastTheme } from "../../theme"; import { RovingAccessibleButton } from "../../accessibility/RovingTabIndex"; -import AccessibleButton, { ButtonEvent } from "../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../views/elements/AccessibleButton"; import SdkConfig from "../../SdkConfig"; import { getHomePageUrl } from "../../utils/pages"; import { OwnProfileStore } from "../../stores/OwnProfileStore"; @@ -39,7 +39,7 @@ import SpaceStore from "../../stores/spaces/SpaceStore"; import { UPDATE_SELECTED_SPACE } from "../../stores/spaces"; import UserIdentifierCustomisations from "../../customisations/UserIdentifier"; import PosthogTrackers from "../../PosthogTrackers"; -import { ViewHomePagePayload } from "../../dispatcher/payloads/ViewHomePagePayload"; +import { type ViewHomePagePayload } from "../../dispatcher/payloads/ViewHomePagePayload"; import { SDKContext } from "../../contexts/SDKContext"; import { shouldShowFeedback } from "../../utils/Feedback"; import DarkLightModeSvg from "../../../res/img/element-icons/roomlist/dark-light-mode.svg"; diff --git a/src/components/structures/UserView.tsx b/src/components/structures/UserView.tsx index 7325f607ad..be947d9a4b 100644 --- a/src/components/structures/UserView.tsx +++ b/src/components/structures/UserView.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, RoomMember, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { MatrixEvent, RoomMember, type MatrixClient } from "matrix-js-sdk/src/matrix"; import Modal from "../../Modal"; import { _t } from "../../languageHandler"; @@ -15,7 +15,7 @@ import ErrorDialog from "../views/dialogs/ErrorDialog"; import MainSplit from "./MainSplit"; import RightPanel from "./RightPanel"; import Spinner from "../views/elements/Spinner"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases"; import HomePage from "./HomePage.tsx"; import MatrixClientContext from "../../contexts/MatrixClientContext"; diff --git a/src/components/structures/ViewSource.tsx b/src/components/structures/ViewSource.tsx index eca37842d7..66bbbe4c0b 100644 --- a/src/components/structures/ViewSource.tsx +++ b/src/components/structures/ViewSource.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import SyntaxHighlight from "../views/elements/SyntaxHighlight"; import { _t } from "../../languageHandler"; diff --git a/src/components/structures/WaitingForThirdPartyRoomView.tsx b/src/components/structures/WaitingForThirdPartyRoomView.tsx index 065ed39cdb..0112da4cc0 100644 --- a/src/components/structures/WaitingForThirdPartyRoomView.tsx +++ b/src/components/structures/WaitingForThirdPartyRoomView.tsx @@ -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 React, { RefObject } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { type RefObject } from "react"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import ResizeNotifier from "../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../utils/ResizeNotifier"; import ErrorBoundary from "../views/elements/ErrorBoundary"; import RoomHeader from "../views/rooms/RoomHeader/RoomHeader.tsx"; import ScrollPanel from "./ScrollPanel"; diff --git a/src/components/structures/auth/ForgotPassword.tsx b/src/components/structures/auth/ForgotPassword.tsx index ecf888f6e9..9e25f3349c 100644 --- a/src/components/structures/auth/ForgotPassword.tsx +++ b/src/components/structures/auth/ForgotPassword.tsx @@ -8,7 +8,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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { sleep } from "matrix-js-sdk/src/utils"; import { LockSolidIcon, CheckIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; @@ -23,11 +23,11 @@ import AuthHeader from "../../views/auth/AuthHeader"; import AuthBody from "../../views/auth/AuthBody"; import PassphraseConfirmField from "../../views/auth/PassphraseConfirmField"; import StyledCheckbox from "../../views/elements/StyledCheckbox"; -import { ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; +import { type ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; import QuestionDialog from "../../views/dialogs/QuestionDialog"; import { EnterEmail } from "./forgot-password/EnterEmail"; import { CheckEmail } from "./forgot-password/CheckEmail"; -import Field from "../../views/elements/Field"; +import type Field from "../../views/elements/Field"; import { ErrorMessage } from "../ErrorMessage"; import { VerifyEmailModal } from "./forgot-password/VerifyEmailModal"; import Spinner from "../../views/elements/Spinner"; diff --git a/src/components/structures/auth/Login.tsx b/src/components/structures/auth/Login.tsx index b4b41f0515..894799b566 100644 --- a/src/components/structures/auth/Login.tsx +++ b/src/components/structures/auth/Login.tsx @@ -6,20 +6,20 @@ 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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import classNames from "classnames"; import { logger } from "matrix-js-sdk/src/logger"; -import { SSOFlow, SSOAction } from "matrix-js-sdk/src/matrix"; +import { type SSOFlow, SSOAction } from "matrix-js-sdk/src/matrix"; import { _t, UserFriendlyError } from "../../../languageHandler"; -import Login, { ClientLoginFlow, OidcNativeFlow } from "../../../Login"; +import Login, { type ClientLoginFlow, type OidcNativeFlow } from "../../../Login"; import { messageForConnectionError, messageForLoginError } from "../../../utils/ErrorUtils"; import AutoDiscoveryUtils from "../../../utils/AutoDiscoveryUtils"; import AuthPage from "../../views/auth/AuthPage"; import PlatformPeg from "../../../PlatformPeg"; import SettingsStore from "../../../settings/SettingsStore"; import { UIFeature } from "../../../settings/UIFeature"; -import { IMatrixClientCreds } from "../../../MatrixClientPeg"; +import { type IMatrixClientCreds } from "../../../MatrixClientPeg"; import PasswordLogin from "../../views/auth/PasswordLogin"; import InlineSpinner from "../../views/elements/InlineSpinner"; import Spinner from "../../views/elements/Spinner"; @@ -27,8 +27,8 @@ import SSOButtons from "../../views/elements/SSOButtons"; import ServerPicker from "../../views/elements/ServerPicker"; import AuthBody from "../../views/auth/AuthBody"; import AuthHeader from "../../views/auth/AuthHeader"; -import AccessibleButton, { ButtonEvent } from "../../views/elements/AccessibleButton"; -import { ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; +import AccessibleButton, { type ButtonEvent } from "../../views/elements/AccessibleButton"; +import { type ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; import { filterBoolean } from "../../../utils/arrays"; import { startOidcLogin } from "../../../utils/oidc/authorize"; diff --git a/src/components/structures/auth/LoginSplashView.tsx b/src/components/structures/auth/LoginSplashView.tsx index 3d68a12e8d..62e5734e19 100644 --- a/src/components/structures/auth/LoginSplashView.tsx +++ b/src/components/structures/auth/LoginSplashView.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { CryptoEvent } from "matrix-js-sdk/src/crypto-api"; import { messageForSyncError } from "../../../utils/ErrorUtils"; import Spinner from "../../views/elements/Spinner"; import ProgressBar from "../../views/elements/ProgressBar"; -import AccessibleButton, { ButtonEvent } from "../../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../views/elements/AccessibleButton"; import { _t } from "../../../languageHandler"; import { useTypedEventEmitterState } from "../../../hooks/useEventEmitter"; import SdkConfig from "../../../SdkConfig"; diff --git a/src/components/structures/auth/Registration.tsx b/src/components/structures/auth/Registration.tsx index 1dc6f57bc7..496c687bbf 100644 --- a/src/components/structures/auth/Registration.tsx +++ b/src/components/structures/auth/Registration.tsx @@ -9,18 +9,18 @@ Please see LICENSE files in the repository root for full details. import { AuthType, createClient, - IAuthData, - AuthDict, - IInputs, + type IAuthData, + type AuthDict, + type IInputs, MatrixError, - IRegisterRequestParams, - IRequestTokenResponse, - MatrixClient, - SSOFlow, + type IRegisterRequestParams, + type IRequestTokenResponse, + type MatrixClient, + type SSOFlow, SSOAction, - RegisterResponse, + type RegisterResponse, } from "matrix-js-sdk/src/matrix"; -import React, { Fragment, ReactNode } from "react"; +import React, { Fragment, type ReactNode } from "react"; import classNames from "classnames"; import { logger } from "matrix-js-sdk/src/logger"; @@ -28,22 +28,22 @@ import { _t } from "../../../languageHandler"; import { adminContactStrings, messageForResourceLimitError, resourceLimitStrings } from "../../../utils/ErrorUtils"; import AutoDiscoveryUtils from "../../../utils/AutoDiscoveryUtils"; import * as Lifecycle from "../../../Lifecycle"; -import { IMatrixClientCreds, MatrixClientPeg } from "../../../MatrixClientPeg"; +import { type IMatrixClientCreds, MatrixClientPeg } from "../../../MatrixClientPeg"; import AuthPage from "../../views/auth/AuthPage"; -import Login, { OidcNativeFlow } from "../../../Login"; +import Login, { type OidcNativeFlow } from "../../../Login"; import dis from "../../../dispatcher/dispatcher"; import SSOButtons from "../../views/elements/SSOButtons"; import ServerPicker from "../../views/elements/ServerPicker"; import RegistrationForm from "../../views/auth/RegistrationForm"; -import AccessibleButton, { ButtonEvent } from "../../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../views/elements/AccessibleButton"; import AuthBody from "../../views/auth/AuthBody"; import AuthHeader from "../../views/auth/AuthHeader"; -import InteractiveAuth, { InteractiveAuthCallback } from "../InteractiveAuth"; +import InteractiveAuth, { type InteractiveAuthCallback } from "../InteractiveAuth"; import Spinner from "../../views/elements/Spinner"; import { AuthHeaderDisplay } from "./header/AuthHeaderDisplay"; import { AuthHeaderProvider } from "./header/AuthHeaderProvider"; import SettingsStore from "../../../settings/SettingsStore"; -import { ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; +import { type ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; import { startOidcLogin } from "../../../utils/oidc/authorize"; const debuglog = (...args: any[]): void => { diff --git a/src/components/structures/auth/SetupEncryptionBody.tsx b/src/components/structures/auth/SetupEncryptionBody.tsx index 1ff0ad4120..e290292ea6 100644 --- a/src/components/structures/auth/SetupEncryptionBody.tsx +++ b/src/components/structures/auth/SetupEncryptionBody.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { KeyBackupInfo, VerificationRequest } from "matrix-js-sdk/src/crypto-api"; +import { type KeyBackupInfo, type VerificationRequest } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; -import { SecretStorageKeyDescription } from "matrix-js-sdk/src/secret-storage"; +import { type SecretStorageKeyDescription } from "matrix-js-sdk/src/secret-storage"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; @@ -17,7 +17,7 @@ import Modal from "../../../Modal"; import VerificationRequestDialog from "../../views/dialogs/VerificationRequestDialog"; import { SetupEncryptionStore, Phase } from "../../../stores/SetupEncryptionStore"; import EncryptionPanel from "../../views/right_panel/EncryptionPanel"; -import AccessibleButton, { ButtonEvent } from "../../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../views/elements/AccessibleButton"; import Spinner from "../../views/elements/Spinner"; function keyHasPassphrase(keyInfo: SecretStorageKeyDescription): boolean { diff --git a/src/components/structures/auth/SoftLogout.tsx b/src/components/structures/auth/SoftLogout.tsx index 696edc0ad2..62cb2801f8 100644 --- a/src/components/structures/auth/SoftLogout.tsx +++ b/src/components/structures/auth/SoftLogout.tsx @@ -6,16 +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 React, { ChangeEvent, SyntheticEvent } from "react"; +import React, { type ChangeEvent, type SyntheticEvent } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { Optional } from "matrix-events-sdk"; -import { LoginFlow, MatrixError, SSOAction, SSOFlow } from "matrix-js-sdk/src/matrix"; +import { type Optional } from "matrix-events-sdk"; +import { type LoginFlow, MatrixError, SSOAction, type SSOFlow } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; import * as Lifecycle from "../../../Lifecycle"; import Modal from "../../../Modal"; -import { IMatrixClientCreds, MatrixClientPeg } from "../../../MatrixClientPeg"; +import { type IMatrixClientCreds, MatrixClientPeg } from "../../../MatrixClientPeg"; import { sendLoginRequest } from "../../../Login"; import AuthPage from "../../views/auth/AuthPage"; import { SSO_HOMESERVER_URL_KEY, SSO_ID_SERVER_URL_KEY } from "../../../BasePlatform"; diff --git a/src/components/structures/auth/forgot-password/CheckEmail.tsx b/src/components/structures/auth/forgot-password/CheckEmail.tsx index 428bc17026..64036507de 100644 --- a/src/components/structures/auth/forgot-password/CheckEmail.tsx +++ b/src/components/structures/auth/forgot-password/CheckEmail.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { Tooltip } from "@vector-im/compound-web"; import { RestartIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; diff --git a/src/components/structures/auth/forgot-password/EnterEmail.tsx b/src/components/structures/auth/forgot-password/EnterEmail.tsx index d50040552d..9e7d6ae5a6 100644 --- a/src/components/structures/auth/forgot-password/EnterEmail.tsx +++ b/src/components/structures/auth/forgot-password/EnterEmail.tsx @@ -6,15 +6,15 @@ 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, { ReactNode, useRef } from "react"; +import React, { type ReactNode, useRef } from "react"; import { EmailSolidIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { _t, _td } from "../../../../languageHandler"; import EmailField from "../../../views/auth/EmailField"; import { ErrorMessage } from "../../ErrorMessage"; import Spinner from "../../../views/elements/Spinner"; -import Field from "../../../views/elements/Field"; -import AccessibleButton, { ButtonEvent } from "../../../views/elements/AccessibleButton"; +import type Field from "../../../views/elements/Field"; +import AccessibleButton, { type ButtonEvent } from "../../../views/elements/AccessibleButton"; interface EnterEmailProps { email: string; diff --git a/src/components/structures/auth/forgot-password/VerifyEmailModal.tsx b/src/components/structures/auth/forgot-password/VerifyEmailModal.tsx index cb2c5b3b85..5f57146fe5 100644 --- a/src/components/structures/auth/forgot-password/VerifyEmailModal.tsx +++ b/src/components/structures/auth/forgot-password/VerifyEmailModal.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { Tooltip } from "@vector-im/compound-web"; import { RestartIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; diff --git a/src/components/structures/auth/header/AuthHeaderContext.tsx b/src/components/structures/auth/header/AuthHeaderContext.tsx index 4c9d436f0c..768060b654 100644 --- a/src/components/structures/auth/header/AuthHeaderContext.tsx +++ b/src/components/structures/auth/header/AuthHeaderContext.tsx @@ -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 { createContext, Dispatch, ReducerAction, ReducerState } from "react"; +import { createContext, type Dispatch, type ReducerAction, type ReducerState } from "react"; import type { AuthHeaderReducer } from "./AuthHeaderProvider"; diff --git a/src/components/structures/auth/header/AuthHeaderDisplay.tsx b/src/components/structures/auth/header/AuthHeaderDisplay.tsx index f1289a1c99..17f4c91b8c 100644 --- a/src/components/structures/auth/header/AuthHeaderDisplay.tsx +++ b/src/components/structures/auth/header/AuthHeaderDisplay.tsx @@ -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 React, { Fragment, PropsWithChildren, ReactNode, useContext } from "react"; +import React, { Fragment, type PropsWithChildren, type ReactNode, useContext } from "react"; import { AuthHeaderContext } from "./AuthHeaderContext"; diff --git a/src/components/structures/auth/header/AuthHeaderModifier.tsx b/src/components/structures/auth/header/AuthHeaderModifier.tsx index d3b3d648e7..afe5a4b7ce 100644 --- a/src/components/structures/auth/header/AuthHeaderModifier.tsx +++ b/src/components/structures/auth/header/AuthHeaderModifier.tsx @@ -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 { ReactNode, useContext, useEffect } from "react"; +import { type ReactNode, useContext, useEffect } from "react"; import { AuthHeaderContext } from "./AuthHeaderContext"; import { AuthHeaderActionType } from "./AuthHeaderProvider"; diff --git a/src/components/structures/auth/header/AuthHeaderProvider.tsx b/src/components/structures/auth/header/AuthHeaderProvider.tsx index 4c4eb62098..af48364bd7 100644 --- a/src/components/structures/auth/header/AuthHeaderProvider.tsx +++ b/src/components/structures/auth/header/AuthHeaderProvider.tsx @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { isEqual } from "lodash"; -import React, { ComponentProps, PropsWithChildren, Reducer, useReducer } from "react"; +import React, { type ComponentProps, type PropsWithChildren, type Reducer, useReducer } from "react"; import { AuthHeaderContext } from "./AuthHeaderContext"; -import { AuthHeaderModifier } from "./AuthHeaderModifier"; +import { type AuthHeaderModifier } from "./AuthHeaderModifier"; export enum AuthHeaderActionType { Add, diff --git a/src/components/structures/grouper/BaseGrouper.ts b/src/components/structures/grouper/BaseGrouper.ts index a685582a2c..c0fc83080e 100644 --- a/src/components/structures/grouper/BaseGrouper.ts +++ b/src/components/structures/grouper/BaseGrouper.ts @@ -6,10 +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 { ReactNode } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type ReactNode } from "react"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import MessagePanel, { WrappedEvent } from "../MessagePanel"; +import { type WrappedEvent } from "../MessagePanel"; +import type MessagePanel from "../MessagePanel"; /* Grouper classes determine when events can be grouped together in a summary. * Groupers should have the following methods: diff --git a/src/components/structures/grouper/CreationGrouper.tsx b/src/components/structures/grouper/CreationGrouper.tsx index 5009b14baf..009f5bdc26 100644 --- a/src/components/structures/grouper/CreationGrouper.tsx +++ b/src/components/structures/grouper/CreationGrouper.tsx @@ -6,12 +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, { ReactNode } from "react"; -import { EventType, M_BEACON_INFO, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode } from "react"; +import { EventType, M_BEACON_INFO, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { BaseGrouper } from "./BaseGrouper"; -import MessagePanel, { WrappedEvent } from "../MessagePanel"; +import { type WrappedEvent } from "../MessagePanel"; +import type MessagePanel from "../MessagePanel"; import DMRoomMap from "../../../utils/DMRoomMap"; import { _t } from "../../../languageHandler"; import DateSeparator from "../../views/messages/DateSeparator"; diff --git a/src/components/structures/grouper/LateEventGrouper.ts b/src/components/structures/grouper/LateEventGrouper.ts index 87cf6549b2..73e858b340 100644 --- a/src/components/structures/grouper/LateEventGrouper.ts +++ b/src/components/structures/grouper/LateEventGrouper.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; const UNSIGNED_KEY = "io.element.late_event"; diff --git a/src/components/structures/grouper/MainGrouper.tsx b/src/components/structures/grouper/MainGrouper.tsx index 84d0be2674..e686f1aa81 100644 --- a/src/components/structures/grouper/MainGrouper.tsx +++ b/src/components/structures/grouper/MainGrouper.tsx @@ -6,8 +6,8 @@ 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, { ReactNode } from "react"; -import { EventType, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode } from "react"; +import { EventType, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import type MessagePanel from "../MessagePanel"; import type { WrappedEvent } from "../MessagePanel"; diff --git a/src/components/utils/Flex.tsx b/src/components/utils/Flex.tsx index c5b81e9eae..01f8022193 100644 --- a/src/components/utils/Flex.tsx +++ b/src/components/utils/Flex.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { ComponentProps, JSXElementConstructor, useMemo } from "react"; +import React, { type ComponentProps, type JSXElementConstructor, useMemo } from "react"; type FlexProps> = { /** diff --git a/src/components/viewmodels/memberlist/MemberListViewModel.tsx b/src/components/viewmodels/memberlist/MemberListViewModel.tsx index 6955746c35..a03f703511 100644 --- a/src/components/viewmodels/memberlist/MemberListViewModel.tsx +++ b/src/components/viewmodels/memberlist/MemberListViewModel.tsx @@ -8,35 +8,35 @@ Please see LICENSE files in the repository root for full details. import { ClientEvent, EventType, - MatrixEvent, - Room, + type MatrixEvent, + type Room, RoomEvent, RoomMemberEvent, - RoomState, + type RoomState, RoomStateEvent, - RoomMember as SdkRoomMember, - User, + type RoomMember as SdkRoomMember, + type User, UserEvent, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { useCallback, useContext, useEffect, useMemo, useState } from "react"; import { throttle } from "lodash"; -import { RoomMember } from "../../../models/rooms/RoomMember"; +import { type RoomMember } from "../../../models/rooms/RoomMember"; import { mediaFromMxc } from "../../../customisations/Media"; import UserIdentifierCustomisations from "../../../customisations/UserIdentifier"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; -import { PresenceState } from "../../../models/rooms/PresenceState"; +import { type PresenceState } from "../../../models/rooms/PresenceState"; import { useMatrixClientContext } from "../../../contexts/MatrixClientContext"; import { SDKContext } from "../../../contexts/SDKContext"; import PosthogTrackers from "../../../PosthogTrackers"; -import { ButtonEvent } from "../../views/elements/AccessibleButton"; +import { type ButtonEvent } from "../../views/elements/AccessibleButton"; import { inviteToRoom } from "../../../utils/room/inviteToRoom"; import { canInviteTo } from "../../../utils/room/canInviteTo"; import { isValid3pidInvite } from "../../../RoomInvite"; -import { ThreePIDInvite } from "../../../models/rooms/ThreePIDInvite"; -import { XOR } from "../../../@types/common"; +import { type ThreePIDInvite } from "../../../models/rooms/ThreePIDInvite"; +import { type XOR } from "../../../@types/common"; import { useTypedEventEmitter } from "../../../hooks/useEventEmitter"; type Member = XOR<{ member: RoomMember }, { threePidInvite: ThreePIDInvite }>; diff --git a/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.tsx b/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.tsx index daf84f763b..4f6814caae 100644 --- a/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.tsx +++ b/src/components/viewmodels/memberlist/tiles/MemberTileViewModel.tsx @@ -6,16 +6,16 @@ Please see LICENSE files in the repository root for full details. */ import { useEffect, useMemo, useState } from "react"; -import { RoomStateEvent, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; -import { UserVerificationStatus, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; +import { RoomStateEvent, type MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { type UserVerificationStatus, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; import dis from "../../../../dispatcher/dispatcher"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import { Action } from "../../../../dispatcher/actions"; import { asyncSome } from "../../../../utils/arrays"; import { getUserDeviceIds } from "../../../../utils/crypto/deviceInfo"; -import { RoomMember } from "../../../../models/rooms/RoomMember"; -import { _t, _td, TranslationKey } from "../../../../languageHandler"; +import { type RoomMember } from "../../../../models/rooms/RoomMember"; +import { _t, _td, type TranslationKey } from "../../../../languageHandler"; import UserIdentifierCustomisations from "../../../../customisations/UserIdentifier"; import { E2EStatus } from "../../../../utils/ShieldUtils"; diff --git a/src/components/viewmodels/memberlist/tiles/ThreePidTileViewModel.tsx b/src/components/viewmodels/memberlist/tiles/ThreePidTileViewModel.tsx index f0502eede0..f1e32692c0 100644 --- a/src/components/viewmodels/memberlist/tiles/ThreePidTileViewModel.tsx +++ b/src/components/viewmodels/memberlist/tiles/ThreePidTileViewModel.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. import dis from "../../../../dispatcher/dispatcher"; import { Action } from "../../../../dispatcher/actions"; -import { ThreePIDInvite } from "../../../../models/rooms/ThreePIDInvite"; +import { type ThreePIDInvite } from "../../../../models/rooms/ThreePIDInvite"; import { _t } from "../../../../languageHandler"; interface ThreePidTileViewModelProps { diff --git a/src/components/viewmodels/rooms/UserIdentityWarningViewModel.tsx b/src/components/viewmodels/rooms/UserIdentityWarningViewModel.tsx index 5a5d2da2d1..9e9f0f7b3a 100644 --- a/src/components/viewmodels/rooms/UserIdentityWarningViewModel.tsx +++ b/src/components/viewmodels/rooms/UserIdentityWarningViewModel.tsx @@ -6,8 +6,8 @@ Please see LICENSE files in the repository root for full details. */ import { useCallback, useEffect, useMemo, useState } from "react"; -import { EventType, MatrixEvent, Room, RoomMember, RoomStateEvent } from "matrix-js-sdk/src/matrix"; -import { CryptoApi, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; +import { EventType, type MatrixEvent, type Room, type RoomMember, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { type CryptoApi, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; import { throttle } from "lodash"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/components/views/audio_messages/AudioPlayer.tsx b/src/components/views/audio_messages/AudioPlayer.tsx index 63c77108e3..6f674e504d 100644 --- a/src/components/views/audio_messages/AudioPlayer.tsx +++ b/src/components/views/audio_messages/AudioPlayer.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import PlayPauseButton from "./PlayPauseButton"; import { formatBytes } from "../../../utils/FormattingUtils"; diff --git a/src/components/views/audio_messages/AudioPlayerBase.tsx b/src/components/views/audio_messages/AudioPlayerBase.tsx index 97cbad0fc2..97fc49b9db 100644 --- a/src/components/views/audio_messages/AudioPlayerBase.tsx +++ b/src/components/views/audio_messages/AudioPlayerBase.tsx @@ -6,16 +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 React, { createRef, ReactNode, RefObject } from "react"; +import React, { createRef, type ReactNode, type RefObject } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { Playback, PlaybackState } from "../../../audio/Playback"; +import { type Playback, type PlaybackState } from "../../../audio/Playback"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import { _t } from "../../../languageHandler"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; -import SeekBar from "./SeekBar"; -import PlayPauseButton from "./PlayPauseButton"; +import type SeekBar from "./SeekBar"; +import type PlayPauseButton from "./PlayPauseButton"; export interface IProps { // Playback instance to render. Cannot change during component lifecycle: create diff --git a/src/components/views/audio_messages/Clock.tsx b/src/components/views/audio_messages/Clock.tsx index c8f27c3f9c..d9f1a3d6c5 100644 --- a/src/components/views/audio_messages/Clock.tsx +++ b/src/components/views/audio_messages/Clock.tsx @@ -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 React, { HTMLProps } from "react"; +import React, { type HTMLProps } from "react"; import { Temporal } from "temporal-polyfill"; import { formatSeconds } from "../../../DateUtils"; diff --git a/src/components/views/audio_messages/DurationClock.tsx b/src/components/views/audio_messages/DurationClock.tsx index 1a84a15955..920baa99be 100644 --- a/src/components/views/audio_messages/DurationClock.tsx +++ b/src/components/views/audio_messages/DurationClock.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import Clock from "./Clock"; -import { Playback } from "../../../audio/Playback"; +import { type Playback } from "../../../audio/Playback"; interface IProps { playback: Playback; diff --git a/src/components/views/audio_messages/LiveRecordingClock.tsx b/src/components/views/audio_messages/LiveRecordingClock.tsx index bd8b8d5d23..74415566a6 100644 --- a/src/components/views/audio_messages/LiveRecordingClock.tsx +++ b/src/components/views/audio_messages/LiveRecordingClock.tsx @@ -8,10 +8,10 @@ Please see LICENSE files in the repository root for full details. import React from "react"; -import { IRecordingUpdate } from "../../../audio/VoiceRecording"; +import { type IRecordingUpdate } from "../../../audio/VoiceRecording"; import Clock from "./Clock"; import { MarkedExecution } from "../../../utils/MarkedExecution"; -import { VoiceMessageRecording } from "../../../audio/VoiceMessageRecording"; +import { type VoiceMessageRecording } from "../../../audio/VoiceMessageRecording"; interface IProps { recorder: VoiceMessageRecording; diff --git a/src/components/views/audio_messages/LiveRecordingWaveform.tsx b/src/components/views/audio_messages/LiveRecordingWaveform.tsx index 18c1ca1aa2..2c388fe867 100644 --- a/src/components/views/audio_messages/LiveRecordingWaveform.tsx +++ b/src/components/views/audio_messages/LiveRecordingWaveform.tsx @@ -8,11 +8,11 @@ Please see LICENSE files in the repository root for full details. import React from "react"; -import { IRecordingUpdate, RECORDING_PLAYBACK_SAMPLES } from "../../../audio/VoiceRecording"; +import { type IRecordingUpdate, RECORDING_PLAYBACK_SAMPLES } from "../../../audio/VoiceRecording"; import { arrayFastResample, arraySeed } from "../../../utils/arrays"; import Waveform from "./Waveform"; import { MarkedExecution } from "../../../utils/MarkedExecution"; -import { VoiceMessageRecording } from "../../../audio/VoiceMessageRecording"; +import { type VoiceMessageRecording } from "../../../audio/VoiceMessageRecording"; interface IProps { recorder: VoiceMessageRecording; diff --git a/src/components/views/audio_messages/PlayPauseButton.tsx b/src/components/views/audio_messages/PlayPauseButton.tsx index 1b197c6bad..a4457b2230 100644 --- a/src/components/views/audio_messages/PlayPauseButton.tsx +++ b/src/components/views/audio_messages/PlayPauseButton.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; -import { Playback, PlaybackState } from "../../../audio/Playback"; -import AccessibleButton, { ButtonProps } from "../elements/AccessibleButton"; +import { type Playback, PlaybackState } from "../../../audio/Playback"; +import AccessibleButton, { type ButtonProps } from "../elements/AccessibleButton"; type Props = Omit, "title" | "onClick" | "disabled" | "element" | "ref"> & { // Playback instance to manipulate. Cannot change during the component lifecycle. diff --git a/src/components/views/audio_messages/PlaybackClock.tsx b/src/components/views/audio_messages/PlaybackClock.tsx index 999b5398b1..0d69793379 100644 --- a/src/components/views/audio_messages/PlaybackClock.tsx +++ b/src/components/views/audio_messages/PlaybackClock.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import Clock from "./Clock"; -import { Playback, PlaybackState } from "../../../audio/Playback"; +import { type Playback, PlaybackState } from "../../../audio/Playback"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; interface IProps { diff --git a/src/components/views/audio_messages/PlaybackWaveform.tsx b/src/components/views/audio_messages/PlaybackWaveform.tsx index a5113dd042..c1f470f4b1 100644 --- a/src/components/views/audio_messages/PlaybackWaveform.tsx +++ b/src/components/views/audio_messages/PlaybackWaveform.tsx @@ -10,7 +10,7 @@ import React from "react"; import { arraySeed, arrayTrimFill } from "../../../utils/arrays"; import Waveform from "./Waveform"; -import { Playback } from "../../../audio/Playback"; +import { type Playback } from "../../../audio/Playback"; import { percentageOf } from "../../../utils/numbers"; import { PLAYBACK_WAVEFORM_SAMPLES } from "../../../audio/consts"; diff --git a/src/components/views/audio_messages/RecordingPlayback.tsx b/src/components/views/audio_messages/RecordingPlayback.tsx index 4c030f81ef..c0e3337787 100644 --- a/src/components/views/audio_messages/RecordingPlayback.tsx +++ b/src/components/views/audio_messages/RecordingPlayback.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import PlayPauseButton from "./PlayPauseButton"; import PlaybackClock from "./PlaybackClock"; -import AudioPlayerBase, { IProps as IAudioPlayerBaseProps } from "./AudioPlayerBase"; +import AudioPlayerBase, { type IProps as IAudioPlayerBaseProps } from "./AudioPlayerBase"; import SeekBar from "./SeekBar"; import PlaybackWaveform from "./PlaybackWaveform"; import { PlaybackState } from "../../../audio/Playback"; diff --git a/src/components/views/audio_messages/SeekBar.tsx b/src/components/views/audio_messages/SeekBar.tsx index 1a79f5be06..587975ce1b 100644 --- a/src/components/views/audio_messages/SeekBar.tsx +++ b/src/components/views/audio_messages/SeekBar.tsx @@ -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, { ChangeEvent, CSSProperties, ReactNode } from "react"; +import React, { type ChangeEvent, type CSSProperties, type ReactNode } from "react"; -import { PlaybackInterface } from "../../../audio/Playback"; +import { type PlaybackInterface } from "../../../audio/Playback"; import { MarkedExecution } from "../../../utils/MarkedExecution"; import { percentageOf } from "../../../utils/numbers"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/audio_messages/Waveform.tsx b/src/components/views/audio_messages/Waveform.tsx index 2110622403..115b310f4c 100644 --- a/src/components/views/audio_messages/Waveform.tsx +++ b/src/components/views/audio_messages/Waveform.tsx @@ -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 React, { CSSProperties } from "react"; +import React, { type CSSProperties } from "react"; import classNames from "classnames"; interface WaveformCSSProperties extends CSSProperties { diff --git a/src/components/views/auth/AuthBody.tsx b/src/components/views/auth/AuthBody.tsx index b83955fcd9..ac1950b4a1 100644 --- a/src/components/views/auth/AuthBody.tsx +++ b/src/components/views/auth/AuthBody.tsx @@ -6,7 +6,7 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { PropsWithChildren } from "react"; +import React, { type PropsWithChildren } from "react"; interface Props { className?: string; diff --git a/src/components/views/auth/AuthFooter.tsx b/src/components/views/auth/AuthFooter.tsx index 472ff53f09..f609b4792a 100644 --- a/src/components/views/auth/AuthFooter.tsx +++ b/src/components/views/auth/AuthFooter.tsx @@ -7,7 +7,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 React, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; import SdkConfig from "../../../SdkConfig"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/auth/CompleteSecurityBody.tsx b/src/components/views/auth/CompleteSecurityBody.tsx index 77808ec71c..01eb0ec6f5 100644 --- a/src/components/views/auth/CompleteSecurityBody.tsx +++ b/src/components/views/auth/CompleteSecurityBody.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; export default class CompleteSecurityBody extends React.PureComponent<{ children: ReactNode }> { public render(): React.ReactNode { diff --git a/src/components/views/auth/CountryDropdown.tsx b/src/components/views/auth/CountryDropdown.tsx index 7e8d669d15..f25ed95e96 100644 --- a/src/components/views/auth/CountryDropdown.tsx +++ b/src/components/views/auth/CountryDropdown.tsx @@ -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, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; -import { COUNTRIES, getEmojiFlag, PhoneNumberCountryDefinition } from "../../../phonenumber"; +import { COUNTRIES, getEmojiFlag, type PhoneNumberCountryDefinition } from "../../../phonenumber"; import SdkConfig from "../../../SdkConfig"; import { _t, getUserLanguage } from "../../../languageHandler"; import Dropdown from "../elements/Dropdown"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; interface InternationalisedCountry extends PhoneNumberCountryDefinition { name: string; // already translated to the user's locale diff --git a/src/components/views/auth/EmailField.tsx b/src/components/views/auth/EmailField.tsx index ddc20c0bd1..9b330a377d 100644 --- a/src/components/views/auth/EmailField.tsx +++ b/src/components/views/auth/EmailField.tsx @@ -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 React, { ComponentProps, PureComponent, RefCallback, RefObject } from "react"; +import React, { type ComponentProps, PureComponent, type RefCallback, type RefObject } from "react"; -import Field, { IInputProps } from "../elements/Field"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; -import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; +import Field, { type IInputProps } from "../elements/Field"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; +import withValidation, { type IFieldState, type IValidationResult } from "../elements/Validation"; import * as Email from "../../../email"; interface IProps extends Omit { diff --git a/src/components/views/auth/InteractiveAuthEntryComponents.tsx b/src/components/views/auth/InteractiveAuthEntryComponents.tsx index 92440dc203..04da4d5bc7 100644 --- a/src/components/views/auth/InteractiveAuthEntryComponents.tsx +++ b/src/components/views/auth/InteractiveAuthEntryComponents.tsx @@ -7,17 +7,17 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import { InternationalisedPolicy, Terms, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { AuthType, AuthDict, IInputs, IStageStatus } from "matrix-js-sdk/src/interactive-auth"; +import { type InternationalisedPolicy, type Terms, type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { AuthType, type AuthDict, type IInputs, type IStageStatus } from "matrix-js-sdk/src/interactive-auth"; import { logger } from "matrix-js-sdk/src/logger"; -import React, { ChangeEvent, createRef, FormEvent, Fragment } from "react"; +import React, { type ChangeEvent, createRef, type FormEvent, Fragment } from "react"; import { Button, Text } from "@vector-im/compound-web"; import PopOutIcon from "@vector-im/compound-design-tokens/assets/web/icons/pop-out"; import EmailPromptIcon from "../../../../res/img/element-icons/email-prompt.svg"; import { _t } from "../../../languageHandler"; import { AuthHeaderModifier } from "../../structures/auth/header/AuthHeaderModifier"; -import AccessibleButton, { AccessibleButtonKind, ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type AccessibleButtonKind, type ButtonEvent } from "../elements/AccessibleButton"; import Field from "../elements/Field"; import Spinner from "../elements/Spinner"; import CaptchaForm from "./CaptchaForm"; diff --git a/src/components/views/auth/LoginWithQR.tsx b/src/components/views/auth/LoginWithQR.tsx index ecf107cfbd..1519a1fb45 100644 --- a/src/components/views/auth/LoginWithQR.tsx +++ b/src/components/views/auth/LoginWithQR.tsx @@ -14,11 +14,11 @@ import { MSC4108SecureChannel, MSC4108SignInWithQR, RendezvousError, - RendezvousFailureReason, + type RendezvousFailureReason, RendezvousIntent, } from "matrix-js-sdk/src/rendezvous"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { Click, Mode, Phase } from "./LoginWithQR-types"; import LoginWithQRFlow from "./LoginWithQRFlow"; diff --git a/src/components/views/auth/LoginWithQRFlow.tsx b/src/components/views/auth/LoginWithQRFlow.tsx index 663dc1acff..588e599098 100644 --- a/src/components/views/auth/LoginWithQRFlow.tsx +++ b/src/components/views/auth/LoginWithQRFlow.tsx @@ -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 React, { createRef, ReactNode } from "react"; +import React, { createRef, type ReactNode } from "react"; import { ClientRendezvousFailureReason, MSC4108FailureReason } from "matrix-js-sdk/src/rendezvous"; import ChevronLeftIcon from "@vector-im/compound-design-tokens/assets/web/icons/chevron-left"; import CheckCircleSolidIcon from "@vector-im/compound-design-tokens/assets/web/icons/check-circle-solid"; @@ -21,7 +21,7 @@ import QRCode from "../elements/QRCode"; import Spinner from "../elements/Spinner"; import { Click, Phase } from "./LoginWithQR-types"; import SdkConfig from "../../../SdkConfig"; -import { FailureReason, LoginWithQRFailureReason } from "./LoginWithQR"; +import { type FailureReason, LoginWithQRFailureReason } from "./LoginWithQR"; import { ErrorMessage } from "../../structures/ErrorMessage"; interface Props { diff --git a/src/components/views/auth/PassphraseConfirmField.tsx b/src/components/views/auth/PassphraseConfirmField.tsx index 0337c80359..bd20b59929 100644 --- a/src/components/views/auth/PassphraseConfirmField.tsx +++ b/src/components/views/auth/PassphraseConfirmField.tsx @@ -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 React, { ComponentProps, PureComponent, RefCallback, RefObject } from "react"; +import React, { type ComponentProps, PureComponent, type RefCallback, type RefObject } from "react"; -import Field, { IInputProps } from "../elements/Field"; -import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; +import Field, { type IInputProps } from "../elements/Field"; +import withValidation, { type IFieldState, type IValidationResult } from "../elements/Validation"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; interface IProps extends Omit { id?: string; diff --git a/src/components/views/auth/PassphraseField.tsx b/src/components/views/auth/PassphraseField.tsx index 8fc56cc68c..ce251d4d9b 100644 --- a/src/components/views/auth/PassphraseField.tsx +++ b/src/components/views/auth/PassphraseField.tsx @@ -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 React, { ComponentProps, PureComponent, RefCallback, RefObject } from "react"; +import React, { type ComponentProps, PureComponent, type RefCallback, type RefObject } from "react"; import classNames from "classnames"; import type { ZxcvbnResult } from "@zxcvbn-ts/core"; import SdkConfig from "../../../SdkConfig"; -import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; -import Field, { IInputProps } from "../elements/Field"; +import withValidation, { type IFieldState, type IValidationResult } from "../elements/Validation"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; +import Field, { type IInputProps } from "../elements/Field"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; interface IProps extends Omit { diff --git a/src/components/views/auth/PasswordLogin.tsx b/src/components/views/auth/PasswordLogin.tsx index e13af99f6f..d394f475a6 100644 --- a/src/components/views/auth/PasswordLogin.tsx +++ b/src/components/views/auth/PasswordLogin.tsx @@ -6,18 +6,18 @@ 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, { SyntheticEvent } from "react"; +import React, { type SyntheticEvent } from "react"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; -import { ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; -import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; +import { type ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; +import withValidation, { type IFieldState, type IValidationResult } from "../elements/Validation"; import Field from "../elements/Field"; import CountryDropdown from "./CountryDropdown"; import EmailField from "./EmailField"; -import { PhoneNumberCountryDefinition } from "../../../phonenumber"; +import { type PhoneNumberCountryDefinition } from "../../../phonenumber"; // For validating phone numbers without country codes const PHONE_NUMBER_REGEX = /^[0-9()\-\s]*$/; diff --git a/src/components/views/auth/RegistrationForm.tsx b/src/components/views/auth/RegistrationForm.tsx index ef2c83d3be..44dfa64ba5 100644 --- a/src/components/views/auth/RegistrationForm.tsx +++ b/src/components/views/auth/RegistrationForm.tsx @@ -7,18 +7,18 @@ 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, { BaseSyntheticEvent, ComponentProps, ReactNode } from "react"; -import { MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import React, { type BaseSyntheticEvent, type ComponentProps, type ReactNode } from "react"; +import { type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import * as Email from "../../../email"; -import { looksValid as phoneNumberLooksValid, PhoneNumberCountryDefinition } from "../../../phonenumber"; +import { looksValid as phoneNumberLooksValid, type PhoneNumberCountryDefinition } from "../../../phonenumber"; import Modal from "../../../Modal"; import { _t, _td } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; import { SAFE_LOCALPART_REGEX } from "../../../Registration"; -import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; -import { ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; +import withValidation, { type IFieldState, type IValidationResult } from "../elements/Validation"; +import { type ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; import EmailField from "./EmailField"; import PassphraseField from "./PassphraseField"; import Field from "../elements/Field"; diff --git a/src/components/views/auth/Welcome.tsx b/src/components/views/auth/Welcome.tsx index dc7eb4ad40..59fd1533e3 100644 --- a/src/components/views/auth/Welcome.tsx +++ b/src/components/views/auth/Welcome.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import SdkConfig from "../../../SdkConfig"; import AuthPage from "./AuthPage"; diff --git a/src/components/views/avatars/BaseAvatar.tsx b/src/components/views/avatars/BaseAvatar.tsx index 942650c65a..8aabf60149 100644 --- a/src/components/views/avatars/BaseAvatar.tsx +++ b/src/components/views/avatars/BaseAvatar.tsx @@ -9,13 +9,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, { AriaRole, forwardRef, useCallback, useContext, useEffect, useState } from "react"; +import React, { type AriaRole, forwardRef, useCallback, useContext, useEffect, useState } from "react"; import classNames from "classnames"; -import { ClientEvent, SyncState } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type SyncState } from "matrix-js-sdk/src/matrix"; import { Avatar } from "@vector-im/compound-web"; import SettingsStore from "../../../settings/SettingsStore"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { useTypedEventEmitter } from "../../../hooks/useEventEmitter"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/avatars/DecoratedRoomAvatar.tsx b/src/components/views/avatars/DecoratedRoomAvatar.tsx index 5a11e0f6b2..89b89af12e 100644 --- a/src/components/views/avatars/DecoratedRoomAvatar.tsx +++ b/src/components/views/avatars/DecoratedRoomAvatar.tsx @@ -8,19 +8,27 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; -import { EventType, JoinRule, MatrixEvent, Room, RoomEvent, User, UserEvent } from "matrix-js-sdk/src/matrix"; +import { + EventType, + JoinRule, + type MatrixEvent, + type Room, + RoomEvent, + type User, + UserEvent, +} from "matrix-js-sdk/src/matrix"; import { UnstableValue } from "matrix-js-sdk/src/NamespacedValue"; import { Tooltip } from "@vector-im/compound-web"; import RoomAvatar from "./RoomAvatar"; import NotificationBadge from "../rooms/NotificationBadge"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; -import { NotificationState } from "../../../stores/notifications/NotificationState"; +import { type NotificationState } from "../../../stores/notifications/NotificationState"; import { isPresenceEnabled } from "../../../utils/presence"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; import DMRoomMap from "../../../utils/DMRoomMap"; -import { IOOBData } from "../../../stores/ThreepidInviteStore"; +import { type IOOBData } from "../../../stores/ThreepidInviteStore"; import { getJoinedNonFunctionalMembers } from "../../../utils/room/getJoinedNonFunctionalMembers"; interface IProps { diff --git a/src/components/views/avatars/MemberAvatar.tsx b/src/components/views/avatars/MemberAvatar.tsx index 641fe4a783..a5bcc211e5 100644 --- a/src/components/views/avatars/MemberAvatar.tsx +++ b/src/components/views/avatars/MemberAvatar.tsx @@ -7,8 +7,8 @@ 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, { forwardRef, ReactNode, Ref, useContext } from "react"; -import { RoomMember, ResizeMethod } from "matrix-js-sdk/src/matrix"; +import React, { forwardRef, type ReactNode, type Ref, useContext } from "react"; +import { type RoomMember, type ResizeMethod } from "matrix-js-sdk/src/matrix"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; diff --git a/src/components/views/avatars/RoomAvatar.tsx b/src/components/views/avatars/RoomAvatar.tsx index e1d71ac1aa..9e75652dcc 100644 --- a/src/components/views/avatars/RoomAvatar.tsx +++ b/src/components/views/avatars/RoomAvatar.tsx @@ -6,8 +6,8 @@ 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, { ComponentProps } from "react"; -import { Room, RoomStateEvent, MatrixEvent, EventType, RoomType } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentProps } from "react"; +import { type Room, RoomStateEvent, type MatrixEvent, EventType, RoomType } from "matrix-js-sdk/src/matrix"; import BaseAvatar from "./BaseAvatar"; import ImageView from "../elements/ImageView"; @@ -16,7 +16,7 @@ import Modal from "../../../Modal"; import * as Avatar from "../../../Avatar"; import DMRoomMap from "../../../utils/DMRoomMap"; import { mediaFromMxc } from "../../../customisations/Media"; -import { IOOBData } from "../../../stores/ThreepidInviteStore"; +import { type IOOBData } from "../../../stores/ThreepidInviteStore"; import { LocalRoom } from "../../../models/LocalRoom"; import { filterBoolean } from "../../../utils/arrays"; diff --git a/src/components/views/avatars/SearchResultAvatar.tsx b/src/components/views/avatars/SearchResultAvatar.tsx index c50c4d81b2..c17dd21736 100644 --- a/src/components/views/avatars/SearchResultAvatar.tsx +++ b/src/components/views/avatars/SearchResultAvatar.tsx @@ -7,11 +7,11 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { RoomMember } from "matrix-js-sdk/src/matrix"; +import { type RoomMember } from "matrix-js-sdk/src/matrix"; import emailPillAvatar from "../../../../res/img/icon-email-pill-avatar.svg"; import { mediaFromMxc } from "../../../customisations/Media"; -import { Member, ThreepidMember } from "../../../utils/direct-messages"; +import { type Member, type ThreepidMember } from "../../../utils/direct-messages"; import BaseAvatar from "./BaseAvatar"; interface SearchResultAvatarProps { diff --git a/src/components/views/avatars/WidgetAvatar.tsx b/src/components/views/avatars/WidgetAvatar.tsx index f6d73e7d1c..c43cd98216 100644 --- a/src/components/views/avatars/WidgetAvatar.tsx +++ b/src/components/views/avatars/WidgetAvatar.tsx @@ -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 React, { ComponentProps } from "react"; -import { IWidget } from "matrix-widget-api"; +import React, { type ComponentProps } from "react"; +import { type IWidget } from "matrix-widget-api"; import classNames from "classnames"; -import { IApp, isAppWidget } from "../../../stores/WidgetStore"; -import BaseAvatar, { BaseAvatarType } from "./BaseAvatar"; +import { type IApp, isAppWidget } from "../../../stores/WidgetStore"; +import BaseAvatar, { type BaseAvatarType } from "./BaseAvatar"; import { mediaFromMxc } from "../../../customisations/Media"; interface IProps extends Omit, "name" | "url" | "urls"> { diff --git a/src/components/views/avatars/WithPresenceIndicator.tsx b/src/components/views/avatars/WithPresenceIndicator.tsx index 9d10f8dce6..4d60daf494 100644 --- a/src/components/views/avatars/WithPresenceIndicator.tsx +++ b/src/components/views/avatars/WithPresenceIndicator.tsx @@ -6,8 +6,8 @@ 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, { ReactNode, useEffect, useState } from "react"; -import { ClientEvent, Room, RoomMember, RoomStateEvent, UserEvent } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode, useEffect, useState } from "react"; +import { ClientEvent, type Room, type RoomMember, RoomStateEvent, UserEvent } from "matrix-js-sdk/src/matrix"; import { Tooltip } from "@vector-im/compound-web"; import { isPresenceEnabled } from "../../../utils/presence"; diff --git a/src/components/views/beacon/BeaconListItem.tsx b/src/components/views/beacon/BeaconListItem.tsx index 01a7f9364a..ceedbf05fd 100644 --- a/src/components/views/beacon/BeaconListItem.tsx +++ b/src/components/views/beacon/BeaconListItem.tsx @@ -6,8 +6,8 @@ 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, { HTMLProps, useContext } from "react"; -import { Beacon, BeaconEvent, LocationAssetType } from "matrix-js-sdk/src/matrix"; +import React, { type HTMLProps, useContext } from "react"; +import { type Beacon, BeaconEvent, LocationAssetType } from "matrix-js-sdk/src/matrix"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { useEventEmitterState } from "../../../hooks/useEventEmitter"; diff --git a/src/components/views/beacon/BeaconMarker.tsx b/src/components/views/beacon/BeaconMarker.tsx index 01d74e72b1..262901233b 100644 --- a/src/components/views/beacon/BeaconMarker.tsx +++ b/src/components/views/beacon/BeaconMarker.tsx @@ -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 React, { ReactNode, useContext } from "react"; -import * as maplibregl from "maplibre-gl"; -import { Beacon, BeaconEvent, LocationAssetType } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode, useContext } from "react"; +import { type Beacon, BeaconEvent, LocationAssetType } from "matrix-js-sdk/src/matrix"; +import type * as maplibregl from "maplibre-gl"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { useEventEmitterState } from "../../../hooks/useEventEmitter"; import { SmartMarker } from "../location"; diff --git a/src/components/views/beacon/BeaconStatus.tsx b/src/components/views/beacon/BeaconStatus.tsx index 1415dc229c..0ed7ceb4b0 100644 --- a/src/components/views/beacon/BeaconStatus.tsx +++ b/src/components/views/beacon/BeaconStatus.tsx @@ -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, { HTMLProps } from "react"; +import React, { type HTMLProps } from "react"; import classNames from "classnames"; -import { Beacon } from "matrix-js-sdk/src/matrix"; +import { type Beacon } from "matrix-js-sdk/src/matrix"; import StyledLiveBeaconIcon from "./StyledLiveBeaconIcon"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/beacon/BeaconStatusTooltip.tsx b/src/components/views/beacon/BeaconStatusTooltip.tsx index 1dc1b05e61..eb8a76f1c1 100644 --- a/src/components/views/beacon/BeaconStatusTooltip.tsx +++ b/src/components/views/beacon/BeaconStatusTooltip.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext } from "react"; -import { Beacon, LocationAssetType } from "matrix-js-sdk/src/matrix"; +import { type Beacon, LocationAssetType } from "matrix-js-sdk/src/matrix"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import BeaconStatus from "./BeaconStatus"; diff --git a/src/components/views/beacon/BeaconViewDialog.tsx b/src/components/views/beacon/BeaconViewDialog.tsx index 27f9f2e520..d779ebbf2e 100644 --- a/src/components/views/beacon/BeaconViewDialog.tsx +++ b/src/components/views/beacon/BeaconViewDialog.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React, { useState, useEffect } from "react"; -import { MatrixClient, Beacon, Room } from "matrix-js-sdk/src/matrix"; -import * as maplibregl from "maplibre-gl"; +import { type MatrixClient, type Beacon, type Room } from "matrix-js-sdk/src/matrix"; +import type * as maplibregl from "maplibre-gl"; import { Icon as LiveLocationIcon } from "../../../../res/img/location/live-location.svg"; import { useLiveBeacons } from "../../../utils/beacon/useLiveBeacons"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; @@ -17,7 +17,7 @@ import BaseDialog from "../dialogs/BaseDialog"; import Map from "../location/Map"; import ZoomButtons from "../location/ZoomButtons"; import BeaconMarker from "./BeaconMarker"; -import { Bounds, getBeaconBounds } from "../../../utils/beacon/bounds"; +import { type Bounds, getBeaconBounds } from "../../../utils/beacon/bounds"; import { getGeoUri } from "../../../utils/beacon"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; @@ -26,7 +26,7 @@ import DialogOwnBeaconStatus from "./DialogOwnBeaconStatus"; import BeaconStatusTooltip from "./BeaconStatusTooltip"; import MapFallback from "../location/MapFallback"; import { MapError } from "../location/MapError"; -import { LocationShareError } from "../../../utils/location"; +import { type LocationShareError } from "../../../utils/location"; export interface IProps { roomId: Room["roomId"]; diff --git a/src/components/views/beacon/DialogOwnBeaconStatus.tsx b/src/components/views/beacon/DialogOwnBeaconStatus.tsx index e6b35d9247..fff6b0db4b 100644 --- a/src/components/views/beacon/DialogOwnBeaconStatus.tsx +++ b/src/components/views/beacon/DialogOwnBeaconStatus.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext } from "react"; -import { Room, Beacon, LocationAssetType } from "matrix-js-sdk/src/matrix"; +import { type Room, type Beacon, LocationAssetType } from "matrix-js-sdk/src/matrix"; import { OwnBeaconStore, OwnBeaconStoreEvent } from "../../../stores/OwnBeaconStore"; import { useEventEmitterState } from "../../../hooks/useEventEmitter"; diff --git a/src/components/views/beacon/DialogSidebar.tsx b/src/components/views/beacon/DialogSidebar.tsx index 9fcca26dde..ee86e6bcf0 100644 --- a/src/components/views/beacon/DialogSidebar.tsx +++ b/src/components/views/beacon/DialogSidebar.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Beacon } from "matrix-js-sdk/src/matrix"; +import { type Beacon } from "matrix-js-sdk/src/matrix"; import CloseIcon from "@vector-im/compound-design-tokens/assets/web/icons/close"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/beacon/LeftPanelLiveShareWarning.tsx b/src/components/views/beacon/LeftPanelLiveShareWarning.tsx index 0c3f26f91e..d5338cf28f 100644 --- a/src/components/views/beacon/LeftPanelLiveShareWarning.tsx +++ b/src/components/views/beacon/LeftPanelLiveShareWarning.tsx @@ -8,16 +8,16 @@ Please see LICENSE files in the repository root for full details. import classNames from "classnames"; import React, { useEffect } from "react"; -import { Beacon, BeaconIdentifier } from "matrix-js-sdk/src/matrix"; +import { type Beacon, type BeaconIdentifier } from "matrix-js-sdk/src/matrix"; import { useEventEmitterState } from "../../../hooks/useEventEmitter"; import { _t } from "../../../languageHandler"; import { OwnBeaconStore, OwnBeaconStoreEvent } from "../../../stores/OwnBeaconStore"; import { Icon as LiveLocationIcon } from "../../../../res/img/location/live-location.svg"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../../../dispatcher/actions"; import dispatcher from "../../../dispatcher/dispatcher"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; interface Props { isMinimized?: boolean; diff --git a/src/components/views/beacon/LiveTimeRemaining.tsx b/src/components/views/beacon/LiveTimeRemaining.tsx index c0730938ee..d4d7ca262e 100644 --- a/src/components/views/beacon/LiveTimeRemaining.tsx +++ b/src/components/views/beacon/LiveTimeRemaining.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useCallback, useEffect, useState } from "react"; -import { BeaconEvent, Beacon } from "matrix-js-sdk/src/matrix"; +import { BeaconEvent, type Beacon } from "matrix-js-sdk/src/matrix"; import { formatDuration } from "../../../DateUtils"; import { useEventEmitterState } from "../../../hooks/useEventEmitter"; diff --git a/src/components/views/beacon/OwnBeaconStatus.tsx b/src/components/views/beacon/OwnBeaconStatus.tsx index 7d0f277786..8ece201cbe 100644 --- a/src/components/views/beacon/OwnBeaconStatus.tsx +++ b/src/components/views/beacon/OwnBeaconStatus.tsx @@ -6,15 +6,15 @@ 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 { Beacon } from "matrix-js-sdk/src/matrix"; -import React, { HTMLProps } from "react"; +import { type Beacon } from "matrix-js-sdk/src/matrix"; +import React, { type HTMLProps } from "react"; import { _t } from "../../../languageHandler"; import { useOwnLiveBeacons } from "../../../utils/beacon"; import { preventDefaultWrapper } from "../../../utils/NativeEventUtils"; import BeaconStatus from "./BeaconStatus"; import { BeaconDisplayStatus } from "./displayStatus"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; interface Props { displayStatus: BeaconDisplayStatus; diff --git a/src/components/views/beacon/RoomCallBanner.tsx b/src/components/views/beacon/RoomCallBanner.tsx index a9f25e7e6c..e4f0dfa608 100644 --- a/src/components/views/beacon/RoomCallBanner.tsx +++ b/src/components/views/beacon/RoomCallBanner.tsx @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import React, { useCallback } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import defaultDispatcher from "../../../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../../../dispatcher/actions"; -import { ConnectionState, ElementCall } from "../../../models/Call"; +import { ConnectionState, type ElementCall } from "../../../models/Call"; import { useCall } from "../../../hooks/useCall"; import { useEventEmitterState } from "../../../hooks/useEventEmitter"; import { OwnBeaconStore, OwnBeaconStoreEvent } from "../../../stores/OwnBeaconStore"; diff --git a/src/components/views/beacon/ShareLatestLocation.tsx b/src/components/views/beacon/ShareLatestLocation.tsx index 5300a81900..b18cdff839 100644 --- a/src/components/views/beacon/ShareLatestLocation.tsx +++ b/src/components/views/beacon/ShareLatestLocation.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useEffect, useState } from "react"; -import { ContentHelpers } from "matrix-js-sdk/src/matrix"; +import { type ContentHelpers } from "matrix-js-sdk/src/matrix"; import { Tooltip } from "@vector-im/compound-web"; import { Icon as ExternalLinkIcon } from "../../../../res/img/external-link.svg"; diff --git a/src/components/views/beacon/displayStatus.ts b/src/components/views/beacon/displayStatus.ts index e11b0018ba..15320c2fa5 100644 --- a/src/components/views/beacon/displayStatus.ts +++ b/src/components/views/beacon/displayStatus.ts @@ -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 { ContentHelpers } from "matrix-js-sdk/src/matrix"; +import { type ContentHelpers } from "matrix-js-sdk/src/matrix"; export enum BeaconDisplayStatus { Loading = "Loading", diff --git a/src/components/views/beacon/index.tsx b/src/components/views/beacon/index.tsx index 871e7cb07e..7cbb6328bf 100644 --- a/src/components/views/beacon/index.tsx +++ b/src/components/views/beacon/index.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. // Exports beacon components which touch maplibre-gs wrapped in React Suspense to enable code splitting -import React, { ComponentProps, lazy, Suspense } from "react"; +import React, { type ComponentProps, lazy, Suspense } from "react"; import Spinner from "../elements/Spinner"; diff --git a/src/components/views/beta/BetaCard.tsx b/src/components/views/beta/BetaCard.tsx index 93d69dffce..4421a9e50b 100644 --- a/src/components/views/beta/BetaCard.tsx +++ b/src/components/views/beta/BetaCard.tsx @@ -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 React, { ReactNode, useState } from "react"; +import React, { type ReactNode, useState } from "react"; import { sleep } from "matrix-js-sdk/src/utils"; import { _t } from "../../../languageHandler"; @@ -20,7 +20,7 @@ import SettingsFlag from "../elements/SettingsFlag"; import { useFeatureEnabled } from "../../../hooks/useSettings"; import InlineSpinner from "../elements/InlineSpinner"; import { shouldShowFeedback } from "../../../utils/Feedback"; -import { FeatureSettingKey } from "../../../settings/Settings.tsx"; +import { type FeatureSettingKey } from "../../../settings/Settings.tsx"; // XXX: Keep this around for re-use in future Betas diff --git a/src/components/views/context_menus/DeviceContextMenu.tsx b/src/components/views/context_menus/DeviceContextMenu.tsx index 5d71049fb4..b6646c05ec 100644 --- a/src/components/views/context_menus/DeviceContextMenu.tsx +++ b/src/components/views/context_menus/DeviceContextMenu.tsx @@ -10,8 +10,8 @@ import React, { useEffect, useState } from "react"; import MediaDeviceHandler, { MediaDeviceKindEnum } from "../../../MediaDeviceHandler"; import IconizedContextMenu, { IconizedContextMenuOptionList, IconizedContextMenuRadio } from "./IconizedContextMenu"; -import { IProps as IContextMenuProps } from "../../structures/ContextMenu"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; +import { type IProps as IContextMenuProps } from "../../structures/ContextMenu"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; const SECTION_NAMES: Record = { [MediaDeviceKindEnum.AudioInput]: _td("voip|input_devices"), diff --git a/src/components/views/context_menus/DialpadContextMenu.tsx b/src/components/views/context_menus/DialpadContextMenu.tsx index c4d0d73786..12fc19781c 100644 --- a/src/components/views/context_menus/DialpadContextMenu.tsx +++ b/src/components/views/context_menus/DialpadContextMenu.tsx @@ -8,10 +8,10 @@ Please see LICENSE files in the repository root for full details. import * as React from "react"; import { createRef } from "react"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; -import ContextMenu, { IProps as IContextMenuProps } from "../../structures/ContextMenu"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; +import ContextMenu, { type IProps as IContextMenuProps } from "../../structures/ContextMenu"; import Field from "../elements/Field"; import DialPad from "../voip/DialPad"; diff --git a/src/components/views/context_menus/IconizedContextMenu.tsx b/src/components/views/context_menus/IconizedContextMenu.tsx index 17a3805513..4d74ed24b1 100644 --- a/src/components/views/context_menus/IconizedContextMenu.tsx +++ b/src/components/views/context_menus/IconizedContextMenu.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import classNames from "classnames"; import ContextMenu, { ChevronFace, - IProps as IContextMenuProps, + type IProps as IContextMenuProps, MenuItem, MenuItemCheckbox, MenuItemRadio, diff --git a/src/components/views/context_menus/KebabContextMenu.tsx b/src/components/views/context_menus/KebabContextMenu.tsx index e65f0389ff..f6fc9972a0 100644 --- a/src/components/views/context_menus/KebabContextMenu.tsx +++ b/src/components/views/context_menus/KebabContextMenu.tsx @@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import ContextMenuIcon from "@vector-im/compound-design-tokens/assets/web/icons/overflow-horizontal"; -import { ChevronFace, ContextMenuButton, MenuProps, useContextMenu } from "../../structures/ContextMenu"; -import { ButtonProps } from "../elements/AccessibleButton"; +import { ChevronFace, ContextMenuButton, type MenuProps, useContextMenu } from "../../structures/ContextMenu"; +import { type ButtonProps } from "../elements/AccessibleButton"; import IconizedContextMenu, { IconizedContextMenuOptionList } from "./IconizedContextMenu"; const contextMenuBelow = (elementRect: DOMRect): MenuProps => { diff --git a/src/components/views/context_menus/LegacyCallContextMenu.tsx b/src/components/views/context_menus/LegacyCallContextMenu.tsx index bc3deab7a1..3427ed183b 100644 --- a/src/components/views/context_menus/LegacyCallContextMenu.tsx +++ b/src/components/views/context_menus/LegacyCallContextMenu.tsx @@ -6,10 +6,10 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { _t } from "../../../languageHandler"; -import ContextMenu, { IProps as IContextMenuProps, MenuItem } from "../../structures/ContextMenu"; +import ContextMenu, { type IProps as IContextMenuProps, MenuItem } from "../../structures/ContextMenu"; import LegacyCallHandler from "../../../LegacyCallHandler"; interface IProps extends IContextMenuProps { diff --git a/src/components/views/context_menus/MessageContextMenu.tsx b/src/components/views/context_menus/MessageContextMenu.tsx index 0af3604fca..9997fad35b 100644 --- a/src/components/views/context_menus/MessageContextMenu.tsx +++ b/src/components/views/context_menus/MessageContextMenu.tsx @@ -11,12 +11,12 @@ Please see LICENSE files in the repository root for full details. import React, { createRef, useContext } from "react"; import { EventStatus, - MatrixEvent, + type MatrixEvent, MatrixEventEvent, RoomMemberEvent, EventType, RelationType, - Relations, + type Relations, Thread, M_POLL_START, } from "matrix-js-sdk/src/matrix"; @@ -31,10 +31,10 @@ import { isUrlPermitted } from "../../../HtmlUtils"; import { canEditContent, editEvent, isContentActionable } from "../../../utils/EventUtils"; import IconizedContextMenu, { IconizedContextMenuOption, IconizedContextMenuOptionList } from "./IconizedContextMenu"; import { Action } from "../../../dispatcher/actions"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import { copyPlaintext, getSelectedText } from "../../../utils/strings"; -import ContextMenu, { toRightOf, MenuProps } from "../../structures/ContextMenu"; +import ContextMenu, { toRightOf, type MenuProps } from "../../structures/ContextMenu"; import ReactionPicker from "../emojipicker/ReactionPicker"; import ViewSource from "../../structures/ViewSource"; import { createRedactEventDialog } from "../dialogs/ConfirmRedactDialog"; @@ -42,14 +42,14 @@ import { ShareDialog } from "../dialogs/ShareDialog"; import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; import EndPollDialog from "../dialogs/EndPollDialog"; import { isPollEnded } from "../messages/MPollBody"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; -import { GetRelationsForEvent, IEventTileOps } from "../rooms/EventTile"; -import { OpenForwardDialogPayload } from "../../../dispatcher/payloads/OpenForwardDialogPayload"; -import { OpenReportEventDialogPayload } from "../../../dispatcher/payloads/OpenReportEventDialogPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type GetRelationsForEvent, type IEventTileOps } from "../rooms/EventTile"; +import { type OpenForwardDialogPayload } from "../../../dispatcher/payloads/OpenForwardDialogPayload"; +import { type OpenReportEventDialogPayload } from "../../../dispatcher/payloads/OpenReportEventDialogPayload"; import { createMapSiteLinkFromEvent } from "../../../utils/location"; import { getForwardableEvent } from "../../../events/forward/getForwardableEvent"; import { getShareableLocationEvent } from "../../../events/location/getShareableLocationEvent"; -import { ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; +import { type ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; import { CardContext } from "../right_panel/context"; import PinningUtils from "../../../utils/PinningUtils"; import PosthogTrackers from "../../../PosthogTrackers.ts"; diff --git a/src/components/views/context_menus/RoomGeneralContextMenu.tsx b/src/components/views/context_menus/RoomGeneralContextMenu.tsx index c54aa1e465..e6ba9cfc11 100644 --- a/src/components/views/context_menus/RoomGeneralContextMenu.tsx +++ b/src/components/views/context_menus/RoomGeneralContextMenu.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import React, { useContext } from "react"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; @@ -19,17 +19,17 @@ import { useUnreadNotifications } from "../../../hooks/useUnreadNotifications"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { _t } from "../../../languageHandler"; import { NotificationLevel } from "../../../stores/notifications/NotificationLevel"; -import { DefaultTagID, TagID } from "../../../stores/room-list/models"; +import { DefaultTagID, type TagID } from "../../../stores/room-list/models"; import RoomListStore, { LISTS_UPDATE_EVENT } from "../../../stores/room-list/RoomListStore"; import DMRoomMap from "../../../utils/DMRoomMap"; import { clearRoomNotification, setMarkedUnreadState } from "../../../utils/notifications"; -import { IProps as IContextMenuProps } from "../../structures/ContextMenu"; +import { type IProps as IContextMenuProps } from "../../structures/ContextMenu"; import IconizedContextMenu, { IconizedContextMenuCheckbox, IconizedContextMenuOption, IconizedContextMenuOptionList, } from "../context_menus/IconizedContextMenu"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; import { DeveloperToolsOption } from "./DeveloperToolsOption"; diff --git a/src/components/views/context_menus/RoomNotificationContextMenu.tsx b/src/components/views/context_menus/RoomNotificationContextMenu.tsx index ea63880762..14e38f9e09 100644 --- a/src/components/views/context_menus/RoomNotificationContextMenu.tsx +++ b/src/components/views/context_menus/RoomNotificationContextMenu.tsx @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import React from "react"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; @@ -14,12 +14,12 @@ import { useNotificationState } from "../../../hooks/useRoomNotificationState"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { _t } from "../../../languageHandler"; import { RoomNotifState } from "../../../RoomNotifs"; -import { IProps as IContextMenuProps } from "../../structures/ContextMenu"; +import { type IProps as IContextMenuProps } from "../../structures/ContextMenu"; import IconizedContextMenu, { IconizedContextMenuOptionList, IconizedContextMenuRadio, } from "../context_menus/IconizedContextMenu"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; interface IProps extends IContextMenuProps { room: Room; diff --git a/src/components/views/context_menus/SpaceContextMenu.tsx b/src/components/views/context_menus/SpaceContextMenu.tsx index 11a1364d6d..17018da57c 100644 --- a/src/components/views/context_menus/SpaceContextMenu.tsx +++ b/src/components/views/context_menus/SpaceContextMenu.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext } from "react"; -import { Room, EventType, RoomType } from "matrix-js-sdk/src/matrix"; +import { type Room, EventType, RoomType } from "matrix-js-sdk/src/matrix"; -import { IProps as IContextMenuProps } from "../../structures/ContextMenu"; +import { type IProps as IContextMenuProps } from "../../structures/ContextMenu"; import IconizedContextMenu, { IconizedContextMenuOption, IconizedContextMenuOptionList } from "./IconizedContextMenu"; import { _t } from "../../../languageHandler"; import { @@ -22,7 +22,7 @@ import { } from "../../../utils/space"; import { leaveSpace } from "../../../utils/leave-behaviour"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import defaultDispatcher from "../../../dispatcher/dispatcher"; import { BetaPill } from "../beta/BetaCard"; import SettingsStore from "../../../settings/SettingsStore"; @@ -31,7 +31,7 @@ import { Action } from "../../../dispatcher/actions"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; import PosthogTrackers from "../../../PosthogTrackers"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; interface IProps extends IContextMenuProps { space?: Room; diff --git a/src/components/views/context_menus/ThreadListContextMenu.tsx b/src/components/views/context_menus/ThreadListContextMenu.tsx index eea9815954..ef32d62282 100644 --- a/src/components/views/context_menus/ThreadListContextMenu.tsx +++ b/src/components/views/context_menus/ThreadListContextMenu.tsx @@ -7,19 +7,19 @@ Please see LICENSE files in the repository root for full details. */ import React, { useCallback, useEffect } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { copyPlaintext } from "../../../utils/strings"; -import { ChevronFace, ContextMenuTooltipButton, MenuProps, useContextMenu } from "../../structures/ContextMenu"; +import { ChevronFace, ContextMenuTooltipButton, type MenuProps, useContextMenu } from "../../structures/ContextMenu"; import { _t } from "../../../languageHandler"; import IconizedContextMenu, { IconizedContextMenuOption, IconizedContextMenuOptionList } from "./IconizedContextMenu"; import { WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; export interface ThreadListContextMenuProps { mxEvent: MatrixEvent; diff --git a/src/components/views/context_menus/WidgetContextMenu.tsx b/src/components/views/context_menus/WidgetContextMenu.tsx index 894e8f8c7d..2b13f636a6 100644 --- a/src/components/views/context_menus/WidgetContextMenu.tsx +++ b/src/components/views/context_menus/WidgetContextMenu.tsx @@ -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 React, { ComponentProps, useContext } from "react"; -import { ClientWidgetApi, IWidget, MatrixCapabilities } from "matrix-widget-api"; +import React, { type ComponentProps, useContext } from "react"; +import { type ClientWidgetApi, type IWidget, MatrixCapabilities } from "matrix-widget-api"; import { logger } from "matrix-js-sdk/src/logger"; -import { ApprovalOpts, WidgetLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WidgetLifecycle"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type ApprovalOpts, WidgetLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WidgetLifecycle"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import IconizedContextMenu, { IconizedContextMenuOption, IconizedContextMenuOptionList } from "./IconizedContextMenu"; import { ChevronFace } from "../../structures/ContextMenu"; diff --git a/src/components/views/dialogs/AddExistingSubspaceDialog.tsx b/src/components/views/dialogs/AddExistingSubspaceDialog.tsx index d7311244b7..09a828194a 100644 --- a/src/components/views/dialogs/AddExistingSubspaceDialog.tsx +++ b/src/components/views/dialogs/AddExistingSubspaceDialog.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useState } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx index 3cc62f4155..2397c5f81e 100644 --- a/src/components/views/dialogs/AddExistingToSpaceDialog.tsx +++ b/src/components/views/dialogs/AddExistingToSpaceDialog.tsx @@ -6,22 +6,22 @@ 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, ReactNode, useContext, useMemo, useRef, useState } from "react"; +import React, { type ReactElement, type ReactNode, useContext, useMemo, useRef, useState } from "react"; import classNames from "classnames"; -import { Room, EventType } from "matrix-js-sdk/src/matrix"; +import { type Room, EventType } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { sleep } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; import { ErrorIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; import BaseDialog from "./BaseDialog"; import Dropdown from "../elements/Dropdown"; import SearchBox from "../../structures/SearchBox"; import SpaceStore from "../../../stores/spaces/SpaceStore"; import RoomAvatar from "../avatars/RoomAvatar"; import { getDisplayAliasForRoom } from "../../../Rooms"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; import DMRoomMap from "../../../utils/DMRoomMap"; import { calculateRoomVia } from "../../../utils/permalinks/Permalinks"; @@ -34,7 +34,7 @@ import QueryMatcher from "../../../autocomplete/QueryMatcher"; import LazyRenderList from "../elements/LazyRenderList"; import { useSettingValue } from "../../../hooks/useSettings"; import { filterBoolean } from "../../../utils/arrays"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; // These values match CSS const ROW_HEIGHT = 32 + 12; diff --git a/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx b/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx index 5396d1e9a7..90681556e8 100644 --- a/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx +++ b/src/components/views/dialogs/AnalyticsLearnMoreDialog.tsx @@ -11,7 +11,7 @@ import React from "react"; import BaseDialog from "./BaseDialog"; import { _t } from "../../../languageHandler"; import DialogButtons from "../elements/DialogButtons"; -import Modal, { ComponentProps } from "../../../Modal"; +import Modal, { type ComponentProps } from "../../../Modal"; import SdkConfig from "../../../SdkConfig"; import { getPolicyUrl } from "../../../toasts/AnalyticsToast"; import ExternalLink from "../elements/ExternalLink"; diff --git a/src/components/views/dialogs/BaseDialog.tsx b/src/components/views/dialogs/BaseDialog.tsx index 39afb2e621..0638e7e8ab 100644 --- a/src/components/views/dialogs/BaseDialog.tsx +++ b/src/components/views/dialogs/BaseDialog.tsx @@ -11,14 +11,14 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import FocusLock from "react-focus-lock"; import classNames from "classnames"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import AccessibleButton from "../elements/AccessibleButton"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import Heading from "../typography/Heading"; -import { PosthogScreenTracker, ScreenName } from "../../../PosthogTrackers"; +import { PosthogScreenTracker, type ScreenName } from "../../../PosthogTrackers"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; diff --git a/src/components/views/dialogs/BetaFeedbackDialog.tsx b/src/components/views/dialogs/BetaFeedbackDialog.tsx index 2c13ae0006..081f8beaca 100644 --- a/src/components/views/dialogs/BetaFeedbackDialog.tsx +++ b/src/components/views/dialogs/BetaFeedbackDialog.tsx @@ -15,7 +15,7 @@ import defaultDispatcher from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; import { UserTab } from "./UserTab"; import GenericFeatureFeedbackDialog from "./GenericFeatureFeedbackDialog"; -import { SettingKey } from "../../../settings/Settings.tsx"; +import { type SettingKey } from "../../../settings/Settings.tsx"; // XXX: Keep this around for re-use in future Betas diff --git a/src/components/views/dialogs/BulkRedactDialog.tsx b/src/components/views/dialogs/BulkRedactDialog.tsx index d766c6c973..ace7f82861 100644 --- a/src/components/views/dialogs/BulkRedactDialog.tsx +++ b/src/components/views/dialogs/BulkRedactDialog.tsx @@ -8,7 +8,14 @@ Please see LICENSE files in the repository root for full details. import React, { useState } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient, RoomMember, Room, MatrixEvent, EventTimeline, EventType } from "matrix-js-sdk/src/matrix"; +import { + type MatrixClient, + type RoomMember, + type Room, + type MatrixEvent, + EventTimeline, + EventType, +} from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; diff --git a/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx b/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx index 2d7500e72c..8fc7f6a256 100644 --- a/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx +++ b/src/components/views/dialogs/ConfirmAndWaitRedactDialog.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, HTTPError, MatrixError } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, HTTPError, MatrixError } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import ConfirmRedactDialog from "./ConfirmRedactDialog"; diff --git a/src/components/views/dialogs/ConfirmRedactDialog.tsx b/src/components/views/dialogs/ConfirmRedactDialog.tsx index 7733d83585..d3fba9b475 100644 --- a/src/components/views/dialogs/ConfirmRedactDialog.tsx +++ b/src/components/views/dialogs/ConfirmRedactDialog.tsx @@ -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 { IRedactOpts, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type IRedactOpts, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import React from "react"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx b/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx index 9c21b469e4..403cb938b7 100644 --- a/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx +++ b/src/components/views/dialogs/ConfirmSpaceUserActionDialog.tsx @@ -6,8 +6,8 @@ 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, { ComponentProps, useMemo, useState } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentProps, useMemo, useState } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import ConfirmUserActionDialog from "./ConfirmUserActionDialog"; import SpaceStore from "../../../stores/spaces/SpaceStore"; diff --git a/src/components/views/dialogs/ConfirmUserActionDialog.tsx b/src/components/views/dialogs/ConfirmUserActionDialog.tsx index f79601f855..3fc7b25aec 100644 --- a/src/components/views/dialogs/ConfirmUserActionDialog.tsx +++ b/src/components/views/dialogs/ConfirmUserActionDialog.tsx @@ -6,8 +6,8 @@ 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, { ChangeEvent, FormEvent, ReactNode } from "react"; -import { RoomMember } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent, type FormEvent, type ReactNode } from "react"; +import { type RoomMember } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/CreateRoomDialog.tsx b/src/components/views/dialogs/CreateRoomDialog.tsx index d77ec14578..5ba2e2e771 100644 --- a/src/components/views/dialogs/CreateRoomDialog.tsx +++ b/src/components/views/dialogs/CreateRoomDialog.tsx @@ -7,14 +7,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 React, { ChangeEvent, createRef, KeyboardEvent, SyntheticEvent } from "react"; -import { Room, RoomType, JoinRule, Preset, Visibility } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent, createRef, type KeyboardEvent, type SyntheticEvent } from "react"; +import { type Room, RoomType, JoinRule, Preset, Visibility } from "matrix-js-sdk/src/matrix"; import SdkConfig from "../../../SdkConfig"; -import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; +import withValidation, { type IFieldState, type IValidationResult } from "../elements/Validation"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import { checkUserIsAllowedToChangeEncryption, IOpts } from "../../../createRoom"; +import { checkUserIsAllowedToChangeEncryption, type IOpts } from "../../../createRoom"; import Field from "../elements/Field"; import RoomAliasField from "../elements/RoomAliasField"; import LabelledToggleSwitch from "../elements/LabelledToggleSwitch"; diff --git a/src/components/views/dialogs/CreateSubspaceDialog.tsx b/src/components/views/dialogs/CreateSubspaceDialog.tsx index 6af128ef64..6c1aeac399 100644 --- a/src/components/views/dialogs/CreateSubspaceDialog.tsx +++ b/src/components/views/dialogs/CreateSubspaceDialog.tsx @@ -7,16 +7,16 @@ Please see LICENSE files in the repository root for full details. */ import React, { useRef, useState } from "react"; -import { Room, JoinRule } from "matrix-js-sdk/src/matrix"; +import { type Room, JoinRule } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import BaseDialog from "./BaseDialog"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { BetaPill } from "../beta/BetaCard"; -import Field from "../elements/Field"; -import RoomAliasField from "../elements/RoomAliasField"; +import type Field from "../elements/Field"; +import type RoomAliasField from "../elements/RoomAliasField"; import { createSpace, SpaceCreateForm } from "../spaces/SpaceCreateMenu"; import { SubspaceSelector } from "./AddExistingToSpaceDialog"; import JoinRuleDropdown from "../elements/JoinRuleDropdown"; diff --git a/src/components/views/dialogs/DeactivateAccountDialog.tsx b/src/components/views/dialogs/DeactivateAccountDialog.tsx index 52140b2967..260f383e15 100644 --- a/src/components/views/dialogs/DeactivateAccountDialog.tsx +++ b/src/components/views/dialogs/DeactivateAccountDialog.tsx @@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { AuthType, IAuthData } from "matrix-js-sdk/src/interactive-auth"; +import { type AuthType, type IAuthData } from "matrix-js-sdk/src/interactive-auth"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; -import InteractiveAuth, { ERROR_USER_CANCELLED, InteractiveAuthCallback } from "../../structures/InteractiveAuth"; -import { ContinueKind, SSOAuthEntry } from "../auth/InteractiveAuthEntryComponents"; +import InteractiveAuth, { ERROR_USER_CANCELLED, type InteractiveAuthCallback } from "../../structures/InteractiveAuth"; +import { type ContinueKind, SSOAuthEntry } from "../auth/InteractiveAuthEntryComponents"; import StyledCheckbox from "../elements/StyledCheckbox"; import BaseDialog from "./BaseDialog"; import defaultDispatcher from "../../../dispatcher/dispatcher"; diff --git a/src/components/views/dialogs/DevtoolsDialog.tsx b/src/components/views/dialogs/DevtoolsDialog.tsx index 440e37393f..d5755ec61e 100644 --- a/src/components/views/dialogs/DevtoolsDialog.tsx +++ b/src/components/views/dialogs/DevtoolsDialog.tsx @@ -9,14 +9,14 @@ Please see LICENSE files in the repository root for full details. import React, { useState } from "react"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import BaseDialog from "./BaseDialog"; import { TimelineEventEditor } from "./devtools/Event"; import ServersInRoom from "./devtools/ServersInRoom"; import SettingExplorer from "./devtools/SettingExplorer"; import { RoomStateExplorer } from "./devtools/RoomState"; -import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./devtools/BaseTool"; +import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./devtools/BaseTool"; import WidgetExplorer from "./devtools/WidgetExplorer"; import { AccountDataExplorer, RoomAccountDataExplorer } from "./devtools/AccountData"; import SettingsFlag from "../elements/SettingsFlag"; diff --git a/src/components/views/dialogs/EndPollDialog.tsx b/src/components/views/dialogs/EndPollDialog.tsx index 03d9c7f7f5..bb654fe607 100644 --- a/src/components/views/dialogs/EndPollDialog.tsx +++ b/src/components/views/dialogs/EndPollDialog.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, MatrixClient, TimelineEvents } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type MatrixClient, type TimelineEvents } from "matrix-js-sdk/src/matrix"; import { PollEndEvent } from "matrix-js-sdk/src/extensible_events_v1/PollEndEvent"; import { _t } from "../../../languageHandler"; @@ -15,7 +15,7 @@ import QuestionDialog from "./QuestionDialog"; import { findTopAnswer } from "../messages/MPollBody"; import Modal from "../../../Modal"; import ErrorDialog from "./ErrorDialog"; -import { GetRelationsForEvent } from "../rooms/EventTile"; +import { type GetRelationsForEvent } from "../rooms/EventTile"; interface IProps { matrixClient: MatrixClient; diff --git a/src/components/views/dialogs/ExportDialog.tsx b/src/components/views/dialogs/ExportDialog.tsx index bd7ad24bca..cfb6cca886 100644 --- a/src/components/views/dialogs/ExportDialog.tsx +++ b/src/components/views/dialogs/ExportDialog.tsx @@ -6,8 +6,8 @@ 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, { useRef, useState, Dispatch, SetStateAction } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { useRef, useState, type Dispatch, type SetStateAction } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; @@ -18,18 +18,18 @@ import StyledRadioGroup from "../elements/StyledRadioGroup"; import StyledCheckbox from "../elements/StyledCheckbox"; import { ExportFormat, - ExportFormatKey, + type ExportFormatKey, ExportType, - ExportTypeKey, + type ExportTypeKey, textForFormat, textForType, } from "../../../utils/exportUtils/exportUtils"; -import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; +import withValidation, { type IFieldState, type IValidationResult } from "../elements/Validation"; import HTMLExporter from "../../../utils/exportUtils/HtmlExport"; import JSONExporter from "../../../utils/exportUtils/JSONExport"; import PlainTextExporter from "../../../utils/exportUtils/PlainTextExport"; import { useStateCallback } from "../../../hooks/useStateCallback"; -import Exporter from "../../../utils/exportUtils/Exporter"; +import type Exporter from "../../../utils/exportUtils/Exporter"; import Spinner from "../elements/Spinner"; import InfoDialog from "./InfoDialog"; import ChatExport from "../../../customisations/ChatExport"; diff --git a/src/components/views/dialogs/ForwardDialog.tsx b/src/components/views/dialogs/ForwardDialog.tsx index a831acc5d1..d18b1bac01 100644 --- a/src/components/views/dialogs/ForwardDialog.tsx +++ b/src/components/views/dialogs/ForwardDialog.tsx @@ -9,18 +9,18 @@ Please see LICENSE files in the repository root for full details. import React, { useEffect, useMemo, useState } from "react"; import classnames from "classnames"; import { - IContent, + type IContent, MatrixEvent, - Room, - RoomMember, + type Room, + type RoomMember, EventType, - MatrixClient, + type MatrixClient, ContentHelpers, - ILocationContent, + type ILocationContent, LocationAssetType, M_TIMESTAMP, M_BEACON, - TimelineEvents, + type TimelineEvents, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; @@ -36,19 +36,19 @@ import DecoratedRoomAvatar from "../avatars/DecoratedRoomAvatar"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; import { StaticNotificationState } from "../../../stores/notifications/StaticNotificationState"; import NotificationBadge from "../rooms/NotificationBadge"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { sortRooms } from "../../../stores/room-list/algorithms/tag-sorting/RecentAlgorithm"; import QueryMatcher from "../../../autocomplete/QueryMatcher"; import TruncatedList from "../elements/TruncatedList"; import { Action } from "../../../dispatcher/actions"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import { isLocationEvent } from "../../../utils/EventUtils"; import { isSelfLocation, locationEventGeoUri } from "../../../utils/location"; import { RoomContextDetails } from "../rooms/RoomContextDetails"; import { filterBoolean } from "../../../utils/arrays"; import { - IState, + type IState, RovingTabIndexContext, RovingTabIndexProvider, Type, diff --git a/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx b/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx index 1ea187361e..cbfdb3c8b3 100644 --- a/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx +++ b/src/components/views/dialogs/GenericFeatureFeedbackDialog.tsx @@ -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 React, { ReactNode, useState } from "react"; +import React, { type ReactNode, useState } from "react"; import QuestionDialog from "./QuestionDialog"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/IncomingSasDialog.tsx b/src/components/views/dialogs/IncomingSasDialog.tsx index e5df3a35b1..bb210d0d23 100644 --- a/src/components/views/dialogs/IncomingSasDialog.tsx +++ b/src/components/views/dialogs/IncomingSasDialog.tsx @@ -5,8 +5,8 @@ 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, { ReactNode } from "react"; -import { GeneratedSas, ShowSasCallbacks, Verifier, VerifierEvent } from "matrix-js-sdk/src/crypto-api"; +import React, { type ReactNode } from "react"; +import { type GeneratedSas, type ShowSasCallbacks, type Verifier, VerifierEvent } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/dialogs/InfoDialog.tsx b/src/components/views/dialogs/InfoDialog.tsx index 20fb51a7d0..febf6a3419 100644 --- a/src/components/views/dialogs/InfoDialog.tsx +++ b/src/components/views/dialogs/InfoDialog.tsx @@ -7,7 +7,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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/InteractiveAuthDialog.tsx b/src/components/views/dialogs/InteractiveAuthDialog.tsx index beb27573c6..8ba67bcc5d 100644 --- a/src/components/views/dialogs/InteractiveAuthDialog.tsx +++ b/src/components/views/dialogs/InteractiveAuthDialog.tsx @@ -9,17 +9,17 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixClient, UIAResponse } from "matrix-js-sdk/src/matrix"; -import { AuthType } from "matrix-js-sdk/src/interactive-auth"; +import { type MatrixClient, type UIAResponse } from "matrix-js-sdk/src/matrix"; +import { type AuthType } from "matrix-js-sdk/src/interactive-auth"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; import InteractiveAuth, { ERROR_USER_CANCELLED, - InteractiveAuthCallback, - InteractiveAuthProps, + type InteractiveAuthCallback, + type InteractiveAuthProps, } from "../../structures/InteractiveAuth"; -import { ContinueKind, SSOAuthEntry } from "../auth/InteractiveAuthEntryComponents"; +import { type ContinueKind, SSOAuthEntry } from "../auth/InteractiveAuthEntryComponents"; import BaseDialog from "./BaseDialog"; import { Linkify } from "../../../Linkify"; diff --git a/src/components/views/dialogs/InviteDialog.tsx b/src/components/views/dialogs/InviteDialog.tsx index d72baae523..d98069fcf9 100644 --- a/src/components/views/dialogs/InviteDialog.tsx +++ b/src/components/views/dialogs/InviteDialog.tsx @@ -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 React, { createRef, ReactNode, SyntheticEvent } from "react"; +import React, { createRef, type ReactNode, type SyntheticEvent } from "react"; import classNames from "classnames"; -import { RoomMember, Room, MatrixError, EventType } from "matrix-js-sdk/src/matrix"; +import { RoomMember, type Room, MatrixError, EventType } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { logger } from "matrix-js-sdk/src/logger"; import { uniqBy } from "lodash"; import { CloseIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; @@ -26,7 +26,7 @@ import { buildActivityScores, buildMemberScores, compareMembers } from "../../.. import { abbreviateUrl } from "../../../utils/UrlUtils"; import IdentityAuthClient from "../../../IdentityAuthClient"; import { humanizeTime } from "../../../utils/humanize"; -import { IInviteResult, inviteMultipleToRoom, showAnyInviteErrors } from "../../../RoomInvite"; +import { type IInviteResult, inviteMultipleToRoom, showAnyInviteErrors } from "../../../RoomInvite"; import { Action } from "../../../dispatcher/actions"; import { DefaultTagID } from "../../../stores/room-list/models"; import RoomListStore from "../../../stores/room-list/RoomListStore"; @@ -35,7 +35,7 @@ import { UIFeature } from "../../../settings/UIFeature"; import { mediaFromMxc } from "../../../customisations/Media"; import BaseAvatar from "../avatars/BaseAvatar"; import { SearchResultAvatar } from "../avatars/SearchResultAvatar"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import { selectText } from "../../../utils/strings"; import Field from "../elements/Field"; import TabbedView, { Tab, TabLocation } from "../../structures/TabbedView"; @@ -47,13 +47,13 @@ import DialPadBackspaceButton from "../elements/DialPadBackspaceButton"; import LegacyCallHandler from "../../../LegacyCallHandler"; import UserIdentifierCustomisations from "../../../customisations/UserIdentifier"; import CopyableText from "../elements/CopyableText"; -import { ScreenName } from "../../../PosthogTrackers"; +import { type ScreenName } from "../../../PosthogTrackers"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { DirectoryMember, - IDMUserTileProps, - Member, + type IDMUserTileProps, + type Member, startDmOnFirstMessage, ThreepidMember, } from "../../../utils/direct-messages"; @@ -61,11 +61,11 @@ import { InviteKind } from "./InviteDialogTypes"; import Modal from "../../../Modal"; import dis from "../../../dispatcher/dispatcher"; import { privateShouldBeEncrypted } from "../../../utils/rooms"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; import { UNKNOWN_PROFILE_ERRORS } from "../../../utils/MultiInviter"; -import AskInviteAnywayDialog, { UnknownProfiles } from "./AskInviteAnywayDialog"; +import AskInviteAnywayDialog, { type UnknownProfiles } from "./AskInviteAnywayDialog"; import { SdkContextClass } from "../../../contexts/SDKContext"; -import { UserProfilesStore } from "../../../stores/UserProfilesStore"; +import { type UserProfilesStore } from "../../../stores/UserProfilesStore"; // we have a number of types defined from the Matrix spec which can't reasonably be altered here. /* eslint-disable camelcase */ diff --git a/src/components/views/dialogs/LeaveSpaceDialog.tsx b/src/components/views/dialogs/LeaveSpaceDialog.tsx index 72ad5f478f..e81606db79 100644 --- a/src/components/views/dialogs/LeaveSpaceDialog.tsx +++ b/src/components/views/dialogs/LeaveSpaceDialog.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useMemo, useState } from "react"; -import { Room, JoinRule } from "matrix-js-sdk/src/matrix"; +import { type Room, JoinRule } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import DialogButtons from "../elements/DialogButtons"; diff --git a/src/components/views/dialogs/LogoutDialog.tsx b/src/components/views/dialogs/LogoutDialog.tsx index 460871fb36..6e000ef631 100644 --- a/src/components/views/dialogs/LogoutDialog.tsx +++ b/src/components/views/dialogs/LogoutDialog.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React, { lazy } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import Modal from "../../../Modal"; import dis from "../../../dispatcher/dispatcher"; diff --git a/src/components/views/dialogs/MessageEditHistoryDialog.tsx b/src/components/views/dialogs/MessageEditHistoryDialog.tsx index 3008e2d16c..701bff0458 100644 --- a/src/components/views/dialogs/MessageEditHistoryDialog.tsx +++ b/src/components/views/dialogs/MessageEditHistoryDialog.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, EventType, RelationType, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, EventType, RelationType, type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import { defer } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/components/views/dialogs/ModalWidgetDialog.tsx b/src/components/views/dialogs/ModalWidgetDialog.tsx index 1bc123c485..e6506b4258 100644 --- a/src/components/views/dialogs/ModalWidgetDialog.tsx +++ b/src/components/views/dialogs/ModalWidgetDialog.tsx @@ -9,16 +9,16 @@ Please see LICENSE files in the repository root for full details. import * as React from "react"; import { ClientWidgetApi, - IModalWidgetCloseRequest, - IModalWidgetOpenRequestData, - IModalWidgetReturnData, - ISetModalButtonEnabledActionRequest, - IWidgetApiAcknowledgeResponseData, - IWidgetApiErrorResponseData, + type IModalWidgetCloseRequest, + type IModalWidgetOpenRequestData, + type IModalWidgetReturnData, + type ISetModalButtonEnabledActionRequest, + type IWidgetApiAcknowledgeResponseData, + type IWidgetApiErrorResponseData, BuiltInModalButtonID, - ModalButtonID, + type ModalButtonID, ModalButtonKind, - Widget, + type Widget, WidgetApiFromWidgetAction, WidgetKind, } from "matrix-widget-api"; @@ -26,7 +26,7 @@ import { ErrorIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import BaseDialog from "./BaseDialog"; import { _t, getUserLanguage } from "../../../languageHandler"; -import AccessibleButton, { AccessibleButtonKind } from "../elements/AccessibleButton"; +import AccessibleButton, { type AccessibleButtonKind } from "../elements/AccessibleButton"; import { StopGapWidgetDriver } from "../../../stores/widgets/StopGapWidgetDriver"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { OwnProfileStore } from "../../../stores/OwnProfileStore"; diff --git a/src/components/views/dialogs/ModuleUiDialog.tsx b/src/components/views/dialogs/ModuleUiDialog.tsx index 89ef4ad0ea..dc358d31ef 100644 --- a/src/components/views/dialogs/ModuleUiDialog.tsx +++ b/src/components/views/dialogs/ModuleUiDialog.tsx @@ -7,12 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { DialogContent, DialogProps } from "@matrix-org/react-sdk-module-api/lib/components/DialogContent"; +import { type DialogContent, type DialogProps } from "@matrix-org/react-sdk-module-api/lib/components/DialogContent"; import { logger } from "matrix-js-sdk/src/logger"; -import { ModuleApi } from "@matrix-org/react-sdk-module-api/lib/ModuleApi"; -import { ModuleUiDialogOptions } from "@matrix-org/react-sdk-module-api/lib/types/ModuleUiDialogOptions"; +import { type ModuleApi } from "@matrix-org/react-sdk-module-api/lib/ModuleApi"; +import { type ModuleUiDialogOptions } from "@matrix-org/react-sdk-module-api/lib/types/ModuleUiDialogOptions"; -import ScrollableBaseModal, { IScrollableBaseState } from "./ScrollableBaseModal"; +import ScrollableBaseModal, { type IScrollableBaseState } from "./ScrollableBaseModal"; import { _t } from "../../../languageHandler"; interface IProps

> { diff --git a/src/components/views/dialogs/PollHistoryDialog.tsx b/src/components/views/dialogs/PollHistoryDialog.tsx index 528b44f332..bcc92932e0 100644 --- a/src/components/views/dialogs/PollHistoryDialog.tsx +++ b/src/components/views/dialogs/PollHistoryDialog.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { PollHistory } from "../polls/pollHistory/PollHistory"; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx b/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx index a7748e3d69..755d1a5116 100644 --- a/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx +++ b/src/components/views/dialogs/RegistrationEmailPromptDialog.tsx @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import * as React from "react"; -import { SyntheticEvent, useRef, useState } from "react"; +import { type SyntheticEvent, useRef, useState } from "react"; import { _t, _td } from "../../../languageHandler"; -import Field from "../elements/Field"; +import type Field from "../elements/Field"; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; import EmailField from "../auth/EmailField"; diff --git a/src/components/views/dialogs/ReportEventDialog.tsx b/src/components/views/dialogs/ReportEventDialog.tsx index 5c1e409ca5..76794154f5 100644 --- a/src/components/views/dialogs/ReportEventDialog.tsx +++ b/src/components/views/dialogs/ReportEventDialog.tsx @@ -7,8 +7,8 @@ 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, { ChangeEvent } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent } from "react"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t, UserFriendlyError } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/RoomSettingsDialog.tsx b/src/components/views/dialogs/RoomSettingsDialog.tsx index a4c8dd91b2..8c90a356d2 100644 --- a/src/components/views/dialogs/RoomSettingsDialog.tsx +++ b/src/components/views/dialogs/RoomSettingsDialog.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { RoomEvent, Room, RoomStateEvent, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { RoomEvent, type Room, RoomStateEvent, type MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; import TabbedView, { Tab } from "../../structures/TabbedView"; import { _t, _td } from "../../../languageHandler"; @@ -26,8 +26,8 @@ import { UIFeature } from "../../../settings/UIFeature"; import BaseDialog from "./BaseDialog"; import { Action } from "../../../dispatcher/actions"; import { VoipRoomSettingsTab } from "../settings/tabs/room/VoipRoomSettingsTab"; -import { ActionPayload } from "../../../dispatcher/payloads"; -import { NonEmptyArray } from "../../../@types/common"; +import { type ActionPayload } from "../../../dispatcher/payloads"; +import { type NonEmptyArray } from "../../../@types/common"; import { PollHistoryTab } from "../settings/tabs/room/PollHistoryTab"; import ErrorBoundary from "../elements/ErrorBoundary"; import { PeopleRoomSettingsTab } from "../settings/tabs/room/PeopleRoomSettingsTab"; diff --git a/src/components/views/dialogs/RoomUpgradeDialog.tsx b/src/components/views/dialogs/RoomUpgradeDialog.tsx index fdb0a9f0a6..f9ca19a590 100644 --- a/src/components/views/dialogs/RoomUpgradeDialog.tsx +++ b/src/components/views/dialogs/RoomUpgradeDialog.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import Modal from "../../../Modal"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx b/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx index c15db4a5df..bd93e8d74f 100644 --- a/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx +++ b/src/components/views/dialogs/RoomUpgradeWarningDialog.tsx @@ -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 React, { ReactNode, SyntheticEvent } from "react"; +import React, { type ReactNode, type SyntheticEvent } from "react"; import { EventType, JoinRule } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/ScrollableBaseModal.tsx b/src/components/views/dialogs/ScrollableBaseModal.tsx index 2f9c94f66f..a379b90d5f 100644 --- a/src/components/views/dialogs/ScrollableBaseModal.tsx +++ b/src/components/views/dialogs/ScrollableBaseModal.tsx @@ -6,8 +6,8 @@ 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, { FormEvent } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import React, { type FormEvent } from "react"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import FocusLock from "react-focus-lock"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/dialogs/ServerOfflineDialog.tsx b/src/components/views/dialogs/ServerOfflineDialog.tsx index b4d03c4c12..45a1e80714 100644 --- a/src/components/views/dialogs/ServerOfflineDialog.tsx +++ b/src/components/views/dialogs/ServerOfflineDialog.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import BaseDialog from "./BaseDialog"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/ServerPickerDialog.tsx b/src/components/views/dialogs/ServerPickerDialog.tsx index 9fd5002138..e62e3e90c7 100644 --- a/src/components/views/dialogs/ServerPickerDialog.tsx +++ b/src/components/views/dialogs/ServerPickerDialog.tsx @@ -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 React, { ChangeEvent, createRef, SyntheticEvent } from "react"; +import React, { type ChangeEvent, createRef, type SyntheticEvent } from "react"; import { AutoDiscovery } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; @@ -18,8 +18,8 @@ import SdkConfig from "../../../SdkConfig"; import Field from "../elements/Field"; import StyledRadioButton from "../elements/StyledRadioButton"; import TextWithTooltip from "../elements/TextWithTooltip"; -import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; -import { ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; +import withValidation, { type IFieldState, type IValidationResult } from "../elements/Validation"; +import { type ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; import ExternalLink from "../elements/ExternalLink"; interface IProps { diff --git a/src/components/views/dialogs/ShareDialog.tsx b/src/components/views/dialogs/ShareDialog.tsx index 3feff26f8f..393e1f700a 100644 --- a/src/components/views/dialogs/ShareDialog.tsx +++ b/src/components/views/dialogs/ShareDialog.tsx @@ -7,7 +7,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 React, { JSX, useMemo, useRef, useState } from "react"; +import React, { type JSX, useMemo, useRef, useState } from "react"; import { Room, RoomMember, MatrixEvent, User } from "matrix-js-sdk/src/matrix"; import { Checkbox, Button } from "@vector-im/compound-web"; import LinkIcon from "@vector-im/compound-design-tokens/assets/web/icons/link"; @@ -19,7 +19,7 @@ import { RoomPermalinkCreator, makeUserPermalink } from "../../../utils/permalin import { copyPlaintext } from "../../../utils/strings"; import { UIFeature } from "../../../settings/UIFeature"; import BaseDialog from "./BaseDialog"; -import { XOR } from "../../../@types/common"; +import { type XOR } from "../../../@types/common"; import { useSettingValue } from "../../../hooks/useSettings.ts"; /* eslint-disable @typescript-eslint/no-require-imports */ diff --git a/src/components/views/dialogs/SlashCommandHelpDialog.tsx b/src/components/views/dialogs/SlashCommandHelpDialog.tsx index 1c087567c3..819d28513e 100644 --- a/src/components/views/dialogs/SlashCommandHelpDialog.tsx +++ b/src/components/views/dialogs/SlashCommandHelpDialog.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { _t } from "../../../languageHandler"; -import { Command, CommandCategories, Commands } from "../../../SlashCommands"; +import { type Command, CommandCategories, Commands } from "../../../SlashCommands"; import InfoDialog from "./InfoDialog"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/dialogs/SpacePreferencesDialog.tsx b/src/components/views/dialogs/SpacePreferencesDialog.tsx index a5f30f0d64..986d69c5e4 100644 --- a/src/components/views/dialogs/SpacePreferencesDialog.tsx +++ b/src/components/views/dialogs/SpacePreferencesDialog.tsx @@ -6,8 +6,8 @@ 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, { ChangeEvent } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { _t, _td } from "../../../languageHandler"; import BaseDialog from "../dialogs/BaseDialog"; @@ -18,7 +18,7 @@ import SettingsStore from "../../../settings/SettingsStore"; import { SettingLevel } from "../../../settings/SettingLevel"; import RoomName from "../elements/RoomName"; import { SpacePreferenceTab } from "../../../dispatcher/payloads/OpenSpacePreferencesPayload"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; import SettingsTab from "../settings/tabs/SettingsTab"; import { SettingsSection } from "../settings/shared/SettingsSection"; import { SettingsSubsection, SettingsSubsectionText } from "../settings/shared/SettingsSubsection"; diff --git a/src/components/views/dialogs/SpaceSettingsDialog.tsx b/src/components/views/dialogs/SpaceSettingsDialog.tsx index 5ea4ea3418..797622a271 100644 --- a/src/components/views/dialogs/SpaceSettingsDialog.tsx +++ b/src/components/views/dialogs/SpaceSettingsDialog.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useMemo } from "react"; -import { Room, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Room, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { _t, _td } from "../../../languageHandler"; import BaseDialog from "./BaseDialog"; @@ -21,7 +21,7 @@ import { UIFeature } from "../../../settings/UIFeature"; import AdvancedRoomSettingsTab from "../settings/tabs/room/AdvancedRoomSettingsTab"; import RolesRoomSettingsTab from "../settings/tabs/room/RolesRoomSettingsTab"; import { Action } from "../../../dispatcher/actions"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; export enum SpaceSettingsTab { General = "SPACE_GENERAL_TAB", diff --git a/src/components/views/dialogs/StorageEvictedDialog.tsx b/src/components/views/dialogs/StorageEvictedDialog.tsx index bdacbcbb51..86bf3eda8f 100644 --- a/src/components/views/dialogs/StorageEvictedDialog.tsx +++ b/src/components/views/dialogs/StorageEvictedDialog.tsx @@ -13,7 +13,7 @@ import { _t } from "../../../languageHandler"; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; import BugReportDialog from "./BugReportDialog"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; interface IProps { onFinished(signOut?: boolean): void; diff --git a/src/components/views/dialogs/TermsDialog.tsx b/src/components/views/dialogs/TermsDialog.tsx index f1cdb3f199..8a8f03f69c 100644 --- a/src/components/views/dialogs/TermsDialog.tsx +++ b/src/components/views/dialogs/TermsDialog.tsx @@ -12,7 +12,7 @@ import { SERVICE_TYPES } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import DialogButtons from "../elements/DialogButtons"; import BaseDialog from "./BaseDialog"; -import { pickBestPolicyLanguage, ServicePolicyPair } from "../../../Terms"; +import { pickBestPolicyLanguage, type ServicePolicyPair } from "../../../Terms"; import ExternalLink from "../elements/ExternalLink"; import { parseUrl } from "../../../utils/UrlUtils"; diff --git a/src/components/views/dialogs/TextInputDialog.tsx b/src/components/views/dialogs/TextInputDialog.tsx index 9d68668413..1a86a40d14 100644 --- a/src/components/views/dialogs/TextInputDialog.tsx +++ b/src/components/views/dialogs/TextInputDialog.tsx @@ -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 React, { ChangeEvent, createRef } from "react"; +import React, { type ChangeEvent, createRef } from "react"; import Field from "../elements/Field"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; -import { IFieldState, IValidationResult } from "../elements/Validation"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; +import { type IFieldState, type IValidationResult } from "../elements/Validation"; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; diff --git a/src/components/views/dialogs/UnpinAllDialog.tsx b/src/components/views/dialogs/UnpinAllDialog.tsx index f2390a978c..3812f07772 100644 --- a/src/components/views/dialogs/UnpinAllDialog.tsx +++ b/src/components/views/dialogs/UnpinAllDialog.tsx @@ -6,9 +6,9 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX } from "react"; +import React, { type JSX } from "react"; import { Button, Text } from "@vector-im/compound-web"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import BaseDialog from "../dialogs/BaseDialog"; diff --git a/src/components/views/dialogs/UntrustedDeviceDialog.tsx b/src/components/views/dialogs/UntrustedDeviceDialog.tsx index ad1b2df7dc..5a076a57b4 100644 --- a/src/components/views/dialogs/UntrustedDeviceDialog.tsx +++ b/src/components/views/dialogs/UntrustedDeviceDialog.tsx @@ -7,14 +7,14 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { User } from "matrix-js-sdk/src/matrix"; +import { type User } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import E2EIcon from "../rooms/E2EIcon"; import AccessibleButton from "../elements/AccessibleButton"; import BaseDialog from "./BaseDialog"; -import { IDevice } from "../right_panel/UserInfo"; +import { type IDevice } from "../right_panel/UserInfo"; import { E2EStatus } from "../../../utils/ShieldUtils"; interface IProps { diff --git a/src/components/views/dialogs/UploadFailureDialog.tsx b/src/components/views/dialogs/UploadFailureDialog.tsx index 7e98fb24b3..75ee17fda6 100644 --- a/src/components/views/dialogs/UploadFailureDialog.tsx +++ b/src/components/views/dialogs/UploadFailureDialog.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { _t } from "../../../languageHandler"; -import ContentMessages from "../../../ContentMessages"; +import type ContentMessages from "../../../ContentMessages"; import BaseDialog from "./BaseDialog"; import DialogButtons from "../elements/DialogButtons"; import { fileSize } from "../../../utils/FileUtils"; diff --git a/src/components/views/dialogs/UserSettingsDialog.tsx b/src/components/views/dialogs/UserSettingsDialog.tsx index 5203c9b059..a8e184f083 100644 --- a/src/components/views/dialogs/UserSettingsDialog.tsx +++ b/src/components/views/dialogs/UserSettingsDialog.tsx @@ -41,8 +41,8 @@ import SidebarUserSettingsTab from "../settings/tabs/user/SidebarUserSettingsTab import KeyboardUserSettingsTab from "../settings/tabs/user/KeyboardUserSettingsTab"; import SessionManagerTab from "../settings/tabs/user/SessionManagerTab"; import { UserTab } from "./UserTab"; -import { NonEmptyArray } from "../../../@types/common"; -import { SDKContext, SdkContextClass } from "../../../contexts/SDKContext"; +import { type NonEmptyArray } from "../../../@types/common"; +import { SDKContext, type SdkContextClass } from "../../../contexts/SDKContext"; import { useSettingValue } from "../../../hooks/useSettings"; import { ToastContext, useActiveToast } from "../../../contexts/ToastContext"; import { EncryptionUserSettingsTab } from "../settings/tabs/user/EncryptionUserSettingsTab"; diff --git a/src/components/views/dialogs/VerificationRequestDialog.tsx b/src/components/views/dialogs/VerificationRequestDialog.tsx index bb49abbf15..d8cef61036 100644 --- a/src/components/views/dialogs/VerificationRequestDialog.tsx +++ b/src/components/views/dialogs/VerificationRequestDialog.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto-api"; -import { User } from "matrix-js-sdk/src/matrix"; +import { type VerificationRequest } from "matrix-js-sdk/src/crypto-api"; +import { type User } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx index 7e57d95708..bde310788c 100644 --- a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx +++ b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx @@ -7,7 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Capability, isTimelineCapability, Widget, WidgetEventCapability, WidgetKind } from "matrix-widget-api"; +import { + type Capability, + isTimelineCapability, + type Widget, + WidgetEventCapability, + type WidgetKind, +} from "matrix-widget-api"; import { lexicographicCompare } from "matrix-js-sdk/src/utils"; import BaseDialog from "./BaseDialog"; diff --git a/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx b/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx index 4c1e8a9d32..f9729a695e 100644 --- a/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx +++ b/src/components/views/dialogs/WidgetOpenIDPermissionsDialog.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Widget, WidgetKind } from "matrix-widget-api"; +import { type Widget, type WidgetKind } from "matrix-widget-api"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/dialogs/devtools/AccountData.tsx b/src/components/views/dialogs/devtools/AccountData.tsx index 402aa396d1..d4dfe039fd 100644 --- a/src/components/views/dialogs/devtools/AccountData.tsx +++ b/src/components/views/dialogs/devtools/AccountData.tsx @@ -8,13 +8,13 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext, useMemo, useState } from "react"; -import { AccountDataEvents, IContent, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type AccountDataEvents, type IContent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool"; +import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool"; import MatrixClientContext from "../../../../contexts/MatrixClientContext"; -import { EventEditor, EventViewer, eventTypeField, IEditorProps, stringify } from "./Event"; +import { EventEditor, EventViewer, eventTypeField, type IEditorProps, stringify } from "./Event"; import FilteredList from "./FilteredList"; -import { _td, TranslationKey } from "../../../../languageHandler"; +import { _td, type TranslationKey } from "../../../../languageHandler"; export const AccountDataEventEditor: React.FC = ({ mxEvent, onBack }) => { const cli = useContext(MatrixClientContext); diff --git a/src/components/views/dialogs/devtools/BaseTool.tsx b/src/components/views/dialogs/devtools/BaseTool.tsx index adc13d2eab..8a923e2623 100644 --- a/src/components/views/dialogs/devtools/BaseTool.tsx +++ b/src/components/views/dialogs/devtools/BaseTool.tsx @@ -7,13 +7,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, { createContext, ReactNode, useState } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { createContext, type ReactNode, useState } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; -import { _t, TranslationKey } from "../../../../languageHandler"; -import { XOR } from "../../../../@types/common"; -import { Tool } from "../DevtoolsDialog"; +import { _t, type TranslationKey } from "../../../../languageHandler"; +import { type XOR } from "../../../../@types/common"; +import { type Tool } from "../DevtoolsDialog"; export interface IDevtoolsProps { onBack(): void; diff --git a/src/components/views/dialogs/devtools/Crypto.tsx b/src/components/views/dialogs/devtools/Crypto.tsx index 78e95bfdff..a05c415f00 100644 --- a/src/components/views/dialogs/devtools/Crypto.tsx +++ b/src/components/views/dialogs/devtools/Crypto.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX } from "react"; +import React, { type JSX } from "react"; import { InlineSpinner } from "@vector-im/compound-web"; import { useMatrixClientContext } from "../../../../contexts/MatrixClientContext"; diff --git a/src/components/views/dialogs/devtools/Event.tsx b/src/components/views/dialogs/devtools/Event.tsx index a0f7bfece5..00669cd614 100644 --- a/src/components/views/dialogs/devtools/Event.tsx +++ b/src/components/views/dialogs/devtools/Event.tsx @@ -7,12 +7,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 React, { ChangeEvent, ReactNode, useContext, useMemo, useRef, useState } from "react"; -import { IContent, MatrixEvent, TimelineEvents } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent, type ReactNode, useContext, useMemo, useRef, useState } from "react"; +import { type IContent, type MatrixEvent, type TimelineEvents } from "matrix-js-sdk/src/matrix"; -import { _t, _td, TranslationKey } from "../../../../languageHandler"; +import { _t, _td, type TranslationKey } from "../../../../languageHandler"; import Field from "../../elements/Field"; -import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool"; +import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool"; import MatrixClientContext from "../../../../contexts/MatrixClientContext"; import withValidation from "../../elements/Validation"; import SyntaxHighlight from "../../elements/SyntaxHighlight"; diff --git a/src/components/views/dialogs/devtools/FilteredList.tsx b/src/components/views/dialogs/devtools/FilteredList.tsx index 0f0c52df94..985e28759c 100644 --- a/src/components/views/dialogs/devtools/FilteredList.tsx +++ b/src/components/views/dialogs/devtools/FilteredList.tsx @@ -7,7 +7,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 React, { ChangeEvent, useEffect, useState } from "react"; +import React, { type ChangeEvent, useEffect, useState } from "react"; import { _t } from "../../../../languageHandler"; import Field from "../../elements/Field"; diff --git a/src/components/views/dialogs/devtools/RoomNotifications.tsx b/src/components/views/dialogs/devtools/RoomNotifications.tsx index a7c8bb7dde..3ba69f527e 100644 --- a/src/components/views/dialogs/devtools/RoomNotifications.tsx +++ b/src/components/views/dialogs/devtools/RoomNotifications.tsx @@ -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 { NotificationCountType, Room, Thread, ReceiptType } from "matrix-js-sdk/src/matrix"; +import { NotificationCountType, type Room, type Thread, ReceiptType } from "matrix-js-sdk/src/matrix"; import React, { useContext } from "react"; -import { ReadReceipt } from "matrix-js-sdk/src/models/read-receipt"; +import { type ReadReceipt } from "matrix-js-sdk/src/models/read-receipt"; import MatrixClientContext from "../../../../contexts/MatrixClientContext"; import { useNotificationState } from "../../../../hooks/useRoomNotificationState"; @@ -16,7 +16,7 @@ import { _t, _td } from "../../../../languageHandler"; import { determineUnreadState } from "../../../../RoomNotifs"; import { humanReadableNotificationLevel } from "../../../../stores/notifications/NotificationLevel"; import { doesRoomOrThreadHaveUnreadMessages } from "../../../../Unread"; -import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool"; +import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool"; import { useIsEncrypted } from "../../../../hooks/useIsEncrypted.ts"; function UserReadUpTo({ target }: { target: ReadReceipt }): JSX.Element { diff --git a/src/components/views/dialogs/devtools/RoomState.tsx b/src/components/views/dialogs/devtools/RoomState.tsx index 8831ccc805..0a41743372 100644 --- a/src/components/views/dialogs/devtools/RoomState.tsx +++ b/src/components/views/dialogs/devtools/RoomState.tsx @@ -8,13 +8,13 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext, useEffect, useMemo, useState } from "react"; -import { IContent, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type IContent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import { _t, _td } from "../../../../languageHandler"; -import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool"; +import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool"; import MatrixClientContext from "../../../../contexts/MatrixClientContext"; -import { EventEditor, EventViewer, eventTypeField, stateKeyField, IEditorProps, stringify } from "./Event"; +import { EventEditor, EventViewer, eventTypeField, stateKeyField, type IEditorProps, stringify } from "./Event"; import FilteredList from "./FilteredList"; import Spinner from "../../elements/Spinner"; import SyntaxHighlight from "../../elements/SyntaxHighlight"; diff --git a/src/components/views/dialogs/devtools/ServerInfo.tsx b/src/components/views/dialogs/devtools/ServerInfo.tsx index 85780b8fd9..be37384d05 100644 --- a/src/components/views/dialogs/devtools/ServerInfo.tsx +++ b/src/components/views/dialogs/devtools/ServerInfo.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; -import BaseTool, { IDevtoolsProps } from "./BaseTool"; +import BaseTool, { type IDevtoolsProps } from "./BaseTool"; import { _t } from "../../../../languageHandler"; import { useAsyncMemo } from "../../../../hooks/useAsyncMemo"; import MatrixClientContext from "../../../../contexts/MatrixClientContext"; diff --git a/src/components/views/dialogs/devtools/ServersInRoom.tsx b/src/components/views/dialogs/devtools/ServersInRoom.tsx index e7b90c9794..ebdd8b526c 100644 --- a/src/components/views/dialogs/devtools/ServersInRoom.tsx +++ b/src/components/views/dialogs/devtools/ServersInRoom.tsx @@ -11,7 +11,7 @@ import React, { useContext, useMemo } from "react"; import { EventType } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool"; +import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool"; import { _t } from "../../../../languageHandler"; const ServersInRoom: React.FC = ({ onBack }) => { diff --git a/src/components/views/dialogs/devtools/SettingExplorer.tsx b/src/components/views/dialogs/devtools/SettingExplorer.tsx index b9919973eb..7fedcd2fa5 100644 --- a/src/components/views/dialogs/devtools/SettingExplorer.tsx +++ b/src/components/views/dialogs/devtools/SettingExplorer.tsx @@ -7,15 +7,15 @@ 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, { ChangeEvent, useContext, useMemo, useState } from "react"; +import React, { type ChangeEvent, useContext, useMemo, useState } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { _t, _td } from "../../../../languageHandler"; -import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool"; +import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool"; import AccessibleButton from "../../elements/AccessibleButton"; import SettingsStore, { LEVEL_ORDER } from "../../../../settings/SettingsStore"; -import { SettingLevel } from "../../../../settings/SettingLevel"; -import { SettingKey, SETTINGS, SettingValueType } from "../../../../settings/Settings"; +import { type SettingLevel } from "../../../../settings/SettingLevel"; +import { type SettingKey, SETTINGS, type SettingValueType } from "../../../../settings/Settings"; import Field from "../../elements/Field"; const SettingExplorer: React.FC = ({ onBack }) => { diff --git a/src/components/views/dialogs/devtools/WidgetExplorer.tsx b/src/components/views/dialogs/devtools/WidgetExplorer.tsx index 5bcae19141..d899c46c7c 100644 --- a/src/components/views/dialogs/devtools/WidgetExplorer.tsx +++ b/src/components/views/dialogs/devtools/WidgetExplorer.tsx @@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext, useState } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { useEventEmitterState } from "../../../../hooks/useEventEmitter"; import { _t } from "../../../../languageHandler"; -import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool"; -import WidgetStore, { IApp } from "../../../../stores/WidgetStore"; +import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool"; +import WidgetStore, { type IApp } from "../../../../stores/WidgetStore"; import { UPDATE_EVENT } from "../../../../stores/AsyncStore"; import FilteredList from "./FilteredList"; import { StateEventEditor } from "./RoomState"; diff --git a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx index a6d81ae2ce..14c144a538 100644 --- a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx +++ b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx @@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details. import { debounce } from "lodash"; import classNames from "classnames"; -import React, { ChangeEvent, FormEvent } from "react"; +import React, { type ChangeEvent, type FormEvent } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { decodeRecoveryKey } from "matrix-js-sdk/src/crypto-api"; -import { SecretStorage } from "matrix-js-sdk/src/matrix"; +import { type SecretStorage } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import Field from "../../elements/Field"; -import AccessibleButton, { ButtonEvent } from "../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../elements/AccessibleButton"; import { _t } from "../../../../languageHandler"; import { accessSecretStorage } from "../../../../SecurityManager"; import Modal from "../../../../Modal"; diff --git a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx index ca0a5e877e..c221c99448 100644 --- a/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx +++ b/src/components/views/dialogs/security/RestoreKeyBackupDialog.tsx @@ -7,9 +7,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, { ChangeEvent } from "react"; +import React, { type ChangeEvent } from "react"; import { MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; -import { decodeRecoveryKey, KeyBackupInfo, KeyBackupRestoreResult } from "matrix-js-sdk/src/crypto-api"; +import { decodeRecoveryKey, type KeyBackupInfo, type KeyBackupRestoreResult } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; diff --git a/src/components/views/dialogs/spotlight/Option.tsx b/src/components/views/dialogs/spotlight/Option.tsx index ac568afe26..c24f65c89f 100644 --- a/src/components/views/dialogs/spotlight/Option.tsx +++ b/src/components/views/dialogs/spotlight/Option.tsx @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { useRovingTabIndex } from "../../../../accessibility/RovingTabIndex"; -import AccessibleButton, { ButtonEvent } from "../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../elements/AccessibleButton"; interface OptionProps { endAdornment?: ReactNode; diff --git a/src/components/views/dialogs/spotlight/PublicRoomResultDetails.tsx b/src/components/views/dialogs/spotlight/PublicRoomResultDetails.tsx index 3e1025a81f..a404388ee7 100644 --- a/src/components/views/dialogs/spotlight/PublicRoomResultDetails.tsx +++ b/src/components/views/dialogs/spotlight/PublicRoomResultDetails.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { IPublicRoomsChunkRoom } from "matrix-js-sdk/src/matrix"; +import { type IPublicRoomsChunkRoom } from "matrix-js-sdk/src/matrix"; import { linkifyAndSanitizeHtml } from "../../../../HtmlUtils"; import { _t } from "../../../../languageHandler"; diff --git a/src/components/views/dialogs/spotlight/RoomResultContextMenus.tsx b/src/components/views/dialogs/spotlight/RoomResultContextMenus.tsx index f7b8311f98..18ab06357d 100644 --- a/src/components/views/dialogs/spotlight/RoomResultContextMenus.tsx +++ b/src/components/views/dialogs/spotlight/RoomResultContextMenus.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import React, { Fragment, useState } from "react"; import { ContextMenuTooltipButton } from "../../../../accessibility/context_menu/ContextMenuTooltipButton"; @@ -17,7 +17,7 @@ import { RoomNotifState } from "../../../../RoomNotifs"; import { RoomGeneralContextMenu } from "../../context_menus/RoomGeneralContextMenu"; import { RoomNotificationContextMenu } from "../../context_menus/RoomNotificationContextMenu"; import SpaceContextMenu from "../../context_menus/SpaceContextMenu"; -import { ButtonEvent } from "../../elements/AccessibleButton"; +import { type ButtonEvent } from "../../elements/AccessibleButton"; import { contextMenuBelow } from "../../rooms/RoomTile"; import { shouldShowComponent } from "../../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../../settings/UIFeature"; diff --git a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx index e4f9b11e67..722920e828 100644 --- a/src/components/views/dialogs/spotlight/SpotlightDialog.tsx +++ b/src/components/views/dialogs/spotlight/SpotlightDialog.tsx @@ -6,21 +6,21 @@ 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 { WebSearch as WebSearchEvent } from "@matrix-org/analytics-events/types/typescript/WebSearch"; +import { type WebSearch as WebSearchEvent } from "@matrix-org/analytics-events/types/typescript/WebSearch"; import classNames from "classnames"; import { capitalize, sum } from "lodash"; import { - IPublicRoomsChunkRoom, - MatrixClient, + type IPublicRoomsChunkRoom, + type MatrixClient, RoomMember, RoomType, - Room, - HierarchyRoom, + type Room, + type HierarchyRoom, JoinRule, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { normalize } from "matrix-js-sdk/src/utils"; -import React, { ChangeEvent, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; +import React, { type ChangeEvent, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; import sanitizeHtml from "sanitize-html"; import { KeyBindingAction } from "../../../../accessibility/KeyboardShortcuts"; @@ -33,7 +33,7 @@ import { import { mediaFromMxc } from "../../../../customisations/Media"; import { Action } from "../../../../dispatcher/actions"; import defaultDispatcher from "../../../../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../../dispatcher/payloads/ViewRoomPayload"; import { useDebouncedCallback } from "../../../../hooks/spotlight/useDebouncedCallback"; import { useRecentSearches } from "../../../../hooks/spotlight/useRecentSearches"; import { useProfileInfo } from "../../../../hooks/useProfileInfo"; @@ -49,13 +49,13 @@ import { showStartChatInviteDialog } from "../../../../RoomInvite"; import { SettingLevel } from "../../../../settings/SettingLevel"; import SettingsStore from "../../../../settings/SettingsStore"; import { BreadcrumbsStore } from "../../../../stores/BreadcrumbsStore"; -import { RoomNotificationState } from "../../../../stores/notifications/RoomNotificationState"; +import { type RoomNotificationState } from "../../../../stores/notifications/RoomNotificationState"; import { RoomNotificationStateStore } from "../../../../stores/notifications/RoomNotificationStateStore"; import { RecentAlgorithm } from "../../../../stores/room-list/algorithms/tag-sorting/RecentAlgorithm"; import { SdkContextClass } from "../../../../contexts/SDKContext"; import { getMetaSpaceName } from "../../../../stores/spaces"; import SpaceStore from "../../../../stores/spaces/SpaceStore"; -import { DirectoryMember, Member, startDmOnFirstMessage } from "../../../../utils/direct-messages"; +import { DirectoryMember, type Member, startDmOnFirstMessage } from "../../../../utils/direct-messages"; import DMRoomMap from "../../../../utils/DMRoomMap"; import { makeUserPermalink } from "../../../../utils/permalinks/Permalinks"; import { buildActivityScores, buildMemberScores, compareMembers } from "../../../../utils/SortMembers"; @@ -64,7 +64,7 @@ import BaseAvatar from "../../avatars/BaseAvatar"; import DecoratedRoomAvatar from "../../avatars/DecoratedRoomAvatar"; import { SearchResultAvatar } from "../../avatars/SearchResultAvatar"; import { NetworkDropdown } from "../../directory/NetworkDropdown"; -import AccessibleButton, { ButtonEvent } from "../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../elements/AccessibleButton"; import Spinner from "../../elements/Spinner"; import NotificationBadge from "../../rooms/NotificationBadge"; import BaseDialog from "../BaseDialog"; diff --git a/src/components/views/dialogs/spotlight/TooltipOption.tsx b/src/components/views/dialogs/spotlight/TooltipOption.tsx index 26d0dcada8..7cf683669f 100644 --- a/src/components/views/dialogs/spotlight/TooltipOption.tsx +++ b/src/components/views/dialogs/spotlight/TooltipOption.tsx @@ -7,11 +7,11 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { useRovingTabIndex } from "../../../../accessibility/RovingTabIndex"; -import AccessibleButton, { ButtonProps } from "../../elements/AccessibleButton"; -import { Ref } from "../../../../accessibility/roving/types"; +import AccessibleButton, { type ButtonProps } from "../../elements/AccessibleButton"; +import { type Ref } from "../../../../accessibility/roving/types"; type TooltipOptionProps = ButtonProps & { className?: string; diff --git a/src/components/views/directory/NetworkDropdown.tsx b/src/components/views/directory/NetworkDropdown.tsx index c2a7a11b98..82714915cc 100644 --- a/src/components/views/directory/NetworkDropdown.tsx +++ b/src/components/views/directory/NetworkDropdown.tsx @@ -17,16 +17,16 @@ import Modal from "../../../Modal"; import SdkConfig from "../../../SdkConfig"; import { SettingLevel } from "../../../settings/SettingLevel"; import SettingsStore from "../../../settings/SettingsStore"; -import { Protocols } from "../../../utils/DirectoryUtils"; +import { type Protocols } from "../../../utils/DirectoryUtils"; import { - AdditionalOptionsProps, + type AdditionalOptionsProps, GenericDropdownMenu, - GenericDropdownMenuItem, + type GenericDropdownMenuItem, } from "../../structures/GenericDropdownMenu"; import TextInputDialog from "../dialogs/TextInputDialog"; import AccessibleButton from "../elements/AccessibleButton"; import withValidation from "../elements/Validation"; -import { SettingKey, Settings } from "../../../settings/Settings.tsx"; +import { type SettingKey, type Settings } from "../../../settings/Settings.tsx"; const SETTING_NAME = "room_directory_servers"; diff --git a/src/components/views/elements/AccessibleButton.tsx b/src/components/views/elements/AccessibleButton.tsx index f12b36359b..efb6e5f939 100644 --- a/src/components/views/elements/AccessibleButton.tsx +++ b/src/components/views/elements/AccessibleButton.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React, { - ComponentProps, - ComponentPropsWithoutRef, + type ComponentProps, + type ComponentPropsWithoutRef, forwardRef, - FunctionComponent, - ReactElement, - KeyboardEvent, - Ref, + type FunctionComponent, + type ReactElement, + type KeyboardEvent, + type Ref, } from "react"; import classnames from "classnames"; import { Tooltip } from "@vector-im/compound-web"; diff --git a/src/components/views/elements/AppPermission.tsx b/src/components/views/elements/AppPermission.tsx index c6ac9d2f50..8aafb7244b 100644 --- a/src/components/views/elements/AppPermission.tsx +++ b/src/components/views/elements/AppPermission.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { RoomMember } from "matrix-js-sdk/src/matrix"; +import { type RoomMember } from "matrix-js-sdk/src/matrix"; import { Tooltip } from "@vector-im/compound-web"; import { HelpIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; diff --git a/src/components/views/elements/AppTile.tsx b/src/components/views/elements/AppTile.tsx index 8af4a95f93..5b75ca2694 100644 --- a/src/components/views/elements/AppTile.tsx +++ b/src/components/views/elements/AppTile.tsx @@ -9,13 +9,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, { ContextType, createRef, CSSProperties, MutableRefObject, ReactNode } from "react"; +import React, { type ContextType, createRef, type CSSProperties, type MutableRefObject, type ReactNode } from "react"; import classNames from "classnames"; -import { IWidget, MatrixCapabilities } from "matrix-widget-api"; -import { Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import { type IWidget, MatrixCapabilities } from "matrix-widget-api"; +import { type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; -import { ApprovalOpts, WidgetLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WidgetLifecycle"; +import { type ApprovalOpts, WidgetLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WidgetLifecycle"; import { OverflowHorizontalIcon, MinusIcon, @@ -38,14 +38,14 @@ import { ElementWidget, StopGapWidget } from "../../../stores/widgets/StopGapWid import { showContextMenu, WidgetContextMenu } from "../context_menus/WidgetContextMenu"; import WidgetAvatar from "../avatars/WidgetAvatar"; import LegacyCallHandler from "../../../LegacyCallHandler"; -import { IApp, isAppWidget } from "../../../stores/WidgetStore"; +import { type IApp, isAppWidget } from "../../../stores/WidgetStore"; import { Icon as PopoutIcon } from "../../../../res/img/external-link.svg"; import { Container, WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore"; import { OwnProfileStore } from "../../../stores/OwnProfileStore"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import WidgetUtils from "../../../utils/WidgetUtils"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import { Action } from "../../../dispatcher/actions"; import { ElementWidgetCapabilities } from "../../../stores/widgets/ElementWidgetCapabilities"; import { WidgetMessagingStore } from "../../../stores/widgets/WidgetMessagingStore"; diff --git a/src/components/views/elements/CopyableText.tsx b/src/components/views/elements/CopyableText.tsx index 02c1b14563..9c2472a202 100644 --- a/src/components/views/elements/CopyableText.tsx +++ b/src/components/views/elements/CopyableText.tsx @@ -12,7 +12,7 @@ import classNames from "classnames"; import { _t } from "../../../languageHandler"; import { copyPlaintext } from "../../../utils/strings"; -import AccessibleButton, { ButtonEvent } from "./AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "./AccessibleButton"; interface IProps extends React.HTMLAttributes { children?: React.ReactNode; diff --git a/src/components/views/elements/DesktopCapturerSourcePicker.tsx b/src/components/views/elements/DesktopCapturerSourcePicker.tsx index 2e100e767c..636e37ccd0 100644 --- a/src/components/views/elements/DesktopCapturerSourcePicker.tsx +++ b/src/components/views/elements/DesktopCapturerSourcePicker.tsx @@ -9,13 +9,13 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; import BaseDialog from "..//dialogs/BaseDialog"; import DialogButtons from "./DialogButtons"; import AccessibleButton from "./AccessibleButton"; import TabbedView, { Tab, TabLocation } from "../../structures/TabbedView"; import PlatformPeg from "../../../PlatformPeg"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; export function getDesktopCapturerSources(): Promise> { const options: GetSourcesOptions = { diff --git a/src/components/views/elements/DialPadBackspaceButton.tsx b/src/components/views/elements/DialPadBackspaceButton.tsx index 7ebf9694b3..3cdf1135e1 100644 --- a/src/components/views/elements/DialPadBackspaceButton.tsx +++ b/src/components/views/elements/DialPadBackspaceButton.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import * as React from "react"; import { _t } from "../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "./AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "./AccessibleButton"; interface IProps { // Callback for when the button is pressed diff --git a/src/components/views/elements/DialogButtons.tsx b/src/components/views/elements/DialogButtons.tsx index defee130bc..1aa8b6a01a 100644 --- a/src/components/views/elements/DialogButtons.tsx +++ b/src/components/views/elements/DialogButtons.tsx @@ -8,7 +8,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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/elements/Dropdown.tsx b/src/components/views/elements/Dropdown.tsx index b4d0df69df..6fc54a0e0b 100644 --- a/src/components/views/elements/Dropdown.tsx +++ b/src/components/views/elements/Dropdown.tsx @@ -7,15 +7,22 @@ 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, { ChangeEvent, createRef, CSSProperties, ReactElement, ReactNode, Ref } from "react"; +import React, { + type ChangeEvent, + createRef, + type CSSProperties, + type ReactElement, + type ReactNode, + type Ref, +} from "react"; import classnames from "classnames"; -import AccessibleButton, { ButtonEvent } from "./AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "./AccessibleButton"; import { _t } from "../../../languageHandler"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { objectHasDiff } from "../../../utils/objects"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; interface IMenuOptionProps { children: ReactElement; diff --git a/src/components/views/elements/EditableItemList.tsx b/src/components/views/elements/EditableItemList.tsx index f08b65e24f..2e91e38dde 100644 --- a/src/components/views/elements/EditableItemList.tsx +++ b/src/components/views/elements/EditableItemList.tsx @@ -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 React, { ChangeEvent } from "react"; +import React, { type ChangeEvent } from "react"; import { _t } from "../../../languageHandler"; import Field from "./Field"; -import AccessibleButton, { ButtonEvent } from "./AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "./AccessibleButton"; interface IItemProps { index: number; diff --git a/src/components/views/elements/EffectsOverlay.tsx b/src/components/views/elements/EffectsOverlay.tsx index 746a135390..1cbba9407f 100644 --- a/src/components/views/elements/EffectsOverlay.tsx +++ b/src/components/views/elements/EffectsOverlay.tsx @@ -6,12 +6,12 @@ Copyright 2020 Nordeck IT + Consulting GmbH. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import React, { FunctionComponent, useEffect, useRef } from "react"; +import React, { type FunctionComponent, useEffect, useRef } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import dis from "../../../dispatcher/dispatcher"; -import ICanvasEffect from "../../../effects/ICanvasEffect"; +import type ICanvasEffect from "../../../effects/ICanvasEffect"; import { CHAT_EFFECTS } from "../../../effects"; import UIStore, { UI_EVENTS } from "../../../stores/UIStore"; diff --git a/src/components/views/elements/ErrorBoundary.tsx b/src/components/views/elements/ErrorBoundary.tsx index 6ea625cec0..09b81f7ea3 100644 --- a/src/components/views/elements/ErrorBoundary.tsx +++ b/src/components/views/elements/ErrorBoundary.tsx @@ -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 React, { ErrorInfo, ReactNode } from "react"; +import React, { type ErrorInfo, type ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/elements/EventListSummary.tsx b/src/components/views/elements/EventListSummary.tsx index 79d89aed0d..7e6ea442e3 100644 --- a/src/components/views/elements/EventListSummary.tsx +++ b/src/components/views/elements/EventListSummary.tsx @@ -8,8 +8,8 @@ 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, { ComponentProps, ReactNode } from "react"; -import { EventType, MatrixEvent, MatrixEventEvent, RoomMember } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentProps, type ReactNode } from "react"; +import { EventType, type MatrixEvent, MatrixEventEvent, type RoomMember } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { throttle } from "lodash"; diff --git a/src/components/views/elements/EventTilePreview.tsx b/src/components/views/elements/EventTilePreview.tsx index dc276858bd..02f28fd9dc 100644 --- a/src/components/views/elements/EventTilePreview.tsx +++ b/src/components/views/elements/EventTilePreview.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classnames from "classnames"; -import { MatrixEvent, RoomMember, MsgType } from "matrix-js-sdk/src/matrix"; +import { MatrixEvent, type RoomMember, MsgType } from "matrix-js-sdk/src/matrix"; import * as Avatar from "../../../Avatar"; import EventTile from "../rooms/EventTile"; diff --git a/src/components/views/elements/ExternalLink.tsx b/src/components/views/elements/ExternalLink.tsx index 8c30f6e2bd..0e3856e132 100644 --- a/src/components/views/elements/ExternalLink.tsx +++ b/src/components/views/elements/ExternalLink.tsx @@ -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 React, { DetailedHTMLProps, AnchorHTMLAttributes } from "react"; +import React, { type DetailedHTMLProps, type AnchorHTMLAttributes } from "react"; import classNames from "classnames"; interface Props extends DetailedHTMLProps, HTMLAnchorElement> {} diff --git a/src/components/views/elements/FacePile.tsx b/src/components/views/elements/FacePile.tsx index 5eecd9a3ba..f2c04ee116 100644 --- a/src/components/views/elements/FacePile.tsx +++ b/src/components/views/elements/FacePile.tsx @@ -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, { FC, HTMLAttributes, ReactNode } from "react"; -import { RoomMember } from "matrix-js-sdk/src/matrix"; +import React, { type FC, type HTMLAttributes, type ReactNode } from "react"; +import { type RoomMember } from "matrix-js-sdk/src/matrix"; import { AvatarStack, Tooltip } from "@vector-im/compound-web"; import classNames from "classnames"; import MemberAvatar from "../avatars/MemberAvatar"; -import AccessibleButton, { ButtonEvent } from "./AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "./AccessibleButton"; import { useToggled } from "../rooms/RoomHeader/toggle/useToggled"; import { RightPanelPhases } from "../../../stores/right-panel/RightPanelStorePhases"; diff --git a/src/components/views/elements/Field.tsx b/src/components/views/elements/Field.tsx index ea41582d62..7d8a603562 100644 --- a/src/components/views/elements/Field.tsx +++ b/src/components/views/elements/Field.tsx @@ -6,21 +6,21 @@ Please see LICENSE files in the repository root for full details. */ import React, { - InputHTMLAttributes, - SelectHTMLAttributes, - TextareaHTMLAttributes, - RefObject, + type InputHTMLAttributes, + type SelectHTMLAttributes, + type TextareaHTMLAttributes, + type RefObject, createRef, - ComponentProps, - MutableRefObject, - RefCallback, - Ref, + type ComponentProps, + type MutableRefObject, + type RefCallback, + type Ref, } from "react"; import classNames from "classnames"; import { debounce } from "lodash"; import { Tooltip } from "@vector-im/compound-web"; -import { IFieldState, IValidationResult } from "./Validation"; +import { type IFieldState, type IValidationResult } from "./Validation"; // Invoke validation from user input (when typing, etc.) at most once every N ms. const VALIDATION_THROTTLE_MS = 200; diff --git a/src/components/views/elements/FilterDropdown.tsx b/src/components/views/elements/FilterDropdown.tsx index 63e0fca243..44be6c4372 100644 --- a/src/components/views/elements/FilterDropdown.tsx +++ b/src/components/views/elements/FilterDropdown.tsx @@ -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 React, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; import classNames from "classnames"; import CheckmarkIcon from "@vector-im/compound-design-tokens/assets/web/icons/check"; -import Dropdown, { DropdownProps } from "./Dropdown"; -import { NonEmptyArray } from "../../../@types/common"; +import Dropdown, { type DropdownProps } from "./Dropdown"; +import { type NonEmptyArray } from "../../../@types/common"; export type FilterDropdownOption = { id: FilterKeysType; diff --git a/src/components/views/elements/FilterTabGroup.tsx b/src/components/views/elements/FilterTabGroup.tsx index b63d96bdd3..b26ef81bb6 100644 --- a/src/components/views/elements/FilterTabGroup.tsx +++ b/src/components/views/elements/FilterTabGroup.tsx @@ -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 React, { FieldsetHTMLAttributes, ReactNode } from "react"; +import React, { type FieldsetHTMLAttributes, type ReactNode } from "react"; export type FilterTab = { label: string | ReactNode; diff --git a/src/components/views/elements/GenericEventListSummary.tsx b/src/components/views/elements/GenericEventListSummary.tsx index 11da97f76b..3a6e377ba1 100644 --- a/src/components/views/elements/GenericEventListSummary.tsx +++ b/src/components/views/elements/GenericEventListSummary.tsx @@ -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, { ReactNode, useEffect } from "react"; +import React, { type ReactNode, useEffect } from "react"; import { uniqBy } from "lodash"; -import { MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type RoomMember } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import MemberAvatar from "../avatars/MemberAvatar"; diff --git a/src/components/views/elements/IRCTimelineProfileResizer.tsx b/src/components/views/elements/IRCTimelineProfileResizer.tsx index 625ea2cb53..90a86ab258 100644 --- a/src/components/views/elements/IRCTimelineProfileResizer.tsx +++ b/src/components/views/elements/IRCTimelineProfileResizer.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import SettingsStore from "../../../settings/SettingsStore"; -import Draggable, { ILocationState } from "./Draggable"; +import Draggable, { type ILocationState } from "./Draggable"; import { SettingLevel } from "../../../settings/SettingLevel"; interface IProps { diff --git a/src/components/views/elements/ImageView.tsx b/src/components/views/elements/ImageView.tsx index 3a3006edc5..394eb2f38a 100644 --- a/src/components/views/elements/ImageView.tsx +++ b/src/components/views/elements/ImageView.tsx @@ -8,9 +8,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, { createRef, CSSProperties, useRef, useState } from "react"; +import React, { createRef, type CSSProperties, useRef, useState } from "react"; import FocusLock from "react-focus-lock"; -import { MatrixEvent, parseErrorResponse } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, parseErrorResponse } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import MemberAvatar from "../avatars/MemberAvatar"; @@ -22,10 +22,10 @@ import SettingsStore from "../../../settings/SettingsStore"; import { formatFullDate } from "../../../DateUtils"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { normalizeWheelEvent } from "../../../utils/Mouse"; import UIStore from "../../../stores/UIStore"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { presentableTextForFile } from "../../../utils/FileUtils"; diff --git a/src/components/views/elements/InfoTooltip.tsx b/src/components/views/elements/InfoTooltip.tsx index 7d62b81cb3..5600fbbbb2 100644 --- a/src/components/views/elements/InfoTooltip.tsx +++ b/src/components/views/elements/InfoTooltip.tsx @@ -7,7 +7,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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import classNames from "classnames"; import { Tooltip } from "@vector-im/compound-web"; diff --git a/src/components/views/elements/JoinRuleDropdown.tsx b/src/components/views/elements/JoinRuleDropdown.tsx index 7e678b02e6..cded54ffd6 100644 --- a/src/components/views/elements/JoinRuleDropdown.tsx +++ b/src/components/views/elements/JoinRuleDropdown.tsx @@ -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 React, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; import { JoinRule } from "matrix-js-sdk/src/matrix"; import Dropdown from "./Dropdown"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; import { Icon as AskToJoinIcon } from "../../../../res/img/element-icons/ask-to-join.svg"; interface IProps { diff --git a/src/components/views/elements/LanguageDropdown.tsx b/src/components/views/elements/LanguageDropdown.tsx index 743e0df1f7..c4a72c4f4f 100644 --- a/src/components/views/elements/LanguageDropdown.tsx +++ b/src/components/views/elements/LanguageDropdown.tsx @@ -7,7 +7,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 React, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; import classNames from "classnames"; import * as languageHandler from "../../../languageHandler"; @@ -15,7 +15,7 @@ import SettingsStore from "../../../settings/SettingsStore"; import { _t } from "../../../languageHandler"; import Spinner from "./Spinner"; import Dropdown from "./Dropdown"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; type Languages = Awaited>; diff --git a/src/components/views/elements/LearnMore.tsx b/src/components/views/elements/LearnMore.tsx index ac7ec09954..7e61bcc789 100644 --- a/src/components/views/elements/LearnMore.tsx +++ b/src/components/views/elements/LearnMore.tsx @@ -11,7 +11,7 @@ import React from "react"; import { _t } from "../../../languageHandler"; import Modal from "../../../Modal"; import InfoDialog from "../dialogs/InfoDialog"; -import AccessibleButton, { ButtonProps } from "./AccessibleButton"; +import AccessibleButton, { type ButtonProps } from "./AccessibleButton"; type Props = Omit, "element" | "kind" | "onClick" | "className"> & { title: string; diff --git a/src/components/views/elements/Measured.tsx b/src/components/views/elements/Measured.tsx index 5f0d3acca8..f058761ecb 100644 --- a/src/components/views/elements/Measured.tsx +++ b/src/components/views/elements/Measured.tsx @@ -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 React, { RefObject } from "react"; +import React, { type RefObject } from "react"; import UIStore, { UI_EVENTS } from "../../../stores/UIStore"; diff --git a/src/components/views/elements/MiniAvatarUploader.tsx b/src/components/views/elements/MiniAvatarUploader.tsx index f5e22ecfab..a6328816ed 100644 --- a/src/components/views/elements/MiniAvatarUploader.tsx +++ b/src/components/views/elements/MiniAvatarUploader.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import classNames from "classnames"; import { EventType } from "matrix-js-sdk/src/matrix"; -import React, { useContext, useRef, useState, MouseEvent, ReactNode } from "react"; +import React, { useContext, useRef, useState, type MouseEvent, type ReactNode } from "react"; import { Tooltip } from "@vector-im/compound-web"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; diff --git a/src/components/views/elements/PersistedElement.tsx b/src/components/views/elements/PersistedElement.tsx index 410b96d037..70180012d9 100644 --- a/src/components/views/elements/PersistedElement.tsx +++ b/src/components/views/elements/PersistedElement.tsx @@ -5,15 +5,15 @@ 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, { MutableRefObject, ReactNode, StrictMode } from "react"; -import { createRoot, Root } from "react-dom/client"; +import React, { type MutableRefObject, type ReactNode, StrictMode } from "react"; +import { createRoot, type Root } from "react-dom/client"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { TooltipProvider } from "@vector-im/compound-web"; import dis from "../../../dispatcher/dispatcher"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; export const getPersistKey = (appId: string): string => "widget_" + appId; diff --git a/src/components/views/elements/PersistentApp.tsx b/src/components/views/elements/PersistentApp.tsx index bd49b32dff..60f64a721b 100644 --- a/src/components/views/elements/PersistentApp.tsx +++ b/src/components/views/elements/PersistentApp.tsx @@ -7,8 +7,8 @@ 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, { ContextType, CSSProperties, MutableRefObject, ReactNode } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { type ContextType, type CSSProperties, type MutableRefObject, type ReactNode } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import WidgetUtils from "../../../utils/WidgetUtils"; import AppTile from "./AppTile"; diff --git a/src/components/views/elements/Pill.tsx b/src/components/views/elements/Pill.tsx index df0c6cab51..e52bd6bff4 100644 --- a/src/components/views/elements/Pill.tsx +++ b/src/components/views/elements/Pill.tsx @@ -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"; import classNames from "classnames"; -import { Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type Room, type RoomMember } from "matrix-js-sdk/src/matrix"; import { Tooltip } from "@vector-im/compound-web"; import { LinkIcon, UserSolidIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; diff --git a/src/components/views/elements/PollCreateDialog.tsx b/src/components/views/elements/PollCreateDialog.tsx index 37139ec0d0..8e23074ca5 100644 --- a/src/components/views/elements/PollCreateDialog.tsx +++ b/src/components/views/elements/PollCreateDialog.tsx @@ -6,20 +6,20 @@ 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, { ChangeEvent, createRef } from "react"; +import React, { type ChangeEvent, createRef } from "react"; import { - Room, - MatrixEvent, - KnownPollKind, + type Room, + type MatrixEvent, + type KnownPollKind, M_POLL_KIND_DISCLOSED, M_POLL_KIND_UNDISCLOSED, M_POLL_START, - IPartialEvent, - TimelineEvents, + type IPartialEvent, + type TimelineEvents, } from "matrix-js-sdk/src/matrix"; import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; -import ScrollableBaseModal, { IScrollableBaseState } from "../dialogs/ScrollableBaseModal"; +import ScrollableBaseModal, { type IScrollableBaseState } from "../dialogs/ScrollableBaseModal"; import QuestionDialog from "../dialogs/QuestionDialog"; import Modal from "../../../Modal"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/elements/QRCode.tsx b/src/components/views/elements/QRCode.tsx index a60d5e6625..805774ba52 100644 --- a/src/components/views/elements/QRCode.tsx +++ b/src/components/views/elements/QRCode.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import * as React from "react"; -import { toDataURL, QRCodeSegment, QRCodeToDataURLOptions, QRCodeRenderersOptions } from "qrcode"; +import { toDataURL, type QRCodeSegment, type QRCodeToDataURLOptions, type QRCodeRenderersOptions } from "qrcode"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/elements/ReplyChain.tsx b/src/components/views/elements/ReplyChain.tsx index d2b9cf079f..ca51d0fd04 100644 --- a/src/components/views/elements/ReplyChain.tsx +++ b/src/components/views/elements/ReplyChain.tsx @@ -9,13 +9,13 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; -import { MatrixEvent, Room, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type Room, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; -import { makeUserPermalink, RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { makeUserPermalink, type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import SettingsStore from "../../../settings/SettingsStore"; -import { Layout } from "../../../settings/enums/Layout"; +import { type Layout } from "../../../settings/enums/Layout"; import { getUserNameColorClass } from "../../../utils/FormattingUtils"; import { Action } from "../../../dispatcher/actions"; import Spinner from "./Spinner"; @@ -25,7 +25,7 @@ import AccessibleButton from "./AccessibleButton"; import { getParentEventId, shouldDisplayReply } from "../../../utils/Reply"; import RoomContext from "../../../contexts/RoomContext"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import { GetRelationsForEvent } from "../rooms/EventTile"; +import { type GetRelationsForEvent } from "../rooms/EventTile"; /** * This number is based on the previous behavior - if we have message of height diff --git a/src/components/views/elements/RoomAliasField.tsx b/src/components/views/elements/RoomAliasField.tsx index e87d26a340..fe0e9c412f 100644 --- a/src/components/views/elements/RoomAliasField.tsx +++ b/src/components/views/elements/RoomAliasField.tsx @@ -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 React, { createRef, KeyboardEventHandler } from "react"; +import React, { createRef, type KeyboardEventHandler } from "react"; import { MatrixError } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; -import withValidation, { IFieldState, IValidationResult } from "./Validation"; -import Field, { IValidateOpts } from "./Field"; +import withValidation, { type IFieldState, type IValidationResult } from "./Validation"; +import Field, { type IValidateOpts } from "./Field"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; interface IProps { diff --git a/src/components/views/elements/RoomFacePile.tsx b/src/components/views/elements/RoomFacePile.tsx index 9b65fb98ae..75b1c665d8 100644 --- a/src/components/views/elements/RoomFacePile.tsx +++ b/src/components/views/elements/RoomFacePile.tsx @@ -6,8 +6,8 @@ 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, { FC, HTMLAttributes, useContext } from "react"; -import { Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import React, { type FC, type HTMLAttributes, useContext } from "react"; +import { type Room, type RoomMember } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { sortBy } from "lodash"; @@ -16,7 +16,7 @@ import DMRoomMap from "../../../utils/DMRoomMap"; import FacePile from "./FacePile"; import { useRoomMembers } from "../../../hooks/useRoomMembers"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; -import { ButtonEvent } from "./AccessibleButton"; +import { type ButtonEvent } from "./AccessibleButton"; const DEFAULT_NUM_FACES = 5; diff --git a/src/components/views/elements/RoomName.tsx b/src/components/views/elements/RoomName.tsx index 9228a71cf0..a475f2107a 100644 --- a/src/components/views/elements/RoomName.tsx +++ b/src/components/views/elements/RoomName.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useEffect, useState } from "react"; -import { Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; import { useTypedEventEmitter } from "../../../hooks/useEventEmitter"; diff --git a/src/components/views/elements/RoomTopic.tsx b/src/components/views/elements/RoomTopic.tsx index 4e71a65c4d..41dea7674c 100644 --- a/src/components/views/elements/RoomTopic.tsx +++ b/src/components/views/elements/RoomTopic.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useCallback, useContext, useState } from "react"; -import { Room, EventType } from "matrix-js-sdk/src/matrix"; +import { type Room, EventType } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import { Tooltip } from "@vector-im/compound-web"; diff --git a/src/components/views/elements/SSOButtons.tsx b/src/components/views/elements/SSOButtons.tsx index 39355b1889..f1b5264979 100644 --- a/src/components/views/elements/SSOButtons.tsx +++ b/src/components/views/elements/SSOButtons.tsx @@ -10,14 +10,14 @@ import React from "react"; import { chunk } from "lodash"; import classNames from "classnames"; import { - MatrixClient, + type MatrixClient, IdentityProviderBrand, - SSOFlow, - SSOAction, - IIdentityProvider, + type SSOFlow, + type SSOAction, + type IIdentityProvider, DELEGATED_OIDC_COMPATIBILITY, } from "matrix-js-sdk/src/matrix"; -import { Signup } from "@matrix-org/analytics-events/types/typescript/Signup"; +import { type Signup } from "@matrix-org/analytics-events/types/typescript/Signup"; import PlatformPeg from "../../../PlatformPeg"; import AccessibleButton from "./AccessibleButton"; diff --git a/src/components/views/elements/SearchWarning.tsx b/src/components/views/elements/SearchWarning.tsx index 6c6c4d82b1..197dd94662 100644 --- a/src/components/views/elements/SearchWarning.tsx +++ b/src/components/views/elements/SearchWarning.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import EventIndexPeg from "../../../indexing/EventIndexPeg"; @@ -15,7 +15,7 @@ import SdkConfig from "../../../SdkConfig"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; import { UserTab } from "../dialogs/UserTab"; -import AccessibleButton, { ButtonEvent } from "./AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "./AccessibleButton"; export enum WarningKind { Files, diff --git a/src/components/views/elements/ServerPicker.tsx b/src/components/views/elements/ServerPicker.tsx index b433aa5150..6740534711 100644 --- a/src/components/views/elements/ServerPicker.tsx +++ b/src/components/views/elements/ServerPicker.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import AccessibleButton from "./AccessibleButton"; -import { ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; +import { type ValidatedServerConfig } from "../../../utils/ValidatedServerConfig"; import { _t } from "../../../languageHandler"; import TextWithTooltip from "./TextWithTooltip"; import SdkConfig from "../../../SdkConfig"; diff --git a/src/components/views/elements/SettingsFlag.tsx b/src/components/views/elements/SettingsFlag.tsx index 357fa5c971..d7fac91875 100644 --- a/src/components/views/elements/SettingsFlag.tsx +++ b/src/components/views/elements/SettingsFlag.tsx @@ -14,8 +14,8 @@ import SettingsStore from "../../../settings/SettingsStore"; import { _t } from "../../../languageHandler"; import ToggleSwitch from "./ToggleSwitch"; import StyledCheckbox from "./StyledCheckbox"; -import { SettingLevel } from "../../../settings/SettingLevel"; -import { BooleanSettingKey, defaultWatchManager } from "../../../settings/Settings"; +import { type SettingLevel } from "../../../settings/SettingLevel"; +import { type BooleanSettingKey, defaultWatchManager } from "../../../settings/Settings"; interface IProps { // The setting must be a boolean diff --git a/src/components/views/elements/SpellCheckLanguagesDropdown.tsx b/src/components/views/elements/SpellCheckLanguagesDropdown.tsx index 9d250831ff..a267999f5b 100644 --- a/src/components/views/elements/SpellCheckLanguagesDropdown.tsx +++ b/src/components/views/elements/SpellCheckLanguagesDropdown.tsx @@ -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 React, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; import Dropdown from "../../views/elements/Dropdown"; import PlatformPeg from "../../../PlatformPeg"; import SettingsStore from "../../../settings/SettingsStore"; import { _t, getUserLanguage } from "../../../languageHandler"; import Spinner from "./Spinner"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; type Languages = { value: string; diff --git a/src/components/views/elements/StyledCheckbox.tsx b/src/components/views/elements/StyledCheckbox.tsx index 2445859341..b164d825ba 100644 --- a/src/components/views/elements/StyledCheckbox.tsx +++ b/src/components/views/elements/StyledCheckbox.tsx @@ -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 React, { Ref } from "react"; +import React, { type Ref } from "react"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; import classnames from "classnames"; diff --git a/src/components/views/elements/StyledRadioButton.tsx b/src/components/views/elements/StyledRadioButton.tsx index caf40c7f1a..54bee73b4a 100644 --- a/src/components/views/elements/StyledRadioButton.tsx +++ b/src/components/views/elements/StyledRadioButton.tsx @@ -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 React, { Ref } from "react"; +import React, { type Ref } from "react"; import classnames from "classnames"; interface IProps extends React.InputHTMLAttributes { diff --git a/src/components/views/elements/StyledRadioGroup.tsx b/src/components/views/elements/StyledRadioGroup.tsx index b93a697bfb..d66b602101 100644 --- a/src/components/views/elements/StyledRadioGroup.tsx +++ b/src/components/views/elements/StyledRadioGroup.tsx @@ -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 React, { ChangeEvent, ReactNode } from "react"; +import React, { type ChangeEvent, type ReactNode } from "react"; import classNames from "classnames"; import StyledRadioButton from "./StyledRadioButton"; diff --git a/src/components/views/elements/Tag.tsx b/src/components/views/elements/Tag.tsx index 0c1676794e..bfff4baeff 100644 --- a/src/components/views/elements/Tag.tsx +++ b/src/components/views/elements/Tag.tsx @@ -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 React, { DetailedHTMLProps, HTMLAttributes } from "react"; +import React, { type DetailedHTMLProps, type HTMLAttributes } from "react"; import CloseIcon from "@vector-im/compound-design-tokens/assets/web/icons/close"; import AccessibleButton from "./AccessibleButton"; diff --git a/src/components/views/elements/TagComposer.tsx b/src/components/views/elements/TagComposer.tsx index 55071964bc..f20bf27253 100644 --- a/src/components/views/elements/TagComposer.tsx +++ b/src/components/views/elements/TagComposer.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { ChangeEvent, FormEvent } from "react"; +import React, { type ChangeEvent, type FormEvent } from "react"; import Field from "./Field"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/elements/TextWithTooltip.tsx b/src/components/views/elements/TextWithTooltip.tsx index 42d436ced4..445d1338e9 100644 --- a/src/components/views/elements/TextWithTooltip.tsx +++ b/src/components/views/elements/TextWithTooltip.tsx @@ -5,7 +5,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 React, { HTMLAttributes } from "react"; +import React, { type HTMLAttributes } from "react"; import { Tooltip } from "@vector-im/compound-web"; interface IProps extends HTMLAttributes { diff --git a/src/components/views/elements/TruncatedList.tsx b/src/components/views/elements/TruncatedList.tsx index 8e7abc1104..b3102bcc3c 100644 --- a/src/components/views/elements/TruncatedList.tsx +++ b/src/components/views/elements/TruncatedList.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/elements/Validation.tsx b/src/components/views/elements/Validation.tsx index 2420945c6e..3396b57413 100644 --- a/src/components/views/elements/Validation.tsx +++ b/src/components/views/elements/Validation.tsx @@ -7,7 +7,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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import classNames from "classnames"; import memoizeOne from "memoize-one"; diff --git a/src/components/views/emojipicker/Category.tsx b/src/components/views/emojipicker/Category.tsx index 397778e0af..da83c50222 100644 --- a/src/components/views/emojipicker/Category.tsx +++ b/src/components/views/emojipicker/Category.tsx @@ -7,13 +7,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, { RefObject } from "react"; -import { DATA_BY_CATEGORY, Emoji as IEmoji } from "@matrix-org/emojibase-bindings"; +import React, { type RefObject } from "react"; +import { type DATA_BY_CATEGORY, type Emoji as IEmoji } from "@matrix-org/emojibase-bindings"; import { CATEGORY_HEADER_HEIGHT, EMOJI_HEIGHT, EMOJIS_PER_ROW } from "./EmojiPicker"; import LazyRenderList from "../elements/LazyRenderList"; import Emoji from "./Emoji"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; const OVERFLOW_ROWS = 3; diff --git a/src/components/views/emojipicker/Emoji.tsx b/src/components/views/emojipicker/Emoji.tsx index 3b74947f04..26d15d4dc6 100644 --- a/src/components/views/emojipicker/Emoji.tsx +++ b/src/components/views/emojipicker/Emoji.tsx @@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Emoji as IEmoji } from "@matrix-org/emojibase-bindings"; +import { type Emoji as IEmoji } from "@matrix-org/emojibase-bindings"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import { RovingAccessibleButton } from "../../../accessibility/RovingTabIndex"; interface IProps { diff --git a/src/components/views/emojipicker/EmojiPicker.tsx b/src/components/views/emojipicker/EmojiPicker.tsx index 0c10d778a6..71659d579b 100644 --- a/src/components/views/emojipicker/EmojiPicker.tsx +++ b/src/components/views/emojipicker/EmojiPicker.tsx @@ -7,8 +7,8 @@ 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, { Dispatch } from "react"; -import { DATA_BY_CATEGORY, getEmojiFromUnicode, Emoji as IEmoji } from "@matrix-org/emojibase-bindings"; +import React, { type Dispatch } from "react"; +import { DATA_BY_CATEGORY, getEmojiFromUnicode, type Emoji as IEmoji } from "@matrix-org/emojibase-bindings"; import { _t } from "../../../languageHandler"; import * as recent from "../../../emojipicker/recent"; @@ -17,17 +17,17 @@ import Header from "./Header"; import Search from "./Search"; import Preview from "./Preview"; import QuickReactions from "./QuickReactions"; -import Category, { CategoryKey, ICategory } from "./Category"; +import Category, { type CategoryKey, type ICategory } from "./Category"; import { filterBoolean } from "../../../utils/arrays"; import { - IAction as RovingAction, - IState as RovingState, + type IAction as RovingAction, + type IState as RovingState, RovingTabIndexProvider, Type, } from "../../../accessibility/RovingTabIndex"; import { Key } from "../../../Keyboard"; import { clamp } from "../../../utils/numbers"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; export const CATEGORY_HEADER_HEIGHT = 20; export const EMOJI_HEIGHT = 35; diff --git a/src/components/views/emojipicker/Header.tsx b/src/components/views/emojipicker/Header.tsx index 53607e2861..985882bd7b 100644 --- a/src/components/views/emojipicker/Header.tsx +++ b/src/components/views/emojipicker/Header.tsx @@ -12,7 +12,7 @@ import classNames from "classnames"; import { findLastIndex } from "lodash"; import { _t } from "../../../languageHandler"; -import { CategoryKey, ICategory } from "./Category"; +import { type CategoryKey, type ICategory } from "./Category"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; diff --git a/src/components/views/emojipicker/Preview.tsx b/src/components/views/emojipicker/Preview.tsx index a511251028..d8d2fe9942 100644 --- a/src/components/views/emojipicker/Preview.tsx +++ b/src/components/views/emojipicker/Preview.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Emoji } from "@matrix-org/emojibase-bindings"; +import { type Emoji } from "@matrix-org/emojibase-bindings"; interface IProps { emoji: Emoji; diff --git a/src/components/views/emojipicker/QuickReactions.tsx b/src/components/views/emojipicker/QuickReactions.tsx index 7a8511f997..a814a6b206 100644 --- a/src/components/views/emojipicker/QuickReactions.tsx +++ b/src/components/views/emojipicker/QuickReactions.tsx @@ -8,11 +8,11 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { getEmojiFromUnicode, Emoji as IEmoji } from "@matrix-org/emojibase-bindings"; +import { getEmojiFromUnicode, type Emoji as IEmoji } from "@matrix-org/emojibase-bindings"; import { _t } from "../../../languageHandler"; import Emoji from "./Emoji"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import Toolbar from "../../../accessibility/Toolbar"; // We use the variation-selector Heart in Quick Reactions for some reason diff --git a/src/components/views/emojipicker/ReactionPicker.tsx b/src/components/views/emojipicker/ReactionPicker.tsx index ea1a502942..8509b4014a 100644 --- a/src/components/views/emojipicker/ReactionPicker.tsx +++ b/src/components/views/emojipicker/ReactionPicker.tsx @@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, EventType, RelationType, Relations, RelationsEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, EventType, RelationType, type Relations, RelationsEvent } from "matrix-js-sdk/src/matrix"; import EmojiPicker from "./EmojiPicker"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; import RoomContext from "../../../contexts/RoomContext"; -import { FocusComposerPayload } from "../../../dispatcher/payloads/FocusComposerPayload"; +import { type FocusComposerPayload } from "../../../dispatcher/payloads/FocusComposerPayload"; interface IProps { mxEvent: MatrixEvent; diff --git a/src/components/views/location/LiveDurationDropdown.tsx b/src/components/views/location/LiveDurationDropdown.tsx index 1bdf93a8e6..31b8898cb5 100644 --- a/src/components/views/location/LiveDurationDropdown.tsx +++ b/src/components/views/location/LiveDurationDropdown.tsx @@ -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 React, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; import { formatDuration } from "../../../DateUtils"; import { _t } from "../../../languageHandler"; import Dropdown from "../elements/Dropdown"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; const DURATION_MS = { fifteenMins: 900000, diff --git a/src/components/views/location/LocationButton.tsx b/src/components/views/location/LocationButton.tsx index 3a4460bec4..e84ce37ec5 100644 --- a/src/components/views/location/LocationButton.tsx +++ b/src/components/views/location/LocationButton.tsx @@ -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, { ReactNode, SyntheticEvent, useContext } from "react"; +import React, { type ReactNode, type SyntheticEvent, useContext } from "react"; import classNames from "classnames"; -import { RoomMember, IEventRelation } from "matrix-js-sdk/src/matrix"; +import { type RoomMember, type IEventRelation } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import { CollapsibleButton } from "../rooms/CollapsibleButton"; -import { aboveLeftOf, useContextMenu, MenuProps } from "../../structures/ContextMenu"; +import { aboveLeftOf, useContextMenu, type MenuProps } from "../../structures/ContextMenu"; import { OverflowMenuContext } from "../rooms/MessageComposerButtons"; import LocationShareMenu from "./LocationShareMenu"; diff --git a/src/components/views/location/LocationPicker.tsx b/src/components/views/location/LocationPicker.tsx index fe0838c166..52762b5fe9 100644 --- a/src/components/views/location/LocationPicker.tsx +++ b/src/components/views/location/LocationPicker.tsx @@ -6,22 +6,22 @@ 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, { SyntheticEvent } from "react"; -import maplibregl, { MapMouseEvent } from "maplibre-gl"; +import React, { type SyntheticEvent } from "react"; +import maplibregl, { type MapMouseEvent } from "maplibre-gl"; import { logger } from "matrix-js-sdk/src/logger"; -import { RoomMember, ClientEvent, IClientWellKnown } from "matrix-js-sdk/src/matrix"; +import { type RoomMember, ClientEvent, type IClientWellKnown } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import Modal from "../../../Modal"; import { tileServerFromWellKnown } from "../../../utils/WellKnownUtils"; -import { GenericPosition, genericPositionFromGeolocation, getGeoUri } from "../../../utils/beacon"; +import { type GenericPosition, genericPositionFromGeolocation, getGeoUri } from "../../../utils/beacon"; import { LocationShareError, findMapStyleUrl, positionFailureMessage } from "../../../utils/location"; import ErrorDialog from "../dialogs/ErrorDialog"; import AccessibleButton from "../elements/AccessibleButton"; import { MapError } from "./MapError"; import LiveDurationDropdown, { DEFAULT_DURATION_MS } from "./LiveDurationDropdown"; -import { LocationShareType, ShareLocationFn } from "./shareLocation"; +import { LocationShareType, type ShareLocationFn } from "./shareLocation"; import Marker from "./Marker"; export interface ILocationPickerProps { diff --git a/src/components/views/location/LocationShareMenu.tsx b/src/components/views/location/LocationShareMenu.tsx index 546ab4f373..453ad33cea 100644 --- a/src/components/views/location/LocationShareMenu.tsx +++ b/src/components/views/location/LocationShareMenu.tsx @@ -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 React, { SyntheticEvent, useContext, useState } from "react"; -import { Room, IEventRelation } from "matrix-js-sdk/src/matrix"; +import React, { type SyntheticEvent, useContext, useState } from "react"; +import { type Room, type IEventRelation } from "matrix-js-sdk/src/matrix"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; -import ContextMenu, { MenuProps } from "../../structures/ContextMenu"; -import LocationPicker, { ILocationPickerProps } from "./LocationPicker"; +import ContextMenu, { type MenuProps } from "../../structures/ContextMenu"; +import LocationPicker, { type ILocationPickerProps } from "./LocationPicker"; import { shareLiveLocation, shareLocation, LocationShareType } from "./shareLocation"; import SettingsStore from "../../../settings/SettingsStore"; import ShareDialogButtons from "./ShareDialogButtons"; diff --git a/src/components/views/location/LocationViewDialog.tsx b/src/components/views/location/LocationViewDialog.tsx index d35f0b75e2..ad975a0100 100644 --- a/src/components/views/location/LocationViewDialog.tsx +++ b/src/components/views/location/LocationViewDialog.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import BaseDialog from "../dialogs/BaseDialog"; import { locationEventGeoUri, isSelfLocation } from "../../../utils/location"; diff --git a/src/components/views/location/Map.tsx b/src/components/views/location/Map.tsx index 3af8b79579..998dff1d15 100644 --- a/src/components/views/location/Map.tsx +++ b/src/components/views/location/Map.tsx @@ -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 React, { ReactNode, useContext, useEffect, useState } from "react"; +import React, { type ReactNode, useContext, useEffect, useState } from "react"; import classNames from "classnames"; import * as maplibregl from "maplibre-gl"; -import { ClientEvent, IClientWellKnown } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type IClientWellKnown } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; @@ -17,7 +17,7 @@ import { useEventEmitterState } from "../../../hooks/useEventEmitter"; import { parseGeoUri, positionFailureMessage } from "../../../utils/location"; import { tileServerFromWellKnown } from "../../../utils/WellKnownUtils"; import { useMap } from "../../../utils/location/useMap"; -import { Bounds } from "../../../utils/beacon/bounds"; +import { type Bounds } from "../../../utils/beacon/bounds"; import Modal from "../../../Modal"; import ErrorDialog from "../dialogs/ErrorDialog"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/location/MapError.tsx b/src/components/views/location/MapError.tsx index 93c7dab406..e2059f9cd1 100644 --- a/src/components/views/location/MapError.tsx +++ b/src/components/views/location/MapError.tsx @@ -11,7 +11,7 @@ import classNames from "classnames"; import { ErrorIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { _t } from "../../../languageHandler"; -import { getLocationShareErrorMessage, LocationShareError } from "../../../utils/location"; +import { getLocationShareErrorMessage, type LocationShareError } from "../../../utils/location"; import AccessibleButton from "../elements/AccessibleButton"; import Heading from "../typography/Heading"; diff --git a/src/components/views/location/Marker.tsx b/src/components/views/location/Marker.tsx index 13239240f1..13faa8cb68 100644 --- a/src/components/views/location/Marker.tsx +++ b/src/components/views/location/Marker.tsx @@ -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, { ReactNode, useState } from "react"; +import React, { type ReactNode, useState } from "react"; import classNames from "classnames"; -import { RoomMember } from "matrix-js-sdk/src/matrix"; +import { type RoomMember } from "matrix-js-sdk/src/matrix"; import LocationIcon from "@vector-im/compound-design-tokens/assets/web/icons/location-pin-solid"; import { getUserNameColorClass } from "../../../utils/FormattingUtils"; diff --git a/src/components/views/location/ShareType.tsx b/src/components/views/location/ShareType.tsx index 923cd26572..3e1585af47 100644 --- a/src/components/views/location/ShareType.tsx +++ b/src/components/views/location/ShareType.tsx @@ -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 React, { HTMLAttributes, useContext } from "react"; +import React, { type HTMLAttributes, useContext } from "react"; import LocationIcon from "@vector-im/compound-design-tokens/assets/web/icons/location-pin-solid"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { _t } from "../../../languageHandler"; import { OwnProfileStore } from "../../../stores/OwnProfileStore"; import BaseAvatar from "../avatars/BaseAvatar"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import Heading from "../typography/Heading"; import { LocationShareType } from "./shareLocation"; import StyledLiveBeaconIcon from "../beacon/StyledLiveBeaconIcon"; diff --git a/src/components/views/location/SmartMarker.tsx b/src/components/views/location/SmartMarker.tsx index 4ec42468a6..31d34397d6 100644 --- a/src/components/views/location/SmartMarker.tsx +++ b/src/components/views/location/SmartMarker.tsx @@ -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 React, { ReactNode, useCallback, useEffect, useState } from "react"; -import * as maplibregl from "maplibre-gl"; -import { RoomMember } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode, useCallback, useEffect, useState } from "react"; +import { type RoomMember } from "matrix-js-sdk/src/matrix"; +import type * as maplibregl from "maplibre-gl"; import { parseGeoUri } from "../../../utils/location"; import { createMarker } from "../../../utils/location/map"; import Marker from "./Marker"; diff --git a/src/components/views/location/ZoomButtons.tsx b/src/components/views/location/ZoomButtons.tsx index 8926fa20c7..35fc4c7bb3 100644 --- a/src/components/views/location/ZoomButtons.tsx +++ b/src/components/views/location/ZoomButtons.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import * as maplibregl from "maplibre-gl"; import { PlusIcon, MinusIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; +import type * as maplibregl from "maplibre-gl"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/location/index.tsx b/src/components/views/location/index.tsx index 3f308f3812..72b73e9f86 100644 --- a/src/components/views/location/index.tsx +++ b/src/components/views/location/index.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. // Exports location components which touch maplibre-gs wrapped in React Suspense to enable code splitting -import React, { ComponentProps, lazy, Suspense } from "react"; +import React, { type ComponentProps, lazy, Suspense } from "react"; import Spinner from "../elements/Spinner"; diff --git a/src/components/views/location/shareLocation.ts b/src/components/views/location/shareLocation.ts index 5aed9ec37e..91b7dfd5dc 100644 --- a/src/components/views/location/shareLocation.ts +++ b/src/components/views/location/shareLocation.ts @@ -7,19 +7,19 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixClient, - IEventRelation, - MatrixError, + type MatrixClient, + type IEventRelation, + type MatrixError, THREAD_RELATION_TYPE, ContentHelpers, LocationAssetType, } from "matrix-js-sdk/src/matrix"; -import { RoomMessageEventContent } from "matrix-js-sdk/src/types"; +import { type RoomMessageEventContent } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import Modal from "../../../Modal"; -import QuestionDialog, { IQuestionDialogProps } from "../dialogs/QuestionDialog"; +import QuestionDialog, { type IQuestionDialogProps } from "../dialogs/QuestionDialog"; import SdkConfig from "../../../SdkConfig"; import { OwnBeaconStore } from "../../../stores/OwnBeaconStore"; import { doMaybeLocalRoomAction } from "../../../utils/local-room"; diff --git a/src/components/views/messages/CallEvent.tsx b/src/components/views/messages/CallEvent.tsx index 5d2e56c4e8..010d9f092c 100644 --- a/src/components/views/messages/CallEvent.tsx +++ b/src/components/views/messages/CallEvent.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React, { forwardRef, useCallback, useContext, useMemo } from "react"; import type { MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix"; -import { ConnectionState, ElementCall } from "../../../models/Call"; +import { ConnectionState, type ElementCall } from "../../../models/Call"; import { _t } from "../../../languageHandler"; import { useCall, @@ -20,7 +20,7 @@ import { import defaultDispatcher from "../../../dispatcher/dispatcher"; import type { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../../../dispatcher/actions"; -import AccessibleButton, { AccessibleButtonKind, ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type AccessibleButtonKind, type ButtonEvent } from "../elements/AccessibleButton"; import MemberAvatar from "../avatars/MemberAvatar"; import { LiveContentSummary, LiveContentType } from "../rooms/LiveContentSummary"; import FacePile from "../elements/FacePile"; diff --git a/src/components/views/messages/DateSeparator.tsx b/src/components/views/messages/DateSeparator.tsx index e8515b9347..635e4a8fb8 100644 --- a/src/components/views/messages/DateSeparator.tsx +++ b/src/components/views/messages/DateSeparator.tsx @@ -22,7 +22,7 @@ import { UIFeature } from "../../../settings/UIFeature"; import Modal from "../../../Modal"; import ErrorDialog from "../dialogs/ErrorDialog"; import BugReportDialog from "../dialogs/BugReportDialog"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import { contextMenuBelow } from "../rooms/RoomTile"; import { ContextMenuTooltipButton } from "../../structures/ContextMenu"; import IconizedContextMenu, { @@ -30,7 +30,7 @@ import IconizedContextMenu, { IconizedContextMenuOptionList, } from "../context_menus/IconizedContextMenu"; import JumpToDatePicker from "./JumpToDatePicker"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { SdkContextClass } from "../../../contexts/SDKContext"; import TimelineSeparator from "./TimelineSeparator"; diff --git a/src/components/views/messages/DecryptionFailureBody.tsx b/src/components/views/messages/DecryptionFailureBody.tsx index f3c02d4c0c..1158749571 100644 --- a/src/components/views/messages/DecryptionFailureBody.tsx +++ b/src/components/views/messages/DecryptionFailureBody.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { forwardRef, ForwardRefExoticComponent, useContext } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { forwardRef, type ForwardRefExoticComponent, useContext } from "react"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { DecryptionFailureCode } from "matrix-js-sdk/src/crypto-api"; import { BlockIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { _t } from "../../../languageHandler"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import { LocalDeviceVerificationStateContext } from "../../../contexts/LocalDeviceVerificationStateContext"; function getErrorMessage(mxEvent: MatrixEvent, isVerified: boolean | undefined): string | React.JSX.Element { diff --git a/src/components/views/messages/DownloadActionButton.tsx b/src/components/views/messages/DownloadActionButton.tsx index e85389f2e7..81ef8f0c6b 100644 --- a/src/components/views/messages/DownloadActionButton.tsx +++ b/src/components/views/messages/DownloadActionButton.tsx @@ -6,15 +6,15 @@ 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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import React from "react"; import classNames from "classnames"; import { DownloadIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; -import { MediaEventHelper } from "../../../utils/MediaEventHelper"; +import { type MediaEventHelper } from "../../../utils/MediaEventHelper"; import { RovingAccessibleButton } from "../../../accessibility/RovingTabIndex"; import Spinner from "../elements/Spinner"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; import { FileDownloader } from "../../../utils/FileDownloader"; import Modal from "../../../Modal"; import ErrorDialog from "../dialogs/ErrorDialog"; diff --git a/src/components/views/messages/EditHistoryMessage.tsx b/src/components/views/messages/EditHistoryMessage.tsx index 1e6333807d..c7470e2b50 100644 --- a/src/components/views/messages/EditHistoryMessage.tsx +++ b/src/components/views/messages/EditHistoryMessage.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { EventStatus, IContent, MatrixEvent, MatrixEventEvent, MsgType } from "matrix-js-sdk/src/matrix"; +import { type EventStatus, type IContent, type MatrixEvent, MatrixEventEvent, MsgType } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import * as HtmlUtils from "../../../HtmlUtils"; diff --git a/src/components/views/messages/EncryptionEvent.tsx b/src/components/views/messages/EncryptionEvent.tsx index 090881aa02..13625457a5 100644 --- a/src/components/views/messages/EncryptionEvent.tsx +++ b/src/components/views/messages/EncryptionEvent.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { forwardRef } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import type { RoomEncryptionEventContent } from "matrix-js-sdk/src/types"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/messages/EventTileBubble.tsx b/src/components/views/messages/EventTileBubble.tsx index 4ba159089f..be18e4604b 100644 --- a/src/components/views/messages/EventTileBubble.tsx +++ b/src/components/views/messages/EventTileBubble.tsx @@ -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 React, { forwardRef, ReactNode, ReactChild } from "react"; +import React, { forwardRef, type ReactNode, type ReactChild } from "react"; import classNames from "classnames"; interface IProps { diff --git a/src/components/views/messages/HiddenBody.tsx b/src/components/views/messages/HiddenBody.tsx index 5485d2fd6e..9cabbe43dc 100644 --- a/src/components/views/messages/HiddenBody.tsx +++ b/src/components/views/messages/HiddenBody.tsx @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; interface IProps { mxEvent: MatrixEvent; diff --git a/src/components/views/messages/IBodyProps.ts b/src/components/views/messages/IBodyProps.ts index c8f6820e23..8ef1dc7fda 100644 --- a/src/components/views/messages/IBodyProps.ts +++ b/src/components/views/messages/IBodyProps.ts @@ -6,13 +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 React, { LegacyRef } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type LegacyRef } from "react"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { MediaEventHelper } from "../../../utils/MediaEventHelper"; -import EditorStateTransfer from "../../../utils/EditorStateTransfer"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; -import { GetRelationsForEvent } from "../rooms/EventTile"; +import type React from "react"; +import { type MediaEventHelper } from "../../../utils/MediaEventHelper"; +import type EditorStateTransfer from "../../../utils/EditorStateTransfer"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type GetRelationsForEvent } from "../rooms/EventTile"; export interface IBodyProps { mxEvent: MatrixEvent; diff --git a/src/components/views/messages/IMediaBody.ts b/src/components/views/messages/IMediaBody.ts index 4025f4e631..4bf55403e7 100644 --- a/src/components/views/messages/IMediaBody.ts +++ b/src/components/views/messages/IMediaBody.ts @@ -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 { MediaEventHelper } from "../../../utils/MediaEventHelper"; +import { type MediaEventHelper } from "../../../utils/MediaEventHelper"; export interface IMediaBody { getMediaHelper(): MediaEventHelper | undefined; diff --git a/src/components/views/messages/JumpToDatePicker.tsx b/src/components/views/messages/JumpToDatePicker.tsx index 28814d1f77..7f196cfe82 100644 --- a/src/components/views/messages/JumpToDatePicker.tsx +++ b/src/components/views/messages/JumpToDatePicker.tsx @@ -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 React, { useState, FormEvent } from "react"; +import React, { useState, type FormEvent } from "react"; import { _t } from "../../../languageHandler"; import Field from "../elements/Field"; diff --git a/src/components/views/messages/LegacyCallEvent.tsx b/src/components/views/messages/LegacyCallEvent.tsx index fe52a83fb7..bf48ab1095 100644 --- a/src/components/views/messages/LegacyCallEvent.tsx +++ b/src/components/views/messages/LegacyCallEvent.tsx @@ -7,13 +7,14 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { CallErrorCode, CallState } from "matrix-js-sdk/src/webrtc/call"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; import MemberAvatar from "../avatars/MemberAvatar"; -import LegacyCallEventGrouper, { LegacyCallEventGrouperEvent } from "../../structures/LegacyCallEventGrouper"; +import type LegacyCallEventGrouper from "../../structures/LegacyCallEventGrouper"; +import { LegacyCallEventGrouperEvent } from "../../structures/LegacyCallEventGrouper"; import AccessibleButton from "../elements/AccessibleButton"; import InfoTooltip, { InfoTooltipKind } from "../elements/InfoTooltip"; import { formatPreciseDuration } from "../../../DateUtils"; diff --git a/src/components/views/messages/MAudioBody.tsx b/src/components/views/messages/MAudioBody.tsx index 9c2bc9583b..54003d6da9 100644 --- a/src/components/views/messages/MAudioBody.tsx +++ b/src/components/views/messages/MAudioBody.tsx @@ -8,15 +8,15 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { IContent } from "matrix-js-sdk/src/matrix"; -import { MediaEventContent } from "matrix-js-sdk/src/types"; +import { type IContent } from "matrix-js-sdk/src/matrix"; +import { type MediaEventContent } from "matrix-js-sdk/src/types"; -import { Playback } from "../../../audio/Playback"; +import { type Playback } from "../../../audio/Playback"; import InlineSpinner from "../elements/InlineSpinner"; import { _t } from "../../../languageHandler"; import AudioPlayer from "../audio_messages/AudioPlayer"; import MFileBody from "./MFileBody"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import { PlaybackManager } from "../../../audio/PlaybackManager"; import { isVoiceMessage } from "../../../utils/EventUtils"; import { PlaybackQueue } from "../../../audio/PlaybackQueue"; diff --git a/src/components/views/messages/MBeaconBody.tsx b/src/components/views/messages/MBeaconBody.tsx index 0737f78c30..38f36b62cd 100644 --- a/src/components/views/messages/MBeaconBody.tsx +++ b/src/components/views/messages/MBeaconBody.tsx @@ -6,16 +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 React, { ForwardRefExoticComponent, useCallback, useContext, useEffect, useState } from "react"; +import React, { type ForwardRefExoticComponent, useCallback, useContext, useEffect, useState } from "react"; import { - Beacon, + type Beacon, BeaconEvent, - MatrixEvent, + type MatrixEvent, MatrixEventEvent, - MatrixClient, + type MatrixClient, RelationType, - IRedactOpts, - ContentHelpers, + type IRedactOpts, + type ContentHelpers, M_BEACON, } from "matrix-js-sdk/src/matrix"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; @@ -33,9 +33,9 @@ import OwnBeaconStatus from "../beacon/OwnBeaconStatus"; import { Map, SmartMarker } from "../location"; import { MapError } from "../location/MapError"; import MapFallback from "../location/MapFallback"; -import { GetRelationsForEvent } from "../rooms/EventTile"; +import { type GetRelationsForEvent } from "../rooms/EventTile"; import { BeaconViewDialog } from "../beacon"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; const useBeaconState = ( beaconInfoEvent: MatrixEvent, diff --git a/src/components/views/messages/MFileBody.tsx b/src/components/views/messages/MFileBody.tsx index 20a27b9744..674e0f8583 100644 --- a/src/components/views/messages/MFileBody.tsx +++ b/src/components/views/messages/MFileBody.tsx @@ -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, { AllHTMLAttributes, createRef } from "react"; +import React, { type AllHTMLAttributes, createRef } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { MediaEventContent } from "matrix-js-sdk/src/types"; +import { type MediaEventContent } from "matrix-js-sdk/src/types"; import { Button } from "@vector-im/compound-web"; import { DownloadIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; @@ -18,7 +18,7 @@ import AccessibleButton from "../elements/AccessibleButton"; import { mediaFromContent } from "../../../customisations/Media"; import ErrorDialog from "../dialogs/ErrorDialog"; import { downloadLabelForFile, presentableTextForFile } from "../../../utils/FileUtils"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import { FileDownloader } from "../../../utils/FileDownloader"; import TextWithTooltip from "../elements/TextWithTooltip"; import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; diff --git a/src/components/views/messages/MImageBody.tsx b/src/components/views/messages/MImageBody.tsx index 86bc59fdbd..59d8b988a8 100644 --- a/src/components/views/messages/MImageBody.tsx +++ b/src/components/views/messages/MImageBody.tsx @@ -7,13 +7,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, { ComponentProps, createRef, ReactNode } from "react"; +import React, { type ComponentProps, createRef, type ReactNode } from "react"; import { Blurhash } from "react-blurhash"; import classNames from "classnames"; import { CSSTransition, SwitchTransition } from "react-transition-group"; import { logger } from "matrix-js-sdk/src/logger"; import { ClientEvent } from "matrix-js-sdk/src/matrix"; -import { ImageContent } from "matrix-js-sdk/src/types"; +import { type ImageContent } from "matrix-js-sdk/src/types"; import { Tooltip } from "@vector-im/compound-web"; import MFileBody from "./MFileBody"; @@ -21,11 +21,11 @@ import Modal from "../../../Modal"; import { _t } from "../../../languageHandler"; import SettingsStore from "../../../settings/SettingsStore"; import Spinner from "../elements/Spinner"; -import { Media, mediaFromContent } from "../../../customisations/Media"; +import { type Media, mediaFromContent } from "../../../customisations/Media"; import { BLURHASH_FIELD, createThumbnail } from "../../../utils/image-media"; import ImageView from "../elements/ImageView"; -import { IBodyProps } from "./IBodyProps"; -import { ImageSize, suggestedSize as suggestedImageSize } from "../../../settings/enums/ImageSize"; +import { type IBodyProps } from "./IBodyProps"; +import { type ImageSize, suggestedSize as suggestedImageSize } from "../../../settings/enums/ImageSize"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; import { blobIsAnimated, mayBeAnimated } from "../../../utils/Image"; diff --git a/src/components/views/messages/MImageReplyBody.tsx b/src/components/views/messages/MImageReplyBody.tsx index 4ba5fc23f2..32fd27c62a 100644 --- a/src/components/views/messages/MImageReplyBody.tsx +++ b/src/components/views/messages/MImageReplyBody.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { ImageContent } from "matrix-js-sdk/src/types"; +import { type ImageContent } from "matrix-js-sdk/src/types"; import MImageBody from "./MImageBody"; diff --git a/src/components/views/messages/MJitsiWidgetEvent.tsx b/src/components/views/messages/MJitsiWidgetEvent.tsx index 2b785b60b4..5adeef38c5 100644 --- a/src/components/views/messages/MJitsiWidgetEvent.tsx +++ b/src/components/views/messages/MJitsiWidgetEvent.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import WidgetStore from "../../../stores/WidgetStore"; diff --git a/src/components/views/messages/MKeyVerificationRequest.tsx b/src/components/views/messages/MKeyVerificationRequest.tsx index fb929f79a2..849db00729 100644 --- a/src/components/views/messages/MKeyVerificationRequest.tsx +++ b/src/components/views/messages/MKeyVerificationRequest.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import { getNameForEventRoom, userLabelForEventRoom } from "../../../utils/KeyVerificationStateObserver"; diff --git a/src/components/views/messages/MLocationBody.tsx b/src/components/views/messages/MLocationBody.tsx index 805201e481..eb5881e815 100644 --- a/src/components/views/messages/MLocationBody.tsx +++ b/src/components/views/messages/MLocationBody.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, ClientEvent, ClientEventHandlerMap } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, ClientEvent, type ClientEventHandlerMap } from "matrix-js-sdk/src/matrix"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; import { Tooltip } from "@vector-im/compound-web"; @@ -21,7 +21,7 @@ import { } from "../../../utils/location"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { SmartMarker, Map, LocationViewDialog } from "../location"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import { createReconnectedListener } from "../../../utils/connection"; interface IState { diff --git a/src/components/views/messages/MPollBody.tsx b/src/components/views/messages/MPollBody.tsx index 17c7a577df..395aa740a6 100644 --- a/src/components/views/messages/MPollBody.tsx +++ b/src/components/views/messages/MPollBody.tsx @@ -6,30 +6,30 @@ 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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { - MatrixEvent, - MatrixClient, - Relations, - Poll, + type MatrixEvent, + type MatrixClient, + type Relations, + type Poll, PollEvent, M_POLL_KIND_DISCLOSED, M_POLL_RESPONSE, M_POLL_START, - TimelineEvents, + type TimelineEvents, } 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 { type PollStartEvent, type PollAnswerSubevent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; import { PollResponseEvent } from "matrix-js-sdk/src/extensible_events_v1/PollResponseEvent"; import { _t } from "../../../languageHandler"; import Modal from "../../../Modal"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import { formatList } from "../../../utils/FormattingUtils"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import ErrorDialog from "../dialogs/ErrorDialog"; -import { GetRelationsForEvent } from "../rooms/EventTile"; +import { type GetRelationsForEvent } from "../rooms/EventTile"; import PollCreateDialog from "../elements/PollCreateDialog"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import Spinner from "../elements/Spinner"; diff --git a/src/components/views/messages/MPollEndBody.tsx b/src/components/views/messages/MPollEndBody.tsx index 7df0e8ad58..a3a42a7843 100644 --- a/src/components/views/messages/MPollEndBody.tsx +++ b/src/components/views/messages/MPollEndBody.tsx @@ -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 React, { useEffect, useState, useContext, ForwardRefExoticComponent } from "react"; +import React, { useEffect, useState, useContext, type ForwardRefExoticComponent } from "react"; import { MatrixEvent, M_TEXT } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; @@ -15,7 +15,7 @@ import MatrixClientContext, { useMatrixClientContext } from "../../../contexts/M import { _t } from "../../../languageHandler"; import { textForEvent } from "../../../TextForEvent"; import { Caption } from "../typography/Caption"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import MPollBody from "./MPollBody"; const getRelatedPollStartEventId = (event: MatrixEvent): string | undefined => { diff --git a/src/components/views/messages/MStickerBody.tsx b/src/components/views/messages/MStickerBody.tsx index 0864ecfcfe..ccb9bb437b 100644 --- a/src/components/views/messages/MStickerBody.tsx +++ b/src/components/views/messages/MStickerBody.tsx @@ -5,9 +5,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, { ComponentProps, ReactNode } from "react"; -import { Tooltip } from "@vector-im/compound-web"; -import { MediaEventContent } from "matrix-js-sdk/src/types"; +import React, { type ComponentProps, type ReactNode } from "react"; +import { type Tooltip } from "@vector-im/compound-web"; +import { type MediaEventContent } from "matrix-js-sdk/src/types"; import MImageBody from "./MImageBody"; import { BLURHASH_FIELD } from "../../../utils/image-media"; diff --git a/src/components/views/messages/MVideoBody.tsx b/src/components/views/messages/MVideoBody.tsx index c513925acd..00c44b5170 100644 --- a/src/components/views/messages/MVideoBody.tsx +++ b/src/components/views/messages/MVideoBody.tsx @@ -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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { decode } from "blurhash"; -import { MediaEventContent } from "matrix-js-sdk/src/types"; +import { type MediaEventContent } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; @@ -16,9 +16,9 @@ import SettingsStore from "../../../settings/SettingsStore"; import InlineSpinner from "../elements/InlineSpinner"; import { mediaFromContent } from "../../../customisations/Media"; import { BLURHASH_FIELD } from "../../../utils/image-media"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import MFileBody from "./MFileBody"; -import { ImageSize, suggestedSize as suggestedVideoSize } from "../../../settings/enums/ImageSize"; +import { type ImageSize, suggestedSize as suggestedVideoSize } from "../../../settings/enums/ImageSize"; import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; import MediaProcessingError from "./shared/MediaProcessingError"; diff --git a/src/components/views/messages/MVoiceOrAudioBody.tsx b/src/components/views/messages/MVoiceOrAudioBody.tsx index af7eb6f84a..9347b7bdc7 100644 --- a/src/components/views/messages/MVoiceOrAudioBody.tsx +++ b/src/components/views/messages/MVoiceOrAudioBody.tsx @@ -10,7 +10,7 @@ import React from "react"; import MAudioBody from "./MAudioBody"; import MVoiceMessageBody from "./MVoiceMessageBody"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import { isVoiceMessage } from "../../../utils/EventUtils"; export default class MVoiceOrAudioBody extends React.PureComponent { diff --git a/src/components/views/messages/MessageActionBar.tsx b/src/components/views/messages/MessageActionBar.tsx index 1476249c2b..e6838c635f 100644 --- a/src/components/views/messages/MessageActionBar.tsx +++ b/src/components/views/messages/MessageActionBar.tsx @@ -8,10 +8,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 React, { ReactElement, useCallback, useContext, useEffect } from "react"; +import React, { type ReactElement, useCallback, useContext, useEffect } from "react"; import { EventStatus, - MatrixEvent, + type MatrixEvent, MatrixEventEvent, MsgType, RelationType, @@ -19,6 +19,7 @@ import { EventTimeline, RoomStateEvent, EventType, + type Relations, } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import { @@ -35,7 +36,6 @@ import { Icon as EditIcon } from "../../../../res/img/element-icons/room/message import { Icon as EmojiIcon } from "../../../../res/img/element-icons/room/message-bar/emoji.svg"; import { Icon as ExpandMessageIcon } from "../../../../res/img/element-icons/expand-message.svg"; import { Icon as CollapseMessageIcon } from "../../../../res/img/element-icons/collapse-message.svg"; -import type { Relations } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import defaultDispatcher from "../../../dispatcher/dispatcher"; import ContextMenu, { aboveLeftOf, ContextMenuTooltipButton, useContextMenu } from "../../structures/ContextMenu"; @@ -48,17 +48,17 @@ import Resend from "../../../Resend"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; import DownloadActionButton from "./DownloadActionButton"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; -import ReplyChain from "../elements/ReplyChain"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import type ReplyChain from "../elements/ReplyChain"; import ReactionPicker from "../emojipicker/ReactionPicker"; import { CardContext } from "../right_panel/context"; import { shouldDisplayReply } from "../../../utils/Reply"; import { Key } from "../../../Keyboard"; import { ALTERNATE_KEY_NAME } from "../../../accessibility/KeyboardShortcuts"; import { Action } from "../../../dispatcher/actions"; -import { ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; -import { GetRelationsForEvent, IEventTileType } from "../rooms/EventTile"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; +import { type GetRelationsForEvent, type IEventTileType } from "../rooms/EventTile"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import PinningUtils from "../../../utils/PinningUtils"; import PosthogTrackers from "../../../PosthogTrackers.ts"; diff --git a/src/components/views/messages/MessageEvent.tsx b/src/components/views/messages/MessageEvent.tsx index 6fb239069f..be63457902 100644 --- a/src/components/views/messages/MessageEvent.tsx +++ b/src/components/views/messages/MessageEvent.tsx @@ -17,16 +17,16 @@ import { M_LOCATION, M_POLL_END, M_POLL_START, - IContent, + type IContent, } from "matrix-js-sdk/src/matrix"; import SettingsStore from "../../../settings/SettingsStore"; import { Mjolnir } from "../../../mjolnir/Mjolnir"; import RedactedBody from "./RedactedBody"; import UnknownBody from "./UnknownBody"; -import { IMediaBody } from "./IMediaBody"; +import { type IMediaBody } from "./IMediaBody"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import TextualBody from "./TextualBody"; import MImageBody from "./MImageBody"; @@ -40,7 +40,7 @@ import MLocationBody from "./MLocationBody"; import MjolnirBody from "./MjolnirBody"; import MBeaconBody from "./MBeaconBody"; import { DecryptionFailureBody } from "./DecryptionFailureBody"; -import { GetRelationsForEvent, IEventTileOps } from "../rooms/EventTile"; +import { type GetRelationsForEvent, type IEventTileOps } from "../rooms/EventTile"; // onMessageAllowed is handled internally interface IProps extends Omit { diff --git a/src/components/views/messages/MessageTimestamp.tsx b/src/components/views/messages/MessageTimestamp.tsx index 34c25303ed..61c9a31641 100644 --- a/src/components/views/messages/MessageTimestamp.tsx +++ b/src/components/views/messages/MessageTimestamp.tsx @@ -7,7 +7,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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { Tooltip } from "@vector-im/compound-web"; import { formatFullDate, formatTime, formatFullTime, formatRelativeTime } from "../../../DateUtils"; diff --git a/src/components/views/messages/MjolnirBody.tsx b/src/components/views/messages/MjolnirBody.tsx index 20587f879e..4050e1750d 100644 --- a/src/components/views/messages/MjolnirBody.tsx +++ b/src/components/views/messages/MjolnirBody.tsx @@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { _t } from "../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; -import { IBodyProps } from "./IBodyProps"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; +import { type IBodyProps } from "./IBodyProps"; export default class MjolnirBody extends React.Component { private onAllowClick = (e: ButtonEvent): void => { diff --git a/src/components/views/messages/PinnedMessageBadge.tsx b/src/components/views/messages/PinnedMessageBadge.tsx index 7f4c132087..2652d84ed8 100644 --- a/src/components/views/messages/PinnedMessageBadge.tsx +++ b/src/components/views/messages/PinnedMessageBadge.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX } from "react"; +import React, { type JSX } from "react"; import PinIcon from "@vector-im/compound-design-tokens/assets/web/icons/pin-solid"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/messages/ReactionsRow.tsx b/src/components/views/messages/ReactionsRow.tsx index 504bf1b244..ee160248d7 100644 --- a/src/components/views/messages/ReactionsRow.tsx +++ b/src/components/views/messages/ReactionsRow.tsx @@ -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, { SyntheticEvent } from "react"; +import React, { type SyntheticEvent } from "react"; import classNames from "classnames"; -import { MatrixEvent, MatrixEventEvent, Relations, RelationsEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, MatrixEventEvent, type Relations, RelationsEvent } from "matrix-js-sdk/src/matrix"; import { uniqBy } from "lodash"; import { UnstableValue } from "matrix-js-sdk/src/NamespacedValue"; diff --git a/src/components/views/messages/ReactionsRowButton.tsx b/src/components/views/messages/ReactionsRowButton.tsx index 9e3763e439..8320237b25 100644 --- a/src/components/views/messages/ReactionsRowButton.tsx +++ b/src/components/views/messages/ReactionsRowButton.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; -import { EventType, MatrixEvent, RelationType } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixEvent, RelationType } from "matrix-js-sdk/src/matrix"; import { mediaFromMxc } from "../../../customisations/Media"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/messages/ReactionsRowButtonTooltip.tsx b/src/components/views/messages/ReactionsRowButtonTooltip.tsx index 84fb95f210..f40002deff 100644 --- a/src/components/views/messages/ReactionsRowButtonTooltip.tsx +++ b/src/components/views/messages/ReactionsRowButtonTooltip.tsx @@ -6,8 +6,8 @@ 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, { PropsWithChildren } from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { type PropsWithChildren } from "react"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { Tooltip } from "@vector-im/compound-web"; import { unicodeToShortcode } from "../../../HtmlUtils"; diff --git a/src/components/views/messages/RedactedBody.tsx b/src/components/views/messages/RedactedBody.tsx index dd311c8f5e..9048d176ca 100644 --- a/src/components/views/messages/RedactedBody.tsx +++ b/src/components/views/messages/RedactedBody.tsx @@ -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 React, { ForwardRefExoticComponent, useContext } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import React, { type ForwardRefExoticComponent, useContext } from "react"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { formatFullDate } from "../../../DateUtils"; import SettingsStore from "../../../settings/SettingsStore"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; const RedactedBody = React.forwardRef(({ mxEvent }, ref) => { const cli: MatrixClient = useContext(MatrixClientContext); diff --git a/src/components/views/messages/RoomAvatarEvent.tsx b/src/components/views/messages/RoomAvatarEvent.tsx index 1d3f9172ca..7c155e59d6 100644 --- a/src/components/views/messages/RoomAvatarEvent.tsx +++ b/src/components/views/messages/RoomAvatarEvent.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/messages/RoomPredecessorTile.tsx b/src/components/views/messages/RoomPredecessorTile.tsx index 3b2de5d67d..8a9b9534c4 100644 --- a/src/components/views/messages/RoomPredecessorTile.tsx +++ b/src/components/views/messages/RoomPredecessorTile.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React, { useCallback } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixEvent, Room, RoomState } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type Room, type RoomState } from "matrix-js-sdk/src/matrix"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; @@ -17,7 +17,7 @@ import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import EventTileBubble from "./EventTileBubble"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { useRoomState } from "../../../hooks/useRoomState"; import SettingsStore from "../../../settings/SettingsStore"; import MatrixToPermalinkConstructor from "../../../utils/permalinks/MatrixToPermalinkConstructor"; diff --git a/src/components/views/messages/SenderProfile.tsx b/src/components/views/messages/SenderProfile.tsx index 8e99e45e75..d6df08de0e 100644 --- a/src/components/views/messages/SenderProfile.tsx +++ b/src/components/views/messages/SenderProfile.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, MsgType } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, MsgType } from "matrix-js-sdk/src/matrix"; import DisambiguatedProfile from "./DisambiguatedProfile"; import { useRoomMemberProfile } from "../../../hooks/room/useRoomMemberProfile"; diff --git a/src/components/views/messages/TextualBody.tsx b/src/components/views/messages/TextualBody.tsx index d64aa128dc..296f7cd537 100644 --- a/src/components/views/messages/TextualBody.tsx +++ b/src/components/views/messages/TextualBody.tsx @@ -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 React, { createRef, SyntheticEvent, MouseEvent, StrictMode } from "react"; +import React, { createRef, type SyntheticEvent, type MouseEvent, StrictMode } from "react"; import { MsgType, PushRuleKind } from "matrix-js-sdk/src/matrix"; import { TooltipProvider } from "@vector-im/compound-web"; import { globToRegexp } from "matrix-js-sdk/src/utils"; @@ -27,13 +27,13 @@ import QuestionDialog from "../dialogs/QuestionDialog"; import MessageEditHistoryDialog from "../dialogs/MessageEditHistoryDialog"; import EditMessageComposer from "../rooms/EditMessageComposer"; import LinkPreviewGroup from "../rooms/LinkPreviewGroup"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; import RoomContext from "../../../contexts/RoomContext"; import AccessibleButton from "../elements/AccessibleButton"; import { options as linkifyOpts } from "../../../linkify-matrix"; import { getParentEventId } from "../../../utils/Reply"; import { EditWysiwygComposer } from "../rooms/wysiwyg_composer"; -import { IEventTileOps } from "../rooms/EventTile"; +import { type IEventTileOps } from "../rooms/EventTile"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import CodeBlock from "./CodeBlock"; import { Pill, PillType } from "../elements/Pill"; diff --git a/src/components/views/messages/TextualEvent.tsx b/src/components/views/messages/TextualEvent.tsx index 41a8fdf115..445913bfc6 100644 --- a/src/components/views/messages/TextualEvent.tsx +++ b/src/components/views/messages/TextualEvent.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; import RoomContext from "../../../contexts/RoomContext"; import * as TextForEvent from "../../../TextForEvent"; diff --git a/src/components/views/messages/TileErrorBoundary.tsx b/src/components/views/messages/TileErrorBoundary.tsx index 33d82e538a..2ccac0f288 100644 --- a/src/components/views/messages/TileErrorBoundary.tsx +++ b/src/components/views/messages/TileErrorBoundary.tsx @@ -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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import classNames from "classnames"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import Modal from "../../../Modal"; @@ -17,7 +17,7 @@ import BugReportDialog from "../dialogs/BugReportDialog"; import AccessibleButton from "../elements/AccessibleButton"; import SettingsStore from "../../../settings/SettingsStore"; import ViewSource from "../../structures/ViewSource"; -import { Layout } from "../../../settings/enums/Layout"; +import { type Layout } from "../../../settings/enums/Layout"; interface IProps { mxEvent: MatrixEvent; diff --git a/src/components/views/messages/TimelineSeparator.tsx b/src/components/views/messages/TimelineSeparator.tsx index f89ba64292..4735c8e00c 100644 --- a/src/components/views/messages/TimelineSeparator.tsx +++ b/src/components/views/messages/TimelineSeparator.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; interface Props { label: string; diff --git a/src/components/views/messages/UnknownBody.tsx b/src/components/views/messages/UnknownBody.tsx index 2e804a221c..e72f8d2327 100644 --- a/src/components/views/messages/UnknownBody.tsx +++ b/src/components/views/messages/UnknownBody.tsx @@ -7,9 +7,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, { forwardRef, ForwardRefExoticComponent } from "react"; +import React, { forwardRef, type ForwardRefExoticComponent } from "react"; -import { IBodyProps } from "./IBodyProps"; +import { type IBodyProps } from "./IBodyProps"; export default forwardRef(({ mxEvent, children }, ref) => { const text = mxEvent.getContent().body; diff --git a/src/components/views/messages/ViewSourceEvent.tsx b/src/components/views/messages/ViewSourceEvent.tsx index 3489921729..e7ed1f8332 100644 --- a/src/components/views/messages/ViewSourceEvent.tsx +++ b/src/components/views/messages/ViewSourceEvent.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import { CollapseIcon, ExpandIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; interface IProps { mxEvent: MatrixEvent; diff --git a/src/components/views/pips/WidgetPip.tsx b/src/components/views/pips/WidgetPip.tsx index 13df6dbfad..3b10dbc784 100644 --- a/src/components/views/pips/WidgetPip.tsx +++ b/src/components/views/pips/WidgetPip.tsx @@ -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, { FC, MutableRefObject, useCallback, useMemo } from "react"; -import { Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import React, { type FC, type MutableRefObject, useCallback, useMemo } from "react"; +import { type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; import BackIcon from "@vector-im/compound-design-tokens/assets/web/icons/arrow-left"; import PersistentApp from "../elements/PersistentApp"; import defaultDispatcher from "../../../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../../../dispatcher/actions"; import { useCallForWidget } from "../../../hooks/useCall"; import WidgetStore from "../../../stores/WidgetStore"; @@ -26,7 +26,7 @@ import { WidgetType } from "../../../widgets/WidgetType"; import { WidgetMessagingStore } from "../../../stores/widgets/WidgetMessagingStore"; import WidgetUtils from "../../../utils/WidgetUtils"; import { ElementWidgetActions } from "../../../stores/widgets/ElementWidgetActions"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; interface Props { widgetId: string; diff --git a/src/components/views/polls/PollOption.tsx b/src/components/views/polls/PollOption.tsx index 07c6d141bb..a8de8fb6ef 100644 --- a/src/components/views/polls/PollOption.tsx +++ b/src/components/views/polls/PollOption.tsx @@ -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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import classNames from "classnames"; -import { PollAnswerSubevent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; +import { type PollAnswerSubevent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; import { _t } from "../../../languageHandler"; import { Icon as TrophyIcon } from "../../../../res/img/element-icons/trophy.svg"; diff --git a/src/components/views/polls/pollHistory/PollDetail.tsx b/src/components/views/polls/pollHistory/PollDetail.tsx index 67da1526cc..7b6d6dd5bb 100644 --- a/src/components/views/polls/pollHistory/PollDetail.tsx +++ b/src/components/views/polls/pollHistory/PollDetail.tsx @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Poll } from "matrix-js-sdk/src/matrix"; +import { type Poll } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../languageHandler"; import dispatcher from "../../../../dispatcher/dispatcher"; import { Action } from "../../../../dispatcher/actions"; -import { ViewRoomPayload } from "../../../../dispatcher/payloads/ViewRoomPayload"; -import { RoomPermalinkCreator } from "../../../../utils/permalinks/Permalinks"; -import { MediaEventHelper } from "../../../../utils/MediaEventHelper"; -import AccessibleButton, { ButtonEvent } from "../../elements/AccessibleButton"; +import { type ViewRoomPayload } from "../../../../dispatcher/payloads/ViewRoomPayload"; +import { type RoomPermalinkCreator } from "../../../../utils/permalinks/Permalinks"; +import { type MediaEventHelper } from "../../../../utils/MediaEventHelper"; +import AccessibleButton, { type ButtonEvent } from "../../elements/AccessibleButton"; import MPollBody from "../../messages/MPollBody"; interface Props { diff --git a/src/components/views/polls/pollHistory/PollDetailHeader.tsx b/src/components/views/polls/pollHistory/PollDetailHeader.tsx index 429f1740a7..4f23299af3 100644 --- a/src/components/views/polls/pollHistory/PollDetailHeader.tsx +++ b/src/components/views/polls/pollHistory/PollDetailHeader.tsx @@ -11,7 +11,7 @@ import LeftCaretIcon from "@vector-im/compound-design-tokens/assets/web/icons/ch import { _t } from "../../../../languageHandler"; import AccessibleButton from "../../elements/AccessibleButton"; -import { PollHistoryFilter } from "./types"; +import { type PollHistoryFilter } from "./types"; interface Props { filter: PollHistoryFilter; diff --git a/src/components/views/polls/pollHistory/PollHistory.tsx b/src/components/views/polls/pollHistory/PollHistory.tsx index 01fcedd8ee..6967ef8d9c 100644 --- a/src/components/views/polls/pollHistory/PollHistory.tsx +++ b/src/components/views/polls/pollHistory/PollHistory.tsx @@ -7,14 +7,14 @@ Please see LICENSE files in the repository root for full details. */ import React, { useState } from "react"; -import { MatrixClient, MatrixEvent, Poll, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent, type Poll, type Room } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../languageHandler"; import { PollHistoryList } from "./PollHistoryList"; -import { PollHistoryFilter } from "./types"; +import { type PollHistoryFilter } from "./types"; import { PollDetailHeader } from "./PollDetailHeader"; import { PollDetail } from "./PollDetail"; -import { RoomPermalinkCreator } from "../../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../../utils/permalinks/Permalinks"; import { usePollsWithRelations } from "./usePollHistory"; import { useFetchPastPolls } from "./fetchPastPolls"; import Heading from "../../typography/Heading"; diff --git a/src/components/views/polls/pollHistory/PollHistoryList.tsx b/src/components/views/polls/pollHistory/PollHistoryList.tsx index ed0b935050..02facc95ae 100644 --- a/src/components/views/polls/pollHistory/PollHistoryList.tsx +++ b/src/components/views/polls/pollHistory/PollHistoryList.tsx @@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; -import { MatrixEvent, Poll } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type Poll } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../languageHandler"; import { FilterTabGroup } from "../../elements/FilterTabGroup"; import InlineSpinner from "../../elements/InlineSpinner"; -import { PollHistoryFilter } from "./types"; +import { type PollHistoryFilter } from "./types"; import { PollListItem } from "./PollListItem"; import { PollListItemEnded } from "./PollListItemEnded"; import AccessibleButton from "../../elements/AccessibleButton"; diff --git a/src/components/views/polls/pollHistory/PollListItem.tsx b/src/components/views/polls/pollHistory/PollListItem.tsx index 3a631c4242..1824bb38da 100644 --- a/src/components/views/polls/pollHistory/PollListItem.tsx +++ b/src/components/views/polls/pollHistory/PollListItem.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { Tooltip } from "@vector-im/compound-web"; import { Icon as PollIcon } from "../../../../../res/img/element-icons/room/composer/poll.svg"; diff --git a/src/components/views/polls/pollHistory/PollListItemEnded.tsx b/src/components/views/polls/pollHistory/PollListItemEnded.tsx index 17a9f9ae3e..8e2ed22127 100644 --- a/src/components/views/polls/pollHistory/PollListItemEnded.tsx +++ b/src/components/views/polls/pollHistory/PollListItemEnded.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React, { useEffect, useState } from "react"; -import { PollAnswerSubevent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; -import { MatrixEvent, Poll, PollEvent, Relations } from "matrix-js-sdk/src/matrix"; +import { type PollAnswerSubevent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; +import { type MatrixEvent, type Poll, PollEvent, type Relations } from "matrix-js-sdk/src/matrix"; import { Tooltip } from "@vector-im/compound-web"; import { Icon as PollIcon } from "../../../../../res/img/element-icons/room/composer/poll.svg"; diff --git a/src/components/views/polls/pollHistory/fetchPastPolls.ts b/src/components/views/polls/pollHistory/fetchPastPolls.ts index 2e6c707594..d25ef6bfae 100644 --- a/src/components/views/polls/pollHistory/fetchPastPolls.ts +++ b/src/components/views/polls/pollHistory/fetchPastPolls.ts @@ -9,13 +9,13 @@ Please see LICENSE files in the repository root for full details. import { useCallback, useEffect, useState } from "react"; import { M_POLL_START, - MatrixClient, + type MatrixClient, Direction, EventTimeline, - EventTimelineSet, - Room, + type EventTimelineSet, + type Room, Filter, - IFilterDefinition, + type IFilterDefinition, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/components/views/polls/pollHistory/usePollHistory.ts b/src/components/views/polls/pollHistory/usePollHistory.ts index fbc5715842..fb0714863d 100644 --- a/src/components/views/polls/pollHistory/usePollHistory.ts +++ b/src/components/views/polls/pollHistory/usePollHistory.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useEffect, useState } from "react"; -import { Poll, PollEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Poll, PollEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { useEventEmitterState } from "../../../../hooks/useEventEmitter"; diff --git a/src/components/views/right_panel/BaseCard.tsx b/src/components/views/right_panel/BaseCard.tsx index d7d6129960..90534947a0 100644 --- a/src/components/views/right_panel/BaseCard.tsx +++ b/src/components/views/right_panel/BaseCard.tsx @@ -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 React, { forwardRef, ReactNode, KeyboardEvent, Ref, MouseEvent } from "react"; +import React, { forwardRef, type ReactNode, type KeyboardEvent, type Ref, type MouseEvent } from "react"; import classNames from "classnames"; import { IconButton, Text } from "@vector-im/compound-web"; import CloseIcon from "@vector-im/compound-design-tokens/assets/web/icons/close"; diff --git a/src/components/views/right_panel/EmptyState.tsx b/src/components/views/right_panel/EmptyState.tsx index 1c7713a5d8..f6b2a940a6 100644 --- a/src/components/views/right_panel/EmptyState.tsx +++ b/src/components/views/right_panel/EmptyState.tsx @@ -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 React, { ComponentType } from "react"; +import React, { type ComponentType } from "react"; import { Text } from "@vector-im/compound-web"; import { Flex } from "../../utils/Flex"; diff --git a/src/components/views/right_panel/EncryptionInfo.tsx b/src/components/views/right_panel/EncryptionInfo.tsx index a2fb6e8f24..a39c8f41d3 100644 --- a/src/components/views/right_panel/EncryptionInfo.tsx +++ b/src/components/views/right_panel/EncryptionInfo.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { RoomMember, User } from "matrix-js-sdk/src/matrix"; +import { type RoomMember, type User } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/right_panel/EncryptionPanel.tsx b/src/components/views/right_panel/EncryptionPanel.tsx index 3ccd07cfc2..32fc2137dc 100644 --- a/src/components/views/right_panel/EncryptionPanel.tsx +++ b/src/components/views/right_panel/EncryptionPanel.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React, { useCallback, useEffect, useRef, useState } from "react"; -import { VerificationPhase, VerificationRequest, VerificationRequestEvent } from "matrix-js-sdk/src/crypto-api"; -import { RoomMember, User } from "matrix-js-sdk/src/matrix"; +import { VerificationPhase, type VerificationRequest, VerificationRequestEvent } from "matrix-js-sdk/src/crypto-api"; +import { type RoomMember, type User } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import EncryptionInfo from "./EncryptionInfo"; diff --git a/src/components/views/right_panel/ExtensionsCard.tsx b/src/components/views/right_panel/ExtensionsCard.tsx index 0e0ca12d67..b88038160b 100644 --- a/src/components/views/right_panel/ExtensionsCard.tsx +++ b/src/components/views/right_panel/ExtensionsCard.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useEffect, useMemo, useState } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import { Button, Link, Separator, Text } from "@vector-im/compound-web"; import PlusIcon from "@vector-im/compound-design-tokens/assets/web/icons/plus"; @@ -20,7 +20,7 @@ import { ChevronFace, ContextMenuTooltipButton, useContextMenu } from "../../str import { WidgetContextMenu } from "../context_menus/WidgetContextMenu"; import UIStore from "../../../stores/UIStore"; import RightPanelStore from "../../../stores/right-panel/RightPanelStore"; -import { IApp } from "../../../stores/WidgetStore"; +import { type IApp } from "../../../stores/WidgetStore"; import { RightPanelPhases } from "../../../stores/right-panel/RightPanelStorePhases"; import { Container, MAX_PINNED, WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/right_panel/PinnedMessagesCard.tsx b/src/components/views/right_panel/PinnedMessagesCard.tsx index 2ce514c97a..daea698edd 100644 --- a/src/components/views/right_panel/PinnedMessagesCard.tsx +++ b/src/components/views/right_panel/PinnedMessagesCard.tsx @@ -6,8 +6,8 @@ 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, { useCallback, useEffect, JSX, useContext } from "react"; -import { Room, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { useCallback, useEffect, type JSX, useContext } from "react"; +import { type Room, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { Button, Separator } from "@vector-im/compound-web"; import classNames from "classnames"; import PinIcon from "@vector-im/compound-design-tokens/assets/web/icons/pin"; @@ -20,7 +20,7 @@ import { PinnedEventTile } from "../rooms/PinnedEventTile"; import { useRoomState } from "../../../hooks/useRoomState"; import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; import { ReadPinsEventId } from "./types"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { filterBoolean } from "../../../utils/arrays"; import Modal from "../../../Modal"; import { UnpinAllDialog } from "../dialogs/UnpinAllDialog"; diff --git a/src/components/views/right_panel/RoomSummaryCard.tsx b/src/components/views/right_panel/RoomSummaryCard.tsx index 0abdba5276..8c32c21f0f 100644 --- a/src/components/views/right_panel/RoomSummaryCard.tsx +++ b/src/components/views/right_panel/RoomSummaryCard.tsx @@ -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 React, { ChangeEvent, SyntheticEvent, useContext, useEffect, useRef, useState } from "react"; +import React, { type ChangeEvent, type SyntheticEvent, useContext, useEffect, useRef, useState } from "react"; import classNames from "classnames"; import { MenuItem, @@ -37,7 +37,7 @@ import LockOffIcon from "@vector-im/compound-design-tokens/assets/web/icons/lock import PublicIcon from "@vector-im/compound-design-tokens/assets/web/icons/public"; import ErrorIcon from "@vector-im/compound-design-tokens/assets/web/icons/error"; import ChevronDownIcon from "@vector-im/compound-design-tokens/assets/web/icons/chevron-down"; -import { EventType, JoinRule, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { EventType, JoinRule, type Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { useIsEncrypted } from "../../../hooks/useIsEncrypted"; @@ -50,7 +50,7 @@ import Modal from "../../../Modal"; import { ShareDialog } from "../dialogs/ShareDialog"; import { useEventEmitterState } from "../../../hooks/useEventEmitter"; import { E2EStatus } from "../../../utils/ShieldUtils"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { TimelineRenderingType } from "../../../contexts/RoomContext"; import RoomName from "../elements/RoomName"; import ExportDialog from "../dialogs/ExportDialog"; diff --git a/src/components/views/right_panel/TimelineCard.tsx b/src/components/views/right_panel/TimelineCard.tsx index 4cee1ef9b4..45891cfe52 100644 --- a/src/components/views/right_panel/TimelineCard.tsx +++ b/src/components/views/right_panel/TimelineCard.tsx @@ -8,33 +8,33 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { - IEventRelation, - MatrixEvent, + type IEventRelation, + type MatrixEvent, NotificationCountType, - Room, - EventTimelineSet, - Thread, + type Room, + type EventTimelineSet, + type Thread, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import BaseCard from "./BaseCard"; -import ResizeNotifier from "../../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../../utils/ResizeNotifier"; import MessageComposer from "../rooms/MessageComposer"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { Layout } from "../../../settings/enums/Layout"; import TimelinePanel from "../../structures/TimelinePanel"; -import { E2EStatus } from "../../../utils/ShieldUtils"; +import { type E2EStatus } from "../../../utils/ShieldUtils"; import EditorStateTransfer from "../../../utils/EditorStateTransfer"; -import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; +import RoomContext, { type TimelineRenderingType } from "../../../contexts/RoomContext"; import dis from "../../../dispatcher/dispatcher"; import { _t } from "../../../languageHandler"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import { Action } from "../../../dispatcher/actions"; import ContentMessages from "../../../ContentMessages"; import UploadBar from "../../structures/UploadBar"; import SettingsStore from "../../../settings/SettingsStore"; import JumpToBottomButton from "../rooms/JumpToBottomButton"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import Measured from "../elements/Measured"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import { SdkContextClass } from "../../../contexts/SDKContext"; diff --git a/src/components/views/right_panel/UserInfo.tsx b/src/components/views/right_panel/UserInfo.tsx index 3be3725576..e7ae576150 100644 --- a/src/components/views/right_panel/UserInfo.tsx +++ b/src/components/views/right_panel/UserInfo.tsx @@ -9,21 +9,21 @@ 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, { ReactNode, useCallback, useContext, useEffect, useMemo, useState } from "react"; +import React, { type ReactNode, useCallback, useContext, useEffect, useMemo, useState } from "react"; import classNames from "classnames"; import { ClientEvent, - MatrixClient, + type MatrixClient, RoomMember, - Room, + type Room, RoomStateEvent, - MatrixEvent, + type MatrixEvent, User, - Device, + type Device, EventType, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import { UserVerificationStatus, VerificationRequest, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; +import { type UserVerificationStatus, type VerificationRequest, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; import { Heading, MenuItem, Text, Tooltip } from "@vector-im/compound-web"; import ChatIcon from "@vector-im/compound-design-tokens/assets/web/icons/chat"; @@ -42,7 +42,7 @@ import dis from "../../../dispatcher/dispatcher"; import Modal from "../../../Modal"; import { _t, UserFriendlyError } from "../../../languageHandler"; import DMRoomMap from "../../../utils/DMRoomMap"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import SdkConfig from "../../../SdkConfig"; import MultiInviter from "../../../utils/MultiInviter"; import E2EIcon from "../rooms/E2EIcon"; @@ -68,17 +68,17 @@ import ErrorDialog from "../dialogs/ErrorDialog"; import QuestionDialog from "../dialogs/QuestionDialog"; import ConfirmUserActionDialog from "../dialogs/ConfirmUserActionDialog"; import { mediaFromMxc } from "../../../customisations/Media"; -import { ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInsertPayload"; +import { type ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInsertPayload"; import ConfirmSpaceUserActionDialog from "../dialogs/ConfirmSpaceUserActionDialog"; import { bulkSpaceBehaviour } from "../../../utils/space"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { UIComponent } from "../../../settings/UIFeature"; import { TimelineRenderingType } from "../../../contexts/RoomContext"; import RightPanelStore from "../../../stores/right-panel/RightPanelStore"; -import { IRightPanelCardState } from "../../../stores/right-panel/RightPanelStoreIPanelState"; +import { type IRightPanelCardState } from "../../../stores/right-panel/RightPanelStoreIPanelState"; import UserIdentifierCustomisations from "../../../customisations/UserIdentifier"; import PosthogTrackers from "../../../PosthogTrackers"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { DirectoryMember, startDmOnFirstMessage } from "../../../utils/direct-messages"; import { SdkContextClass } from "../../../contexts/SDKContext"; import { asyncSome } from "../../../utils/arrays"; diff --git a/src/components/views/right_panel/VerificationPanel.tsx b/src/components/views/right_panel/VerificationPanel.tsx index 2a1d8ce3c0..62ac734fcd 100644 --- a/src/components/views/right_panel/VerificationPanel.tsx +++ b/src/components/views/right_panel/VerificationPanel.tsx @@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { - ShowQrCodeCallbacks, - ShowSasCallbacks, + type ShowQrCodeCallbacks, + type ShowSasCallbacks, VerificationPhase as Phase, - VerificationRequest, + type VerificationRequest, VerificationRequestEvent, VerifierEvent, } from "matrix-js-sdk/src/crypto-api"; -import { Device, RoomMember, User } from "matrix-js-sdk/src/matrix"; +import { type Device, type RoomMember, type User } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { VerificationMethod } from "matrix-js-sdk/src/types"; diff --git a/src/components/views/right_panel/WidgetCard.tsx b/src/components/views/right_panel/WidgetCard.tsx index b1488aefb4..3bfbcdd0df 100644 --- a/src/components/views/right_panel/WidgetCard.tsx +++ b/src/components/views/right_panel/WidgetCard.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext, useEffect } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import BaseCard from "./BaseCard"; diff --git a/src/components/views/room_settings/AliasSettings.tsx b/src/components/views/room_settings/AliasSettings.tsx index e76c8a2cd5..36143dabe2 100644 --- a/src/components/views/room_settings/AliasSettings.tsx +++ b/src/components/views/room_settings/AliasSettings.tsx @@ -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 React, { ChangeEvent, ContextType, createRef, SyntheticEvent } from "react"; -import { MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent, type ContextType, createRef, type SyntheticEvent } from "react"; +import { type MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { RoomCanonicalAliasEventContent } from "matrix-js-sdk/src/types"; +import { type RoomCanonicalAliasEventContent } from "matrix-js-sdk/src/types"; import EditableItemList from "../elements/EditableItemList"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/room_settings/RoomProfileSettings.tsx b/src/components/views/room_settings/RoomProfileSettings.tsx index 15ed6f461c..26cd16e873 100644 --- a/src/components/views/room_settings/RoomProfileSettings.tsx +++ b/src/components/views/room_settings/RoomProfileSettings.tsx @@ -12,7 +12,7 @@ import { ContentHelpers, EventType } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import Field from "../elements/Field"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import AvatarSetting from "../settings/AvatarSetting"; import { htmlSerializeFromMdIfNeeded } from "../../../editor/serialize"; import { idNameForRoom } from "../avatars/RoomAvatar"; diff --git a/src/components/views/room_settings/UrlPreviewSettings.tsx b/src/components/views/room_settings/UrlPreviewSettings.tsx index 9c7dcabbc6..d200f487eb 100644 --- a/src/components/views/room_settings/UrlPreviewSettings.tsx +++ b/src/components/views/room_settings/UrlPreviewSettings.tsx @@ -9,8 +9,8 @@ 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, { ReactNode, JSX } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode, type JSX } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { InlineSpinner } from "@vector-im/compound-web"; import { _t } from "../../../languageHandler"; @@ -20,7 +20,7 @@ import { Action } from "../../../dispatcher/actions"; import { SettingLevel } from "../../../settings/SettingLevel"; import SettingsFlag from "../elements/SettingsFlag"; import SettingsFieldset from "../settings/SettingsFieldset"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import { useIsEncrypted } from "../../../hooks/useIsEncrypted.ts"; import { useMatrixClientContext } from "../../../contexts/MatrixClientContext.tsx"; import { useSettingValueAt } from "../../../hooks/useSettings.ts"; diff --git a/src/components/views/rooms/AppsDrawer.tsx b/src/components/views/rooms/AppsDrawer.tsx index 36df51f4cb..a5c869c0c3 100644 --- a/src/components/views/rooms/AppsDrawer.tsx +++ b/src/components/views/rooms/AppsDrawer.tsx @@ -6,25 +6,25 @@ 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, { AriaRole } from "react"; +import React, { type AriaRole } from "react"; import classNames from "classnames"; -import { Resizable, Size } from "re-resizable"; -import { Room } from "matrix-js-sdk/src/matrix"; -import { IWidget } from "matrix-widget-api"; +import { Resizable, type Size } from "re-resizable"; +import { type Room } from "matrix-js-sdk/src/matrix"; +import { type IWidget } from "matrix-widget-api"; import AppTile from "../elements/AppTile"; import dis from "../../../dispatcher/dispatcher"; import * as ScalarMessaging from "../../../ScalarMessaging"; import WidgetUtils from "../../../utils/WidgetUtils"; import WidgetEchoStore from "../../../stores/WidgetEchoStore"; -import ResizeNotifier from "../../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../../utils/ResizeNotifier"; import ResizeHandle from "../elements/ResizeHandle"; -import Resizer, { IConfig } from "../../../resizer/resizer"; +import Resizer, { type IConfig } from "../../../resizer/resizer"; import PercentageDistributor from "../../../resizer/distributors/percentage"; import { Container, WidgetLayoutStore } from "../../../stores/widgets/WidgetLayoutStore"; import { clamp, percentageOf, percentageWithin } from "../../../utils/numbers"; import UIStore from "../../../stores/UIStore"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import Spinner from "../elements/Spinner"; import SdkConfig from "../../../SdkConfig"; diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index 33d3435dfc..f884bd3946 100644 --- a/src/components/views/rooms/Autocomplete.tsx +++ b/src/components/views/rooms/Autocomplete.tsx @@ -6,13 +6,17 @@ 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, { createRef, RefObject } from "react"; +import React, { createRef, type RefObject } from "react"; import classNames from "classnames"; import { flatMap } from "lodash"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { defer } from "matrix-js-sdk/src/utils"; -import Autocompleter, { ICompletion, ISelectionRange, IProviderCompletions } from "../../../autocomplete/Autocompleter"; +import Autocompleter, { + type ICompletion, + type ISelectionRange, + type IProviderCompletions, +} from "../../../autocomplete/Autocompleter"; import SettingsStore from "../../../settings/SettingsStore"; import RoomContext from "../../../contexts/RoomContext"; diff --git a/src/components/views/rooms/AuxPanel.tsx b/src/components/views/rooms/AuxPanel.tsx index 67a25d433d..9e34a6f40d 100644 --- a/src/components/views/rooms/AuxPanel.tsx +++ b/src/components/views/rooms/AuxPanel.tsx @@ -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 React, { ReactNode } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import AppsDrawer from "./AppsDrawer"; import SettingsStore from "../../../settings/SettingsStore"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; import { UIFeature } from "../../../settings/UIFeature"; -import ResizeNotifier from "../../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../../utils/ResizeNotifier"; import LegacyCallViewForRoom from "../voip/LegacyCallViewForRoom"; import { objectHasDiff } from "../../../utils/objects"; diff --git a/src/components/views/rooms/BasicMessageComposer.tsx b/src/components/views/rooms/BasicMessageComposer.tsx index ffa5e99f92..93952663b9 100644 --- a/src/components/views/rooms/BasicMessageComposer.tsx +++ b/src/components/views/rooms/BasicMessageComposer.tsx @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { createRef, ClipboardEvent, SyntheticEvent } from "react"; -import { Room, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { createRef, type ClipboardEvent, type SyntheticEvent } from "react"; +import { type Room, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import EMOTICON_REGEX from "emojibase-regex/emoticon"; import { logger } from "matrix-js-sdk/src/logger"; import { EMOTICON_TO_EMOJI } from "@matrix-org/emojibase-bindings"; -import EditorModel from "../../../editor/model"; +import type EditorModel from "../../../editor/model"; import HistoryManager from "../../../editor/history"; -import { Caret, setSelection } from "../../../editor/caret"; +import { type Caret, setSelection } from "../../../editor/caret"; import { formatRange, formatRangeAsLink, @@ -24,7 +24,7 @@ import { } from "../../../editor/operations"; import { getCaretOffsetAndText, getRangeForSelection } from "../../../editor/dom"; import Autocomplete, { generateCompletionDomId } from "../rooms/Autocomplete"; -import { getAutoCompleteCreator, Part, SerializedPart, Type } from "../../../editor/parts"; +import { getAutoCompleteCreator, type Part, type SerializedPart, Type } from "../../../editor/parts"; import { parseEvent, parsePlainTextMessage } from "../../../editor/deserialize"; import { renderModel } from "../../../editor/render"; import SettingsStore from "../../../settings/SettingsStore"; @@ -32,11 +32,11 @@ import { IS_MAC, Key } from "../../../Keyboard"; import { CommandCategories, CommandMap, parseCommandString } from "../../../SlashCommands"; import Range from "../../../editor/range"; import MessageComposerFormatBar, { Formatting } from "./MessageComposerFormatBar"; -import DocumentOffset from "../../../editor/offset"; -import { IDiff } from "../../../editor/diff"; -import AutocompleteWrapperModel from "../../../editor/autocomplete"; -import DocumentPosition from "../../../editor/position"; -import { ICompletion } from "../../../autocomplete/Autocompleter"; +import type DocumentOffset from "../../../editor/offset"; +import { type IDiff } from "../../../editor/diff"; +import type AutocompleteWrapperModel from "../../../editor/autocomplete"; +import type DocumentPosition from "../../../editor/position"; +import { type ICompletion } from "../../../autocomplete/Autocompleter"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { ALTERNATE_KEY_NAME, KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/rooms/CollapsibleButton.tsx b/src/components/views/rooms/CollapsibleButton.tsx index f1387a7a1b..40aff57d7b 100644 --- a/src/components/views/rooms/CollapsibleButton.tsx +++ b/src/components/views/rooms/CollapsibleButton.tsx @@ -9,10 +9,10 @@ Please see LICENSE files in the repository root for full details. import React, { useContext } from "react"; import classNames from "classnames"; -import AccessibleButton, { ButtonProps } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonProps } from "../elements/AccessibleButton"; import { OverflowMenuContext } from "./MessageComposerButtons"; import { IconizedContextMenuOption } from "../context_menus/IconizedContextMenu"; -import { Ref } from "../../../accessibility/roving/types"; +import { type Ref } from "../../../accessibility/roving/types"; interface Props extends Omit, "element"> { inputRef?: Ref; diff --git a/src/components/views/rooms/E2EIcon.tsx b/src/components/views/rooms/E2EIcon.tsx index 8542ad4b4b..5ec75af734 100644 --- a/src/components/views/rooms/E2EIcon.tsx +++ b/src/components/views/rooms/E2EIcon.tsx @@ -7,11 +7,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 React, { ComponentProps, CSSProperties } from "react"; +import React, { type ComponentProps, type CSSProperties } from "react"; import classNames from "classnames"; import { Tooltip } from "@vector-im/compound-web"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; import { E2EStatus } from "../../../utils/ShieldUtils"; diff --git a/src/components/views/rooms/EditMessageComposer.tsx b/src/components/views/rooms/EditMessageComposer.tsx index dcae215352..92d60b7571 100644 --- a/src/components/views/rooms/EditMessageComposer.tsx +++ b/src/components/views/rooms/EditMessageComposer.tsx @@ -6,12 +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 React, { createRef, KeyboardEvent } from "react"; +import React, { createRef, type KeyboardEvent } from "react"; import classNames from "classnames"; -import { EventStatus, MatrixEvent, Room, MsgType } from "matrix-js-sdk/src/matrix"; +import { EventStatus, type MatrixEvent, type Room, MsgType } 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"; -import { ReplacementEvent, RoomMessageEventContent, RoomMessageTextEventContent } from "matrix-js-sdk/src/types"; +import { type Composer as ComposerEvent } from "@matrix-org/analytics-events/types/typescript/Composer"; +import { + type ReplacementEvent, + type RoomMessageEventContent, + type RoomMessageTextEventContent, +} from "matrix-js-sdk/src/types"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; @@ -20,25 +24,25 @@ import { getCaretOffsetAndText } from "../../../editor/dom"; import { htmlSerializeIfNeeded, textSerialize, containsEmote, stripEmoteCommand } from "../../../editor/serialize"; import { findEditableEvent } from "../../../utils/EventUtils"; import { parseEvent } from "../../../editor/deserialize"; -import { CommandPartCreator, Part, PartCreator, SerializedPart } from "../../../editor/parts"; -import EditorStateTransfer from "../../../utils/EditorStateTransfer"; +import { CommandPartCreator, type Part, type PartCreator, type SerializedPart } from "../../../editor/parts"; +import type EditorStateTransfer from "../../../utils/EditorStateTransfer"; import BasicMessageComposer, { REGEX_EMOTICON } from "./BasicMessageComposer"; import { CommandCategories } from "../../../SlashCommands"; import { Action } from "../../../dispatcher/actions"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import SendHistoryManager from "../../../SendHistoryManager"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import AccessibleButton from "../elements/AccessibleButton"; import { createRedactEventDialog } from "../dialogs/ConfirmRedactDialog"; import SettingsStore from "../../../settings/SettingsStore"; -import { withMatrixClientHOC, MatrixClientProps } from "../../../contexts/MatrixClientContext"; +import { withMatrixClientHOC, type MatrixClientProps } from "../../../contexts/MatrixClientContext"; import RoomContext from "../../../contexts/RoomContext"; import { ComposerType } from "../../../dispatcher/payloads/ComposerInsertPayload"; import { getSlashCommand, isSlashCommand, runSlashCommand, shouldSendAnyway } from "../../../editor/commands"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { PosthogAnalytics } from "../../../PosthogAnalytics"; import { editorRoomKey, editorStateKey } from "../../../Editing"; -import DocumentOffset from "../../../editor/offset"; +import type DocumentOffset from "../../../editor/offset"; import { attachMentions, attachRelation } from "./SendMessageComposer"; import { filterBoolean } from "../../../utils/arrays"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/rooms/EmojiButton.tsx b/src/components/views/rooms/EmojiButton.tsx index 79184486b1..f28834506e 100644 --- a/src/components/views/rooms/EmojiButton.tsx +++ b/src/components/views/rooms/EmojiButton.tsx @@ -10,7 +10,7 @@ import classNames from "classnames"; import React, { useContext } from "react"; import { _t } from "../../../languageHandler"; -import ContextMenu, { aboveLeftOf, MenuProps, useContextMenu } from "../../structures/ContextMenu"; +import ContextMenu, { aboveLeftOf, type MenuProps, useContextMenu } from "../../structures/ContextMenu"; import EmojiPicker from "../emojipicker/EmojiPicker"; import { CollapsibleButton } from "./CollapsibleButton"; import { OverflowMenuContext } from "./MessageComposerButtons"; diff --git a/src/components/views/rooms/EventPreview.tsx b/src/components/views/rooms/EventPreview.tsx index 8e7f53a330..bf44211d29 100644 --- a/src/components/views/rooms/EventPreview.tsx +++ b/src/components/views/rooms/EventPreview.tsx @@ -6,8 +6,8 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { HTMLProps, JSX, useContext, useState } from "react"; -import { IContent, M_POLL_START, MatrixEvent, MatrixEventEvent, MsgType } from "matrix-js-sdk/src/matrix"; +import React, { type HTMLProps, type JSX, useContext, useState } from "react"; +import { type IContent, M_POLL_START, type MatrixEvent, MatrixEventEvent, MsgType } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 1d2983dd03..17d09b661d 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -7,21 +7,21 @@ 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, { createRef, forwardRef, JSX, MouseEvent, ReactNode } from "react"; +import React, { createRef, forwardRef, type JSX, type MouseEvent, type ReactNode } from "react"; import classNames from "classnames"; import { EventStatus, EventType, - MatrixEvent, + type MatrixEvent, MatrixEventEvent, MsgType, - NotificationCountType, - Relations, - RelationType, - Room, + type NotificationCountType, + type Relations, + type RelationType, + type Room, RoomEvent, - RoomMember, - Thread, + type RoomMember, + type Thread, ThreadEvent, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; @@ -31,7 +31,7 @@ import { DecryptionFailureCode, EventShieldColour, EventShieldReason, - UserVerificationStatus, + type UserVerificationStatus, } from "matrix-js-sdk/src/crypto-api"; import { Tooltip } from "@vector-im/compound-web"; @@ -46,35 +46,35 @@ import RoomAvatar from "../avatars/RoomAvatar"; import MessageContextMenu from "../context_menus/MessageContextMenu"; import { aboveRightOf } from "../../structures/ContextMenu"; import { objectHasDiff } from "../../../utils/objects"; -import EditorStateTransfer from "../../../utils/EditorStateTransfer"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import type EditorStateTransfer from "../../../utils/EditorStateTransfer"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { StaticNotificationState } from "../../../stores/notifications/StaticNotificationState"; import NotificationBadge from "./NotificationBadge"; -import LegacyCallEventGrouper from "../../structures/LegacyCallEventGrouper"; -import { ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInsertPayload"; +import type LegacyCallEventGrouper from "../../structures/LegacyCallEventGrouper"; +import { type ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInsertPayload"; import { Action } from "../../../dispatcher/actions"; import PlatformPeg from "../../../PlatformPeg"; import MemberAvatar from "../avatars/MemberAvatar"; import SenderProfile from "../messages/SenderProfile"; import MessageTimestamp from "../messages/MessageTimestamp"; -import { IReadReceiptPosition } from "./ReadReceiptMarker"; +import { type IReadReceiptPosition } from "./ReadReceiptMarker"; import MessageActionBar from "../messages/MessageActionBar"; import ReactionsRow from "../messages/ReactionsRow"; import { getEventDisplayInfo } from "../../../utils/EventRenderingUtils"; import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; import { MediaEventHelper } from "../../../utils/MediaEventHelper"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import { copyPlaintext, getSelectedText } from "../../../utils/strings"; import { DecryptionFailureTracker } from "../../../DecryptionFailureTracker"; import RedactedBody from "../messages/RedactedBody"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { shouldDisplayReply } from "../../../utils/Reply"; import PosthogTrackers from "../../../PosthogTrackers"; import TileErrorBoundary from "../messages/TileErrorBoundary"; import { haveRendererForEvent, isMessageEvent, renderTile } from "../../../events/EventTileFactory"; import ThreadSummary, { ThreadMessagePreview } from "./ThreadSummary"; import { ReadReceiptGroup } from "./ReadReceiptGroup"; -import { ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; +import { type ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; import { isLocalRoom } from "../../../utils/localRoom/isLocalRoom"; import { ElementCall } from "../../../models/Call"; import { UnreadNotificationBadge } from "./NotificationBadge/UnreadNotificationBadge"; diff --git a/src/components/views/rooms/EventTile/EventTileThreadToolbar.tsx b/src/components/views/rooms/EventTile/EventTileThreadToolbar.tsx index 29f3a43633..fd71f7b54a 100644 --- a/src/components/views/rooms/EventTile/EventTileThreadToolbar.tsx +++ b/src/components/views/rooms/EventTile/EventTileThreadToolbar.tsx @@ -13,7 +13,7 @@ import { RovingAccessibleButton } from "../../../../accessibility/RovingTabIndex import Toolbar from "../../../../accessibility/Toolbar"; import { _t } from "../../../../languageHandler"; import { Icon as ViewInRoomIcon } from "../../../../../res/img/element-icons/view-in-room.svg"; -import { ButtonEvent } from "../../elements/AccessibleButton"; +import { type ButtonEvent } from "../../elements/AccessibleButton"; export function EventTileThreadToolbar({ viewInRoom, diff --git a/src/components/views/rooms/ExtraTile.tsx b/src/components/views/rooms/ExtraTile.tsx index d33db33e16..636291023e 100644 --- a/src/components/views/rooms/ExtraTile.tsx +++ b/src/components/views/rooms/ExtraTile.tsx @@ -11,8 +11,8 @@ import classNames from "classnames"; import { RovingAccessibleButton } from "../../../accessibility/RovingTabIndex"; import NotificationBadge from "./NotificationBadge"; -import { NotificationState } from "../../../stores/notifications/NotificationState"; -import { ButtonEvent } from "../elements/AccessibleButton"; +import { type NotificationState } from "../../../stores/notifications/NotificationState"; +import { type ButtonEvent } from "../elements/AccessibleButton"; import useHover from "../../../hooks/useHover"; interface ExtraTileProps { diff --git a/src/components/views/rooms/JumpToBottomButton.tsx b/src/components/views/rooms/JumpToBottomButton.tsx index a33fa7857b..b2a69cb5fe 100644 --- a/src/components/views/rooms/JumpToBottomButton.tsx +++ b/src/components/views/rooms/JumpToBottomButton.tsx @@ -9,7 +9,7 @@ import React from "react"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; interface IProps { numUnreadMessages?: number; diff --git a/src/components/views/rooms/LinkPreviewGroup.tsx b/src/components/views/rooms/LinkPreviewGroup.tsx index 4ba64cee8c..db6365f3c8 100644 --- a/src/components/views/rooms/LinkPreviewGroup.tsx +++ b/src/components/views/rooms/LinkPreviewGroup.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext, useEffect } from "react"; -import { MatrixEvent, MatrixError, IPreviewUrlResponse, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, MatrixError, type IPreviewUrlResponse, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import CloseIcon from "@vector-im/compound-design-tokens/assets/web/icons/close"; diff --git a/src/components/views/rooms/LinkPreviewWidget.tsx b/src/components/views/rooms/LinkPreviewWidget.tsx index 07d41ea534..5d65578bab 100644 --- a/src/components/views/rooms/LinkPreviewWidget.tsx +++ b/src/components/views/rooms/LinkPreviewWidget.tsx @@ -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, { ComponentProps, createRef, ReactNode } from "react"; +import React, { type ComponentProps, createRef, type ReactNode } from "react"; import { decode } from "html-entities"; -import { MatrixEvent, IPreviewUrlResponse } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type IPreviewUrlResponse } from "matrix-js-sdk/src/matrix"; import { Linkify } from "../../../HtmlUtils"; import SettingsStore from "../../../settings/SettingsStore"; diff --git a/src/components/views/rooms/LiveContentSummary.tsx b/src/components/views/rooms/LiveContentSummary.tsx index 3ffcc6c0ec..1f5d36e8d0 100644 --- a/src/components/views/rooms/LiveContentSummary.tsx +++ b/src/components/views/rooms/LiveContentSummary.tsx @@ -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 React, { FC } from "react"; +import React, { type FC } from "react"; import classNames from "classnames"; import { _t } from "../../../languageHandler"; -import { Call } from "../../../models/Call"; +import { type Call } from "../../../models/Call"; import { useParticipantCount } from "../../../hooks/useCall"; export enum LiveContentType { diff --git a/src/components/views/rooms/MemberList/MemberListHeaderView.tsx b/src/components/views/rooms/MemberList/MemberListHeaderView.tsx index 4dd5fd73c4..3c6fad8aa1 100644 --- a/src/components/views/rooms/MemberList/MemberListHeaderView.tsx +++ b/src/components/views/rooms/MemberList/MemberListHeaderView.tsx @@ -11,7 +11,7 @@ import InviteIcon from "@vector-im/compound-design-tokens/assets/web/icons/user- import { UserAddIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { Flex } from "../../../utils/Flex"; -import { MemberListViewState } from "../../../viewmodels/memberlist/MemberListViewModel"; +import { type MemberListViewState } from "../../../viewmodels/memberlist/MemberListViewModel"; import { _t } from "../../../../languageHandler"; interface TooltipProps { diff --git a/src/components/views/rooms/MemberList/MemberListView.tsx b/src/components/views/rooms/MemberList/MemberListView.tsx index 328420d737..e514144e31 100644 --- a/src/components/views/rooms/MemberList/MemberListView.tsx +++ b/src/components/views/rooms/MemberList/MemberListView.tsx @@ -7,12 +7,12 @@ Please see LICENSE files in the repository root for full details. import { Form } from "@vector-im/compound-web"; import React from "react"; -import { List, ListRowProps } from "react-virtualized/dist/commonjs/List"; +import { List, type ListRowProps } from "react-virtualized/dist/commonjs/List"; import { AutoSizer } from "react-virtualized"; import { Flex } from "../../../utils/Flex"; import { - MemberWithSeparator, + type MemberWithSeparator, SEPARATOR, useMemberListViewModel, } from "../../../viewmodels/memberlist/MemberListViewModel"; diff --git a/src/components/views/rooms/MemberList/tiles/RoomMemberTileView.tsx b/src/components/views/rooms/MemberList/tiles/RoomMemberTileView.tsx index 7aeb32a343..d72be8452c 100644 --- a/src/components/views/rooms/MemberList/tiles/RoomMemberTileView.tsx +++ b/src/components/views/rooms/MemberList/tiles/RoomMemberTileView.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import DisambiguatedProfile from "../../../messages/DisambiguatedProfile"; -import { RoomMember } from "../../../../../models/rooms/RoomMember"; +import { type RoomMember } from "../../../../../models/rooms/RoomMember"; import { useMemberTileViewModel } from "../../../../viewmodels/memberlist/tiles/MemberTileViewModel"; import { E2EIconView } from "./common/E2EIconView"; import AvatarPresenceIconView from "./common/PresenceIconView"; diff --git a/src/components/views/rooms/MemberList/tiles/ThreePidInviteTileView.tsx b/src/components/views/rooms/MemberList/tiles/ThreePidInviteTileView.tsx index 5a177eb5bf..bd7b6062ef 100644 --- a/src/components/views/rooms/MemberList/tiles/ThreePidInviteTileView.tsx +++ b/src/components/views/rooms/MemberList/tiles/ThreePidInviteTileView.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { useThreePidTileViewModel } from "../../../../viewmodels/memberlist/tiles/ThreePidTileViewModel"; -import { ThreePIDInvite } from "../../../../../models/rooms/ThreePIDInvite"; +import { type ThreePIDInvite } from "../../../../../models/rooms/ThreePIDInvite"; import BaseAvatar from "../../../avatars/BaseAvatar"; import { MemberTileView } from "./common/MemberTileView"; import { InvitedIconView } from "./common/InvitedIconView"; diff --git a/src/components/views/rooms/MessageComposer.tsx b/src/components/views/rooms/MessageComposer.tsx index 3cab66201a..ceeb1ddebf 100644 --- a/src/components/views/rooms/MessageComposer.tsx +++ b/src/components/views/rooms/MessageComposer.tsx @@ -6,51 +6,51 @@ 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, { createRef, ReactNode } from "react"; +import React, { createRef, type ReactNode } from "react"; import classNames from "classnames"; import { - IEventRelation, - MatrixEvent, - Room, - RoomMember, + type IEventRelation, + type MatrixEvent, + type Room, + type RoomMember, EventType, THREAD_RELATION_TYPE, } from "matrix-js-sdk/src/matrix"; -import { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import { Tooltip } from "@vector-im/compound-web"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import dis from "../../../dispatcher/dispatcher"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import Stickerpicker from "./Stickerpicker"; -import { makeRoomPermalink, RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { makeRoomPermalink, type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import E2EIcon from "./E2EIcon"; import SettingsStore from "../../../settings/SettingsStore"; -import { aboveLeftOf, MenuProps } from "../../structures/ContextMenu"; +import { aboveLeftOf, type MenuProps } from "../../structures/ContextMenu"; import ReplyPreview from "./ReplyPreview"; import { UserIdentityWarning } from "./UserIdentityWarning"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import VoiceRecordComposerTile from "./VoiceRecordComposerTile"; import { VoiceRecordingStore } from "../../../stores/VoiceRecordingStore"; import { RecordingState } from "../../../audio/VoiceRecording"; -import ResizeNotifier from "../../../utils/ResizeNotifier"; -import { E2EStatus } from "../../../utils/ShieldUtils"; -import SendMessageComposer, { SendMessageComposer as SendMessageComposerClass } from "./SendMessageComposer"; -import { ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInsertPayload"; +import type ResizeNotifier from "../../../utils/ResizeNotifier"; +import { type E2EStatus } from "../../../utils/ShieldUtils"; +import SendMessageComposer, { type SendMessageComposer as SendMessageComposerClass } from "./SendMessageComposer"; +import { type ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInsertPayload"; import { Action } from "../../../dispatcher/actions"; -import EditorModel from "../../../editor/model"; +import type EditorModel from "../../../editor/model"; import UIStore, { UI_EVENTS } from "../../../stores/UIStore"; import RoomContext from "../../../contexts/RoomContext"; -import { SettingUpdatedPayload } from "../../../dispatcher/payloads/SettingUpdatedPayload"; +import { type SettingUpdatedPayload } from "../../../dispatcher/payloads/SettingUpdatedPayload"; import MessageComposerButtons from "./MessageComposerButtons"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { isLocalRoom } from "../../../utils/localRoom/isLocalRoom"; -import { VoiceMessageRecording } from "../../../audio/VoiceMessageRecording"; +import { type VoiceMessageRecording } from "../../../audio/VoiceMessageRecording"; import { SendWysiwygComposer, sendMessage, getConversionFunctions } from "./wysiwyg_composer/"; -import { MatrixClientProps, withMatrixClientHOC } from "../../../contexts/MatrixClientContext"; +import { type MatrixClientProps, withMatrixClientHOC } from "../../../contexts/MatrixClientContext"; import { UIFeature } from "../../../settings/UIFeature"; import { formatTimeLeft } from "../../../DateUtils"; import RoomReplacedSvg from "../../../../res/img/room_replaced.svg"; diff --git a/src/components/views/rooms/MessageComposerButtons.tsx b/src/components/views/rooms/MessageComposerButtons.tsx index b70c39fb02..67110998eb 100644 --- a/src/components/views/rooms/MessageComposerButtons.tsx +++ b/src/components/views/rooms/MessageComposerButtons.tsx @@ -7,12 +7,18 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -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 { + type IEventRelation, + type Room, + type MatrixClient, + THREAD_RELATION_TYPE, + M_POLL_START, +} from "matrix-js-sdk/src/matrix"; +import React, { createContext, type ReactElement, type ReactNode, useContext, useRef } from "react"; import { _t } from "../../../languageHandler"; import { CollapsibleButton } from "./CollapsibleButton"; -import { MenuProps } from "../../structures/ContextMenu"; +import { type MenuProps } from "../../structures/ContextMenu"; import dis from "../../../dispatcher/dispatcher"; import ErrorDialog from "../dialogs/ErrorDialog"; import { LocationButton } from "../location"; @@ -27,7 +33,7 @@ import IconizedContextMenu, { IconizedContextMenuOptionList } from "../context_m import { EmojiButton } from "./EmojiButton"; import { filterBoolean } from "../../../utils/arrays"; import { useSettingValue } from "../../../hooks/useSettings"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import { useScopedRoomContext } from "../../../contexts/ScopedRoomContext.tsx"; interface IProps { diff --git a/src/components/views/rooms/NewRoomIntro.tsx b/src/components/views/rooms/NewRoomIntro.tsx index cb15917e37..d28d114470 100644 --- a/src/components/views/rooms/NewRoomIntro.tsx +++ b/src/components/views/rooms/NewRoomIntro.tsx @@ -7,17 +7,17 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext } from "react"; -import { EventType, Room, User, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { EventType, type Room, type User, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import DMRoomMap from "../../../utils/DMRoomMap"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import MiniAvatarUploader, { AVATAR_SIZE } from "../elements/MiniAvatarUploader"; import RoomAvatar from "../avatars/RoomAvatar"; import defaultDispatcher from "../../../dispatcher/dispatcher"; -import { ViewUserPayload } from "../../../dispatcher/payloads/ViewUserPayload"; +import { type ViewUserPayload } from "../../../dispatcher/payloads/ViewUserPayload"; import { Action } from "../../../dispatcher/actions"; import SpaceStore from "../../../stores/spaces/SpaceStore"; import { showSpaceInvite } from "../../../utils/space"; diff --git a/src/components/views/rooms/NotificationBadge.tsx b/src/components/views/rooms/NotificationBadge.tsx index f2fe9b0886..fcb53ca17c 100644 --- a/src/components/views/rooms/NotificationBadge.tsx +++ b/src/components/views/rooms/NotificationBadge.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { Tooltip } from "@vector-im/compound-web"; import SettingsStore from "../../../settings/SettingsStore"; -import { XOR } from "../../../@types/common"; -import { NotificationState, NotificationStateEvents } from "../../../stores/notifications/NotificationState"; +import { type XOR } from "../../../@types/common"; +import { type NotificationState, NotificationStateEvents } from "../../../stores/notifications/NotificationState"; import { _t } from "../../../languageHandler"; import { NotificationLevel } from "../../../stores/notifications/NotificationLevel"; import { StatelessNotificationBadge } from "./NotificationBadge/StatelessNotificationBadge"; diff --git a/src/components/views/rooms/NotificationBadge/StatelessNotificationBadge.tsx b/src/components/views/rooms/NotificationBadge/StatelessNotificationBadge.tsx index 7031814607..c324e8ccbd 100644 --- a/src/components/views/rooms/NotificationBadge/StatelessNotificationBadge.tsx +++ b/src/components/views/rooms/NotificationBadge/StatelessNotificationBadge.tsx @@ -10,10 +10,10 @@ import React, { forwardRef } from "react"; import classNames from "classnames"; import { formatCount } from "../../../../utils/FormattingUtils"; -import AccessibleButton, { ButtonEvent } from "../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../elements/AccessibleButton"; import { NotificationLevel } from "../../../../stores/notifications/NotificationLevel"; import { useSettingValue } from "../../../../hooks/useSettings"; -import { XOR } from "../../../../@types/common"; +import { type XOR } from "../../../../@types/common"; interface Props { symbol: string | null; diff --git a/src/components/views/rooms/NotificationBadge/UnreadNotificationBadge.tsx b/src/components/views/rooms/NotificationBadge/UnreadNotificationBadge.tsx index 1c75b34704..2a682b982c 100644 --- a/src/components/views/rooms/NotificationBadge/UnreadNotificationBadge.tsx +++ b/src/components/views/rooms/NotificationBadge/UnreadNotificationBadge.tsx @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import React from "react"; import { useUnreadNotifications } from "../../../../hooks/useUnreadNotifications"; diff --git a/src/components/views/rooms/PinnedEventTile.tsx b/src/components/views/rooms/PinnedEventTile.tsx index 42cc21026f..cfa9db2526 100644 --- a/src/components/views/rooms/PinnedEventTile.tsx +++ b/src/components/views/rooms/PinnedEventTile.tsx @@ -7,8 +7,8 @@ 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, { JSX, useCallback, useState } from "react"; -import { EventTimeline, EventType, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import React, { type JSX, useCallback, useState } from "react"; +import { EventTimeline, EventType, type MatrixEvent, type Room } from "matrix-js-sdk/src/matrix"; import { IconButton, Menu, MenuItem, Separator, Tooltip } from "@vector-im/compound-web"; import ViewIcon from "@vector-im/compound-design-tokens/assets/web/icons/visibility-on"; import UnpinIcon from "@vector-im/compound-design-tokens/assets/web/icons/unpin"; @@ -24,15 +24,15 @@ import MessageEvent from "../messages/MessageEvent"; import MemberAvatar from "../avatars/MemberAvatar"; import { _t } from "../../../languageHandler"; import { getUserNameColorClass } from "../../../utils/FormattingUtils"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import { useMatrixClientContext } from "../../../contexts/MatrixClientContext"; import { useRoomState } from "../../../hooks/useRoomState"; import { isContentActionable } from "../../../utils/EventUtils"; import { getForwardableEvent } from "../../../events"; -import { OpenForwardDialogPayload } from "../../../dispatcher/payloads/OpenForwardDialogPayload"; +import { type OpenForwardDialogPayload } from "../../../dispatcher/payloads/OpenForwardDialogPayload"; import { createRedactEventDialog } from "../dialogs/ConfirmRedactDialog"; -import { ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; +import { type ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; import PinningUtils from "../../../utils/PinningUtils.ts"; import PosthogTrackers from "../../../PosthogTrackers.ts"; diff --git a/src/components/views/rooms/PinnedMessageBanner.tsx b/src/components/views/rooms/PinnedMessageBanner.tsx index 4ba9e0a40c..2b9f335c7f 100644 --- a/src/components/views/rooms/PinnedMessageBanner.tsx +++ b/src/components/views/rooms/PinnedMessageBanner.tsx @@ -6,10 +6,10 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX, useEffect, useRef, useState } from "react"; +import React, { type JSX, useEffect, useRef, useState } from "react"; import PinIcon from "@vector-im/compound-design-tokens/assets/web/icons/pin-solid"; import { Button } from "@vector-im/compound-web"; -import { MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type Room } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; import { usePinnedEvents, useSortedFetchedPinnedEvents } from "../../../hooks/usePinnedEvents"; @@ -18,14 +18,14 @@ import RightPanelStore from "../../../stores/right-panel/RightPanelStore"; import { RightPanelPhases } from "../../../stores/right-panel/RightPanelStorePhases"; import { useEventEmitter } from "../../../hooks/useEventEmitter"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import dis from "../../../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../../../dispatcher/actions"; import MessageEvent from "../messages/MessageEvent"; import PosthogTrackers from "../../../PosthogTrackers.ts"; import { EventPreview } from "./EventPreview.tsx"; -import ResizeNotifier from "../../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../../utils/ResizeNotifier"; /** * The props for the {@link PinnedMessageBanner} component. diff --git a/src/components/views/rooms/ReadReceiptGroup.tsx b/src/components/views/rooms/ReadReceiptGroup.tsx index 112b41329c..1c386f37eb 100644 --- a/src/components/views/rooms/ReadReceiptGroup.tsx +++ b/src/components/views/rooms/ReadReceiptGroup.tsx @@ -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 React, { PropsWithChildren } from "react"; -import { User } from "matrix-js-sdk/src/matrix"; +import React, { type PropsWithChildren } from "react"; +import { type User } from "matrix-js-sdk/src/matrix"; import { Tooltip } from "@vector-im/compound-web"; -import ReadReceiptMarker, { IReadReceiptPosition } from "./ReadReceiptMarker"; -import { IReadReceiptProps } from "./EventTile"; +import ReadReceiptMarker, { type IReadReceiptPosition } from "./ReadReceiptMarker"; +import { type IReadReceiptProps } from "./EventTile"; import AccessibleButton from "../elements/AccessibleButton"; import MemberAvatar from "../avatars/MemberAvatar"; import AutoHideScrollbar from "../../structures/AutoHideScrollbar"; diff --git a/src/components/views/rooms/ReadReceiptMarker.tsx b/src/components/views/rooms/ReadReceiptMarker.tsx index 9d4feb10c4..6b096d8917 100644 --- a/src/components/views/rooms/ReadReceiptMarker.tsx +++ b/src/components/views/rooms/ReadReceiptMarker.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { RoomMember } from "matrix-js-sdk/src/matrix"; +import { type RoomMember } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import NodeAnimator from "../../../NodeAnimator"; diff --git a/src/components/views/rooms/ReplyPreview.tsx b/src/components/views/rooms/ReplyPreview.tsx index f426a924b8..4782f52abe 100644 --- a/src/components/views/rooms/ReplyPreview.tsx +++ b/src/components/views/rooms/ReplyPreview.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import dis from "../../../dispatcher/dispatcher"; import { _t } from "../../../languageHandler"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import ReplyTile from "./ReplyTile"; -import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; +import RoomContext, { type TimelineRenderingType } from "../../../contexts/RoomContext"; import AccessibleButton from "../elements/AccessibleButton"; function cancelQuoting(context: TimelineRenderingType): void { diff --git a/src/components/views/rooms/ReplyTile.tsx b/src/components/views/rooms/ReplyTile.tsx index 73352a806e..8084b59ba3 100644 --- a/src/components/views/rooms/ReplyTile.tsx +++ b/src/components/views/rooms/ReplyTile.tsx @@ -8,13 +8,13 @@ Please see LICENSE files in the repository root for full details. import React, { createRef } from "react"; import classNames from "classnames"; -import { MatrixEvent, MatrixEventEvent, EventType, MsgType } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, MatrixEventEvent, EventType, MsgType } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import SenderProfile from "../messages/SenderProfile"; import MImageReplyBody from "../messages/MImageReplyBody"; import { isVoiceMessage } from "../../../utils/EventUtils"; @@ -22,9 +22,9 @@ import { getEventDisplayInfo } from "../../../utils/EventRenderingUtils"; import MFileBody from "../messages/MFileBody"; import MemberAvatar from "../avatars/MemberAvatar"; import MVoiceMessageBody from "../messages/MVoiceMessageBody"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { renderReplyTile } from "../../../events/EventTileFactory"; -import { GetRelationsForEvent } from "../rooms/EventTile"; +import { type GetRelationsForEvent } from "../rooms/EventTile"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; interface IProps { diff --git a/src/components/views/rooms/RoomBreadcrumbs.tsx b/src/components/views/rooms/RoomBreadcrumbs.tsx index ce87718197..c677b32edc 100644 --- a/src/components/views/rooms/RoomBreadcrumbs.tsx +++ b/src/components/views/rooms/RoomBreadcrumbs.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { EmptyObject, Room } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject, type Room } from "matrix-js-sdk/src/matrix"; import { CSSTransition } from "react-transition-group"; import { BreadcrumbsStore } from "../../../stores/BreadcrumbsStore"; @@ -18,8 +18,8 @@ import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import { useRovingTabIndex } from "../../../accessibility/RovingTabIndex"; import Toolbar from "../../../accessibility/Toolbar"; import { Action } from "../../../dispatcher/actions"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; interface IState { // Both of these control the animation for the breadcrumbs. For details on the diff --git a/src/components/views/rooms/RoomContextDetails.tsx b/src/components/views/rooms/RoomContextDetails.tsx index cd6ca327c0..001e92997d 100644 --- a/src/components/views/rooms/RoomContextDetails.tsx +++ b/src/components/views/rooms/RoomContextDetails.tsx @@ -6,8 +6,8 @@ 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 { Room } from "matrix-js-sdk/src/matrix"; -import React, { HTMLAttributes, ReactHTML } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; +import React, { type HTMLAttributes, type ReactHTML } from "react"; import { roomContextDetails } from "../../../utils/i18n-helpers"; diff --git a/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx b/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx index 76e91cada6..7675f66070 100644 --- a/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx +++ b/src/components/views/rooms/RoomHeader/CallGuestLinkButton.tsx @@ -9,7 +9,7 @@ import ExternalLinkIcon from "@vector-im/compound-design-tokens/assets/web/icons import { Button, IconButton, Tooltip } from "@vector-im/compound-web"; import React, { useCallback } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { EventType, JoinRule, Room } from "matrix-js-sdk/src/matrix"; +import { EventType, JoinRule, type Room } from "matrix-js-sdk/src/matrix"; import Modal from "../../../../Modal"; import { ShareDialog } from "../../dialogs/ShareDialog"; diff --git a/src/components/views/rooms/RoomHeader/RoomHeader.tsx b/src/components/views/rooms/RoomHeader/RoomHeader.tsx index a81ba2724c..964295f0be 100644 --- a/src/components/views/rooms/RoomHeader/RoomHeader.tsx +++ b/src/components/views/rooms/RoomHeader/RoomHeader.tsx @@ -18,7 +18,7 @@ import VerifiedIcon from "@vector-im/compound-design-tokens/assets/web/icons/ver import ErrorIcon from "@vector-im/compound-design-tokens/assets/web/icons/error"; import PublicIcon from "@vector-im/compound-design-tokens/assets/web/icons/public"; import { JoinRule, type Room } from "matrix-js-sdk/src/matrix"; -import { ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; +import { type ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; import { useRoomName } from "../../../../hooks/useRoomName.ts"; import { RightPanelPhases } from "../../../../stores/right-panel/RightPanelStorePhases.ts"; @@ -45,9 +45,9 @@ import { RoomKnocksBar } from "../RoomKnocksBar.tsx"; import { isVideoRoom as calcIsVideoRoom } from "../../../../utils/video-rooms.ts"; import { notificationLevelToIndicator } from "../../../../utils/notifications.ts"; import { CallGuestLinkButton } from "./CallGuestLinkButton.tsx"; -import { ButtonEvent } from "../../elements/AccessibleButton.tsx"; +import { type ButtonEvent } from "../../elements/AccessibleButton.tsx"; import WithPresenceIndicator, { useDmMember } from "../../avatars/WithPresenceIndicator.tsx"; -import { IOOBData } from "../../../../stores/ThreepidInviteStore.ts"; +import { type IOOBData } from "../../../../stores/ThreepidInviteStore.ts"; import { MainSplitContentType } from "../../../structures/RoomView.tsx"; import defaultDispatcher from "../../../../dispatcher/dispatcher.ts"; import { RoomSettingsTab } from "../../dialogs/RoomSettingsDialog.tsx"; diff --git a/src/components/views/rooms/RoomHeader/VideoRoomChatButton.tsx b/src/components/views/rooms/RoomHeader/VideoRoomChatButton.tsx index b1b8ae071e..792b2903df 100644 --- a/src/components/views/rooms/RoomHeader/VideoRoomChatButton.tsx +++ b/src/components/views/rooms/RoomHeader/VideoRoomChatButton.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React, { useContext } from "react"; import ChatIcon from "@vector-im/compound-design-tokens/assets/web/icons/chat-solid"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { IconButton, Tooltip } from "@vector-im/compound-web"; import { _t } from "../../../../languageHandler"; @@ -17,7 +17,7 @@ import { NotificationStateEvents } from "../../../../stores/notifications/Notifi import { NotificationLevel } from "../../../../stores/notifications/NotificationLevel"; import { RightPanelPhases } from "../../../../stores/right-panel/RightPanelStorePhases"; import { SDKContext } from "../../../../contexts/SDKContext"; -import { ButtonEvent } from "../../elements/AccessibleButton"; +import { type ButtonEvent } from "../../elements/AccessibleButton"; import { ToggleableIcon } from "./toggle/ToggleableIcon"; /** diff --git a/src/components/views/rooms/RoomHeader/toggle/ToggleableIcon.tsx b/src/components/views/rooms/RoomHeader/toggle/ToggleableIcon.tsx index f90679b744..72f4d6bb8c 100644 --- a/src/components/views/rooms/RoomHeader/toggle/ToggleableIcon.tsx +++ b/src/components/views/rooms/RoomHeader/toggle/ToggleableIcon.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; -import { RightPanelPhases } from "../../../../../stores/right-panel/RightPanelStorePhases"; +import { type RightPanelPhases } from "../../../../../stores/right-panel/RightPanelStorePhases"; import { useToggled } from "./useToggled"; type Props = { diff --git a/src/components/views/rooms/RoomHeader/toggle/useToggled.tsx b/src/components/views/rooms/RoomHeader/toggle/useToggled.tsx index 9d3a5ed0cb..3dedc55581 100644 --- a/src/components/views/rooms/RoomHeader/toggle/useToggled.tsx +++ b/src/components/views/rooms/RoomHeader/toggle/useToggled.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. import { useContext } from "react"; -import { RightPanelPhases } from "../../../../../stores/right-panel/RightPanelStorePhases"; +import { type RightPanelPhases } from "../../../../../stores/right-panel/RightPanelStorePhases"; import { CurrentRightPanelPhaseContext } from "../../../../../contexts/CurrentRightPanelPhaseContext"; /** diff --git a/src/components/views/rooms/RoomInfoLine.tsx b/src/components/views/rooms/RoomInfoLine.tsx index 438b804d88..7956566409 100644 --- a/src/components/views/rooms/RoomInfoLine.tsx +++ b/src/components/views/rooms/RoomInfoLine.tsx @@ -6,8 +6,8 @@ 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, { FC } from "react"; -import { Room, JoinRule, MatrixClient } from "matrix-js-sdk/src/matrix"; +import React, { type FC } from "react"; +import { type Room, JoinRule, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/rooms/RoomKnocksBar.tsx b/src/components/views/rooms/RoomKnocksBar.tsx index 64d6956625..ffddfecb4a 100644 --- a/src/components/views/rooms/RoomKnocksBar.tsx +++ b/src/components/views/rooms/RoomKnocksBar.tsx @@ -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 { EventTimeline, JoinRule, MatrixError, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { EventTimeline, JoinRule, type MatrixError, type Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import React, { ReactElement, ReactNode, useCallback, useState, VFC } from "react"; +import React, { type ReactElement, type ReactNode, useCallback, useState, type VFC } from "react"; import { CloseIcon, CheckIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import dis from "../../../dispatcher/dispatcher"; diff --git a/src/components/views/rooms/RoomList.tsx b/src/components/views/rooms/RoomList.tsx index 22e4f49469..af409f12cd 100644 --- a/src/components/views/rooms/RoomList.tsx +++ b/src/components/views/rooms/RoomList.tsx @@ -6,43 +6,43 @@ 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 { EventType, Room, RoomType } from "matrix-js-sdk/src/matrix"; -import React, { ComponentType, createRef, ReactComponentElement, SyntheticEvent } from "react"; +import { EventType, type Room, RoomType } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentType, createRef, type ReactComponentElement, type SyntheticEvent } from "react"; -import { IState as IRovingTabIndexState, RovingTabIndexProvider } from "../../../accessibility/RovingTabIndex"; +import { type IState as IRovingTabIndexState, RovingTabIndexProvider } from "../../../accessibility/RovingTabIndex"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { Action } from "../../../dispatcher/actions"; import defaultDispatcher from "../../../dispatcher/dispatcher"; -import { ActionPayload } from "../../../dispatcher/payloads"; -import { ViewRoomDeltaPayload } from "../../../dispatcher/payloads/ViewRoomDeltaPayload"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ActionPayload } from "../../../dispatcher/payloads"; +import { type ViewRoomDeltaPayload } from "../../../dispatcher/payloads/ViewRoomDeltaPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { useEventEmitterState } from "../../../hooks/useEventEmitter"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import PosthogTrackers from "../../../PosthogTrackers"; import SettingsStore from "../../../settings/SettingsStore"; import { useFeatureEnabled } from "../../../hooks/useSettings"; import { UIComponent } from "../../../settings/UIFeature"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; -import { ITagMap } from "../../../stores/room-list/algorithms/models"; -import { DefaultTagID, TagID } from "../../../stores/room-list/models"; +import { type ITagMap } from "../../../stores/room-list/algorithms/models"; +import { DefaultTagID, type TagID } from "../../../stores/room-list/models"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; import RoomListStore, { LISTS_UPDATE_EVENT } from "../../../stores/room-list/RoomListStore"; import { isMetaSpace, - ISuggestedRoom, + type ISuggestedRoom, MetaSpace, - SpaceKey, + type SpaceKey, UPDATE_SELECTED_SPACE, UPDATE_SUGGESTED_ROOMS, } from "../../../stores/spaces"; import SpaceStore from "../../../stores/spaces/SpaceStore"; import { arrayFastClone, arrayHasDiff } from "../../../utils/arrays"; import { objectShallowClone, objectWithOnly } from "../../../utils/objects"; -import ResizeNotifier from "../../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../../utils/ResizeNotifier"; import { shouldShowSpaceInvite, showAddExistingRooms, showCreateNewRoom, showSpaceInvite } from "../../../utils/space"; -import { ChevronFace, ContextMenuTooltipButton, MenuProps, useContextMenu } from "../../structures/ContextMenu"; +import { ChevronFace, ContextMenuTooltipButton, type MenuProps, useContextMenu } from "../../structures/ContextMenu"; import RoomAvatar from "../avatars/RoomAvatar"; import { BetaPill } from "../beta/BetaCard"; import IconizedContextMenu, { @@ -50,7 +50,7 @@ import IconizedContextMenu, { IconizedContextMenuOptionList, } from "../context_menus/IconizedContextMenu"; import ExtraTile from "./ExtraTile"; -import RoomSublist, { IAuxButtonProps } from "./RoomSublist"; +import RoomSublist, { type IAuxButtonProps } from "./RoomSublist"; import { SdkContextClass } from "../../../contexts/SDKContext"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; diff --git a/src/components/views/rooms/RoomListHeader.tsx b/src/components/views/rooms/RoomListHeader.tsx index aa41c1f2ba..0640aaba33 100644 --- a/src/components/views/rooms/RoomListHeader.tsx +++ b/src/components/views/rooms/RoomListHeader.tsx @@ -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 { EventType, RoomType, Room, RoomEvent, ClientEvent } from "matrix-js-sdk/src/matrix"; +import { EventType, RoomType, type Room, RoomEvent, ClientEvent } from "matrix-js-sdk/src/matrix"; import React, { useContext, useEffect, useState } from "react"; import { Tooltip } from "@vector-im/compound-web"; @@ -14,7 +14,7 @@ import MatrixClientContext from "../../../contexts/MatrixClientContext"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; import { Action } from "../../../dispatcher/actions"; import defaultDispatcher from "../../../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { useDispatcher } from "../../../hooks/useDispatcher"; import { useEventEmitterState, useTypedEventEmitter, useTypedEventEmitterState } from "../../../hooks/useEventEmitter"; import { useFeatureEnabled } from "../../../hooks/useSettings"; @@ -24,7 +24,7 @@ import { UIComponent } from "../../../settings/UIFeature"; import { getMetaSpaceName, MetaSpace, - SpaceKey, + type SpaceKey, UPDATE_HOME_BEHAVIOUR, UPDATE_SELECTED_SPACE, } from "../../../stores/spaces"; @@ -40,7 +40,7 @@ import { ChevronFace, ContextMenuTooltipButton, useContextMenu, - MenuProps, + type MenuProps, ContextMenuButton, } from "../../structures/ContextMenu"; import { BetaPill } from "../beta/BetaCard"; diff --git a/src/components/views/rooms/RoomPreviewBar.tsx b/src/components/views/rooms/RoomPreviewBar.tsx index 7b1791d0cd..f823bb7294 100644 --- a/src/components/views/rooms/RoomPreviewBar.tsx +++ b/src/components/views/rooms/RoomPreviewBar.tsx @@ -6,11 +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 React, { ChangeEvent, ReactNode } from "react"; -import { Room, RoomMember, EventType, RoomType, JoinRule, MatrixError } from "matrix-js-sdk/src/matrix"; -import { KnownMembership, RoomJoinRulesEventContent } from "matrix-js-sdk/src/types"; +import React, { type ChangeEvent, type ReactNode } from "react"; +import { type Room, type RoomMember, EventType, RoomType, JoinRule, type MatrixError } from "matrix-js-sdk/src/matrix"; +import { KnownMembership, type RoomJoinRulesEventContent } from "matrix-js-sdk/src/types"; import classNames from "classnames"; -import { RoomPreviewOpts, RoomViewLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; +import { + type RoomPreviewOpts, + RoomViewLifecycle, +} from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import dis from "../../../dispatcher/dispatcher"; @@ -18,7 +21,7 @@ import { _t, UserFriendlyError } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; import IdentityAuthClient from "../../../IdentityAuthClient"; import InviteReason from "../elements/InviteReason"; -import { IOOBData } from "../../../stores/ThreepidInviteStore"; +import { type IOOBData } from "../../../stores/ThreepidInviteStore"; import Spinner from "../elements/Spinner"; import AccessibleButton from "../elements/AccessibleButton"; import RoomAvatar from "../avatars/RoomAvatar"; diff --git a/src/components/views/rooms/RoomPreviewCard.tsx b/src/components/views/rooms/RoomPreviewCard.tsx index bce6fc22b3..e626b12b04 100644 --- a/src/components/views/rooms/RoomPreviewCard.tsx +++ b/src/components/views/rooms/RoomPreviewCard.tsx @@ -6,8 +6,8 @@ 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, { FC, useContext, useState } from "react"; -import { Room, JoinRule } from "matrix-js-sdk/src/matrix"; +import React, { type FC, useContext, useState } from "react"; +import { type Room, JoinRule } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/rooms/RoomSearchAuxPanel.tsx b/src/components/views/rooms/RoomSearchAuxPanel.tsx index 1c3ec238b2..fa0a24abe9 100644 --- a/src/components/views/rooms/RoomSearchAuxPanel.tsx +++ b/src/components/views/rooms/RoomSearchAuxPanel.tsx @@ -14,7 +14,7 @@ import { IconButton, Link } from "@vector-im/compound-web"; import { _t } from "../../../languageHandler"; import { PosthogScreenTracker } from "../../../PosthogTrackers"; import SearchWarning, { WarningKind } from "../elements/SearchWarning"; -import { SearchInfo, SearchScope } from "../../../Searching"; +import { type SearchInfo, SearchScope } from "../../../Searching"; import InlineSpinner from "../elements/InlineSpinner"; interface Props { diff --git a/src/components/views/rooms/RoomSublist.tsx b/src/components/views/rooms/RoomSublist.tsx index dac72994b0..de313246b1 100644 --- a/src/components/views/rooms/RoomSublist.tsx +++ b/src/components/views/rooms/RoomSublist.tsx @@ -8,40 +8,40 @@ 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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import classNames from "classnames"; -import { Enable, Resizable } from "re-resizable"; -import { Direction } from "re-resizable/lib/resizer"; +import { type Enable, Resizable } from "re-resizable"; +import { type Direction } from "re-resizable/lib/resizer"; import * as React from "react"; -import { ComponentType, createRef, ReactComponentElement, ReactNode } from "react"; +import { type ComponentType, createRef, type ReactComponentElement, type ReactNode } from "react"; import { polyfillTouchEvent } from "../../../@types/polyfill"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { RovingAccessibleButton, RovingTabIndexWrapper } from "../../../accessibility/RovingTabIndex"; import { Action } from "../../../dispatcher/actions"; -import defaultDispatcher, { MatrixDispatcher } from "../../../dispatcher/dispatcher"; -import { ActionPayload } from "../../../dispatcher/payloads"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import defaultDispatcher, { type MatrixDispatcher } from "../../../dispatcher/dispatcher"; +import { type ActionPayload } from "../../../dispatcher/payloads"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { _t } from "../../../languageHandler"; -import { ListNotificationState } from "../../../stores/notifications/ListNotificationState"; +import { type ListNotificationState } from "../../../stores/notifications/ListNotificationState"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; import { ListAlgorithm, SortAlgorithm } from "../../../stores/room-list/algorithms/models"; -import { ListLayout } from "../../../stores/room-list/ListLayout"; -import { DefaultTagID, TagID } from "../../../stores/room-list/models"; +import { type ListLayout } from "../../../stores/room-list/ListLayout"; +import { DefaultTagID, type TagID } from "../../../stores/room-list/models"; import RoomListLayoutStore from "../../../stores/room-list/RoomListLayoutStore"; import RoomListStore, { LISTS_UPDATE_EVENT, LISTS_LOADING_EVENT } from "../../../stores/room-list/RoomListStore"; import { arrayFastClone, arrayHasOrderChange } from "../../../utils/arrays"; import { objectExcluding, objectHasDiff } from "../../../utils/objects"; -import ResizeNotifier from "../../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../../utils/ResizeNotifier"; import ContextMenu, { ChevronFace, ContextMenuTooltipButton, StyledMenuItemCheckbox, StyledMenuItemRadio, } from "../../structures/ContextMenu"; -import AccessibleButton, { ButtonEvent } from "../../views/elements/AccessibleButton"; -import ExtraTile from "./ExtraTile"; +import AccessibleButton, { type ButtonEvent } from "../../views/elements/AccessibleButton"; +import type ExtraTile from "./ExtraTile"; import SettingsStore from "../../../settings/SettingsStore"; import { SlidingSyncManager } from "../../../SlidingSyncManager"; import NotificationBadge from "./NotificationBadge"; diff --git a/src/components/views/rooms/RoomTile.tsx b/src/components/views/rooms/RoomTile.tsx index cbeb562077..3eafb671cb 100644 --- a/src/components/views/rooms/RoomTile.tsx +++ b/src/components/views/rooms/RoomTile.tsx @@ -8,32 +8,32 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import classNames from "classnames"; import type { Call } from "../../../models/Call"; import { RovingTabIndexWrapper } from "../../../accessibility/RovingTabIndex"; -import AccessibleButton, { ButtonEvent } from "../../views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../views/elements/AccessibleButton"; import defaultDispatcher from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; import { _t } from "../../../languageHandler"; -import { ChevronFace, ContextMenuTooltipButton, MenuProps } from "../../structures/ContextMenu"; -import { DefaultTagID, TagID } from "../../../stores/room-list/models"; -import { MessagePreview, MessagePreviewStore } from "../../../stores/room-list/MessagePreviewStore"; +import { ChevronFace, ContextMenuTooltipButton, type MenuProps } from "../../structures/ContextMenu"; +import { DefaultTagID, type TagID } from "../../../stores/room-list/models"; +import { type MessagePreview, MessagePreviewStore } from "../../../stores/room-list/MessagePreviewStore"; import DecoratedRoomAvatar from "../avatars/DecoratedRoomAvatar"; import { RoomNotifState } from "../../../RoomNotifs"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { RoomNotificationContextMenu } from "../context_menus/RoomNotificationContextMenu"; import NotificationBadge from "./NotificationBadge"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import { RoomNotificationStateStore } from "../../../stores/notifications/RoomNotificationStateStore"; -import { NotificationState, NotificationStateEvents } from "../../../stores/notifications/NotificationState"; +import { type NotificationState, NotificationStateEvents } from "../../../stores/notifications/NotificationState"; import { EchoChamber } from "../../../stores/local-echo/EchoChamber"; -import { CachedRoomKey, RoomEchoChamber } from "../../../stores/local-echo/RoomEchoChamber"; +import { CachedRoomKey, type RoomEchoChamber } from "../../../stores/local-echo/RoomEchoChamber"; import { PROPERTY_UPDATED } from "../../../stores/local-echo/GenericEchoChamber"; import PosthogTrackers from "../../../PosthogTrackers"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { RoomGeneralContextMenu } from "../context_menus/RoomGeneralContextMenu"; diff --git a/src/components/views/rooms/RoomTileCallSummary.tsx b/src/components/views/rooms/RoomTileCallSummary.tsx index 8c1db5f34b..21975fc49d 100644 --- a/src/components/views/rooms/RoomTileCallSummary.tsx +++ b/src/components/views/rooms/RoomTileCallSummary.tsx @@ -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 React, { FC } from "react"; +import React, { type FC } from "react"; import type { Call } from "../../../models/Call"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/rooms/RoomTileSubtitle.tsx b/src/components/views/rooms/RoomTileSubtitle.tsx index 883dc5db0d..715a09c9c4 100644 --- a/src/components/views/rooms/RoomTileSubtitle.tsx +++ b/src/components/views/rooms/RoomTileSubtitle.tsx @@ -10,8 +10,8 @@ import React from "react"; import classNames from "classnames"; import { ThreadsIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; -import { MessagePreview } from "../../../stores/room-list/MessagePreviewStore"; -import { Call } from "../../../models/Call"; +import { type MessagePreview } from "../../../stores/room-list/MessagePreviewStore"; +import { type Call } from "../../../models/Call"; import { RoomTileCallSummary } from "./RoomTileCallSummary"; interface Props { diff --git a/src/components/views/rooms/RoomUpgradeWarningBar.tsx b/src/components/views/rooms/RoomUpgradeWarningBar.tsx index 3b5685c229..e29c8648df 100644 --- a/src/components/views/rooms/RoomUpgradeWarningBar.tsx +++ b/src/components/views/rooms/RoomUpgradeWarningBar.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import Modal from "../../../Modal"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/rooms/SearchResultTile.tsx b/src/components/views/rooms/SearchResultTile.tsx index 825a5d235f..f110ff17ea 100644 --- a/src/components/views/rooms/SearchResultTile.tsx +++ b/src/components/views/rooms/SearchResultTile.tsx @@ -8,16 +8,17 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; import SettingsStore from "../../../settings/SettingsStore"; -import { RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks"; import DateSeparator from "../messages/DateSeparator"; import EventTile from "./EventTile"; import { shouldFormContinuation } from "../../structures/MessagePanel"; import { wantsDateSeparator } from "../../../DateUtils"; -import LegacyCallEventGrouper, { buildLegacyCallEventGroupers } from "../../structures/LegacyCallEventGrouper"; +import type LegacyCallEventGrouper from "../../structures/LegacyCallEventGrouper"; +import { buildLegacyCallEventGroupers } from "../../structures/LegacyCallEventGrouper"; import { haveRendererForEvent } from "../../../events/EventTileFactory"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/components/views/rooms/SendMessageComposer.tsx b/src/components/views/rooms/SendMessageComposer.tsx index d12a84e0c2..374a14a3aa 100644 --- a/src/components/views/rooms/SendMessageComposer.tsx +++ b/src/components/views/rooms/SendMessageComposer.tsx @@ -6,22 +6,22 @@ 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, { createRef, KeyboardEvent, SyntheticEvent } from "react"; +import React, { createRef, type KeyboardEvent, type SyntheticEvent } from "react"; import { - IContent, - MatrixEvent, - IEventRelation, - IMentions, - Room, + type IContent, + type MatrixEvent, + type IEventRelation, + type IMentions, + type Room, EventType, MsgType, RelationType, THREAD_RELATION_TYPE, } from "matrix-js-sdk/src/matrix"; -import { DebouncedFunc, throttle } from "lodash"; +import { type DebouncedFunc, throttle } from "lodash"; import { logger } from "matrix-js-sdk/src/logger"; -import { Composer as ComposerEvent } from "@matrix-org/analytics-events/types/typescript/Composer"; -import { RoomMessageEventContent } from "matrix-js-sdk/src/types"; +import { type Composer as ComposerEvent } from "@matrix-org/analytics-events/types/typescript/Composer"; +import { type RoomMessageEventContent } from "matrix-js-sdk/src/types"; import dis from "../../../dispatcher/dispatcher"; import EditorModel from "../../../editor/model"; @@ -35,19 +35,19 @@ import { unescapeMessage, } from "../../../editor/serialize"; import BasicMessageComposer, { REGEX_EMOTICON } from "./BasicMessageComposer"; -import { CommandPartCreator, Part, PartCreator, SerializedPart, Type } from "../../../editor/parts"; +import { CommandPartCreator, type Part, type PartCreator, type SerializedPart, Type } from "../../../editor/parts"; import { findEditableEvent } from "../../../utils/EventUtils"; import SendHistoryManager from "../../../SendHistoryManager"; import { CommandCategories } from "../../../SlashCommands"; import ContentMessages from "../../../ContentMessages"; -import { withMatrixClientHOC, MatrixClientProps } from "../../../contexts/MatrixClientContext"; +import { withMatrixClientHOC, type MatrixClientProps } from "../../../contexts/MatrixClientContext"; import { Action } from "../../../dispatcher/actions"; import { containsEmoji } from "../../../effects/utils"; import { CHAT_EFFECTS } from "../../../effects"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import SettingsStore from "../../../settings/SettingsStore"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import { decorateStartSendingTime, sendRoundTripMetric } from "../../../sendTimePerformanceMetrics"; import RoomContext, { TimelineRenderingType } from "../../../contexts/RoomContext"; import DocumentPosition from "../../../editor/position"; @@ -57,8 +57,8 @@ import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { PosthogAnalytics } from "../../../PosthogAnalytics"; import { addReplyToMessageContent } from "../../../utils/Reply"; import { doMaybeLocalRoomAction } from "../../../utils/local-room"; -import { Caret } from "../../../editor/caret"; -import { IDiff } from "../../../editor/diff"; +import { type Caret } from "../../../editor/caret"; +import { type IDiff } from "../../../editor/diff"; import { getBlobSafeMimeType } from "../../../utils/blobs"; import { EMOJI_REGEX } from "../../../HtmlUtils"; diff --git a/src/components/views/rooms/Stickerpicker.tsx b/src/components/views/rooms/Stickerpicker.tsx index 448e05ac55..3ad0ad99ba 100644 --- a/src/components/views/rooms/Stickerpicker.tsx +++ b/src/components/views/rooms/Stickerpicker.tsx @@ -6,23 +6,23 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room, ClientEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, ClientEvent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { IWidget } from "matrix-widget-api"; +import { type IWidget } from "matrix-widget-api"; -import { _t, _td, TranslationKey } from "../../../languageHandler"; +import { _t, _td, type TranslationKey } from "../../../languageHandler"; import AppTile from "../elements/AppTile"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import dis from "../../../dispatcher/dispatcher"; import AccessibleButton from "../elements/AccessibleButton"; -import WidgetUtils, { UserWidget } from "../../../utils/WidgetUtils"; +import WidgetUtils, { type UserWidget } from "../../../utils/WidgetUtils"; import PersistedElement from "../elements/PersistedElement"; import { IntegrationManagers } from "../../../integrations/IntegrationManagers"; import ContextMenu, { ChevronFace } from "../../structures/ContextMenu"; import { WidgetType } from "../../../widgets/WidgetType"; import { WidgetMessagingStore } from "../../../stores/widgets/WidgetMessagingStore"; -import { ActionPayload } from "../../../dispatcher/payloads"; -import ScalarAuthClient from "../../../ScalarAuthClient"; +import { type ActionPayload } from "../../../dispatcher/payloads"; +import type ScalarAuthClient from "../../../ScalarAuthClient"; import GenericElementContextMenu from "../context_menus/GenericElementContextMenu"; import RightPanelStore from "../../../stores/right-panel/RightPanelStore"; import { UPDATE_EVENT } from "../../../stores/AsyncStore"; diff --git a/src/components/views/rooms/ThirdPartyMemberInfo.tsx b/src/components/views/rooms/ThirdPartyMemberInfo.tsx index cee38fc078..9723df3fcc 100644 --- a/src/components/views/rooms/ThirdPartyMemberInfo.tsx +++ b/src/components/views/rooms/ThirdPartyMemberInfo.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { EventType, MatrixEvent, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixEvent, type Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { Button, Text } from "@vector-im/compound-web"; diff --git a/src/components/views/rooms/ThreadSummary.tsx b/src/components/views/rooms/ThreadSummary.tsx index 1ec6a56e78..f56ffc43cb 100644 --- a/src/components/views/rooms/ThreadSummary.tsx +++ b/src/components/views/rooms/ThreadSummary.tsx @@ -7,18 +7,18 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext } from "react"; -import { Thread, ThreadEvent, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type Thread, ThreadEvent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { IndicatorIcon } from "@vector-im/compound-web"; import ThreadIconSolid from "@vector-im/compound-design-tokens/assets/web/icons/threads-solid"; import { _t } from "../../../languageHandler"; import { CardContext } from "../right_panel/context"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import PosthogTrackers from "../../../PosthogTrackers"; import { useTypedEventEmitterState } from "../../../hooks/useEventEmitter"; import MemberAvatar from "../avatars/MemberAvatar"; import { Action } from "../../../dispatcher/actions"; -import { ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; +import { type ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload"; import defaultDispatcher from "../../../dispatcher/dispatcher"; import { useUnreadNotifications } from "../../../hooks/useUnreadNotifications"; import { notificationLevelToIndicator } from "../../../utils/notifications"; diff --git a/src/components/views/rooms/TopUnreadMessagesBar.tsx b/src/components/views/rooms/TopUnreadMessagesBar.tsx index f9053cc31a..71960c9e25 100644 --- a/src/components/views/rooms/TopUnreadMessagesBar.tsx +++ b/src/components/views/rooms/TopUnreadMessagesBar.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { _t } from "../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; interface IProps { onScrollUpClick: (e: ButtonEvent) => void; diff --git a/src/components/views/rooms/UserIdentityWarning.tsx b/src/components/views/rooms/UserIdentityWarning.tsx index 1933767778..f880b5a0da 100644 --- a/src/components/views/rooms/UserIdentityWarning.tsx +++ b/src/components/views/rooms/UserIdentityWarning.tsx @@ -6,7 +6,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type Room, type RoomMember } from "matrix-js-sdk/src/matrix"; import { Button, Separator } from "@vector-im/compound-web"; import classNames from "classnames"; @@ -14,9 +14,9 @@ import { _t } from "../../../languageHandler"; import MemberAvatar from "../avatars/MemberAvatar"; import { useUserIdentityWarningViewModel, - ViolationPrompt, + type ViolationPrompt, } from "../../viewmodels/rooms/UserIdentityWarningViewModel.tsx"; -import { ButtonEvent } from "../elements/AccessibleButton.tsx"; +import { type ButtonEvent } from "../elements/AccessibleButton.tsx"; interface UserIdentityWarningProps { /** diff --git a/src/components/views/rooms/VoiceRecordComposerTile.tsx b/src/components/views/rooms/VoiceRecordComposerTile.tsx index 486c9475bc..14925297f0 100644 --- a/src/components/views/rooms/VoiceRecordComposerTile.tsx +++ b/src/components/views/rooms/VoiceRecordComposerTile.tsx @@ -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 React, { ReactNode } from "react"; -import { Room, IEventRelation, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode } from "react"; +import { type Room, type IEventRelation, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import { _t } from "../../../languageHandler"; import { RecordingState } from "../../../audio/VoiceRecording"; @@ -32,7 +32,7 @@ import defaultDispatcher from "../../../dispatcher/dispatcher"; import { attachMentions, attachRelation } from "./SendMessageComposer"; import { addReplyToMessageContent } from "../../../utils/Reply"; import RoomContext from "../../../contexts/RoomContext"; -import { IUpload, VoiceMessageRecording } from "../../../audio/VoiceMessageRecording"; +import { type IUpload, type VoiceMessageRecording } from "../../../audio/VoiceMessageRecording"; import { createVoiceMessageContent } from "../../../utils/createVoiceMessageContent"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/rooms/WhoIsTypingTile.tsx b/src/components/views/rooms/WhoIsTypingTile.tsx index 7c0c53c7a2..e59d135ca7 100644 --- a/src/components/views/rooms/WhoIsTypingTile.tsx +++ b/src/components/views/rooms/WhoIsTypingTile.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room, RoomEvent, RoomMember, RoomMemberEvent, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomEvent, type RoomMember, RoomMemberEvent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import * as WhoIsTyping from "../../../WhoIsTyping"; import Timer from "../../../utils/Timer"; diff --git a/src/components/views/rooms/wysiwyg_composer/ComposerContext.ts b/src/components/views/rooms/wysiwyg_composer/ComposerContext.ts index cfd8e6fa80..df6ef53f95 100644 --- a/src/components/views/rooms/wysiwyg_composer/ComposerContext.ts +++ b/src/components/views/rooms/wysiwyg_composer/ComposerContext.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { createContext, useContext } from "react"; -import { IEventRelation } from "matrix-js-sdk/src/matrix"; +import { type IEventRelation } from "matrix-js-sdk/src/matrix"; -import { SubSelection } from "./types"; -import EditorStateTransfer from "../../../../utils/EditorStateTransfer"; +import { type SubSelection } from "./types"; +import type EditorStateTransfer from "../../../../utils/EditorStateTransfer"; export function getDefaultContextValue(defaultValue?: Partial): { selection: SubSelection } { return { diff --git a/src/components/views/rooms/wysiwyg_composer/DynamicImportWysiwygComposer.tsx b/src/components/views/rooms/wysiwyg_composer/DynamicImportWysiwygComposer.tsx index f713832d92..f39b0f1e02 100644 --- a/src/components/views/rooms/wysiwyg_composer/DynamicImportWysiwygComposer.tsx +++ b/src/components/views/rooms/wysiwyg_composer/DynamicImportWysiwygComposer.tsx @@ -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 React, { ComponentProps, lazy, Suspense } from "react"; -import { ISendEventResponse } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentProps, lazy, Suspense } from "react"; +import { type ISendEventResponse } from "matrix-js-sdk/src/matrix"; // we need to import the types for TS, but do not import the sendMessage // function to avoid importing from "@vector-im/matrix-wysiwyg" -import { SendMessageParams } from "./utils/message"; +import { type SendMessageParams } from "./utils/message"; const SendComposer = lazy(() => import("./SendWysiwygComposer")); const EditComposer = lazy(() => import("./EditWysiwygComposer")); diff --git a/src/components/views/rooms/wysiwyg_composer/EditWysiwygComposer.tsx b/src/components/views/rooms/wysiwyg_composer/EditWysiwygComposer.tsx index 2de986a299..b5a3ea19f8 100644 --- a/src/components/views/rooms/wysiwyg_composer/EditWysiwygComposer.tsx +++ b/src/components/views/rooms/wysiwyg_composer/EditWysiwygComposer.tsx @@ -6,17 +6,17 @@ 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, { ForwardedRef, forwardRef, MutableRefObject, useMemo } from "react"; +import React, { type ForwardedRef, forwardRef, type MutableRefObject, useMemo } from "react"; import classNames from "classnames"; -import EditorStateTransfer from "../../../../utils/EditorStateTransfer"; +import type EditorStateTransfer from "../../../../utils/EditorStateTransfer"; import { WysiwygComposer } from "./components/WysiwygComposer"; import { EditionButtons } from "./components/EditionButtons"; import { useWysiwygEditActionHandler } from "./hooks/useWysiwygEditActionHandler"; import { useEditing } from "./hooks/useEditing"; import { useInitialContent } from "./hooks/useInitialContent"; import { ComposerContext, getDefaultContextValue } from "./ComposerContext"; -import { ComposerFunctions } from "./types"; +import { type ComposerFunctions } from "./types"; interface ContentProps { disabled?: boolean; diff --git a/src/components/views/rooms/wysiwyg_composer/SendWysiwygComposer.tsx b/src/components/views/rooms/wysiwyg_composer/SendWysiwygComposer.tsx index e705a0f486..b7a69f1b29 100644 --- a/src/components/views/rooms/wysiwyg_composer/SendWysiwygComposer.tsx +++ b/src/components/views/rooms/wysiwyg_composer/SendWysiwygComposer.tsx @@ -6,16 +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 React, { ForwardedRef, forwardRef, MutableRefObject, useMemo } from "react"; -import { IEventRelation } from "matrix-js-sdk/src/matrix"; +import React, { type ForwardedRef, forwardRef, type MutableRefObject, useMemo } from "react"; +import { type IEventRelation } from "matrix-js-sdk/src/matrix"; import { useWysiwygSendActionHandler } from "./hooks/useWysiwygSendActionHandler"; import { WysiwygComposer } from "./components/WysiwygComposer"; import { PlainTextComposer } from "./components/PlainTextComposer"; -import { ComposerFunctions } from "./types"; -import { E2EStatus } from "../../../../utils/ShieldUtils"; +import { type ComposerFunctions } from "./types"; +import { type E2EStatus } from "../../../../utils/ShieldUtils"; import E2EIcon from "../E2EIcon"; -import { MenuProps } from "../../../structures/ContextMenu"; +import { type MenuProps } from "../../../structures/ContextMenu"; import { Emoji } from "./components/Emoji"; import { ComposerContext, getDefaultContextValue } from "./ComposerContext"; diff --git a/src/components/views/rooms/wysiwyg_composer/components/EditionButtons.tsx b/src/components/views/rooms/wysiwyg_composer/components/EditionButtons.tsx index 0a6a78210c..a7b9f1195f 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/EditionButtons.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/EditionButtons.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { _t } from "../../../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../../elements/AccessibleButton"; interface EditionButtonsProps { onCancelClick: (e: ButtonEvent) => void; diff --git a/src/components/views/rooms/wysiwyg_composer/components/Editor.tsx b/src/components/views/rooms/wysiwyg_composer/components/Editor.tsx index 79bc19445c..e65bf278b6 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/Editor.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/Editor.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { CSSProperties, forwardRef, memo, MutableRefObject, ReactNode } from "react"; +import React, { type CSSProperties, forwardRef, memo, type MutableRefObject, type ReactNode } from "react"; import { useIsExpanded } from "../hooks/useIsExpanded"; import { useSelection } from "../hooks/useSelection"; diff --git a/src/components/views/rooms/wysiwyg_composer/components/Emoji.tsx b/src/components/views/rooms/wysiwyg_composer/components/Emoji.tsx index 94d7603c6b..0ef134cbd2 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/Emoji.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/Emoji.tsx @@ -8,10 +8,10 @@ Please see LICENSE files in the repository root for full details. import React from "react"; -import { MenuProps } from "../../../../structures/ContextMenu"; +import { type MenuProps } from "../../../../structures/ContextMenu"; import { EmojiButton } from "../../EmojiButton"; import dis from "../../../../../dispatcher/dispatcher"; -import { ComposerInsertPayload } from "../../../../../dispatcher/payloads/ComposerInsertPayload"; +import { type ComposerInsertPayload } from "../../../../../dispatcher/payloads/ComposerInsertPayload"; import { Action } from "../../../../../dispatcher/actions"; import { useScopedRoomContext } from "../../../../../contexts/ScopedRoomContext.tsx"; diff --git a/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx b/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx index e541d17e0d..b8551bf41d 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/FormattingButtons.tsx @@ -6,8 +6,8 @@ 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, { MouseEventHandler, ReactNode } from "react"; -import { FormattingFunctions, AllActionStates, ActionState } from "@vector-im/matrix-wysiwyg"; +import React, { type MouseEventHandler, type ReactNode } from "react"; +import { type FormattingFunctions, type AllActionStates, type ActionState } from "@vector-im/matrix-wysiwyg"; import classNames from "classnames"; import BoldIcon from "@vector-im/compound-design-tokens/assets/web/icons/bold"; import BulletedListIcon from "@vector-im/compound-design-tokens/assets/web/icons/list-bulleted"; @@ -23,11 +23,11 @@ import UnderlineIcon from "@vector-im/compound-design-tokens/assets/web/icons/un import LinkIcon from "@vector-im/compound-design-tokens/assets/web/icons/link"; import { _t } from "../../../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../../elements/AccessibleButton"; import { openLinkModal } from "./LinkModal"; import { useComposerContext } from "../ComposerContext"; import { KeyboardShortcut } from "../../../settings/KeyboardShortcut"; -import { KeyCombo } from "../../../../../KeyBindingsManager"; +import { type KeyCombo } from "../../../../../KeyBindingsManager"; interface ButtonProps { icon: ReactNode; diff --git a/src/components/views/rooms/wysiwyg_composer/components/LinkModal.tsx b/src/components/views/rooms/wysiwyg_composer/components/LinkModal.tsx index 31f153dbec..b65caf13e0 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/LinkModal.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/LinkModal.tsx @@ -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 { FormattingFunctions } from "@vector-im/matrix-wysiwyg"; -import React, { ChangeEvent, useState } from "react"; +import { type FormattingFunctions } from "@vector-im/matrix-wysiwyg"; +import React, { type ChangeEvent, useState } from "react"; import { _t } from "../../../../../languageHandler"; import Modal from "../../../../../Modal"; import Field from "../../../elements/Field"; -import { ComposerContextState } from "../ComposerContext"; +import { type ComposerContextState } from "../ComposerContext"; import { isSelectionEmpty, setSelection } from "../utils/selection"; import BaseDialog from "../../../dialogs/BaseDialog"; import DialogButtons from "../../../elements/DialogButtons"; diff --git a/src/components/views/rooms/wysiwyg_composer/components/PlainTextComposer.tsx b/src/components/views/rooms/wysiwyg_composer/components/PlainTextComposer.tsx index c826bbc98b..c3e31a9145 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/PlainTextComposer.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/PlainTextComposer.tsx @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import { IEventRelation } from "matrix-js-sdk/src/matrix"; -import React, { MutableRefObject, ReactNode } from "react"; +import { type IEventRelation } from "matrix-js-sdk/src/matrix"; +import React, { type MutableRefObject, type ReactNode } from "react"; import { useComposerFunctions } from "../hooks/useComposerFunctions"; import { useIsFocused } from "../hooks/useIsFocused"; import { usePlainTextInitialization } from "../hooks/usePlainTextInitialization"; import { usePlainTextListeners } from "../hooks/usePlainTextListeners"; import { useSetCursorPosition } from "../hooks/useSetCursorPosition"; -import { ComposerFunctions } from "../types"; +import { type ComposerFunctions } from "../types"; import { Editor } from "./Editor"; import { WysiwygAutocomplete } from "./WysiwygAutocomplete"; import { useSettingValue } from "../../../../../hooks/useSettings"; diff --git a/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx b/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx index b006ec2d35..2d1397aed8 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete.tsx @@ -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 React, { ForwardedRef, forwardRef, FunctionComponent } from "react"; -import { FormattingFunctions, MappedSuggestion } from "@vector-im/matrix-wysiwyg"; +import React, { type ForwardedRef, forwardRef, type FunctionComponent } from "react"; +import { type FormattingFunctions, type MappedSuggestion } from "@vector-im/matrix-wysiwyg"; import { logger } from "matrix-js-sdk/src/logger"; import Autocomplete from "../../Autocomplete"; -import { ICompletion } from "../../../../../autocomplete/Autocompleter"; +import { type ICompletion } from "../../../../../autocomplete/Autocompleter"; import { useMatrixClientContext } from "../../../../../contexts/MatrixClientContext"; import { getMentionDisplayText, getMentionAttributes, buildQuery } from "../utils/autocomplete"; import { useScopedRoomContext } from "../../../../../contexts/ScopedRoomContext.tsx"; diff --git a/src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer.tsx b/src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer.tsx index e7dd0213a4..9aecf59f3d 100644 --- a/src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer.tsx +++ b/src/components/views/rooms/wysiwyg_composer/components/WysiwygComposer.tsx @@ -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, { memo, MutableRefObject, ReactNode, useEffect, useMemo, useRef } from "react"; -import { IEventRelation } from "matrix-js-sdk/src/matrix"; +import React, { memo, type MutableRefObject, type ReactNode, useEffect, useMemo, useRef } from "react"; +import { type IEventRelation } from "matrix-js-sdk/src/matrix"; import { EMOTICON_TO_EMOJI } from "@matrix-org/emojibase-bindings"; -import { useWysiwyg, FormattingFunctions } from "@vector-im/matrix-wysiwyg"; +import { useWysiwyg, type FormattingFunctions } from "@vector-im/matrix-wysiwyg"; import classNames from "classnames"; -import Autocomplete from "../../Autocomplete"; +import type Autocomplete from "../../Autocomplete"; import { WysiwygAutocomplete } from "./WysiwygAutocomplete"; import { FormattingButtons } from "./FormattingButtons"; import { Editor } from "./Editor"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useComposerFunctions.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useComposerFunctions.ts index 20d877271e..115d6fc288 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useComposerFunctions.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useComposerFunctions.ts @@ -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 { RefObject, useMemo } from "react"; +import { type RefObject, useMemo } from "react"; import { setSelection } from "../utils/selection"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useEditing.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useEditing.ts index 8fbd856200..e48b00e82a 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useEditing.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useEditing.ts @@ -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 { ISendEventResponse } from "matrix-js-sdk/src/matrix"; +import { type ISendEventResponse } from "matrix-js-sdk/src/matrix"; import { useCallback, useState } from "react"; import { useMatrixClientContext } from "../../../../../contexts/MatrixClientContext"; -import EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; +import type EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; import { endEditing } from "../utils/editing"; import { editMessage } from "../utils/message"; import { useScopedRoomContext } from "../../../../../contexts/ScopedRoomContext.tsx"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useInitialContent.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useInitialContent.ts index 25afcd431f..f87e8d0f18 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useInitialContent.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useInitialContent.ts @@ -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 { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import { useMemo } from "react"; import { useMatrixClientContext } from "../../../../../contexts/MatrixClientContext"; import { parseEvent } from "../../../../../editor/deserialize"; -import { CommandPartCreator, Part } from "../../../../../editor/parts"; +import { CommandPartCreator, type Part } from "../../../../../editor/parts"; import SettingsStore from "../../../../../settings/SettingsStore"; -import EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; +import type EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; import { useScopedRoomContext } from "../../../../../contexts/ScopedRoomContext.tsx"; function getFormattedContent(editorStateTransfer: EditorStateTransfer): string { diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useInputEventProcessor.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useInputEventProcessor.ts index 26a72f4b96..5c8db0e749 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useInputEventProcessor.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useInputEventProcessor.ts @@ -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 { Wysiwyg, WysiwygEvent } from "@vector-im/matrix-wysiwyg"; +import { type Wysiwyg, type WysiwygEvent } from "@vector-im/matrix-wysiwyg"; import { useCallback } from "react"; -import { IEventRelation, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type IEventRelation, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { useSettingValue } from "../../../../../hooks/useSettings"; import { getKeyBindingsManager } from "../../../../../KeyBindingsManager"; @@ -16,14 +16,14 @@ import { KeyBindingAction } from "../../../../../accessibility/KeyboardShortcuts import { findEditableEvent } from "../../../../../utils/EventUtils"; import dis from "../../../../../dispatcher/dispatcher"; import { Action } from "../../../../../dispatcher/actions"; -import { IRoomState } from "../../../../structures/RoomView"; -import { ComposerContextState, useComposerContext } from "../ComposerContext"; -import EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; +import { type IRoomState } from "../../../../structures/RoomView"; +import { type ComposerContextState, useComposerContext } from "../ComposerContext"; +import type EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; import { useMatrixClientContext } from "../../../../../contexts/MatrixClientContext"; import { isCaretAtEnd, isCaretAtStart } from "../utils/selection"; import { getEventsFromEditorStateTransfer, getEventsFromRoom } from "../utils/event"; import { endEditing } from "../utils/editing"; -import Autocomplete from "../../Autocomplete"; +import type Autocomplete from "../../Autocomplete"; import { handleClipboardEvent, handleEventWithAutocomplete, isEventToHandleAsClipboardEvent } from "./utils"; import { useScopedRoomContext } from "../../../../../contexts/ScopedRoomContext.tsx"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useIsExpanded.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useIsExpanded.ts index 9941dda7bb..be178c374f 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useIsExpanded.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useIsExpanded.ts @@ -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 { MutableRefObject, useEffect, useState } from "react"; +import { type MutableRefObject, useEffect, useState } from "react"; export function useIsExpanded(ref: MutableRefObject, breakingPoint: number): boolean { const [isExpanded, setIsExpanded] = useState(false); diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useIsFocused.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useIsFocused.ts index 1391939713..3cae07c8be 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useIsFocused.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useIsFocused.ts @@ -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 { FocusEvent, useCallback, useEffect, useRef, useState } from "react"; +import { type FocusEvent, useCallback, useEffect, useRef, useState } from "react"; export function useIsFocused(): { isFocused: boolean; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextInitialization.ts b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextInitialization.ts index bc58160ce3..51a5f4b313 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextInitialization.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextInitialization.ts @@ -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 { RefObject, useEffect } from "react"; +import { type RefObject, useEffect } from "react"; export function usePlainTextInitialization(initialContent = "", ref: RefObject): void { useEffect(() => { diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts index 6dfae53efe..416cad5f58 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/usePlainTextListeners.ts @@ -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 { KeyboardEvent, RefObject, SyntheticEvent, useCallback, useRef, useState } from "react"; -import { AllowedMentionAttributes, MappedSuggestion } from "@vector-im/matrix-wysiwyg"; -import { IEventRelation } from "matrix-js-sdk/src/matrix"; +import { type KeyboardEvent, type RefObject, type SyntheticEvent, useCallback, useRef, useState } from "react"; +import { type AllowedMentionAttributes, type MappedSuggestion } from "@vector-im/matrix-wysiwyg"; +import { type IEventRelation } from "matrix-js-sdk/src/matrix"; import { useSettingValue } from "../../../../../hooks/useSettings"; import { IS_MAC, Key } from "../../../../../Keyboard"; -import Autocomplete from "../../Autocomplete"; +import type Autocomplete from "../../Autocomplete"; import { handleClipboardEvent, handleEventWithAutocomplete, isEventToHandleAsClipboardEvent } from "./utils"; import { useSuggestion } from "./useSuggestion"; import { isNotNull, isNotUndefined } from "../../../../../Typeguards"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useSelection.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useSelection.ts index 0689c466f6..10686f1078 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useSelection.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useSelection.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import { useCallback, useEffect } from "react"; import useFocus from "../../../../../hooks/useFocus"; -import { useComposerContext, ComposerContextState } from "../ComposerContext"; +import { useComposerContext, type ComposerContextState } from "../ComposerContext"; function setSelectionContext(composerContext: ComposerContextState): void { const selection = document.getSelection(); diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useSetCursorPosition.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useSetCursorPosition.ts index 8fd39111ff..5b164051eb 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useSetCursorPosition.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useSetCursorPosition.ts @@ -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 { RefObject, useEffect } from "react"; +import { type RefObject, useEffect } from "react"; import { setCursorPositionAtTheEnd } from "./utils"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts index 6e4473f454..f970830eb9 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useSuggestion.ts @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import { EMOTICON_TO_EMOJI } from "@matrix-org/emojibase-bindings"; -import { AllowedMentionAttributes, MappedSuggestion } from "@vector-im/matrix-wysiwyg"; -import { SyntheticEvent, useState, SetStateAction } from "react"; +import { type AllowedMentionAttributes, type MappedSuggestion } from "@vector-im/matrix-wysiwyg"; +import { type SyntheticEvent, useState, type SetStateAction } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { isNotNull } from "../../../../../Typeguards"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygEditActionHandler.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygEditActionHandler.ts index 8761b8addb..68d38eebcd 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygEditActionHandler.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygEditActionHandler.ts @@ -6,16 +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 { RefObject, useCallback, useRef } from "react"; +import { type RefObject, useCallback, useRef } from "react"; import defaultDispatcher from "../../../../../dispatcher/dispatcher"; import { Action } from "../../../../../dispatcher/actions"; -import { ActionPayload } from "../../../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../../../dispatcher/payloads"; import { TimelineRenderingType } from "../../../../../contexts/RoomContext"; import { useDispatcher } from "../../../../../hooks/useDispatcher"; import { focusComposer } from "./utils"; import { ComposerType } from "../../../../../dispatcher/payloads/ComposerInsertPayload"; -import { ComposerFunctions } from "../types"; +import { type ComposerFunctions } from "../types"; import { setSelection } from "../utils/selection"; import { useComposerContext } from "../ComposerContext"; import { useScopedRoomContext } from "../../../../../contexts/ScopedRoomContext.tsx"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts b/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts index cef635ef5b..c85242e60a 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/useWysiwygSendActionHandler.ts @@ -6,15 +6,15 @@ 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 { MutableRefObject, useCallback, useRef } from "react"; +import { type MutableRefObject, useCallback, useRef } from "react"; import defaultDispatcher from "../../../../../dispatcher/dispatcher"; import { Action } from "../../../../../dispatcher/actions"; -import { ActionPayload } from "../../../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../../../dispatcher/payloads"; import { TimelineRenderingType } from "../../../../../contexts/RoomContext"; import { useDispatcher } from "../../../../../hooks/useDispatcher"; import { focusComposer } from "./utils"; -import { ComposerFunctions } from "../types"; +import { type ComposerFunctions } from "../types"; import { ComposerType } from "../../../../../dispatcher/payloads/ComposerInsertPayload"; import { useComposerContext } from "../ComposerContext"; import { setSelection } from "../utils/selection"; diff --git a/src/components/views/rooms/wysiwyg_composer/hooks/utils.ts b/src/components/views/rooms/wysiwyg_composer/hooks/utils.ts index 48b73d352b..2b0569b868 100644 --- a/src/components/views/rooms/wysiwyg_composer/hooks/utils.ts +++ b/src/components/views/rooms/wysiwyg_composer/hooks/utils.ts @@ -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 { MutableRefObject, RefObject } from "react"; -import { IEventRelation, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { WysiwygEvent } from "@vector-im/matrix-wysiwyg"; +import { type MutableRefObject, type RefObject } from "react"; +import { type IEventRelation, type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type WysiwygEvent } from "@vector-im/matrix-wysiwyg"; -import { TimelineRenderingType } from "../../../../../contexts/RoomContext"; -import { IRoomState } from "../../../../structures/RoomView"; -import Autocomplete from "../../Autocomplete"; +import { type TimelineRenderingType } from "../../../../../contexts/RoomContext"; +import { type IRoomState } from "../../../../structures/RoomView"; +import type Autocomplete from "../../Autocomplete"; import { getKeyBindingsManager } from "../../../../../KeyBindingsManager"; import { KeyBindingAction } from "../../../../../accessibility/KeyboardShortcuts"; import { getBlobSafeMimeType } from "../../../../../utils/blobs"; diff --git a/src/components/views/rooms/wysiwyg_composer/utils/autocomplete.ts b/src/components/views/rooms/wysiwyg_composer/utils/autocomplete.ts index 529f15cff3..d4ee4cfc70 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/autocomplete.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/autocomplete.ts @@ -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 { AllowedMentionAttributes, MappedSuggestion } from "@vector-im/matrix-wysiwyg"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type AllowedMentionAttributes, type MappedSuggestion } from "@vector-im/matrix-wysiwyg"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; -import { ICompletion } from "../../../../../autocomplete/Autocompleter"; +import { type ICompletion } from "../../../../../autocomplete/Autocompleter"; import * as Avatar from "../../../../../Avatar"; /** diff --git a/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts b/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts index 5778faa61a..63fe8ca361 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/createMessageContent.ts @@ -7,8 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import { richToPlain, plainToRich } from "@vector-im/matrix-wysiwyg"; -import { IContent, IEventRelation, MatrixEvent, MsgType } from "matrix-js-sdk/src/matrix"; -import { ReplacementEvent, RoomMessageEventContent, RoomMessageTextEventContent } from "matrix-js-sdk/src/types"; +import { type IContent, type IEventRelation, MatrixEvent, MsgType } from "matrix-js-sdk/src/matrix"; +import { + type ReplacementEvent, + type RoomMessageEventContent, + type RoomMessageTextEventContent, +} from "matrix-js-sdk/src/types"; import SettingsStore from "../../../../../settings/SettingsStore"; import { parsePermalink } from "../../../../../utils/permalinks/Permalinks"; diff --git a/src/components/views/rooms/wysiwyg_composer/utils/editing.ts b/src/components/views/rooms/wysiwyg_composer/utils/editing.ts index fd5c7d1997..bda8a7a12f 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/editing.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/editing.ts @@ -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 { EventStatus, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { EventStatus, type MatrixClient } from "matrix-js-sdk/src/matrix"; -import { IRoomState } from "../../../../structures/RoomView"; +import { type IRoomState } from "../../../../structures/RoomView"; import dis from "../../../../../dispatcher/dispatcher"; import { Action } from "../../../../../dispatcher/actions"; -import EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; +import type EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; export function endEditing(roomContext: Pick): void { // todo local storage diff --git a/src/components/views/rooms/wysiwyg_composer/utils/event.ts b/src/components/views/rooms/wysiwyg_composer/utils/event.ts index 5860ae9ec6..a38a27dd92 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/event.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/event.ts @@ -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 { MatrixClient, MatrixEvent, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix"; -import EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; -import { IRoomState } from "../../../../structures/RoomView"; -import { ComposerContextState } from "../ComposerContext"; +import type EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; +import { type IRoomState } from "../../../../structures/RoomView"; +import { type ComposerContextState } from "../ComposerContext"; // From EditMessageComposer private get events(): MatrixEvent[] export function getEventsFromEditorStateTransfer( diff --git a/src/components/views/rooms/wysiwyg_composer/utils/isContentModified.ts b/src/components/views/rooms/wysiwyg_composer/utils/isContentModified.ts index 3821ca3512..ab215d3f91 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/isContentModified.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/isContentModified.ts @@ -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 { RoomMessageEventContent, RoomMessageTextEventContent } from "matrix-js-sdk/src/types"; +import { type RoomMessageEventContent, type RoomMessageTextEventContent } from "matrix-js-sdk/src/types"; -import EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; +import type EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; export function isContentModified( newContent: RoomMessageEventContent, diff --git a/src/components/views/rooms/wysiwyg_composer/utils/message.ts b/src/components/views/rooms/wysiwyg_composer/utils/message.ts index 8f95bf8da1..b794ba6fe4 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/message.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/message.ts @@ -6,15 +6,15 @@ 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 { Composer as ComposerEvent } from "@matrix-org/analytics-events/types/typescript/Composer"; +import { type Composer as ComposerEvent } from "@matrix-org/analytics-events/types/typescript/Composer"; import { - IEventRelation, - MatrixEvent, - ISendEventResponse, - MatrixClient, + type IEventRelation, + type MatrixEvent, + type ISendEventResponse, + type MatrixClient, THREAD_RELATION_TYPE, } from "matrix-js-sdk/src/matrix"; -import { RoomMessageEventContent } from "matrix-js-sdk/src/types"; +import { type RoomMessageEventContent } from "matrix-js-sdk/src/types"; import { PosthogAnalytics } from "../../../../../PosthogAnalytics"; import SettingsStore from "../../../../../settings/SettingsStore"; @@ -22,11 +22,11 @@ import { decorateStartSendingTime, sendRoundTripMetric } from "../../../../../se import { doMaybeLocalRoomAction } from "../../../../../utils/local-room"; import { CHAT_EFFECTS } from "../../../../../effects"; import { containsEmoji } from "../../../../../effects/utils"; -import { IRoomState } from "../../../../structures/RoomView"; +import { type IRoomState } from "../../../../structures/RoomView"; import dis from "../../../../../dispatcher/dispatcher"; import { createRedactEventDialog } from "../../../dialogs/ConfirmRedactDialog"; import { endEditing, cancelPreviousPendingEdit } from "./editing"; -import EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; +import type EditorStateTransfer from "../../../../../utils/EditorStateTransfer"; import { createMessageContent, EMOTE_PREFIX } from "./createMessageContent"; import { isContentModified } from "./isContentModified"; import { CommandCategories, getCommand } from "../../../../../SlashCommands"; diff --git a/src/components/views/rooms/wysiwyg_composer/utils/selection.ts b/src/components/views/rooms/wysiwyg_composer/utils/selection.ts index 95da5ef66b..d8c6213e64 100644 --- a/src/components/views/rooms/wysiwyg_composer/utils/selection.ts +++ b/src/components/views/rooms/wysiwyg_composer/utils/selection.ts @@ -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 { SubSelection } from "../types"; +import { type SubSelection } from "../types"; export function setSelection(selection: SubSelection): Promise { if (selection.anchorNode && selection.focusNode) { diff --git a/src/components/views/settings/AddPrivilegedUsers.tsx b/src/components/views/settings/AddPrivilegedUsers.tsx index 5276e825fd..68a940a65d 100644 --- a/src/components/views/settings/AddPrivilegedUsers.tsx +++ b/src/components/views/settings/AddPrivilegedUsers.tsx @@ -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 React, { FormEvent, useCallback, useContext, useRef, useState } from "react"; -import { Room, EventType } from "matrix-js-sdk/src/matrix"; +import React, { type FormEvent, useCallback, useContext, useRef, useState } from "react"; +import { type Room, EventType } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; -import { ICompletion } from "../../../autocomplete/Autocompleter"; +import { type ICompletion } from "../../../autocomplete/Autocompleter"; import UserProvider from "../../../autocomplete/UserProvider"; import { AutocompleteInput } from "../../structures/AutocompleteInput"; import PowerSelector from "../elements/PowerSelector"; diff --git a/src/components/views/settings/AddRemoveThreepids.tsx b/src/components/views/settings/AddRemoveThreepids.tsx index 704f2a1292..2286d4085b 100644 --- a/src/components/views/settings/AddRemoveThreepids.tsx +++ b/src/components/views/settings/AddRemoveThreepids.tsx @@ -9,22 +9,22 @@ Please see LICENSE files in the repository root for full details. import React, { useCallback, useRef, useState } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { - IRequestMsisdnTokenResponse, - IRequestTokenResponse, + type IRequestMsisdnTokenResponse, + type IRequestTokenResponse, MatrixError, ThreepidMedium, } from "matrix-js-sdk/src/matrix"; -import AddThreepid, { Binding, ThirdPartyIdentifier } from "../../../AddThreepid"; +import AddThreepid, { type Binding, type ThirdPartyIdentifier } from "../../../AddThreepid"; import { _t, UserFriendlyError } from "../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import { useMatrixClientContext } from "../../../contexts/MatrixClientContext"; import Modal from "../../../Modal"; import ErrorDialog, { extractErrorMessageFromError } from "../dialogs/ErrorDialog"; import Field from "../elements/Field"; import { looksValid as emailLooksValid } from "../../../email"; import CountryDropdown from "../auth/CountryDropdown"; -import { PhoneNumberCountryDefinition } from "../../../phonenumber"; +import { type PhoneNumberCountryDefinition } from "../../../phonenumber"; import InlineSpinner from "../elements/InlineSpinner"; // Whether we're adding 3pids to the user's account on the homeserver or sharing them on an identity server diff --git a/src/components/views/settings/AvatarSetting.tsx b/src/components/views/settings/AvatarSetting.tsx index 2ed4d06568..1cca43b9cd 100644 --- a/src/components/views/settings/AvatarSetting.tsx +++ b/src/components/views/settings/AvatarSetting.tsx @@ -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 React, { ReactNode, createRef, useCallback, useEffect, useState, useId } from "react"; +import React, { type ReactNode, createRef, useCallback, useEffect, useState, useId } from "react"; import EditIcon from "@vector-im/compound-design-tokens/assets/web/icons/edit"; import UploadIcon from "@vector-im/compound-design-tokens/assets/web/icons/share"; import DeleteIcon from "@vector-im/compound-design-tokens/assets/web/icons/delete"; diff --git a/src/components/views/settings/BridgeTile.tsx b/src/components/views/settings/BridgeTile.tsx index ad9088116c..3de39ed9af 100644 --- a/src/components/views/settings/BridgeTile.tsx +++ b/src/components/views/settings/BridgeTile.tsx @@ -6,8 +6,8 @@ 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, { ReactNode } from "react"; -import { MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode } from "react"; +import { type MatrixEvent, type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/settings/ChangePassword.tsx b/src/components/views/settings/ChangePassword.tsx index 07a13cd347..30b6bd9661 100644 --- a/src/components/views/settings/ChangePassword.tsx +++ b/src/components/views/settings/ChangePassword.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import Field from "../elements/Field"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import AccessibleButton, { AccessibleButtonKind } from "../elements/AccessibleButton"; +import AccessibleButton, { type AccessibleButtonKind } from "../elements/AccessibleButton"; import Spinner from "../elements/Spinner"; -import withValidation, { IFieldState, IValidationResult } from "../elements/Validation"; +import withValidation, { type IFieldState, type IValidationResult } from "../elements/Validation"; import { UserFriendlyError, _t, _td } from "../../../languageHandler"; import Modal from "../../../Modal"; import PassphraseField from "../auth/PassphraseField"; diff --git a/src/components/views/settings/CrossSigningPanel.tsx b/src/components/views/settings/CrossSigningPanel.tsx index 5b7a39aad2..ced47e992f 100644 --- a/src/components/views/settings/CrossSigningPanel.tsx +++ b/src/components/views/settings/CrossSigningPanel.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { ClientEvent, EmptyObject, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type EmptyObject, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { CryptoEvent } from "matrix-js-sdk/src/crypto-api"; diff --git a/src/components/views/settings/CryptographyPanel.tsx b/src/components/views/settings/CryptographyPanel.tsx index d0cabf7af9..5fb9959e1d 100644 --- a/src/components/views/settings/CryptographyPanel.tsx +++ b/src/components/views/settings/CryptographyPanel.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React, { lazy } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import Modal from "../../../Modal"; diff --git a/src/components/views/settings/EventIndexPanel.tsx b/src/components/views/settings/EventIndexPanel.tsx index c314f72f38..2457a2c649 100644 --- a/src/components/views/settings/EventIndexPanel.tsx +++ b/src/components/views/settings/EventIndexPanel.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { lazy } from "react"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import SdkConfig from "../../../SdkConfig"; diff --git a/src/components/views/settings/FontScalingPanel.tsx b/src/components/views/settings/FontScalingPanel.tsx index f2f1d6a93b..f1151a4269 100644 --- a/src/components/views/settings/FontScalingPanel.tsx +++ b/src/components/views/settings/FontScalingPanel.tsx @@ -7,11 +7,11 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import EventTilePreview from "../elements/EventTilePreview"; import SettingsStore from "../../../settings/SettingsStore"; -import { Layout } from "../../../settings/enums/Layout"; +import { type Layout } from "../../../settings/enums/Layout"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { SettingLevel } from "../../../settings/SettingLevel"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/settings/ImageSizePanel.tsx b/src/components/views/settings/ImageSizePanel.tsx index cae714d002..fea7ec362e 100644 --- a/src/components/views/settings/ImageSizePanel.tsx +++ b/src/components/views/settings/ImageSizePanel.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import SettingsStore from "../../../settings/SettingsStore"; import StyledRadioButton from "../elements/StyledRadioButton"; diff --git a/src/components/views/settings/IntegrationManager.tsx b/src/components/views/settings/IntegrationManager.tsx index 28a5130b25..bb6893551a 100644 --- a/src/components/views/settings/IntegrationManager.tsx +++ b/src/components/views/settings/IntegrationManager.tsx @@ -10,7 +10,7 @@ import React from "react"; import { _t } from "../../../languageHandler"; import dis from "../../../dispatcher/dispatcher"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import Spinner from "../elements/Spinner"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; diff --git a/src/components/views/settings/JoinRuleSettings.tsx b/src/components/views/settings/JoinRuleSettings.tsx index 023b68c282..eae4d2dcc5 100644 --- a/src/components/views/settings/JoinRuleSettings.tsx +++ b/src/components/views/settings/JoinRuleSettings.tsx @@ -6,25 +6,25 @@ 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, { ReactNode, useEffect, useState } from "react"; -import { JoinRule, RestrictedAllowType, Room, EventType, Visibility } from "matrix-js-sdk/src/matrix"; -import { RoomJoinRulesEventContent } from "matrix-js-sdk/src/types"; +import React, { type ReactNode, useEffect, useState } from "react"; +import { JoinRule, RestrictedAllowType, type Room, EventType, Visibility } from "matrix-js-sdk/src/matrix"; +import { type RoomJoinRulesEventContent } from "matrix-js-sdk/src/types"; -import StyledRadioGroup, { IDefinition } from "../elements/StyledRadioGroup"; +import StyledRadioGroup, { type IDefinition } from "../elements/StyledRadioGroup"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; import RoomAvatar from "../avatars/RoomAvatar"; import SpaceStore from "../../../stores/spaces/SpaceStore"; import Modal from "../../../Modal"; import ManageRestrictedJoinRuleDialog from "../dialogs/ManageRestrictedJoinRuleDialog"; -import RoomUpgradeWarningDialog, { IFinishedOpts } from "../dialogs/RoomUpgradeWarningDialog"; +import RoomUpgradeWarningDialog, { type IFinishedOpts } from "../dialogs/RoomUpgradeWarningDialog"; import { upgradeRoom } from "../../../utils/RoomUpgrade"; import { arrayHasDiff } from "../../../utils/arrays"; import { useLocalEcho } from "../../../hooks/useLocalEcho"; import dis from "../../../dispatcher/dispatcher"; import { RoomSettingsTab } from "../dialogs/RoomSettingsDialog"; import { Action } from "../../../dispatcher/actions"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { doesRoomVersionSupport, PreferredRoomVersions } from "../../../utils/PreferredRoomVersions"; import SettingsStore from "../../../settings/SettingsStore"; import LabelledCheckbox from "../elements/LabelledCheckbox"; diff --git a/src/components/views/settings/KeyboardShortcut.tsx b/src/components/views/settings/KeyboardShortcut.tsx index f84c89208a..32db41132f 100644 --- a/src/components/views/settings/KeyboardShortcut.tsx +++ b/src/components/views/settings/KeyboardShortcut.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { ALTERNATE_KEY_NAME, KEY_ICON } from "../../../accessibility/KeyboardShortcuts"; -import { KeyCombo } from "../../../KeyBindingsManager"; +import { type KeyCombo } from "../../../KeyBindingsManager"; import { IS_MAC, Key } from "../../../Keyboard"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/settings/LayoutSwitcher.tsx b/src/components/views/settings/LayoutSwitcher.tsx index 075c92fce7..9df3968859 100644 --- a/src/components/views/settings/LayoutSwitcher.tsx +++ b/src/components/views/settings/LayoutSwitcher.tsx @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX, useEffect, useState } from "react"; +import React, { type JSX, useEffect, useState } from "react"; import { Field, HelpMessage, InlineField, Label, RadioControl, Root, ToggleControl } from "@vector-im/compound-web"; import { SettingsSubsection } from "./shared/SettingsSubsection"; diff --git a/src/components/views/settings/Notifications.tsx b/src/components/views/settings/Notifications.tsx index 1b9d266a94..79e792584c 100644 --- a/src/components/views/settings/Notifications.tsx +++ b/src/components/views/settings/Notifications.tsx @@ -6,17 +6,17 @@ 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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { - IAnnotatedPushRule, - IPusher, - PushRuleAction, + type IAnnotatedPushRule, + type IPusher, + type PushRuleAction, PushRuleKind, RuleId, - IThreepid, + type IThreepid, ThreepidMedium, - LocalNotificationSettings, - EmptyObject, + type LocalNotificationSettings, + type EmptyObject, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; @@ -24,13 +24,13 @@ import Spinner from "../elements/Spinner"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { ContentRules, - IContentRules, + type IContentRules, PushRuleVectorState, VectorPushRulesDefinitions, VectorState, + type VectorPushRuleDefinition, } from "../../../notifications"; -import type { VectorPushRuleDefinition } from "../../../notifications"; -import { _t, TranslatedString } from "../../../languageHandler"; +import { _t, type TranslatedString } from "../../../languageHandler"; import LabelledToggleSwitch from "../elements/LabelledToggleSwitch"; import SettingsStore from "../../../settings/SettingsStore"; import StyledRadioButton from "../elements/StyledRadioButton"; diff --git a/src/components/views/settings/PowerLevelSelector.tsx b/src/components/views/settings/PowerLevelSelector.tsx index 5bc2da9f92..32731715ff 100644 --- a/src/components/views/settings/PowerLevelSelector.tsx +++ b/src/components/views/settings/PowerLevelSelector.tsx @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { useState, JSX, PropsWithChildren } from "react"; +import React, { useState, type JSX, type PropsWithChildren } from "react"; import { Button } from "@vector-im/compound-web"; import { useMatrixClientContext } from "../../../contexts/MatrixClientContext"; diff --git a/src/components/views/settings/SecureBackupPanel.tsx b/src/components/views/settings/SecureBackupPanel.tsx index 722c3fe38f..0e8568f2a9 100644 --- a/src/components/views/settings/SecureBackupPanel.tsx +++ b/src/components/views/settings/SecureBackupPanel.tsx @@ -7,10 +7,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 React, { lazy, ReactNode } from "react"; -import { CryptoEvent, BackupTrustInfo, KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; +import React, { lazy, type ReactNode } from "react"; +import { CryptoEvent, type BackupTrustInfo, type KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/settings/SetIdServer.tsx b/src/components/views/settings/SetIdServer.tsx index 9345d87e82..86aa0a3df8 100644 --- a/src/components/views/settings/SetIdServer.tsx +++ b/src/components/views/settings/SetIdServer.tsx @@ -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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { IThreepid } from "matrix-js-sdk/src/matrix"; +import { type IThreepid } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; @@ -19,7 +19,7 @@ import IdentityAuthClient from "../../../IdentityAuthClient"; import { abbreviateUrl, parseUrl, unabbreviateUrl } from "../../../utils/UrlUtils"; import { getDefaultIdentityServerUrl, doesIdentityServerHaveTerms } from "../../../utils/IdentityServerUtils"; import { timeout } from "../../../utils/promise"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import InlineSpinner from "../elements/InlineSpinner"; import AccessibleButton from "../elements/AccessibleButton"; import Field from "../elements/Field"; diff --git a/src/components/views/settings/SetIntegrationManager.tsx b/src/components/views/settings/SetIntegrationManager.tsx index fbf9ff710f..8721ddcd4b 100644 --- a/src/components/views/settings/SetIntegrationManager.tsx +++ b/src/components/views/settings/SetIntegrationManager.tsx @@ -8,11 +8,11 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import { IntegrationManagers } from "../../../integrations/IntegrationManagers"; -import { IntegrationManagerInstance } from "../../../integrations/IntegrationManagerInstance"; +import { type IntegrationManagerInstance } from "../../../integrations/IntegrationManagerInstance"; import SettingsStore from "../../../settings/SettingsStore"; import { SettingLevel } from "../../../settings/SettingLevel"; import ToggleSwitch from "../elements/ToggleSwitch"; diff --git a/src/components/views/settings/SettingsFieldset.tsx b/src/components/views/settings/SettingsFieldset.tsx index 3316b657e6..850647f37b 100644 --- a/src/components/views/settings/SettingsFieldset.tsx +++ b/src/components/views/settings/SettingsFieldset.tsx @@ -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 React, { ReactNode, HTMLAttributes } from "react"; +import React, { type ReactNode, type HTMLAttributes } from "react"; import classNames from "classnames"; import { SettingsSubsectionText } from "./shared/SettingsSubsection"; diff --git a/src/components/views/settings/SettingsHeader.tsx b/src/components/views/settings/SettingsHeader.tsx index 9a83ba1d92..10534958f4 100644 --- a/src/components/views/settings/SettingsHeader.tsx +++ b/src/components/views/settings/SettingsHeader.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX } from "react"; +import React, { type JSX } from "react"; import { Heading } from "@vector-im/compound-web"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/settings/SettingsSubheader.tsx b/src/components/views/settings/SettingsSubheader.tsx index 90b8a41b7a..e3e6eae555 100644 --- a/src/components/views/settings/SettingsSubheader.tsx +++ b/src/components/views/settings/SettingsSubheader.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX } from "react"; +import React, { type JSX } from "react"; import CheckCircleIcon from "@vector-im/compound-design-tokens/assets/web/icons/check-circle-solid"; import ErrorIcon from "@vector-im/compound-design-tokens/assets/web/icons/error"; import classNames from "classnames"; diff --git a/src/components/views/settings/SpellCheckSettings.tsx b/src/components/views/settings/SpellCheckSettings.tsx index 1ec8e0adce..d1c759418d 100644 --- a/src/components/views/settings/SpellCheckSettings.tsx +++ b/src/components/views/settings/SpellCheckSettings.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import SpellCheckLanguagesDropdown from "../../../components/views/elements/SpellCheckLanguagesDropdown"; -import AccessibleButton, { ButtonEvent } from "../../../components/views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../../components/views/elements/AccessibleButton"; import { _t, getUserLanguage } from "../../../languageHandler"; interface ExistingSpellCheckLanguageIProps { diff --git a/src/components/views/settings/ThemeChoicePanel.tsx b/src/components/views/settings/ThemeChoicePanel.tsx index b60b3fe540..6581e823fc 100644 --- a/src/components/views/settings/ThemeChoicePanel.tsx +++ b/src/components/views/settings/ThemeChoicePanel.tsx @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { ChangeEvent, JSX, useCallback, useMemo, useState } from "react"; +import React, { type ChangeEvent, type JSX, useCallback, useMemo, useState } from "react"; import { InlineField, ToggleControl, @@ -28,10 +28,15 @@ import ThemeWatcher from "../../../settings/watchers/ThemeWatcher"; import SettingsStore from "../../../settings/SettingsStore"; import { SettingLevel } from "../../../settings/SettingLevel"; import dis from "../../../dispatcher/dispatcher"; -import { RecheckThemePayload } from "../../../dispatcher/payloads/RecheckThemePayload"; +import { type RecheckThemePayload } from "../../../dispatcher/payloads/RecheckThemePayload"; import { Action } from "../../../dispatcher/actions"; import { useTheme } from "../../../hooks/useTheme"; -import { findHighContrastTheme, getOrderedThemes, CustomTheme as CustomThemeType, ITheme } from "../../../theme"; +import { + findHighContrastTheme, + getOrderedThemes, + type CustomTheme as CustomThemeType, + type ITheme, +} from "../../../theme"; import { useSettingValue } from "../../../hooks/useSettings"; /** diff --git a/src/components/views/settings/UpdateCheckButton.tsx b/src/components/views/settings/UpdateCheckButton.tsx index e283373eb9..cf91bea9ee 100644 --- a/src/components/views/settings/UpdateCheckButton.tsx +++ b/src/components/views/settings/UpdateCheckButton.tsx @@ -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 React, { ReactNode, useState } from "react"; +import React, { type ReactNode, useState } from "react"; import { UpdateCheckStatus } from "../../../BasePlatform"; import PlatformPeg from "../../../PlatformPeg"; @@ -16,7 +16,7 @@ import { Action } from "../../../dispatcher/actions"; import { _t } from "../../../languageHandler"; import InlineSpinner from "../../../components/views/elements/InlineSpinner"; import AccessibleButton from "../../../components/views/elements/AccessibleButton"; -import { CheckUpdatesPayload } from "../../../dispatcher/payloads/CheckUpdatesPayload"; +import { type CheckUpdatesPayload } from "../../../dispatcher/payloads/CheckUpdatesPayload"; function installUpdate(): void { PlatformPeg.get()?.installUpdate(); diff --git a/src/components/views/settings/UserPersonalInfoSettings.tsx b/src/components/views/settings/UserPersonalInfoSettings.tsx index c08c0f636f..e6dae795c6 100644 --- a/src/components/views/settings/UserPersonalInfoSettings.tsx +++ b/src/components/views/settings/UserPersonalInfoSettings.tsx @@ -14,7 +14,7 @@ import { _t } from "../../../languageHandler"; import InlineSpinner from "../elements/InlineSpinner"; import { SettingsSubsection } from "./shared/SettingsSubsection"; import { useMatrixClientContext } from "../../../contexts/MatrixClientContext"; -import { ThirdPartyIdentifier } from "../../../AddThreepid"; +import { type ThirdPartyIdentifier } from "../../../AddThreepid"; import SettingsStore from "../../../settings/SettingsStore"; import { UIFeature } from "../../../settings/UIFeature"; import { AddRemoveThreepids } from "./AddRemoveThreepids"; diff --git a/src/components/views/settings/UserProfileSettings.tsx b/src/components/views/settings/UserProfileSettings.tsx index 5fba36ad01..11b6a5bb69 100644 --- a/src/components/views/settings/UserProfileSettings.tsx +++ b/src/components/views/settings/UserProfileSettings.tsx @@ -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 React, { ChangeEvent, ReactNode, useCallback, useEffect, useMemo, useState, useId } from "react"; +import React, { type ChangeEvent, type ReactNode, useCallback, useEffect, useMemo, useState, useId } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { EditInPlace, Alert, ErrorMessage } from "@vector-im/compound-web"; import PopOutIcon from "@vector-im/compound-design-tokens/assets/web/icons/pop-out"; diff --git a/src/components/views/settings/devices/CurrentDeviceSection.tsx b/src/components/views/settings/devices/CurrentDeviceSection.tsx index 245c244c90..c88649d831 100644 --- a/src/components/views/settings/devices/CurrentDeviceSection.tsx +++ b/src/components/views/settings/devices/CurrentDeviceSection.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useState } from "react"; -import { LocalNotificationSettings } from "matrix-js-sdk/src/matrix"; +import { type LocalNotificationSettings } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../languageHandler"; import Spinner from "../../elements/Spinner"; @@ -17,7 +17,7 @@ import DeviceDetails from "./DeviceDetails"; import { DeviceExpandDetailsButton } from "./DeviceExpandDetailsButton"; import DeviceTile from "./DeviceTile"; import { DeviceVerificationStatusCard } from "./DeviceVerificationStatusCard"; -import { ExtendedDevice } from "./types"; +import { type ExtendedDevice } from "./types"; import { KebabContextMenu } from "../../context_menus/KebabContextMenu"; import { IconizedContextMenuOption } from "../../context_menus/IconizedContextMenu"; diff --git a/src/components/views/settings/devices/DeviceDetailHeading.tsx b/src/components/views/settings/devices/DeviceDetailHeading.tsx index 945f5f204a..78c9574486 100644 --- a/src/components/views/settings/devices/DeviceDetailHeading.tsx +++ b/src/components/views/settings/devices/DeviceDetailHeading.tsx @@ -9,13 +9,13 @@ Please see LICENSE files in the repository root for full details. import React, { useEffect, useState } from "react"; import { _t } from "../../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../elements/AccessibleButton"; import Field from "../../elements/Field"; import LearnMore from "../../elements/LearnMore"; import Spinner from "../../elements/Spinner"; import { Caption } from "../../typography/Caption"; import Heading from "../../typography/Heading"; -import { ExtendedDevice } from "./types"; +import { type ExtendedDevice } from "./types"; interface Props { device: ExtendedDevice; diff --git a/src/components/views/settings/devices/DeviceDetails.tsx b/src/components/views/settings/devices/DeviceDetails.tsx index a97a1b1bfe..52f5800dac 100644 --- a/src/components/views/settings/devices/DeviceDetails.tsx +++ b/src/components/views/settings/devices/DeviceDetails.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; -import { IPusher, PUSHER_ENABLED, LocalNotificationSettings } from "matrix-js-sdk/src/matrix"; +import { type IPusher, PUSHER_ENABLED, type LocalNotificationSettings } from "matrix-js-sdk/src/matrix"; import { formatDate } from "../../../../DateUtils"; import { _t } from "../../../../languageHandler"; @@ -17,7 +17,7 @@ import Spinner from "../../elements/Spinner"; import ToggleSwitch from "../../elements/ToggleSwitch"; import { DeviceDetailHeading } from "./DeviceDetailHeading"; import { DeviceVerificationStatusCard } from "./DeviceVerificationStatusCard"; -import { ExtendedDevice } from "./types"; +import { type ExtendedDevice } from "./types"; import { getManageDeviceUrl } from "../../../../utils/oidc/urls.ts"; interface Props { diff --git a/src/components/views/settings/devices/DeviceExpandDetailsButton.tsx b/src/components/views/settings/devices/DeviceExpandDetailsButton.tsx index b227ea3814..fffa131dba 100644 --- a/src/components/views/settings/devices/DeviceExpandDetailsButton.tsx +++ b/src/components/views/settings/devices/DeviceExpandDetailsButton.tsx @@ -11,7 +11,7 @@ import React from "react"; import { ChevronDownIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { _t } from "../../../../languageHandler"; -import AccessibleButton, { ButtonProps } from "../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonProps } from "../../elements/AccessibleButton"; type Props = Omit< ButtonProps, diff --git a/src/components/views/settings/devices/DeviceMetaData.tsx b/src/components/views/settings/devices/DeviceMetaData.tsx index be7bd11996..299cef69cf 100644 --- a/src/components/views/settings/devices/DeviceMetaData.tsx +++ b/src/components/views/settings/devices/DeviceMetaData.tsx @@ -10,7 +10,7 @@ import React, { Fragment } from "react"; import { Icon as InactiveIcon } from "../../../../../res/img/element-icons/settings/inactive.svg"; import { INACTIVE_DEVICE_AGE_DAYS, isDeviceInactive } from "../../../../components/views/settings/devices/filter"; -import { ExtendedDevice } from "../../../../components/views/settings/devices/types"; +import { type ExtendedDevice } from "../../../../components/views/settings/devices/types"; import { formatDate, formatRelativeTime } from "../../../../DateUtils"; import { _t } from "../../../../languageHandler"; diff --git a/src/components/views/settings/devices/DeviceSecurityLearnMore.tsx b/src/components/views/settings/devices/DeviceSecurityLearnMore.tsx index 6a2ca55d43..3dbc7d6123 100644 --- a/src/components/views/settings/devices/DeviceSecurityLearnMore.tsx +++ b/src/components/views/settings/devices/DeviceSecurityLearnMore.tsx @@ -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 React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import { _t } from "../../../../languageHandler"; import LearnMore from "../../elements/LearnMore"; diff --git a/src/components/views/settings/devices/DeviceTile.tsx b/src/components/views/settings/devices/DeviceTile.tsx index 79d0c720df..1295b8da95 100644 --- a/src/components/views/settings/devices/DeviceTile.tsx +++ b/src/components/views/settings/devices/DeviceTile.tsx @@ -10,7 +10,7 @@ import React from "react"; import classNames from "classnames"; import Heading from "../../typography/Heading"; -import { ExtendedDevice } from "./types"; +import { type ExtendedDevice } from "./types"; import { DeviceTypeIcon } from "./DeviceTypeIcon"; import { preventDefaultWrapper } from "../../../../utils/NativeEventUtils"; import { DeviceMetaData } from "./DeviceMetaData"; diff --git a/src/components/views/settings/devices/DeviceTypeIcon.tsx b/src/components/views/settings/devices/DeviceTypeIcon.tsx index c685c4c895..994a40f250 100644 --- a/src/components/views/settings/devices/DeviceTypeIcon.tsx +++ b/src/components/views/settings/devices/DeviceTypeIcon.tsx @@ -15,8 +15,8 @@ import { Icon as WebIcon } from "../../../../../res/img/element-icons/settings/w import { Icon as MobileIcon } from "../../../../../res/img/element-icons/settings/mobile.svg"; import { Icon as VerifiedIcon } from "../../../../../res/img/e2e/verified.svg"; import { Icon as UnverifiedIcon } from "../../../../../res/img/e2e/warning.svg"; -import { _t, _td, TranslationKey } from "../../../../languageHandler"; -import { ExtendedDevice } from "./types"; +import { _t, _td, type TranslationKey } from "../../../../languageHandler"; +import { type ExtendedDevice } from "./types"; import { DeviceType } from "../../../../utils/device/parseUserAgent"; interface Props { diff --git a/src/components/views/settings/devices/DeviceVerificationStatusCard.tsx b/src/components/views/settings/devices/DeviceVerificationStatusCard.tsx index d57231076b..87cb9113ca 100644 --- a/src/components/views/settings/devices/DeviceVerificationStatusCard.tsx +++ b/src/components/views/settings/devices/DeviceVerificationStatusCard.tsx @@ -12,7 +12,7 @@ import { _t } from "../../../../languageHandler"; import AccessibleButton from "../../elements/AccessibleButton"; import DeviceSecurityCard from "./DeviceSecurityCard"; import { DeviceSecurityLearnMore } from "./DeviceSecurityLearnMore"; -import { DeviceSecurityVariation, ExtendedDevice } from "./types"; +import { DeviceSecurityVariation, type ExtendedDevice } from "./types"; export interface DeviceVerificationStatusCardProps { device: ExtendedDevice; diff --git a/src/components/views/settings/devices/FilteredDeviceList.tsx b/src/components/views/settings/devices/FilteredDeviceList.tsx index bf37b09548..c9a266e4b9 100644 --- a/src/components/views/settings/devices/FilteredDeviceList.tsx +++ b/src/components/views/settings/devices/FilteredDeviceList.tsx @@ -6,19 +6,19 @@ 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, { ForwardedRef, forwardRef } from "react"; -import { IPusher, PUSHER_DEVICE_ID, LocalNotificationSettings } from "matrix-js-sdk/src/matrix"; +import React, { type ForwardedRef, forwardRef } from "react"; +import { type IPusher, PUSHER_DEVICE_ID, type LocalNotificationSettings } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../languageHandler"; import AccessibleButton from "../../elements/AccessibleButton"; -import { FilterDropdown, FilterDropdownOption } from "../../elements/FilterDropdown"; +import { FilterDropdown, type FilterDropdownOption } from "../../elements/FilterDropdown"; import DeviceDetails from "./DeviceDetails"; import { DeviceExpandDetailsButton } from "./DeviceExpandDetailsButton"; import DeviceSecurityCard from "./DeviceSecurityCard"; -import { filterDevicesBySecurityRecommendation, FilterVariation, INACTIVE_DEVICE_AGE_DAYS } from "./filter"; +import { filterDevicesBySecurityRecommendation, type FilterVariation, INACTIVE_DEVICE_AGE_DAYS } from "./filter"; import SelectableDeviceTile from "./SelectableDeviceTile"; -import { DevicesDictionary, DeviceSecurityVariation, ExtendedDevice } from "./types"; -import { DevicesState } from "./useOwnDevices"; +import { type DevicesDictionary, DeviceSecurityVariation, type ExtendedDevice } from "./types"; +import { type DevicesState } from "./useOwnDevices"; import FilteredDeviceListHeader from "./FilteredDeviceListHeader"; import Spinner from "../../elements/Spinner"; import { DeviceSecurityLearnMore } from "./DeviceSecurityLearnMore"; diff --git a/src/components/views/settings/devices/FilteredDeviceListHeader.tsx b/src/components/views/settings/devices/FilteredDeviceListHeader.tsx index 28fcec6715..7be2b09d05 100644 --- a/src/components/views/settings/devices/FilteredDeviceListHeader.tsx +++ b/src/components/views/settings/devices/FilteredDeviceListHeader.tsx @@ -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 React, { HTMLProps } from "react"; +import React, { type HTMLProps } from "react"; import { Tooltip } from "@vector-im/compound-web"; import { _t } from "../../../../languageHandler"; diff --git a/src/components/views/settings/devices/LoginWithQRSection.tsx b/src/components/views/settings/devices/LoginWithQRSection.tsx index 3cd762c126..523633c884 100644 --- a/src/components/views/settings/devices/LoginWithQRSection.tsx +++ b/src/components/views/settings/devices/LoginWithQRSection.tsx @@ -7,7 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { IServerVersions, OidcClientConfig, MatrixClient, DEVICE_CODE_SCOPE } from "matrix-js-sdk/src/matrix"; +import { + type IServerVersions, + type OidcClientConfig, + type MatrixClient, + DEVICE_CODE_SCOPE, +} from "matrix-js-sdk/src/matrix"; import QrCodeIcon from "@vector-im/compound-design-tokens/assets/web/icons/qr-code"; import { Text } from "@vector-im/compound-web"; diff --git a/src/components/views/settings/devices/SecurityRecommendations.tsx b/src/components/views/settings/devices/SecurityRecommendations.tsx index 599c3bd5b3..8c555ca9c6 100644 --- a/src/components/views/settings/devices/SecurityRecommendations.tsx +++ b/src/components/views/settings/devices/SecurityRecommendations.tsx @@ -13,8 +13,8 @@ import AccessibleButton from "../../elements/AccessibleButton"; import { SettingsSubsection } from "../shared/SettingsSubsection"; import DeviceSecurityCard from "./DeviceSecurityCard"; import { DeviceSecurityLearnMore } from "./DeviceSecurityLearnMore"; -import { filterDevicesBySecurityRecommendation, FilterVariation, INACTIVE_DEVICE_AGE_DAYS } from "./filter"; -import { DeviceSecurityVariation, ExtendedDevice, DevicesDictionary } from "./types"; +import { filterDevicesBySecurityRecommendation, type FilterVariation, INACTIVE_DEVICE_AGE_DAYS } from "./filter"; +import { DeviceSecurityVariation, type ExtendedDevice, type DevicesDictionary } from "./types"; interface Props { devices: DevicesDictionary; diff --git a/src/components/views/settings/devices/SelectableDeviceTile.tsx b/src/components/views/settings/devices/SelectableDeviceTile.tsx index b83b2c5870..b6e90ae3ef 100644 --- a/src/components/views/settings/devices/SelectableDeviceTile.tsx +++ b/src/components/views/settings/devices/SelectableDeviceTile.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import StyledCheckbox, { CheckboxStyle } from "../../elements/StyledCheckbox"; -import DeviceTile, { DeviceTileProps } from "./DeviceTile"; +import DeviceTile, { type DeviceTileProps } from "./DeviceTile"; interface Props extends DeviceTileProps { isSelected: boolean; diff --git a/src/components/views/settings/devices/deleteDevices.tsx b/src/components/views/settings/devices/deleteDevices.tsx index 16fdca9219..e2fc6c1abd 100644 --- a/src/components/views/settings/devices/deleteDevices.tsx +++ b/src/components/views/settings/devices/deleteDevices.tsx @@ -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 { MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; -import { AuthDict, IAuthData } from "matrix-js-sdk/src/interactive-auth"; +import { type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { type AuthDict, type IAuthData } from "matrix-js-sdk/src/interactive-auth"; import { _t } from "../../../../languageHandler"; import Modal from "../../../../Modal"; -import { InteractiveAuthCallback } from "../../../structures/InteractiveAuth"; +import { type InteractiveAuthCallback } from "../../../structures/InteractiveAuth"; import { SSOAuthEntry } from "../../auth/InteractiveAuthEntryComponents"; import InteractiveAuthDialog from "../../dialogs/InteractiveAuthDialog"; diff --git a/src/components/views/settings/devices/filter.ts b/src/components/views/settings/devices/filter.ts index ba7f6f5c21..3712ab4939 100644 --- a/src/components/views/settings/devices/filter.ts +++ b/src/components/views/settings/devices/filter.ts @@ -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 { ExtendedDevice, DeviceSecurityVariation } from "./types"; +import { type ExtendedDevice, DeviceSecurityVariation } from "./types"; type DeviceFilterCondition = (device: ExtendedDevice) => boolean; diff --git a/src/components/views/settings/devices/types.ts b/src/components/views/settings/devices/types.ts index 3891f6be32..a7f9dfa952 100644 --- a/src/components/views/settings/devices/types.ts +++ b/src/components/views/settings/devices/types.ts @@ -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 { IMyDevice } from "matrix-js-sdk/src/matrix"; +import { type IMyDevice } from "matrix-js-sdk/src/matrix"; -import { ExtendedDeviceInformation } from "../../../../utils/device/parseUserAgent"; +import { type ExtendedDeviceInformation } from "../../../../utils/device/parseUserAgent"; export type DeviceWithVerification = IMyDevice & { /** diff --git a/src/components/views/settings/devices/useOwnDevices.ts b/src/components/views/settings/devices/useOwnDevices.ts index 8cb3f9dbc1..34aec1c012 100644 --- a/src/components/views/settings/devices/useOwnDevices.ts +++ b/src/components/views/settings/devices/useOwnDevices.ts @@ -9,23 +9,23 @@ Please see LICENSE files in the repository root for full details. import { useCallback, useContext, useEffect, useState } from "react"; import { ClientEvent, - IMyDevice, - IPusher, + type IMyDevice, + type IPusher, LOCAL_NOTIFICATION_SETTINGS_PREFIX, - MatrixClient, - MatrixEvent, + type MatrixClient, + type MatrixEvent, PUSHER_DEVICE_ID, PUSHER_ENABLED, UNSTABLE_MSC3852_LAST_SEEN_UA, - MatrixError, - LocalNotificationSettings, + type MatrixError, + type LocalNotificationSettings, } from "matrix-js-sdk/src/matrix"; -import { VerificationRequest, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; +import { type VerificationRequest, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../languageHandler"; import { getDeviceClientInformation, pruneClientInformation } from "../../../../utils/device/clientInformation"; -import { DevicesDictionary, ExtendedDevice, ExtendedDeviceAppInfo } from "./types"; +import { type DevicesDictionary, type ExtendedDevice, type ExtendedDeviceAppInfo } from "./types"; import { useEventEmitter } from "../../../../hooks/useEventEmitter"; import { parseUserAgent } from "../../../../utils/device/parseUserAgent"; import { isDeviceVerified } from "../../../../utils/device/isDeviceVerified"; diff --git a/src/components/views/settings/discovery/DiscoverySettings.tsx b/src/components/views/settings/discovery/DiscoverySettings.tsx index e87a1f147b..8bfd7d144d 100644 --- a/src/components/views/settings/discovery/DiscoverySettings.tsx +++ b/src/components/views/settings/discovery/DiscoverySettings.tsx @@ -13,19 +13,19 @@ import { Alert } from "@vector-im/compound-web"; import { getThreepidsWithBindStatus } from "../../../../boundThreepids"; import { useMatrixClientContext } from "../../../../contexts/MatrixClientContext"; -import { ThirdPartyIdentifier } from "../../../../AddThreepid"; +import { type ThirdPartyIdentifier } from "../../../../AddThreepid"; import SettingsStore from "../../../../settings/SettingsStore"; import { UIFeature } from "../../../../settings/UIFeature"; import { _t } from "../../../../languageHandler"; import SetIdServer from "../SetIdServer"; import { SettingsSubsection } from "../shared/SettingsSubsection"; import InlineTermsAgreement from "../../terms/InlineTermsAgreement"; -import { Service, ServicePolicyPair, startTermsFlow } from "../../../../Terms"; +import { Service, type ServicePolicyPair, startTermsFlow } from "../../../../Terms"; import IdentityAuthClient from "../../../../IdentityAuthClient"; import { abbreviateUrl } from "../../../../utils/UrlUtils"; import { useDispatcher } from "../../../../hooks/useDispatcher"; import defaultDispatcher from "../../../../dispatcher/dispatcher"; -import { ActionPayload } from "../../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../../dispatcher/payloads"; import { AddRemoveThreepids } from "../AddRemoveThreepids"; type RequiredPolicyInfo = diff --git a/src/components/views/settings/encryption/AdvancedPanel.tsx b/src/components/views/settings/encryption/AdvancedPanel.tsx index 97fda70d2c..d5e8954705 100644 --- a/src/components/views/settings/encryption/AdvancedPanel.tsx +++ b/src/components/views/settings/encryption/AdvancedPanel.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX, lazy, MouseEventHandler } from "react"; +import React, { type JSX, lazy, type MouseEventHandler } from "react"; import { Button, HelpMessage, InlineField, InlineSpinner, Label, Root, ToggleControl } from "@vector-im/compound-web"; import DownloadIcon from "@vector-im/compound-design-tokens/assets/web/icons/download"; import ShareIcon from "@vector-im/compound-design-tokens/assets/web/icons/share"; diff --git a/src/components/views/settings/encryption/ChangeRecoveryKey.tsx b/src/components/views/settings/encryption/ChangeRecoveryKey.tsx index 0c2c9485f2..979b4bee04 100644 --- a/src/components/views/settings/encryption/ChangeRecoveryKey.tsx +++ b/src/components/views/settings/encryption/ChangeRecoveryKey.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { FormEventHandler, JSX, MouseEventHandler, useState } from "react"; +import React, { type FormEventHandler, type JSX, type MouseEventHandler, useState } from "react"; import { Breadcrumb, Button, diff --git a/src/components/views/settings/encryption/EncryptionCard.tsx b/src/components/views/settings/encryption/EncryptionCard.tsx index 6f9ddd651a..89ce2cbb17 100644 --- a/src/components/views/settings/encryption/EncryptionCard.tsx +++ b/src/components/views/settings/encryption/EncryptionCard.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX, PropsWithChildren, ComponentType, SVGAttributes } from "react"; +import React, { type JSX, type PropsWithChildren, type ComponentType, type SVGAttributes } from "react"; import { BigIcon, Heading } from "@vector-im/compound-web"; import classNames from "classnames"; diff --git a/src/components/views/settings/encryption/RecoveryPanel.tsx b/src/components/views/settings/encryption/RecoveryPanel.tsx index 129f698912..9c7f12efc8 100644 --- a/src/components/views/settings/encryption/RecoveryPanel.tsx +++ b/src/components/views/settings/encryption/RecoveryPanel.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX } from "react"; +import React, { type JSX } from "react"; import { Button, InlineSpinner } from "@vector-im/compound-web"; import KeyIcon from "@vector-im/compound-design-tokens/assets/web/icons/key"; diff --git a/src/components/views/settings/encryption/RecoveryPanelOutOfSync.tsx b/src/components/views/settings/encryption/RecoveryPanelOutOfSync.tsx index c5541a31e0..7b5bea5623 100644 --- a/src/components/views/settings/encryption/RecoveryPanelOutOfSync.tsx +++ b/src/components/views/settings/encryption/RecoveryPanelOutOfSync.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX } from "react"; +import React, { type JSX } from "react"; import { Button } from "@vector-im/compound-web"; import KeyIcon from "@vector-im/compound-design-tokens/assets/web/icons/key"; diff --git a/src/components/views/settings/encryption/ResetIdentityPanel.tsx b/src/components/views/settings/encryption/ResetIdentityPanel.tsx index b0a6b3fbf2..40475b2ad1 100644 --- a/src/components/views/settings/encryption/ResetIdentityPanel.tsx +++ b/src/components/views/settings/encryption/ResetIdentityPanel.tsx @@ -9,7 +9,7 @@ import { Breadcrumb, Button, VisualList, VisualListItem } from "@vector-im/compo import CheckIcon from "@vector-im/compound-design-tokens/assets/web/icons/check"; import InfoIcon from "@vector-im/compound-design-tokens/assets/web/icons/info"; import ErrorIcon from "@vector-im/compound-design-tokens/assets/web/icons/error"; -import React, { MouseEventHandler } from "react"; +import React, { type MouseEventHandler } from "react"; import { _t } from "../../../../languageHandler"; import { EncryptionCard } from "./EncryptionCard"; diff --git a/src/components/views/settings/notifications/NotificationPusherSettings.tsx b/src/components/views/settings/notifications/NotificationPusherSettings.tsx index d5506f7b95..a071fd5694 100644 --- a/src/components/views/settings/notifications/NotificationPusherSettings.tsx +++ b/src/components/views/settings/notifications/NotificationPusherSettings.tsx @@ -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 { ThreepidMedium, IPusher } from "matrix-js-sdk/src/matrix"; +import { ThreepidMedium, type IPusher } from "matrix-js-sdk/src/matrix"; import React, { useCallback, useMemo } from "react"; import { useMatrixClientContext } from "../../../../contexts/MatrixClientContext"; diff --git a/src/components/views/settings/notifications/NotificationSettings2.tsx b/src/components/views/settings/notifications/NotificationSettings2.tsx index babc4c8bd5..81a0886a34 100644 --- a/src/components/views/settings/notifications/NotificationSettings2.tsx +++ b/src/components/views/settings/notifications/NotificationSettings2.tsx @@ -15,7 +15,7 @@ import { useSettingValue } from "../../../../hooks/useSettings"; import { _t } from "../../../../languageHandler"; import { DefaultNotificationSettings, - NotificationSettings, + type NotificationSettings, } from "../../../../models/notificationsettings/NotificationSettings"; import { RoomNotifState } from "../../../../RoomNotifs"; import { SettingLevel } from "../../../../settings/SettingLevel"; diff --git a/src/components/views/settings/shared/SettingsBanner.tsx b/src/components/views/settings/shared/SettingsBanner.tsx index a5b0ac2a36..ed40e4a869 100644 --- a/src/components/views/settings/shared/SettingsBanner.tsx +++ b/src/components/views/settings/shared/SettingsBanner.tsx @@ -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 React, { PropsWithChildren, ReactNode } from "react"; +import React, { type PropsWithChildren, type ReactNode } from "react"; import AccessibleButton from "../../elements/AccessibleButton"; diff --git a/src/components/views/settings/shared/SettingsIndent.tsx b/src/components/views/settings/shared/SettingsIndent.tsx index 7c280311c2..abcc244129 100644 --- a/src/components/views/settings/shared/SettingsIndent.tsx +++ b/src/components/views/settings/shared/SettingsIndent.tsx @@ -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 React, { HTMLAttributes } from "react"; +import React, { type HTMLAttributes } from "react"; export interface SettingsIndentProps extends HTMLAttributes { children?: React.ReactNode; diff --git a/src/components/views/settings/shared/SettingsSection.tsx b/src/components/views/settings/shared/SettingsSection.tsx index 4763c51e56..b43b8a4469 100644 --- a/src/components/views/settings/shared/SettingsSection.tsx +++ b/src/components/views/settings/shared/SettingsSection.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import classnames from "classnames"; -import React, { HTMLAttributes } from "react"; +import React, { type HTMLAttributes } from "react"; import Heading from "../../typography/Heading"; import { SettingsHeader } from "../SettingsHeader"; diff --git a/src/components/views/settings/shared/SettingsSubsection.tsx b/src/components/views/settings/shared/SettingsSubsection.tsx index cbb20f771b..6f7fdde1f0 100644 --- a/src/components/views/settings/shared/SettingsSubsection.tsx +++ b/src/components/views/settings/shared/SettingsSubsection.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { HTMLAttributes } from "react"; +import React, { type HTMLAttributes } from "react"; import { Separator } from "@vector-im/compound-web"; import { SettingsSubsectionHeading } from "./SettingsSubsectionHeading"; diff --git a/src/components/views/settings/shared/SettingsSubsectionHeading.tsx b/src/components/views/settings/shared/SettingsSubsectionHeading.tsx index 61c29642a9..63fb79c637 100644 --- a/src/components/views/settings/shared/SettingsSubsectionHeading.tsx +++ b/src/components/views/settings/shared/SettingsSubsectionHeading.tsx @@ -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 React, { HTMLAttributes } from "react"; +import React, { type HTMLAttributes } from "react"; import Heading from "../../typography/Heading"; diff --git a/src/components/views/settings/tabs/SettingsTab.tsx b/src/components/views/settings/tabs/SettingsTab.tsx index ed0b1367f6..d9f5d17788 100644 --- a/src/components/views/settings/tabs/SettingsTab.tsx +++ b/src/components/views/settings/tabs/SettingsTab.tsx @@ -5,7 +5,7 @@ Copyright 2022 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import React, { HTMLAttributes } from "react"; +import React, { type HTMLAttributes } from "react"; import classNames from "classnames"; export interface SettingsTabProps extends HTMLAttributes { diff --git a/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx index dbd2a63505..6a177e31cf 100644 --- a/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/AdvancedRoomSettingsTab.tsx @@ -7,16 +7,16 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { EventType, Room } from "matrix-js-sdk/src/matrix"; +import { EventType, type Room } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../../elements/AccessibleButton"; import RoomUpgradeDialog from "../../../dialogs/RoomUpgradeDialog"; import Modal from "../../../../../Modal"; import dis from "../../../../../dispatcher/dispatcher"; import { Action } from "../../../../../dispatcher/actions"; import CopyableText from "../../../elements/CopyableText"; -import { ViewRoomPayload } from "../../../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../../../dispatcher/payloads/ViewRoomPayload"; import SettingsStore from "../../../../../settings/SettingsStore"; import SettingsTab from "../SettingsTab"; import { SettingsSection } from "../../shared/SettingsSection"; diff --git a/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx b/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx index ed80cc31e8..7cef27236d 100644 --- a/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/BridgeSettingsTab.tsx @@ -6,8 +6,8 @@ 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, { ReactNode } from "react"; -import { Room, MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode } from "react"; +import { type Room, type MatrixClient, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../../languageHandler"; import BridgeTile from "../../BridgeTile"; diff --git a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx index 590b54218f..3b5f3191ef 100644 --- a/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/GeneralRoomSettingsTab.tsx @@ -5,13 +5,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, { ContextType } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import React, { type ContextType } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { _t } from "../../../../../languageHandler"; import RoomProfileSettings from "../../../room_settings/RoomProfileSettings"; -import AccessibleButton, { ButtonEvent } from "../../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../../elements/AccessibleButton"; import dis from "../../../../../dispatcher/dispatcher"; import MatrixClientContext from "../../../../../contexts/MatrixClientContext"; import SettingsStore from "../../../../../settings/SettingsStore"; diff --git a/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx b/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx index 17e2498ae7..5f23281dec 100644 --- a/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/NotificationSettingsTab.tsx @@ -10,11 +10,11 @@ import React, { createRef } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../../languageHandler"; -import AccessibleButton, { ButtonEvent } from "../../../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../../../elements/AccessibleButton"; import Notifier from "../../../../../Notifier"; import SettingsStore from "../../../../../settings/SettingsStore"; import { SettingLevel } from "../../../../../settings/SettingLevel"; -import { RoomEchoChamber } from "../../../../../stores/local-echo/RoomEchoChamber"; +import { type RoomEchoChamber } from "../../../../../stores/local-echo/RoomEchoChamber"; import { EchoChamber } from "../../../../../stores/local-echo/EchoChamber"; import MatrixClientContext from "../../../../../contexts/MatrixClientContext"; import StyledRadioGroup from "../../../elements/StyledRadioGroup"; diff --git a/src/components/views/settings/tabs/room/PeopleRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/PeopleRoomSettingsTab.tsx index b374f36de1..2e4f30d0f4 100644 --- a/src/components/views/settings/tabs/room/PeopleRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/PeopleRoomSettingsTab.tsx @@ -6,15 +6,15 @@ 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 { EventTimeline, MatrixError, Room, RoomMember, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { EventTimeline, type MatrixError, type Room, type RoomMember, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import React, { useCallback, useState, VFC } from "react"; +import React, { useCallback, useState, type VFC } from "react"; import { CloseIcon, CheckIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { formatRelativeTime } from "../../../../../DateUtils"; import { useTypedEventEmitterState } from "../../../../../hooks/useEventEmitter"; import { _t } from "../../../../../languageHandler"; -import Modal, { IHandle } from "../../../../../Modal"; +import Modal, { type IHandle } from "../../../../../Modal"; import MemberAvatar from "../../../avatars/MemberAvatar"; import ErrorDialog from "../../../dialogs/ErrorDialog"; import AccessibleButton from "../../../elements/AccessibleButton"; diff --git a/src/components/views/settings/tabs/room/PollHistoryTab.tsx b/src/components/views/settings/tabs/room/PollHistoryTab.tsx index a33e132e13..72a20350bb 100644 --- a/src/components/views/settings/tabs/room/PollHistoryTab.tsx +++ b/src/components/views/settings/tabs/room/PollHistoryTab.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useContext } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import MatrixClientContext from "../../../../../contexts/MatrixClientContext"; import { PollHistory } from "../../../polls/pollHistory/PollHistory"; diff --git a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx index e2de5c3e69..3b6855bc19 100644 --- a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx @@ -7,12 +7,19 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { EventType, RoomMember, RoomState, RoomStateEvent, Room, IContent } from "matrix-js-sdk/src/matrix"; +import { + EventType, + type RoomMember, + type RoomState, + RoomStateEvent, + type Room, + type IContent, +} from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { throttle, get } from "lodash"; -import { KnownMembership, RoomPowerLevelsEventContent } from "matrix-js-sdk/src/types"; +import { KnownMembership, type RoomPowerLevelsEventContent } from "matrix-js-sdk/src/types"; -import { _t, _td, TranslationKey } from "../../../../../languageHandler"; +import { _t, _td, type TranslationKey } from "../../../../../languageHandler"; import AccessibleButton from "../../../elements/AccessibleButton"; import Modal from "../../../../../Modal"; import ErrorDialog from "../../../dialogs/ErrorDialog"; diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx index f90dd9821d..31f308809d 100644 --- a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { GuestAccess, HistoryVisibility, JoinRule, - MatrixEvent, + type MatrixEvent, RoomStateEvent, - Room, + type Room, EventType, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx index f7b69696be..3583179b92 100644 --- a/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/VoipRoomSettingsTab.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React, { useCallback, useMemo, useState } from "react"; -import { JoinRule, EventType, RoomState, Room } from "matrix-js-sdk/src/matrix"; -import { RoomPowerLevelsEventContent } from "matrix-js-sdk/src/types"; +import { JoinRule, EventType, type RoomState, type Room } from "matrix-js-sdk/src/matrix"; +import { type RoomPowerLevelsEventContent } from "matrix-js-sdk/src/types"; import { _t } from "../../../../../languageHandler"; import LabelledToggleSwitch from "../../../elements/LabelledToggleSwitch"; diff --git a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx index 8720c55a91..7d46cf72da 100644 --- a/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/AppearanceUserSettingsTab.tsx @@ -7,8 +7,8 @@ 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, { ChangeEvent, ReactNode } from "react"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import React, { type ChangeEvent, type ReactNode } from "react"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; diff --git a/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx b/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx index 59f9f9fa9d..f164342e27 100644 --- a/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx @@ -5,7 +5,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX, useCallback, useEffect, useState } from "react"; +import React, { type JSX, useCallback, useEffect, useState } from "react"; import { Button, InlineSpinner, Separator } from "@vector-im/compound-web"; import ComputerIcon from "@vector-im/compound-design-tokens/assets/web/icons/computer"; diff --git a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx index 1d24875482..5330d74520 100644 --- a/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/HelpUserSettingsTab.tsx @@ -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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import AccessibleButton from "../../../elements/AccessibleButton"; import { _t } from "../../../../../languageHandler"; diff --git a/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx b/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx index b6d2d24c96..44e3623625 100644 --- a/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/KeyboardUserSettingsTab.tsx @@ -9,7 +9,12 @@ Please see LICENSE files in the repository root for full details. import React from "react"; -import { ICategory, CATEGORIES, CategoryName, KeyBindingAction } from "../../../../../accessibility/KeyboardShortcuts"; +import { + type ICategory, + CATEGORIES, + CategoryName, + type KeyBindingAction, +} from "../../../../../accessibility/KeyboardShortcuts"; import { _t } from "../../../../../languageHandler"; import { getKeyboardShortcutDisplayName, diff --git a/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx b/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx index 140b599b4a..1d7b920f2b 100644 --- a/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { sortBy } from "lodash"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../../languageHandler"; import SettingsStore from "../../../../../settings/SettingsStore"; @@ -15,7 +15,7 @@ import { SettingLevel } from "../../../../../settings/SettingLevel"; import SdkConfig from "../../../../../SdkConfig"; import BetaCard from "../../../beta/BetaCard"; import SettingsFlag from "../../../elements/SettingsFlag"; -import { FeatureSettingKey, LabGroup, labGroupNames } from "../../../../../settings/Settings"; +import { type FeatureSettingKey, LabGroup, labGroupNames } from "../../../../../settings/Settings"; import { EnhancedMap } from "../../../../../utils/maps"; import { SettingsSection } from "../../shared/SettingsSection"; import { SettingsSubsection, SettingsSubsectionText } from "../../shared/SettingsSubsection"; diff --git a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx index b0fa4e0fc2..1fe0367b31 100644 --- a/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/MjolnirUserSettingsTab.tsx @@ -6,15 +6,15 @@ 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, { ChangeEvent, SyntheticEvent } from "react"; +import React, { type ChangeEvent, type SyntheticEvent } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../../languageHandler"; import SdkConfig from "../../../../../SdkConfig"; import { Mjolnir } from "../../../../../mjolnir/Mjolnir"; -import { ListRule } from "../../../../../mjolnir/ListRule"; -import { BanList, RULE_SERVER, RULE_USER } from "../../../../../mjolnir/BanList"; +import { type ListRule } from "../../../../../mjolnir/ListRule"; +import { type BanList, RULE_SERVER, RULE_USER } from "../../../../../mjolnir/BanList"; import Modal from "../../../../../Modal"; import { MatrixClientPeg } from "../../../../../MatrixClientPeg"; import ErrorDialog from "../../../dialogs/ErrorDialog"; diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx index 8ad00f350f..cb22bb2a0c 100644 --- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.tsx @@ -7,9 +7,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, useCallback, useEffect, useState } from "react"; +import React, { type ReactElement, useCallback, useEffect, useState } from "react"; -import { NonEmptyArray } from "../../../../../@types/common"; +import { type NonEmptyArray } from "../../../../../@types/common"; import { _t, getCurrentLanguage } from "../../../../../languageHandler"; import SettingsStore from "../../../../../settings/SettingsStore"; import Field from "../../../elements/Field"; @@ -19,7 +19,7 @@ import SettingsFlag from "../../../elements/SettingsFlag"; import AccessibleButton from "../../../elements/AccessibleButton"; import dis from "../../../../../dispatcher/dispatcher"; import { UserTab } from "../../../dialogs/UserTab"; -import { OpenToTabPayload } from "../../../../../dispatcher/payloads/OpenToTabPayload"; +import { type OpenToTabPayload } from "../../../../../dispatcher/payloads/OpenToTabPayload"; import { Action } from "../../../../../dispatcher/actions"; import SdkConfig from "../../../../../SdkConfig"; import { SettingsSubsection } from "../../shared/SettingsSubsection"; @@ -31,7 +31,7 @@ import { IS_MAC } from "../../../../../Keyboard"; import SpellCheckSettings from "../../SpellCheckSettings"; import LabelledToggleSwitch from "../../../elements/LabelledToggleSwitch"; import * as TimezoneHandler from "../../../../../TimezoneHandler"; -import { BooleanSettingKey } from "../../../../../settings/Settings.tsx"; +import { type BooleanSettingKey } from "../../../../../settings/Settings.tsx"; interface IProps { closeSettingsFn(success: boolean): void; diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx index dfd57aa072..758fbf3e4a 100644 --- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { sleep } from "matrix-js-sdk/src/utils"; -import { Room, RoomEvent } from "matrix-js-sdk/src/matrix"; -import { KnownMembership, Membership } from "matrix-js-sdk/src/types"; +import { type Room, RoomEvent, type IServerVersions } from "matrix-js-sdk/src/matrix"; +import { KnownMembership, type Membership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../../../languageHandler"; @@ -20,7 +20,7 @@ import { SettingLevel } from "../../../../../settings/SettingLevel"; import SecureBackupPanel from "../../SecureBackupPanel"; import SettingsStore from "../../../../../settings/SettingsStore"; import { UIFeature } from "../../../../../settings/UIFeature"; -import { ActionPayload } from "../../../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../../../dispatcher/payloads"; import CryptographyPanel from "../../CryptographyPanel"; import SettingsFlag from "../../../elements/SettingsFlag"; import CrossSigningPanel from "../../CrossSigningPanel"; @@ -29,7 +29,6 @@ import InlineSpinner from "../../../elements/InlineSpinner"; import { PosthogAnalytics } from "../../../../../PosthogAnalytics"; import { showDialog as showAnalyticsLearnMoreDialog } from "../../../dialogs/AnalyticsLearnMoreDialog"; import { privateShouldBeEncrypted } from "../../../../../utils/rooms"; -import type { IServerVersions } from "matrix-js-sdk/src/matrix"; import SettingsTab from "../SettingsTab"; import { SettingsSection } from "../../shared/SettingsSection"; import { SettingsSubsection, SettingsSubsectionText } from "../../shared/SettingsSubsection"; diff --git a/src/components/views/settings/tabs/user/SessionManagerTab.tsx b/src/components/views/settings/tabs/user/SessionManagerTab.tsx index d6a64426f1..ef670cd19f 100644 --- a/src/components/views/settings/tabs/user/SessionManagerTab.tsx +++ b/src/components/views/settings/tabs/user/SessionManagerTab.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { lazy, Suspense, useCallback, useContext, useEffect, useRef, useState } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { defer } from "matrix-js-sdk/src/utils"; @@ -21,14 +21,14 @@ import { useOwnDevices } from "../../devices/useOwnDevices"; import { FilteredDeviceList } from "../../devices/FilteredDeviceList"; import CurrentDeviceSection from "../../devices/CurrentDeviceSection"; import SecurityRecommendations from "../../devices/SecurityRecommendations"; -import { ExtendedDevice } from "../../devices/types"; +import { type ExtendedDevice } from "../../devices/types"; import { deleteDevicesWithInteractiveAuth } from "../../devices/deleteDevices"; import SettingsTab from "../SettingsTab"; import LoginWithQRSection from "../../devices/LoginWithQRSection"; import { Mode } from "../../../auth/LoginWithQR-types"; import { useAsyncMemo } from "../../../../../hooks/useAsyncMemo"; import QuestionDialog from "../../../dialogs/QuestionDialog"; -import { FilterVariation } from "../../devices/filter"; +import { type FilterVariation } from "../../devices/filter"; import { OtherSessionsSectionHeading } from "../../devices/OtherSessionsSectionHeading"; import { SettingsSection } from "../../shared/SettingsSection"; import { getManageDeviceUrl } from "../../../../../utils/oidc/urls.ts"; diff --git a/src/components/views/settings/tabs/user/SidebarUserSettingsTab.tsx b/src/components/views/settings/tabs/user/SidebarUserSettingsTab.tsx index d7b6283aa4..067ec9a124 100644 --- a/src/components/views/settings/tabs/user/SidebarUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/SidebarUserSettingsTab.tsx @@ -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 React, { ChangeEvent, useMemo } from "react"; +import React, { type ChangeEvent, useMemo } from "react"; import { VideoCallSolidIcon, HomeSolidIcon, diff --git a/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx b/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx index 739bf3dea1..c54b77e70a 100644 --- a/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/VoiceUserSettingsTab.tsx @@ -7,13 +7,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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import { FALLBACK_ICE_SERVER } from "matrix-js-sdk/src/webrtc/call"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../../../languageHandler"; -import MediaDeviceHandler, { IMediaDevices, MediaDeviceKindEnum } from "../../../../../MediaDeviceHandler"; +import MediaDeviceHandler, { type IMediaDevices, MediaDeviceKindEnum } from "../../../../../MediaDeviceHandler"; import Field from "../../../elements/Field"; import AccessibleButton from "../../../elements/AccessibleButton"; import { SettingLevel } from "../../../../../settings/SettingLevel"; diff --git a/src/components/views/spaces/QuickThemeSwitcher.tsx b/src/components/views/spaces/QuickThemeSwitcher.tsx index 5d2372647e..ddb058f788 100644 --- a/src/components/views/spaces/QuickThemeSwitcher.tsx +++ b/src/components/views/spaces/QuickThemeSwitcher.tsx @@ -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 React, { ReactElement, useMemo } from "react"; +import React, { type ReactElement, useMemo } from "react"; import { _t } from "../../../languageHandler"; import { Action } from "../../../dispatcher/actions"; @@ -15,9 +15,9 @@ import Dropdown from "../elements/Dropdown"; import SettingsStore from "../../../settings/SettingsStore"; import { SettingLevel } from "../../../settings/SettingLevel"; import dis from "../../../dispatcher/dispatcher"; -import { RecheckThemePayload } from "../../../dispatcher/payloads/RecheckThemePayload"; +import { type RecheckThemePayload } from "../../../dispatcher/payloads/RecheckThemePayload"; import PosthogTrackers from "../../../PosthogTrackers"; -import { NonEmptyArray } from "../../../@types/common"; +import { type NonEmptyArray } from "../../../@types/common"; import { useTheme } from "../../../hooks/useTheme"; type Props = { diff --git a/src/components/views/spaces/SpaceBasicSettings.tsx b/src/components/views/spaces/SpaceBasicSettings.tsx index 4832da50b3..fb841e9360 100644 --- a/src/components/views/spaces/SpaceBasicSettings.tsx +++ b/src/components/views/spaces/SpaceBasicSettings.tsx @@ -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 React, { ChangeEvent, useRef, useState } from "react"; +import React, { type ChangeEvent, useRef, useState } from "react"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/spaces/SpaceChildrenPicker.tsx b/src/components/views/spaces/SpaceChildrenPicker.tsx index 49f873fcf5..268b22d288 100644 --- a/src/components/views/spaces/SpaceChildrenPicker.tsx +++ b/src/components/views/spaces/SpaceChildrenPicker.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useEffect, useMemo, useState } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import StyledRadioGroup from "../elements/StyledRadioGroup"; diff --git a/src/components/views/spaces/SpaceCreateMenu.tsx b/src/components/views/spaces/SpaceCreateMenu.tsx index e964894502..01d4a454c0 100644 --- a/src/components/views/spaces/SpaceCreateMenu.tsx +++ b/src/components/views/spaces/SpaceCreateMenu.tsx @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import React, { - ComponentProps, - RefObject, - SyntheticEvent, - KeyboardEvent, + type ComponentProps, + type RefObject, + type SyntheticEvent, + type KeyboardEvent, useContext, useRef, useState, - ChangeEvent, - ReactNode, + type ChangeEvent, + type ReactNode, useEffect, } from "react"; import classNames from "classnames"; @@ -24,17 +24,18 @@ import { HistoryVisibility, Preset, Visibility, - MatrixClient, - ICreateRoomOpts, + type MatrixClient, + type ICreateRoomOpts, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; import ContextMenu, { ChevronFace } from "../../structures/ContextMenu"; -import createRoom, { IOpts as ICreateOpts } from "../../../createRoom"; +import createRoom, { type IOpts as ICreateOpts } from "../../../createRoom"; import MatrixClientContext, { useMatrixClientContext } from "../../../contexts/MatrixClientContext"; -import SpaceBasicSettings, { SpaceAvatar } from "./SpaceBasicSettings"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import type SpaceBasicSettings from "./SpaceBasicSettings"; +import { SpaceAvatar } from "./SpaceBasicSettings"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import Field from "../elements/Field"; import withValidation from "../elements/Validation"; import RoomAliasField from "../elements/RoomAliasField"; @@ -43,7 +44,7 @@ import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import defaultDispatcher from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; import { Filter } from "../dialogs/spotlight/Filter"; -import { OpenSpotlightPayload } from "../../../dispatcher/payloads/OpenSpotlightPayload.ts"; +import { type OpenSpotlightPayload } from "../../../dispatcher/payloads/OpenSpotlightPayload.ts"; export const createSpace = async ( client: MatrixClient, diff --git a/src/components/views/spaces/SpacePanel.tsx b/src/components/views/spaces/SpacePanel.tsx index 3dd46abb8d..35bb9b0c8c 100644 --- a/src/components/views/spaces/SpacePanel.tsx +++ b/src/components/views/spaces/SpacePanel.tsx @@ -7,20 +7,20 @@ Please see LICENSE files in the repository root for full details. */ import React, { - ComponentProps, - Dispatch, - ReactNode, - RefCallback, - SetStateAction, + type ComponentProps, + type Dispatch, + type ReactNode, + type RefCallback, + type SetStateAction, useCallback, useEffect, useLayoutEffect, useRef, useState, } from "react"; -import { DragDropContext, Draggable, Droppable, DroppableProvidedProps } from "react-beautiful-dnd"; +import { DragDropContext, Draggable, Droppable, type DroppableProvidedProps } from "react-beautiful-dnd"; import classNames from "classnames"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import { useContextMenu } from "../../structures/ContextMenu"; @@ -31,7 +31,7 @@ import SpaceStore from "../../../stores/spaces/SpaceStore"; import { getMetaSpaceName, MetaSpace, - SpaceKey, + type SpaceKey, UPDATE_HOME_BEHAVIOUR, UPDATE_INVITED_SPACES, UPDATE_SELECTED_SPACE, @@ -42,7 +42,7 @@ import { RoomNotificationStateStore, UPDATE_STATUS_INDICATOR, } from "../../../stores/notifications/RoomNotificationStateStore"; -import SpaceContextMenu from "../context_menus/SpaceContextMenu"; +import type SpaceContextMenu from "../context_menus/SpaceContextMenu"; import IconizedContextMenu, { IconizedContextMenuCheckbox, IconizedContextMenuOptionList, @@ -56,9 +56,9 @@ import UserMenu from "../../structures/UserMenu"; import IndicatorScrollbar from "../../structures/IndicatorScrollbar"; import { useDispatcher } from "../../../hooks/useDispatcher"; import defaultDispatcher from "../../../dispatcher/dispatcher"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import { Action } from "../../../dispatcher/actions"; -import { NotificationState } from "../../../stores/notifications/NotificationState"; +import { type NotificationState } from "../../../stores/notifications/NotificationState"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { shouldShowComponent } from "../../../customisations/helpers/UIComponents"; diff --git a/src/components/views/spaces/SpacePublicShare.tsx b/src/components/views/spaces/SpacePublicShare.tsx index 8e148567ac..c3a9fae562 100644 --- a/src/components/views/spaces/SpacePublicShare.tsx +++ b/src/components/views/spaces/SpacePublicShare.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useState } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { sleep } from "matrix-js-sdk/src/utils"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/spaces/SpaceSettingsGeneralTab.tsx b/src/components/views/spaces/SpaceSettingsGeneralTab.tsx index 09f14ec2e1..f8a984e0c3 100644 --- a/src/components/views/spaces/SpaceSettingsGeneralTab.tsx +++ b/src/components/views/spaces/SpaceSettingsGeneralTab.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useState } from "react"; -import { Room, EventType, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Room, EventType, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../../languageHandler"; diff --git a/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx b/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx index 3612f668c9..1abd2a1634 100644 --- a/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx +++ b/src/components/views/spaces/SpaceSettingsVisibilityTab.tsx @@ -7,7 +7,14 @@ Please see LICENSE files in the repository root for full details. */ import React, { useState } from "react"; -import { Room, EventType, GuestAccess, HistoryVisibility, JoinRule, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { + type Room, + EventType, + GuestAccess, + HistoryVisibility, + JoinRule, + type MatrixClient, +} from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import AccessibleButton from "../elements/AccessibleButton"; diff --git a/src/components/views/spaces/SpaceTreeLevel.tsx b/src/components/views/spaces/SpaceTreeLevel.tsx index d85e5ff2a9..cdc35593ae 100644 --- a/src/components/views/spaces/SpaceTreeLevel.tsx +++ b/src/components/views/spaces/SpaceTreeLevel.tsx @@ -7,22 +7,22 @@ Please see LICENSE files in the repository root for full details. */ import React, { - MouseEvent, - ComponentProps, - ComponentType, + type MouseEvent, + type ComponentProps, + type ComponentType, createRef, - InputHTMLAttributes, - LegacyRef, - RefObject, + type InputHTMLAttributes, + type LegacyRef, + type RefObject, } from "react"; import classNames from "classnames"; -import { Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import { DraggableProvidedDragHandleProps } from "react-beautiful-dnd"; +import { type DraggableProvidedDragHandleProps } from "react-beautiful-dnd"; import RoomAvatar from "../avatars/RoomAvatar"; import SpaceStore from "../../../stores/spaces/SpaceStore"; -import { SpaceKey } from "../../../stores/spaces"; +import { type SpaceKey } from "../../../stores/spaces"; import SpaceTreeLevelLayoutStore from "../../../stores/spaces/SpaceTreeLevelLayoutStore"; import NotificationBadge from "../rooms/NotificationBadge"; import { _t } from "../../../languageHandler"; @@ -30,11 +30,14 @@ import defaultDispatcher from "../../../dispatcher/dispatcher"; import { Action } from "../../../dispatcher/actions"; import { ContextMenuTooltipButton } from "../../../accessibility/context_menu/ContextMenuTooltipButton"; import { toRightOf, useContextMenu } from "../../structures/ContextMenu"; -import AccessibleButton, { ButtonEvent, ButtonProps as AccessibleButtonProps } from "../elements/AccessibleButton"; +import AccessibleButton, { + type ButtonEvent, + type ButtonProps as AccessibleButtonProps, +} from "../elements/AccessibleButton"; import { StaticNotificationState } from "../../../stores/notifications/StaticNotificationState"; import { NotificationLevel } from "../../../stores/notifications/NotificationLevel"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; -import { NotificationState } from "../../../stores/notifications/NotificationState"; +import { type NotificationState } from "../../../stores/notifications/NotificationState"; import SpaceContextMenu from "../context_menus/SpaceContextMenu"; import { useRovingTabIndex } from "../../../accessibility/RovingTabIndex"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; diff --git a/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx b/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx index 562019a33f..75f4553116 100644 --- a/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx +++ b/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx @@ -6,21 +6,21 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { JSX, useState } from "react"; +import React, { type JSX, useState } from "react"; import { Menu, MenuItem } from "@vector-im/compound-web"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { ThreadsActivityCentreButton } from "./ThreadsActivityCentreButton"; import { _t } from "../../../../languageHandler"; import DecoratedRoomAvatar from "../../avatars/DecoratedRoomAvatar"; import { Action } from "../../../../dispatcher/actions"; import defaultDispatcher from "../../../../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../../dispatcher/payloads/ViewRoomPayload"; import RightPanelStore from "../../../../stores/right-panel/RightPanelStore"; import { RightPanelPhases } from "../../../../stores/right-panel/RightPanelStorePhases"; import { useUnreadThreadRooms } from "./useUnreadThreadRooms"; import { StatelessNotificationBadge } from "../../rooms/NotificationBadge/StatelessNotificationBadge"; -import { NotificationLevel } from "../../../../stores/notifications/NotificationLevel"; +import { type NotificationLevel } from "../../../../stores/notifications/NotificationLevel"; import PosthogTrackers from "../../../../PosthogTrackers"; import { getKeyBindingsManager } from "../../../../KeyBindingsManager"; import { KeyBindingAction } from "../../../../accessibility/KeyboardShortcuts"; diff --git a/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentreButton.tsx b/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentreButton.tsx index 123b8a072e..bb04df275b 100644 --- a/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentreButton.tsx +++ b/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentreButton.tsx @@ -6,13 +6,13 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { ComponentProps, forwardRef } from "react"; +import React, { type ComponentProps, forwardRef } from "react"; import ThreadsSolidIcon from "@vector-im/compound-design-tokens/assets/web/icons/threads-solid"; import classNames from "classnames"; import { IconButton, Text, Tooltip } from "@vector-im/compound-web"; import { _t } from "../../../../languageHandler"; -import { NotificationLevel } from "../../../../stores/notifications/NotificationLevel"; +import { type NotificationLevel } from "../../../../stores/notifications/NotificationLevel"; import { notificationLevelToIndicator } from "../../../../utils/notifications"; interface ThreadsActivityCentreButtonProps extends ComponentProps { diff --git a/src/components/views/spaces/threads-activity-centre/useUnreadThreadRooms.ts b/src/components/views/spaces/threads-activity-centre/useUnreadThreadRooms.ts index dea00bafa7..966e223df6 100644 --- a/src/components/views/spaces/threads-activity-centre/useUnreadThreadRooms.ts +++ b/src/components/views/spaces/threads-activity-centre/useUnreadThreadRooms.ts @@ -7,7 +7,7 @@ */ import { useCallback, useEffect, useMemo, useState } from "react"; -import { ClientEvent, MatrixClient, MatrixEventEvent, Room } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type MatrixClient, MatrixEventEvent, type Room } from "matrix-js-sdk/src/matrix"; import { throttle } from "lodash"; import { doesRoomHaveUnreadThreads } from "../../../../Unread"; diff --git a/src/components/views/terms/InlineTermsAgreement.tsx b/src/components/views/terms/InlineTermsAgreement.tsx index 14a9199f80..e4ae2258d7 100644 --- a/src/components/views/terms/InlineTermsAgreement.tsx +++ b/src/components/views/terms/InlineTermsAgreement.tsx @@ -12,7 +12,7 @@ import { _t } from "../../../languageHandler"; import { objectClone } from "../../../utils/objects"; import StyledCheckbox from "../elements/StyledCheckbox"; import AccessibleButton from "../elements/AccessibleButton"; -import { pickBestPolicyLanguage, ServicePolicyPair } from "../../../Terms"; +import { pickBestPolicyLanguage, type ServicePolicyPair } from "../../../Terms"; interface IProps { policiesAndServicePairs: ServicePolicyPair[]; diff --git a/src/components/views/toasts/GenericExpiringToast.tsx b/src/components/views/toasts/GenericExpiringToast.tsx index b019babaf2..abbbacc5f8 100644 --- a/src/components/views/toasts/GenericExpiringToast.tsx +++ b/src/components/views/toasts/GenericExpiringToast.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import ToastStore from "../../../stores/ToastStore"; -import GenericToast, { IProps as IGenericToastProps } from "./GenericToast"; +import GenericToast, { type IProps as IGenericToastProps } from "./GenericToast"; import { useExpiringCounter } from "../../../hooks/useTimeout"; interface IProps extends IGenericToastProps { diff --git a/src/components/views/toasts/GenericToast.tsx b/src/components/views/toasts/GenericToast.tsx index 61c6272377..d57dddc705 100644 --- a/src/components/views/toasts/GenericToast.tsx +++ b/src/components/views/toasts/GenericToast.tsx @@ -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 React, { ComponentType, ReactNode } from "react"; +import React, { type ComponentType, type ReactNode } from "react"; import { Button } from "@vector-im/compound-web"; -import { XOR } from "../../../@types/common"; +import { type XOR } from "../../../@types/common"; export interface IProps { description: ReactNode; diff --git a/src/components/views/toasts/VerificationRequestToast.tsx b/src/components/views/toasts/VerificationRequestToast.tsx index f235b8f488..e3975c148b 100644 --- a/src/components/views/toasts/VerificationRequestToast.tsx +++ b/src/components/views/toasts/VerificationRequestToast.tsx @@ -9,11 +9,11 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { canAcceptVerificationRequest, - VerificationRequest, + type VerificationRequest, VerificationRequestEvent, } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; -import { Device } from "matrix-js-sdk/src/matrix"; +import { type Device } from "matrix-js-sdk/src/matrix"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; @@ -26,7 +26,7 @@ import GenericToast from "./GenericToast"; import { Action } from "../../../dispatcher/actions"; import VerificationRequestDialog from "../dialogs/VerificationRequestDialog"; import RightPanelStore from "../../../stores/right-panel/RightPanelStore"; -import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload"; import { getDeviceCryptoInfo } from "../../../utils/crypto/deviceInfo"; interface IProps { diff --git a/src/components/views/typography/Caption.tsx b/src/components/views/typography/Caption.tsx index 0ce9fbb65c..8279ac9b7c 100644 --- a/src/components/views/typography/Caption.tsx +++ b/src/components/views/typography/Caption.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import classNames from "classnames"; -import React, { HTMLAttributes } from "react"; +import React, { type HTMLAttributes } from "react"; interface Props extends Omit, "className"> { children: React.ReactNode; diff --git a/src/components/views/typography/Heading.tsx b/src/components/views/typography/Heading.tsx index c367c5d445..883f5f3b26 100644 --- a/src/components/views/typography/Heading.tsx +++ b/src/components/views/typography/Heading.tsx @@ -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 React, { HTMLAttributes } from "react"; +import React, { type HTMLAttributes } from "react"; import classNames from "classnames"; type Size = "1" | "2" | "3" | "4"; diff --git a/src/components/views/verification/VerificationShowSas.tsx b/src/components/views/verification/VerificationShowSas.tsx index df9ddba892..d2d53164d3 100644 --- a/src/components/views/verification/VerificationShowSas.tsx +++ b/src/components/views/verification/VerificationShowSas.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Device } from "matrix-js-sdk/src/matrix"; -import { GeneratedSas, EmojiMapping } from "matrix-js-sdk/src/crypto-api"; +import { type Device } from "matrix-js-sdk/src/matrix"; +import { type GeneratedSas, type EmojiMapping } from "matrix-js-sdk/src/crypto-api"; import SasEmoji from "@matrix-org/spec/sas-emoji.json"; import { _t, getNormalizedLanguageKeys, getUserLanguage } from "../../../languageHandler"; diff --git a/src/components/views/voip/AudioFeed.tsx b/src/components/views/voip/AudioFeed.tsx index 36a02c21cd..834318f41a 100644 --- a/src/components/views/voip/AudioFeed.tsx +++ b/src/components/views/voip/AudioFeed.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { CallFeed, CallFeedEvent } from "matrix-js-sdk/src/webrtc/callFeed"; +import { type CallFeed, CallFeedEvent } from "matrix-js-sdk/src/webrtc/callFeed"; import { logger } from "matrix-js-sdk/src/logger"; import MediaDeviceHandler, { MediaDeviceHandlerEvent } from "../../../MediaDeviceHandler"; diff --git a/src/components/views/voip/AudioFeedArrayForLegacyCall.tsx b/src/components/views/voip/AudioFeedArrayForLegacyCall.tsx index 5b2a0d0c87..89f9330f74 100644 --- a/src/components/views/voip/AudioFeedArrayForLegacyCall.tsx +++ b/src/components/views/voip/AudioFeedArrayForLegacyCall.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { CallEvent, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; -import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; +import { CallEvent, type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; import AudioFeed from "./AudioFeed"; diff --git a/src/components/views/voip/CallDuration.tsx b/src/components/views/voip/CallDuration.tsx index 34f5d0ba60..ccf57d3f02 100644 --- a/src/components/views/voip/CallDuration.tsx +++ b/src/components/views/voip/CallDuration.tsx @@ -6,8 +6,8 @@ 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, { FC, useState, useEffect, memo } from "react"; -import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; +import React, { type FC, useState, useEffect, memo } from "react"; +import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; import { formatPreciseDuration } from "../../../DateUtils"; diff --git a/src/components/views/voip/CallView.tsx b/src/components/views/voip/CallView.tsx index b7b15c2f71..d45554d08f 100644 --- a/src/components/views/voip/CallView.tsx +++ b/src/components/views/voip/CallView.tsx @@ -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 React, { FC, useContext, useEffect, AriaRole, useCallback } from "react"; +import React, { type FC, useContext, useEffect, type AriaRole, useCallback } from "react"; import type { Room } from "matrix-js-sdk/src/matrix"; -import { Call, ConnectionState, ElementCall } from "../../../models/Call"; +import { type Call, ConnectionState, ElementCall } from "../../../models/Call"; import { useCall } from "../../../hooks/useCall"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; import AppTile from "../elements/AppTile"; diff --git a/src/components/views/voip/DialPad.tsx b/src/components/views/voip/DialPad.tsx index a23c89fdef..fff24d08f2 100644 --- a/src/components/views/voip/DialPad.tsx +++ b/src/components/views/voip/DialPad.tsx @@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details. import * as React from "react"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import { _t } from "../../../languageHandler"; -import { XOR } from "../../../@types/common"; +import { type XOR } from "../../../@types/common"; export const BUTTONS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "0", "#"]; export const BUTTON_LETTERS = ["", "ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ", "", "+", ""]; diff --git a/src/components/views/voip/DialPadModal.tsx b/src/components/views/voip/DialPadModal.tsx index 172a9cbaa5..cf23997a02 100644 --- a/src/components/views/voip/DialPadModal.tsx +++ b/src/components/views/voip/DialPadModal.tsx @@ -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, { ChangeEvent, createRef, SyntheticEvent } from "react"; +import React, { type ChangeEvent, createRef, type SyntheticEvent } from "react"; -import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../elements/AccessibleButton"; import Field from "../elements/Field"; import DialPad from "./DialPad"; import DialPadBackspaceButton from "../elements/DialPadBackspaceButton"; diff --git a/src/components/views/voip/LegacyCallView.tsx b/src/components/views/voip/LegacyCallView.tsx index 9c5246b912..1131621d12 100644 --- a/src/components/views/voip/LegacyCallView.tsx +++ b/src/components/views/voip/LegacyCallView.tsx @@ -9,9 +9,9 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { CallEvent, CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { CallEvent, CallState, type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import classNames from "classnames"; -import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; +import { type CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; import { SDPStreamMetadataPurpose } from "matrix-js-sdk/src/webrtc/callEventTypes"; import dis from "../../../dispatcher/dispatcher"; @@ -25,7 +25,7 @@ import { avatarUrlForMember } from "../../../Avatar"; import LegacyCallViewSidebar from "./LegacyCallViewSidebar"; import LegacyCallViewHeader from "./LegacyCallView/LegacyCallViewHeader"; import LegacyCallViewButtons from "./LegacyCallView/LegacyCallViewButtons"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import { getKeyBindingsManager } from "../../../KeyBindingsManager"; import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts"; diff --git a/src/components/views/voip/LegacyCallView/LegacyCallViewButtons.tsx b/src/components/views/voip/LegacyCallView/LegacyCallViewButtons.tsx index 7788cb0e78..d9fc85c943 100644 --- a/src/components/views/voip/LegacyCallView/LegacyCallViewButtons.tsx +++ b/src/components/views/voip/LegacyCallView/LegacyCallViewButtons.tsx @@ -10,7 +10,7 @@ Please see LICENSE files in the repository root for full details. import React, { createRef, useState, forwardRef } from "react"; import classNames from "classnames"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import LegacyCallContextMenu from "../../context_menus/LegacyCallContextMenu"; import DialpadContextMenu from "../../context_menus/DialpadContextMenu"; @@ -24,7 +24,10 @@ import { import { _t } from "../../../../languageHandler"; import DeviceContextMenu from "../../context_menus/DeviceContextMenu"; import { MediaDeviceKindEnum } from "../../../../MediaDeviceHandler"; -import AccessibleButton, { ButtonEvent, ButtonProps as AccessibleButtonProps } from "../../elements/AccessibleButton"; +import AccessibleButton, { + type ButtonEvent, + type ButtonProps as AccessibleButtonProps, +} from "../../elements/AccessibleButton"; // Height of the header duplicated from CSS because we need to subtract it from our max // height to get the max height of the video diff --git a/src/components/views/voip/LegacyCallView/LegacyCallViewHeader.tsx b/src/components/views/voip/LegacyCallView/LegacyCallViewHeader.tsx index b443636d85..0c56bd267c 100644 --- a/src/components/views/voip/LegacyCallView/LegacyCallViewHeader.tsx +++ b/src/components/views/voip/LegacyCallView/LegacyCallViewHeader.tsx @@ -5,7 +5,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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import React from "react"; import { _t } from "../../../../languageHandler"; diff --git a/src/components/views/voip/LegacyCallViewForRoom.tsx b/src/components/views/voip/LegacyCallViewForRoom.tsx index ed55f908be..bd44af5fa5 100644 --- a/src/components/views/voip/LegacyCallViewForRoom.tsx +++ b/src/components/views/voip/LegacyCallViewForRoom.tsx @@ -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 { CallState, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { CallState, type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import React from "react"; import { Resizable } from "re-resizable"; import LegacyCallHandler, { LegacyCallHandlerEvent } from "../../../LegacyCallHandler"; import LegacyCallView from "./LegacyCallView"; -import ResizeNotifier from "../../../utils/ResizeNotifier"; +import type ResizeNotifier from "../../../utils/ResizeNotifier"; interface IProps { // What room we should display the call for diff --git a/src/components/views/voip/LegacyCallViewSidebar.tsx b/src/components/views/voip/LegacyCallViewSidebar.tsx index 3dcf3c644d..71140bff9c 100644 --- a/src/components/views/voip/LegacyCallViewSidebar.tsx +++ b/src/components/views/voip/LegacyCallViewSidebar.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; -import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; +import { type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; import classNames from "classnames"; import VideoFeed from "./VideoFeed"; diff --git a/src/components/views/voip/VideoFeed.tsx b/src/components/views/voip/VideoFeed.tsx index 80ea27223c..3db168d097 100644 --- a/src/components/views/voip/VideoFeed.tsx +++ b/src/components/views/voip/VideoFeed.tsx @@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details. */ import classnames from "classnames"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import React from "react"; -import { CallFeed, CallFeedEvent } from "matrix-js-sdk/src/webrtc/callFeed"; +import { type CallFeed, CallFeedEvent } from "matrix-js-sdk/src/webrtc/callFeed"; import { logger } from "matrix-js-sdk/src/logger"; import { SDPStreamMetadataPurpose } from "matrix-js-sdk/src/webrtc/callEventTypes"; diff --git a/src/contexts/CurrentRightPanelPhaseContext.tsx b/src/contexts/CurrentRightPanelPhaseContext.tsx index 1ab3eafc25..8bc3080fc3 100644 --- a/src/contexts/CurrentRightPanelPhaseContext.tsx +++ b/src/contexts/CurrentRightPanelPhaseContext.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React, { createContext } from "react"; import { useCurrentPhase } from "../hooks/right-panel/useCurrentPhase"; -import { RightPanelPhases } from "../stores/right-panel/RightPanelStorePhases"; +import { type RightPanelPhases } from "../stores/right-panel/RightPanelStorePhases"; type Context = { isPanelOpen: boolean; diff --git a/src/contexts/MatrixClientContext.tsx b/src/contexts/MatrixClientContext.tsx index 3401330379..0810465789 100644 --- a/src/contexts/MatrixClientContext.tsx +++ b/src/contexts/MatrixClientContext.tsx @@ -6,8 +6,8 @@ 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, { ComponentClass, createContext, forwardRef, useContext } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentClass, createContext, forwardRef, useContext } from "react"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; // This context is available to components under LoggedInView, // the context must not be used by components outside a MatrixClientContext tree. diff --git a/src/contexts/RoomContext.ts b/src/contexts/RoomContext.ts index 19f87d9471..2082f70bab 100644 --- a/src/contexts/RoomContext.ts +++ b/src/contexts/RoomContext.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { createContext } from "react"; -import { IRoomState } from "../components/structures/RoomView"; +import { type IRoomState } from "../components/structures/RoomView"; import { Layout } from "../settings/enums/Layout"; export enum TimelineRenderingType { diff --git a/src/contexts/SDKContext.ts b/src/contexts/SDKContext.ts index 184bea4cfa..1b8ede3efd 100644 --- a/src/contexts/SDKContext.ts +++ b/src/contexts/SDKContext.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { createContext } from "react"; import defaultDispatcher from "../dispatcher/dispatcher"; @@ -17,7 +17,7 @@ import { MemberListStore } from "../stores/MemberListStore"; import { RoomNotificationStateStore } from "../stores/notifications/RoomNotificationStateStore"; import RightPanelStore from "../stores/right-panel/RightPanelStore"; import { RoomViewStore } from "../stores/RoomViewStore"; -import SpaceStore, { SpaceStoreClass } from "../stores/spaces/SpaceStore"; +import SpaceStore, { type SpaceStoreClass } from "../stores/spaces/SpaceStore"; import TypingStore from "../stores/TypingStore"; import { UserProfilesStore } from "../stores/UserProfilesStore"; import { WidgetLayoutStore } from "../stores/widgets/WidgetLayoutStore"; diff --git a/src/contexts/ScopedRoomContext.tsx b/src/contexts/ScopedRoomContext.tsx index f08911cbb2..c2ae2dfcd3 100644 --- a/src/contexts/ScopedRoomContext.tsx +++ b/src/contexts/ScopedRoomContext.tsx @@ -7,7 +7,16 @@ Please see LICENSE files in the repository root for full details. */ import { TypedEventEmitter } from "matrix-js-sdk/src/matrix"; -import React, { ContextType, createContext, memo, ReactNode, useContext, useEffect, useMemo, useState } from "react"; +import React, { + type ContextType, + createContext, + memo, + type ReactNode, + useContext, + useEffect, + useMemo, + useState, +} from "react"; import { objectKeyChanges } from "../utils/objects.ts"; import { useTypedEventEmitter } from "../hooks/useEventEmitter.ts"; diff --git a/src/contexts/ToastContext.tsx b/src/contexts/ToastContext.tsx index 268539d0e7..7382a412dc 100644 --- a/src/contexts/ToastContext.tsx +++ b/src/contexts/ToastContext.tsx @@ -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 { ReactNode, createContext, useCallback, useContext, useEffect, useState, useMemo } from "react"; +import { type ReactNode, createContext, useCallback, useContext, useEffect, useState, useMemo } from "react"; /** * A ToastContext helps components display any kind of toast message and can be provided diff --git a/src/createRoom.ts b/src/createRoom.ts index 45f071aac7..d8c9cb2340 100644 --- a/src/createRoom.ts +++ b/src/createRoom.ts @@ -8,13 +8,13 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixClient, + type MatrixClient, ClientEvent, - Room, + type Room, EventType, RoomCreateTypeField, RoomType, - ICreateRoomOpts, + type ICreateRoomOpts, HistoryVisibility, JoinRule, Preset, @@ -23,7 +23,7 @@ import { } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import Modal, { IHandle } from "./Modal"; +import Modal, { type IHandle } from "./Modal"; import { _t, UserFriendlyError } from "./languageHandler"; import dis from "./dispatcher/dispatcher"; import * as Rooms from "./Rooms"; @@ -35,7 +35,7 @@ import { JitsiCall, ElementCall } from "./models/Call"; import { Action } from "./dispatcher/actions"; import ErrorDialog from "./components/views/dialogs/ErrorDialog"; import Spinner from "./components/views/elements/Spinner"; -import { ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; import { findDMForUser } from "./utils/dm/findDMForUser"; import { privateShouldBeEncrypted } from "./utils/rooms"; import { shouldForceDisableEncryption } from "./utils/crypto/shouldForceDisableEncryption"; diff --git a/src/customisations/ChatExport.ts b/src/customisations/ChatExport.ts index ae979d4273..edb634bb96 100644 --- a/src/customisations/ChatExport.ts +++ b/src/customisations/ChatExport.ts @@ -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 { ExportFormat, ExportType } from "../utils/exportUtils/exportUtils"; +import { type ExportFormat, type ExportType } from "../utils/exportUtils/exportUtils"; export type ForceChatExportParameters = { format?: ExportFormat; diff --git a/src/customisations/ComponentVisibility.ts b/src/customisations/ComponentVisibility.ts index c69b6ee185..19a3192894 100644 --- a/src/customisations/ComponentVisibility.ts +++ b/src/customisations/ComponentVisibility.ts @@ -12,7 +12,7 @@ Please see LICENSE files in the repository root for full details. // Populate this class with the details of your customisations when copying it. -import { UIComponent } from "../settings/UIFeature"; +import { type UIComponent } from "../settings/UIFeature"; /** * Determines whether or not the active MatrixClient user should be able to use diff --git a/src/customisations/Media.ts b/src/customisations/Media.ts index d7b367c584..ee963ce822 100644 --- a/src/customisations/Media.ts +++ b/src/customisations/Media.ts @@ -6,12 +6,12 @@ * Please see LICENSE files in the repository root for full details. */ -import { MatrixClient, parseErrorResponse, ResizeMethod } from "matrix-js-sdk/src/matrix"; -import { MediaEventContent } from "matrix-js-sdk/src/types"; -import { Optional } from "matrix-events-sdk"; +import { type MatrixClient, parseErrorResponse, type ResizeMethod } from "matrix-js-sdk/src/matrix"; +import { type MediaEventContent } from "matrix-js-sdk/src/types"; +import { type Optional } from "matrix-events-sdk"; import { MatrixClientPeg } from "../MatrixClientPeg"; -import { IPreparedMedia, prepEventContentAsMedia } from "./models/IMediaEventContent"; +import { type IPreparedMedia, prepEventContentAsMedia } from "./models/IMediaEventContent"; import { UserFriendlyError } from "../languageHandler"; // Populate this class with the details of your customisations when copying it. diff --git a/src/customisations/RoomList.ts b/src/customisations/RoomList.ts index a62e1bf6fc..077056936e 100644 --- a/src/customisations/RoomList.ts +++ b/src/customisations/RoomList.ts @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; // Populate this file with the details of your customisations when copying it. diff --git a/src/customisations/WidgetPermissions.ts b/src/customisations/WidgetPermissions.ts index 9734fee9d0..4f2e6c5308 100644 --- a/src/customisations/WidgetPermissions.ts +++ b/src/customisations/WidgetPermissions.ts @@ -7,7 +7,7 @@ */ // Populate this class with the details of your customisations when copying it. -import { Capability, Widget } from "matrix-widget-api"; +import { type Capability, type Widget } from "matrix-widget-api"; /** * Approves the widget for capabilities that it requested, if any can be diff --git a/src/customisations/WidgetVariables.ts b/src/customisations/WidgetVariables.ts index 6a6651dd10..2ac1a6c13c 100644 --- a/src/customisations/WidgetVariables.ts +++ b/src/customisations/WidgetVariables.ts @@ -7,7 +7,7 @@ */ // Populate this class with the details of your customisations when copying it. -import { ITemplateParams } from "matrix-widget-api"; +import { type ITemplateParams } from "matrix-widget-api"; /** * Provides a partial set of the variables needed to render any widget. If diff --git a/src/customisations/helpers/UIComponents.ts b/src/customisations/helpers/UIComponents.ts index 1c710f112d..4f15ddaf90 100644 --- a/src/customisations/helpers/UIComponents.ts +++ b/src/customisations/helpers/UIComponents.ts @@ -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 { UIComponent } from "../../settings/UIFeature"; +import { type UIComponent } from "../../settings/UIFeature"; import { ComponentVisibilityCustomisations } from "../ComponentVisibility"; export function shouldShowComponent(component: UIComponent): boolean { diff --git a/src/customisations/models/IMediaEventContent.ts b/src/customisations/models/IMediaEventContent.ts index 607fc012ad..9fbe0e977f 100644 --- a/src/customisations/models/IMediaEventContent.ts +++ b/src/customisations/models/IMediaEventContent.ts @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { EncryptedFile, MediaEventContent } from "matrix-js-sdk/src/types"; +import { type EncryptedFile, type MediaEventContent } from "matrix-js-sdk/src/types"; export interface IPreparedMedia extends IMediaObject { thumbnail?: IMediaObject; diff --git a/src/dispatcher/dispatcher.ts b/src/dispatcher/dispatcher.ts index 8b093e2e4a..99c4555f5d 100644 --- a/src/dispatcher/dispatcher.ts +++ b/src/dispatcher/dispatcher.ts @@ -8,8 +8,8 @@ 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 { Action } from "./actions"; -import { ActionPayload, AsyncActionPayload } from "./payloads"; +import { type Action } from "./actions"; +import { type ActionPayload, AsyncActionPayload } from "./payloads"; type DispatchToken = string; diff --git a/src/dispatcher/payloads.ts b/src/dispatcher/payloads.ts index 114f1e5515..248a486a07 100644 --- a/src/dispatcher/payloads.ts +++ b/src/dispatcher/payloads.ts @@ -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 { DispatcherAction } from "./actions"; +import { type DispatcherAction } from "./actions"; /** * The base dispatch type exposed by our dispatcher. diff --git a/src/dispatcher/payloads/ActiveRoomChangedPayload.ts b/src/dispatcher/payloads/ActiveRoomChangedPayload.ts index bb1c0e4afb..68d55c3b52 100644 --- a/src/dispatcher/payloads/ActiveRoomChangedPayload.ts +++ b/src/dispatcher/payloads/ActiveRoomChangedPayload.ts @@ -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 { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; -import { Action } from "../actions"; -import { ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type ActionPayload } from "../payloads"; export interface ActiveRoomChangedPayload extends ActionPayload { action: Action.ActiveRoomChanged; diff --git a/src/dispatcher/payloads/AfterLeaveRoomPayload.ts b/src/dispatcher/payloads/AfterLeaveRoomPayload.ts index 5a74dce7be..07e7c54ad2 100644 --- a/src/dispatcher/payloads/AfterLeaveRoomPayload.ts +++ b/src/dispatcher/payloads/AfterLeaveRoomPayload.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { Action } from "../actions"; -import { ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type ActionPayload } from "../payloads"; export interface AfterLeaveRoomPayload extends ActionPayload { action: Action.AfterLeaveRoom; diff --git a/src/dispatcher/payloads/CancelAskToJoinPayload.ts b/src/dispatcher/payloads/CancelAskToJoinPayload.ts index d9ca8d291e..0b84cb47cf 100644 --- a/src/dispatcher/payloads/CancelAskToJoinPayload.ts +++ b/src/dispatcher/payloads/CancelAskToJoinPayload.ts @@ -6,8 +6,8 @@ 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 { Action } from "../actions"; -import { ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type ActionPayload } from "../payloads"; export interface CancelAskToJoinPayload extends Pick { action: Action.CancelAskToJoin; diff --git a/src/dispatcher/payloads/CheckUpdatesPayload.ts b/src/dispatcher/payloads/CheckUpdatesPayload.ts index b588193b4f..6ab6e5eb35 100644 --- a/src/dispatcher/payloads/CheckUpdatesPayload.ts +++ b/src/dispatcher/payloads/CheckUpdatesPayload.ts @@ -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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; -import { UpdateStatus } from "../../BasePlatform"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type UpdateStatus } from "../../BasePlatform"; export interface CheckUpdatesPayload extends ActionPayload, UpdateStatus { action: Action.CheckUpdates; diff --git a/src/dispatcher/payloads/ComposerInsertPayload.ts b/src/dispatcher/payloads/ComposerInsertPayload.ts index 941f8c135c..9712a8303a 100644 --- a/src/dispatcher/payloads/ComposerInsertPayload.ts +++ b/src/dispatcher/payloads/ComposerInsertPayload.ts @@ -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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; -import { TimelineRenderingType } from "../../contexts/RoomContext"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type TimelineRenderingType } from "../../contexts/RoomContext"; export enum ComposerType { Send = "send", diff --git a/src/dispatcher/payloads/DoAfterSyncPreparedPayload.ts b/src/dispatcher/payloads/DoAfterSyncPreparedPayload.ts index 2f2ed06f66..e73ebcfc01 100644 --- a/src/dispatcher/payloads/DoAfterSyncPreparedPayload.ts +++ b/src/dispatcher/payloads/DoAfterSyncPreparedPayload.ts @@ -6,8 +6,8 @@ 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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface DoAfterSyncPreparedPayload extends Pick { action: Action.DoAfterSyncPrepared; diff --git a/src/dispatcher/payloads/FocusComposerPayload.ts b/src/dispatcher/payloads/FocusComposerPayload.ts index 6ec62e4758..2a72906716 100644 --- a/src/dispatcher/payloads/FocusComposerPayload.ts +++ b/src/dispatcher/payloads/FocusComposerPayload.ts @@ -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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; -import { TimelineRenderingType } from "../../contexts/RoomContext"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type TimelineRenderingType } from "../../contexts/RoomContext"; export interface FocusComposerPayload extends ActionPayload { action: diff --git a/src/dispatcher/payloads/JoinRoomErrorPayload.ts b/src/dispatcher/payloads/JoinRoomErrorPayload.ts index 1112674f21..283a3c6915 100644 --- a/src/dispatcher/payloads/JoinRoomErrorPayload.ts +++ b/src/dispatcher/payloads/JoinRoomErrorPayload.ts @@ -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 { MatrixError } from "matrix-js-sdk/src/matrix"; +import { type MatrixError } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface JoinRoomErrorPayload extends Pick { action: Action.JoinRoomError; diff --git a/src/dispatcher/payloads/JoinRoomPayload.ts b/src/dispatcher/payloads/JoinRoomPayload.ts index d4d0f5ca99..ba5019be6c 100644 --- a/src/dispatcher/payloads/JoinRoomPayload.ts +++ b/src/dispatcher/payloads/JoinRoomPayload.ts @@ -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 { JoinedRoom as JoinedRoomEvent } from "@matrix-org/analytics-events/types/typescript/JoinedRoom"; -import { IJoinRoomOpts } from "matrix-js-sdk/src/matrix"; +import { type JoinedRoom as JoinedRoomEvent } from "@matrix-org/analytics-events/types/typescript/JoinedRoom"; +import { type IJoinRoomOpts } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; /* eslint-disable camelcase */ export interface JoinRoomPayload extends Pick { diff --git a/src/dispatcher/payloads/JoinRoomReadyPayload.ts b/src/dispatcher/payloads/JoinRoomReadyPayload.ts index 5eaa9e3c8d..516f5b4d5c 100644 --- a/src/dispatcher/payloads/JoinRoomReadyPayload.ts +++ b/src/dispatcher/payloads/JoinRoomReadyPayload.ts @@ -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 { JoinedRoom as JoinedRoomEvent } from "@matrix-org/analytics-events/types/typescript/JoinedRoom"; +import { type JoinedRoom as JoinedRoomEvent } from "@matrix-org/analytics-events/types/typescript/JoinedRoom"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; /* eslint-disable camelcase */ export interface JoinRoomReadyPayload extends Pick { diff --git a/src/dispatcher/payloads/OpenAddExistingToSpaceDialogPayload.ts b/src/dispatcher/payloads/OpenAddExistingToSpaceDialogPayload.ts index ebcddb36c8..49dee1dff5 100644 --- a/src/dispatcher/payloads/OpenAddExistingToSpaceDialogPayload.ts +++ b/src/dispatcher/payloads/OpenAddExistingToSpaceDialogPayload.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface OpenAddExistingToSpaceDialogPayload extends ActionPayload { action: Action.OpenAddToExistingSpaceDialog; diff --git a/src/dispatcher/payloads/OpenForwardDialogPayload.ts b/src/dispatcher/payloads/OpenForwardDialogPayload.ts index cc1bffa21e..a883a8bdc1 100644 --- a/src/dispatcher/payloads/OpenForwardDialogPayload.ts +++ b/src/dispatcher/payloads/OpenForwardDialogPayload.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { Optional } from "matrix-events-sdk"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type Optional } from "matrix-events-sdk"; -import { Action } from "../actions"; -import { ActionPayload } from "../payloads"; -import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; +import { type Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type RoomPermalinkCreator } from "../../utils/permalinks/Permalinks"; export interface OpenForwardDialogPayload extends ActionPayload { action: Action.OpenForwardDialog; diff --git a/src/dispatcher/payloads/OpenInviteDialogPayload.ts b/src/dispatcher/payloads/OpenInviteDialogPayload.ts index 1d27507821..77973c239f 100644 --- a/src/dispatcher/payloads/OpenInviteDialogPayload.ts +++ b/src/dispatcher/payloads/OpenInviteDialogPayload.ts @@ -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 { Optional } from "matrix-events-sdk"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type Optional } from "matrix-events-sdk"; +import { type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; -import { InviteKind } from "../../components/views/dialogs/InviteDialogTypes"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type InviteKind } from "../../components/views/dialogs/InviteDialogTypes"; export interface OpenInviteDialogPayload extends ActionPayload { action: Action.OpenInviteDialog; diff --git a/src/dispatcher/payloads/OpenReportEventDialogPayload.ts b/src/dispatcher/payloads/OpenReportEventDialogPayload.ts index a4b355e984..5c3e5d8cd3 100644 --- a/src/dispatcher/payloads/OpenReportEventDialogPayload.ts +++ b/src/dispatcher/payloads/OpenReportEventDialogPayload.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { Action } from "../actions"; -import { ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type ActionPayload } from "../payloads"; export interface OpenReportEventDialogPayload extends ActionPayload { action: Action.OpenReportEventDialog; diff --git a/src/dispatcher/payloads/OpenSpacePreferencesPayload.ts b/src/dispatcher/payloads/OpenSpacePreferencesPayload.ts index ea068054db..8ee488d064 100644 --- a/src/dispatcher/payloads/OpenSpacePreferencesPayload.ts +++ b/src/dispatcher/payloads/OpenSpacePreferencesPayload.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export enum SpacePreferenceTab { Appearance = "SPACE_PREFERENCE_APPEARANCE_TAB", diff --git a/src/dispatcher/payloads/OpenSpaceSettingsPayload.ts b/src/dispatcher/payloads/OpenSpaceSettingsPayload.ts index 9a1feae34d..0bb9bb5ac2 100644 --- a/src/dispatcher/payloads/OpenSpaceSettingsPayload.ts +++ b/src/dispatcher/payloads/OpenSpaceSettingsPayload.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface OpenSpaceSettingsPayload extends ActionPayload { action: Action.OpenSpaceSettings; diff --git a/src/dispatcher/payloads/OpenSpotlightPayload.ts b/src/dispatcher/payloads/OpenSpotlightPayload.ts index ec2a630d07..5cdd5c1295 100644 --- a/src/dispatcher/payloads/OpenSpotlightPayload.ts +++ b/src/dispatcher/payloads/OpenSpotlightPayload.ts @@ -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 { Action } from "../actions"; -import { ActionPayload } from "../payloads"; -import { Filter } from "../../components/views/dialogs/spotlight/Filter"; +import { type Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Filter } from "../../components/views/dialogs/spotlight/Filter"; export interface OpenSpotlightPayload extends ActionPayload { action: Action.OpenSpotlight; diff --git a/src/dispatcher/payloads/OpenToTabPayload.ts b/src/dispatcher/payloads/OpenToTabPayload.ts index 872ae62665..9f43c507e6 100644 --- a/src/dispatcher/payloads/OpenToTabPayload.ts +++ b/src/dispatcher/payloads/OpenToTabPayload.ts @@ -6,8 +6,8 @@ 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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface OpenToTabPayload extends ActionPayload { action: Action.ViewUserSettings | string; // TODO: Add room settings action diff --git a/src/dispatcher/payloads/OverwriteLoginPayload.ts b/src/dispatcher/payloads/OverwriteLoginPayload.ts index dd53b0b7f9..b617611d2d 100644 --- a/src/dispatcher/payloads/OverwriteLoginPayload.ts +++ b/src/dispatcher/payloads/OverwriteLoginPayload.ts @@ -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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; -import { IMatrixClientCreds } from "../../MatrixClientPeg"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type IMatrixClientCreds } from "../../MatrixClientPeg"; export interface OverwriteLoginPayload extends ActionPayload { action: Action.OverwriteLogin; diff --git a/src/dispatcher/payloads/PlatformSetPayload.ts b/src/dispatcher/payloads/PlatformSetPayload.ts index 69dc79121c..6d12978f8f 100644 --- a/src/dispatcher/payloads/PlatformSetPayload.ts +++ b/src/dispatcher/payloads/PlatformSetPayload.ts @@ -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 { Action } from "../actions"; -import { ActionPayload } from "../payloads"; -import BasePlatform from "../../BasePlatform"; +import { type Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import type BasePlatform from "../../BasePlatform"; export interface PlatformSetPayload extends ActionPayload { action: Action.PlatformSet; diff --git a/src/dispatcher/payloads/RecheckThemePayload.ts b/src/dispatcher/payloads/RecheckThemePayload.ts index 87419465ae..f87d45582c 100644 --- a/src/dispatcher/payloads/RecheckThemePayload.ts +++ b/src/dispatcher/payloads/RecheckThemePayload.ts @@ -6,8 +6,8 @@ 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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface RecheckThemePayload extends ActionPayload { action: Action.RecheckTheme; diff --git a/src/dispatcher/payloads/SettingUpdatedPayload.ts b/src/dispatcher/payloads/SettingUpdatedPayload.ts index 16c8d50590..ed84c2b18e 100644 --- a/src/dispatcher/payloads/SettingUpdatedPayload.ts +++ b/src/dispatcher/payloads/SettingUpdatedPayload.ts @@ -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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; -import { SettingLevel } from "../../settings/SettingLevel"; -import { SettingValueType } from "../../settings/Settings"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type SettingLevel } from "../../settings/SettingLevel"; +import { type SettingValueType } from "../../settings/Settings"; export interface SettingUpdatedPayload extends ActionPayload { action: Action.SettingUpdated; diff --git a/src/dispatcher/payloads/ShowThreadPayload.ts b/src/dispatcher/payloads/ShowThreadPayload.ts index 700758af94..1d3efc18b8 100644 --- a/src/dispatcher/payloads/ShowThreadPayload.ts +++ b/src/dispatcher/payloads/ShowThreadPayload.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface ShowThreadPayload extends ActionPayload { action: Action.ShowThread; diff --git a/src/dispatcher/payloads/SubmitAskToJoinPayload.ts b/src/dispatcher/payloads/SubmitAskToJoinPayload.ts index 40334fab8d..725409fe4a 100644 --- a/src/dispatcher/payloads/SubmitAskToJoinPayload.ts +++ b/src/dispatcher/payloads/SubmitAskToJoinPayload.ts @@ -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 { KnockRoomOpts } from "matrix-js-sdk/src/matrix"; +import { type KnockRoomOpts } from "matrix-js-sdk/src/matrix"; -import { Action } from "../actions"; -import { ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type ActionPayload } from "../payloads"; export interface SubmitAskToJoinPayload extends Pick { action: Action.SubmitAskToJoin; diff --git a/src/dispatcher/payloads/SwitchSpacePayload.ts b/src/dispatcher/payloads/SwitchSpacePayload.ts index 7ad22a7b2d..d33ea051f4 100644 --- a/src/dispatcher/payloads/SwitchSpacePayload.ts +++ b/src/dispatcher/payloads/SwitchSpacePayload.ts @@ -6,8 +6,8 @@ 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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface SwitchSpacePayload extends ActionPayload { action: Action.SwitchSpace; diff --git a/src/dispatcher/payloads/ThreadPayload.ts b/src/dispatcher/payloads/ThreadPayload.ts index 2f21576c33..ac74370afa 100644 --- a/src/dispatcher/payloads/ThreadPayload.ts +++ b/src/dispatcher/payloads/ThreadPayload.ts @@ -6,8 +6,8 @@ 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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; /* eslint-disable camelcase */ export interface ThreadPayload extends Pick { diff --git a/src/dispatcher/payloads/UpdateFontSizeDeltaPayload.ts b/src/dispatcher/payloads/UpdateFontSizeDeltaPayload.ts index 40495615b5..503299702c 100644 --- a/src/dispatcher/payloads/UpdateFontSizeDeltaPayload.ts +++ b/src/dispatcher/payloads/UpdateFontSizeDeltaPayload.ts @@ -6,8 +6,8 @@ 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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface UpdateFontSizeDeltaPayload extends ActionPayload { action: Action.UpdateFontSizeDelta; diff --git a/src/dispatcher/payloads/UpdateSystemFontPayload.ts b/src/dispatcher/payloads/UpdateSystemFontPayload.ts index 91951244a9..1e1fd0f8a3 100644 --- a/src/dispatcher/payloads/UpdateSystemFontPayload.ts +++ b/src/dispatcher/payloads/UpdateSystemFontPayload.ts @@ -6,8 +6,8 @@ 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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface UpdateSystemFontPayload extends ActionPayload { action: Action.UpdateSystemFont; diff --git a/src/dispatcher/payloads/UploadPayload.ts b/src/dispatcher/payloads/UploadPayload.ts index 6d26a4dd2b..acfce43d7f 100644 --- a/src/dispatcher/payloads/UploadPayload.ts +++ b/src/dispatcher/payloads/UploadPayload.ts @@ -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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; -import { RoomUpload } from "../../models/RoomUpload"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type RoomUpload } from "../../models/RoomUpload"; export interface UploadPayload extends ActionPayload { /** diff --git a/src/dispatcher/payloads/ViewHomePagePayload.ts b/src/dispatcher/payloads/ViewHomePagePayload.ts index 8743569bdf..c18d896ae4 100644 --- a/src/dispatcher/payloads/ViewHomePagePayload.ts +++ b/src/dispatcher/payloads/ViewHomePagePayload.ts @@ -6,8 +6,8 @@ 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 { Action } from "../actions"; -import { ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type ActionPayload } from "../payloads"; export interface ViewHomePagePayload extends ActionPayload { action: Action.ViewHomePage; diff --git a/src/dispatcher/payloads/ViewRoomDeltaPayload.ts b/src/dispatcher/payloads/ViewRoomDeltaPayload.ts index fefe5ec544..461b68f065 100644 --- a/src/dispatcher/payloads/ViewRoomDeltaPayload.ts +++ b/src/dispatcher/payloads/ViewRoomDeltaPayload.ts @@ -6,8 +6,8 @@ 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 { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface ViewRoomDeltaPayload extends ActionPayload { action: Action.ViewRoomDelta; diff --git a/src/dispatcher/payloads/ViewRoomErrorPayload.ts b/src/dispatcher/payloads/ViewRoomErrorPayload.ts index fd85b9af09..d14dc5c6da 100644 --- a/src/dispatcher/payloads/ViewRoomErrorPayload.ts +++ b/src/dispatcher/payloads/ViewRoomErrorPayload.ts @@ -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 { MatrixError, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixError, type Room } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface ViewRoomErrorPayload extends Pick { action: Action.ViewRoomError; diff --git a/src/dispatcher/payloads/ViewRoomPayload.ts b/src/dispatcher/payloads/ViewRoomPayload.ts index 95affe573e..525dd50d62 100644 --- a/src/dispatcher/payloads/ViewRoomPayload.ts +++ b/src/dispatcher/payloads/ViewRoomPayload.ts @@ -6,15 +6,15 @@ 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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { ViewRoom as ViewRoomEvent } from "@matrix-org/analytics-events/types/typescript/ViewRoom"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type ViewRoom as ViewRoomEvent } from "@matrix-org/analytics-events/types/typescript/ViewRoom"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; -import { IOOBData, IThreepidInvite } from "../../stores/ThreepidInviteStore"; -import { IOpts } from "../../createRoom"; -import { JoinRoomPayload } from "./JoinRoomPayload"; -import { AtLeastOne } from "../../@types/common"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; +import { type IOOBData, type IThreepidInvite } from "../../stores/ThreepidInviteStore"; +import { type IOpts } from "../../createRoom"; +import { type JoinRoomPayload } from "./JoinRoomPayload"; +import { type AtLeastOne } from "../../@types/common"; export type FocusNextType = "composer" | "threadsPanel" | undefined; diff --git a/src/dispatcher/payloads/ViewStartChatOrReusePayload.ts b/src/dispatcher/payloads/ViewStartChatOrReusePayload.ts index 0c988d917a..9a23d39505 100644 --- a/src/dispatcher/payloads/ViewStartChatOrReusePayload.ts +++ b/src/dispatcher/payloads/ViewStartChatOrReusePayload.ts @@ -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 { User } from "matrix-js-sdk/src/matrix"; +import { type User } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface ViewStartChatOrReusePayload extends Pick { action: Action.ViewStartChatOrReuse; diff --git a/src/dispatcher/payloads/ViewUserPayload.ts b/src/dispatcher/payloads/ViewUserPayload.ts index 497ebf5671..63c11f29a2 100644 --- a/src/dispatcher/payloads/ViewUserPayload.ts +++ b/src/dispatcher/payloads/ViewUserPayload.ts @@ -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 { RoomMember, User } from "matrix-js-sdk/src/matrix"; +import { type RoomMember, type User } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../payloads"; -import { Action } from "../actions"; +import { type ActionPayload } from "../payloads"; +import { type Action } from "../actions"; export interface ViewUserPayload extends ActionPayload { action: Action.ViewUser; diff --git a/src/editor/autocomplete.ts b/src/editor/autocomplete.ts index abbea0254e..f3a3148b86 100644 --- a/src/editor/autocomplete.ts +++ b/src/editor/autocomplete.ts @@ -6,12 +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 React from "react"; - -import { Part, CommandPartCreator, PartCreator } from "./parts"; -import DocumentPosition from "./position"; -import { ICompletion, ISelectionRange } from "../autocomplete/Autocompleter"; -import Autocomplete from "../components/views/rooms/Autocomplete"; +import type React from "react"; +import { type Part, type CommandPartCreator, type PartCreator } from "./parts"; +import type DocumentPosition from "./position"; +import { type ICompletion, type ISelectionRange } from "../autocomplete/Autocompleter"; +import type Autocomplete from "../components/views/rooms/Autocomplete"; export interface ICallback { replaceParts?: Part[]; diff --git a/src/editor/caret.ts b/src/editor/caret.ts index 7db2c59b77..2f36b4b1bf 100644 --- a/src/editor/caret.ts +++ b/src/editor/caret.ts @@ -8,9 +8,10 @@ Please see LICENSE files in the repository root for full details. import { needsCaretNodeBefore, needsCaretNodeAfter } from "./render"; import Range from "./range"; -import EditorModel from "./model"; -import DocumentPosition, { IPosition } from "./position"; -import { Part, Type } from "./parts"; +import type EditorModel from "./model"; +import { type IPosition } from "./position"; +import type DocumentPosition from "./position"; +import { type Part, Type } from "./parts"; export type Caret = Range | DocumentPosition; diff --git a/src/editor/commands.tsx b/src/editor/commands.tsx index cb38f88d0d..f24e1307cb 100644 --- a/src/editor/commands.tsx +++ b/src/editor/commands.tsx @@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; -import { RoomMessageEventContent } from "matrix-js-sdk/src/types"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type RoomMessageEventContent } from "matrix-js-sdk/src/types"; -import EditorModel from "./model"; +import type EditorModel from "./model"; import { Type } from "./parts"; -import { Command, CommandCategories, getCommand } from "../SlashCommands"; +import { type Command, CommandCategories, getCommand } from "../SlashCommands"; import { UserFriendlyError, _t, _td } from "../languageHandler"; import Modal from "../Modal"; import ErrorDialog from "../components/views/dialogs/ErrorDialog"; diff --git a/src/editor/deserialize.ts b/src/editor/deserialize.ts index 77ca729feb..3bca5e585a 100644 --- a/src/editor/deserialize.ts +++ b/src/editor/deserialize.ts @@ -7,11 +7,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 { MatrixEvent, MsgType } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, MsgType } from "matrix-js-sdk/src/matrix"; import { checkBlockNode } from "../HtmlUtils"; import { getPrimaryPermalinkEntity } from "../utils/permalinks/Permalinks"; -import { Part, PartCreator, Type } from "./parts"; +import { type Part, type PartCreator, Type } from "./parts"; import SdkConfig from "../SdkConfig"; import { textToHtmlRainbow } from "../utils/colour"; import { stripPlainReply } from "../utils/Reply"; diff --git a/src/editor/dom.ts b/src/editor/dom.ts index b0fd9b47e9..358364b9f3 100644 --- a/src/editor/dom.ts +++ b/src/editor/dom.ts @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import { CARET_NODE_CHAR, isCaretNode } from "./render"; import DocumentOffset from "./offset"; -import EditorModel from "./model"; -import Range from "./range"; +import type EditorModel from "./model"; +import type Range from "./range"; type Predicate = (node: Node) => boolean; type Callback = (node: Node) => void; diff --git a/src/editor/history.ts b/src/editor/history.ts index ca5a39bb77..9e510a5a5d 100644 --- a/src/editor/history.ts +++ b/src/editor/history.ts @@ -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 EditorModel from "./model"; -import { IDiff } from "./diff"; -import { SerializedPart } from "./parts"; -import { Caret } from "./caret"; +import type EditorModel from "./model"; +import { type IDiff } from "./diff"; +import { type SerializedPart } from "./parts"; +import { type Caret } from "./caret"; export interface IHistory { parts: SerializedPart[]; diff --git a/src/editor/model.ts b/src/editor/model.ts index c583c93972..4328b666d8 100644 --- a/src/editor/model.ts +++ b/src/editor/model.ts @@ -6,13 +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 { diffAtCaret, diffDeletion, IDiff } from "./diff"; -import DocumentPosition, { IPosition } from "./position"; +import { diffAtCaret, diffDeletion, type IDiff } from "./diff"; +import DocumentPosition, { type IPosition } from "./position"; import Range from "./range"; -import { SerializedPart, Part, PartCreator } from "./parts"; -import AutocompleteWrapperModel, { ICallback } from "./autocomplete"; -import DocumentOffset from "./offset"; -import { Caret } from "./caret"; +import { type SerializedPart, type Part, type PartCreator } from "./parts"; +import { type ICallback } from "./autocomplete"; +import type AutocompleteWrapperModel from "./autocomplete"; +import type DocumentOffset from "./offset"; +import { type Caret } from "./caret"; /** * @callback ModelCallback diff --git a/src/editor/offset.ts b/src/editor/offset.ts index 143fcdd0f0..7e0d854246 100644 --- a/src/editor/offset.ts +++ b/src/editor/offset.ts @@ -6,8 +6,8 @@ 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 EditorModel from "./model"; -import DocumentPosition from "./position"; +import type EditorModel from "./model"; +import type DocumentPosition from "./position"; export default class DocumentOffset { public constructor( diff --git a/src/editor/operations.ts b/src/editor/operations.ts index 6ee663968d..5594ed09c3 100644 --- a/src/editor/operations.ts +++ b/src/editor/operations.ts @@ -6,8 +6,8 @@ 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 Range from "./range"; -import { Part, Type } from "./parts"; +import type Range from "./range"; +import { type Part, Type } from "./parts"; import { Formatting } from "../components/views/rooms/MessageComposerFormatBar"; import { longestBacktickSequence } from "./deserialize"; diff --git a/src/editor/parts.ts b/src/editor/parts.ts index 907758e39a..ad49058609 100644 --- a/src/editor/parts.ts +++ b/src/editor/parts.ts @@ -6,9 +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 { MatrixClient, RoomMember, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type RoomMember, type Room } from "matrix-js-sdk/src/matrix"; -import AutocompleteWrapperModel, { GetAutocompleterComponent, UpdateCallback, UpdateQuery } from "./autocomplete"; +import AutocompleteWrapperModel, { + type GetAutocompleterComponent, + type UpdateCallback, + type UpdateQuery, +} from "./autocomplete"; import { EMOJI_REGEX, unicodeToShortcode } from "../HtmlUtils"; import * as Avatar from "../Avatar"; import defaultDispatcher from "../dispatcher/dispatcher"; diff --git a/src/editor/position.ts b/src/editor/position.ts index 2b728b22b4..4b7a8c576b 100644 --- a/src/editor/position.ts +++ b/src/editor/position.ts @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import DocumentOffset from "./offset"; -import EditorModel from "./model"; -import { Part } from "./parts"; +import type EditorModel from "./model"; +import { type Part } from "./parts"; export interface IPosition { index: number; diff --git a/src/editor/range.ts b/src/editor/range.ts index 6441e92d04..eff439ec81 100644 --- a/src/editor/range.ts +++ b/src/editor/range.ts @@ -6,9 +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 EditorModel from "./model"; -import DocumentPosition, { Predicate } from "./position"; -import { Part } from "./parts"; +import type EditorModel from "./model"; +import { type Predicate } from "./position"; +import type DocumentPosition from "./position"; +import { type Part } from "./parts"; const whitespacePredicate: Predicate = (index, offset, part) => { return part.text[offset].trim() === ""; diff --git a/src/editor/render.ts b/src/editor/render.ts index 4ac2fc54b3..fe0059de6e 100644 --- a/src/editor/render.ts +++ b/src/editor/render.ts @@ -6,8 +6,8 @@ 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 { Part, Type } from "./parts"; -import EditorModel from "./model"; +import { type Part, Type } from "./parts"; +import type EditorModel from "./model"; export function needsCaretNodeBefore(part: Part, prevPart?: Part): boolean { const isFirst = !prevPart || prevPart.type === Type.Newline; diff --git a/src/editor/serialize.ts b/src/editor/serialize.ts index 8b05063b4e..d2c5ecc693 100644 --- a/src/editor/serialize.ts +++ b/src/editor/serialize.ts @@ -12,7 +12,7 @@ import escapeHtml from "escape-html"; import Markdown from "../Markdown"; import { makeGenericPermalink } from "../utils/permalinks/Permalinks"; -import EditorModel from "./model"; +import type EditorModel from "./model"; import SettingsStore from "../settings/SettingsStore"; import SdkConfig from "../SdkConfig"; import { Type } from "./parts"; diff --git a/src/effects/confetti/index.ts b/src/effects/confetti/index.ts index 4c9046f8df..766d2700b2 100644 --- a/src/effects/confetti/index.ts +++ b/src/effects/confetti/index.ts @@ -7,7 +7,7 @@ Copyright 2020 Nordeck IT + Consulting GmbH. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import ICanvasEffect from "../ICanvasEffect"; +import type ICanvasEffect from "../ICanvasEffect"; export type ConfettiOptions = { /** diff --git a/src/effects/effect.ts b/src/effects/effect.ts index 6a8ae5d8ba..571ce494ed 100644 --- a/src/effects/effect.ts +++ b/src/effects/effect.ts @@ -7,7 +7,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 { TranslationKey } from "../languageHandler"; +import { type TranslationKey } from "../languageHandler"; export type Effect = { /** diff --git a/src/effects/fireworks/index.ts b/src/effects/fireworks/index.ts index 13f6e6408b..05cbd8b838 100644 --- a/src/effects/fireworks/index.ts +++ b/src/effects/fireworks/index.ts @@ -8,7 +8,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 ICanvasEffect from "../ICanvasEffect"; +import type ICanvasEffect from "../ICanvasEffect"; export type FireworksOptions = { /** diff --git a/src/effects/hearts/index.ts b/src/effects/hearts/index.ts index 00082049eb..a3de6ada84 100644 --- a/src/effects/hearts/index.ts +++ b/src/effects/hearts/index.ts @@ -6,7 +6,7 @@ Copyright 2022 Arseny Uskov SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import ICanvasEffect from "../ICanvasEffect"; +import type ICanvasEffect from "../ICanvasEffect"; import { arrayFastClone } from "../../utils/arrays"; export type HeartOptions = { diff --git a/src/effects/index.ts b/src/effects/index.ts index 1ed7d2c3a3..96a200e4b1 100644 --- a/src/effects/index.ts +++ b/src/effects/index.ts @@ -7,13 +7,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 { _t, _td } from "../languageHandler"; -import { ConfettiOptions } from "./confetti"; -import { Effect } from "./effect"; -import { FireworksOptions } from "./fireworks"; -import { RainfallOptions } from "./rainfall"; -import { SnowfallOptions } from "./snowfall"; -import { SpaceInvadersOptions } from "./spaceinvaders"; -import { HeartOptions } from "./hearts"; +import { type ConfettiOptions } from "./confetti"; +import { type Effect } from "./effect"; +import { type FireworksOptions } from "./fireworks"; +import { type RainfallOptions } from "./rainfall"; +import { type SnowfallOptions } from "./snowfall"; +import { type SpaceInvadersOptions } from "./spaceinvaders"; +import { type HeartOptions } from "./hearts"; /** * This configuration defines room effects that can be triggered by custom message types and emojis diff --git a/src/effects/rainfall/index.ts b/src/effects/rainfall/index.ts index 9fac36d615..a992d8f43b 100644 --- a/src/effects/rainfall/index.ts +++ b/src/effects/rainfall/index.ts @@ -6,7 +6,7 @@ Copyright 2021 Josias Allestad SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import ICanvasEffect from "../ICanvasEffect"; +import type ICanvasEffect from "../ICanvasEffect"; import { arrayFastClone } from "../../utils/arrays"; export type RainfallOptions = { diff --git a/src/effects/snowfall/index.ts b/src/effects/snowfall/index.ts index bfc690d1a4..df6f691b78 100644 --- a/src/effects/snowfall/index.ts +++ b/src/effects/snowfall/index.ts @@ -5,7 +5,7 @@ Copyright 2020-2023 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import ICanvasEffect from "../ICanvasEffect"; +import type ICanvasEffect from "../ICanvasEffect"; import { arrayFastClone } from "../../utils/arrays"; export type SnowfallOptions = { diff --git a/src/effects/spaceinvaders/index.ts b/src/effects/spaceinvaders/index.ts index 49aeb26e8d..0bc6e3df94 100644 --- a/src/effects/spaceinvaders/index.ts +++ b/src/effects/spaceinvaders/index.ts @@ -5,7 +5,7 @@ Copyright 2021-2023 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import ICanvasEffect from "../ICanvasEffect"; +import type ICanvasEffect from "../ICanvasEffect"; import { arrayFastClone } from "../../utils/arrays"; export type SpaceInvadersOptions = { diff --git a/src/effects/utils.ts b/src/effects/utils.ts index 1479b6f5cd..31d07eb573 100644 --- a/src/effects/utils.ts +++ b/src/effects/utils.ts @@ -7,7 +7,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 { IContent } from "matrix-js-sdk/src/matrix"; +import { type IContent } from "matrix-js-sdk/src/matrix"; /** * Checks a message if it contains one of the provided emojis diff --git a/src/events/EventTileFactory.tsx b/src/events/EventTileFactory.tsx index 3079e45abf..e0d2a91afb 100644 --- a/src/events/EventTileFactory.tsx +++ b/src/events/EventTileFactory.tsx @@ -8,20 +8,20 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { - MatrixEvent, + type MatrixEvent, EventType, MsgType, RelationType, - MatrixClient, + type MatrixClient, GroupCallIntent, M_POLL_END, M_POLL_START, } from "matrix-js-sdk/src/matrix"; -import { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import SettingsStore from "../settings/SettingsStore"; -import LegacyCallEventGrouper from "../components/structures/LegacyCallEventGrouper"; -import { EventTileProps } from "../components/views/rooms/EventTile"; +import type LegacyCallEventGrouper from "../components/structures/LegacyCallEventGrouper"; +import { type EventTileProps } from "../components/views/rooms/EventTile"; import { TimelineRenderingType } from "../contexts/RoomContext"; import MessageEvent from "../components/views/messages/MessageEvent"; import LegacyCallEvent from "../components/views/messages/LegacyCallEvent"; diff --git a/src/events/RelationsHelper.ts b/src/events/RelationsHelper.ts index e063395c9a..83f1eeb264 100644 --- a/src/events/RelationsHelper.ts +++ b/src/events/RelationsHelper.ts @@ -7,16 +7,16 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixClient, - MatrixEvent, + type MatrixClient, + type MatrixEvent, MatrixEventEvent, - RelationType, + type RelationType, TypedEventEmitter, - Relations, + type Relations, RelationsEvent, } from "matrix-js-sdk/src/matrix"; -import { IDestroyable } from "../utils/IDestroyable"; +import { type IDestroyable } from "../utils/IDestroyable"; export enum RelationsHelperEvent { Add = "add", diff --git a/src/events/forward/getForwardableEvent.ts b/src/events/forward/getForwardableEvent.ts index 151da1e8af..4f04f02339 100644 --- a/src/events/forward/getForwardableEvent.ts +++ b/src/events/forward/getForwardableEvent.ts @@ -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 { M_POLL_END, M_POLL_START, M_BEACON_INFO, MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { M_POLL_END, M_POLL_START, M_BEACON_INFO, type MatrixEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { getShareableLocationEventForBeacon } from "../../utils/beacon/getShareableLocation"; diff --git a/src/events/location/getShareableLocationEvent.ts b/src/events/location/getShareableLocationEvent.ts index e5c9a0f3a1..e56d5014e0 100644 --- a/src/events/location/getShareableLocationEvent.ts +++ b/src/events/location/getShareableLocationEvent.ts @@ -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 { M_BEACON_INFO, MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { M_BEACON_INFO, type MatrixEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { getShareableLocationEventForBeacon } from "../../utils/beacon/getShareableLocation"; import { isLocationEvent } from "../../utils/EventUtils"; diff --git a/src/hooks/right-panel/useCurrentPhase.ts b/src/hooks/right-panel/useCurrentPhase.ts index 9560612873..926c6f6e8c 100644 --- a/src/hooks/right-panel/useCurrentPhase.ts +++ b/src/hooks/right-panel/useCurrentPhase.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { useContext, useState } from "react"; import { SDKContext } from "../../contexts/SDKContext"; -import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases"; +import { type RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases"; import { useEventEmitter } from "../useEventEmitter"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; diff --git a/src/hooks/room/useGuestAccessInformation.ts b/src/hooks/room/useGuestAccessInformation.ts index bf49d434ef..58945a5bf6 100644 --- a/src/hooks/room/useGuestAccessInformation.ts +++ b/src/hooks/room/useGuestAccessInformation.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useMemo } from "react"; -import { EventType, JoinRule, Room } from "matrix-js-sdk/src/matrix"; +import { EventType, JoinRule, type Room } from "matrix-js-sdk/src/matrix"; import SdkConfig from "../../SdkConfig"; import { useRoomState } from "../useRoomState"; diff --git a/src/hooks/room/useRoomCall.tsx b/src/hooks/room/useRoomCall.tsx index 74a518b217..e0dfbdcdeb 100644 --- a/src/hooks/room/useRoomCall.tsx +++ b/src/hooks/room/useRoomCall.tsx @@ -6,8 +6,8 @@ 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 { Room } from "matrix-js-sdk/src/matrix"; -import React, { ReactNode, useCallback, useEffect, useMemo, useState } from "react"; +import { type Room } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode, useCallback, useEffect, useMemo, useState } from "react"; import { CallType } from "matrix-js-sdk/src/webrtc/call"; import { useFeatureEnabled } from "../useSettings"; @@ -24,11 +24,11 @@ import { Container, WidgetLayoutStore } from "../../stores/widgets/WidgetLayoutS import { useRoomState } from "../useRoomState"; import { _t } from "../../languageHandler"; import { isManagedHybridWidget, isManagedHybridWidgetEnabled } from "../../widgets/ManagedHybrid"; -import { IApp } from "../../stores/WidgetStore"; +import { type IApp } from "../../stores/WidgetStore"; import { SdkContextClass } from "../../contexts/SDKContext"; import { UPDATE_EVENT } from "../../stores/AsyncStore"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../../dispatcher/actions"; import { CallStore, CallStoreEvent } from "../../stores/CallStore"; import { isVideoRoom } from "../../utils/video-rooms"; @@ -36,7 +36,7 @@ import { useGuestAccessInformation } from "./useGuestAccessInformation"; import SettingsStore from "../../settings/SettingsStore"; import { UIFeature } from "../../settings/UIFeature"; import { BetaPill } from "../../components/views/beta/BetaCard"; -import { InteractionName } from "../../PosthogTrackers"; +import { type InteractionName } from "../../PosthogTrackers"; export enum PlatformCallType { ElementCall, diff --git a/src/hooks/room/useRoomMemberProfile.ts b/src/hooks/room/useRoomMemberProfile.ts index 123e6f0991..5b1b4ae125 100644 --- a/src/hooks/room/useRoomMemberProfile.ts +++ b/src/hooks/room/useRoomMemberProfile.ts @@ -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 { RoomMember } from "matrix-js-sdk/src/matrix"; +import { type RoomMember } from "matrix-js-sdk/src/matrix"; import { useMemo } from "react"; import { TimelineRenderingType } from "../../contexts/RoomContext"; diff --git a/src/hooks/room/useRoomThreadNotifications.ts b/src/hooks/room/useRoomThreadNotifications.ts index 2740a016f7..25c55ab165 100644 --- a/src/hooks/room/useRoomThreadNotifications.ts +++ b/src/hooks/room/useRoomThreadNotifications.ts @@ -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 { NotificationCountType, Room, RoomEvent, ThreadEvent } from "matrix-js-sdk/src/matrix"; +import { NotificationCountType, type Room, RoomEvent, ThreadEvent } from "matrix-js-sdk/src/matrix"; import { useCallback, useEffect, useState } from "react"; import { NotificationLevel } from "../../stores/notifications/NotificationLevel"; diff --git a/src/hooks/room/useTopic.ts b/src/hooks/room/useTopic.ts index 3f8de87e39..e254e7a4ea 100644 --- a/src/hooks/room/useTopic.ts +++ b/src/hooks/room/useTopic.ts @@ -9,13 +9,13 @@ Please see LICENSE files in the repository root for full details. import { useEffect, useState } from "react"; import { EventType, - MatrixEvent, - Room, + type MatrixEvent, + type Room, RoomStateEvent, ContentHelpers, - MRoomTopicEventContent, + type MRoomTopicEventContent, } from "matrix-js-sdk/src/matrix"; -import { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import { useTypedEventEmitter } from "../useEventEmitter"; diff --git a/src/hooks/spotlight/useRecentSearches.ts b/src/hooks/spotlight/useRecentSearches.ts index 7f7ec89c19..5adf643953 100644 --- a/src/hooks/spotlight/useRecentSearches.ts +++ b/src/hooks/spotlight/useRecentSearches.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useState } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../MatrixClientPeg"; import { SettingLevel } from "../../settings/SettingLevel"; diff --git a/src/hooks/useAccountData.ts b/src/hooks/useAccountData.ts index a86f8765fe..85c73f958f 100644 --- a/src/hooks/useAccountData.ts +++ b/src/hooks/useAccountData.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useCallback, useState } from "react"; -import { AccountDataEvents, ClientEvent, MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type AccountDataEvents, ClientEvent, type MatrixClient, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { useTypedEventEmitter } from "./useEventEmitter"; diff --git a/src/hooks/useAsyncMemo.ts b/src/hooks/useAsyncMemo.ts index 49925d0c74..d5d9906565 100644 --- a/src/hooks/useAsyncMemo.ts +++ b/src/hooks/useAsyncMemo.ts @@ -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 { useState, useEffect, DependencyList } from "react"; +import { useState, useEffect, type DependencyList } from "react"; type Fn = () => Promise; diff --git a/src/hooks/useAsyncRefreshMemo.ts b/src/hooks/useAsyncRefreshMemo.ts index 3d167d56a6..a1845ac816 100644 --- a/src/hooks/useAsyncRefreshMemo.ts +++ b/src/hooks/useAsyncRefreshMemo.ts @@ -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 { DependencyList, useCallback, useEffect, useState } from "react"; +import { type DependencyList, useCallback, useEffect, useState } from "react"; type Fn = () => Promise; diff --git a/src/hooks/useCall.ts b/src/hooks/useCall.ts index 63f5cd87ad..19b54fe8ea 100644 --- a/src/hooks/useCall.ts +++ b/src/hooks/useCall.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import { useState, useCallback, useMemo } from "react"; import type { RoomMember } from "matrix-js-sdk/src/matrix"; -import { Call, ConnectionState, CallEvent } from "../models/Call"; +import { type Call, ConnectionState, CallEvent } from "../models/Call"; import { useTypedEventEmitterState, useEventEmitter } from "./useEventEmitter"; import { CallStore, CallStoreEvent } from "../stores/CallStore"; import SdkConfig, { DEFAULTS } from "../SdkConfig"; diff --git a/src/hooks/useDispatcher.ts b/src/hooks/useDispatcher.ts index 2072e31824..6d234a353c 100644 --- a/src/hooks/useDispatcher.ts +++ b/src/hooks/useDispatcher.ts @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import { useEffect, useRef } from "react"; -import { ActionPayload } from "../dispatcher/payloads"; -import { MatrixDispatcher } from "../dispatcher/dispatcher"; +import { type ActionPayload } from "../dispatcher/payloads"; +import { type MatrixDispatcher } from "../dispatcher/dispatcher"; // Hook to simplify listening to event dispatches export const useDispatcher = (dispatcher: MatrixDispatcher, handler: (payload: ActionPayload) => void): void => { diff --git a/src/hooks/useEncryptionStatus.ts b/src/hooks/useEncryptionStatus.ts index 32238aa442..75c894c803 100644 --- a/src/hooks/useEncryptionStatus.ts +++ b/src/hooks/useEncryptionStatus.ts @@ -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 { MatrixClient, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import { useEffect, useMemo, useState } from "react"; import { throttle } from "lodash"; import { CryptoEvent } from "matrix-js-sdk/src/crypto-api"; -import { E2EStatus, shieldStatusForRoom } from "../utils/ShieldUtils"; +import { type E2EStatus, shieldStatusForRoom } from "../utils/ShieldUtils"; import { useTypedEventEmitter } from "./useEventEmitter"; export function useEncryptionStatus(client: MatrixClient, room: Room): E2EStatus | null { diff --git a/src/hooks/useEventEmitter.ts b/src/hooks/useEventEmitter.ts index b7c35081cd..67049195a0 100644 --- a/src/hooks/useEventEmitter.ts +++ b/src/hooks/useEventEmitter.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useRef, useEffect, useState, useCallback } from "react"; -import { ListenerMap, TypedEventEmitter } from "matrix-js-sdk/src/matrix"; +import { type ListenerMap, type TypedEventEmitter } from "matrix-js-sdk/src/matrix"; import type { EventEmitter } from "events"; diff --git a/src/hooks/useGlobalNotificationState.ts b/src/hooks/useGlobalNotificationState.ts index fd2f0b7063..d596cabf67 100644 --- a/src/hooks/useGlobalNotificationState.ts +++ b/src/hooks/useGlobalNotificationState.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { useState } from "react"; -import { SummarizedNotificationState } from "../stores/notifications/SummarizedNotificationState"; +import { type SummarizedNotificationState } from "../stores/notifications/SummarizedNotificationState"; import { RoomNotificationStateStore, UPDATE_STATUS_INDICATOR, diff --git a/src/hooks/useIsEncrypted.ts b/src/hooks/useIsEncrypted.ts index 7cdfcc68a1..75c43958dc 100644 --- a/src/hooks/useIsEncrypted.ts +++ b/src/hooks/useIsEncrypted.ts @@ -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 { MatrixClient, MatrixEvent, Room, EventType } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent, type Room, EventType } from "matrix-js-sdk/src/matrix"; import { useRoomState } from "./useRoomState.ts"; import { useAsyncMemo } from "./useAsyncMemo.ts"; diff --git a/src/hooks/useIsReleaseAnnouncementOpen.ts b/src/hooks/useIsReleaseAnnouncementOpen.ts index 68ab65f97a..ee3e90f2e0 100644 --- a/src/hooks/useIsReleaseAnnouncementOpen.ts +++ b/src/hooks/useIsReleaseAnnouncementOpen.ts @@ -9,7 +9,7 @@ import { useState } from "react"; import { useTypedEventEmitter, useTypedEventEmitterState } from "./useEventEmitter"; -import { Feature, ReleaseAnnouncementStore } from "../stores/ReleaseAnnouncementStore"; +import { type Feature, ReleaseAnnouncementStore } from "../stores/ReleaseAnnouncementStore"; import Modal, { ModalManagerEvent } from "../Modal"; /** diff --git a/src/hooks/useLocalStorageState.ts b/src/hooks/useLocalStorageState.ts index 5efec21035..be1b79b49f 100644 --- a/src/hooks/useLocalStorageState.ts +++ b/src/hooks/useLocalStorageState.ts @@ -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 { Dispatch, useCallback, useEffect, useState } from "react"; +import { type Dispatch, useCallback, useEffect, useState } from "react"; const getValue = (key: string, initialValue: T): T => { try { diff --git a/src/hooks/useNotificationSettings.tsx b/src/hooks/useNotificationSettings.tsx index 3036a8122c..dc1c9f1ba7 100644 --- a/src/hooks/useNotificationSettings.tsx +++ b/src/hooks/useNotificationSettings.tsx @@ -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 { IPushRules, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type IPushRules, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; -import { NotificationSettings } from "../models/notificationsettings/NotificationSettings"; -import { PushRuleDiff } from "../models/notificationsettings/PushRuleDiff"; +import { type NotificationSettings } from "../models/notificationsettings/NotificationSettings"; +import { type PushRuleDiff } from "../models/notificationsettings/PushRuleDiff"; import { reconcileNotificationSettings } from "../models/notificationsettings/reconcileNotificationSettings"; import { toNotificationSettings } from "../models/notificationsettings/toNotificationSettings"; diff --git a/src/hooks/usePermalink.ts b/src/hooks/usePermalink.ts index f9174654fc..146c44cdfe 100644 --- a/src/hooks/usePermalink.ts +++ b/src/hooks/usePermalink.ts @@ -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 { MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type Room, type RoomMember } from "matrix-js-sdk/src/matrix"; -import { ButtonEvent } from "../components/views/elements/AccessibleButton"; +import { type ButtonEvent } from "../components/views/elements/AccessibleButton"; import { PillType } from "../components/views/elements/Pill"; import { parsePermalink } from "../utils/permalinks/Permalinks"; import dis from "../dispatcher/dispatcher"; import { Action } from "../dispatcher/actions"; -import { PermalinkParts } from "../utils/permalinks/PermalinkConstructor"; +import { type PermalinkParts } from "../utils/permalinks/PermalinkConstructor"; import { _t } from "../languageHandler"; import { usePermalinkTargetRoom } from "./usePermalinkTargetRoom"; import { usePermalinkEvent } from "./usePermalinkEvent"; diff --git a/src/hooks/usePermalinkEvent.ts b/src/hooks/usePermalinkEvent.ts index 12844d73bb..bb95f3b5c0 100644 --- a/src/hooks/usePermalinkEvent.ts +++ b/src/hooks/usePermalinkEvent.ts @@ -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 { MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { MatrixEvent, type Room } from "matrix-js-sdk/src/matrix"; import { useEffect, useState } from "react"; import { PillType } from "../components/views/elements/Pill"; import { MatrixClientPeg } from "../MatrixClientPeg"; -import { PermalinkParts } from "../utils/permalinks/PermalinkConstructor"; +import { type PermalinkParts } from "../utils/permalinks/PermalinkConstructor"; /** * Tries to find the initial event. diff --git a/src/hooks/usePermalinkMember.ts b/src/hooks/usePermalinkMember.ts index 787062ca3a..77267073ca 100644 --- a/src/hooks/usePermalinkMember.ts +++ b/src/hooks/usePermalinkMember.ts @@ -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 { IMatrixProfile, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type IMatrixProfile, type MatrixEvent, type Room, RoomMember } from "matrix-js-sdk/src/matrix"; import { useEffect, useState } from "react"; import { PillType } from "../components/views/elements/Pill"; import { SdkContextClass } from "../contexts/SDKContext"; -import { PermalinkParts } from "../utils/permalinks/PermalinkConstructor"; +import { type PermalinkParts } from "../utils/permalinks/PermalinkConstructor"; const createMemberFromProfile = (userId: string, profile: IMatrixProfile): RoomMember => { const member = new RoomMember("", userId); diff --git a/src/hooks/usePermalinkTargetRoom.ts b/src/hooks/usePermalinkTargetRoom.ts index 7a3a40ae52..9de18cc4f8 100644 --- a/src/hooks/usePermalinkTargetRoom.ts +++ b/src/hooks/usePermalinkTargetRoom.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { useEffect, useState } from "react"; import { PillType } from "../components/views/elements/Pill"; import { MatrixClientPeg } from "../MatrixClientPeg"; -import { PermalinkParts } from "../utils/permalinks/PermalinkConstructor"; +import { type PermalinkParts } from "../utils/permalinks/PermalinkConstructor"; /** * Tries to determine the initial room. diff --git a/src/hooks/usePinnedEvents.ts b/src/hooks/usePinnedEvents.ts index b065edc83f..f563211129 100644 --- a/src/hooks/usePinnedEvents.ts +++ b/src/hooks/usePinnedEvents.ts @@ -8,14 +8,14 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import { - Room, + type Room, RoomEvent, RoomStateEvent, MatrixEvent, EventType, RelationType, EventTimeline, - MatrixClient, + type MatrixClient, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/src/hooks/usePublicRoomDirectory.ts b/src/hooks/usePublicRoomDirectory.ts index 2e8cfb21b6..530e61e070 100644 --- a/src/hooks/usePublicRoomDirectory.ts +++ b/src/hooks/usePublicRoomDirectory.ts @@ -6,14 +6,19 @@ 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 { RoomType, IProtocol, IPublicRoomsChunkRoom, IRoomDirectoryOptions } from "matrix-js-sdk/src/matrix"; +import { + type RoomType, + type IProtocol, + type IPublicRoomsChunkRoom, + type IRoomDirectoryOptions, +} from "matrix-js-sdk/src/matrix"; import { useCallback, useEffect, useState } from "react"; -import { IPublicRoomDirectoryConfig } from "../components/views/directory/NetworkDropdown"; +import { type IPublicRoomDirectoryConfig } from "../components/views/directory/NetworkDropdown"; import { MatrixClientPeg } from "../MatrixClientPeg"; import SdkConfig from "../SdkConfig"; import SettingsStore from "../settings/SettingsStore"; -import { Protocols } from "../utils/DirectoryUtils"; +import { type Protocols } from "../utils/DirectoryUtils"; import { useLatestResult } from "./useLatestResult"; import { useSettingValue } from "./useSettings"; diff --git a/src/hooks/usePushers.ts b/src/hooks/usePushers.ts index 8dc6283291..d6b95f7e4e 100644 --- a/src/hooks/usePushers.ts +++ b/src/hooks/usePushers.ts @@ -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 { IPusher, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type IPusher, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { useAsyncRefreshMemo } from "./useAsyncRefreshMemo"; diff --git a/src/hooks/useRoomMembers.ts b/src/hooks/useRoomMembers.ts index 7a37d693df..14448ba307 100644 --- a/src/hooks/useRoomMembers.ts +++ b/src/hooks/useRoomMembers.ts @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import { useMemo, useState } from "react"; -import { Room, RoomEvent, RoomMember, RoomStateEvent } from "matrix-js-sdk/src/matrix"; -import { Membership } from "matrix-js-sdk/src/types"; +import { type Room, RoomEvent, type RoomMember, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { type Membership } from "matrix-js-sdk/src/types"; import { throttle } from "lodash"; import { useTypedEventEmitter } from "./useEventEmitter"; diff --git a/src/hooks/useRoomName.ts b/src/hooks/useRoomName.ts index 201cc088de..2f46eb287c 100644 --- a/src/hooks/useRoomName.ts +++ b/src/hooks/useRoomName.ts @@ -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 { Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; import { useEffect, useState } from "react"; -import { IOOBData } from "../stores/ThreepidInviteStore"; +import { type IOOBData } from "../stores/ThreepidInviteStore"; import { useTypedEventEmitter } from "./useEventEmitter"; import { _t } from "../languageHandler"; diff --git a/src/hooks/useRoomNotificationState.ts b/src/hooks/useRoomNotificationState.ts index e76295a347..b1e1b1b168 100644 --- a/src/hooks/useRoomNotificationState.ts +++ b/src/hooks/useRoomNotificationState.ts @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import { useCallback, useMemo, useState } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { RoomNotifState } from "../RoomNotifs"; +import { type RoomNotifState } from "../RoomNotifs"; import { EchoChamber } from "../stores/local-echo/EchoChamber"; import { PROPERTY_UPDATED } from "../stores/local-echo/GenericEchoChamber"; import { CachedRoomKey } from "../stores/local-echo/RoomEchoChamber"; diff --git a/src/hooks/useRoomState.ts b/src/hooks/useRoomState.ts index 24c4609b12..5555629bb1 100644 --- a/src/hooks/useRoomState.ts +++ b/src/hooks/useRoomState.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useCallback, useEffect, useRef, useState } from "react"; -import { Room, RoomState, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, type RoomState, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import { useTypedEventEmitter } from "./useEventEmitter"; diff --git a/src/hooks/useSettings.ts b/src/hooks/useSettings.ts index 7fbf5231fa..67f84b4c74 100644 --- a/src/hooks/useSettings.ts +++ b/src/hooks/useSettings.ts @@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details. import { useEffect, useState } from "react"; import SettingsStore from "../settings/SettingsStore"; -import { SettingLevel } from "../settings/SettingLevel"; -import { FeatureSettingKey, SettingKey, Settings } from "../settings/Settings.tsx"; +import { type SettingLevel } from "../settings/SettingLevel"; +import { type FeatureSettingKey, type SettingKey, type Settings } from "../settings/Settings.tsx"; // Hook to fetch the value of a setting and dynamically update when it changes export function useSettingValue( diff --git a/src/hooks/useSlidingSyncRoomSearch.ts b/src/hooks/useSlidingSyncRoomSearch.ts index 079d11d7e7..17eca74474 100644 --- a/src/hooks/useSlidingSyncRoomSearch.ts +++ b/src/hooks/useSlidingSyncRoomSearch.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useCallback, useState } from "react"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { useLatestResult } from "./useLatestResult"; diff --git a/src/hooks/useSpaceResults.ts b/src/hooks/useSpaceResults.ts index 3c4698cb66..d7fb644087 100644 --- a/src/hooks/useSpaceResults.ts +++ b/src/hooks/useSpaceResults.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useCallback, useEffect, useMemo, useState } from "react"; -import { Room, RoomType, HierarchyRoom } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomType, type HierarchyRoom } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { RoomHierarchy } from "matrix-js-sdk/src/room-hierarchy"; import { normalize } from "matrix-js-sdk/src/utils"; diff --git a/src/hooks/useStateCallback.ts b/src/hooks/useStateCallback.ts index ec46d0151f..6d45adf5db 100644 --- a/src/hooks/useStateCallback.ts +++ b/src/hooks/useStateCallback.ts @@ -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 { Dispatch, useState } from "react"; +import { type Dispatch, useState } from "react"; // Hook to simplify interactions with a store-backed state values // Returns value and method to change the state value diff --git a/src/hooks/useStateToggle.ts b/src/hooks/useStateToggle.ts index d808d9b133..962a47c6be 100644 --- a/src/hooks/useStateToggle.ts +++ b/src/hooks/useStateToggle.ts @@ -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 { Dispatch, SetStateAction, useState } from "react"; +import { type Dispatch, type SetStateAction, useState } from "react"; // Hook to simplify toggling of a boolean state value // Returns value, method to toggle boolean value and method to set the boolean value diff --git a/src/hooks/useThreepids.ts b/src/hooks/useThreepids.ts index 32884bc7cc..9cc03f5bcc 100644 --- a/src/hooks/useThreepids.ts +++ b/src/hooks/useThreepids.ts @@ -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 { MatrixClient, IThreepid } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type IThreepid } from "matrix-js-sdk/src/matrix"; import { useAsyncRefreshMemo } from "./useAsyncRefreshMemo"; diff --git a/src/hooks/useTransition.ts b/src/hooks/useTransition.ts index e1f48eeac4..d5e8df5f5d 100644 --- a/src/hooks/useTransition.ts +++ b/src/hooks/useTransition.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. // Based on https://stackoverflow.com/a/61680184 -import { DependencyList, useEffect, useRef } from "react"; +import { type DependencyList, useEffect, useRef } from "react"; export const useTransition = (callback: (...params: D) => void, deps: D): void => { const func = useRef<(...params: D) => void>(callback); diff --git a/src/hooks/useUserTimezone.ts b/src/hooks/useUserTimezone.ts index c6c98483dd..bca05659a0 100644 --- a/src/hooks/useUserTimezone.ts +++ b/src/hooks/useUserTimezone.ts @@ -5,7 +5,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 { useEffect, useState } from "react"; -import { MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; /** * Fetch a user's delclared timezone through their profile, and return diff --git a/src/indexing/BaseEventIndexManager.ts b/src/indexing/BaseEventIndexManager.ts index 0088a79683..7ec65a5f84 100644 --- a/src/indexing/BaseEventIndexManager.ts +++ b/src/indexing/BaseEventIndexManager.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { - IMatrixProfile, - IEventWithRoomId as IMatrixEvent, - IResultRoomEvents, - Direction, + type IMatrixProfile, + type IEventWithRoomId as IMatrixEvent, + type IResultRoomEvents, + type Direction, } from "matrix-js-sdk/src/matrix"; // The following interfaces take their names and member names from seshat and the spec diff --git a/src/indexing/EventIndex.ts b/src/indexing/EventIndex.ts index 7a126b2ffb..235d68fffd 100644 --- a/src/indexing/EventIndex.ts +++ b/src/indexing/EventIndex.ts @@ -9,26 +9,26 @@ Please see LICENSE files in the repository root for full details. import { EventEmitter } from "events"; import { RoomMember, - Room, + type Room, RoomEvent, - RoomState, + type RoomState, RoomStateEvent, - MatrixEvent, + type MatrixEvent, Direction, EventTimeline, - EventTimelineSet, - IRoomTimelineData, + type EventTimelineSet, + type IRoomTimelineData, EventType, ClientEvent, - MatrixClient, + type MatrixClient, HTTPError, - IEventWithRoomId, - IMatrixProfile, - IResultRoomEvents, - SyncStateData, - SyncState, - TimelineIndex, - TimelineWindow, + type IEventWithRoomId, + type IMatrixProfile, + type IResultRoomEvents, + type SyncStateData, + type SyncState, + type TimelineIndex, + type TimelineWindow, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { sleep } from "matrix-js-sdk/src/utils"; @@ -38,7 +38,13 @@ import PlatformPeg from "../PlatformPeg"; import { MatrixClientPeg } from "../MatrixClientPeg"; import SettingsStore from "../settings/SettingsStore"; import { SettingLevel } from "../settings/SettingLevel"; -import { ICrawlerCheckpoint, IEventAndProfile, IIndexStats, ILoadArgs, ISearchArgs } from "./BaseEventIndexManager"; +import { + type ICrawlerCheckpoint, + type IEventAndProfile, + type IIndexStats, + type ILoadArgs, + type ISearchArgs, +} from "./BaseEventIndexManager"; import { asyncFilter } from "../utils/arrays.ts"; // The time in ms that the crawler will wait loop iterations if there diff --git a/src/integrations/IntegrationManagerInstance.ts b/src/integrations/IntegrationManagerInstance.ts index d74b380bfd..c6c66c80d6 100644 --- a/src/integrations/IntegrationManagerInstance.ts +++ b/src/integrations/IntegrationManagerInstance.ts @@ -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 { ComponentProps } from "react"; +import { type ComponentProps } from "react"; import { logger } from "matrix-js-sdk/src/logger"; import type { Room } from "matrix-js-sdk/src/matrix"; diff --git a/src/integrations/IntegrationManagers.ts b/src/integrations/IntegrationManagers.ts index a8fe8a33dc..6d8ab69ccc 100644 --- a/src/integrations/IntegrationManagers.ts +++ b/src/integrations/IntegrationManagers.ts @@ -7,9 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { ClientEvent, IClientWellKnown, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type IClientWellKnown, type MatrixClient, type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import type { MatrixEvent } from "matrix-js-sdk/src/matrix"; import SdkConfig from "../SdkConfig"; import Modal from "../Modal"; import { IntegrationManagerInstance, Kind } from "./IntegrationManagerInstance"; diff --git a/src/languageHandler.tsx b/src/languageHandler.tsx index 937a6c1867..865430fb9e 100644 --- a/src/languageHandler.tsx +++ b/src/languageHandler.tsx @@ -12,10 +12,10 @@ Please see LICENSE files in the repository root for full details. import counterpart from "counterpart"; import React from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import { MapWithDefault } from "matrix-js-sdk/src/utils"; -import { normalizeLanguageKey, TranslationKey as _TranslationKey, KEY_SEPARATOR } from "matrix-web-i18n"; -import { TranslationStringsObject } from "@matrix-org/react-sdk-module-api"; +import { normalizeLanguageKey, type TranslationKey as _TranslationKey, KEY_SEPARATOR } from "matrix-web-i18n"; +import { type TranslationStringsObject } from "@matrix-org/react-sdk-module-api"; import _ from "lodash"; import type Translations from "./i18n/strings/en_EN.json"; diff --git a/src/linkify-matrix.ts b/src/linkify-matrix.ts index 198d5982c1..aef4553140 100644 --- a/src/linkify-matrix.ts +++ b/src/linkify-matrix.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import * as linkifyjs from "linkifyjs"; -import { EventListeners, Opts, registerCustomProtocol, registerPlugin } from "linkifyjs"; +import { type EventListeners, type Opts, registerCustomProtocol, registerPlugin } from "linkifyjs"; import linkifyElement from "linkify-element"; import linkifyString from "linkify-string"; import { getHttpUriForMxc, User } from "matrix-js-sdk/src/matrix"; @@ -20,8 +20,8 @@ import { } from "./utils/permalinks/Permalinks"; import dis from "./dispatcher/dispatcher"; import { Action } from "./dispatcher/actions"; -import { ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload"; -import { ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; +import { type ViewUserPayload } from "./dispatcher/payloads/ViewUserPayload"; +import { type ViewRoomPayload } from "./dispatcher/payloads/ViewRoomPayload"; import { MatrixClientPeg } from "./MatrixClientPeg"; import { PERMITTED_URL_SCHEMES } from "./utils/UrlUtils"; diff --git a/src/mjolnir/Mjolnir.ts b/src/mjolnir/Mjolnir.ts index cea128e5ef..be4acf5965 100644 --- a/src/mjolnir/Mjolnir.ts +++ b/src/mjolnir/Mjolnir.ts @@ -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 { MatrixEvent, RoomStateEvent, Preset } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, RoomStateEvent, Preset } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../MatrixClientPeg"; @@ -15,8 +15,8 @@ import SettingsStore from "../settings/SettingsStore"; import { _t } from "../languageHandler"; import dis from "../dispatcher/dispatcher"; import { SettingLevel } from "../settings/SettingLevel"; -import { ActionPayload } from "../dispatcher/payloads"; -import { DoAfterSyncPreparedPayload } from "../dispatcher/payloads/DoAfterSyncPreparedPayload"; +import { type ActionPayload } from "../dispatcher/payloads"; +import { type DoAfterSyncPreparedPayload } from "../dispatcher/payloads/DoAfterSyncPreparedPayload"; import { Action } from "../dispatcher/actions"; // TODO: Move this and related files to the js-sdk or something once finalized. diff --git a/src/models/Call.ts b/src/models/Call.ts index b5b0d5a6ec..8ce5a1d2ca 100644 --- a/src/models/Call.ts +++ b/src/models/Call.ts @@ -11,27 +11,26 @@ import { RoomEvent, RoomStateEvent, EventType, - MatrixClient, - IMyDevice, - Room, - RoomMember, + type MatrixClient, + type IMyDevice, + type Room, + type RoomMember, } from "matrix-js-sdk/src/matrix"; -import { KnownMembership, Membership } from "matrix-js-sdk/src/types"; +import { KnownMembership, type Membership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; import { CallType } from "matrix-js-sdk/src/webrtc/call"; import { NamespacedValue } from "matrix-js-sdk/src/NamespacedValue"; -import { IWidgetApiRequest } from "matrix-widget-api"; +import { type IWidgetApiRequest, type ClientWidgetApi, type IWidgetData } from "matrix-widget-api"; import { MatrixRTCSession, MatrixRTCSessionEvent, - CallMembership, + type CallMembership, MatrixRTCSessionManagerEvents, - ICallNotifyContent, + type ICallNotifyContent, } from "matrix-js-sdk/src/matrixrtc"; import type EventEmitter from "events"; -import type { ClientWidgetApi, IWidgetData } from "matrix-widget-api"; import type { IApp } from "../stores/WidgetStore"; import SdkConfig, { DEFAULTS } from "../SdkConfig"; import SettingsStore from "../settings/SettingsStore"; @@ -49,7 +48,7 @@ import { UPDATE_EVENT } from "../stores/AsyncStore"; import { getJoinedNonFunctionalMembers } from "../utils/room/getJoinedNonFunctionalMembers"; import { isVideoRoom } from "../utils/video-rooms"; import { FontWatcher } from "../settings/watchers/FontWatcher"; -import { JitsiCallMemberContent, JitsiCallMemberEventType } from "../call-types"; +import { type JitsiCallMemberContent, JitsiCallMemberEventType } from "../call-types"; const TIMEOUT_MS = 16000; diff --git a/src/models/LocalRoom.ts b/src/models/LocalRoom.ts index 4a233f976f..a8e2c255b2 100644 --- a/src/models/LocalRoom.ts +++ b/src/models/LocalRoom.ts @@ -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 { MatrixClient, Room, PendingEventOrdering } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room, PendingEventOrdering } from "matrix-js-sdk/src/matrix"; -import { Member } from "../utils/direct-messages"; +import { type Member } from "../utils/direct-messages"; export const LOCAL_ROOM_ID_PREFIX = "local+"; diff --git a/src/models/RoomUpload.ts b/src/models/RoomUpload.ts index 61add9c7f5..3fa75d1881 100644 --- a/src/models/RoomUpload.ts +++ b/src/models/RoomUpload.ts @@ -6,8 +6,8 @@ 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 { IEventRelation, UploadProgress } from "matrix-js-sdk/src/matrix"; -import { EncryptedFile } from "matrix-js-sdk/src/types"; +import { type IEventRelation, type UploadProgress } from "matrix-js-sdk/src/matrix"; +import { type EncryptedFile } from "matrix-js-sdk/src/types"; export class RoomUpload { public readonly abortController = new AbortController(); diff --git a/src/models/notificationsettings/PushRuleDiff.ts b/src/models/notificationsettings/PushRuleDiff.ts index 11d8ce0522..992ea2f982 100644 --- a/src/models/notificationsettings/PushRuleDiff.ts +++ b/src/models/notificationsettings/PushRuleDiff.ts @@ -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 { IAnnotatedPushRule, PushRuleAction, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; +import { type IAnnotatedPushRule, type PushRuleAction, type PushRuleKind, type RuleId } from "matrix-js-sdk/src/matrix"; export type PushRuleDiff = { updated: PushRuleUpdate[]; diff --git a/src/models/notificationsettings/PushRuleMap.ts b/src/models/notificationsettings/PushRuleMap.ts index 8c7ede293c..d57d5bbe18 100644 --- a/src/models/notificationsettings/PushRuleMap.ts +++ b/src/models/notificationsettings/PushRuleMap.ts @@ -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 { IAnnotatedPushRule, IPushRules, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; +import { type IAnnotatedPushRule, type IPushRules, PushRuleKind, type RuleId } from "matrix-js-sdk/src/matrix"; export type PushRuleMap = Map; diff --git a/src/models/notificationsettings/reconcileNotificationSettings.ts b/src/models/notificationsettings/reconcileNotificationSettings.ts index ce67d25d34..fdf4f4925b 100644 --- a/src/models/notificationsettings/reconcileNotificationSettings.ts +++ b/src/models/notificationsettings/reconcileNotificationSettings.ts @@ -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 { IPushRules, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; +import { type IPushRules, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; import { deepCompare } from "matrix-js-sdk/src/utils"; import { NotificationUtils } from "../../notifications"; import { StandardActions } from "../../notifications/StandardActions"; import { RoomNotifState } from "../../RoomNotifs"; -import { NotificationSettings } from "./NotificationSettings"; -import { PushRuleDiff, PushRuleUpdate } from "./PushRuleDiff"; +import { type NotificationSettings } from "./NotificationSettings"; +import { type PushRuleDiff, type PushRuleUpdate } from "./PushRuleDiff"; import { buildPushRuleMap } from "./PushRuleMap"; function toStandardRules( diff --git a/src/models/notificationsettings/toNotificationSettings.ts b/src/models/notificationsettings/toNotificationSettings.ts index 33ed4b5e4a..19be22957d 100644 --- a/src/models/notificationsettings/toNotificationSettings.ts +++ b/src/models/notificationsettings/toNotificationSettings.ts @@ -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 { IPushRule, IPushRules, RuleId } from "matrix-js-sdk/src/matrix"; +import { type IPushRule, type IPushRules, RuleId } from "matrix-js-sdk/src/matrix"; import { NotificationUtils } from "../../notifications"; import { RoomNotifState } from "../../RoomNotifs"; -import { NotificationSettings } from "./NotificationSettings"; +import { type NotificationSettings } from "./NotificationSettings"; import { buildPushRuleMap } from "./PushRuleMap"; function shouldNotify(rules: (IPushRule | null | undefined | false)[]): boolean { diff --git a/src/models/rooms/RoomMember.ts b/src/models/rooms/RoomMember.ts index 850ae368b1..eee1ae37ea 100644 --- a/src/models/rooms/RoomMember.ts +++ b/src/models/rooms/RoomMember.ts @@ -5,7 +5,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 { PresenceState } from "./PresenceState"; +import { type PresenceState } from "./PresenceState"; export type RoomMember = { roomId: string; diff --git a/src/models/rooms/ThreePIDInvite.ts b/src/models/rooms/ThreePIDInvite.ts index 4fabd6e097..01e8cd46f7 100644 --- a/src/models/rooms/ThreePIDInvite.ts +++ b/src/models/rooms/ThreePIDInvite.ts @@ -5,7 +5,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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; export type ThreePIDInvite = { event: MatrixEvent; diff --git a/src/modules.d.ts b/src/modules.d.ts index 0f804f17cd..632cfe101d 100644 --- a/src/modules.d.ts +++ b/src/modules.d.ts @@ -5,7 +5,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 { ModuleApi, RuntimeModule } from "@matrix-org/react-sdk-module-api"; +import type { ModuleApi, RuntimeModule } from "@matrix-org/react-sdk-module-api"; declare module "./modules.js" { export type RuntimeModuleConstructor = { new (api: ModuleApi): RuntimeModule }; diff --git a/src/modules/AppModule.ts b/src/modules/AppModule.ts index b7585fd2c6..a3b0f15d4e 100644 --- a/src/modules/AppModule.ts +++ b/src/modules/AppModule.ts @@ -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 { RuntimeModule } from "@matrix-org/react-sdk-module-api/lib/RuntimeModule"; +import { type RuntimeModule } from "@matrix-org/react-sdk-module-api/lib/RuntimeModule"; -import { ModuleFactory } from "./ModuleFactory"; +import { type ModuleFactory } from "./ModuleFactory"; import { ProxiedModuleApi } from "./ProxiedModuleApi"; /** diff --git a/src/modules/ModuleComponents.tsx b/src/modules/ModuleComponents.tsx index 53ab415603..60ea07a4c9 100644 --- a/src/modules/ModuleComponents.tsx +++ b/src/modules/ModuleComponents.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { TextInputField } from "@matrix-org/react-sdk-module-api/lib/components/TextInputField"; import { Spinner as ModuleSpinner } from "@matrix-org/react-sdk-module-api/lib/components/Spinner"; -import React, { ChangeEvent } from "react"; +import React, { type ChangeEvent } from "react"; import Field from "../components/views/elements/Field"; import Spinner from "../components/views/elements/Spinner"; diff --git a/src/modules/ModuleFactory.ts b/src/modules/ModuleFactory.ts index 9d72a18d6b..1e0f205f08 100644 --- a/src/modules/ModuleFactory.ts +++ b/src/modules/ModuleFactory.ts @@ -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 { RuntimeModule } from "@matrix-org/react-sdk-module-api/lib/RuntimeModule"; -import { ModuleApi } from "@matrix-org/react-sdk-module-api/lib/ModuleApi"; +import { type RuntimeModule } from "@matrix-org/react-sdk-module-api/lib/RuntimeModule"; +import { type ModuleApi } from "@matrix-org/react-sdk-module-api/lib/ModuleApi"; export type ModuleFactory = (api: ModuleApi) => RuntimeModule; diff --git a/src/modules/ModuleRunner.ts b/src/modules/ModuleRunner.ts index c01015206d..172bd86aee 100644 --- a/src/modules/ModuleRunner.ts +++ b/src/modules/ModuleRunner.ts @@ -7,19 +7,19 @@ Please see LICENSE files in the repository root for full details. */ import { safeSet } from "matrix-js-sdk/src/utils"; -import { TranslationStringsObject } from "@matrix-org/react-sdk-module-api/lib/types/translations"; -import { AnyLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/types"; +import { type TranslationStringsObject } from "@matrix-org/react-sdk-module-api/lib/types/translations"; +import { type AnyLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/types"; import { DefaultCryptoSetupExtensions, - ProvideCryptoSetupExtensions, + type ProvideCryptoSetupExtensions, } from "@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions"; import { DefaultExperimentalExtensions, - ProvideExperimentalExtensions, + type ProvideExperimentalExtensions, } from "@matrix-org/react-sdk-module-api/lib/lifecycles/ExperimentalExtensions"; import { AppModule } from "./AppModule"; -import { ModuleFactory } from "./ModuleFactory"; +import { type ModuleFactory } from "./ModuleFactory"; import "./ModuleComponents"; diff --git a/src/modules/ProxiedModuleApi.ts b/src/modules/ProxiedModuleApi.ts index 7aa6ccd3b8..8f1b980dbe 100644 --- a/src/modules/ProxiedModuleApi.ts +++ b/src/modules/ProxiedModuleApi.ts @@ -6,18 +6,21 @@ 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 { ModuleApi } from "@matrix-org/react-sdk-module-api/lib/ModuleApi"; -import { TranslationStringsObject, PlainSubstitution } from "@matrix-org/react-sdk-module-api/lib/types/translations"; -import { Optional } from "matrix-events-sdk"; -import { DialogContent, DialogProps } from "@matrix-org/react-sdk-module-api/lib/components/DialogContent"; -import React from "react"; -import { AccountAuthInfo } from "@matrix-org/react-sdk-module-api/lib/types/AccountAuthInfo"; +import { type ModuleApi } from "@matrix-org/react-sdk-module-api/lib/ModuleApi"; +import { + type TranslationStringsObject, + type PlainSubstitution, +} from "@matrix-org/react-sdk-module-api/lib/types/translations"; +import { type Optional } from "matrix-events-sdk"; +import { type DialogContent, type DialogProps } from "@matrix-org/react-sdk-module-api/lib/components/DialogContent"; +import { type AccountAuthInfo } from "@matrix-org/react-sdk-module-api/lib/types/AccountAuthInfo"; import * as Matrix from "matrix-js-sdk/src/matrix"; -import { IRegisterRequestParams } from "matrix-js-sdk/src/matrix"; -import { ModuleUiDialogOptions } from "@matrix-org/react-sdk-module-api/lib/types/ModuleUiDialogOptions"; +import { type IRegisterRequestParams } from "matrix-js-sdk/src/matrix"; +import { type ModuleUiDialogOptions } from "@matrix-org/react-sdk-module-api/lib/types/ModuleUiDialogOptions"; +import type React from "react"; import Modal from "../Modal"; -import { _t, TranslationKey } from "../languageHandler"; +import { _t, type TranslationKey } from "../languageHandler"; import { ModuleUiDialog } from "../components/views/dialogs/ModuleUiDialog"; import SdkConfig from "../SdkConfig"; import PlatformPeg from "../PlatformPeg"; @@ -27,11 +30,11 @@ import { parsePermalink } from "../utils/permalinks/Permalinks"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { getCachedRoomIDForAlias } from "../RoomAliasCache"; import { Action } from "../dispatcher/actions"; -import { OverwriteLoginPayload } from "../dispatcher/payloads/OverwriteLoginPayload"; -import { ActionPayload } from "../dispatcher/payloads"; +import { type OverwriteLoginPayload } from "../dispatcher/payloads/OverwriteLoginPayload"; +import { type ActionPayload } from "../dispatcher/payloads"; import SettingsStore from "../settings/SettingsStore"; -import WidgetStore, { IApp } from "../stores/WidgetStore"; -import { Container, WidgetLayoutStore } from "../stores/widgets/WidgetLayoutStore"; +import WidgetStore, { type IApp } from "../stores/WidgetStore"; +import { type Container, WidgetLayoutStore } from "../stores/widgets/WidgetLayoutStore"; /** * Glue between the `ModuleApi` interface and the react-sdk. Anticipates one instance diff --git a/src/notifications/ContentRules.ts b/src/notifications/ContentRules.ts index bfe3bed6c2..ee8dabd16d 100644 --- a/src/notifications/ContentRules.ts +++ b/src/notifications/ContentRules.ts @@ -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 { IAnnotatedPushRule, IPushRules, PushRuleKind, PushRuleSet } from "matrix-js-sdk/src/matrix"; +import { type IAnnotatedPushRule, type IPushRules, PushRuleKind, type PushRuleSet } from "matrix-js-sdk/src/matrix"; import { PushRuleVectorState, VectorState } from "./PushRuleVectorState"; diff --git a/src/notifications/NotificationUtils.ts b/src/notifications/NotificationUtils.ts index 0504ba41f7..cce937551c 100644 --- a/src/notifications/NotificationUtils.ts +++ b/src/notifications/NotificationUtils.ts @@ -6,7 +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 { PushRuleAction, PushRuleActionName, TweakHighlight, TweakSound } from "matrix-js-sdk/src/matrix"; +import { + type PushRuleAction, + PushRuleActionName, + type TweakHighlight, + type TweakSound, +} from "matrix-js-sdk/src/matrix"; export interface PushRuleActions { notify: boolean; diff --git a/src/notifications/PushRuleVectorState.ts b/src/notifications/PushRuleVectorState.ts index eeed5ca99c..465299095a 100644 --- a/src/notifications/PushRuleVectorState.ts +++ b/src/notifications/PushRuleVectorState.ts @@ -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 { IPushRule, PushRuleAction } from "matrix-js-sdk/src/matrix"; +import { type IPushRule, type PushRuleAction } from "matrix-js-sdk/src/matrix"; import { StandardActions } from "./StandardActions"; import { NotificationUtils } from "./NotificationUtils"; diff --git a/src/notifications/StandardActions.ts b/src/notifications/StandardActions.ts index 21dad0e655..b40e8b4d50 100644 --- a/src/notifications/StandardActions.ts +++ b/src/notifications/StandardActions.ts @@ -7,7 +7,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 { PushRuleAction } from "matrix-js-sdk/src/matrix"; +import { type PushRuleAction } from "matrix-js-sdk/src/matrix"; import { NotificationUtils } from "./NotificationUtils"; diff --git a/src/notifications/VectorPushRulesDefinitions.ts b/src/notifications/VectorPushRulesDefinitions.ts index 77311edcec..403efbc49b 100644 --- a/src/notifications/VectorPushRulesDefinitions.ts +++ b/src/notifications/VectorPushRulesDefinitions.ts @@ -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 { IAnnotatedPushRule, PushRuleAction, RuleId } from "matrix-js-sdk/src/matrix"; +import { type IAnnotatedPushRule, type PushRuleAction, RuleId } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { _td, TranslationKey } from "../languageHandler"; +import { _td, type TranslationKey } from "../languageHandler"; import { StandardActions } from "./StandardActions"; import { PushRuleVectorState, VectorState } from "./PushRuleVectorState"; import { NotificationUtils } from "./NotificationUtils"; diff --git a/src/rageshake/submit-rageshake.ts b/src/rageshake/submit-rageshake.ts index 05f8a49b43..c782d92737 100644 --- a/src/rageshake/submit-rageshake.ts +++ b/src/rageshake/submit-rageshake.ts @@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { Method, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { CryptoApi } from "matrix-js-sdk/src/crypto-api"; +import { Method, type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type CryptoApi } from "matrix-js-sdk/src/crypto-api"; import type * as Pako from "pako"; import { MatrixClientPeg } from "../MatrixClientPeg"; diff --git a/src/resizer/distributors/collapse.ts b/src/resizer/distributors/collapse.ts index a4693e8e14..bd0e874cc4 100644 --- a/src/resizer/distributors/collapse.ts +++ b/src/resizer/distributors/collapse.ts @@ -8,8 +8,9 @@ Please see LICENSE files in the repository root for full details. import { BaseDistributor } from "./fixed"; import ResizeItem from "../item"; -import Resizer, { IConfig } from "../resizer"; -import Sizer from "../sizer"; +import { type IConfig } from "../resizer"; +import type Resizer from "../resizer"; +import type Sizer from "../sizer"; export interface ICollapseConfig extends IConfig { toggleSize: number; diff --git a/src/resizer/distributors/fixed.ts b/src/resizer/distributors/fixed.ts index 609df1deae..1820492ab7 100644 --- a/src/resizer/distributors/fixed.ts +++ b/src/resizer/distributors/fixed.ts @@ -8,7 +8,8 @@ Please see LICENSE files in the repository root for full details. import ResizeItem from "../item"; import Sizer from "../sizer"; -import Resizer, { IConfig } from "../resizer"; +import { type IConfig } from "../resizer"; +import type Resizer from "../resizer"; export abstract class BaseDistributor = ResizeItem> { public static createSizer(containerElement: HTMLElement, vertical: boolean, reverse: boolean): Sizer { diff --git a/src/resizer/distributors/percentage.ts b/src/resizer/distributors/percentage.ts index f8a0010787..df385868f8 100644 --- a/src/resizer/distributors/percentage.ts +++ b/src/resizer/distributors/percentage.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import Sizer from "../sizer"; import FixedDistributor from "./fixed"; -import { IConfig } from "../resizer"; +import { type IConfig } from "../resizer"; class PercentageSizer extends Sizer { public start(item: HTMLElement): void { diff --git a/src/resizer/item.ts b/src/resizer/item.ts index 9eeea86fd6..ed61730693 100644 --- a/src/resizer/item.ts +++ b/src/resizer/item.ts @@ -6,8 +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 Resizer, { IConfig } from "./resizer"; -import Sizer from "./sizer"; +import { type IConfig } from "./resizer"; +import type Resizer from "./resizer"; +import type Sizer from "./sizer"; export default class ResizeItem { public readonly domNode: HTMLElement; diff --git a/src/resizer/resizer.ts b/src/resizer/resizer.ts index 826b017d56..8a814792ad 100644 --- a/src/resizer/resizer.ts +++ b/src/resizer/resizer.ts @@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details. import { throttle } from "lodash"; -import FixedDistributor from "./distributors/fixed"; -import ResizeItem from "./item"; -import Sizer from "./sizer"; +import type FixedDistributor from "./distributors/fixed"; +import type ResizeItem from "./item"; +import type Sizer from "./sizer"; interface IClassNames { // class on resize-handle diff --git a/src/sendTimePerformanceMetrics.ts b/src/sendTimePerformanceMetrics.ts index c57ed3771b..45298b2cd2 100644 --- a/src/sendTimePerformanceMetrics.ts +++ b/src/sendTimePerformanceMetrics.ts @@ -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 { IContent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type IContent, type MatrixClient } from "matrix-js-sdk/src/matrix"; /** * Decorates the given event content object with the "send start time". The diff --git a/src/sentry.ts b/src/sentry.ts index 90ce39d671..60f35fbb6a 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -7,12 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import * as Sentry from "@sentry/browser"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import SdkConfig from "./SdkConfig"; import { MatrixClientPeg } from "./MatrixClientPeg"; import SettingsStore from "./settings/SettingsStore"; -import { IConfigOptions } from "./IConfigOptions"; +import { type IConfigOptions } from "./IConfigOptions"; /* eslint-disable camelcase */ diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index 48a271a9a9..b2c2043063 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -7,10 +7,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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { UNSTABLE_MSC4133_EXTENDED_PROFILES } from "matrix-js-sdk/src/matrix"; -import { _t, _td, TranslationKey } from "../languageHandler"; +import { _t, _td, type TranslationKey } from "../languageHandler"; import DeviceIsolationModeController from "./controllers/DeviceIsolationModeController.ts"; import { NotificationBodyEnabledController, @@ -21,7 +21,7 @@ import ReloadOnChangeController from "./controllers/ReloadOnChangeController"; import FontSizeController from "./controllers/FontSizeController"; import SystemFontController from "./controllers/SystemFontController"; import { SettingLevel } from "./SettingLevel"; -import SettingController from "./controllers/SettingController"; +import type SettingController from "./controllers/SettingController"; import { IS_MAC } from "../Keyboard"; import UIFeatureController from "./controllers/UIFeatureController"; import { UIFeature } from "./UIFeature"; @@ -35,15 +35,15 @@ import SlidingSyncController from "./controllers/SlidingSyncController"; import { FontWatcher } from "./watchers/FontWatcher"; import ServerSupportUnstableFeatureController from "./controllers/ServerSupportUnstableFeatureController"; import { WatchManager } from "./WatchManager"; -import { CustomTheme } from "../theme"; +import { type CustomTheme } from "../theme"; import AnalyticsController from "./controllers/AnalyticsController"; import FallbackIceServerController from "./controllers/FallbackIceServerController"; -import { IRightPanelForRoomStored } from "../stores/right-panel/RightPanelStoreIPanelState.ts"; -import { ILayoutSettings } from "../stores/widgets/WidgetLayoutStore.ts"; -import { ReleaseAnnouncementData } from "../stores/ReleaseAnnouncementStore.ts"; -import { Json, JsonValue } from "../@types/json.ts"; -import { RecentEmojiData } from "../emojipicker/recent.ts"; -import { Assignable } from "../@types/common.ts"; +import { type IRightPanelForRoomStored } from "../stores/right-panel/RightPanelStoreIPanelState.ts"; +import { type ILayoutSettings } from "../stores/widgets/WidgetLayoutStore.ts"; +import { type ReleaseAnnouncementData } from "../stores/ReleaseAnnouncementStore.ts"; +import { type Json, type JsonValue } from "../@types/json.ts"; +import { type RecentEmojiData } from "../emojipicker/recent.ts"; +import { type Assignable } from "../@types/common.ts"; export const defaultWatchManager = new WatchManager(); diff --git a/src/settings/SettingsStore.ts b/src/settings/SettingsStore.ts index f0b74de15a..671a2ac676 100644 --- a/src/settings/SettingsStore.ts +++ b/src/settings/SettingsStore.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { ReactNode } from "react"; +import { type ReactNode } from "react"; import { ClientEvent, SyncState } from "matrix-js-sdk/src/matrix"; import DeviceSettingsHandler from "./handlers/DeviceSettingsHandler"; @@ -20,12 +20,20 @@ import RoomSettingsHandler from "./handlers/RoomSettingsHandler"; import ConfigSettingsHandler from "./handlers/ConfigSettingsHandler"; import { _t } from "../languageHandler"; import dis from "../dispatcher/dispatcher"; -import { IFeature, ISetting, LabGroup, SETTINGS, defaultWatchManager, SettingKey, Settings } from "./Settings"; +import { + type IFeature, + type ISetting, + type LabGroup, + SETTINGS, + defaultWatchManager, + type SettingKey, + type Settings, +} from "./Settings"; import LocalEchoWrapper from "./handlers/LocalEchoWrapper"; -import { CallbackFn as WatchCallbackFn } from "./WatchManager"; +import { type CallbackFn as WatchCallbackFn } from "./WatchManager"; import { SettingLevel } from "./SettingLevel"; -import SettingsHandler from "./handlers/SettingsHandler"; -import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload"; +import type SettingsHandler from "./handlers/SettingsHandler"; +import { type SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload"; import { Action } from "../dispatcher/actions"; import PlatformSettingsHandler from "./handlers/PlatformSettingsHandler"; import ReloadOnChangeController from "./controllers/ReloadOnChangeController"; diff --git a/src/settings/WatchManager.ts b/src/settings/WatchManager.ts index fd38ae3637..2a0a523e0d 100644 --- a/src/settings/WatchManager.ts +++ b/src/settings/WatchManager.ts @@ -5,7 +5,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 { SettingLevel } from "./SettingLevel"; +import { type SettingLevel } from "./SettingLevel"; export type CallbackFn = (changedInRoomId: string | null, atLevel: SettingLevel, newValAtLevel: any) => void; diff --git a/src/settings/controllers/AnalyticsController.ts b/src/settings/controllers/AnalyticsController.ts index f2b432ef5b..9b2bd6b289 100644 --- a/src/settings/controllers/AnalyticsController.ts +++ b/src/settings/controllers/AnalyticsController.ts @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import SettingController from "./SettingController"; -import { SettingLevel } from "../SettingLevel"; -import PosthogTrackers, { InteractionName } from "../../PosthogTrackers"; +import { type SettingLevel } from "../SettingLevel"; +import PosthogTrackers, { type InteractionName } from "../../PosthogTrackers"; /** * Controller that sends events to analytics when a setting is changed. diff --git a/src/settings/controllers/DeviceIsolationModeController.ts b/src/settings/controllers/DeviceIsolationModeController.ts index bbdca789ce..0b619c2eac 100644 --- a/src/settings/controllers/DeviceIsolationModeController.ts +++ b/src/settings/controllers/DeviceIsolationModeController.ts @@ -6,11 +6,11 @@ Please see LICENSE files in the repository root for full details. */ import { AllDevicesIsolationMode, OnlySignedDevicesIsolationMode } from "matrix-js-sdk/src/crypto-api"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import SettingController from "./SettingController"; import { MatrixClientPeg } from "../../MatrixClientPeg"; -import { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; /** * A controller for the "exclude_insecure_devices" setting, which will diff --git a/src/settings/controllers/FallbackIceServerController.ts b/src/settings/controllers/FallbackIceServerController.ts index e433b64ba3..fa87a00bd3 100644 --- a/src/settings/controllers/FallbackIceServerController.ts +++ b/src/settings/controllers/FallbackIceServerController.ts @@ -5,9 +5,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 { ClientEvent, IClientWellKnown, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type IClientWellKnown, type MatrixClient } from "matrix-js-sdk/src/matrix"; -import { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; import SettingsStore from "../SettingsStore.ts"; import MatrixClientBackedController from "./MatrixClientBackedController.ts"; diff --git a/src/settings/controllers/FontSizeController.ts b/src/settings/controllers/FontSizeController.ts index 762e18011e..140369c2b8 100644 --- a/src/settings/controllers/FontSizeController.ts +++ b/src/settings/controllers/FontSizeController.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import SettingController from "./SettingController"; import dis from "../../dispatcher/dispatcher"; -import { UpdateFontSizeDeltaPayload } from "../../dispatcher/payloads/UpdateFontSizeDeltaPayload"; +import { type UpdateFontSizeDeltaPayload } from "../../dispatcher/payloads/UpdateFontSizeDeltaPayload"; import { Action } from "../../dispatcher/actions"; import { SettingLevel } from "../SettingLevel"; diff --git a/src/settings/controllers/IncompatibleController.ts b/src/settings/controllers/IncompatibleController.ts index 37100271f6..81c8ca74ac 100644 --- a/src/settings/controllers/IncompatibleController.ts +++ b/src/settings/controllers/IncompatibleController.ts @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import SettingController from "./SettingController"; -import { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; import SettingsStore from "../SettingsStore"; -import { BooleanSettingKey } from "../Settings.tsx"; +import { type BooleanSettingKey } from "../Settings.tsx"; /** * Enforces that a boolean setting cannot be enabled if the incompatible setting diff --git a/src/settings/controllers/MatrixClientBackedController.ts b/src/settings/controllers/MatrixClientBackedController.ts index ab0ca82093..c7816222d5 100644 --- a/src/settings/controllers/MatrixClientBackedController.ts +++ b/src/settings/controllers/MatrixClientBackedController.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import SettingController from "./SettingController"; diff --git a/src/settings/controllers/NotificationControllers.ts b/src/settings/controllers/NotificationControllers.ts index effb7aee59..20b0d7cf7c 100644 --- a/src/settings/controllers/NotificationControllers.ts +++ b/src/settings/controllers/NotificationControllers.ts @@ -14,7 +14,7 @@ import { PushRuleActionName } from "matrix-js-sdk/src/matrix"; import SettingController from "./SettingController"; import { MatrixClientPeg } from "../../MatrixClientPeg"; -import { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; // .m.rule.master being enabled means all events match that push rule // default action on this rule is dont_notify, but it could be something else diff --git a/src/settings/controllers/ReducedMotionController.ts b/src/settings/controllers/ReducedMotionController.ts index 38d2477fc3..53db05ac4c 100644 --- a/src/settings/controllers/ReducedMotionController.ts +++ b/src/settings/controllers/ReducedMotionController.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import SettingController from "./SettingController"; -import { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; /** * For animation-like settings, this controller checks whether the user has diff --git a/src/settings/controllers/ReloadOnChangeController.ts b/src/settings/controllers/ReloadOnChangeController.ts index ace6d108d2..96093c907b 100644 --- a/src/settings/controllers/ReloadOnChangeController.ts +++ b/src/settings/controllers/ReloadOnChangeController.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import SettingController from "./SettingController"; import PlatformPeg from "../../PlatformPeg"; -import { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; export default class ReloadOnChangeController extends SettingController { public onChange(level: SettingLevel, roomId: string, newValue: any): void { diff --git a/src/settings/controllers/ServerSupportUnstableFeatureController.ts b/src/settings/controllers/ServerSupportUnstableFeatureController.ts index 9da9e3befc..1b6bf9cfff 100644 --- a/src/settings/controllers/ServerSupportUnstableFeatureController.ts +++ b/src/settings/controllers/ServerSupportUnstableFeatureController.ts @@ -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 { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; import MatrixClientBackedController from "./MatrixClientBackedController"; -import { WatchManager } from "../WatchManager"; +import { type WatchManager } from "../WatchManager"; import SettingsStore from "../SettingsStore"; -import { SettingKey } from "../Settings.tsx"; +import { type SettingKey } from "../Settings.tsx"; /** * Disables a given setting if the server unstable feature it requires is not supported diff --git a/src/settings/controllers/SettingController.ts b/src/settings/controllers/SettingController.ts index 821b3d2032..4f8d804adb 100644 --- a/src/settings/controllers/SettingController.ts +++ b/src/settings/controllers/SettingController.ts @@ -7,7 +7,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 { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; /** * Represents a controller for individual settings to alter the reading behaviour diff --git a/src/settings/controllers/SystemFontController.ts b/src/settings/controllers/SystemFontController.ts index 70fab9eda9..11d9a2cbd6 100644 --- a/src/settings/controllers/SystemFontController.ts +++ b/src/settings/controllers/SystemFontController.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import SettingController from "./SettingController"; import SettingsStore from "../SettingsStore"; import dis from "../../dispatcher/dispatcher"; -import { UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload"; +import { type UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload"; import { Action } from "../../dispatcher/actions"; export default class SystemFontController extends SettingController { diff --git a/src/settings/controllers/ThemeController.ts b/src/settings/controllers/ThemeController.ts index a192a4d080..32a13ff8b7 100644 --- a/src/settings/controllers/ThemeController.ts +++ b/src/settings/controllers/ThemeController.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import SettingController from "./SettingController"; import { DEFAULT_THEME, enumerateThemes } from "../../theme"; -import { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; export default class ThemeController extends SettingController { public static isLogin = false; diff --git a/src/settings/controllers/UIFeatureController.ts b/src/settings/controllers/UIFeatureController.ts index 5371751a3c..59ab516487 100644 --- a/src/settings/controllers/UIFeatureController.ts +++ b/src/settings/controllers/UIFeatureController.ts @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import SettingController from "./SettingController"; -import { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; import SettingsStore from "../SettingsStore"; -import { SettingKey } from "../Settings.tsx"; +import { type SettingKey } from "../Settings.tsx"; /** * Enforces that a boolean setting cannot be enabled if the corresponding diff --git a/src/settings/handlers/AccountSettingsHandler.ts b/src/settings/handlers/AccountSettingsHandler.ts index 0500556931..6afd560867 100644 --- a/src/settings/handlers/AccountSettingsHandler.ts +++ b/src/settings/handlers/AccountSettingsHandler.ts @@ -7,14 +7,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 { AccountDataEvents, ClientEvent, MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type AccountDataEvents, ClientEvent, type MatrixClient, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { defer } from "matrix-js-sdk/src/utils"; import { isEqual } from "lodash"; import MatrixClientBackedSettingsHandler from "./MatrixClientBackedSettingsHandler"; import { objectClone, objectKeyChanges } from "../../utils/objects"; import { SettingLevel } from "../SettingLevel"; -import { WatchManager } from "../WatchManager"; +import { type WatchManager } from "../WatchManager"; const BREADCRUMBS_LEGACY_EVENT_TYPE = "im.vector.riot.breadcrumb_rooms"; const BREADCRUMBS_EVENT_TYPE = "im.vector.setting.breadcrumbs"; diff --git a/src/settings/handlers/ConfigSettingsHandler.ts b/src/settings/handlers/ConfigSettingsHandler.ts index 1dd0e19dc5..1b41d676f5 100644 --- a/src/settings/handlers/ConfigSettingsHandler.ts +++ b/src/settings/handlers/ConfigSettingsHandler.ts @@ -12,7 +12,7 @@ import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import SettingsHandler from "./SettingsHandler"; import SdkConfig from "../../SdkConfig"; import { SnakedObject } from "../../utils/SnakedObject"; -import { IConfigOptions } from "../../IConfigOptions"; +import { type IConfigOptions } from "../../IConfigOptions"; /** * Gets and sets settings at the "config" level. This handler does not make use of the diff --git a/src/settings/handlers/DeviceSettingsHandler.ts b/src/settings/handlers/DeviceSettingsHandler.ts index 5feb0c1db3..5ca296aae8 100644 --- a/src/settings/handlers/DeviceSettingsHandler.ts +++ b/src/settings/handlers/DeviceSettingsHandler.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. */ import { SettingLevel } from "../SettingLevel"; -import { CallbackFn, WatchManager } from "../WatchManager"; +import { type CallbackFn, type WatchManager } from "../WatchManager"; import AbstractLocalStorageSettingsHandler from "./AbstractLocalStorageSettingsHandler"; /** diff --git a/src/settings/handlers/LocalEchoWrapper.ts b/src/settings/handlers/LocalEchoWrapper.ts index 2c44fca8a4..b34dd65229 100644 --- a/src/settings/handlers/LocalEchoWrapper.ts +++ b/src/settings/handlers/LocalEchoWrapper.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import SettingsHandler from "./SettingsHandler"; -import { SettingLevel } from "../SettingLevel"; +import { type SettingLevel } from "../SettingLevel"; /** * A wrapper for a SettingsHandler that performs local echo on diff --git a/src/settings/handlers/MatrixClientBackedSettingsHandler.ts b/src/settings/handlers/MatrixClientBackedSettingsHandler.ts index 84d56dcecf..822018375e 100644 --- a/src/settings/handlers/MatrixClientBackedSettingsHandler.ts +++ b/src/settings/handlers/MatrixClientBackedSettingsHandler.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import SettingsHandler from "./SettingsHandler"; diff --git a/src/settings/handlers/PlatformSettingsHandler.ts b/src/settings/handlers/PlatformSettingsHandler.ts index fb16b182fe..48420650b1 100644 --- a/src/settings/handlers/PlatformSettingsHandler.ts +++ b/src/settings/handlers/PlatformSettingsHandler.ts @@ -11,7 +11,7 @@ import PlatformPeg from "../../PlatformPeg"; import { SETTINGS } from "../Settings"; import { SettingLevel } from "../SettingLevel"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { Action } from "../../dispatcher/actions"; /** diff --git a/src/settings/handlers/RoomAccountSettingsHandler.ts b/src/settings/handlers/RoomAccountSettingsHandler.ts index 73a83d4575..045ef5cfe0 100644 --- a/src/settings/handlers/RoomAccountSettingsHandler.ts +++ b/src/settings/handlers/RoomAccountSettingsHandler.ts @@ -7,13 +7,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 { MatrixClient, MatrixEvent, Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent, type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; import { defer } from "matrix-js-sdk/src/utils"; import MatrixClientBackedSettingsHandler from "./MatrixClientBackedSettingsHandler"; import { objectClone, objectKeyChanges } from "../../utils/objects"; import { SettingLevel } from "../SettingLevel"; -import { WatchManager } from "../WatchManager"; +import { type WatchManager } from "../WatchManager"; const ALLOWED_WIDGETS_EVENT_TYPE = "im.vector.setting.allowed_widgets"; const DEFAULT_SETTINGS_EVENT_TYPE = "im.vector.web.settings"; diff --git a/src/settings/handlers/RoomDeviceSettingsHandler.ts b/src/settings/handlers/RoomDeviceSettingsHandler.ts index cf7c17ced6..2e9187c790 100644 --- a/src/settings/handlers/RoomDeviceSettingsHandler.ts +++ b/src/settings/handlers/RoomDeviceSettingsHandler.ts @@ -10,7 +10,7 @@ Please see LICENSE files in the repository root for full details. import { safeSet } from "matrix-js-sdk/src/utils"; import { SettingLevel } from "../SettingLevel"; -import { WatchManager } from "../WatchManager"; +import { type WatchManager } from "../WatchManager"; import AbstractLocalStorageSettingsHandler from "./AbstractLocalStorageSettingsHandler"; /** diff --git a/src/settings/handlers/RoomSettingsHandler.ts b/src/settings/handlers/RoomSettingsHandler.ts index dd6bc48a01..c574ea1ea4 100644 --- a/src/settings/handlers/RoomSettingsHandler.ts +++ b/src/settings/handlers/RoomSettingsHandler.ts @@ -7,13 +7,19 @@ 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, RoomState, RoomStateEvent, StateEvents } from "matrix-js-sdk/src/matrix"; +import { + type MatrixClient, + type MatrixEvent, + type RoomState, + RoomStateEvent, + type StateEvents, +} from "matrix-js-sdk/src/matrix"; import { defer } from "matrix-js-sdk/src/utils"; import MatrixClientBackedSettingsHandler from "./MatrixClientBackedSettingsHandler"; import { objectClone, objectKeyChanges } from "../../utils/objects"; import { SettingLevel } from "../SettingLevel"; -import { WatchManager } from "../WatchManager"; +import { type WatchManager } from "../WatchManager"; const DEFAULT_SETTINGS_EVENT_TYPE = "im.vector.web.settings"; type RoomSettingsEventType = typeof DEFAULT_SETTINGS_EVENT_TYPE | "org.matrix.room.preview_urls"; diff --git a/src/settings/handlers/SettingsHandler.ts b/src/settings/handlers/SettingsHandler.ts index 43ec57cc13..f0157163b4 100644 --- a/src/settings/handlers/SettingsHandler.ts +++ b/src/settings/handlers/SettingsHandler.ts @@ -7,7 +7,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 { WatchManager } from "../WatchManager"; +import { type WatchManager } from "../WatchManager"; /** * Represents the base class for all level handlers. This class performs no logic diff --git a/src/settings/watchers/FontWatcher.ts b/src/settings/watchers/FontWatcher.ts index 6be4b92581..9a36d8f73e 100644 --- a/src/settings/watchers/FontWatcher.ts +++ b/src/settings/watchers/FontWatcher.ts @@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details. import dis from "../../dispatcher/dispatcher"; import SettingsStore from "../SettingsStore"; -import IWatcher from "./Watcher"; +import type IWatcher from "./Watcher"; import { toPx } from "../../utils/units"; import { Action } from "../../dispatcher/actions"; import { SettingLevel } from "../SettingLevel"; -import { UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type UpdateSystemFontPayload } from "../../dispatcher/payloads/UpdateSystemFontPayload"; +import { type ActionPayload } from "../../dispatcher/payloads"; export class FontWatcher implements IWatcher { /** diff --git a/src/settings/watchers/ThemeWatcher.ts b/src/settings/watchers/ThemeWatcher.ts index 77c8a391ae..5ee5810884 100644 --- a/src/settings/watchers/ThemeWatcher.ts +++ b/src/settings/watchers/ThemeWatcher.ts @@ -15,7 +15,7 @@ import dis from "../../dispatcher/dispatcher"; import { Action } from "../../dispatcher/actions"; import ThemeController from "../controllers/ThemeController"; import { findHighContrastTheme } from "../../theme"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { SettingLevel } from "../SettingLevel"; export enum ThemeWatcherEvent { diff --git a/src/shouldHideEvent.ts b/src/shouldHideEvent.ts index e97afd0fbd..f8bc2fc517 100644 --- a/src/shouldHideEvent.ts +++ b/src/shouldHideEvent.ts @@ -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 { MatrixEvent, EventType, RelationType } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, EventType, RelationType } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import SettingsStore from "./settings/SettingsStore"; -import { IRoomState } from "./components/structures/RoomView"; -import { SettingKey } from "./settings/Settings.tsx"; +import { type IRoomState } from "./components/structures/RoomView"; +import { type SettingKey } from "./settings/Settings.tsx"; interface IDiff { isMemberEvent: boolean; diff --git a/src/slash-commands/command.ts b/src/slash-commands/command.ts index 01c6227723..029d42db45 100644 --- a/src/slash-commands/command.ts +++ b/src/slash-commands/command.ts @@ -9,14 +9,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 { MatrixClient } from "matrix-js-sdk/src/matrix"; -import { SlashCommand as SlashCommandEvent } from "@matrix-org/analytics-events/types/typescript/SlashCommand"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type SlashCommand as SlashCommandEvent } from "@matrix-org/analytics-events/types/typescript/SlashCommand"; import { TimelineRenderingType } from "../contexts/RoomContext"; import { reject } from "./utils"; -import { _t, TranslationKey, UserFriendlyError } from "../languageHandler"; +import { _t, type TranslationKey, UserFriendlyError } from "../languageHandler"; import { PosthogAnalytics } from "../PosthogAnalytics"; -import { CommandCategories, RunResult } from "./interface"; +import { CommandCategories, type RunResult } from "./interface"; type RunFn = ( this: Command, diff --git a/src/slash-commands/interface.ts b/src/slash-commands/interface.ts index 6f1f0c8af4..807a3b725d 100644 --- a/src/slash-commands/interface.ts +++ b/src/slash-commands/interface.ts @@ -9,10 +9,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 { RoomMessageEventContent } from "matrix-js-sdk/src/types"; +import { type RoomMessageEventContent } from "matrix-js-sdk/src/types"; import { _td } from "../languageHandler"; -import { XOR } from "../@types/common"; +import { type XOR } from "../@types/common"; export const CommandCategories = { messages: _td("slash_command|category_messages"), diff --git a/src/slash-commands/join.ts b/src/slash-commands/join.ts index de548cba5f..d34fdae0d5 100644 --- a/src/slash-commands/join.ts +++ b/src/slash-commands/join.ts @@ -9,17 +9,17 @@ 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 } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { _td } from "../languageHandler"; import { reject, success } from "./utils"; import { isPermalinkHost, parsePermalink } from "../utils/permalinks/Permalinks"; import dis from "../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../dispatcher/actions"; import { TimelineRenderingType } from "../contexts/RoomContext"; import { Command } from "./command"; -import { CommandCategories, RunResult } from "./interface"; +import { CommandCategories, type RunResult } from "./interface"; // A return of undefined here signals a usage error, where the command should return `reject(this.getUsage());` function openRoom(cli: MatrixClient, args: string | undefined, autoJoin: boolean): RunResult | undefined { diff --git a/src/slash-commands/op.ts b/src/slash-commands/op.ts index 77084bc7a0..09157bf57e 100644 --- a/src/slash-commands/op.ts +++ b/src/slash-commands/op.ts @@ -9,14 +9,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 { MatrixClient, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room, type RoomMember } from "matrix-js-sdk/src/matrix"; import { _td, UserFriendlyError } from "../languageHandler"; import { EffectiveMembership, getEffectiveMembership } from "../utils/membership"; import { warnSelfDemote } from "../components/views/right_panel/UserInfo"; import { TimelineRenderingType } from "../contexts/RoomContext"; import { canAffectPowerlevels, success, reject } from "./utils"; -import { CommandCategories, RunResult } from "./interface"; +import { CommandCategories, type RunResult } from "./interface"; import { Command } from "./command"; const updatePowerLevel = async (room: Room, member: RoomMember, powerLevel: number | undefined): Promise => { diff --git a/src/slash-commands/utils.ts b/src/slash-commands/utils.ts index 8bdade9cf1..f1be124151 100644 --- a/src/slash-commands/utils.ts +++ b/src/slash-commands/utils.ts @@ -9,13 +9,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 { EventType, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { SdkContextClass } from "../contexts/SDKContext"; import { isLocalRoom } from "../utils/localRoom/isLocalRoom"; import Modal from "../Modal"; import UploadConfirmDialog from "../components/views/dialogs/UploadConfirmDialog"; -import { RunResult } from "./interface"; +import { type RunResult } from "./interface"; export function reject(error?: any): RunResult { return { error }; diff --git a/src/stores/ActiveWidgetStore.ts b/src/stores/ActiveWidgetStore.ts index 8d59155224..74497ebf99 100644 --- a/src/stores/ActiveWidgetStore.ts +++ b/src/stores/ActiveWidgetStore.ts @@ -6,7 +6,7 @@ Please see LICENSE files in the repository root for full details. */ import EventEmitter from "events"; -import { MatrixEvent, RoomStateEvent, RoomState } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, RoomStateEvent, type RoomState } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../MatrixClientPeg"; import WidgetUtils from "../utils/WidgetUtils"; diff --git a/src/stores/AsyncStore.ts b/src/stores/AsyncStore.ts index 8f73bdb10a..86a043f84a 100644 --- a/src/stores/AsyncStore.ts +++ b/src/stores/AsyncStore.ts @@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details. import { EventEmitter } from "events"; import AwaitLock from "await-lock"; -import { ActionPayload } from "../dispatcher/payloads"; -import { MatrixDispatcher } from "../dispatcher/dispatcher"; +import { type ActionPayload } from "../dispatcher/payloads"; +import { type MatrixDispatcher } from "../dispatcher/dispatcher"; /** * The event/channel to listen for in an AsyncStore. diff --git a/src/stores/AsyncStoreWithClient.ts b/src/stores/AsyncStoreWithClient.ts index 598594ca3b..6a40787607 100644 --- a/src/stores/AsyncStoreWithClient.ts +++ b/src/stores/AsyncStoreWithClient.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { AsyncStore } from "./AsyncStore"; -import { ActionPayload } from "../dispatcher/payloads"; +import { type ActionPayload } from "../dispatcher/payloads"; import { ReadyWatchingStore } from "./ReadyWatchingStore"; -import { MatrixDispatcher } from "../dispatcher/dispatcher"; +import { type MatrixDispatcher } from "../dispatcher/dispatcher"; export abstract class AsyncStoreWithClient extends AsyncStore { protected readyStore: ReadyWatchingStore; diff --git a/src/stores/AutoRageshakeStore.ts b/src/stores/AutoRageshakeStore.ts index a972099473..b790001250 100644 --- a/src/stores/AutoRageshakeStore.ts +++ b/src/stores/AutoRageshakeStore.ts @@ -8,10 +8,10 @@ Please see LICENSE files in the repository root for full details. import { ClientEvent, - MatrixEvent, + type MatrixEvent, MatrixEventEvent, - SyncStateData, - SyncState, + type SyncStateData, + type SyncState, ToDeviceMessageId, } from "matrix-js-sdk/src/matrix"; import { sleep } from "matrix-js-sdk/src/utils"; @@ -22,7 +22,7 @@ import SdkConfig from "../SdkConfig"; import sendBugReport from "../rageshake/submit-rageshake"; import defaultDispatcher from "../dispatcher/dispatcher"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; -import { ActionPayload } from "../dispatcher/payloads"; +import { type ActionPayload } from "../dispatcher/payloads"; import SettingsStore from "../settings/SettingsStore"; import { Action } from "../dispatcher/actions"; diff --git a/src/stores/BreadcrumbsStore.ts b/src/stores/BreadcrumbsStore.ts index c02d1181fe..e3b01cae0b 100644 --- a/src/stores/BreadcrumbsStore.ts +++ b/src/stores/BreadcrumbsStore.ts @@ -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 { Room, RoomEvent, ClientEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomEvent, ClientEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; @@ -16,9 +16,9 @@ import defaultDispatcher from "../dispatcher/dispatcher"; import { arrayHasDiff, filterBoolean } from "../utils/arrays"; import { SettingLevel } from "../settings/SettingLevel"; import { Action } from "../dispatcher/actions"; -import { SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload"; -import { ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; -import { JoinRoomPayload } from "../dispatcher/payloads/JoinRoomPayload"; +import { type SettingUpdatedPayload } from "../dispatcher/payloads/SettingUpdatedPayload"; +import { type ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; +import { type JoinRoomPayload } from "../dispatcher/payloads/JoinRoomPayload"; const MAX_ROOMS = 20; // arbitrary const AUTOJOIN_WAIT_THRESHOLD_MS = 90000; // 90s, the time we wait for an autojoined room to show up diff --git a/src/stores/CallStore.ts b/src/stores/CallStore.ts index 0d950eecce..6347cc898e 100644 --- a/src/stores/CallStore.ts +++ b/src/stores/CallStore.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { logger } from "matrix-js-sdk/src/logger"; import { GroupCallEventHandlerEvent } from "matrix-js-sdk/src/webrtc/groupCallEventHandler"; -import { MatrixRTCSession, MatrixRTCSessionManagerEvents } from "matrix-js-sdk/src/matrixrtc"; +import { type MatrixRTCSession, MatrixRTCSessionManagerEvents } from "matrix-js-sdk/src/matrixrtc"; import type { EmptyObject, GroupCall, Room } from "matrix-js-sdk/src/matrix"; import defaultDispatcher from "../dispatcher/dispatcher"; diff --git a/src/stores/InitialCryptoSetupStore.ts b/src/stores/InitialCryptoSetupStore.ts index 593b9c1108..226d3f4b2a 100644 --- a/src/stores/InitialCryptoSetupStore.ts +++ b/src/stores/InitialCryptoSetupStore.ts @@ -6,7 +6,7 @@ Please see LICENSE files in the repository root for full details. */ import EventEmitter from "events"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { useEffect, useState } from "react"; diff --git a/src/stores/LifecycleStore.ts b/src/stores/LifecycleStore.ts index 8a369cb51e..6efeffa013 100644 --- a/src/stores/LifecycleStore.ts +++ b/src/stores/LifecycleStore.ts @@ -12,8 +12,8 @@ import { logger } from "matrix-js-sdk/src/logger"; import { Action } from "../dispatcher/actions"; import dis from "../dispatcher/dispatcher"; -import { ActionPayload } from "../dispatcher/payloads"; -import { DoAfterSyncPreparedPayload } from "../dispatcher/payloads/DoAfterSyncPreparedPayload"; +import { type ActionPayload } from "../dispatcher/payloads"; +import { type DoAfterSyncPreparedPayload } from "../dispatcher/payloads/DoAfterSyncPreparedPayload"; import { AsyncStore } from "./AsyncStore"; import { MatrixClientPeg } from "../MatrixClientPeg"; import ToastStore from "./ToastStore"; diff --git a/src/stores/MemberListStore.ts b/src/stores/MemberListStore.ts index 12878c4ec9..04c5824d99 100644 --- a/src/stores/MemberListStore.ts +++ b/src/stores/MemberListStore.ts @@ -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 { Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type Room, type RoomMember } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import SettingsStore from "../settings/SettingsStore"; -import { SdkContextClass } from "../contexts/SDKContext"; +import { type SdkContextClass } from "../contexts/SDKContext"; import SdkConfig from "../SdkConfig"; // Regex applied to filter our punctuation in member names before applying sort, to fuzzy it a little diff --git a/src/stores/ModalWidgetStore.ts b/src/stores/ModalWidgetStore.ts index 9f5ddca25d..10f16d24d2 100644 --- a/src/stores/ModalWidgetStore.ts +++ b/src/stores/ModalWidgetStore.ts @@ -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 { IModalWidgetOpenRequestData, IModalWidgetReturnData, Widget } from "matrix-widget-api"; +import { type IModalWidgetOpenRequestData, type IModalWidgetReturnData, type Widget } from "matrix-widget-api"; import { logger } from "matrix-js-sdk/src/logger"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; -import { ActionPayload } from "../dispatcher/payloads"; -import Modal, { IHandle, IModal } from "../Modal"; +import { type ActionPayload } from "../dispatcher/payloads"; +import Modal, { type IHandle, type IModal } from "../Modal"; import ModalWidgetDialog from "../components/views/dialogs/ModalWidgetDialog"; import { WidgetMessagingStore } from "./widgets/WidgetMessagingStore"; diff --git a/src/stores/NonUrgentToastStore.ts b/src/stores/NonUrgentToastStore.ts index 97a4bbdfdf..3912fb5788 100644 --- a/src/stores/NonUrgentToastStore.ts +++ b/src/stores/NonUrgentToastStore.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import EventEmitter from "events"; -import { ComponentClass } from "../@types/common"; +import { type ComponentClass } from "../@types/common"; import { UPDATE_EVENT } from "./AsyncStore"; export type ToastReference = symbol; diff --git a/src/stores/OwnBeaconStore.ts b/src/stores/OwnBeaconStore.ts index 72c67c3635..4b6f0ddc11 100644 --- a/src/stores/OwnBeaconStore.ts +++ b/src/stores/OwnBeaconStore.ts @@ -8,31 +8,31 @@ Please see LICENSE files in the repository root for full details. import { debounce } from "lodash"; import { - Beacon, - BeaconIdentifier, + type Beacon, + type BeaconIdentifier, BeaconEvent, - MatrixEvent, - Room, - RoomMember, - RoomState, + type MatrixEvent, + type Room, + type RoomMember, + type RoomState, RoomStateEvent, ContentHelpers, - MBeaconInfoEventContent, + type MBeaconInfoEventContent, M_BEACON, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import defaultDispatcher from "../dispatcher/dispatcher"; -import { ActionPayload } from "../dispatcher/payloads"; +import { type ActionPayload } from "../dispatcher/payloads"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import { arrayDiff } from "../utils/arrays"; import { - ClearWatchCallback, + type ClearWatchCallback, GeolocationError, mapGeolocationPositionToTimedGeo, sortBeaconsByLatestCreation, - TimedGeoUri, + type TimedGeoUri, watchPosition, getCurrentPosition, } from "../utils/beacon"; diff --git a/src/stores/OwnProfileStore.ts b/src/stores/OwnProfileStore.ts index ef721ee4aa..b2d35a390f 100644 --- a/src/stores/OwnProfileStore.ts +++ b/src/stores/OwnProfileStore.ts @@ -6,10 +6,17 @@ 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 { MatrixEvent, RoomStateEvent, MatrixError, User, UserEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { + type MatrixEvent, + RoomStateEvent, + MatrixError, + type User, + UserEvent, + EventType, +} from "matrix-js-sdk/src/matrix"; import { throttle } from "lodash"; -import { ActionPayload } from "../dispatcher/payloads"; +import { type ActionPayload } from "../dispatcher/payloads"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import { MatrixClientPeg } from "../MatrixClientPeg"; diff --git a/src/stores/ReadyWatchingStore.ts b/src/stores/ReadyWatchingStore.ts index cb99cf1268..91d7144c71 100644 --- a/src/stores/ReadyWatchingStore.ts +++ b/src/stores/ReadyWatchingStore.ts @@ -6,14 +6,14 @@ * Please see LICENSE files in the repository root for full details. */ -import { MatrixClient, SyncState } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, SyncState } from "matrix-js-sdk/src/matrix"; import { EventEmitter } from "events"; import { MatrixClientPeg } from "../MatrixClientPeg"; -import { ActionPayload } from "../dispatcher/payloads"; -import { IDestroyable } from "../utils/IDestroyable"; +import { type ActionPayload } from "../dispatcher/payloads"; +import { type IDestroyable } from "../utils/IDestroyable"; import { Action } from "../dispatcher/actions"; -import { MatrixDispatcher } from "../dispatcher/dispatcher"; +import { type MatrixDispatcher } from "../dispatcher/dispatcher"; export abstract class ReadyWatchingStore extends EventEmitter implements IDestroyable { protected matrixClient?: MatrixClient; diff --git a/src/stores/RoomViewStore.tsx b/src/stores/RoomViewStore.tsx index 822a6a9dd1..c691f0af79 100644 --- a/src/stores/RoomViewStore.tsx +++ b/src/stores/RoomViewStore.tsx @@ -8,18 +8,21 @@ 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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import * as utils from "matrix-js-sdk/src/utils"; -import { MatrixError, JoinRule, Room, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { MatrixError, JoinRule, type Room, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; -import { ViewRoom as ViewRoomEvent } from "@matrix-org/analytics-events/types/typescript/ViewRoom"; -import { JoinedRoom as JoinedRoomEvent } from "@matrix-org/analytics-events/types/typescript/JoinedRoom"; -import { Optional } from "matrix-events-sdk"; +import { type ViewRoom as ViewRoomEvent } from "@matrix-org/analytics-events/types/typescript/ViewRoom"; +import { type JoinedRoom as JoinedRoomEvent } from "@matrix-org/analytics-events/types/typescript/JoinedRoom"; +import { type Optional } from "matrix-events-sdk"; import EventEmitter from "events"; -import { RoomViewLifecycle, ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; +import { + RoomViewLifecycle, + type ViewRoomOpts, +} from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; -import { MatrixDispatcher } from "../dispatcher/dispatcher"; +import { type MatrixDispatcher } from "../dispatcher/dispatcher"; import { MatrixClientPeg } from "../MatrixClientPeg"; import Modal from "../Modal"; import { _t } from "../languageHandler"; @@ -27,24 +30,24 @@ import { getCachedRoomIDForAlias, storeRoomAliasInCache } from "../RoomAliasCach import { Action } from "../dispatcher/actions"; import { retry } from "../utils/promise"; import { TimelineRenderingType } from "../contexts/RoomContext"; -import { ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; import DMRoomMap from "../utils/DMRoomMap"; import { isMetaSpace, MetaSpace } from "./spaces"; -import { JoinRoomPayload } from "../dispatcher/payloads/JoinRoomPayload"; -import { JoinRoomReadyPayload } from "../dispatcher/payloads/JoinRoomReadyPayload"; -import { JoinRoomErrorPayload } from "../dispatcher/payloads/JoinRoomErrorPayload"; -import { ViewRoomErrorPayload } from "../dispatcher/payloads/ViewRoomErrorPayload"; +import { type JoinRoomPayload } from "../dispatcher/payloads/JoinRoomPayload"; +import { type JoinRoomReadyPayload } from "../dispatcher/payloads/JoinRoomReadyPayload"; +import { type JoinRoomErrorPayload } from "../dispatcher/payloads/JoinRoomErrorPayload"; +import { type ViewRoomErrorPayload } from "../dispatcher/payloads/ViewRoomErrorPayload"; import ErrorDialog from "../components/views/dialogs/ErrorDialog"; -import { ActiveRoomChangedPayload } from "../dispatcher/payloads/ActiveRoomChangedPayload"; +import { type ActiveRoomChangedPayload } from "../dispatcher/payloads/ActiveRoomChangedPayload"; import SettingsStore from "../settings/SettingsStore"; import { awaitRoomDownSync } from "../utils/RoomUpgrade"; import { UPDATE_EVENT } from "./AsyncStore"; -import { SdkContextClass } from "../contexts/SDKContext"; +import { type SdkContextClass } from "../contexts/SDKContext"; import { CallStore } from "./CallStore"; -import { ThreadPayload } from "../dispatcher/payloads/ThreadPayload"; -import { ActionPayload } from "../dispatcher/payloads"; -import { CancelAskToJoinPayload } from "../dispatcher/payloads/CancelAskToJoinPayload"; -import { SubmitAskToJoinPayload } from "../dispatcher/payloads/SubmitAskToJoinPayload"; +import { type ThreadPayload } from "../dispatcher/payloads/ThreadPayload"; +import { type ActionPayload } from "../dispatcher/payloads"; +import { type CancelAskToJoinPayload } from "../dispatcher/payloads/CancelAskToJoinPayload"; +import { type SubmitAskToJoinPayload } from "../dispatcher/payloads/SubmitAskToJoinPayload"; import { ModuleRunner } from "../modules/ModuleRunner"; import { setMarkedUnreadState } from "../utils/notifications"; diff --git a/src/stores/SetupEncryptionStore.ts b/src/stores/SetupEncryptionStore.ts index 3aa6ad1866..0431242c69 100644 --- a/src/stores/SetupEncryptionStore.ts +++ b/src/stores/SetupEncryptionStore.ts @@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details. import EventEmitter from "events"; import { - KeyBackupInfo, + type KeyBackupInfo, VerificationPhase, - VerificationRequest, + type VerificationRequest, VerificationRequestEvent, CryptoEvent, } from "matrix-js-sdk/src/crypto-api"; import { logger } from "matrix-js-sdk/src/logger"; -import { Device, SecretStorage } from "matrix-js-sdk/src/matrix"; +import { type Device, type SecretStorage } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { AccessCancelledError, accessSecretStorage } from "../SecurityManager"; diff --git a/src/stores/ThreepidInviteStore.ts b/src/stores/ThreepidInviteStore.ts index 92fa7d5bd8..271d75b130 100644 --- a/src/stores/ThreepidInviteStore.ts +++ b/src/stores/ThreepidInviteStore.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import EventEmitter from "events"; import { base32 } from "rfc4648"; -import { RoomType } from "matrix-js-sdk/src/matrix"; +import { type RoomType } from "matrix-js-sdk/src/matrix"; // Dev note: the interface is split in two so we don't have to disable the // linter across the whole project. diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts index 3ebb0d945c..8fe1fa8246 100644 --- a/src/stores/ToastStore.ts +++ b/src/stores/ToastStore.ts @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import EventEmitter from "events"; -import React from "react"; -import { ComponentClass } from "../@types/common"; +import type React from "react"; +import { type ComponentClass } from "../@types/common"; export interface IToast { key: string; diff --git a/src/stores/TypingStore.ts b/src/stores/TypingStore.ts index 26fd4967e7..31f04121b1 100644 --- a/src/stores/TypingStore.ts +++ b/src/stores/TypingStore.ts @@ -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 { SdkContextClass } from "../contexts/SDKContext"; +import { type SdkContextClass } from "../contexts/SDKContext"; import SettingsStore from "../settings/SettingsStore"; import { isLocalRoom } from "../utils/localRoom/isLocalRoom"; import Timer from "../utils/Timer"; diff --git a/src/stores/UserProfilesStore.ts b/src/stores/UserProfilesStore.ts index eb3c25a309..79bef7d394 100644 --- a/src/stores/UserProfilesStore.ts +++ b/src/stores/UserProfilesStore.ts @@ -8,11 +8,11 @@ Please see LICENSE files in the repository root for full details. import { logger } from "matrix-js-sdk/src/logger"; import { - IMatrixProfile, - MatrixClient, + type IMatrixProfile, + type MatrixClient, MatrixError, - MatrixEvent, - RoomMember, + type MatrixEvent, + type RoomMember, RoomMemberEvent, } from "matrix-js-sdk/src/matrix"; diff --git a/src/stores/VoiceRecordingStore.ts b/src/stores/VoiceRecordingStore.ts index b94301f62c..0715394996 100644 --- a/src/stores/VoiceRecordingStore.ts +++ b/src/stores/VoiceRecordingStore.ts @@ -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 { Optional } from "matrix-events-sdk"; -import { Room, IEventRelation, RelationType } from "matrix-js-sdk/src/matrix"; +import { type Optional } from "matrix-events-sdk"; +import { type Room, type IEventRelation, RelationType } from "matrix-js-sdk/src/matrix"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; -import { ActionPayload } from "../dispatcher/payloads"; -import { createVoiceMessageRecording, VoiceMessageRecording } from "../audio/VoiceMessageRecording"; +import { type ActionPayload } from "../dispatcher/payloads"; +import { createVoiceMessageRecording, type VoiceMessageRecording } from "../audio/VoiceMessageRecording"; const SEPARATOR = "|"; diff --git a/src/stores/WidgetEchoStore.ts b/src/stores/WidgetEchoStore.ts index ef81ec10d7..7be77652c7 100644 --- a/src/stores/WidgetEchoStore.ts +++ b/src/stores/WidgetEchoStore.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import EventEmitter from "events"; -import { IWidget } from "matrix-widget-api"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type IWidget } from "matrix-widget-api"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { WidgetType } from "../widgets/WidgetType"; +import { type WidgetType } from "../widgets/WidgetType"; /** * Acts as a place to get & set widget state, storing local echo state and diff --git a/src/stores/WidgetStore.ts b/src/stores/WidgetStore.ts index a715a97c1e..5a76df7103 100644 --- a/src/stores/WidgetStore.ts +++ b/src/stores/WidgetStore.ts @@ -6,18 +6,18 @@ 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 { Room, RoomStateEvent, MatrixEvent, ClientEvent, EmptyObject } from "matrix-js-sdk/src/matrix"; -import { IWidget } from "matrix-widget-api"; +import { type Room, RoomStateEvent, type MatrixEvent, ClientEvent, type EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type IWidget } from "matrix-widget-api"; import { logger } from "matrix-js-sdk/src/logger"; -import { ActionPayload } from "../dispatcher/payloads"; +import { type ActionPayload } from "../dispatcher/payloads"; import { AsyncStoreWithClient } from "./AsyncStoreWithClient"; import defaultDispatcher from "../dispatcher/dispatcher"; import WidgetEchoStore from "../stores/WidgetEchoStore"; import ActiveWidgetStore from "../stores/ActiveWidgetStore"; import WidgetUtils from "../utils/WidgetUtils"; import { UPDATE_EVENT } from "./AsyncStore"; -import { IApp } from "../utils/WidgetUtils-types"; +import { type IApp } from "../utils/WidgetUtils-types"; export type { IApp }; diff --git a/src/stores/local-echo/EchoChamber.ts b/src/stores/local-echo/EchoChamber.ts index 1cc9bd981e..553c1a120c 100644 --- a/src/stores/local-echo/EchoChamber.ts +++ b/src/stores/local-echo/EchoChamber.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { RoomEchoChamber } from "./RoomEchoChamber"; +import { type RoomEchoChamber } from "./RoomEchoChamber"; import { EchoStore } from "./EchoStore"; /** diff --git a/src/stores/local-echo/EchoContext.ts b/src/stores/local-echo/EchoContext.ts index 17ba5710d4..df9abff158 100644 --- a/src/stores/local-echo/EchoContext.ts +++ b/src/stores/local-echo/EchoContext.ts @@ -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 { EchoTransaction, RunFn, TransactionStatus } from "./EchoTransaction"; +import { EchoTransaction, type RunFn, TransactionStatus } from "./EchoTransaction"; import { arrayFastClone } from "../../utils/arrays"; -import { IDestroyable } from "../../utils/IDestroyable"; +import { type IDestroyable } from "../../utils/IDestroyable"; import { Whenable } from "../../utils/Whenable"; export enum ContextTransactionState { diff --git a/src/stores/local-echo/EchoStore.ts b/src/stores/local-echo/EchoStore.ts index c38995cd4e..90a52f6cac 100644 --- a/src/stores/local-echo/EchoStore.ts +++ b/src/stores/local-echo/EchoStore.ts @@ -6,16 +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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { GenericEchoChamber } from "./GenericEchoChamber"; +import { type GenericEchoChamber } from "./GenericEchoChamber"; import { RoomEchoChamber } from "./RoomEchoChamber"; import { RoomEchoContext } from "./RoomEchoContext"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import { ActionPayload } from "../../dispatcher/payloads"; -import { ContextTransactionState, EchoContext } from "./EchoContext"; -import NonUrgentToastStore, { ToastReference } from "../NonUrgentToastStore"; +import { type ActionPayload } from "../../dispatcher/payloads"; +import { ContextTransactionState, type EchoContext } from "./EchoContext"; +import NonUrgentToastStore, { type ToastReference } from "../NonUrgentToastStore"; import NonUrgentEchoFailureToast from "../../components/views/toasts/NonUrgentEchoFailureToast"; interface IState { diff --git a/src/stores/local-echo/GenericEchoChamber.ts b/src/stores/local-echo/GenericEchoChamber.ts index 3bda937d3c..6dbd7f587b 100644 --- a/src/stores/local-echo/GenericEchoChamber.ts +++ b/src/stores/local-echo/GenericEchoChamber.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { EventEmitter } from "events"; -import { EchoContext } from "./EchoContext"; -import { EchoTransaction, RunFn, TransactionStatus } from "./EchoTransaction"; +import { type EchoContext } from "./EchoContext"; +import { type EchoTransaction, type RunFn, TransactionStatus } from "./EchoTransaction"; export async function implicitlyReverted(): Promise { // do nothing :D diff --git a/src/stores/local-echo/RoomEchoChamber.ts b/src/stores/local-echo/RoomEchoChamber.ts index e318875226..90e1b645f7 100644 --- a/src/stores/local-echo/RoomEchoChamber.ts +++ b/src/stores/local-echo/RoomEchoChamber.ts @@ -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 { MatrixEvent, ClientEvent, MatrixClient, EventType } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, ClientEvent, type MatrixClient, EventType } from "matrix-js-sdk/src/matrix"; import { GenericEchoChamber, implicitlyReverted, PROPERTY_UPDATED } from "./GenericEchoChamber"; -import { getRoomNotifsState, RoomNotifState, setRoomNotifsState } from "../../RoomNotifs"; -import { RoomEchoContext } from "./RoomEchoContext"; +import { getRoomNotifsState, type RoomNotifState, setRoomNotifsState } from "../../RoomNotifs"; +import { type RoomEchoContext } from "./RoomEchoContext"; import { _t } from "../../languageHandler"; export enum CachedRoomKey { diff --git a/src/stores/local-echo/RoomEchoContext.ts b/src/stores/local-echo/RoomEchoContext.ts index ae8573c922..e935024cd4 100644 --- a/src/stores/local-echo/RoomEchoContext.ts +++ b/src/stores/local-echo/RoomEchoContext.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { EchoContext } from "./EchoContext"; diff --git a/src/stores/notifications/ListNotificationState.ts b/src/stores/notifications/ListNotificationState.ts index f6af7d35c7..884b318838 100644 --- a/src/stores/notifications/ListNotificationState.ts +++ b/src/stores/notifications/ListNotificationState.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { NotificationLevel } from "./NotificationLevel"; import { arrayDiff } from "../../utils/arrays"; -import { RoomNotificationState } from "./RoomNotificationState"; +import { type RoomNotificationState } from "./RoomNotificationState"; import { NotificationState, NotificationStateEvents } from "./NotificationState"; export type FetchRoomFn = (room: Room) => RoomNotificationState; diff --git a/src/stores/notifications/NotificationState.ts b/src/stores/notifications/NotificationState.ts index 9c72c9fef0..a453d7ca42 100644 --- a/src/stores/notifications/NotificationState.ts +++ b/src/stores/notifications/NotificationState.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import { TypedEventEmitter } from "matrix-js-sdk/src/matrix"; import { NotificationLevel } from "./NotificationLevel"; -import { IDestroyable } from "../../utils/IDestroyable"; +import { type IDestroyable } from "../../utils/IDestroyable"; import SettingsStore from "../../settings/SettingsStore"; export interface INotificationStateSnapshotParams { diff --git a/src/stores/notifications/RoomNotificationStateStore.ts b/src/stores/notifications/RoomNotificationStateStore.ts index 4fa51128be..12447a3983 100644 --- a/src/stores/notifications/RoomNotificationStateStore.ts +++ b/src/stores/notifications/RoomNotificationStateStore.ts @@ -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 { Room, ClientEvent, SyncState, EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type Room, ClientEvent, SyncState, type EmptyObject } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; -import defaultDispatcher, { MatrixDispatcher } from "../../dispatcher/dispatcher"; -import { DefaultTagID, TagID } from "../room-list/models"; -import { FetchRoomFn, ListNotificationState } from "./ListNotificationState"; +import defaultDispatcher, { type MatrixDispatcher } from "../../dispatcher/dispatcher"; +import { DefaultTagID, type TagID } from "../room-list/models"; +import { type FetchRoomFn, ListNotificationState } from "./ListNotificationState"; import { RoomNotificationState } from "./RoomNotificationState"; import { SummarizedNotificationState } from "./SummarizedNotificationState"; import { VisibilityProvider } from "../room-list/filters/VisibilityProvider"; diff --git a/src/stores/notifications/SpaceNotificationState.ts b/src/stores/notifications/SpaceNotificationState.ts index e5aedf6317..4ea24b7e10 100644 --- a/src/stores/notifications/SpaceNotificationState.ts +++ b/src/stores/notifications/SpaceNotificationState.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { NotificationLevel } from "./NotificationLevel"; import { arrayDiff } from "../../utils/arrays"; -import { RoomNotificationState } from "./RoomNotificationState"; +import { type RoomNotificationState } from "./RoomNotificationState"; import { NotificationState, NotificationStateEvents } from "./NotificationState"; -import { FetchRoomFn } from "./ListNotificationState"; +import { type FetchRoomFn } from "./ListNotificationState"; import { DefaultTagID } from "../room-list/models"; import RoomListStore from "../room-list/RoomListStore"; diff --git a/src/stores/oidc/OidcClientStore.ts b/src/stores/oidc/OidcClientStore.ts index b58405c2db..1edfb4b59c 100644 --- a/src/stores/oidc/OidcClientStore.ts +++ b/src/stores/oidc/OidcClientStore.ts @@ -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 { MatrixClient, discoverAndValidateOIDCIssuerWellKnown } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, discoverAndValidateOIDCIssuerWellKnown } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { OidcClient } from "oidc-client-ts"; diff --git a/src/stores/right-panel/RightPanelStore.ts b/src/stores/right-panel/RightPanelStore.ts index b89851691a..b3f8d93460 100644 --- a/src/stores/right-panel/RightPanelStore.ts +++ b/src/stores/right-panel/RightPanelStore.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { logger } from "matrix-js-sdk/src/logger"; import { CryptoEvent } from "matrix-js-sdk/src/crypto-api"; -import { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { pendingVerificationRequestForUser } from "../../verification"; @@ -20,13 +20,13 @@ import { ReadyWatchingStore } from "../ReadyWatchingStore"; import { convertToStatePanel, convertToStorePanel, - IRightPanelCard, - IRightPanelCardState, - IRightPanelForRoom, + type IRightPanelCard, + type IRightPanelCardState, + type IRightPanelForRoom, } from "./RightPanelStoreIPanelState"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { Action } from "../../dispatcher/actions"; -import { ActiveRoomChangedPayload } from "../../dispatcher/payloads/ActiveRoomChangedPayload"; +import { type ActiveRoomChangedPayload } from "../../dispatcher/payloads/ActiveRoomChangedPayload"; import { SdkContextClass } from "../../contexts/SDKContext"; import { MatrixClientPeg } from "../../MatrixClientPeg"; diff --git a/src/stores/right-panel/RightPanelStoreIPanelState.ts b/src/stores/right-panel/RightPanelStoreIPanelState.ts index d70f6606e9..8b145c25ec 100644 --- a/src/stores/right-panel/RightPanelStoreIPanelState.ts +++ b/src/stores/right-panel/RightPanelStoreIPanelState.ts @@ -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 { MatrixEvent, Room, RoomMember, User } from "matrix-js-sdk/src/matrix"; -import { VerificationRequest } from "matrix-js-sdk/src/crypto-api"; +import { type MatrixEvent, type Room, type RoomMember, type User } from "matrix-js-sdk/src/matrix"; +import { type VerificationRequest } from "matrix-js-sdk/src/crypto-api"; -import { RightPanelPhases } from "./RightPanelStorePhases"; +import { type RightPanelPhases } from "./RightPanelStorePhases"; export interface IRightPanelCardState { member?: RoomMember | User; diff --git a/src/stores/right-panel/action-handlers/View3pidInvite.ts b/src/stores/right-panel/action-handlers/View3pidInvite.ts index 8a54c56c99..a57fd9b990 100644 --- a/src/stores/right-panel/action-handlers/View3pidInvite.ts +++ b/src/stores/right-panel/action-handlers/View3pidInvite.ts @@ -6,8 +6,8 @@ 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 { ActionPayload } from "../../../dispatcher/payloads"; -import RightPanelStore from "../RightPanelStore"; +import { type ActionPayload } from "../../../dispatcher/payloads"; +import type RightPanelStore from "../RightPanelStore"; import { RightPanelPhases } from "../RightPanelStorePhases"; /** diff --git a/src/stores/room-list/Interface.ts b/src/stores/room-list/Interface.ts index f9e32b6f40..f913f7e7ed 100644 --- a/src/stores/room-list/Interface.ts +++ b/src/stores/room-list/Interface.ts @@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details. import type { Room } from "matrix-js-sdk/src/matrix"; import type { EventEmitter } from "events"; -import { ITagMap, ListAlgorithm, SortAlgorithm } from "./algorithms/models"; -import { RoomUpdateCause, TagID } from "./models"; -import { IFilterCondition } from "./filters/IFilterCondition"; +import { type ITagMap, type ListAlgorithm, type SortAlgorithm } from "./algorithms/models"; +import { type RoomUpdateCause, type TagID } from "./models"; +import { type IFilterCondition } from "./filters/IFilterCondition"; export enum RoomListStoreEvent { // The event/channel which is called when the room lists have been changed. diff --git a/src/stores/room-list/ListLayout.ts b/src/stores/room-list/ListLayout.ts index e85703fa5f..a4468dfffe 100644 --- a/src/stores/room-list/ListLayout.ts +++ b/src/stores/room-list/ListLayout.ts @@ -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 { TagID } from "./models"; +import { type TagID } from "./models"; const TILE_HEIGHT_PX = 44; diff --git a/src/stores/room-list/MessagePreviewStore.ts b/src/stores/room-list/MessagePreviewStore.ts index fe2d56871d..51e413940d 100644 --- a/src/stores/room-list/MessagePreviewStore.ts +++ b/src/stores/room-list/MessagePreviewStore.ts @@ -7,29 +7,29 @@ Please see LICENSE files in the repository root for full details. */ import { - Room, + type Room, RelationType, - MatrixEvent, - Thread, + type MatrixEvent, + type Thread, M_POLL_START, RoomEvent, - EmptyObject, + type EmptyObject, } from "matrix-js-sdk/src/matrix"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { MessageEventPreview } from "./previews/MessageEventPreview"; import { PollStartEventPreview } from "./previews/PollStartEventPreview"; -import { TagID } from "./models"; +import { type TagID } from "./models"; import { LegacyCallInviteEventPreview } from "./previews/LegacyCallInviteEventPreview"; import { LegacyCallAnswerEventPreview } from "./previews/LegacyCallAnswerEventPreview"; import { LegacyCallHangupEvent } from "./previews/LegacyCallHangupEvent"; import { StickerEventPreview } from "./previews/StickerEventPreview"; import { ReactionEventPreview } from "./previews/ReactionEventPreview"; import { UPDATE_EVENT } from "../AsyncStore"; -import { IPreview } from "./previews/IPreview"; +import { type IPreview } from "./previews/IPreview"; import shouldHideEvent from "../../shouldHideEvent"; // Emitted event for when a room's preview has changed. First argument will the room for which diff --git a/src/stores/room-list/RoomListLayoutStore.ts b/src/stores/room-list/RoomListLayoutStore.ts index f739554b82..c7b2b7f31e 100644 --- a/src/stores/room-list/RoomListLayoutStore.ts +++ b/src/stores/room-list/RoomListLayoutStore.ts @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; -import { TagID } from "./models"; +import { type TagID } from "./models"; import { ListLayout } from "./ListLayout"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; export default class RoomListLayoutStore extends AsyncStoreWithClient { private static internalInstance: RoomListLayoutStore; diff --git a/src/stores/room-list/RoomListStore.ts b/src/stores/room-list/RoomListStore.ts index bb48ec5e18..e1d2f7b7e8 100644 --- a/src/stores/room-list/RoomListStore.ts +++ b/src/stores/room-list/RoomListStore.ts @@ -6,17 +6,23 @@ 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, Room, RoomState, EventType, EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room, type RoomState, EventType, type EmptyObject } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import SettingsStore from "../../settings/SettingsStore"; -import { DefaultTagID, OrderedDefaultTagIDs, RoomUpdateCause, TagID } from "./models"; -import { IListOrderingMap, ITagMap, ITagSortingMap, ListAlgorithm, SortAlgorithm } from "./algorithms/models"; -import { ActionPayload } from "../../dispatcher/payloads"; -import defaultDispatcher, { MatrixDispatcher } from "../../dispatcher/dispatcher"; +import { DefaultTagID, OrderedDefaultTagIDs, RoomUpdateCause, type TagID } from "./models"; +import { + type IListOrderingMap, + type ITagMap, + type ITagSortingMap, + ListAlgorithm, + SortAlgorithm, +} from "./algorithms/models"; +import { type ActionPayload } from "../../dispatcher/payloads"; +import defaultDispatcher, { type MatrixDispatcher } from "../../dispatcher/dispatcher"; import { readReceiptChangeIsFor } from "../../utils/read-receipts"; -import { FILTER_CHANGED, IFilterCondition } from "./filters/IFilterCondition"; +import { FILTER_CHANGED, type IFilterCondition } from "./filters/IFilterCondition"; import { Algorithm, LIST_UPDATED_EVENT } from "./algorithms/Algorithm"; import { EffectiveMembership, getEffectiveMembership, getEffectiveMembershipTag } from "../../utils/membership"; import RoomListLayoutStore from "./RoomListLayoutStore"; @@ -25,8 +31,8 @@ import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import { RoomNotificationStateStore } from "../notifications/RoomNotificationStateStore"; import { VisibilityProvider } from "./filters/VisibilityProvider"; import { SpaceWatcher } from "./SpaceWatcher"; -import { IRoomTimelineActionPayload } from "../../actions/MatrixActionCreators"; -import { RoomListStore as Interface, RoomListStoreEvent } from "./Interface"; +import { type IRoomTimelineActionPayload } from "../../actions/MatrixActionCreators"; +import { type RoomListStore as Interface, RoomListStoreEvent } from "./Interface"; import { SlidingRoomListStoreClass } from "./SlidingRoomListStore"; import { UPDATE_EVENT } from "../AsyncStore"; import { SdkContextClass } from "../../contexts/SDKContext"; diff --git a/src/stores/room-list/SlidingRoomListStore.ts b/src/stores/room-list/SlidingRoomListStore.ts index 626ac5dc6a..b7ff70c671 100644 --- a/src/stores/room-list/SlidingRoomListStore.ts +++ b/src/stores/room-list/SlidingRoomListStore.ts @@ -6,22 +6,22 @@ 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 { EmptyObject, Room } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject, type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { MSC3575Filter, SlidingSyncEvent } from "matrix-js-sdk/src/sliding-sync"; -import { Optional } from "matrix-events-sdk"; +import { type MSC3575Filter, SlidingSyncEvent } from "matrix-js-sdk/src/sliding-sync"; +import { type Optional } from "matrix-events-sdk"; -import { RoomUpdateCause, TagID, OrderedDefaultTagIDs, DefaultTagID } from "./models"; -import { ITagMap, ListAlgorithm, SortAlgorithm } from "./algorithms/models"; -import { ActionPayload } from "../../dispatcher/payloads"; -import { MatrixDispatcher } from "../../dispatcher/dispatcher"; -import { IFilterCondition } from "./filters/IFilterCondition"; +import { type RoomUpdateCause, type TagID, OrderedDefaultTagIDs, DefaultTagID } from "./models"; +import { type ITagMap, ListAlgorithm, SortAlgorithm } from "./algorithms/models"; +import { type ActionPayload } from "../../dispatcher/payloads"; +import { type MatrixDispatcher } from "../../dispatcher/dispatcher"; +import { type IFilterCondition } from "./filters/IFilterCondition"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; -import { RoomListStore as Interface, RoomListStoreEvent } from "./Interface"; -import { MetaSpace, SpaceKey, UPDATE_SELECTED_SPACE } from "../spaces"; +import { type RoomListStore as Interface, RoomListStoreEvent } from "./Interface"; +import { MetaSpace, type SpaceKey, UPDATE_SELECTED_SPACE } from "../spaces"; import { LISTS_LOADING_EVENT } from "./RoomListStore"; import { UPDATE_EVENT } from "../AsyncStore"; -import { SdkContextClass } from "../../contexts/SDKContext"; +import { type SdkContextClass } from "../../contexts/SDKContext"; export const SlidingSyncSortToFilter: Record = { [SortAlgorithm.Alphabetic]: ["by_name", "by_recency"], diff --git a/src/stores/room-list/SpaceWatcher.ts b/src/stores/room-list/SpaceWatcher.ts index 1757637c70..83d2b1a5db 100644 --- a/src/stores/room-list/SpaceWatcher.ts +++ b/src/stores/room-list/SpaceWatcher.ts @@ -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 { RoomListStore as Interface } from "./Interface"; +import { type RoomListStore as Interface } from "./Interface"; import { SpaceFilterCondition } from "./filters/SpaceFilterCondition"; import SpaceStore from "../spaces/SpaceStore"; -import { MetaSpace, SpaceKey, UPDATE_HOME_BEHAVIOUR, UPDATE_SELECTED_SPACE } from "../spaces"; +import { MetaSpace, type SpaceKey, UPDATE_HOME_BEHAVIOUR, UPDATE_SELECTED_SPACE } from "../spaces"; /** * Watches for changes in spaces to manage the filter on the provided RoomListStore diff --git a/src/stores/room-list/algorithms/Algorithm.ts b/src/stores/room-list/algorithms/Algorithm.ts index 2ae3a1ff99..5419a6e47c 100644 --- a/src/stores/room-list/algorithms/Algorithm.ts +++ b/src/stores/room-list/algorithms/Algorithm.ts @@ -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 { JoinRule, Room } from "matrix-js-sdk/src/matrix"; +import { JoinRule, type Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { isNullOrUndefined } from "matrix-js-sdk/src/utils"; import { EventEmitter } from "events"; @@ -14,14 +14,14 @@ import { logger } from "matrix-js-sdk/src/logger"; import DMRoomMap from "../../../utils/DMRoomMap"; import { arrayDiff, arrayHasDiff } from "../../../utils/arrays"; -import { DefaultTagID, RoomUpdateCause, TagID } from "../models"; +import { DefaultTagID, RoomUpdateCause, type TagID } from "../models"; import { - IListOrderingMap, - IOrderingAlgorithmMap, - ITagMap, - ITagSortingMap, - ListAlgorithm, - SortAlgorithm, + type IListOrderingMap, + type IOrderingAlgorithmMap, + type ITagMap, + type ITagSortingMap, + type ListAlgorithm, + type SortAlgorithm, } from "./models"; import { EffectiveMembership, @@ -29,7 +29,7 @@ import { getEffectiveMembershipTag, splitRoomsByMembership, } from "../../../utils/membership"; -import { OrderingAlgorithm } from "./list-ordering/OrderingAlgorithm"; +import { type OrderingAlgorithm } from "./list-ordering/OrderingAlgorithm"; import { getListAlgorithmInstance } from "./list-ordering"; import { VisibilityProvider } from "../filters/VisibilityProvider"; import { CallStore, CallStoreEvent } from "../../CallStore"; diff --git a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts index 492e9ed4e7..5bd26c273f 100644 --- a/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/ImportanceAlgorithm.ts @@ -7,10 +7,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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { RoomUpdateCause, TagID } from "../../models"; +import { RoomUpdateCause, type TagID } from "../../models"; import { SortAlgorithm } from "../models"; import { sortRoomsWithAlgorithm } from "../tag-sorting"; import { OrderingAlgorithm } from "./OrderingAlgorithm"; diff --git a/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts index f44b0e1aec..08014822ea 100644 --- a/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/NaturalAlgorithm.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { SortAlgorithm } from "../models"; +import { type SortAlgorithm } from "../models"; import { sortRoomsWithAlgorithm } from "../tag-sorting"; import { OrderingAlgorithm } from "./OrderingAlgorithm"; -import { RoomUpdateCause, TagID } from "../../models"; +import { RoomUpdateCause, type TagID } from "../../models"; import { RoomNotificationStateStore } from "../../../notifications/RoomNotificationStateStore"; type NaturalCategorizedRoomMap = { diff --git a/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts b/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts index 5cf7631cfe..0f95fe78c2 100644 --- a/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts +++ b/src/stores/room-list/algorithms/list-ordering/OrderingAlgorithm.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { RoomUpdateCause, TagID } from "../../models"; +import { type RoomUpdateCause, type TagID } from "../../models"; import { SortAlgorithm } from "../models"; /** diff --git a/src/stores/room-list/algorithms/list-ordering/index.ts b/src/stores/room-list/algorithms/list-ordering/index.ts index aae3242a09..c492ddf4a9 100644 --- a/src/stores/room-list/algorithms/list-ordering/index.ts +++ b/src/stores/room-list/algorithms/list-ordering/index.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { ImportanceAlgorithm } from "./ImportanceAlgorithm"; -import { ListAlgorithm, SortAlgorithm } from "../models"; +import { ListAlgorithm, type SortAlgorithm } from "../models"; import { NaturalAlgorithm } from "./NaturalAlgorithm"; -import { TagID } from "../../models"; -import { OrderingAlgorithm } from "./OrderingAlgorithm"; +import { type TagID } from "../../models"; +import { type OrderingAlgorithm } from "./OrderingAlgorithm"; interface AlgorithmFactory { (tagId: TagID, initialSortingAlgorithm: SortAlgorithm): OrderingAlgorithm; diff --git a/src/stores/room-list/algorithms/models.ts b/src/stores/room-list/algorithms/models.ts index 7cc9bd1c17..710c4f15a8 100644 --- a/src/stores/room-list/algorithms/models.ts +++ b/src/stores/room-list/algorithms/models.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { TagID } from "../models"; -import { OrderingAlgorithm } from "./list-ordering/OrderingAlgorithm"; +import { type TagID } from "../models"; +import { type OrderingAlgorithm } from "./list-ordering/OrderingAlgorithm"; export enum SortAlgorithm { Manual = "MANUAL", diff --git a/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts index 77f530bad4..759d578c96 100644 --- a/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/AlphabeticAlgorithm.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { TagID } from "../../models"; -import { IAlgorithm } from "./IAlgorithm"; +import { type TagID } from "../../models"; +import { type IAlgorithm } from "./IAlgorithm"; /** * Sorts rooms according to the browser's determination of alphabetic. diff --git a/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts index eea3db1db3..cc0d0b5cc7 100644 --- a/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/IAlgorithm.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { TagID } from "../../models"; +import { type TagID } from "../../models"; /** * Represents a tag sorting algorithm. diff --git a/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts index 7dd2869506..b880b6baaf 100644 --- a/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/ManualAlgorithm.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { TagID } from "../../models"; -import { IAlgorithm } from "./IAlgorithm"; +import { type TagID } from "../../models"; +import { type IAlgorithm } from "./IAlgorithm"; /** * Sorts rooms according to the tag's `order` property on the room. diff --git a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts index 2c6375e7df..78afecc0e6 100644 --- a/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts +++ b/src/stores/room-list/algorithms/tag-sorting/RecentAlgorithm.ts @@ -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 { Room, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { type Room, type MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; -import { TagID } from "../../models"; -import { IAlgorithm } from "./IAlgorithm"; +import { type TagID } from "../../models"; +import { type IAlgorithm } from "./IAlgorithm"; import { MatrixClientPeg } from "../../../../MatrixClientPeg"; import * as Unread from "../../../../Unread"; import { EffectiveMembership, getEffectiveMembership } from "../../../../utils/membership"; diff --git a/src/stores/room-list/algorithms/tag-sorting/index.ts b/src/stores/room-list/algorithms/tag-sorting/index.ts index 912ae5d167..bd728c821b 100644 --- a/src/stores/room-list/algorithms/tag-sorting/index.ts +++ b/src/stores/room-list/algorithms/tag-sorting/index.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { SortAlgorithm } from "../models"; import { ManualAlgorithm } from "./ManualAlgorithm"; -import { IAlgorithm } from "./IAlgorithm"; -import { TagID } from "../../models"; +import { type IAlgorithm } from "./IAlgorithm"; +import { type TagID } from "../../models"; import { RecentAlgorithm } from "./RecentAlgorithm"; import { AlphabeticAlgorithm } from "./AlphabeticAlgorithm"; diff --git a/src/stores/room-list/filters/IFilterCondition.ts b/src/stores/room-list/filters/IFilterCondition.ts index 00248ff740..8dd77fd4b9 100644 --- a/src/stores/room-list/filters/IFilterCondition.ts +++ b/src/stores/room-list/filters/IFilterCondition.ts @@ -6,8 +6,8 @@ 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 { Room } from "matrix-js-sdk/src/matrix"; -import { EventEmitter } from "events"; +import { type Room } from "matrix-js-sdk/src/matrix"; +import { type EventEmitter } from "events"; export const FILTER_CHANGED = "filter_changed"; diff --git a/src/stores/room-list/filters/SpaceFilterCondition.ts b/src/stores/room-list/filters/SpaceFilterCondition.ts index 7c4316ff21..02e20e9103 100644 --- a/src/stores/room-list/filters/SpaceFilterCondition.ts +++ b/src/stores/room-list/filters/SpaceFilterCondition.ts @@ -7,12 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import { EventEmitter } from "events"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; -import { FILTER_CHANGED, IFilterCondition } from "./IFilterCondition"; -import { IDestroyable } from "../../../utils/IDestroyable"; +import { FILTER_CHANGED, type IFilterCondition } from "./IFilterCondition"; +import { type IDestroyable } from "../../../utils/IDestroyable"; import SpaceStore from "../../spaces/SpaceStore"; -import { isMetaSpace, MetaSpace, SpaceKey } from "../../spaces"; +import { isMetaSpace, MetaSpace, type SpaceKey } from "../../spaces"; import { setHasDiff } from "../../../utils/sets"; import SettingsStore from "../../../settings/SettingsStore"; diff --git a/src/stores/room-list/filters/VisibilityProvider.ts b/src/stores/room-list/filters/VisibilityProvider.ts index 4332ba0f98..f6b0acb030 100644 --- a/src/stores/room-list/filters/VisibilityProvider.ts +++ b/src/stores/room-list/filters/VisibilityProvider.ts @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import LegacyCallHandler from "../../../LegacyCallHandler"; import { RoomListCustomisations } from "../../../customisations/RoomList"; diff --git a/src/stores/room-list/previews/IPreview.ts b/src/stores/room-list/previews/IPreview.ts index 6defb8bfd8..bdc5912821 100644 --- a/src/stores/room-list/previews/IPreview.ts +++ b/src/stores/room-list/previews/IPreview.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { TagID } from "../models"; +import { type TagID } from "../models"; /** * Represents an event preview. diff --git a/src/stores/room-list/previews/LegacyCallAnswerEventPreview.ts b/src/stores/room-list/previews/LegacyCallAnswerEventPreview.ts index eaf2de5e16..8dda1f64bb 100644 --- a/src/stores/room-list/previews/LegacyCallAnswerEventPreview.ts +++ b/src/stores/room-list/previews/LegacyCallAnswerEventPreview.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { IPreview } from "./IPreview"; -import { TagID } from "../models"; +import { type IPreview } from "./IPreview"; +import { type TagID } from "../models"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/LegacyCallHangupEvent.ts b/src/stores/room-list/previews/LegacyCallHangupEvent.ts index 58487db650..3088c9590c 100644 --- a/src/stores/room-list/previews/LegacyCallHangupEvent.ts +++ b/src/stores/room-list/previews/LegacyCallHangupEvent.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { IPreview } from "./IPreview"; -import { TagID } from "../models"; +import { type IPreview } from "./IPreview"; +import { type TagID } from "../models"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/LegacyCallInviteEventPreview.ts b/src/stores/room-list/previews/LegacyCallInviteEventPreview.ts index 4b3d20e6db..14ff23456e 100644 --- a/src/stores/room-list/previews/LegacyCallInviteEventPreview.ts +++ b/src/stores/room-list/previews/LegacyCallInviteEventPreview.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { IPreview } from "./IPreview"; -import { TagID } from "../models"; +import { type IPreview } from "./IPreview"; +import { type TagID } from "../models"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/MessageEventPreview.ts b/src/stores/room-list/previews/MessageEventPreview.ts index fe63ee1c1b..cf69e6903d 100644 --- a/src/stores/room-list/previews/MessageEventPreview.ts +++ b/src/stores/room-list/previews/MessageEventPreview.ts @@ -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 { MatrixEvent, MsgType, RelationType } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, MsgType, RelationType } from "matrix-js-sdk/src/matrix"; -import { IPreview } from "./IPreview"; -import { TagID } from "../models"; +import { type IPreview } from "./IPreview"; +import { type TagID } from "../models"; import { _t, sanitizeForTranslation } from "../../../languageHandler"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { getHtmlText } from "../../../HtmlUtils"; diff --git a/src/stores/room-list/previews/PollStartEventPreview.ts b/src/stores/room-list/previews/PollStartEventPreview.ts index 09679335c4..d614e736a3 100644 --- a/src/stores/room-list/previews/PollStartEventPreview.ts +++ b/src/stores/room-list/previews/PollStartEventPreview.ts @@ -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 { MatrixEvent, PollStartEventContent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type PollStartEventContent } from "matrix-js-sdk/src/matrix"; import { InvalidEventError } from "matrix-js-sdk/src/extensible_events_v1/InvalidEventError"; import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; -import { IPreview } from "./IPreview"; -import { TagID } from "../models"; +import { type IPreview } from "./IPreview"; +import { type TagID } from "../models"; import { _t, sanitizeForTranslation } from "../../../languageHandler"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; diff --git a/src/stores/room-list/previews/ReactionEventPreview.ts b/src/stores/room-list/previews/ReactionEventPreview.ts index cee18dda2b..15cb0c3489 100644 --- a/src/stores/room-list/previews/ReactionEventPreview.ts +++ b/src/stores/room-list/previews/ReactionEventPreview.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { IPreview } from "./IPreview"; -import { TagID } from "../models"; +import { type IPreview } from "./IPreview"; +import { type TagID } from "../models"; import { getSenderName, isSelf } from "./utils"; import { _t } from "../../../languageHandler"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; diff --git a/src/stores/room-list/previews/StickerEventPreview.ts b/src/stores/room-list/previews/StickerEventPreview.ts index a368e675e3..701b97ffc8 100644 --- a/src/stores/room-list/previews/StickerEventPreview.ts +++ b/src/stores/room-list/previews/StickerEventPreview.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { IPreview } from "./IPreview"; -import { TagID } from "../models"; +import { type IPreview } from "./IPreview"; +import { type TagID } from "../models"; import { getSenderName, isSelf, shouldPrefixMessagesIn } from "./utils"; import { _t } from "../../../languageHandler"; diff --git a/src/stores/room-list/previews/utils.ts b/src/stores/room-list/previews/utils.ts index ffb1602829..d9ce0512de 100644 --- a/src/stores/room-list/previews/utils.ts +++ b/src/stores/room-list/previews/utils.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../../MatrixClientPeg"; -import { DefaultTagID, TagID } from "../models"; +import { DefaultTagID, type TagID } from "../models"; export function isSelf(event: MatrixEvent): boolean { const selfUserId = MatrixClientPeg.safeGet().getSafeUserId(); diff --git a/src/stores/room-list/utils/roomMute.ts b/src/stores/room-list/utils/roomMute.ts index df3dbb5914..47135edcba 100644 --- a/src/stores/room-list/utils/roomMute.ts +++ b/src/stores/room-list/utils/roomMute.ts @@ -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 { MatrixEvent, EventType, IPushRules } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, EventType, type IPushRules } from "matrix-js-sdk/src/matrix"; -import { ActionPayload } from "../../../dispatcher/payloads"; +import { type ActionPayload } from "../../../dispatcher/payloads"; import { isRuleMaybeRoomMuteRule } from "../../../RoomNotifs"; import { arrayDiff } from "../../../utils/arrays"; diff --git a/src/stores/spaces/SpaceStore.ts b/src/stores/spaces/SpaceStore.ts index 9ee877ec3f..2a2e8f0894 100644 --- a/src/stores/spaces/SpaceStore.ts +++ b/src/stores/spaces/SpaceStore.ts @@ -6,18 +6,18 @@ 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 { ListIteratee, Many, sortBy } from "lodash"; +import { type ListIteratee, type Many, sortBy } from "lodash"; import { EventType, RoomType, - Room, + type Room, RoomEvent, - RoomMember, + type RoomMember, RoomStateEvent, - MatrixEvent, + type MatrixEvent, ClientEvent, - ISendEventResponse, - EmptyObject, + type ISendEventResponse, + type EmptyObject, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; @@ -27,7 +27,7 @@ import defaultDispatcher from "../../dispatcher/dispatcher"; import RoomListStore from "../room-list/RoomListStore"; import SettingsStore from "../../settings/SettingsStore"; import DMRoomMap from "../../utils/DMRoomMap"; -import { FetchRoomFn } from "../notifications/ListNotificationState"; +import { type FetchRoomFn } from "../notifications/ListNotificationState"; import { SpaceNotificationState } from "../notifications/SpaceNotificationState"; import { RoomNotificationStateStore } from "../notifications/RoomNotificationStateStore"; import { DefaultTagID } from "../room-list/models"; @@ -37,12 +37,12 @@ import { Action } from "../../dispatcher/actions"; import { arrayHasDiff, arrayHasOrderChange, filterBoolean } from "../../utils/arrays"; import { reorderLexicographically } from "../../utils/stringOrderField"; import { TAG_ORDER } from "../../components/views/rooms/RoomList"; -import { SettingUpdatedPayload } from "../../dispatcher/payloads/SettingUpdatedPayload"; +import { type SettingUpdatedPayload } from "../../dispatcher/payloads/SettingUpdatedPayload"; import { isMetaSpace, - ISuggestedRoom, + type ISuggestedRoom, MetaSpace, - SpaceKey, + type SpaceKey, UPDATE_HOME_BEHAVIOUR, UPDATE_INVITED_SPACES, UPDATE_SELECTED_SPACE, @@ -53,15 +53,15 @@ import { getCachedRoomIDForAlias } from "../../RoomAliasCache"; import { EffectiveMembership, getEffectiveMembership } from "../../utils/membership"; import { flattenSpaceHierarchyWithCache, - SpaceEntityMap, - SpaceDescendantMap, + type SpaceEntityMap, + type SpaceDescendantMap, flattenSpaceHierarchy, } from "./flattenSpaceHierarchy"; import { PosthogAnalytics } from "../../PosthogAnalytics"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; -import { ViewHomePagePayload } from "../../dispatcher/payloads/ViewHomePagePayload"; -import { SwitchSpacePayload } from "../../dispatcher/payloads/SwitchSpacePayload"; -import { AfterLeaveRoomPayload } from "../../dispatcher/payloads/AfterLeaveRoomPayload"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewHomePagePayload } from "../../dispatcher/payloads/ViewHomePagePayload"; +import { type SwitchSpacePayload } from "../../dispatcher/payloads/SwitchSpacePayload"; +import { type AfterLeaveRoomPayload } from "../../dispatcher/payloads/AfterLeaveRoomPayload"; import { SdkContextClass } from "../../contexts/SDKContext"; const ACTIVE_SPACE_LS_KEY = "mx_active_space"; diff --git a/src/stores/spaces/flattenSpaceHierarchy.ts b/src/stores/spaces/flattenSpaceHierarchy.ts index 15d583617d..ca393d841b 100644 --- a/src/stores/spaces/flattenSpaceHierarchy.ts +++ b/src/stores/spaces/flattenSpaceHierarchy.ts @@ -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 { SpaceKey } from "."; +import { type SpaceKey } from "."; export type SpaceEntityMap = Map>; export type SpaceDescendantMap = Map>; diff --git a/src/stores/spaces/index.ts b/src/stores/spaces/index.ts index b8853d606e..e1ded5a16a 100644 --- a/src/stores/spaces/index.ts +++ b/src/stores/spaces/index.ts @@ -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 { Room, HierarchyRoom } from "matrix-js-sdk/src/matrix"; +import { type Room, type HierarchyRoom } from "matrix-js-sdk/src/matrix"; import { _t } from "../../languageHandler"; diff --git a/src/stores/widgets/ElementWidgetActions.ts b/src/stores/widgets/ElementWidgetActions.ts index 8e4142f77d..be887c88cd 100644 --- a/src/stores/widgets/ElementWidgetActions.ts +++ b/src/stores/widgets/ElementWidgetActions.ts @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { IWidgetApiRequest } from "matrix-widget-api"; +import { type IWidgetApiRequest } from "matrix-widget-api"; export enum ElementWidgetActions { // All of these actions are currently specific to Jitsi and Element Call diff --git a/src/stores/widgets/StopGapWidget.ts b/src/stores/widgets/StopGapWidget.ts index 6f3d554c11..672c1b27b4 100644 --- a/src/stores/widgets/StopGapWidget.ts +++ b/src/stores/widgets/StopGapWidget.ts @@ -7,26 +7,26 @@ */ import { - Room, - MatrixEvent, + type Room, + type MatrixEvent, MatrixEventEvent, - MatrixClient, + type MatrixClient, ClientEvent, RoomStateEvent, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { ClientWidgetApi, - IModalWidgetOpenRequest, - IRoomEvent, - IStickerActionRequest, - IStickyActionRequest, - ITemplateParams, - IWidget, - IWidgetApiErrorResponseData, - IWidgetApiRequest, - IWidgetApiRequestEmptyData, - IWidgetData, + type IModalWidgetOpenRequest, + type IRoomEvent, + type IStickerActionRequest, + type IStickyActionRequest, + type ITemplateParams, + type IWidget, + type IWidgetApiErrorResponseData, + type IWidgetApiRequest, + type IWidgetApiRequestEmptyData, + type IWidgetData, MatrixCapabilities, runTemplate, Widget, @@ -48,16 +48,16 @@ import ActiveWidgetStore from "../ActiveWidgetStore"; import { objectShallowClone } from "../../utils/objects"; import defaultDispatcher from "../../dispatcher/dispatcher"; import { Action } from "../../dispatcher/actions"; -import { ElementWidgetActions, IHangupCallApiRequest, IViewRoomApiRequest } from "./ElementWidgetActions"; +import { ElementWidgetActions, type IHangupCallApiRequest, type IViewRoomApiRequest } from "./ElementWidgetActions"; import { ModalWidgetStore } from "../ModalWidgetStore"; -import { IApp, isAppWidget } from "../WidgetStore"; +import { type IApp, isAppWidget } from "../WidgetStore"; import ThemeWatcher, { ThemeWatcherEvent } from "../../settings/watchers/ThemeWatcher"; import { getCustomTheme } from "../../theme"; import { ElementWidgetCapabilities } from "./ElementWidgetCapabilities"; import { ELEMENT_CLIENT_ID } from "../../identifiers"; import { WidgetVariableCustomisations } from "../../customisations/WidgetVariables"; import { arrayFastClone } from "../../utils/arrays"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; import Modal from "../../Modal"; import ErrorDialog from "../../components/views/dialogs/ErrorDialog"; import { SdkContextClass } from "../../contexts/SDKContext"; diff --git a/src/stores/widgets/StopGapWidgetDriver.ts b/src/stores/widgets/StopGapWidgetDriver.ts index 4eb5aaf654..988cbae8f8 100644 --- a/src/stores/widgets/StopGapWidgetDriver.ts +++ b/src/stores/widgets/StopGapWidgetDriver.ts @@ -7,44 +7,44 @@ */ import { - Capability, + type Capability, EventDirection, - IOpenIDCredentials, - IOpenIDUpdate, - ISendDelayedEventDetails, - ISendEventDetails, - ITurnServer, - IReadEventRelationsResult, - IRoomEvent, + type IOpenIDCredentials, + type IOpenIDUpdate, + type ISendDelayedEventDetails, + type ISendEventDetails, + type ITurnServer, + type IReadEventRelationsResult, + type IRoomEvent, MatrixCapabilities, OpenIDRequestState, - SimpleObservable, - Widget, + type SimpleObservable, + type Widget, WidgetDriver, WidgetEventCapability, WidgetKind, - IWidgetApiErrorResponseDataDetails, - ISearchUserDirectoryResult, - IGetMediaConfigResult, - UpdateDelayedEventAction, + type IWidgetApiErrorResponseDataDetails, + type ISearchUserDirectoryResult, + type IGetMediaConfigResult, + type UpdateDelayedEventAction, } from "matrix-widget-api"; import { ClientEvent, - ITurnServer as IClientTurnServer, + type ITurnServer as IClientTurnServer, EventType, - IContent, + type IContent, MatrixError, - MatrixEvent, + type MatrixEvent, Direction, THREAD_RELATION_TYPE, - SendDelayedEventResponse, - StateEvents, - TimelineEvents, + type SendDelayedEventResponse, + type StateEvents, + type TimelineEvents, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { - ApprovalOpts, - CapabilitiesOpts, + type ApprovalOpts, + type CapabilitiesOpts, WidgetLifecycle, } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WidgetLifecycle"; diff --git a/src/stores/widgets/WidgetLayoutStore.ts b/src/stores/widgets/WidgetLayoutStore.ts index 5e587c5487..eaea0957b0 100644 --- a/src/stores/widgets/WidgetLayoutStore.ts +++ b/src/stores/widgets/WidgetLayoutStore.ts @@ -6,13 +6,13 @@ * Please see LICENSE files in the repository root for full details. */ -import { Room, RoomStateEvent, MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { Optional } from "matrix-events-sdk"; +import { type Room, RoomStateEvent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type Optional } from "matrix-events-sdk"; import { MapWithDefault, recursiveMapToObject } from "matrix-js-sdk/src/utils"; -import { IWidget } from "matrix-widget-api"; +import { type IWidget } from "matrix-widget-api"; import SettingsStore from "../../settings/SettingsStore"; -import WidgetStore, { IApp } from "../WidgetStore"; +import WidgetStore, { type IApp } from "../WidgetStore"; import { WidgetType } from "../../widgets/WidgetType"; import { clamp, defaultNumber, sum } from "../../utils/numbers"; import defaultDispatcher from "../../dispatcher/dispatcher"; @@ -20,7 +20,13 @@ import { ReadyWatchingStore } from "../ReadyWatchingStore"; import { SettingLevel } from "../../settings/SettingLevel"; import { arrayFastClone } from "../../utils/arrays"; import { UPDATE_EVENT } from "../AsyncStore"; -import { Container, IStoredLayout, ILayoutStateEvent, WIDGET_LAYOUT_EVENT_TYPE, IWidgetLayouts } from "./types"; +import { + Container, + type IStoredLayout, + type ILayoutStateEvent, + WIDGET_LAYOUT_EVENT_TYPE, + type IWidgetLayouts, +} from "./types"; export type { IStoredLayout, ILayoutStateEvent }; export { Container, WIDGET_LAYOUT_EVENT_TYPE }; diff --git a/src/stores/widgets/WidgetMessagingStore.ts b/src/stores/widgets/WidgetMessagingStore.ts index d42c499226..e8210317ce 100644 --- a/src/stores/widgets/WidgetMessagingStore.ts +++ b/src/stores/widgets/WidgetMessagingStore.ts @@ -6,12 +6,12 @@ * Please see LICENSE files in the repository root for full details. */ -import { ClientWidgetApi, Widget } from "matrix-widget-api"; -import { EmptyObject } from "matrix-js-sdk/src/matrix"; +import { type ClientWidgetApi, type Widget } from "matrix-widget-api"; +import { type EmptyObject } from "matrix-js-sdk/src/matrix"; import { AsyncStoreWithClient } from "../AsyncStoreWithClient"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { EnhancedMap } from "../../utils/maps"; import WidgetUtils from "../../utils/WidgetUtils"; diff --git a/src/stores/widgets/WidgetPermissionStore.ts b/src/stores/widgets/WidgetPermissionStore.ts index 482704b65f..75f491fcf5 100644 --- a/src/stores/widgets/WidgetPermissionStore.ts +++ b/src/stores/widgets/WidgetPermissionStore.ts @@ -6,11 +6,11 @@ * Please see LICENSE files in the repository root for full details. */ -import { Widget, WidgetKind } from "matrix-widget-api"; +import { type Widget, WidgetKind } from "matrix-widget-api"; import SettingsStore from "../../settings/SettingsStore"; import { SettingLevel } from "../../settings/SettingLevel"; -import { SdkContextClass } from "../../contexts/SDKContext"; +import { type SdkContextClass } from "../../contexts/SDKContext"; export enum OIDCState { Allowed, // user has set the remembered value as allowed diff --git a/src/toasts/IncomingCallToast.tsx b/src/toasts/IncomingCallToast.tsx index 197c70186c..d427ca7abc 100644 --- a/src/toasts/IncomingCallToast.tsx +++ b/src/toasts/IncomingCallToast.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { useCallback, useEffect, useState } from "react"; -import { MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type RoomMember } from "matrix-js-sdk/src/matrix"; import { Button, Tooltip, TooltipProvider } from "@vector-im/compound-web"; import VideoCallIcon from "@vector-im/compound-design-tokens/assets/web/icons/video-call-solid"; @@ -15,7 +15,7 @@ import { _t } from "../languageHandler"; import RoomAvatar from "../components/views/avatars/RoomAvatar"; import { MatrixClientPeg } from "../MatrixClientPeg"; import defaultDispatcher from "../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../dispatcher/actions"; import ToastStore from "../stores/ToastStore"; import { @@ -24,10 +24,10 @@ import { LiveContentType, } from "../components/views/rooms/LiveContentSummary"; import { useCall, useJoinCallButtonDisabledTooltip } from "../hooks/useCall"; -import AccessibleButton, { ButtonEvent } from "../components/views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../components/views/elements/AccessibleButton"; import { useDispatcher } from "../hooks/useDispatcher"; -import { ActionPayload } from "../dispatcher/payloads"; -import { Call, CallEvent } from "../models/Call"; +import { type ActionPayload } from "../dispatcher/payloads"; +import { type Call, CallEvent } from "../models/Call"; import LegacyCallHandler, { AudioID } from "../LegacyCallHandler"; import { useEventEmitter } from "../hooks/useEventEmitter"; import { CallStore, CallStoreEvent } from "../stores/CallStore"; diff --git a/src/toasts/IncomingLegacyCallToast.tsx b/src/toasts/IncomingLegacyCallToast.tsx index a8e9668198..18c3f9f506 100644 --- a/src/toasts/IncomingLegacyCallToast.tsx +++ b/src/toasts/IncomingLegacyCallToast.tsx @@ -10,14 +10,14 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { CallType, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { CallType, type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import classNames from "classnames"; import LegacyCallHandler, { LegacyCallHandlerEvent } from "../LegacyCallHandler"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { _t } from "../languageHandler"; import RoomAvatar from "../components/views/avatars/RoomAvatar"; -import AccessibleButton, { ButtonEvent } from "../components/views/elements/AccessibleButton"; +import AccessibleButton, { type ButtonEvent } from "../components/views/elements/AccessibleButton"; export const getIncomingLegacyCallToastKey = (callId: string): string => `call_${callId}`; diff --git a/src/toasts/SetupEncryptionToast.ts b/src/toasts/SetupEncryptionToast.ts index 8d321a16eb..2545aa6ff2 100644 --- a/src/toasts/SetupEncryptionToast.ts +++ b/src/toasts/SetupEncryptionToast.ts @@ -16,7 +16,7 @@ import GenericToast from "../components/views/toasts/GenericToast"; import { ModuleRunner } from "../modules/ModuleRunner"; import { SetupEncryptionStore } from "../stores/SetupEncryptionStore"; import Spinner from "../components/views/elements/Spinner"; -import { OpenToTabPayload } from "../dispatcher/payloads/OpenToTabPayload"; +import { type OpenToTabPayload } from "../dispatcher/payloads/OpenToTabPayload"; import { Action } from "../dispatcher/actions"; import { UserTab } from "../components/views/dialogs/UserTab"; import defaultDispatcher from "../dispatcher/dispatcher"; diff --git a/src/utils/AutoDiscoveryUtils.tsx b/src/utils/AutoDiscoveryUtils.tsx index a9dd44e2c3..e5359c48f8 100644 --- a/src/utils/AutoDiscoveryUtils.tsx +++ b/src/utils/AutoDiscoveryUtils.tsx @@ -6,21 +6,21 @@ 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, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { AutoDiscovery, AutoDiscoveryError, - ClientConfig, - IClientWellKnown, + type ClientConfig, + type IClientWellKnown, MatrixClient, MatrixError, - OidcClientConfig, + type OidcClientConfig, } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { _t, _td, TranslationKey, UserFriendlyError } from "../languageHandler"; +import { _t, _td, type TranslationKey, UserFriendlyError } from "../languageHandler"; import SdkConfig from "../SdkConfig"; -import { ValidatedServerConfig } from "./ValidatedServerConfig"; +import { type ValidatedServerConfig } from "./ValidatedServerConfig"; const LIVELINESS_DISCOVERY_ERRORS: AutoDiscoveryError[] = [ AutoDiscovery.ERROR_INVALID_HOMESERVER, diff --git a/src/utils/BrowserWorkarounds.ts b/src/utils/BrowserWorkarounds.ts index 8a83d67d03..de10e90eec 100644 --- a/src/utils/BrowserWorkarounds.ts +++ b/src/utils/BrowserWorkarounds.ts @@ -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 { MouseEvent } from "react"; +import { type MouseEvent } from "react"; export function chromeFileInputFix(event: MouseEvent): void { // Workaround for Chromium Bug diff --git a/src/utils/DMRoomMap.ts b/src/utils/DMRoomMap.ts index 77b4c65545..df1cc2d364 100644 --- a/src/utils/DMRoomMap.ts +++ b/src/utils/DMRoomMap.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { uniq } from "lodash"; -import { Room, MatrixEvent, EventType, ClientEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Room, type MatrixEvent, EventType, ClientEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; -import { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import { filterValidMDirect } from "./dm/filterValidMDirect"; diff --git a/src/utils/DecryptFile.ts b/src/utils/DecryptFile.ts index 25ea583819..baf2acafc1 100644 --- a/src/utils/DecryptFile.ts +++ b/src/utils/DecryptFile.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. // Pull in the encryption lib so that we can decrypt attachments. import encrypt from "matrix-encrypt-attachment"; import { parseErrorResponse } from "matrix-js-sdk/src/matrix"; -import { EncryptedFile, MediaEventInfo } from "matrix-js-sdk/src/types"; +import { type EncryptedFile, type MediaEventInfo } from "matrix-js-sdk/src/types"; import { mediaFromContent } from "../customisations/Media"; import { getBlobSafeMimeType } from "./blobs"; diff --git a/src/utils/DialogOpener.ts b/src/utils/DialogOpener.ts index c7b2212a21..8304d6c2aa 100644 --- a/src/utils/DialogOpener.ts +++ b/src/utils/DialogOpener.ts @@ -7,11 +7,11 @@ Please see LICENSE files in the repository root for full details. */ import classnames from "classnames"; -import { ComponentProps } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type ComponentProps } from "react"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import defaultDispatcher from "../dispatcher/dispatcher"; -import { ActionPayload } from "../dispatcher/payloads"; +import { type ActionPayload } from "../dispatcher/payloads"; import Modal from "../Modal"; import RoomSettingsDialog from "../components/views/dialogs/RoomSettingsDialog"; import ForwardDialog from "../components/views/dialogs/ForwardDialog"; @@ -21,7 +21,7 @@ import SpacePreferencesDialog from "../components/views/dialogs/SpacePreferences import SpaceSettingsDialog from "../components/views/dialogs/SpaceSettingsDialog"; import InviteDialog from "../components/views/dialogs/InviteDialog"; import AddExistingToSpaceDialog from "../components/views/dialogs/AddExistingToSpaceDialog"; -import { ButtonEvent } from "../components/views/elements/AccessibleButton"; +import { type ButtonEvent } from "../components/views/elements/AccessibleButton"; import PosthogTrackers from "../PosthogTrackers"; import { showAddExistingSubspace, showCreateNewRoom } from "./space"; import { SdkContextClass } from "../contexts/SDKContext"; diff --git a/src/utils/DirectoryUtils.ts b/src/utils/DirectoryUtils.ts index ff2407f256..732f5c3cc7 100644 --- a/src/utils/DirectoryUtils.ts +++ b/src/utils/DirectoryUtils.ts @@ -6,6 +6,6 @@ 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 { IProtocol } from "matrix-js-sdk/src/matrix"; +import { type IProtocol } from "matrix-js-sdk/src/matrix"; export type Protocols = Record; diff --git a/src/utils/EditorStateTransfer.ts b/src/utils/EditorStateTransfer.ts index e104a5244c..5766732136 100644 --- a/src/utils/EditorStateTransfer.ts +++ b/src/utils/EditorStateTransfer.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { SerializedPart } from "../editor/parts"; -import DocumentOffset from "../editor/offset"; +import { type SerializedPart } from "../editor/parts"; +import type DocumentOffset from "../editor/offset"; /** * Used while editing, to pass the event, and to preserve editor state diff --git a/src/utils/ErrorUtils.tsx b/src/utils/ErrorUtils.tsx index 997dd56840..38ba489c7f 100644 --- a/src/utils/ErrorUtils.tsx +++ b/src/utils/ErrorUtils.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; import { MatrixError, ConnectionError } from "matrix-js-sdk/src/matrix"; -import { _t, _td, lookupString, Tags, TranslatedString, TranslationKey } from "../languageHandler"; +import { _t, _td, lookupString, type Tags, type TranslatedString, type TranslationKey } from "../languageHandler"; import SdkConfig from "../SdkConfig"; -import { ValidatedServerConfig } from "./ValidatedServerConfig"; +import { type ValidatedServerConfig } from "./ValidatedServerConfig"; import ExternalLink from "../components/views/elements/ExternalLink"; export const resourceLimitStrings = { diff --git a/src/utils/EventRenderingUtils.ts b/src/utils/EventRenderingUtils.ts index 0bef43df12..5ac6629b8b 100644 --- a/src/utils/EventRenderingUtils.ts +++ b/src/utils/EventRenderingUtils.ts @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixEvent, - IContent, - MatrixClient, + type MatrixEvent, + type IContent, + type MatrixClient, EventType, MsgType, M_POLL_END, diff --git a/src/utils/EventUtils.ts b/src/utils/EventUtils.ts index 2ed3bceb0d..9c387b16b0 100644 --- a/src/utils/EventUtils.ts +++ b/src/utils/EventUtils.ts @@ -13,7 +13,7 @@ import { EVENT_VISIBILITY_CHANGE_TYPE, MsgType, RelationType, - MatrixClient, + type MatrixClient, THREAD_RELATION_TYPE, M_POLL_END, M_POLL_START, @@ -23,13 +23,13 @@ import { import { logger } from "matrix-js-sdk/src/logger"; import shouldHideEvent from "../shouldHideEvent"; -import { GetRelationsForEvent } from "../components/views/rooms/EventTile"; +import { type GetRelationsForEvent } from "../components/views/rooms/EventTile"; import SettingsStore from "../settings/SettingsStore"; import defaultDispatcher from "../dispatcher/dispatcher"; -import { TimelineRenderingType } from "../contexts/RoomContext"; +import { type TimelineRenderingType } from "../contexts/RoomContext"; import { launchPollEditor } from "../components/views/messages/MPollBody"; import { Action } from "../dispatcher/actions"; -import { ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; /** * Returns whether an event should allow actions like reply, reactions, edit, etc. diff --git a/src/utils/FileUtils.ts b/src/utils/FileUtils.ts index 6792ad254e..1240dc61db 100644 --- a/src/utils/FileUtils.ts +++ b/src/utils/FileUtils.ts @@ -9,15 +9,15 @@ Please see LICENSE files in the repository root for full details. import { filesize, - FileSizeOptionsArray, - FileSizeOptionsBase, - FileSizeOptionsExponent, - FileSizeOptionsObject, - FileSizeOptionsString, - FileSizeReturnArray, - FileSizeReturnObject, + type FileSizeOptionsArray, + type FileSizeOptionsBase, + type FileSizeOptionsExponent, + type FileSizeOptionsObject, + type FileSizeOptionsString, + type FileSizeReturnArray, + type FileSizeReturnObject, } from "filesize"; -import { MediaEventContent } from "matrix-js-sdk/src/types"; +import { type MediaEventContent } from "matrix-js-sdk/src/types"; import { _t } from "../languageHandler"; diff --git a/src/utils/FormattingUtils.ts b/src/utils/FormattingUtils.ts index ae92cf6104..7e8a1d52a5 100644 --- a/src/utils/FormattingUtils.ts +++ b/src/utils/FormattingUtils.ts @@ -7,7 +7,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 { ReactElement, ReactNode } from "react"; +import { type ReactElement, type ReactNode } from "react"; import { useIdColorHash } from "@vector-im/compound-web"; import { _t, getCurrentLanguage, getUserLanguage } from "../languageHandler"; diff --git a/src/utils/IdentityServerUtils.ts b/src/utils/IdentityServerUtils.ts index aa1153acfd..df4f269c34 100644 --- a/src/utils/IdentityServerUtils.ts +++ b/src/utils/IdentityServerUtils.ts @@ -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 { SERVICE_TYPES, HTTPError, MatrixClient, Terms } from "matrix-js-sdk/src/matrix"; +import { SERVICE_TYPES, HTTPError, type MatrixClient, type Terms } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import SdkConfig from "../SdkConfig"; diff --git a/src/utils/KeyVerificationStateObserver.ts b/src/utils/KeyVerificationStateObserver.ts index 64f50ab201..2dfd78e0a8 100644 --- a/src/utils/KeyVerificationStateObserver.ts +++ b/src/utils/KeyVerificationStateObserver.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { _t } from "../languageHandler"; diff --git a/src/utils/MediaEventHelper.ts b/src/utils/MediaEventHelper.ts index 118b5baadb..25339260f3 100644 --- a/src/utils/MediaEventHelper.ts +++ b/src/utils/MediaEventHelper.ts @@ -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 { MatrixEvent, EventType, MsgType } from "matrix-js-sdk/src/matrix"; -import { FileContent, ImageContent, MediaEventContent } from "matrix-js-sdk/src/types"; +import { type MatrixEvent, EventType, MsgType } from "matrix-js-sdk/src/matrix"; +import { type FileContent, type ImageContent, type MediaEventContent } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import { LazyValue } from "./LazyValue"; -import { Media, mediaFromContent } from "../customisations/Media"; +import { type Media, mediaFromContent } from "../customisations/Media"; import { decryptFile } from "./DecryptFile"; -import { IDestroyable } from "./IDestroyable"; +import { type IDestroyable } from "./IDestroyable"; // TODO: We should consider caching the blobs. https://github.com/vector-im/element-web/issues/17192 diff --git a/src/utils/MessageDiffUtils.tsx b/src/utils/MessageDiffUtils.tsx index 08af2379e6..87d967458f 100644 --- a/src/utils/MessageDiffUtils.tsx +++ b/src/utils/MessageDiffUtils.tsx @@ -9,12 +9,12 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import classNames from "classnames"; import DiffMatchPatch from "diff-match-patch"; -import { DiffDOM, IDiff } from "diff-dom"; -import { IContent } from "matrix-js-sdk/src/matrix"; +import { DiffDOM, type IDiff } from "diff-dom"; +import { type IContent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { unescape } from "lodash"; -import { bodyToHtml, checkBlockNode, EventRenderOpts } from "../HtmlUtils"; +import { bodyToHtml, checkBlockNode, type EventRenderOpts } from "../HtmlUtils"; function textToHtml(text: string): string { const container = document.createElement("div"); diff --git a/src/utils/MultiInviter.ts b/src/utils/MultiInviter.ts index c42284db45..4f5bda879d 100644 --- a/src/utils/MultiInviter.ts +++ b/src/utils/MultiInviter.ts @@ -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 { MatrixError, MatrixClient, EventType, EmptyObject } from "matrix-js-sdk/src/matrix"; +import { MatrixError, type MatrixClient, EventType, type EmptyObject } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import { defer, IDeferred } from "matrix-js-sdk/src/utils"; +import { defer, type IDeferred } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; import { AddressType, getAddressType } from "../UserAddress"; diff --git a/src/utils/NativeEventUtils.ts b/src/utils/NativeEventUtils.ts index eebd2fcb51..d6373a61a2 100644 --- a/src/utils/NativeEventUtils.ts +++ b/src/utils/NativeEventUtils.ts @@ -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 React from "react"; +import type React from "react"; // Wrap DOM event handlers with stopPropagation and preventDefault export const preventDefaultWrapper = diff --git a/src/utils/PasswordScorer.ts b/src/utils/PasswordScorer.ts index 876461920c..b01e5051cf 100644 --- a/src/utils/PasswordScorer.ts +++ b/src/utils/PasswordScorer.ts @@ -5,10 +5,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 { zxcvbn, zxcvbnOptions, ZxcvbnResult, TranslationKeys } from "@zxcvbn-ts/core"; +import { zxcvbn, zxcvbnOptions, type ZxcvbnResult, type TranslationKeys } from "@zxcvbn-ts/core"; import * as zxcvbnCommonPackage from "@zxcvbn-ts/language-common"; import * as zxcvbnEnPackage from "@zxcvbn-ts/language-en"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { _t } from "../languageHandler"; import SdkConfig from "../SdkConfig"; diff --git a/src/utils/PinningUtils.ts b/src/utils/PinningUtils.ts index 40ab66160d..9575e3b767 100644 --- a/src/utils/PinningUtils.ts +++ b/src/utils/PinningUtils.ts @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixEvent, + type MatrixEvent, EventType, M_POLL_START, - MatrixClient, + type MatrixClient, EventTimeline, - Room, - EmptyObject, + type Room, + type EmptyObject, } from "matrix-js-sdk/src/matrix"; import { isContentActionable } from "./EventUtils"; diff --git a/src/utils/ReactUtils.tsx b/src/utils/ReactUtils.tsx index 2180aa81ae..a31f97d1f6 100644 --- a/src/utils/ReactUtils.tsx +++ b/src/utils/ReactUtils.tsx @@ -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 React, { ReactNode } from "react"; +import React, { type ReactNode } from "react"; /** * Joins an array into one value with a joiner. E.g. join(["hello", "world"], " ") -> hello world diff --git a/src/utils/Reply.ts b/src/utils/Reply.ts index fee65a7b55..e5909ffcc0 100644 --- a/src/utils/Reply.ts +++ b/src/utils/Reply.ts @@ -7,7 +7,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { IContent, IEventRelation, MatrixEvent, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix"; +import { type IContent, type IEventRelation, type MatrixEvent, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix"; import sanitizeHtml from "sanitize-html"; import { PERMITTED_URL_SCHEMES } from "./UrlUtils"; diff --git a/src/utils/RoomUpgrade.ts b/src/utils/RoomUpgrade.ts index 8979b1f0c8..aa106f1a1a 100644 --- a/src/utils/RoomUpgrade.ts +++ b/src/utils/RoomUpgrade.ts @@ -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 { Room, EventType, ClientEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Room, EventType, ClientEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import { inviteUsersToRoom } from "../RoomInvite"; -import Modal, { IHandle } from "../Modal"; +import Modal, { type IHandle } from "../Modal"; import { _t } from "../languageHandler"; import ErrorDialog from "../components/views/dialogs/ErrorDialog"; import SpaceStore from "../stores/spaces/SpaceStore"; diff --git a/src/utils/ShieldUtils.ts b/src/utils/ShieldUtils.ts index d1466609e4..7802d51341 100644 --- a/src/utils/ShieldUtils.ts +++ b/src/utils/ShieldUtils.ts @@ -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 { ClientStoppedError, MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { ClientStoppedError, type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import DMRoomMap from "./DMRoomMap"; diff --git a/src/utils/SortMembers.ts b/src/utils/SortMembers.ts index 2c76bb6ed4..65a8f77f2b 100644 --- a/src/utils/SortMembers.ts +++ b/src/utils/SortMembers.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { groupBy, mapValues, maxBy, minBy, sumBy, takeRight } from "lodash"; -import { MatrixClient, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room, type RoomMember } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import { Member } from "./direct-messages"; +import { type Member } from "./direct-messages"; import DMRoomMap from "./DMRoomMap"; export const compareMembers = diff --git a/src/utils/Timer.ts b/src/utils/Timer.ts index ee05e39b34..6b120fa30a 100644 --- a/src/utils/Timer.ts +++ b/src/utils/Timer.ts @@ -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 { IDeferred, defer } from "matrix-js-sdk/src/utils"; +import { type IDeferred, defer } from "matrix-js-sdk/src/utils"; /** A countdown timer, exposing a promise api. diff --git a/src/utils/ValidatedServerConfig.ts b/src/utils/ValidatedServerConfig.ts index a464514317..2e83ba20c5 100644 --- a/src/utils/ValidatedServerConfig.ts +++ b/src/utils/ValidatedServerConfig.ts @@ -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 { OidcClientConfig } from "matrix-js-sdk/src/matrix"; +import { type OidcClientConfig } from "matrix-js-sdk/src/matrix"; export interface ValidatedServerConfig { hsUrl: string; diff --git a/src/utils/WellKnownUtils.ts b/src/utils/WellKnownUtils.ts index 5634a94b59..b2af51e2c3 100644 --- a/src/utils/WellKnownUtils.ts +++ b/src/utils/WellKnownUtils.ts @@ -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 { IClientWellKnown, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type IClientWellKnown, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { UnstableValue } from "matrix-js-sdk/src/NamespacedValue"; const CALL_BEHAVIOUR_WK_KEY = "io.element.call_behaviour"; diff --git a/src/utils/Whenable.ts b/src/utils/Whenable.ts index c584c4aa4c..4f21f58424 100644 --- a/src/utils/Whenable.ts +++ b/src/utils/Whenable.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { logger } from "matrix-js-sdk/src/logger"; -import { IDestroyable } from "./IDestroyable"; +import { type IDestroyable } from "./IDestroyable"; import { arrayFastClone } from "./arrays"; export type WhenFn = (w: Whenable) => void; diff --git a/src/utils/WidgetUtils-types.ts b/src/utils/WidgetUtils-types.ts index 734a4d002e..374b37632f 100644 --- a/src/utils/WidgetUtils-types.ts +++ b/src/utils/WidgetUtils-types.ts @@ -7,7 +7,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 { IWidget } from "matrix-widget-api"; +import { type IWidget } from "matrix-widget-api"; export interface IApp extends IWidget { "roomId": string; diff --git a/src/utils/WidgetUtils.ts b/src/utils/WidgetUtils.ts index 617ee35101..41232db3c4 100644 --- a/src/utils/WidgetUtils.ts +++ b/src/utils/WidgetUtils.ts @@ -10,8 +10,8 @@ Please see LICENSE files in the repository root for full details. import { useCallback, useEffect, useState } from "react"; import { base32 } from "rfc4648"; import { capitalize } from "lodash"; -import { IWidget, IWidgetData } from "matrix-widget-api"; -import { Room, ClientEvent, MatrixClient, RoomStateEvent, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type IWidget, type IWidgetData } from "matrix-widget-api"; +import { type Room, ClientEvent, type MatrixClient, RoomStateEvent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; import { CallType } from "matrix-js-sdk/src/webrtc/call"; @@ -26,11 +26,11 @@ import { WidgetType } from "../widgets/WidgetType"; import { Jitsi } from "../widgets/Jitsi"; import { objectClone } from "./objects"; import { _t } from "../languageHandler"; -import WidgetStore, { IApp, isAppWidget } from "../stores/WidgetStore"; +import WidgetStore, { type IApp, isAppWidget } from "../stores/WidgetStore"; import { parseUrl } from "./UrlUtils"; import { useEventEmitter } from "../hooks/useEventEmitter"; import { WidgetLayoutStore } from "../stores/widgets/WidgetLayoutStore"; -import { IWidgetEvent, UserWidget } from "./WidgetUtils-types"; +import { type IWidgetEvent, type UserWidget } from "./WidgetUtils-types"; // How long we wait for the state event echo to come back from the server // before waitFor[Room/User]Widget rejects its promise diff --git a/src/utils/beacon/bounds.ts b/src/utils/beacon/bounds.ts index a23e3367da..4df186b037 100644 --- a/src/utils/beacon/bounds.ts +++ b/src/utils/beacon/bounds.ts @@ -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 { Beacon } from "matrix-js-sdk/src/matrix"; +import { type Beacon } from "matrix-js-sdk/src/matrix"; import { filterBoolean } from "../arrays"; import { parseGeoUri } from "../location"; diff --git a/src/utils/beacon/duration.ts b/src/utils/beacon/duration.ts index d967bb5217..1cda8cf8dd 100644 --- a/src/utils/beacon/duration.ts +++ b/src/utils/beacon/duration.ts @@ -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 { Beacon, ContentHelpers } from "matrix-js-sdk/src/matrix"; +import { type Beacon, type ContentHelpers } from "matrix-js-sdk/src/matrix"; /** * Get ms until expiry diff --git a/src/utils/beacon/getShareableLocation.ts b/src/utils/beacon/getShareableLocation.ts index 4a141ec969..f548ad2fb5 100644 --- a/src/utils/beacon/getShareableLocation.ts +++ b/src/utils/beacon/getShareableLocation.ts @@ -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 { MatrixClient, MatrixEvent, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix"; /** * Beacons should only have shareable locations (open in external mapping tool, forward) diff --git a/src/utils/beacon/timeline.ts b/src/utils/beacon/timeline.ts index 25e0e9c008..1a5cc1ca2c 100644 --- a/src/utils/beacon/timeline.ts +++ b/src/utils/beacon/timeline.ts @@ -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 { MatrixEvent, M_BEACON_INFO } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, M_BEACON_INFO } from "matrix-js-sdk/src/matrix"; /** * beacon_info events without live property set to true diff --git a/src/utils/beacon/useBeacon.ts b/src/utils/beacon/useBeacon.ts index 80fe14abcd..b405eb654b 100644 --- a/src/utils/beacon/useBeacon.ts +++ b/src/utils/beacon/useBeacon.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useContext, useEffect, useState } from "react"; -import { Beacon, BeaconEvent, MatrixEvent, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix"; +import { type Beacon, BeaconEvent, type MatrixEvent, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import { useEventEmitterState } from "../../hooks/useEventEmitter"; diff --git a/src/utils/beacon/useLiveBeacons.ts b/src/utils/beacon/useLiveBeacons.ts index c99faeb72f..8d2d956a2f 100644 --- a/src/utils/beacon/useLiveBeacons.ts +++ b/src/utils/beacon/useLiveBeacons.ts @@ -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 { Beacon, Room, RoomStateEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Beacon, type Room, RoomStateEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { useEventEmitterState } from "../../hooks/useEventEmitter"; diff --git a/src/utils/beacon/useOwnLiveBeacons.ts b/src/utils/beacon/useOwnLiveBeacons.ts index 37387fda98..f9696fc880 100644 --- a/src/utils/beacon/useOwnLiveBeacons.ts +++ b/src/utils/beacon/useOwnLiveBeacons.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { useEffect, useState } from "react"; -import { Beacon, BeaconIdentifier } from "matrix-js-sdk/src/matrix"; +import { type Beacon, type BeaconIdentifier } from "matrix-js-sdk/src/matrix"; import { useEventEmitterState } from "../../hooks/useEventEmitter"; import { OwnBeaconStore, OwnBeaconStoreEvent } from "../../stores/OwnBeaconStore"; diff --git a/src/utils/connection.ts b/src/utils/connection.ts index 9c2866d305..66ecde56b0 100644 --- a/src/utils/connection.ts +++ b/src/utils/connection.ts @@ -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 { ClientEvent, ClientEventHandlerMap, SyncState } from "matrix-js-sdk/src/matrix"; +import { type ClientEvent, type ClientEventHandlerMap, SyncState } from "matrix-js-sdk/src/matrix"; /** * Creates a MatrixClient event listener function that can be used to get notified about reconnects. diff --git a/src/utils/createMatrixClient.ts b/src/utils/createMatrixClient.ts index ad156b8ab4..3cbc7a62f3 100644 --- a/src/utils/createMatrixClient.ts +++ b/src/utils/createMatrixClient.ts @@ -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 { - MatrixClient, + type MatrixClient, createClient, - ICreateClientOpts, + type ICreateClientOpts, MemoryCryptoStore, MemoryStore, IndexedDBCryptoStore, diff --git a/src/utils/createVoiceMessageContent.ts b/src/utils/createVoiceMessageContent.ts index eb40406dbc..4d7aa761bb 100644 --- a/src/utils/createVoiceMessageContent.ts +++ b/src/utils/createVoiceMessageContent.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { MsgType } from "matrix-js-sdk/src/matrix"; -import { EncryptedFile, RoomMessageEventContent } from "matrix-js-sdk/src/types"; +import { type EncryptedFile, type RoomMessageEventContent } from "matrix-js-sdk/src/types"; /** * @param {string} mxc MXC URL of the file diff --git a/src/utils/crypto/deviceInfo.ts b/src/utils/crypto/deviceInfo.ts index dda634545d..f758e853ea 100644 --- a/src/utils/crypto/deviceInfo.ts +++ b/src/utils/crypto/deviceInfo.ts @@ -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 { Device, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Device, type MatrixClient } from "matrix-js-sdk/src/matrix"; /** * Get crypto information on a specific device. diff --git a/src/utils/crypto/shouldForceDisableEncryption.ts b/src/utils/crypto/shouldForceDisableEncryption.ts index c30f58636e..04a2fe5818 100644 --- a/src/utils/crypto/shouldForceDisableEncryption.ts +++ b/src/utils/crypto/shouldForceDisableEncryption.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { getE2EEWellKnown } from "../WellKnownUtils"; diff --git a/src/utils/crypto/shouldSkipSetupEncryption.ts b/src/utils/crypto/shouldSkipSetupEncryption.ts index c431833b76..8b235c5e3e 100644 --- a/src/utils/crypto/shouldSkipSetupEncryption.ts +++ b/src/utils/crypto/shouldSkipSetupEncryption.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { shouldForceDisableEncryption } from "./shouldForceDisableEncryption"; import { asyncSomeParallel } from "../arrays.ts"; diff --git a/src/utils/device/clientInformation.ts b/src/utils/device/clientInformation.ts index a8e2383bfd..3c2fb544bd 100644 --- a/src/utils/device/clientInformation.ts +++ b/src/utils/device/clientInformation.ts @@ -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 { AccountDataEvents, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type AccountDataEvents, type MatrixClient } from "matrix-js-sdk/src/matrix"; -import BasePlatform from "../../BasePlatform"; -import { IConfigOptions } from "../../IConfigOptions"; -import { DeepReadonly } from "../../@types/common"; -import { DeviceClientInformation } from "./types"; +import type BasePlatform from "../../BasePlatform"; +import { type IConfigOptions } from "../../IConfigOptions"; +import { type DeepReadonly } from "../../@types/common"; +import { type DeviceClientInformation } from "./types"; export type { DeviceClientInformation }; diff --git a/src/utils/device/dehydration.ts b/src/utils/device/dehydration.ts index 8ad4901b8c..174c80a0d1 100644 --- a/src/utils/device/dehydration.ts +++ b/src/utils/device/dehydration.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { CryptoApi, StartDehydrationOpts } from "matrix-js-sdk/src/crypto-api"; +import { type CryptoApi, type StartDehydrationOpts } from "matrix-js-sdk/src/crypto-api"; import type { MatrixClient } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../MatrixClientPeg"; diff --git a/src/utils/device/isDeviceVerified.ts b/src/utils/device/isDeviceVerified.ts index 0eacb4d54e..6eb69709d8 100644 --- a/src/utils/device/isDeviceVerified.ts +++ b/src/utils/device/isDeviceVerified.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; /** * Check if one of our own devices is verified via cross signing diff --git a/src/utils/direct-messages.ts b/src/utils/direct-messages.ts index ef80016962..e1e518421d 100644 --- a/src/utils/direct-messages.ts +++ b/src/utils/direct-messages.ts @@ -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 { ClientEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { canEncryptToAllUsers } from "../createRoom"; import { Action } from "../dispatcher/actions"; -import { ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; import dis from "../dispatcher/dispatcher"; -import { LocalRoom, LocalRoomState } from "../models/LocalRoom"; +import { type LocalRoom, LocalRoomState } from "../models/LocalRoom"; import { waitForRoomReadyAndApplyAfterCreateCallbacks } from "./local-room"; import { findDMRoom } from "./dm/findDMRoom"; import { privateShouldBeEncrypted } from "./rooms"; diff --git a/src/utils/dm/createDmLocalRoom.ts b/src/utils/dm/createDmLocalRoom.ts index 60dbf216b0..e29d808ff5 100644 --- a/src/utils/dm/createDmLocalRoom.ts +++ b/src/utils/dm/createDmLocalRoom.ts @@ -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 { EventType, KNOWN_SAFE_ROOM_VERSION, MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { EventType, KNOWN_SAFE_ROOM_VERSION, type MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { LOCAL_ROOM_ID_PREFIX, LocalRoom } from "../../../src/models/LocalRoom"; -import { determineCreateRoomEncryptionOption, Member } from "../../../src/utils/direct-messages"; +import { determineCreateRoomEncryptionOption, type Member } from "../../../src/utils/direct-messages"; import { MEGOLM_ENCRYPTION_ALGORITHM } from "../crypto"; /** diff --git a/src/utils/dm/findDMForUser.ts b/src/utils/dm/findDMForUser.ts index b5e13aebaa..4e1168595f 100644 --- a/src/utils/dm/findDMForUser.ts +++ b/src/utils/dm/findDMForUser.ts @@ -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 { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import DMRoomMap from "../DMRoomMap"; diff --git a/src/utils/dm/findDMRoom.ts b/src/utils/dm/findDMRoom.ts index 52c35ec084..7b4bed796a 100644 --- a/src/utils/dm/findDMRoom.ts +++ b/src/utils/dm/findDMRoom.ts @@ -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 { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; -import { Member } from "../direct-messages"; +import { type Member } from "../direct-messages"; import DMRoomMap from "../DMRoomMap"; import { findDMForUser } from "./findDMForUser"; diff --git a/src/utils/dm/startDm.ts b/src/utils/dm/startDm.ts index 44b7b1d3d8..c88ad15c77 100644 --- a/src/utils/dm/startDm.ts +++ b/src/utils/dm/startDm.ts @@ -6,18 +6,18 @@ 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 { IInvite3PID, MatrixClient, Room } from "matrix-js-sdk/src/matrix"; -import { Optional } from "matrix-events-sdk"; +import { type IInvite3PID, type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; +import { type Optional } from "matrix-events-sdk"; import { Action } from "../../dispatcher/actions"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; -import { determineCreateRoomEncryptionOption, Member } from "../direct-messages"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { determineCreateRoomEncryptionOption, type Member } from "../direct-messages"; import DMRoomMap from "../DMRoomMap"; import { isLocalRoom } from "../localRoom/isLocalRoom"; import { findDMForUser } from "./findDMForUser"; import dis from "../../dispatcher/dispatcher"; import { getAddressType } from "../../UserAddress"; -import createRoom, { IOpts } from "../../createRoom"; +import createRoom, { type IOpts } from "../../createRoom"; /** * Start a DM. diff --git a/src/utils/event/getSenderName.ts b/src/utils/event/getSenderName.ts index 450edd8f20..fbb3524d18 100644 --- a/src/utils/event/getSenderName.ts +++ b/src/utils/event/getSenderName.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { _t } from "../../languageHandler"; diff --git a/src/utils/exportUtils/Exporter.ts b/src/utils/exportUtils/Exporter.ts index 0c549038b4..5409186941 100644 --- a/src/utils/exportUtils/Exporter.ts +++ b/src/utils/exportUtils/Exporter.ts @@ -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 { Direction, MatrixEvent, Relations, Room } from "matrix-js-sdk/src/matrix"; -import { EventType, MediaEventContent, RelationType } from "matrix-js-sdk/src/types"; +import { Direction, type MatrixEvent, type Relations, type Room } from "matrix-js-sdk/src/matrix"; +import { type EventType, type MediaEventContent, type RelationType } from "matrix-js-sdk/src/types"; import { saveAs } from "file-saver"; import { logger } from "matrix-js-sdk/src/logger"; import sanitizeFilename from "sanitize-filename"; -import { ExportType, IExportOptions } from "./exportUtils"; +import { ExportType, type IExportOptions } from "./exportUtils"; import { decryptFile } from "../DecryptFile"; import { mediaFromContent } from "../../customisations/Media"; import { formatFullDateNoDay, formatFullDateNoDayISO } from "../../DateUtils"; diff --git a/src/utils/exportUtils/HtmlExport.tsx b/src/utils/exportUtils/HtmlExport.tsx index 9bd88dbd45..57c2b6f0e7 100644 --- a/src/utils/exportUtils/HtmlExport.tsx +++ b/src/utils/exportUtils/HtmlExport.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { createRoot } from "react-dom/client"; -import { Room, MatrixEvent, EventType, MsgType } from "matrix-js-sdk/src/matrix"; +import { type Room, MatrixEvent, EventType, MsgType } from "matrix-js-sdk/src/matrix"; import { renderToStaticMarkup } from "react-dom/server"; import { logger } from "matrix-js-sdk/src/logger"; import escapeHtml from "escape-html"; @@ -26,7 +26,7 @@ import * as Avatar from "../../Avatar"; import EventTile from "../../components/views/rooms/EventTile"; import DateSeparator from "../../components/views/messages/DateSeparator"; import BaseAvatar from "../../components/views/avatars/BaseAvatar"; -import { ExportType, IExportOptions } from "./exportUtils"; +import { type ExportType, type IExportOptions } from "./exportUtils"; import MatrixClientContext from "../../contexts/MatrixClientContext"; import getExportCSS from "./exportCSS"; import { textForEvent } from "../../TextForEvent"; diff --git a/src/utils/exportUtils/JSONExport.ts b/src/utils/exportUtils/JSONExport.ts index bcd5c5cdc2..49549c5ae8 100644 --- a/src/utils/exportUtils/JSONExport.ts +++ b/src/utils/exportUtils/JSONExport.ts @@ -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 { Room, IEvent, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { type Room, type IEvent, type MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import Exporter from "./Exporter"; import { formatFullDateNoDayNoTime } from "../../DateUtils"; -import { ExportType, IExportOptions } from "./exportUtils"; +import { type ExportType, type IExportOptions } from "./exportUtils"; import { _t } from "../../languageHandler"; import { haveRendererForEvent } from "../../events/EventTileFactory"; diff --git a/src/utils/exportUtils/PlainTextExport.ts b/src/utils/exportUtils/PlainTextExport.ts index 48354d6f2a..821233ef01 100644 --- a/src/utils/exportUtils/PlainTextExport.ts +++ b/src/utils/exportUtils/PlainTextExport.ts @@ -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 { Room, IContent, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, type IContent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import React from "react"; +import type React from "react"; import Exporter from "./Exporter"; import { _t } from "../../languageHandler"; -import { ExportType, IExportOptions } from "./exportUtils"; +import { type ExportType, type IExportOptions } from "./exportUtils"; import { textForEvent } from "../../TextForEvent"; import { haveRendererForEvent } from "../../events/EventTileFactory"; import SettingsStore from "../../settings/SettingsStore"; diff --git a/src/utils/i18n-helpers.ts b/src/utils/i18n-helpers.ts index 195d3afd7a..408ec269e5 100644 --- a/src/utils/i18n-helpers.ts +++ b/src/utils/i18n-helpers.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import SpaceStore from "../stores/spaces/SpaceStore"; import { _t } from "../languageHandler"; diff --git a/src/utils/image-media.ts b/src/utils/image-media.ts index 2192297bde..03c34fb39e 100644 --- a/src/utils/image-media.ts +++ b/src/utils/image-media.ts @@ -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 { ImageInfo } from "matrix-js-sdk/src/types"; +import { type ImageInfo } from "matrix-js-sdk/src/types"; import { BlurhashEncoder } from "../BlurhashEncoder"; diff --git a/src/utils/leave-behaviour.ts b/src/utils/leave-behaviour.ts index 8924c3693b..ec24903ad4 100644 --- a/src/utils/leave-behaviour.ts +++ b/src/utils/leave-behaviour.ts @@ -7,21 +7,21 @@ Please see LICENSE files in the repository root for full details. */ import { sleep } from "matrix-js-sdk/src/utils"; -import React, { ReactNode } from "react"; -import { EventStatus, MatrixEventEvent, Room, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import React, { type ReactNode } from "react"; +import { EventStatus, MatrixEventEvent, type Room, type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; -import Modal, { IHandle } from "../Modal"; +import Modal, { type IHandle } from "../Modal"; import Spinner from "../components/views/elements/Spinner"; import { _t } from "../languageHandler"; import ErrorDialog from "../components/views/dialogs/ErrorDialog"; import { isMetaSpace } from "../stores/spaces"; import SpaceStore from "../stores/spaces/SpaceStore"; import dis from "../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../dispatcher/actions"; -import { ViewHomePagePayload } from "../dispatcher/payloads/ViewHomePagePayload"; +import { type ViewHomePagePayload } from "../dispatcher/payloads/ViewHomePagePayload"; import LeaveSpaceDialog from "../components/views/dialogs/LeaveSpaceDialog"; -import { AfterLeaveRoomPayload } from "../dispatcher/payloads/AfterLeaveRoomPayload"; +import { type AfterLeaveRoomPayload } from "../dispatcher/payloads/AfterLeaveRoomPayload"; import { bulkSpaceBehaviour } from "./space"; import { SdkContextClass } from "../contexts/SDKContext"; import SettingsStore from "../settings/SettingsStore"; diff --git a/src/utils/local-room.ts b/src/utils/local-room.ts index 304471e93a..90d25bd4c0 100644 --- a/src/utils/local-room.ts +++ b/src/utils/local-room.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { ClientEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import defaultDispatcher from "../dispatcher/dispatcher"; -import { LocalRoom, LocalRoomState } from "../models/LocalRoom"; +import { type LocalRoom, LocalRoomState } from "../models/LocalRoom"; import { isLocalRoom } from "./localRoom/isLocalRoom"; import { isRoomReady } from "./localRoom/isRoomReady"; diff --git a/src/utils/localRoom/isLocalRoom.ts b/src/utils/localRoom/isLocalRoom.ts index 6888c9aafd..d0e96828a2 100644 --- a/src/utils/localRoom/isLocalRoom.ts +++ b/src/utils/localRoom/isLocalRoom.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { LocalRoom, LOCAL_ROOM_ID_PREFIX } from "../../models/LocalRoom"; diff --git a/src/utils/localRoom/isRoomReady.ts b/src/utils/localRoom/isRoomReady.ts index 8d84f3abe8..3093f82b85 100644 --- a/src/utils/localRoom/isRoomReady.ts +++ b/src/utils/localRoom/isRoomReady.ts @@ -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 { EventType, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixClient } from "matrix-js-sdk/src/matrix"; -import { LocalRoom } from "../../models/LocalRoom"; +import { type LocalRoom } from "../../models/LocalRoom"; /** * Tests whether a room created based on a local room is ready. diff --git a/src/utils/location/findMapStyleUrl.ts b/src/utils/location/findMapStyleUrl.ts index 10915a9c33..3504f684b8 100644 --- a/src/utils/location/findMapStyleUrl.ts +++ b/src/utils/location/findMapStyleUrl.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import SdkConfig from "../../SdkConfig"; import { getTileServerWellKnown } from "../WellKnownUtils"; diff --git a/src/utils/location/isSelfLocation.ts b/src/utils/location/isSelfLocation.ts index 17d9e9ea94..da0cdaf9ab 100644 --- a/src/utils/location/isSelfLocation.ts +++ b/src/utils/location/isSelfLocation.ts @@ -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 { ILocationContent, LocationAssetType, M_ASSET } from "matrix-js-sdk/src/matrix"; +import { type ILocationContent, LocationAssetType, M_ASSET } from "matrix-js-sdk/src/matrix"; export const isSelfLocation = (locationContent: ILocationContent): boolean => { const asset = M_ASSET.findIn(locationContent) as { type: string }; diff --git a/src/utils/location/links.ts b/src/utils/location/links.ts index cf957af3e8..03f0e3eda1 100644 --- a/src/utils/location/links.ts +++ b/src/utils/location/links.ts @@ -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 { MatrixEvent, M_LOCATION } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, M_LOCATION } from "matrix-js-sdk/src/matrix"; import { parseGeoUri } from "./parseGeoUri"; diff --git a/src/utils/location/locationEventGeoUri.ts b/src/utils/location/locationEventGeoUri.ts index 171952b07b..54b463da3c 100644 --- a/src/utils/location/locationEventGeoUri.ts +++ b/src/utils/location/locationEventGeoUri.ts @@ -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 { MatrixEvent, M_LOCATION } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, M_LOCATION } from "matrix-js-sdk/src/matrix"; /** * Find the geo-URI contained within a location event. diff --git a/src/utils/location/map.ts b/src/utils/location/map.ts index 22ceb998d5..b16ee5b1fb 100644 --- a/src/utils/location/map.ts +++ b/src/utils/location/map.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import * as maplibregl from "maplibre-gl"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { _t } from "../../languageHandler"; diff --git a/src/utils/membership.ts b/src/utils/membership.ts index 79a1771e66..ba67d5a6c3 100644 --- a/src/utils/membership.ts +++ b/src/utils/membership.ts @@ -6,8 +6,15 @@ 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 { Room, RoomMember, RoomState, RoomStateEvent, MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { KnownMembership, Membership } from "matrix-js-sdk/src/types"; +import { + type Room, + type RoomMember, + type RoomState, + RoomStateEvent, + type MatrixEvent, + type MatrixClient, +} from "matrix-js-sdk/src/matrix"; +import { KnownMembership, type Membership } from "matrix-js-sdk/src/types"; import { MatrixClientPeg } from "../MatrixClientPeg"; import SettingsStore from "../settings/SettingsStore"; diff --git a/src/utils/notifications.ts b/src/utils/notifications.ts index d0dfa8ffa6..ebfd7e90f6 100644 --- a/src/utils/notifications.ts +++ b/src/utils/notifications.ts @@ -7,21 +7,21 @@ Please see LICENSE files in the repository root for full details. */ import { - MatrixClient, + type MatrixClient, LOCAL_NOTIFICATION_SETTINGS_PREFIX, NotificationCountType, - Room, - LocalNotificationSettings, + type Room, + type LocalNotificationSettings, ReceiptType, - IMarkedUnreadEvent, - EmptyObject, + type IMarkedUnreadEvent, + type EmptyObject, } from "matrix-js-sdk/src/matrix"; -import { IndicatorIcon } from "@vector-im/compound-web"; +import { type IndicatorIcon } from "@vector-im/compound-web"; import SettingsStore from "../settings/SettingsStore"; import { NotificationLevel } from "../stores/notifications/NotificationLevel"; import { doesRoomHaveUnreadMessages } from "../Unread"; -import { SettingKey } from "../settings/Settings.tsx"; +import { type SettingKey } from "../settings/Settings.tsx"; // MSC2867 is not yet spec at time of writing. We read from both stable // and unstable prefixes and accept the risk that the format may change, diff --git a/src/utils/oidc/TokenRefresher.ts b/src/utils/oidc/TokenRefresher.ts index 7c6848e39e..a525f9fd1d 100644 --- a/src/utils/oidc/TokenRefresher.ts +++ b/src/utils/oidc/TokenRefresher.ts @@ -6,8 +6,8 @@ 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 { OidcTokenRefresher, AccessTokens } from "matrix-js-sdk/src/matrix"; -import { IdTokenClaims } from "oidc-client-ts"; +import { OidcTokenRefresher, type AccessTokens } from "matrix-js-sdk/src/matrix"; +import { type IdTokenClaims } from "oidc-client-ts"; import PlatformPeg from "../../PlatformPeg"; import { persistAccessTokenInStorage, persistRefreshTokenInStorage } from "../tokens/tokens"; diff --git a/src/utils/oidc/authorize.ts b/src/utils/oidc/authorize.ts index 339d71414f..d409396db9 100644 --- a/src/utils/oidc/authorize.ts +++ b/src/utils/oidc/authorize.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { completeAuthorizationCodeGrant, generateOidcAuthorizationUrl } from "matrix-js-sdk/src/oidc/authorize"; -import { QueryDict } from "matrix-js-sdk/src/utils"; -import { OidcClientConfig } from "matrix-js-sdk/src/matrix"; +import { type QueryDict } from "matrix-js-sdk/src/utils"; +import { type OidcClientConfig } from "matrix-js-sdk/src/matrix"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; -import { IdTokenClaims } from "oidc-client-ts"; +import { type IdTokenClaims } from "oidc-client-ts"; import { OidcClientError } from "./error"; import PlatformPeg from "../../PlatformPeg"; diff --git a/src/utils/oidc/error.ts b/src/utils/oidc/error.ts index 94313648a2..f9334a739c 100644 --- a/src/utils/oidc/error.ts +++ b/src/utils/oidc/error.ts @@ -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 { ReactNode } from "react"; +import { type ReactNode } from "react"; import { OidcError } from "matrix-js-sdk/src/oidc/error"; import { _t } from "../../languageHandler"; diff --git a/src/utils/oidc/isUserRegistrationSupported.ts b/src/utils/oidc/isUserRegistrationSupported.ts index 22d32173ad..805206635d 100644 --- a/src/utils/oidc/isUserRegistrationSupported.ts +++ b/src/utils/oidc/isUserRegistrationSupported.ts @@ -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 { OidcClientConfig } from "matrix-js-sdk/src/matrix"; +import { type OidcClientConfig } from "matrix-js-sdk/src/matrix"; /** * Check the create prompt is supported by the OP, if so, we can do a registration flow diff --git a/src/utils/oidc/persistOidcSettings.ts b/src/utils/oidc/persistOidcSettings.ts index 6ca1295e03..38426e79cb 100644 --- a/src/utils/oidc/persistOidcSettings.ts +++ b/src/utils/oidc/persistOidcSettings.ts @@ -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 { IdTokenClaims } from "oidc-client-ts"; +import { type IdTokenClaims } from "oidc-client-ts"; import { decodeIdToken } from "matrix-js-sdk/src/matrix"; const clientIdStorageKey = "mx_oidc_client_id"; diff --git a/src/utils/oidc/registerClient.ts b/src/utils/oidc/registerClient.ts index 72ea11ddcd..92b7cf57d0 100644 --- a/src/utils/oidc/registerClient.ts +++ b/src/utils/oidc/registerClient.ts @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { registerOidcClient, OidcClientConfig } from "matrix-js-sdk/src/matrix"; +import { registerOidcClient, type OidcClientConfig } from "matrix-js-sdk/src/matrix"; -import { IConfigOptions } from "../../IConfigOptions"; +import { type IConfigOptions } from "../../IConfigOptions"; import PlatformPeg from "../../PlatformPeg"; /** diff --git a/src/utils/pages.ts b/src/utils/pages.ts index efa25c803e..4181e987f9 100644 --- a/src/utils/pages.ts +++ b/src/utils/pages.ts @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; -import { IConfigOptions } from "../IConfigOptions"; +import { type IConfigOptions } from "../IConfigOptions"; import { getEmbeddedPagesWellKnown } from "../utils/WellKnownUtils"; import { SnakedObject } from "./SnakedObject"; diff --git a/src/utils/permalinks/Permalinks.ts b/src/utils/permalinks/Permalinks.ts index 6441189497..0df4b4beb1 100644 --- a/src/utils/permalinks/Permalinks.ts +++ b/src/utils/permalinks/Permalinks.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import isIp from "is-ip"; import * as utils from "matrix-js-sdk/src/utils"; -import { Room, MatrixClient, RoomStateEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { type Room, type MatrixClient, RoomStateEvent, EventType } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; @@ -16,7 +16,8 @@ import MatrixToPermalinkConstructor, { baseUrl as matrixtoBaseUrl, baseUrlPattern as matrixToBaseUrlPattern, } from "./MatrixToPermalinkConstructor"; -import PermalinkConstructor, { PermalinkParts } from "./PermalinkConstructor"; +import { type PermalinkParts } from "./PermalinkConstructor"; +import type PermalinkConstructor from "./PermalinkConstructor"; import ElementPermalinkConstructor from "./ElementPermalinkConstructor"; import SdkConfig from "../../SdkConfig"; import { ELEMENT_URL_PATTERN } from "../../linkify-matrix"; diff --git a/src/utils/pillify.tsx b/src/utils/pillify.tsx index efcc993746..e39fd813bb 100644 --- a/src/utils/pillify.tsx +++ b/src/utils/pillify.tsx @@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details. import React, { StrictMode } from "react"; import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; -import { MatrixClient, MatrixEvent, RuleId } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent, RuleId } from "matrix-js-sdk/src/matrix"; import { TooltipProvider } from "@vector-im/compound-web"; import SettingsStore from "../settings/SettingsStore"; import { Pill, pillRoomNotifLen, pillRoomNotifPos, PillType } from "../components/views/elements/Pill"; import { parsePermalink } from "./permalinks/Permalinks"; -import { PermalinkParts } from "./permalinks/PermalinkConstructor"; -import { ReactRootManager } from "./react"; +import { type PermalinkParts } from "./permalinks/PermalinkConstructor"; +import { type ReactRootManager } from "./react"; /** * A node here is an A element with a href attribute tag. diff --git a/src/utils/presence.ts b/src/utils/presence.ts index 798efdde5d..9942ab8a3f 100644 --- a/src/utils/presence.ts +++ b/src/utils/presence.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import SdkConfig from "../SdkConfig"; diff --git a/src/utils/pushRules/monitorSyncedPushRules.ts b/src/utils/pushRules/monitorSyncedPushRules.ts index fcc41aae82..2c9684722c 100644 --- a/src/utils/pushRules/monitorSyncedPushRules.ts +++ b/src/utils/pushRules/monitorSyncedPushRules.ts @@ -6,11 +6,17 @@ 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, EventType, RuleId, IAnnotatedPushRule } from "matrix-js-sdk/src/matrix"; +import { + type MatrixClient, + type MatrixEvent, + EventType, + type RuleId, + type IAnnotatedPushRule, +} from "matrix-js-sdk/src/matrix"; import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; import { logger } from "matrix-js-sdk/src/logger"; -import { VectorPushRulesDefinitions, VectorPushRuleDefinition } from "../../notifications"; +import { VectorPushRulesDefinitions, type VectorPushRuleDefinition } from "../../notifications"; import { updateExistingPushRulesWithActions } from "./updatePushRuleActions"; const pushRuleAndKindToAnnotated = ( diff --git a/src/utils/pushRules/updatePushRuleActions.ts b/src/utils/pushRules/updatePushRuleActions.ts index e7ce8f7e8e..1d872e5207 100644 --- a/src/utils/pushRules/updatePushRuleActions.ts +++ b/src/utils/pushRules/updatePushRuleActions.ts @@ -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 { MatrixClient, IPushRule, PushRuleAction, PushRuleKind } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type IPushRule, type PushRuleAction, type PushRuleKind } from "matrix-js-sdk/src/matrix"; import { PushProcessor } from "matrix-js-sdk/src/pushprocessor"; /** diff --git a/src/utils/react.tsx b/src/utils/react.tsx index 435485214d..1a63340717 100644 --- a/src/utils/react.tsx +++ b/src/utils/react.tsx @@ -5,8 +5,8 @@ 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 { ReactNode } from "react"; -import { createRoot, Root } from "react-dom/client"; +import { type ReactNode } from "react"; +import { createRoot, type Root } from "react-dom/client"; /** * Utility class to render & unmount additional React roots, diff --git a/src/utils/read-receipts.ts b/src/utils/read-receipts.ts index 51a4d6705e..ee949fa034 100644 --- a/src/utils/read-receipts.ts +++ b/src/utils/read-receipts.ts @@ -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 { MatrixEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { isSupportedReceiptType } from "matrix-js-sdk/src/utils"; /** diff --git a/src/utils/room/canInviteTo.ts b/src/utils/room/canInviteTo.ts index 3d0b0c8f50..f6bb76c1e0 100644 --- a/src/utils/room/canInviteTo.ts +++ b/src/utils/room/canInviteTo.ts @@ -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 { JoinRule, Room } from "matrix-js-sdk/src/matrix"; +import { JoinRule, type Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { shouldShowComponent } from "../../customisations/helpers/UIComponents"; diff --git a/src/utils/room/getFunctionalMembers.ts b/src/utils/room/getFunctionalMembers.ts index f107fc0d1a..ac9859b28a 100644 --- a/src/utils/room/getFunctionalMembers.ts +++ b/src/utils/room/getFunctionalMembers.ts @@ -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 { Room, UNSTABLE_ELEMENT_FUNCTIONAL_USERS } from "matrix-js-sdk/src/matrix"; +import { type Room, UNSTABLE_ELEMENT_FUNCTIONAL_USERS } from "matrix-js-sdk/src/matrix"; export const getFunctionalMembers = (room: Room): string[] => { const [functionalUsersStateEvent] = room.currentState.getStateEvents(UNSTABLE_ELEMENT_FUNCTIONAL_USERS.name); diff --git a/src/utils/room/getJoinedNonFunctionalMembers.ts b/src/utils/room/getJoinedNonFunctionalMembers.ts index b843498753..8c8ac91069 100644 --- a/src/utils/room/getJoinedNonFunctionalMembers.ts +++ b/src/utils/room/getJoinedNonFunctionalMembers.ts @@ -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 { Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type Room, type RoomMember } from "matrix-js-sdk/src/matrix"; import { getFunctionalMembers } from "./getFunctionalMembers"; diff --git a/src/utils/room/inviteToRoom.ts b/src/utils/room/inviteToRoom.ts index c7010ec947..4435acc4cf 100644 --- a/src/utils/room/inviteToRoom.ts +++ b/src/utils/room/inviteToRoom.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import dis from "../../dispatcher/dispatcher"; diff --git a/src/utils/room/placeCall.ts b/src/utils/room/placeCall.ts index 04043fc3d3..1f0d67c1e6 100644 --- a/src/utils/room/placeCall.ts +++ b/src/utils/room/placeCall.ts @@ -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 { CallType } from "matrix-js-sdk/src/webrtc/call"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type CallType } from "matrix-js-sdk/src/webrtc/call"; +import { type Room } from "matrix-js-sdk/src/matrix"; import LegacyCallHandler from "../../LegacyCallHandler"; import { getPlatformCallTypeProps, PlatformCallType } from "../../hooks/room/useRoomCall"; import defaultDispatcher from "../../dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../dispatcher/payloads/ViewRoomPayload"; import { Action } from "../../dispatcher/actions"; import PosthogTrackers from "../../PosthogTrackers"; diff --git a/src/utils/room/shouldEncryptRoomWithSingle3rdPartyInvite.ts b/src/utils/room/shouldEncryptRoomWithSingle3rdPartyInvite.ts index 4192f0af1a..a86f15974a 100644 --- a/src/utils/room/shouldEncryptRoomWithSingle3rdPartyInvite.ts +++ b/src/utils/room/shouldEncryptRoomWithSingle3rdPartyInvite.ts @@ -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 { MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type Room } from "matrix-js-sdk/src/matrix"; import DMRoomMap from "../DMRoomMap"; import { privateShouldBeEncrypted } from "../rooms"; diff --git a/src/utils/room/tagRoom.ts b/src/utils/room/tagRoom.ts index 7ed707d874..716dd959a8 100644 --- a/src/utils/room/tagRoom.ts +++ b/src/utils/room/tagRoom.ts @@ -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 { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import RoomListStore from "../../stores/room-list/RoomListStore"; -import { DefaultTagID, TagID } from "../../stores/room-list/models"; +import { DefaultTagID, type TagID } from "../../stores/room-list/models"; import RoomListActions from "../../actions/RoomListActions"; import dis from "../../dispatcher/dispatcher"; diff --git a/src/utils/rooms.ts b/src/utils/rooms.ts index d32e2e933f..b0d2a60422 100644 --- a/src/utils/rooms.ts +++ b/src/utils/rooms.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { shouldForceDisableEncryption } from "./crypto/shouldForceDisableEncryption"; import { getE2EEWellKnown } from "./WellKnownUtils"; diff --git a/src/utils/sets.ts b/src/utils/sets.ts index 0d871f6b26..6a635326e4 100644 --- a/src/utils/sets.ts +++ b/src/utils/sets.ts @@ -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 { arrayDiff, Diff } from "./arrays"; +import { arrayDiff, type Diff } from "./arrays"; /** * Determines if two sets are different through a shallow comparison. diff --git a/src/utils/space.tsx b/src/utils/space.tsx index 9c3e0bc40c..1a9b104c4b 100644 --- a/src/utils/space.tsx +++ b/src/utils/space.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room, ICreateRoomStateEvent, RoomType, EventType, JoinRule } from "matrix-js-sdk/src/matrix"; +import { type Room, type ICreateRoomStateEvent, type RoomType, EventType, JoinRule } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { calculateRoomVia } from "./permalinks/Permalinks"; @@ -25,9 +25,12 @@ import { Action } from "../dispatcher/actions"; import Spinner from "../components/views/elements/Spinner"; import { shouldShowComponent } from "../customisations/helpers/UIComponents"; import { UIComponent } from "../settings/UIFeature"; -import { OpenSpacePreferencesPayload, SpacePreferenceTab } from "../dispatcher/payloads/OpenSpacePreferencesPayload"; -import { OpenSpaceSettingsPayload } from "../dispatcher/payloads/OpenSpaceSettingsPayload"; -import { OpenAddExistingToSpaceDialogPayload } from "../dispatcher/payloads/OpenAddExistingToSpaceDialogPayload"; +import { + type OpenSpacePreferencesPayload, + type SpacePreferenceTab, +} from "../dispatcher/payloads/OpenSpacePreferencesPayload"; +import { type OpenSpaceSettingsPayload } from "../dispatcher/payloads/OpenSpaceSettingsPayload"; +import { type OpenAddExistingToSpaceDialogPayload } from "../dispatcher/payloads/OpenAddExistingToSpaceDialogPayload"; import { SdkContextClass } from "../contexts/SDKContext"; export const shouldShowSpaceSettings = (space: Room): boolean => { diff --git a/src/utils/threepids.ts b/src/utils/threepids.ts index 5882c51c18..cfd5235fbb 100644 --- a/src/utils/threepids.ts +++ b/src/utils/threepids.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; -import { DirectoryMember, Member, ThreepidMember } from "./direct-messages"; +import { DirectoryMember, type Member, ThreepidMember } from "./direct-messages"; /** * Tries to resolve the ThreepidMembers to DirectoryMembers. diff --git a/src/utils/tokens/tokens.ts b/src/utils/tokens/tokens.ts index a25117beb8..9716e5af8a 100644 --- a/src/utils/tokens/tokens.ts +++ b/src/utils/tokens/tokens.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import { logger } from "matrix-js-sdk/src/logger"; import decryptAESSecretStorageItem from "matrix-js-sdk/src/utils/decryptAESSecretStorageItem"; import encryptAESSecretStorageItem from "matrix-js-sdk/src/utils/encryptAESSecretStorageItem"; -import { AESEncryptedSecretStoragePayload } from "matrix-js-sdk/src/types"; +import { type AESEncryptedSecretStoragePayload } from "matrix-js-sdk/src/types"; import * as StorageAccess from "../StorageAccess"; diff --git a/src/utils/tooltipify.tsx b/src/utils/tooltipify.tsx index 26d43cf033..e2f8b89f29 100644 --- a/src/utils/tooltipify.tsx +++ b/src/utils/tooltipify.tsx @@ -11,7 +11,7 @@ import { TooltipProvider } from "@vector-im/compound-web"; import PlatformPeg from "../PlatformPeg"; import LinkWithTooltip from "../components/views/elements/LinkWithTooltip"; -import { ReactRootManager } from "./react"; +import { type ReactRootManager } from "./react"; /** * If the platform enabled needsUrlTooltips, recurses depth-first through a DOM tree, adding tooltip previews diff --git a/src/vector/app.tsx b/src/vector/app.tsx index 12d8173d5f..c16c9a8b75 100644 --- a/src/vector/app.tsx +++ b/src/vector/app.tsx @@ -12,20 +12,20 @@ Please see LICENSE files in the repository root for full details. // To ensure we load the browser-matrix version first import "matrix-js-sdk/src/browser-index"; -import React, { ReactElement, StrictMode } from "react"; +import React, { type ReactElement, StrictMode } from "react"; import { logger } from "matrix-js-sdk/src/logger"; -import { createClient, AutoDiscovery, ClientConfig } from "matrix-js-sdk/src/matrix"; -import { WrapperLifecycle, WrapperOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WrapperLifecycle"; +import { createClient, AutoDiscovery, type ClientConfig } from "matrix-js-sdk/src/matrix"; +import { WrapperLifecycle, type WrapperOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WrapperLifecycle"; import type { QueryDict } from "matrix-js-sdk/src/utils"; import PlatformPeg from "../PlatformPeg"; import AutoDiscoveryUtils from "../utils/AutoDiscoveryUtils"; import * as Lifecycle from "../Lifecycle"; import SdkConfig, { parseSsoRedirectOptions } from "../SdkConfig"; -import { IConfigOptions } from "../IConfigOptions"; +import { type IConfigOptions } from "../IConfigOptions"; import { SnakedObject } from "../utils/SnakedObject"; import MatrixChat from "../components/structures/MatrixChat"; -import { ValidatedServerConfig } from "../utils/ValidatedServerConfig"; +import { type ValidatedServerConfig } from "../utils/ValidatedServerConfig"; import { ModuleRunner } from "../modules/ModuleRunner"; import { parseQs } from "./url_utils"; import { getInitialScreenAfterLogin, getScreenFromLocation, init as initRouting, onNewScreen } from "./routing"; diff --git a/src/vector/init.tsx b/src/vector/init.tsx index 9a2f1c1196..82c2e1647d 100644 --- a/src/vector/init.tsx +++ b/src/vector/init.tsx @@ -19,7 +19,7 @@ import PlatformPeg from "../PlatformPeg"; import SdkConfig from "../SdkConfig"; import { setTheme } from "../theme"; import { ModuleRunner } from "../modules/ModuleRunner"; -import MatrixChat from "../components/structures/MatrixChat"; +import type MatrixChat from "../components/structures/MatrixChat"; import ElectronPlatform from "./platform/ElectronPlatform"; import PWAPlatform from "./platform/PWAPlatform"; import WebPlatform from "./platform/WebPlatform"; diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 273e80488c..a5ea8cba6d 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. import { KJUR } from "jsrsasign"; import { - IOpenIDCredentials, - IWidgetApiRequest, - IWidgetApiRequestData, - IWidgetApiResponseData, + type IOpenIDCredentials, + type IWidgetApiRequest, + type IWidgetApiRequestData, + type IWidgetApiResponseData, VideoConferenceCapabilities, WidgetApi, - WidgetApiAction, + type WidgetApiAction, } from "matrix-widget-api"; import { logger } from "matrix-js-sdk/src/logger"; @@ -28,7 +28,7 @@ import type { InterfaceConfig as _InterfaceConfig, } from "jitsi-meet"; import { ElementWidgetActions } from "../../stores/widgets/ElementWidgetActions"; -import { IConfigOptions } from "../../IConfigOptions"; +import { type IConfigOptions } from "../../IConfigOptions"; import { SnakedObject } from "../../utils/SnakedObject"; import { ElementWidgetCapabilities } from "../../stores/widgets/ElementWidgetCapabilities"; import { getVectorConfig } from "../getconfig"; diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 252db399c9..19fa455168 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -10,24 +10,29 @@ 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, Room, MatrixEvent, OidcRegistrationClientMetadata } from "matrix-js-sdk/src/matrix"; +import { + type MatrixClient, + type Room, + type MatrixEvent, + type OidcRegistrationClientMetadata, +} from "matrix-js-sdk/src/matrix"; import React from "react"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; import { logger } from "matrix-js-sdk/src/logger"; -import BasePlatform, { UpdateCheckStatus, UpdateStatus } from "../../BasePlatform"; -import BaseEventIndexManager from "../../indexing/BaseEventIndexManager"; +import BasePlatform, { UpdateCheckStatus, type UpdateStatus } from "../../BasePlatform"; +import type BaseEventIndexManager from "../../indexing/BaseEventIndexManager"; import dis from "../../dispatcher/dispatcher"; import SdkConfig from "../../SdkConfig"; -import { IConfigOptions } from "../../IConfigOptions"; +import { type IConfigOptions } from "../../IConfigOptions"; import * as rageshake from "../../rageshake/rageshake"; import Modal from "../../Modal"; import InfoDialog from "../../components/views/dialogs/InfoDialog"; import Spinner from "../../components/views/elements/Spinner"; import { Action } from "../../dispatcher/actions"; -import { ActionPayload } from "../../dispatcher/payloads"; +import { type ActionPayload } from "../../dispatcher/payloads"; import { showToast as showUpdateToast } from "../../toasts/UpdateToast"; -import { CheckUpdatesPayload } from "../../dispatcher/payloads/CheckUpdatesPayload"; +import { type CheckUpdatesPayload } from "../../dispatcher/payloads/CheckUpdatesPayload"; import ToastStore from "../../stores/ToastStore"; import GenericExpiringToast from "../../components/views/toasts/GenericExpiringToast"; import { BreadcrumbsStore } from "../../stores/BreadcrumbsStore"; diff --git a/src/vector/platform/IPCManager.ts b/src/vector/platform/IPCManager.ts index 5b8af55df8..eb0f411025 100644 --- a/src/vector/platform/IPCManager.ts +++ b/src/vector/platform/IPCManager.ts @@ -5,10 +5,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 { defer, IDeferred } from "matrix-js-sdk/src/utils"; +import { defer, type IDeferred } from "matrix-js-sdk/src/utils"; import { logger } from "matrix-js-sdk/src/logger"; -import { ElectronChannel } from "../../@types/global"; +import { type ElectronChannel } from "../../@types/global"; interface IPCPayload { id?: number; diff --git a/src/vector/platform/SeshatIndexManager.ts b/src/vector/platform/SeshatIndexManager.ts index 2f281812f6..88a8889b72 100644 --- a/src/vector/platform/SeshatIndexManager.ts +++ b/src/vector/platform/SeshatIndexManager.ts @@ -6,14 +6,18 @@ Please see LICENSE files in the repository root for full details. */ // eslint-disable-next-line no-restricted-imports -import { IMatrixProfile, IEventWithRoomId as IMatrixEvent, IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; +import { + type IMatrixProfile, + type IEventWithRoomId as IMatrixEvent, + type IResultRoomEvents, +} from "matrix-js-sdk/src/@types/search"; import BaseEventIndexManager, { - ICrawlerCheckpoint, - IEventAndProfile, - IIndexStats, - ISearchArgs, - ILoadArgs, + type ICrawlerCheckpoint, + type IEventAndProfile, + type IIndexStats, + type ISearchArgs, + type ILoadArgs, } from "../../indexing/BaseEventIndexManager"; import { IPCManager } from "./IPCManager"; diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index ff575cb7b3..316f479e73 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -11,11 +11,11 @@ import UAParser from "ua-parser-js"; import { logger } from "matrix-js-sdk/src/logger"; import { MatrixClientPeg } from "../../MatrixClientPeg"; -import BasePlatform, { UpdateCheckStatus, UpdateStatus } from "../../BasePlatform"; +import BasePlatform, { UpdateCheckStatus, type UpdateStatus } from "../../BasePlatform"; import dis from "../../dispatcher/dispatcher"; import { hideToast as hideUpdateToast, showToast as showUpdateToast } from "../../toasts/UpdateToast"; import { Action } from "../../dispatcher/actions"; -import { CheckUpdatesPayload } from "../../dispatcher/payloads/CheckUpdatesPayload"; +import { type CheckUpdatesPayload } from "../../dispatcher/payloads/CheckUpdatesPayload"; import { parseQs } from "../url_utils"; import { _t } from "../../languageHandler"; diff --git a/src/vector/routing.ts b/src/vector/routing.ts index 98da881736..964c0c0684 100644 --- a/src/vector/routing.ts +++ b/src/vector/routing.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. // Parse the given window.location and return parameters that can be used when calling // MatrixChat.showScreen(screen, params) import { logger } from "matrix-js-sdk/src/logger"; -import { QueryDict } from "matrix-js-sdk/src/utils"; +import { type QueryDict } from "matrix-js-sdk/src/utils"; import { parseQsFromFragment } from "./url_utils"; diff --git a/src/vector/url_utils.ts b/src/vector/url_utils.ts index 82430a10c8..2b5202806e 100644 --- a/src/vector/url_utils.ts +++ b/src/vector/url_utils.ts @@ -5,7 +5,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 { QueryDict, decodeParams } from "matrix-js-sdk/src/utils"; +import { type QueryDict, decodeParams } from "matrix-js-sdk/src/utils"; // We want to support some name / value pairs in the fragment // so we're re-using query string like format diff --git a/src/verification.ts b/src/verification.ts index 90dacbf6ac..b31c8f9ca0 100644 --- a/src/verification.ts +++ b/src/verification.ts @@ -6,17 +6,17 @@ 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 { User, MatrixClient, RoomMember } from "matrix-js-sdk/src/matrix"; -import { CrossSigningKey, VerificationRequest } from "matrix-js-sdk/src/crypto-api"; +import { type User, type MatrixClient, type RoomMember } from "matrix-js-sdk/src/matrix"; +import { CrossSigningKey, type VerificationRequest } from "matrix-js-sdk/src/crypto-api"; import dis from "./dispatcher/dispatcher"; import Modal from "./Modal"; import { RightPanelPhases } from "./stores/right-panel/RightPanelStorePhases"; import { accessSecretStorage } from "./SecurityManager"; import UntrustedDeviceDialog from "./components/views/dialogs/UntrustedDeviceDialog"; -import { IDevice } from "./components/views/right_panel/UserInfo"; +import { type IDevice } from "./components/views/right_panel/UserInfo"; import RightPanelStore from "./stores/right-panel/RightPanelStore"; -import { IRightPanelCardState } from "./stores/right-panel/RightPanelStoreIPanelState"; +import { type IRightPanelCardState } from "./stores/right-panel/RightPanelStoreIPanelState"; import { findDMForUser } from "./utils/dm/findDMForUser"; async function enable4SIfNeeded(matrixClient: MatrixClient): Promise { diff --git a/src/widgets/CapabilityText.tsx b/src/widgets/CapabilityText.tsx index ea910c21c0..effaa0975b 100644 --- a/src/widgets/CapabilityText.tsx +++ b/src/widgets/CapabilityText.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { - Capability, + type Capability, EventDirection, EventKind, getTimelineRoomIDFromCapability, @@ -21,7 +21,7 @@ import { import { EventType, MsgType } from "matrix-js-sdk/src/matrix"; import React from "react"; -import { _t, _td, TranslatedString, TranslationKey } from "../languageHandler"; +import { _t, _td, type TranslatedString, type TranslationKey } from "../languageHandler"; import { ElementWidgetCapabilities } from "../stores/widgets/ElementWidgetCapabilities"; import { MatrixClientPeg } from "../MatrixClientPeg"; import TextWithTooltip from "../components/views/elements/TextWithTooltip"; diff --git a/src/widgets/Jitsi.ts b/src/widgets/Jitsi.ts index e76e86157d..c3eecb6a5c 100644 --- a/src/widgets/Jitsi.ts +++ b/src/widgets/Jitsi.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { ClientEvent, IClientWellKnown } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type IClientWellKnown } from "matrix-js-sdk/src/matrix"; import SdkConfig from "../SdkConfig"; import { MatrixClientPeg } from "../MatrixClientPeg"; diff --git a/src/widgets/ManagedHybrid.ts b/src/widgets/ManagedHybrid.ts index b4ef4cba8b..f89420ae2a 100644 --- a/src/widgets/ManagedHybrid.ts +++ b/src/widgets/ManagedHybrid.ts @@ -6,16 +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 { IWidget } from "matrix-widget-api"; +import { type IWidget } from "matrix-widget-api"; import { logger } from "matrix-js-sdk/src/logger"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../MatrixClientPeg"; import { getCallBehaviourWellKnown } from "../utils/WellKnownUtils"; import WidgetUtils from "../utils/WidgetUtils"; -import { IStoredLayout, WidgetLayoutStore } from "../stores/widgets/WidgetLayoutStore"; +import { type IStoredLayout, WidgetLayoutStore } from "../stores/widgets/WidgetLayoutStore"; import WidgetEchoStore from "../stores/WidgetEchoStore"; -import WidgetStore, { IApp } from "../stores/WidgetStore"; +import WidgetStore, { type IApp } from "../stores/WidgetStore"; import SdkConfig from "../SdkConfig"; import { getJoinedNonFunctionalMembers } from "../utils/room/getJoinedNonFunctionalMembers"; diff --git a/src/workers/blurhash.worker.ts b/src/workers/blurhash.worker.ts index 9d9c2fbf52..a9adfd4f8e 100644 --- a/src/workers/blurhash.worker.ts +++ b/src/workers/blurhash.worker.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { encode } from "blurhash"; -import { WorkerPayload } from "./worker"; +import { type WorkerPayload } from "./worker"; const ctx: Worker = self as any; diff --git a/src/workers/playback.worker.ts b/src/workers/playback.worker.ts index 47479e6adb..3c77f9a9b4 100644 --- a/src/workers/playback.worker.ts +++ b/src/workers/playback.worker.ts @@ -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 { WorkerPayload } from "./worker"; +import { type WorkerPayload } from "./worker"; import { arrayRescale, arraySmoothingResample } from "../utils/arrays"; import { PLAYBACK_WAVEFORM_SAMPLES } from "../audio/consts"; diff --git a/test/CreateCrossSigning-test.ts b/test/CreateCrossSigning-test.ts index 6863b0500e..cd2bf904cd 100644 --- a/test/CreateCrossSigning-test.ts +++ b/test/CreateCrossSigning-test.ts @@ -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 { HTTPError, MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { HTTPError, type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import { createCrossSigning } from "../src/CreateCrossSigning"; diff --git a/test/app-tests/wrapper-test.tsx b/test/app-tests/wrapper-test.tsx index 47e2ad2ce1..1029754296 100644 --- a/test/app-tests/wrapper-test.tsx +++ b/test/app-tests/wrapper-test.tsx @@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import fetchMock from "fetch-mock-jest"; -import { render, RenderResult, screen } from "jest-matrix-react"; -import { WrapperLifecycle, WrapperOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WrapperLifecycle"; +import { render, type RenderResult, screen } from "jest-matrix-react"; +import { WrapperLifecycle, type WrapperOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WrapperLifecycle"; import SdkConfig from "../../src/SdkConfig"; import PlatformPeg from "../../src/PlatformPeg"; diff --git a/test/test-utils/audio.ts b/test/test-utils/audio.ts index 5de94b529d..eb9f91bcc6 100644 --- a/test/test-utils/audio.ts +++ b/test/test-utils/audio.ts @@ -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 => { const eventEmitter = new EventEmitter(); diff --git a/test/test-utils/beacon.ts b/test/test-utils/beacon.ts index aca294546f..2688d223ad 100644 --- a/test/test-utils/beacon.ts +++ b/test/test-utils/beacon.ts @@ -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"; diff --git a/test/test-utils/call.ts b/test/test-utils/call.ts index 04b46f1597..008858a129 100644 --- a/test/test-utils/call.ts +++ b/test/test-utils/call.ts @@ -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 { diff --git a/test/test-utils/client.ts b/test/test-utils/client.ts index f1b2cf967c..2f9a0e8116 100644 --- a/test/test-utils/client.ts +++ b/test/test-utils/client.ts @@ -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"; diff --git a/test/test-utils/composer.ts b/test/test-utils/composer.ts index 73a3d990cf..6439e70fc2 100644 --- a/test/test-utils/composer.ts +++ b/test/test-utils/composer.ts @@ -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) => diff --git a/test/test-utils/index.ts b/test/test-utils/index.ts index 0fd5797b3f..d1298ca3df 100644 --- a/test/test-utils/index.ts +++ b/test/test-utils/index.ts @@ -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"; diff --git a/test/test-utils/jest-matrix-react.tsx b/test/test-utils/jest-matrix-react.tsx index 765f84a5c9..ed5ff0075e 100644 --- a/test/test-utils/jest-matrix-react.tsx +++ b/test/test-utils/jest-matrix-react.tsx @@ -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"]) => { diff --git a/test/test-utils/location.ts b/test/test-utils/location.ts index 0b558b5b8c..b14f19cf98 100644 --- a/test/test-utils/location.ts +++ b/test/test-utils/location.ts @@ -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 => { diff --git a/test/test-utils/platform.ts b/test/test-utils/platform.ts index e360bb5e0c..3769826576 100644 --- a/test/test-utils/platform.ts +++ b/test/test-utils/platform.ts @@ -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"; diff --git a/test/test-utils/poll.ts b/test/test-utils/poll.ts index 13003ea528..a9896c62ca 100644 --- a/test/test-utils/poll.ts +++ b/test/test-utils/poll.ts @@ -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, diff --git a/test/test-utils/pushRules.ts b/test/test-utils/pushRules.ts index 15796f8a09..a7b050c8ba 100644 --- a/test/test-utils/pushRules.ts +++ b/test/test-utils/pushRules.ts @@ -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 diff --git a/test/test-utils/relations.ts b/test/test-utils/relations.ts index 1acf16af00..4bc5b26e4c 100644 --- a/test/test-utils/relations.ts +++ b/test/test-utils/relations.ts @@ -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 as Relations; diff --git a/test/test-utils/room.ts b/test/test-utils/room.ts index 21c82c9ae3..9fe77a970c 100644 --- a/test/test-utils/room.ts +++ b/test/test-utils/room.ts @@ -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"; diff --git a/test/test-utils/test-utils.ts b/test/test-utils/test-utils.ts index f752daf530..a8b53abb0e 100644 --- a/test/test-utils/test-utils.ts +++ b/test/test-utils/test-utils.ts @@ -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"; /** diff --git a/test/test-utils/threads.ts b/test/test-utils/threads.ts index 12b0575ba7..7dca8b2ca0 100644 --- a/test/test-utils/threads.ts +++ b/test/test-utils/threads.ts @@ -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, diff --git a/test/test-utils/utilities.ts b/test/test-utils/utilities.ts index e43f356161..dd3e5e6a62 100644 --- a/test/test-utils/utilities.ts +++ b/test/test-utils/utilities.ts @@ -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)); diff --git a/test/test-utils/wrappers.tsx b/test/test-utils/wrappers.tsx index 8b582ccf00..7c4fd4b968 100644 --- a/test/test-utils/wrappers.tsx +++ b/test/test-utils/wrappers.tsx @@ -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 = { wrappedRef?: Ref> } & T; diff --git a/test/unit-tests/Avatar-test.ts b/test/unit-tests/Avatar-test.ts index c068b8e465..ced974a059 100644 --- a/test/unit-tests/Avatar-test.ts +++ b/test/unit-tests/Avatar-test.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { Room, RoomMember, RoomType } from "matrix-js-sdk/src/matrix"; +import { type Room, type RoomMember, RoomType } from "matrix-js-sdk/src/matrix"; import { avatarUrlForRoom } from "../../src/Avatar"; -import { Media, mediaFromMxc } from "../../src/customisations/Media"; +import { type Media, mediaFromMxc } from "../../src/customisations/Media"; import DMRoomMap from "../../src/utils/DMRoomMap"; jest.mock("../../src/customisations/Media", () => ({ diff --git a/test/unit-tests/ContentMessages-test.ts b/test/unit-tests/ContentMessages-test.ts index 67ab582511..2b08cd85e0 100644 --- a/test/unit-tests/ContentMessages-test.ts +++ b/test/unit-tests/ContentMessages-test.ts @@ -7,10 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { ISendEventResponse, MatrixClient, RelationType, UploadResponse } from "matrix-js-sdk/src/matrix"; -import { ImageInfo } from "matrix-js-sdk/src/types"; +import { + type ISendEventResponse, + type MatrixClient, + RelationType, + type UploadResponse, +} from "matrix-js-sdk/src/matrix"; +import { type ImageInfo } from "matrix-js-sdk/src/types"; import { defer } from "matrix-js-sdk/src/utils"; -import encrypt, { IEncryptedFile } from "matrix-encrypt-attachment"; +import encrypt, { type IEncryptedFile } from "matrix-encrypt-attachment"; import ContentMessages, { UploadCanceledError, uploadFile } from "../../src/ContentMessages"; import { doMaybeLocalRoomAction } from "../../src/utils/local-room"; diff --git a/test/unit-tests/DecryptionFailureTracker-test.ts b/test/unit-tests/DecryptionFailureTracker-test.ts index adadcc3973..754a621a4f 100644 --- a/test/unit-tests/DecryptionFailureTracker-test.ts +++ b/test/unit-tests/DecryptionFailureTracker-test.ts @@ -5,13 +5,18 @@ 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, Mocked, MockedObject } from "jest-mock"; -import { HttpApiEvent, MatrixClient, MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; +import { mocked, type Mocked, type MockedObject } from "jest-mock"; +import { HttpApiEvent, type MatrixClient, type MatrixEvent, MatrixEventEvent } from "matrix-js-sdk/src/matrix"; import { decryptExistingEvent, mkDecryptionFailureMatrixEvent } from "matrix-js-sdk/src/testing"; -import { CryptoApi, DecryptionFailureCode, UserVerificationStatus, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; +import { + type CryptoApi, + DecryptionFailureCode, + UserVerificationStatus, + CryptoEvent, +} from "matrix-js-sdk/src/crypto-api"; import { sleep } from "matrix-js-sdk/src/utils"; -import { DecryptionFailureTracker, ErrorProperties } from "../../src/DecryptionFailureTracker"; +import { DecryptionFailureTracker, type ErrorProperties } from "../../src/DecryptionFailureTracker"; import { stubClient } from "../test-utils"; import * as Lifecycle from "../../src/Lifecycle"; diff --git a/test/unit-tests/DeviceListener-test.ts b/test/unit-tests/DeviceListener-test.ts index bdbf86637d..635e252759 100644 --- a/test/unit-tests/DeviceListener-test.ts +++ b/test/unit-tests/DeviceListener-test.ts @@ -6,17 +6,17 @@ 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, mocked } from "jest-mock"; -import { MatrixEvent, Room, MatrixClient, Device, ClientStoppedError } from "matrix-js-sdk/src/matrix"; +import { type Mocked, mocked } from "jest-mock"; +import { MatrixEvent, type Room, type MatrixClient, Device, ClientStoppedError } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import { CryptoEvent, - CrossSigningStatus, - CryptoApi, + type CrossSigningStatus, + type CryptoApi, DeviceVerificationStatus, - KeyBackupInfo, + type KeyBackupInfo, } from "matrix-js-sdk/src/crypto-api"; -import { CryptoSessionStateChange } from "@matrix-org/analytics-events/types/typescript/CryptoSessionStateChange"; +import { type CryptoSessionStateChange } from "@matrix-org/analytics-events/types/typescript/CryptoSessionStateChange"; import DeviceListener from "../../src/DeviceListener"; import { MatrixClientPeg } from "../../src/MatrixClientPeg"; diff --git a/test/unit-tests/HtmlUtils-test.tsx b/test/unit-tests/HtmlUtils-test.tsx index e4fccb185b..ad469c3a92 100644 --- a/test/unit-tests/HtmlUtils-test.tsx +++ b/test/unit-tests/HtmlUtils-test.tsx @@ -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 React, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; import { mocked } from "jest-mock"; import { render, screen } from "jest-matrix-react"; -import { IContent } from "matrix-js-sdk/src/matrix"; +import { type IContent } from "matrix-js-sdk/src/matrix"; import { bodyToSpan, formatEmojis, topicToHtml } from "../../src/HtmlUtils"; import SettingsStore from "../../src/settings/SettingsStore"; diff --git a/test/unit-tests/KeyBindingsManager-test.ts b/test/unit-tests/KeyBindingsManager-test.ts index 91adfc0eff..ed0be01fe2 100644 --- a/test/unit-tests/KeyBindingsManager-test.ts +++ b/test/unit-tests/KeyBindingsManager-test.ts @@ -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 { isKeyComboMatch, KeyCombo } from "../../src/KeyBindingsManager"; +import { isKeyComboMatch, type KeyCombo } from "../../src/KeyBindingsManager"; function mockKeyEvent( key: string, diff --git a/test/unit-tests/LegacyCallHandler-test.ts b/test/unit-tests/LegacyCallHandler-test.ts index 1aee2d2231..d10c232b65 100644 --- a/test/unit-tests/LegacyCallHandler-test.ts +++ b/test/unit-tests/LegacyCallHandler-test.ts @@ -7,11 +7,11 @@ Please see LICENSE files in the repository root for full details. */ import { - IProtocol, + type IProtocol, LOCAL_NOTIFICATION_SETTINGS_PREFIX, MatrixEvent, PushRuleKind, - Room, + type Room, RuleId, TweakName, } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/Lifecycle-test.ts b/test/unit-tests/Lifecycle-test.ts index 284a3c6531..94751b98c4 100644 --- a/test/unit-tests/Lifecycle-test.ts +++ b/test/unit-tests/Lifecycle-test.ts @@ -11,7 +11,7 @@ import { logger } from "matrix-js-sdk/src/logger"; import * as MatrixJs from "matrix-js-sdk/src/matrix"; import { decodeBase64, encodeUnpaddedBase64 } from "matrix-js-sdk/src/matrix"; import * as encryptAESSecretStorageItemModule from "matrix-js-sdk/src/utils/encryptAESSecretStorageItem"; -import { mocked, MockedObject } from "jest-mock"; +import { mocked, type MockedObject } from "jest-mock"; import fetchMock from "fetch-mock-jest"; import StorageEvictedDialog from "../../src/components/views/dialogs/StorageEvictedDialog"; diff --git a/test/unit-tests/MatrixClientPeg-test.ts b/test/unit-tests/MatrixClientPeg-test.ts index 51e9406f36..abf730d960 100644 --- a/test/unit-tests/MatrixClientPeg-test.ts +++ b/test/unit-tests/MatrixClientPeg-test.ts @@ -10,7 +10,7 @@ import { logger } from "matrix-js-sdk/src/logger"; import fetchMockJest from "fetch-mock-jest"; import { advanceDateAndTime, stubClient } from "../test-utils"; -import { IMatrixClientPeg, MatrixClientPeg as peg } from "../../src/MatrixClientPeg"; +import { type IMatrixClientPeg, MatrixClientPeg as peg } from "../../src/MatrixClientPeg"; jest.useFakeTimers(); diff --git a/test/unit-tests/Notifier-test.ts b/test/unit-tests/Notifier-test.ts index 3335b29787..92df3bc385 100644 --- a/test/unit-tests/Notifier-test.ts +++ b/test/unit-tests/Notifier-test.ts @@ -5,23 +5,23 @@ Copyright 2022 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import { mocked, MockedObject } from "jest-mock"; +import { mocked, type MockedObject } from "jest-mock"; import { ClientEvent, - MatrixClient, + type MatrixClient, Room, RoomEvent, EventType, MsgType, - IContent, + type IContent, MatrixEvent, SyncState, - AccountDataEvents, + type AccountDataEvents, } from "matrix-js-sdk/src/matrix"; import { waitFor } from "jest-matrix-react"; import { CallMembership, MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; -import BasePlatform from "../../src/BasePlatform"; +import type BasePlatform from "../../src/BasePlatform"; import Notifier from "../../src/Notifier"; import SettingsStore from "../../src/settings/SettingsStore"; import ToastStore from "../../src/stores/ToastStore"; @@ -42,7 +42,7 @@ import UserActivity from "../../src/UserActivity"; import Modal from "../../src/Modal"; import { mkThread } from "../test-utils/threads"; import dis from "../../src/dispatcher/dispatcher"; -import { ThreadPayload } from "../../src/dispatcher/payloads/ThreadPayload"; +import { type ThreadPayload } from "../../src/dispatcher/payloads/ThreadPayload"; import { Action } from "../../src/dispatcher/actions"; import { addReplyToMessageContent } from "../../src/utils/Reply"; diff --git a/test/unit-tests/PosthogAnalytics-test.ts b/test/unit-tests/PosthogAnalytics-test.ts index 27552bbba6..91fdd32f2e 100644 --- a/test/unit-tests/PosthogAnalytics-test.ts +++ b/test/unit-tests/PosthogAnalytics-test.ts @@ -7,11 +7,16 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { PostHog } from "posthog-js"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; -import { CryptoApi } from "matrix-js-sdk/src/crypto-api"; +import { type PostHog } from "posthog-js"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type CryptoApi } from "matrix-js-sdk/src/crypto-api"; -import { Anonymity, getRedactedCurrentLocation, IPosthogEvent, PosthogAnalytics } from "../../src/PosthogAnalytics"; +import { + Anonymity, + getRedactedCurrentLocation, + type IPosthogEvent, + PosthogAnalytics, +} from "../../src/PosthogAnalytics"; import SdkConfig from "../../src/SdkConfig"; import { getMockClientWithEventEmitter } from "../test-utils"; import SettingsStore from "../../src/settings/SettingsStore"; diff --git a/test/unit-tests/RoomNotifs-test.ts b/test/unit-tests/RoomNotifs-test.ts index 1452306de6..cff4ecef75 100644 --- a/test/unit-tests/RoomNotifs-test.ts +++ b/test/unit-tests/RoomNotifs-test.ts @@ -14,12 +14,12 @@ import { Room, EventStatus, EventType, - MatrixEvent, + type MatrixEvent, PendingEventOrdering, + type MatrixClient, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import type { MatrixClient } from "matrix-js-sdk/src/matrix"; import { mkEvent, mkRoom, mkRoomMember, muteRoom, stubClient, upsertRoomStateEvents } from "../test-utils"; import { getRoomNotifsState, diff --git a/test/unit-tests/Rooms-test.ts b/test/unit-tests/Rooms-test.ts index 32b5513f82..a9266d7e79 100644 --- a/test/unit-tests/Rooms-test.ts +++ b/test/unit-tests/Rooms-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { EventType, MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixClient, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { setDMRoom } from "../../src/Rooms"; import { mkEvent, stubClient } from "../test-utils"; diff --git a/test/unit-tests/ScalarAuthClient-test.ts b/test/unit-tests/ScalarAuthClient-test.ts index 4221fca0ed..4480318729 100644 --- a/test/unit-tests/ScalarAuthClient-test.ts +++ b/test/unit-tests/ScalarAuthClient-test.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { mocked } from "jest-mock"; import fetchMock from "fetch-mock-jest"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import ScalarAuthClient from "../../src/ScalarAuthClient"; import { stubClient } from "../test-utils"; diff --git a/test/unit-tests/SecurityManager-test.ts b/test/unit-tests/SecurityManager-test.ts index f81e08ada2..8c1671b52e 100644 --- a/test/unit-tests/SecurityManager-test.ts +++ b/test/unit-tests/SecurityManager-test.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import { mocked } from "jest-mock"; import { act } from "react"; import { Crypto } from "@peculiar/webcrypto"; -import { CryptoApi, deriveRecoveryKeyFromPassphrase } from "matrix-js-sdk/src/crypto-api"; +import { type CryptoApi, deriveRecoveryKeyFromPassphrase } from "matrix-js-sdk/src/crypto-api"; import { SecretStorage } from "matrix-js-sdk/src/matrix"; import { accessSecretStorage, crossSigningCallbacks } from "../../src/SecurityManager"; @@ -17,7 +17,7 @@ import { filterConsole, stubClient } from "../test-utils"; import Modal from "../../src/Modal.tsx"; import { default as AccessSecretStorageDialog, - KeyParams, + type KeyParams, } from "../../src/components/views/dialogs/security/AccessSecretStorageDialog.tsx"; jest.mock("react", () => { diff --git a/test/unit-tests/SlashCommands-test.tsx b/test/unit-tests/SlashCommands-test.tsx index c2b3da7f2d..60bc145892 100644 --- a/test/unit-tests/SlashCommands-test.tsx +++ b/test/unit-tests/SlashCommands-test.tsx @@ -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 { MatrixClient, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room, RoomMember } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { mocked } from "jest-mock"; -import { Command, Commands, getCommand } from "../../src/SlashCommands"; +import { type Command, Commands, getCommand } from "../../src/SlashCommands"; import { createTestClient } from "../test-utils"; import { LocalRoom, LOCAL_ROOM_ID_PREFIX } from "../../src/models/LocalRoom"; import SettingsStore from "../../src/settings/SettingsStore"; diff --git a/test/unit-tests/SlidingSyncManager-test.ts b/test/unit-tests/SlidingSyncManager-test.ts index 66f4c48c25..ddc5911262 100644 --- a/test/unit-tests/SlidingSyncManager-test.ts +++ b/test/unit-tests/SlidingSyncManager-test.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { SlidingSync } from "matrix-js-sdk/src/sliding-sync"; import { mocked } from "jest-mock"; -import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import fetchMockJest from "fetch-mock-jest"; import { SlidingSyncManager } from "../../src/SlidingSyncManager"; diff --git a/test/unit-tests/Terms-test.tsx b/test/unit-tests/Terms-test.tsx index 042e0c7826..ca2476c082 100644 --- a/test/unit-tests/Terms-test.tsx +++ b/test/unit-tests/Terms-test.tsx @@ -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 { EventType, MatrixEvent, Policy, SERVICE_TYPES, Terms } from "matrix-js-sdk/src/matrix"; +import { EventType, MatrixEvent, type Policy, SERVICE_TYPES, type Terms } from "matrix-js-sdk/src/matrix"; import { screen, within } from "jest-matrix-react"; import { dialogTermsInteractionCallback, Service, startTermsFlow } from "../../src/Terms"; diff --git a/test/unit-tests/TestSdkContext.ts b/test/unit-tests/TestSdkContext.ts index 1a8f9565a8..f4d7eea9e2 100644 --- a/test/unit-tests/TestSdkContext.ts +++ b/test/unit-tests/TestSdkContext.ts @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import { SdkContextClass } from "../../src/contexts/SDKContext"; -import { PosthogAnalytics } from "../../src/PosthogAnalytics"; -import { SlidingSyncManager } from "../../src/SlidingSyncManager"; -import { RoomNotificationStateStore } from "../../src/stores/notifications/RoomNotificationStateStore"; -import RightPanelStore from "../../src/stores/right-panel/RightPanelStore"; -import { RoomViewStore } from "../../src/stores/RoomViewStore"; -import { SpaceStoreClass } from "../../src/stores/spaces/SpaceStore"; -import { WidgetLayoutStore } from "../../src/stores/widgets/WidgetLayoutStore"; -import { WidgetPermissionStore } from "../../src/stores/widgets/WidgetPermissionStore"; -import WidgetStore from "../../src/stores/WidgetStore"; +import { type PosthogAnalytics } from "../../src/PosthogAnalytics"; +import { type SlidingSyncManager } from "../../src/SlidingSyncManager"; +import { type RoomNotificationStateStore } from "../../src/stores/notifications/RoomNotificationStateStore"; +import type RightPanelStore from "../../src/stores/right-panel/RightPanelStore"; +import { type RoomViewStore } from "../../src/stores/RoomViewStore"; +import { type SpaceStoreClass } from "../../src/stores/spaces/SpaceStore"; +import { type WidgetLayoutStore } from "../../src/stores/widgets/WidgetLayoutStore"; +import { type WidgetPermissionStore } from "../../src/stores/widgets/WidgetPermissionStore"; +import type WidgetStore from "../../src/stores/WidgetStore"; /** * A class which provides the same API as SdkContextClass but adds additional unsafe setters which can diff --git a/test/unit-tests/TextForEvent-test.ts b/test/unit-tests/TextForEvent-test.ts index 17437de894..7fc1a61b0a 100644 --- a/test/unit-tests/TextForEvent-test.ts +++ b/test/unit-tests/TextForEvent-test.ts @@ -10,16 +10,16 @@ import { EventType, HistoryVisibility, JoinRule, - MatrixClient, + type MatrixClient, MatrixEvent, - MRoomTopicEventContent, + type MRoomTopicEventContent, Room, - RoomMember, + type RoomMember, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { render } from "jest-matrix-react"; -import { ReactElement } from "react"; -import { Mocked, mocked } from "jest-mock"; +import { type ReactElement } from "react"; +import { type Mocked, mocked } from "jest-mock"; import { textForEvent } from "../../src/TextForEvent"; import SettingsStore from "../../src/settings/SettingsStore"; diff --git a/test/unit-tests/accessibility/RovingTabIndex-test.tsx b/test/unit-tests/accessibility/RovingTabIndex-test.tsx index e0efaf6b1b..00c0c67913 100644 --- a/test/unit-tests/accessibility/RovingTabIndex-test.tsx +++ b/test/unit-tests/accessibility/RovingTabIndex-test.tsx @@ -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 React, { HTMLAttributes } from "react"; +import React, { type HTMLAttributes } from "react"; import { act, render } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { - IState, + type IState, reducer, RovingTabIndexProvider, RovingTabIndexWrapper, diff --git a/test/unit-tests/async-components/dialogs/security/NewRecoveryMethodDialog-test.tsx b/test/unit-tests/async-components/dialogs/security/NewRecoveryMethodDialog-test.tsx index cca6526582..c49f2c48a4 100644 --- a/test/unit-tests/async-components/dialogs/security/NewRecoveryMethodDialog-test.tsx +++ b/test/unit-tests/async-components/dialogs/security/NewRecoveryMethodDialog-test.tsx @@ -6,7 +6,7 @@ */ import React from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { render, screen, act } from "jest-matrix-react"; import { waitFor } from "@testing-library/dom"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/audio/VoiceMessageRecording-test.ts b/test/unit-tests/audio/VoiceMessageRecording-test.ts index 8cb1ac3afb..aec34fa236 100644 --- a/test/unit-tests/audio/VoiceMessageRecording-test.ts +++ b/test/unit-tests/audio/VoiceMessageRecording-test.ts @@ -7,11 +7,11 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { UploadOpts, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { EncryptedFile } from "matrix-js-sdk/src/types"; +import { type UploadOpts, type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type EncryptedFile } from "matrix-js-sdk/src/types"; import { createVoiceMessageRecording, VoiceMessageRecording } from "../../../src/audio/VoiceMessageRecording"; -import { RecordingState, VoiceRecording } from "../../../src/audio/VoiceRecording"; +import { RecordingState, type VoiceRecording } from "../../../src/audio/VoiceRecording"; import { uploadFile } from "../../../src/ContentMessages"; import { stubClient } from "../../test-utils"; import { Playback } from "../../../src/audio/Playback"; diff --git a/test/unit-tests/autocomplete/RoomProvider-test.ts b/test/unit-tests/autocomplete/RoomProvider-test.ts index 80b9251134..3da37528ed 100644 --- a/test/unit-tests/autocomplete/RoomProvider-test.ts +++ b/test/unit-tests/autocomplete/RoomProvider-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import RoomProvider from "../../../src/autocomplete/RoomProvider"; import SettingsStore from "../../../src/settings/SettingsStore"; diff --git a/test/unit-tests/autocomplete/SpaceProvider-test.ts b/test/unit-tests/autocomplete/SpaceProvider-test.ts index 789a3bd4a6..9769d55660 100644 --- a/test/unit-tests/autocomplete/SpaceProvider-test.ts +++ b/test/unit-tests/autocomplete/SpaceProvider-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import SpaceProvider from "../../../src/autocomplete/SpaceProvider"; import SettingsStore from "../../../src/settings/SettingsStore"; diff --git a/test/unit-tests/components/structures/AutocompleteInput-test.tsx b/test/unit-tests/components/structures/AutocompleteInput-test.tsx index d34c521f97..901764f43b 100644 --- a/test/unit-tests/components/structures/AutocompleteInput-test.tsx +++ b/test/unit-tests/components/structures/AutocompleteInput-test.tsx @@ -10,8 +10,8 @@ import React from "react"; import { screen, render, fireEvent, waitFor, within, act } from "jest-matrix-react"; import * as TestUtils from "../../../test-utils"; -import AutocompleteProvider from "../../../../src/autocomplete/AutocompleteProvider"; -import { ICompletion } from "../../../../src/autocomplete/Autocompleter"; +import type AutocompleteProvider from "../../../../src/autocomplete/AutocompleteProvider"; +import { type ICompletion } from "../../../../src/autocomplete/Autocompleter"; import { AutocompleteInput } from "../../../../src/components/structures/AutocompleteInput"; describe("AutocompleteInput", () => { diff --git a/test/unit-tests/components/structures/LeftPanel-test.tsx b/test/unit-tests/components/structures/LeftPanel-test.tsx index 93f014567c..518dc948de 100644 --- a/test/unit-tests/components/structures/LeftPanel-test.tsx +++ b/test/unit-tests/components/structures/LeftPanel-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, RenderResult, screen } from "jest-matrix-react"; +import { render, type RenderResult, screen } from "jest-matrix-react"; import { mocked } from "jest-mock"; import LeftPanel from "../../../../src/components/structures/LeftPanel"; diff --git a/test/unit-tests/components/structures/LegacyCallEventGrouper-test.ts b/test/unit-tests/components/structures/LegacyCallEventGrouper-test.ts index 22fb5d300c..6c4fd23018 100644 --- a/test/unit-tests/components/structures/LegacyCallEventGrouper-test.ts +++ b/test/unit-tests/components/structures/LegacyCallEventGrouper-test.ts @@ -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 { MatrixClient, MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent, EventType } from "matrix-js-sdk/src/matrix"; import { CallState } from "matrix-js-sdk/src/webrtc/call"; import { stubClient } from "../../../test-utils"; diff --git a/test/unit-tests/components/structures/LoggedInView-test.tsx b/test/unit-tests/components/structures/LoggedInView-test.tsx index b4df9e2926..cddbf312f6 100644 --- a/test/unit-tests/components/structures/LoggedInView-test.tsx +++ b/test/unit-tests/components/structures/LoggedInView-test.tsx @@ -7,8 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, RenderResult } from "jest-matrix-react"; -import { ConditionKind, EventType, IPushRule, MatrixEvent, ClientEvent, PushRuleKind } from "matrix-js-sdk/src/matrix"; +import { render, type RenderResult } from "jest-matrix-react"; +import { + ConditionKind, + EventType, + type IPushRule, + MatrixEvent, + ClientEvent, + PushRuleKind, +} from "matrix-js-sdk/src/matrix"; import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler"; import { logger } from "matrix-js-sdk/src/logger"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/structures/MatrixChat-test.tsx b/test/unit-tests/components/structures/MatrixChat-test.tsx index 9891c07b4b..aade976327 100644 --- a/test/unit-tests/components/structures/MatrixChat-test.tsx +++ b/test/unit-tests/components/structures/MatrixChat-test.tsx @@ -10,18 +10,18 @@ Please see LICENSE files in the repository root for full details. // https://github.com/dumbmatter/fakeIndexedDB?tab=readme-ov-file#jsdom-often-used-with-jest import "core-js/stable/structured-clone"; import "fake-indexeddb/auto"; -import React, { ComponentProps } from "react"; -import { fireEvent, render, RenderResult, screen, waitFor, within, act } from "jest-matrix-react"; +import React, { type ComponentProps } from "react"; +import { fireEvent, render, type RenderResult, screen, waitFor, within, act } from "jest-matrix-react"; import fetchMock from "fetch-mock-jest"; -import { Mocked, mocked } from "jest-mock"; -import { ClientEvent, MatrixClient, MatrixEvent, Room, SyncState } from "matrix-js-sdk/src/matrix"; -import { MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler"; +import { type Mocked, mocked } from "jest-mock"; +import { ClientEvent, type MatrixClient, MatrixEvent, Room, SyncState } from "matrix-js-sdk/src/matrix"; +import { type MediaHandler } from "matrix-js-sdk/src/webrtc/mediaHandler"; import * as MatrixJs from "matrix-js-sdk/src/matrix"; import { completeAuthorizationCodeGrant } from "matrix-js-sdk/src/oidc/authorize"; import { logger } from "matrix-js-sdk/src/logger"; import { OidcError } from "matrix-js-sdk/src/oidc/error"; -import { BearerTokenResponse } from "matrix-js-sdk/src/oidc/validate"; -import { defer, IDeferred, sleep } from "matrix-js-sdk/src/utils"; +import { type BearerTokenResponse } from "matrix-js-sdk/src/oidc/validate"; +import { defer, type IDeferred, sleep } from "matrix-js-sdk/src/utils"; import { CryptoEvent, UserVerificationStatus } from "matrix-js-sdk/src/crypto-api"; import MatrixChat from "../../../../src/components/structures/MatrixChat"; @@ -46,7 +46,7 @@ import * as leaveRoomUtils from "../../../../src/utils/leave-behaviour"; import { OidcClientError } from "../../../../src/utils/oidc/error"; import LegacyCallHandler from "../../../../src/LegacyCallHandler"; import { CallStore } from "../../../../src/stores/CallStore"; -import { Call } from "../../../../src/models/Call"; +import { type Call } from "../../../../src/models/Call"; import { PosthogAnalytics } from "../../../../src/PosthogAnalytics"; import PlatformPeg from "../../../../src/PlatformPeg"; import EventIndexPeg from "../../../../src/indexing/EventIndexPeg"; @@ -60,7 +60,7 @@ import { ReleaseAnnouncementStore } from "../../../../src/stores/ReleaseAnnounce import { DRAFT_LAST_CLEANUP_KEY } from "../../../../src/DraftCleaner"; import { UIFeature } from "../../../../src/settings/UIFeature"; import AutoDiscoveryUtils from "../../../../src/utils/AutoDiscoveryUtils"; -import { ValidatedServerConfig } from "../../../../src/utils/ValidatedServerConfig"; +import { type ValidatedServerConfig } from "../../../../src/utils/ValidatedServerConfig"; import Modal from "../../../../src/Modal.tsx"; jest.mock("matrix-js-sdk/src/oidc/authorize", () => ({ diff --git a/test/unit-tests/components/structures/MatrixClientContextProvider-test.tsx b/test/unit-tests/components/structures/MatrixClientContextProvider-test.tsx index e5ae9d9769..2710dcd57a 100644 --- a/test/unit-tests/components/structures/MatrixClientContextProvider-test.tsx +++ b/test/unit-tests/components/structures/MatrixClientContextProvider-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { act, render } from "jest-matrix-react"; import React, { useContext } from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { CryptoEvent, UserVerificationStatus } from "matrix-js-sdk/src/crypto-api"; import MatrixClientContext from "../../../../src/contexts/MatrixClientContext"; diff --git a/test/unit-tests/components/structures/MessagePanel-test.tsx b/test/unit-tests/components/structures/MessagePanel-test.tsx index c881823903..96a88ba585 100644 --- a/test/unit-tests/components/structures/MessagePanel-test.tsx +++ b/test/unit-tests/components/structures/MessagePanel-test.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { EventEmitter } from "events"; -import { MatrixEvent, Room, RoomMember, Thread, ReceiptType } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, Room, RoomMember, type Thread, ReceiptType } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { render } from "jest-matrix-react"; @@ -27,8 +27,8 @@ import { mockClientMethodsEvents, mockClientMethodsUser, } from "../../../test-utils"; -import ResizeNotifier from "../../../../src/utils/ResizeNotifier"; -import { IRoomState } from "../../../../src/components/structures/RoomView"; +import type ResizeNotifier from "../../../../src/utils/ResizeNotifier"; +import { type IRoomState } from "../../../../src/components/structures/RoomView"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; import { ScopedRoomContextProvider } from "../../../../src/contexts/ScopedRoomContext.tsx"; diff --git a/test/unit-tests/components/structures/PictureInPictureDragger-test.tsx b/test/unit-tests/components/structures/PictureInPictureDragger-test.tsx index 6cbf0842a9..de9075d79f 100644 --- a/test/unit-tests/components/structures/PictureInPictureDragger-test.tsx +++ b/test/unit-tests/components/structures/PictureInPictureDragger-test.tsx @@ -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 React, { MouseEventHandler } from "react"; -import { screen, render, RenderResult } from "jest-matrix-react"; +import React, { type MouseEventHandler } from "react"; +import { screen, render, type RenderResult } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import PictureInPictureDragger, { - CreatePipChildren, + type CreatePipChildren, } from "../../../../src/components/structures/PictureInPictureDragger"; describe("PictureInPictureDragger", () => { diff --git a/test/unit-tests/components/structures/PipContainer-test.tsx b/test/unit-tests/components/structures/PipContainer-test.tsx index 06cad2a290..74b6577444 100644 --- a/test/unit-tests/components/structures/PipContainer-test.tsx +++ b/test/unit-tests/components/structures/PipContainer-test.tsx @@ -7,14 +7,19 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { mocked, Mocked } from "jest-mock"; +import { mocked, type Mocked } from "jest-mock"; import { screen, render, act, cleanup } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { MatrixClient, PendingEventOrdering, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; -import { Widget, ClientWidgetApi } from "matrix-widget-api"; -import { UserEvent } from "@testing-library/user-event/dist/types/setup/setup"; +import { + type MatrixClient, + PendingEventOrdering, + Room, + RoomStateEvent, + type RoomMember, +} from "matrix-js-sdk/src/matrix"; +import { Widget, type ClientWidgetApi } from "matrix-widget-api"; +import { type UserEvent } from "@testing-library/user-event/dist/types/setup/setup"; -import type { RoomMember } from "matrix-js-sdk/src/matrix"; import { useMockedCalls, MockedCall, @@ -36,7 +41,7 @@ import ActiveWidgetStore from "../../../../src/stores/ActiveWidgetStore"; import DMRoomMap from "../../../../src/utils/DMRoomMap"; import defaultDispatcher from "../../../../src/dispatcher/dispatcher"; import { Action } from "../../../../src/dispatcher/actions"; -import { ViewRoomPayload } from "../../../../src/dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../../src/dispatcher/payloads/ViewRoomPayload"; import { TestSdkContext } from "../../TestSdkContext"; import { RoomViewStore } from "../../../../src/stores/RoomViewStore"; import { Container, WidgetLayoutStore } from "../../../../src/stores/widgets/WidgetLayoutStore"; diff --git a/test/unit-tests/components/structures/RightPanel-test.tsx b/test/unit-tests/components/structures/RightPanel-test.tsx index 83f79665a9..5a5b9237af 100644 --- a/test/unit-tests/components/structures/RightPanel-test.tsx +++ b/test/unit-tests/components/structures/RightPanel-test.tsx @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen, waitFor } from "jest-matrix-react"; -import { mocked, MockedObject } from "jest-mock"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { mocked, type MockedObject } from "jest-mock"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import _RightPanel from "../../../../src/components/structures/RightPanel"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/components/structures/RoomSearchView-test.tsx b/test/unit-tests/components/structures/RoomSearchView-test.tsx index 56f19b830e..e52da13be6 100644 --- a/test/unit-tests/components/structures/RoomSearchView-test.tsx +++ b/test/unit-tests/components/structures/RoomSearchView-test.tsx @@ -11,12 +11,12 @@ import { mocked } from "jest-mock"; import { render, screen } from "jest-matrix-react"; import { Room, - MatrixClient, - IEvent, + type MatrixClient, + type IEvent, MatrixEvent, EventType, SearchResult, - ISearchResults, + type ISearchResults, } from "matrix-js-sdk/src/matrix"; import { defer } from "matrix-js-sdk/src/utils"; diff --git a/test/unit-tests/components/structures/RoomStatusBar-test.tsx b/test/unit-tests/components/structures/RoomStatusBar-test.tsx index 5d130b0205..844ed8ab2d 100644 --- a/test/unit-tests/components/structures/RoomStatusBar-test.tsx +++ b/test/unit-tests/components/structures/RoomStatusBar-test.tsx @@ -9,10 +9,10 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render } from "jest-matrix-react"; import { - MatrixClient, + type MatrixClient, PendingEventOrdering, EventStatus, - MatrixEvent, + type MatrixEvent, Room, MatrixError, } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/components/structures/RoomView-test.tsx b/test/unit-tests/components/structures/RoomView-test.tsx index 67bcacf407..3f60e3564f 100644 --- a/test/unit-tests/components/structures/RoomView-test.tsx +++ b/test/unit-tests/components/structures/RoomView-test.tsx @@ -6,15 +6,15 @@ 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, { createRef, RefObject } from "react"; -import { mocked, MockedObject } from "jest-mock"; +import React, { createRef, type RefObject } from "react"; +import { mocked, type MockedObject } from "jest-mock"; import { ClientEvent, EventTimeline, EventType, - IEvent, + type IEvent, JoinRule, - MatrixClient, + type MatrixClient, MatrixError, MatrixEvent, Room, @@ -22,13 +22,13 @@ import { RoomStateEvent, SearchResult, } from "matrix-js-sdk/src/matrix"; -import { CryptoApi, UserVerificationStatus, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; +import { type CryptoApi, UserVerificationStatus, CryptoEvent } from "matrix-js-sdk/src/crypto-api"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { fireEvent, render, screen, - RenderResult, + type RenderResult, waitForElementToBeRemoved, waitFor, act, @@ -54,7 +54,7 @@ import { import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; import { Action } from "../../../../src/dispatcher/actions"; import defaultDispatcher from "../../../../src/dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../../../src/dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../../src/dispatcher/payloads/ViewRoomPayload"; import { RoomView } from "../../../../src/components/structures/RoomView"; import ResizeNotifier from "../../../../src/utils/ResizeNotifier"; import SettingsStore from "../../../../src/settings/SettingsStore"; @@ -62,7 +62,7 @@ import { SettingLevel } from "../../../../src/settings/SettingLevel"; import DMRoomMap from "../../../../src/utils/DMRoomMap"; import { NotificationState } from "../../../../src/stores/notifications/NotificationState"; import { RightPanelPhases } from "../../../../src/stores/right-panel/RightPanelStorePhases"; -import { LocalRoom, LocalRoomState } from "../../../../src/models/LocalRoom"; +import { type LocalRoom, LocalRoomState } from "../../../../src/models/LocalRoom"; import { DirectoryMember } from "../../../../src/utils/direct-messages"; import { createDmLocalRoom } from "../../../../src/utils/dm/createDmLocalRoom"; import { UPDATE_EVENT } from "../../../../src/stores/AsyncStore"; @@ -71,11 +71,11 @@ import VoipUserMapper from "../../../../src/VoipUserMapper"; import WidgetUtils from "../../../../src/utils/WidgetUtils"; import { WidgetType } from "../../../../src/widgets/WidgetType"; import WidgetStore from "../../../../src/stores/WidgetStore"; -import { ViewRoomErrorPayload } from "../../../../src/dispatcher/payloads/ViewRoomErrorPayload"; +import { type ViewRoomErrorPayload } from "../../../../src/dispatcher/payloads/ViewRoomErrorPayload"; import { SearchScope } from "../../../../src/Searching"; import { MEGOLM_ENCRYPTION_ALGORITHM } from "../../../../src/utils/crypto"; import MatrixClientContext from "../../../../src/contexts/MatrixClientContext"; -import { ViewUserPayload } from "../../../../src/dispatcher/payloads/ViewUserPayload.ts"; +import { type ViewUserPayload } from "../../../../src/dispatcher/payloads/ViewUserPayload.ts"; describe("RoomView", () => { let cli: MockedObject; diff --git a/test/unit-tests/components/structures/SpaceHierarchy-test.tsx b/test/unit-tests/components/structures/SpaceHierarchy-test.tsx index c2b71e304f..cea704b90b 100644 --- a/test/unit-tests/components/structures/SpaceHierarchy-test.tsx +++ b/test/unit-tests/components/structures/SpaceHierarchy-test.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { mocked } from "jest-mock"; import { fireEvent, render, screen, waitFor, waitForElementToBeRemoved } from "jest-matrix-react"; -import { HierarchyRoom, JoinRule, MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type HierarchyRoom, JoinRule, type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { RoomHierarchy } from "matrix-js-sdk/src/room-hierarchy"; diff --git a/test/unit-tests/components/structures/SpaceRoomView-test.tsx b/test/unit-tests/components/structures/SpaceRoomView-test.tsx index 156f2d1cdb..f181b90576 100644 --- a/test/unit-tests/components/structures/SpaceRoomView-test.tsx +++ b/test/unit-tests/components/structures/SpaceRoomView-test.tsx @@ -6,8 +6,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { mocked, MockedObject } from "jest-mock"; -import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { mocked, type MockedObject } from "jest-mock"; +import { type MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { render, cleanup, screen, fireEvent } from "jest-matrix-react"; import { stubClient, mockPlatformPeg, unmockPlatformPeg, withClientContextRenderOptions } from "../../../test-utils"; diff --git a/test/unit-tests/components/structures/TabbedView-test.tsx b/test/unit-tests/components/structures/TabbedView-test.tsx index 9c30bc443a..e966601a60 100644 --- a/test/unit-tests/components/structures/TabbedView-test.tsx +++ b/test/unit-tests/components/structures/TabbedView-test.tsx @@ -10,7 +10,7 @@ import React from "react"; import { act, fireEvent, render } from "jest-matrix-react"; import TabbedView, { Tab, TabLocation } from "../../../../src/components/structures/TabbedView"; -import { NonEmptyArray } from "../../../../src/@types/common"; +import { type NonEmptyArray } from "../../../../src/@types/common"; import { _t } from "../../../../src/languageHandler"; describe("", () => { diff --git a/test/unit-tests/components/structures/ThreadPanel-test.tsx b/test/unit-tests/components/structures/ThreadPanel-test.tsx index c58194f0b9..e2596b072f 100644 --- a/test/unit-tests/components/structures/ThreadPanel-test.tsx +++ b/test/unit-tests/components/structures/ThreadPanel-test.tsx @@ -10,8 +10,8 @@ import React from "react"; import { render, screen, fireEvent, waitFor, getByRole } from "jest-matrix-react"; import { mocked } from "jest-mock"; import { - MatrixClient, - MatrixEvent, + type MatrixClient, + type MatrixEvent, PendingEventOrdering, Room, FeatureSupport, @@ -26,7 +26,7 @@ import { RoomPermalinkCreator } from "../../../../src/utils/permalinks/Permalink import ResizeNotifier from "../../../../src/utils/ResizeNotifier"; import { createTestClient, getRoomContext, mkRoom, mockPlatformPeg, stubClient } from "../../../test-utils"; import { mkThread } from "../../../test-utils/threads"; -import { IRoomState } from "../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../src/components/structures/RoomView"; import { ScopedRoomContextProvider } from "../../../../src/contexts/ScopedRoomContext.tsx"; jest.mock("../../../../src/utils/Feedback"); diff --git a/test/unit-tests/components/structures/ThreadView-test.tsx b/test/unit-tests/components/structures/ThreadView-test.tsx index f67e2f28a3..365e72b3db 100644 --- a/test/unit-tests/components/structures/ThreadView-test.tsx +++ b/test/unit-tests/components/structures/ThreadView-test.tsx @@ -6,16 +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 { act, getByTestId, render, RenderResult, waitFor } from "jest-matrix-react"; +import { act, getByTestId, render, type RenderResult, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { mocked } from "jest-mock"; import { MsgType, RelationType, EventStatus, - MatrixEvent, + type MatrixEvent, Room, - MatrixClient, + type MatrixClient, PendingEventOrdering, THREAD_RELATION_TYPE, } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/components/structures/TimelinePanel-test.tsx b/test/unit-tests/components/structures/TimelinePanel-test.tsx index 2e10f74a69..b480051182 100644 --- a/test/unit-tests/components/structures/TimelinePanel-test.tsx +++ b/test/unit-tests/components/structures/TimelinePanel-test.tsx @@ -11,7 +11,7 @@ import { ReceiptType, EventTimelineSet, EventType, - MatrixClient, + type MatrixClient, MatrixEvent, PendingEventOrdering, RelationType, @@ -29,7 +29,7 @@ import { } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import React from "react"; -import { Mocked, mocked } from "jest-mock"; +import { type Mocked, mocked } from "jest-mock"; import { forEachRight } from "lodash"; import TimelinePanel from "../../../../src/components/structures/TimelinePanel"; diff --git a/test/unit-tests/components/structures/UserMenu-test.tsx b/test/unit-tests/components/structures/UserMenu-test.tsx index b6eb1bef5d..177adbaf11 100644 --- a/test/unit-tests/components/structures/UserMenu-test.tsx +++ b/test/unit-tests/components/structures/UserMenu-test.tsx @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen, waitFor } from "jest-matrix-react"; -import { DEVICE_CODE_SCOPE, MatrixClient, Room } from "matrix-js-sdk/src/matrix"; -import { CryptoApi } from "matrix-js-sdk/src/crypto-api"; +import { DEVICE_CODE_SCOPE, type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; +import { type CryptoApi } from "matrix-js-sdk/src/crypto-api"; import { mocked } from "jest-mock"; import fetchMock from "fetch-mock-jest"; diff --git a/test/unit-tests/components/structures/auth/ForgotPassword-test.tsx b/test/unit-tests/components/structures/auth/ForgotPassword-test.tsx index b55fd2c99c..3ff77f9be8 100644 --- a/test/unit-tests/components/structures/auth/ForgotPassword-test.tsx +++ b/test/unit-tests/components/structures/auth/ForgotPassword-test.tsx @@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { mocked } from "jest-mock"; -import { render, RenderResult, screen, waitFor, cleanup } from "jest-matrix-react"; +import { render, type RenderResult, screen, waitFor, cleanup } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { MatrixClient, createClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, createClient } from "matrix-js-sdk/src/matrix"; import ForgotPassword from "../../../../../src/components/structures/auth/ForgotPassword"; -import { ValidatedServerConfig } from "../../../../../src/utils/ValidatedServerConfig"; +import { type ValidatedServerConfig } from "../../../../../src/utils/ValidatedServerConfig"; import { clearAllModals, filterConsole, stubClient, waitEnoughCyclesForModal } from "../../../../test-utils"; import AutoDiscoveryUtils from "../../../../../src/utils/AutoDiscoveryUtils"; diff --git a/test/unit-tests/components/structures/auth/Login-test.tsx b/test/unit-tests/components/structures/auth/Login-test.tsx index ee3c608256..d6fec89dcb 100644 --- a/test/unit-tests/components/structures/auth/Login-test.tsx +++ b/test/unit-tests/components/structures/auth/Login-test.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { fireEvent, render, screen, waitForElementToBeRemoved } from "jest-matrix-react"; -import { mocked, MockedObject } from "jest-mock"; +import { mocked, type MockedObject } from "jest-mock"; import fetchMock from "fetch-mock-jest"; -import { DELEGATED_OIDC_COMPATIBILITY, IdentityProviderBrand, OidcClientConfig } from "matrix-js-sdk/src/matrix"; +import { DELEGATED_OIDC_COMPATIBILITY, IdentityProviderBrand, type OidcClientConfig } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import * as Matrix from "matrix-js-sdk/src/matrix"; import { OidcError } from "matrix-js-sdk/src/oidc/error"; @@ -17,7 +17,7 @@ import { OidcError } from "matrix-js-sdk/src/oidc/error"; import SdkConfig from "../../../../../src/SdkConfig"; import { mkServerConfig, mockPlatformPeg, unmockPlatformPeg } from "../../../../test-utils"; import Login from "../../../../../src/components/structures/auth/Login"; -import BasePlatform from "../../../../../src/BasePlatform"; +import type BasePlatform from "../../../../../src/BasePlatform"; import SettingsStore from "../../../../../src/settings/SettingsStore"; import * as registerClientUtils from "../../../../../src/utils/oidc/registerClient"; import { makeDelegatedAuthConfig } from "../../../../test-utils/oidc"; diff --git a/test/unit-tests/components/structures/auth/LoginSplashView-test.tsx b/test/unit-tests/components/structures/auth/LoginSplashView-test.tsx index 1758216730..c2eed442c5 100644 --- a/test/unit-tests/components/structures/auth/LoginSplashView-test.tsx +++ b/test/unit-tests/components/structures/auth/LoginSplashView-test.tsx @@ -6,8 +6,8 @@ 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, render, RenderResult } from "jest-matrix-react"; -import React, { ComponentProps } from "react"; +import { act, render, type RenderResult } from "jest-matrix-react"; +import React, { type ComponentProps } from "react"; import EventEmitter from "events"; import { CryptoEvent } from "matrix-js-sdk/src/crypto-api"; import { sleep } from "matrix-js-sdk/src/utils"; diff --git a/test/unit-tests/components/structures/auth/Registration-test.tsx b/test/unit-tests/components/structures/auth/Registration-test.tsx index a8c170eac7..0a24fcf25b 100644 --- a/test/unit-tests/components/structures/auth/Registration-test.tsx +++ b/test/unit-tests/components/structures/auth/Registration-test.tsx @@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { fireEvent, render, screen, waitFor, waitForElementToBeRemoved } from "jest-matrix-react"; -import { createClient, MatrixClient, MatrixError, OidcClientConfig } from "matrix-js-sdk/src/matrix"; -import { mocked, MockedObject } from "jest-mock"; +import { createClient, type MatrixClient, MatrixError, type OidcClientConfig } from "matrix-js-sdk/src/matrix"; +import { mocked, type MockedObject } from "jest-mock"; import fetchMock from "fetch-mock-jest"; import SdkConfig, { DEFAULTS } from "../../../../../src/SdkConfig"; diff --git a/test/unit-tests/components/views/VerificationShowSas-test.tsx b/test/unit-tests/components/views/VerificationShowSas-test.tsx index 3e29e2098c..f9312e906e 100644 --- a/test/unit-tests/components/views/VerificationShowSas-test.tsx +++ b/test/unit-tests/components/views/VerificationShowSas-test.tsx @@ -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 { EmojiMapping } from "matrix-js-sdk/src/crypto-api"; +import { type EmojiMapping } from "matrix-js-sdk/src/crypto-api"; import { tEmoji } from "../../../../src/components/views/verification/VerificationShowSas"; diff --git a/test/unit-tests/components/views/audio_messages/RecordingPlayback-test.tsx b/test/unit-tests/components/views/audio_messages/RecordingPlayback-test.tsx index 6c96aacb8e..a84ecb1e16 100644 --- a/test/unit-tests/components/views/audio_messages/RecordingPlayback-test.tsx +++ b/test/unit-tests/components/views/audio_messages/RecordingPlayback-test.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { mocked } from "jest-mock"; import { logger } from "matrix-js-sdk/src/logger"; -import { fireEvent, render, RenderResult } from "jest-matrix-react"; +import { fireEvent, render, type RenderResult } from "jest-matrix-react"; import RecordingPlayback, { PlaybackLayout, @@ -18,7 +18,7 @@ import { Playback } from "../../../../../src/audio/Playback"; import { TimelineRenderingType } from "../../../../../src/contexts/RoomContext"; import { createAudioContext } from "../../../../../src/audio/compat"; import { flushPromises } from "../../../../test-utils"; -import { IRoomState } from "../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../src/components/structures/RoomView"; import { ScopedRoomContextProvider } from "../../../../../src/contexts/ScopedRoomContext.tsx"; jest.mock("../../../../../src/WorkerManager", () => ({ diff --git a/test/unit-tests/components/views/audio_messages/SeekBar-test.tsx b/test/unit-tests/components/views/audio_messages/SeekBar-test.tsx index 95aaa7ada8..19537a2b98 100644 --- a/test/unit-tests/components/views/audio_messages/SeekBar-test.tsx +++ b/test/unit-tests/components/views/audio_messages/SeekBar-test.tsx @@ -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 React, { createRef, RefObject } from "react"; +import React, { createRef, type RefObject } from "react"; import { mocked } from "jest-mock"; -import { act, fireEvent, render, RenderResult } from "jest-matrix-react"; +import { act, fireEvent, render, type RenderResult } from "jest-matrix-react"; -import { Playback } from "../../../../../src/audio/Playback"; +import { type Playback } from "../../../../../src/audio/Playback"; import { createTestPlayback } from "../../../../test-utils/audio"; import SeekBar from "../../../../../src/components/views/audio_messages/SeekBar"; diff --git a/test/unit-tests/components/views/auth/InteractiveAuthEntryComponents-test.tsx b/test/unit-tests/components/views/auth/InteractiveAuthEntryComponents-test.tsx index 5e145d2bf9..adba9d1f75 100644 --- a/test/unit-tests/components/views/auth/InteractiveAuthEntryComponents-test.tsx +++ b/test/unit-tests/components/views/auth/InteractiveAuthEntryComponents-test.tsx @@ -10,7 +10,7 @@ import React from "react"; import { render, screen, waitFor, act, fireEvent } from "jest-matrix-react"; import { AuthType } from "matrix-js-sdk/src/interactive-auth"; import userEvent from "@testing-library/user-event"; -import { Policy } from "matrix-js-sdk/src/matrix"; +import { type Policy } from "matrix-js-sdk/src/matrix"; import { EmailIdentityAuthEntry, diff --git a/test/unit-tests/components/views/auth/RegistrationToken-test.tsx b/test/unit-tests/components/views/auth/RegistrationToken-test.tsx index cf9f8268a0..1ae42d6188 100644 --- a/test/unit-tests/components/views/auth/RegistrationToken-test.tsx +++ b/test/unit-tests/components/views/auth/RegistrationToken-test.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, render, RenderResult } from "jest-matrix-react"; +import { fireEvent, render, type RenderResult } from "jest-matrix-react"; import InteractiveAuthComponent from "../../../../../src/components/structures/InteractiveAuth"; import { flushPromises, getMockClientWithEventEmitter, unmockClientPeg } from "../../../../test-utils"; diff --git a/test/unit-tests/components/views/avatars/DecoratedRoomAvatar-test.tsx b/test/unit-tests/components/views/avatars/DecoratedRoomAvatar-test.tsx index c1c6a2ce98..f4a386f9cb 100644 --- a/test/unit-tests/components/views/avatars/DecoratedRoomAvatar-test.tsx +++ b/test/unit-tests/components/views/avatars/DecoratedRoomAvatar-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { render, waitFor } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { JoinRule, MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix"; +import { JoinRule, type MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix"; import React from "react"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/views/avatars/MemberAvatar-test.tsx b/test/unit-tests/components/views/avatars/MemberAvatar-test.tsx index 1239d7e5ad..2e934dc0ce 100644 --- a/test/unit-tests/components/views/avatars/MemberAvatar-test.tsx +++ b/test/unit-tests/components/views/avatars/MemberAvatar-test.tsx @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import { getByTestId, render, waitFor } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { MatrixClient, PendingEventOrdering, Room, RoomMember } from "matrix-js-sdk/src/matrix"; -import React, { ComponentProps } from "react"; +import { type MatrixClient, PendingEventOrdering, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentProps } from "react"; import MemberAvatar from "../../../../../src/components/views/avatars/MemberAvatar"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/components/views/avatars/RoomAvatar-test.tsx b/test/unit-tests/components/views/avatars/RoomAvatar-test.tsx index e3e8715cfb..8e7a446cbd 100644 --- a/test/unit-tests/components/views/avatars/RoomAvatar-test.tsx +++ b/test/unit-tests/components/views/avatars/RoomAvatar-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render } from "jest-matrix-react"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import RoomAvatar from "../../../../../src/components/views/avatars/RoomAvatar"; diff --git a/test/unit-tests/components/views/avatars/WithPresenceIndicator-test.tsx b/test/unit-tests/components/views/avatars/WithPresenceIndicator-test.tsx index f5c26aa7ef..61cec3d4fa 100644 --- a/test/unit-tests/components/views/avatars/WithPresenceIndicator-test.tsx +++ b/test/unit-tests/components/views/avatars/WithPresenceIndicator-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { render, waitFor } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { MatrixClient, PendingEventOrdering, Room, RoomMember, User } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, PendingEventOrdering, Room, RoomMember, User } from "matrix-js-sdk/src/matrix"; import React from "react"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/views/beacon/BeaconListItem-test.tsx b/test/unit-tests/components/views/beacon/BeaconListItem-test.tsx index f44a1d72db..7773839223 100644 --- a/test/unit-tests/components/views/beacon/BeaconListItem-test.tsx +++ b/test/unit-tests/components/views/beacon/BeaconListItem-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { act, fireEvent, render } from "jest-matrix-react"; -import { Beacon, RoomMember, MatrixEvent, LocationAssetType } from "matrix-js-sdk/src/matrix"; +import { Beacon, RoomMember, type MatrixEvent, LocationAssetType } from "matrix-js-sdk/src/matrix"; import BeaconListItem from "../../../../../src/components/views/beacon/BeaconListItem"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; diff --git a/test/unit-tests/components/views/beacon/BeaconMarker-test.tsx b/test/unit-tests/components/views/beacon/BeaconMarker-test.tsx index 625d61b1c3..8e24c6d841 100644 --- a/test/unit-tests/components/views/beacon/BeaconMarker-test.tsx +++ b/test/unit-tests/components/views/beacon/BeaconMarker-test.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { act, render, screen, waitFor } from "jest-matrix-react"; import * as maplibregl from "maplibre-gl"; -import { Beacon, Room, RoomMember, MatrixEvent, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix"; +import { Beacon, type Room, RoomMember, type MatrixEvent, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix"; import BeaconMarker from "../../../../../src/components/views/beacon/BeaconMarker"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; diff --git a/test/unit-tests/components/views/beacon/BeaconViewDialog-test.tsx b/test/unit-tests/components/views/beacon/BeaconViewDialog-test.tsx index 2c879468d6..5895929640 100644 --- a/test/unit-tests/components/views/beacon/BeaconViewDialog-test.tsx +++ b/test/unit-tests/components/views/beacon/BeaconViewDialog-test.tsx @@ -7,8 +7,14 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { act, fireEvent, render, RenderResult, waitFor } from "jest-matrix-react"; -import { MatrixClient, MatrixEvent, Room, RoomMember, getBeaconInfoIdentifier } from "matrix-js-sdk/src/matrix"; +import { act, fireEvent, render, type RenderResult, waitFor } from "jest-matrix-react"; +import { + type MatrixClient, + type MatrixEvent, + type Room, + RoomMember, + getBeaconInfoIdentifier, +} from "matrix-js-sdk/src/matrix"; import * as maplibregl from "maplibre-gl"; import { mocked } from "jest-mock"; diff --git a/test/unit-tests/components/views/beacon/DialogSidebar-test.tsx b/test/unit-tests/components/views/beacon/DialogSidebar-test.tsx index ca76d6fd59..15a56ed290 100644 --- a/test/unit-tests/components/views/beacon/DialogSidebar-test.tsx +++ b/test/unit-tests/components/views/beacon/DialogSidebar-test.tsx @@ -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 React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import { act, fireEvent, render } from "jest-matrix-react"; import DialogSidebar from "../../../../../src/components/views/beacon/DialogSidebar"; diff --git a/test/unit-tests/components/views/beacon/LeftPanelLiveShareWarning-test.tsx b/test/unit-tests/components/views/beacon/LeftPanelLiveShareWarning-test.tsx index aa83fefb9a..af60e87324 100644 --- a/test/unit-tests/components/views/beacon/LeftPanelLiveShareWarning-test.tsx +++ b/test/unit-tests/components/views/beacon/LeftPanelLiveShareWarning-test.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { mocked } from "jest-mock"; import { act, fireEvent, render } from "jest-matrix-react"; -import { Beacon, BeaconIdentifier } from "matrix-js-sdk/src/matrix"; +import { Beacon, type BeaconIdentifier } from "matrix-js-sdk/src/matrix"; import LeftPanelLiveShareWarning from "../../../../../src/components/views/beacon/LeftPanelLiveShareWarning"; import { OwnBeaconStore, OwnBeaconStoreEvent } from "../../../../../src/stores/OwnBeaconStore"; diff --git a/test/unit-tests/components/views/beacon/RoomCallBanner-test.tsx b/test/unit-tests/components/views/beacon/RoomCallBanner-test.tsx index e8fefe0571..38cb77eb03 100644 --- a/test/unit-tests/components/views/beacon/RoomCallBanner-test.tsx +++ b/test/unit-tests/components/views/beacon/RoomCallBanner-test.tsx @@ -7,10 +7,16 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room, PendingEventOrdering, MatrixClient, RoomMember, RoomStateEvent } from "matrix-js-sdk/src/matrix"; -import { ClientWidgetApi, Widget } from "matrix-widget-api"; +import { + Room, + PendingEventOrdering, + type MatrixClient, + type RoomMember, + RoomStateEvent, +} from "matrix-js-sdk/src/matrix"; +import { type ClientWidgetApi, Widget } from "matrix-widget-api"; import { act, cleanup, render, screen } from "jest-matrix-react"; -import { mocked, Mocked } from "jest-mock"; +import { mocked, type Mocked } from "jest-mock"; import { mkRoomMember, diff --git a/test/unit-tests/components/views/beta/BetaCard-test.tsx b/test/unit-tests/components/views/beta/BetaCard-test.tsx index 42efb1cd34..06ede990e6 100644 --- a/test/unit-tests/components/views/beta/BetaCard-test.tsx +++ b/test/unit-tests/components/views/beta/BetaCard-test.tsx @@ -13,8 +13,8 @@ import { render, screen } from "jest-matrix-react"; import { shouldShowFeedback } from "../../../../../src/utils/Feedback"; import BetaCard from "../../../../../src/components/views/beta/BetaCard"; import SettingsStore from "../../../../../src/settings/SettingsStore"; -import { TranslationKey } from "../../../../../src/languageHandler"; -import { FeatureSettingKey } from "../../../../../src/settings/Settings.tsx"; +import { type TranslationKey } from "../../../../../src/languageHandler"; +import { type FeatureSettingKey } from "../../../../../src/settings/Settings.tsx"; jest.mock("../../../../../src/utils/Feedback"); jest.mock("../../../../../src/settings/SettingsStore"); diff --git a/test/unit-tests/components/views/context_menus/MessageContextMenu-test.tsx b/test/unit-tests/components/views/context_menus/MessageContextMenu-test.tsx index 1cfc1a03f6..411cc5d0e4 100644 --- a/test/unit-tests/components/views/context_menus/MessageContextMenu-test.tsx +++ b/test/unit-tests/components/views/context_menus/MessageContextMenu-test.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, render, RenderResult, screen, waitFor } from "jest-matrix-react"; +import { fireEvent, render, type RenderResult, screen, waitFor } from "jest-matrix-react"; import { EventStatus, MatrixEvent, Room, PendingEventOrdering, - BeaconIdentifier, + type BeaconIdentifier, Beacon, getBeaconInfoIdentifier, EventType, @@ -28,7 +28,7 @@ import userEvent from "@testing-library/user-event"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; import { TimelineRenderingType } from "../../../../../src/contexts/RoomContext"; -import { IRoomState } from "../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../src/components/structures/RoomView"; import { canEditContent } from "../../../../../src/utils/EventUtils"; import { copyPlaintext, getSelectedText } from "../../../../../src/utils/strings"; import MessageContextMenu from "../../../../../src/components/views/context_menus/MessageContextMenu"; diff --git a/test/unit-tests/components/views/context_menus/RoomGeneralContextMenu-test.tsx b/test/unit-tests/components/views/context_menus/RoomGeneralContextMenu-test.tsx index 10aade5b54..6c71acc09e 100644 --- a/test/unit-tests/components/views/context_menus/RoomGeneralContextMenu-test.tsx +++ b/test/unit-tests/components/views/context_menus/RoomGeneralContextMenu-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { fireEvent, getByLabelText, render, screen } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { ReceiptType, MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix"; +import { ReceiptType, type MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import React from "react"; import userEvent from "@testing-library/user-event"; @@ -17,7 +17,7 @@ import { sleep } from "matrix-js-sdk/src/utils"; import { ChevronFace } from "../../../../../src/components/structures/ContextMenu"; import { RoomGeneralContextMenu, - RoomGeneralContextMenuProps, + type RoomGeneralContextMenuProps, } from "../../../../../src/components/views/context_menus/RoomGeneralContextMenu"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/components/views/context_menus/SpaceContextMenu-test.tsx b/test/unit-tests/components/views/context_menus/SpaceContextMenu-test.tsx index 8b8a565aa4..eab7e4eef9 100644 --- a/test/unit-tests/components/views/context_menus/SpaceContextMenu-test.tsx +++ b/test/unit-tests/components/views/context_menus/SpaceContextMenu-test.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; -import { Mocked, mocked } from "jest-mock"; -import { prettyDOM, render, RenderResult, screen } from "jest-matrix-react"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; +import { type Mocked, mocked } from "jest-mock"; +import { prettyDOM, render, type RenderResult, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import SpaceContextMenu from "../../../../../src/components/views/context_menus/SpaceContextMenu"; diff --git a/test/unit-tests/components/views/context_menus/ThreadListContextMenu-test.tsx b/test/unit-tests/components/views/context_menus/ThreadListContextMenu-test.tsx index 0ef43d1b80..23dd63e9f2 100644 --- a/test/unit-tests/components/views/context_menus/ThreadListContextMenu-test.tsx +++ b/test/unit-tests/components/views/context_menus/ThreadListContextMenu-test.tsx @@ -9,11 +9,11 @@ Please see LICENSE files in the repository root for full details. import { getByTestId, render, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { mocked } from "jest-mock"; -import { MatrixClient, PendingEventOrdering, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, PendingEventOrdering, type MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import React from "react"; import ThreadListContextMenu, { - ThreadListContextMenuProps, + type ThreadListContextMenuProps, } from "../../../../../src/components/views/context_menus/ThreadListContextMenu"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; diff --git a/test/unit-tests/components/views/context_menus/WidgetContextMenu-test.tsx b/test/unit-tests/components/views/context_menus/WidgetContextMenu-test.tsx index 37dd192525..41b572c959 100644 --- a/test/unit-tests/components/views/context_menus/WidgetContextMenu-test.tsx +++ b/test/unit-tests/components/views/context_menus/WidgetContextMenu-test.tsx @@ -7,19 +7,19 @@ 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, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import { screen, render } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { MatrixWidgetType } from "matrix-widget-api"; import { - ApprovalOpts, - WidgetInfo, + type ApprovalOpts, + type WidgetInfo, WidgetLifecycle, } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WidgetLifecycle"; import { WidgetContextMenu } from "../../../../../src/components/views/context_menus/WidgetContextMenu"; -import { IApp } from "../../../../../src/stores/WidgetStore"; +import { type IApp } from "../../../../../src/stores/WidgetStore"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import WidgetUtils from "../../../../../src/utils/WidgetUtils"; import { ModuleRunner } from "../../../../../src/modules/ModuleRunner"; diff --git a/test/unit-tests/components/views/dialogs/AccessSecretStorageDialog-test.tsx b/test/unit-tests/components/views/dialogs/AccessSecretStorageDialog-test.tsx index cb877d8a11..03f6520dbd 100644 --- a/test/unit-tests/components/views/dialogs/AccessSecretStorageDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/AccessSecretStorageDialog-test.tsx @@ -6,8 +6,8 @@ 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, { ComponentProps } from "react"; -import { SecretStorage, MatrixClient } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentProps } from "react"; +import { type SecretStorage, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { act, fireEvent, render, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/views/dialogs/AskInviteAnywayDialog-test.tsx b/test/unit-tests/components/views/dialogs/AskInviteAnywayDialog-test.tsx index 713d90a3ef..f0e450f9e4 100644 --- a/test/unit-tests/components/views/dialogs/AskInviteAnywayDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/AskInviteAnywayDialog-test.tsx @@ -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 { getByText, render, RenderResult } from "jest-matrix-react"; +import { getByText, render, type RenderResult } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import React from "react"; import AskInviteAnywayDialog, { - AskInviteAnywayDialogProps, + type AskInviteAnywayDialogProps, } from "../../../../../src/components/views/dialogs/AskInviteAnywayDialog"; import SettingsStore from "../../../../../src/settings/SettingsStore"; diff --git a/test/unit-tests/components/views/dialogs/ChangelogDialog-test.tsx b/test/unit-tests/components/views/dialogs/ChangelogDialog-test.tsx index fd7b82c590..f240e97169 100644 --- a/test/unit-tests/components/views/dialogs/ChangelogDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/ChangelogDialog-test.tsx @@ -11,7 +11,7 @@ import fetchMock from "fetch-mock-jest"; import { render, screen, waitForElementToBeRemoved } from "jest-matrix-react"; import ChangelogDialog, { - DevelopVersionString, + type DevelopVersionString, parseVersion, } from "../../../../../src/components/views/dialogs/ChangelogDialog"; diff --git a/test/unit-tests/components/views/dialogs/ConfirmRedactDialog-test.tsx b/test/unit-tests/components/views/dialogs/ConfirmRedactDialog-test.tsx index 9ba84b58e4..8e16639fef 100644 --- a/test/unit-tests/components/views/dialogs/ConfirmRedactDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/ConfirmRedactDialog-test.tsx @@ -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 { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { screen, act } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/views/dialogs/DevtoolsDialog-test.tsx b/test/unit-tests/components/views/dialogs/DevtoolsDialog-test.tsx index 89dde08393..34f8daa88a 100644 --- a/test/unit-tests/components/views/dialogs/DevtoolsDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/DevtoolsDialog-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { getByLabelText, getAllByLabelText, render } from "jest-matrix-react"; -import { Room, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { Room, type MatrixClient } from "matrix-js-sdk/src/matrix"; import userEvent from "@testing-library/user-event"; import { stubClient } from "../../../../test-utils"; diff --git a/test/unit-tests/components/views/dialogs/ExportDialog-test.tsx b/test/unit-tests/components/views/dialogs/ExportDialog-test.tsx index 8417ffedb6..6dcb70afd2 100644 --- a/test/unit-tests/components/views/dialogs/ExportDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/ExportDialog-test.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, render, RenderResult, waitFor } from "jest-matrix-react"; +import { fireEvent, render, type RenderResult, waitFor } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import ExportDialog from "../../../../../src/components/views/dialogs/ExportDialog"; import { ExportType, ExportFormat } from "../../../../../src/utils/exportUtils/exportUtils"; diff --git a/test/unit-tests/components/views/dialogs/ForwardDialog-test.tsx b/test/unit-tests/components/views/dialogs/ForwardDialog-test.tsx index 9aa842ee2c..b6ab8a7b38 100644 --- a/test/unit-tests/components/views/dialogs/ForwardDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/ForwardDialog-test.tsx @@ -16,7 +16,7 @@ import { M_TIMESTAMP, M_TEXT, } from "matrix-js-sdk/src/matrix"; -import { act, fireEvent, getByTestId, render, RenderResult, screen, waitFor } from "jest-matrix-react"; +import { act, fireEvent, getByTestId, render, type RenderResult, screen, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { sleep } from "matrix-js-sdk/src/utils"; diff --git a/test/unit-tests/components/views/dialogs/IncomingSasDialog-test.tsx b/test/unit-tests/components/views/dialogs/IncomingSasDialog-test.tsx index 644b4e0f8b..cf9e103ee6 100644 --- a/test/unit-tests/components/views/dialogs/IncomingSasDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/IncomingSasDialog-test.tsx @@ -8,13 +8,13 @@ Please see LICENSE files in the repository root for full details. import { act, render } from "jest-matrix-react"; import React from "react"; -import { Mocked } from "jest-mock"; +import { type Mocked } from "jest-mock"; import { - EmojiMapping, - ShowSasCallbacks, - Verifier, + type EmojiMapping, + type ShowSasCallbacks, + type Verifier, VerifierEvent, - VerifierEventHandlerMap, + type VerifierEventHandlerMap, } from "matrix-js-sdk/src/crypto-api"; import { TypedEventEmitter } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/components/views/dialogs/InviteDialog-test.tsx b/test/unit-tests/components/views/dialogs/InviteDialog-test.tsx index 0a319cc845..02d0d8dd2e 100644 --- a/test/unit-tests/components/views/dialogs/InviteDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/InviteDialog-test.tsx @@ -9,10 +9,10 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { fireEvent, render, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { RoomType, MatrixClient, MatrixError, Room } from "matrix-js-sdk/src/matrix"; +import { RoomType, type MatrixClient, MatrixError, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { sleep } from "matrix-js-sdk/src/utils"; -import { mocked, Mocked } from "jest-mock"; +import { mocked, type Mocked } from "jest-mock"; import InviteDialog from "../../../../../src/components/views/dialogs/InviteDialog"; import { InviteKind } from "../../../../../src/components/views/dialogs/InviteDialogTypes"; @@ -27,10 +27,10 @@ import { } from "../../../../test-utils"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; import SdkConfig from "../../../../../src/SdkConfig"; -import { ValidatedServerConfig } from "../../../../../src/utils/ValidatedServerConfig"; -import { IConfigOptions } from "../../../../../src/IConfigOptions"; +import { type ValidatedServerConfig } from "../../../../../src/utils/ValidatedServerConfig"; +import { type IConfigOptions } from "../../../../../src/IConfigOptions"; import { SdkContextClass } from "../../../../../src/contexts/SDKContext"; -import { IProfileInfo } from "../../../../../src/hooks/useProfileInfo"; +import { type IProfileInfo } from "../../../../../src/hooks/useProfileInfo"; import { DirectoryMember, startDmOnFirstMessage } from "../../../../../src/utils/direct-messages"; import SettingsStore from "../../../../../src/settings/SettingsStore"; diff --git a/test/unit-tests/components/views/dialogs/LogoutDialog-test.tsx b/test/unit-tests/components/views/dialogs/LogoutDialog-test.tsx index 6c1315d5ac..cee615380f 100644 --- a/test/unit-tests/components/views/dialogs/LogoutDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/LogoutDialog-test.tsx @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { mocked, MockedObject } from "jest-mock"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; -import { CryptoApi, KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; -import { fireEvent, render, RenderResult, screen } from "jest-matrix-react"; +import { mocked, type MockedObject } from "jest-mock"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type CryptoApi, type KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; +import { fireEvent, render, type RenderResult, screen } from "jest-matrix-react"; import { filterConsole, getMockClientWithEventEmitter, mockClientMethodsCrypto } from "../../../../test-utils"; import LogoutDialog from "../../../../../src/components/views/dialogs/LogoutDialog"; diff --git a/test/unit-tests/components/views/dialogs/MessageEditHistoryDialog-test.tsx b/test/unit-tests/components/views/dialogs/MessageEditHistoryDialog-test.tsx index 1969867bcd..2f0b0a4974 100644 --- a/test/unit-tests/components/views/dialogs/MessageEditHistoryDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/MessageEditHistoryDialog-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, RenderResult, waitForElementToBeRemoved } from "jest-matrix-react"; +import { render, type RenderResult, waitForElementToBeRemoved } from "jest-matrix-react"; import { EventType, MatrixEvent } from "matrix-js-sdk/src/matrix"; import type { MatrixClient } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/components/views/dialogs/ServerPickerDialog-test.tsx b/test/unit-tests/components/views/dialogs/ServerPickerDialog-test.tsx index b4a4b6e756..7dbb08ac20 100644 --- a/test/unit-tests/components/views/dialogs/ServerPickerDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/ServerPickerDialog-test.tsx @@ -13,7 +13,7 @@ import fetchMock from "fetch-mock-jest"; import ServerPickerDialog from "../../../../../src/components/views/dialogs/ServerPickerDialog"; import SdkConfig from "../../../../../src/SdkConfig"; import { flushPromises } from "../../../../test-utils"; -import { ValidatedServerConfig } from "../../../../../src/utils/ValidatedServerConfig"; +import { type ValidatedServerConfig } from "../../../../../src/utils/ValidatedServerConfig"; /** The matrix versions our mock server claims to support */ const SERVER_SUPPORTED_MATRIX_VERSIONS = ["v1.1", "v1.5", "v1.6", "v1.8", "v1.9"]; diff --git a/test/unit-tests/components/views/dialogs/ShareDialog-test.tsx b/test/unit-tests/components/views/dialogs/ShareDialog-test.tsx index 93beaec711..f4c4154cf0 100644 --- a/test/unit-tests/components/views/dialogs/ShareDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/ShareDialog-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixClient, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix"; import { render, screen, act } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { waitFor } from "@testing-library/dom"; diff --git a/test/unit-tests/components/views/dialogs/SpotlightDialog-test.tsx b/test/unit-tests/components/views/dialogs/SpotlightDialog-test.tsx index 776aaff17d..76f342c8f6 100644 --- a/test/unit-tests/components/views/dialogs/SpotlightDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/SpotlightDialog-test.tsx @@ -10,11 +10,11 @@ import React from "react"; import { mocked } from "jest-mock"; import { ConnectionError, - IProtocol, - IPublicRoomsChunkRoom, + type IProtocol, + type IPublicRoomsChunkRoom, JoinRule, - MatrixClient, - Room, + type MatrixClient, + type Room, RoomMember, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; diff --git a/test/unit-tests/components/views/dialogs/UntrustedDeviceDialog-test.tsx b/test/unit-tests/components/views/dialogs/UntrustedDeviceDialog-test.tsx index f0a3fdfb8b..a9486ca35e 100644 --- a/test/unit-tests/components/views/dialogs/UntrustedDeviceDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/UntrustedDeviceDialog-test.tsx @@ -6,7 +6,7 @@ */ import React from "react"; -import { Device, MatrixClient, User } from "matrix-js-sdk/src/matrix"; +import { Device, type MatrixClient, User } from "matrix-js-sdk/src/matrix"; import { render, screen } from "jest-matrix-react"; import { stubClient } from "../../../../test-utils"; diff --git a/test/unit-tests/components/views/dialogs/UserSettingsDialog-test.tsx b/test/unit-tests/components/views/dialogs/UserSettingsDialog-test.tsx index 9e7a71b74b..8ffe9e3de6 100644 --- a/test/unit-tests/components/views/dialogs/UserSettingsDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/UserSettingsDialog-test.tsx @@ -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 React, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; import { render, screen } from "jest-matrix-react"; -import { mocked, MockedObject } from "jest-mock"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { mocked, type MockedObject } from "jest-mock"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; -import SettingsStore, { CallbackFn } from "../../../../../src/settings/SettingsStore"; +import SettingsStore, { type CallbackFn } from "../../../../../src/settings/SettingsStore"; import SdkConfig from "../../../../../src/SdkConfig"; import { UserTab } from "../../../../../src/components/views/dialogs/UserTab"; import UserSettingsDialog from "../../../../../src/components/views/dialogs/UserSettingsDialog"; @@ -27,7 +27,7 @@ import { import { UIFeature } from "../../../../../src/settings/UIFeature"; import { SettingLevel } from "../../../../../src/settings/SettingLevel"; import { SdkContextClass } from "../../../../../src/contexts/SDKContext"; -import { FeatureSettingKey } from "../../../../../src/settings/Settings.tsx"; +import { type FeatureSettingKey } from "../../../../../src/settings/Settings.tsx"; mockPlatformPeg({ supportsSpellCheckSettings: jest.fn().mockReturnValue(false), diff --git a/test/unit-tests/components/views/dialogs/devtools/Crypto-test.tsx b/test/unit-tests/components/views/dialogs/devtools/Crypto-test.tsx index 9086be63e8..66907eea8b 100644 --- a/test/unit-tests/components/views/dialogs/devtools/Crypto-test.tsx +++ b/test/unit-tests/components/views/dialogs/devtools/Crypto-test.tsx @@ -6,9 +6,9 @@ */ import React from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { render, screen, waitFor } from "jest-matrix-react"; -import { KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; +import { type KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; import { createTestClient, withClientContextRenderOptions } from "../../../../../test-utils"; import { Crypto } from "../../../../../../src/components/views/dialogs/devtools/Crypto"; diff --git a/test/unit-tests/components/views/dialogs/security/CreateSecretStorageDialog-test.tsx b/test/unit-tests/components/views/dialogs/security/CreateSecretStorageDialog-test.tsx index 1da0bc7be8..703f574587 100644 --- a/test/unit-tests/components/views/dialogs/security/CreateSecretStorageDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/security/CreateSecretStorageDialog-test.tsx @@ -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 { render, RenderResult, screen } from "jest-matrix-react"; +import { render, type RenderResult, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import React from "react"; -import { mocked, MockedObject } from "jest-mock"; -import { MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { mocked, type MockedObject } from "jest-mock"; +import { type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; import { sleep } from "matrix-js-sdk/src/utils"; import { filterConsole, flushPromises, stubClient } from "../../../../../test-utils"; diff --git a/test/unit-tests/components/views/dialogs/security/ExportE2eKeysDialog-test.tsx b/test/unit-tests/components/views/dialogs/security/ExportE2eKeysDialog-test.tsx index e4dc75062c..004e2e5f8b 100644 --- a/test/unit-tests/components/views/dialogs/security/ExportE2eKeysDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/security/ExportE2eKeysDialog-test.tsx @@ -9,8 +9,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { screen, fireEvent, render, waitFor, act } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { IMegolmSessionData } from "matrix-js-sdk/src/matrix"; -import { CryptoApi } from "matrix-js-sdk/src/crypto-api"; +import { type IMegolmSessionData } from "matrix-js-sdk/src/matrix"; +import { type CryptoApi } from "matrix-js-sdk/src/crypto-api"; import * as MegolmExportEncryption from "../../../../../../src/utils/MegolmExportEncryption"; import ExportE2eKeysDialog from "../../../../../../src/async-components/views/dialogs/security/ExportE2eKeysDialog"; diff --git a/test/unit-tests/components/views/dialogs/security/ImportE2eKeysDialog-test.tsx b/test/unit-tests/components/views/dialogs/security/ImportE2eKeysDialog-test.tsx index f9dcc17737..e45b408df3 100644 --- a/test/unit-tests/components/views/dialogs/security/ImportE2eKeysDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/security/ImportE2eKeysDialog-test.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { fireEvent, render, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { CryptoApi } from "matrix-js-sdk/src/crypto-api"; +import { type CryptoApi } from "matrix-js-sdk/src/crypto-api"; import ImportE2eKeysDialog from "../../../../../../src/async-components/views/dialogs/security/ImportE2eKeysDialog"; import * as MegolmExportEncryption from "../../../../../../src/utils/MegolmExportEncryption"; diff --git a/test/unit-tests/components/views/dialogs/security/RestoreKeyBackupDialog-test.tsx b/test/unit-tests/components/views/dialogs/security/RestoreKeyBackupDialog-test.tsx index 4fc42f5893..2860535984 100644 --- a/test/unit-tests/components/views/dialogs/security/RestoreKeyBackupDialog-test.tsx +++ b/test/unit-tests/components/views/dialogs/security/RestoreKeyBackupDialog-test.tsx @@ -8,8 +8,8 @@ import React from "react"; import { screen, render, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; -import { KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type KeyBackupInfo } from "matrix-js-sdk/src/crypto-api"; // Needed to be able to mock decodeRecoveryKey // eslint-disable-next-line no-restricted-imports import * as recoveryKeyModule from "matrix-js-sdk/src/crypto-api/recovery-key"; diff --git a/test/unit-tests/components/views/dialogs/spotlight/PublicRoomResultDetails-test.tsx b/test/unit-tests/components/views/dialogs/spotlight/PublicRoomResultDetails-test.tsx index c5cda731be..9e85147c07 100644 --- a/test/unit-tests/components/views/dialogs/spotlight/PublicRoomResultDetails-test.tsx +++ b/test/unit-tests/components/views/dialogs/spotlight/PublicRoomResultDetails-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render } from "jest-matrix-react"; -import { IPublicRoomsChunkRoom } from "matrix-js-sdk/src/matrix"; +import { type IPublicRoomsChunkRoom } from "matrix-js-sdk/src/matrix"; import { PublicRoomResultDetails } from "../../../../../../src/components/views/dialogs/spotlight/PublicRoomResultDetails"; diff --git a/test/unit-tests/components/views/dialogs/spotlight/RoomResultContextMenus-test.tsx b/test/unit-tests/components/views/dialogs/spotlight/RoomResultContextMenus-test.tsx index 209ad32727..b02d780485 100644 --- a/test/unit-tests/components/views/dialogs/spotlight/RoomResultContextMenus-test.tsx +++ b/test/unit-tests/components/views/dialogs/spotlight/RoomResultContextMenus-test.tsx @@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, screen, RenderResult } from "jest-matrix-react"; +import { render, screen, type RenderResult } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { Room, MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/matrix"; +import { Room, type MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/matrix"; import { RoomResultContextMenus } from "../../../../../../src/components/views/dialogs/spotlight/RoomResultContextMenus"; import { filterConsole, stubClient } from "../../../../../test-utils"; diff --git a/test/unit-tests/components/views/elements/AppTile-test.tsx b/test/unit-tests/components/views/elements/AppTile-test.tsx index 7a2acb3ace..1a21bda494 100644 --- a/test/unit-tests/components/views/elements/AppTile-test.tsx +++ b/test/unit-tests/components/views/elements/AppTile-test.tsx @@ -7,14 +7,14 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { Room, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { ClientWidgetApi, IWidget, MatrixWidgetType } from "matrix-widget-api"; -import { Optional } from "matrix-events-sdk"; -import { act, render, RenderResult, waitForElementToBeRemoved, waitFor } from "jest-matrix-react"; +import { Room, type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type ClientWidgetApi, type IWidget, MatrixWidgetType } from "matrix-widget-api"; +import { type Optional } from "matrix-events-sdk"; +import { act, render, type RenderResult, waitForElementToBeRemoved, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { - ApprovalOpts, - WidgetInfo, + type ApprovalOpts, + type WidgetInfo, WidgetLifecycle, } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WidgetLifecycle"; @@ -29,7 +29,7 @@ import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext import SettingsStore from "../../../../../src/settings/SettingsStore"; import { RightPanelPhases } from "../../../../../src/stores/right-panel/RightPanelStorePhases"; import RightPanelStore from "../../../../../src/stores/right-panel/RightPanelStore"; -import WidgetStore, { IApp } from "../../../../../src/stores/WidgetStore"; +import WidgetStore, { type IApp } from "../../../../../src/stores/WidgetStore"; import ActiveWidgetStore from "../../../../../src/stores/ActiveWidgetStore"; import AppTile from "../../../../../src/components/views/elements/AppTile"; import { Container, WidgetLayoutStore } from "../../../../../src/stores/widgets/WidgetLayoutStore"; diff --git a/test/unit-tests/components/views/elements/DesktopCapturerSourcePicker-test.tsx b/test/unit-tests/components/views/elements/DesktopCapturerSourcePicker-test.tsx index 7fc739fafb..4e5c04605d 100644 --- a/test/unit-tests/components/views/elements/DesktopCapturerSourcePicker-test.tsx +++ b/test/unit-tests/components/views/elements/DesktopCapturerSourcePicker-test.tsx @@ -12,7 +12,7 @@ import userEvent from "@testing-library/user-event"; import DesktopCapturerSourcePicker from "../../../../../src/components/views/elements/DesktopCapturerSourcePicker"; import PlatformPeg from "../../../../../src/PlatformPeg"; -import BasePlatform from "../../../../../src/BasePlatform"; +import type BasePlatform from "../../../../../src/BasePlatform"; const SOURCES = [ { diff --git a/test/unit-tests/components/views/elements/EventListSummary-test.tsx b/test/unit-tests/components/views/elements/EventListSummary-test.tsx index f1140352b8..2f2c409db6 100644 --- a/test/unit-tests/components/views/elements/EventListSummary-test.tsx +++ b/test/unit-tests/components/views/elements/EventListSummary-test.tsx @@ -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 React, { ComponentProps } from "react"; -import { render, RenderResult } from "jest-matrix-react"; -import { MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix"; -import { KnownMembership, Membership } from "matrix-js-sdk/src/types"; +import React, { type ComponentProps } from "react"; +import { render, type RenderResult } from "jest-matrix-react"; +import { type MatrixEvent, RoomMember } from "matrix-js-sdk/src/matrix"; +import { KnownMembership, type Membership } from "matrix-js-sdk/src/types"; import { getMockClientWithEventEmitter, diff --git a/test/unit-tests/components/views/elements/Pill-test.tsx b/test/unit-tests/components/views/elements/Pill-test.tsx index b2ea507790..8d6565c0a1 100644 --- a/test/unit-tests/components/views/elements/Pill-test.tsx +++ b/test/unit-tests/components/views/elements/Pill-test.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, RenderResult, screen } from "jest-matrix-react"; +import { render, type RenderResult, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { mocked, Mocked } from "jest-mock"; -import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { mocked, type Mocked } from "jest-mock"; +import { type MatrixClient, type MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import dis from "../../../../../src/dispatcher/dispatcher"; -import { Pill, PillProps, PillType } from "../../../../../src/components/views/elements/Pill"; +import { Pill, type PillProps, PillType } from "../../../../../src/components/views/elements/Pill"; import { filterConsole, flushPromises, @@ -24,7 +24,7 @@ import { } from "../../../../test-utils"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; import { Action } from "../../../../../src/dispatcher/actions"; -import { ButtonEvent } from "../../../../../src/components/views/elements/AccessibleButton"; +import { type ButtonEvent } from "../../../../../src/components/views/elements/AccessibleButton"; import { SdkContextClass } from "../../../../../src/contexts/SDKContext"; describe("", () => { diff --git a/test/unit-tests/components/views/elements/PollCreateDialog-test.tsx b/test/unit-tests/components/views/elements/PollCreateDialog-test.tsx index cf50181bb8..a0acf4b0e0 100644 --- a/test/unit-tests/components/views/elements/PollCreateDialog-test.tsx +++ b/test/unit-tests/components/views/elements/PollCreateDialog-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, render, RenderResult } from "jest-matrix-react"; +import { fireEvent, render, type RenderResult } from "jest-matrix-react"; import { Room, MatrixEvent, @@ -17,7 +17,7 @@ import { M_TEXT, } from "matrix-js-sdk/src/matrix"; import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; -import { ReplacementEvent } from "matrix-js-sdk/src/types"; +import { type ReplacementEvent } from "matrix-js-sdk/src/types"; import { getMockClientWithEventEmitter } from "../../../../test-utils"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/components/views/elements/StyledRadioGroup-test.tsx b/test/unit-tests/components/views/elements/StyledRadioGroup-test.tsx index 1f8894457c..be8fc56fda 100644 --- a/test/unit-tests/components/views/elements/StyledRadioGroup-test.tsx +++ b/test/unit-tests/components/views/elements/StyledRadioGroup-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, render, RenderResult } from "jest-matrix-react"; +import { fireEvent, render, type RenderResult } from "jest-matrix-react"; import StyledRadioGroup from "../../../../../src/components/views/elements/StyledRadioGroup"; diff --git a/test/unit-tests/components/views/location/LocationPicker-test.tsx b/test/unit-tests/components/views/location/LocationPicker-test.tsx index 93acbdf18a..365f6678df 100644 --- a/test/unit-tests/components/views/location/LocationPicker-test.tsx +++ b/test/unit-tests/components/views/location/LocationPicker-test.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { act, fireEvent, render, RenderResult } from "jest-matrix-react"; +import { act, fireEvent, render, type RenderResult } from "jest-matrix-react"; import * as maplibregl from "maplibre-gl"; -import { RoomMember, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { RoomMember, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import { logger } from "matrix-js-sdk/src/logger"; diff --git a/test/unit-tests/components/views/location/LocationShareMenu-test.tsx b/test/unit-tests/components/views/location/LocationShareMenu-test.tsx index 7f95b5564d..c347ac91a9 100644 --- a/test/unit-tests/components/views/location/LocationShareMenu-test.tsx +++ b/test/unit-tests/components/views/location/LocationShareMenu-test.tsx @@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { mocked } from "jest-mock"; -import { RoomMember, RelationType, MatrixClient, M_ASSET, LocationAssetType } from "matrix-js-sdk/src/matrix"; +import { RoomMember, RelationType, type MatrixClient, M_ASSET, LocationAssetType } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { act, fireEvent, render, RenderResult } from "jest-matrix-react"; +import { act, fireEvent, render, type RenderResult } from "jest-matrix-react"; import * as maplibregl from "maplibre-gl"; import LocationShareMenu from "../../../../../src/components/views/location/LocationShareMenu"; diff --git a/test/unit-tests/components/views/location/LocationViewDialog-test.tsx b/test/unit-tests/components/views/location/LocationViewDialog-test.tsx index 1993215cf8..8e251e219a 100644 --- a/test/unit-tests/components/views/location/LocationViewDialog-test.tsx +++ b/test/unit-tests/components/views/location/LocationViewDialog-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, RenderResult } from "jest-matrix-react"; +import { render, type RenderResult } from "jest-matrix-react"; import { RoomMember, LocationAssetType } from "matrix-js-sdk/src/matrix"; import LocationViewDialog from "../../../../../src/components/views/location/LocationViewDialog"; diff --git a/test/unit-tests/components/views/location/MapError-test.tsx b/test/unit-tests/components/views/location/MapError-test.tsx index 423a4645dc..f150958405 100644 --- a/test/unit-tests/components/views/location/MapError-test.tsx +++ b/test/unit-tests/components/views/location/MapError-test.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, RenderResult } from "jest-matrix-react"; +import { render, type RenderResult } from "jest-matrix-react"; -import { MapError, MapErrorProps } from "../../../../../src/components/views/location/MapError"; +import { MapError, type MapErrorProps } from "../../../../../src/components/views/location/MapError"; import { LocationShareError } from "../../../../../src/utils/location"; describe("", () => { diff --git a/test/unit-tests/components/views/location/shareLocation-test.ts b/test/unit-tests/components/views/location/shareLocation-test.ts index 498df43ee1..6c4d7d3913 100644 --- a/test/unit-tests/components/views/location/shareLocation-test.ts +++ b/test/unit-tests/components/views/location/shareLocation-test.ts @@ -9,16 +9,16 @@ Please see LICENSE files in the repository root for full details. import { mocked } from "jest-mock"; import { ContentHelpers, - MatrixClient, - LegacyLocationEventContent, - MLocationEventContent, + type MatrixClient, + type LegacyLocationEventContent, + type MLocationEventContent, } from "matrix-js-sdk/src/matrix"; import { doMaybeLocalRoomAction } from "../../../../../src/utils/local-room"; import { LocationShareType, shareLocation, - ShareLocationFn, + type ShareLocationFn, } from "../../../../../src/components/views/location/shareLocation"; jest.mock("../../../../../src/utils/local-room", () => ({ diff --git a/test/unit-tests/components/views/messages/CallEvent-test.tsx b/test/unit-tests/components/views/messages/CallEvent-test.tsx index b092cf84f6..cc8e5a0a8e 100644 --- a/test/unit-tests/components/views/messages/CallEvent-test.tsx +++ b/test/unit-tests/components/views/messages/CallEvent-test.tsx @@ -8,11 +8,16 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen, act, cleanup, fireEvent, waitFor } from "jest-matrix-react"; -import { mocked, Mocked } from "jest-mock"; -import { Room, RoomStateEvent, MatrixClient, PendingEventOrdering } from "matrix-js-sdk/src/matrix"; -import { ClientWidgetApi, Widget } from "matrix-widget-api"; +import { mocked, type Mocked } from "jest-mock"; +import { + Room, + RoomStateEvent, + type MatrixClient, + PendingEventOrdering, + type RoomMember, +} from "matrix-js-sdk/src/matrix"; +import { type ClientWidgetApi, Widget } from "matrix-widget-api"; -import type { RoomMember } from "matrix-js-sdk/src/matrix"; import { useMockedCalls, MockedCall, diff --git a/test/unit-tests/components/views/messages/DateSeparator-test.tsx b/test/unit-tests/components/views/messages/DateSeparator-test.tsx index 3177fd513d..190872feea 100644 --- a/test/unit-tests/components/views/messages/DateSeparator-test.tsx +++ b/test/unit-tests/components/views/messages/DateSeparator-test.tsx @@ -9,11 +9,11 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { mocked } from "jest-mock"; import { fireEvent, render, screen, waitFor } from "jest-matrix-react"; -import { TimestampToEventResponse, ConnectionError, HTTPError, MatrixError } from "matrix-js-sdk/src/matrix"; +import { type TimestampToEventResponse, ConnectionError, HTTPError, MatrixError } from "matrix-js-sdk/src/matrix"; import dispatcher from "../../../../../src/dispatcher/dispatcher"; import { Action } from "../../../../../src/dispatcher/actions"; -import { ViewRoomPayload } from "../../../../../src/dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../../../src/dispatcher/payloads/ViewRoomPayload"; import { SdkContextClass } from "../../../../../src/contexts/SDKContext"; import { formatFullDateNoTime } from "../../../../../src/DateUtils"; import SettingsStore from "../../../../../src/settings/SettingsStore"; diff --git a/test/unit-tests/components/views/messages/DecryptionFailureBody-test.tsx b/test/unit-tests/components/views/messages/DecryptionFailureBody-test.tsx index 5d5e3badc4..ce628da309 100644 --- a/test/unit-tests/components/views/messages/DecryptionFailureBody-test.tsx +++ b/test/unit-tests/components/views/messages/DecryptionFailureBody-test.tsx @@ -8,7 +8,7 @@ import React from "react"; import { render } from "jest-matrix-react"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { mkDecryptionFailureMatrixEvent } from "matrix-js-sdk/src/testing"; import { DecryptionFailureCode } from "matrix-js-sdk/src/crypto-api"; diff --git a/test/unit-tests/components/views/messages/EncryptionEvent-test.tsx b/test/unit-tests/components/views/messages/EncryptionEvent-test.tsx index 7ea9de76bc..c91a274c70 100644 --- a/test/unit-tests/components/views/messages/EncryptionEvent-test.tsx +++ b/test/unit-tests/components/views/messages/EncryptionEvent-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { mocked } from "jest-mock"; -import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { render, screen } from "jest-matrix-react"; import { waitFor } from "@testing-library/dom"; diff --git a/test/unit-tests/components/views/messages/LegacyCallEvent-test.tsx b/test/unit-tests/components/views/messages/LegacyCallEvent-test.tsx index f345b58a1c..aa8b7172f8 100644 --- a/test/unit-tests/components/views/messages/LegacyCallEvent-test.tsx +++ b/test/unit-tests/components/views/messages/LegacyCallEvent-test.tsx @@ -9,10 +9,10 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen } from "jest-matrix-react"; import { CallErrorCode, CallState } from "matrix-js-sdk/src/webrtc/call"; -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import LegacyCallEvent from "../../../../../src/components/views/messages/LegacyCallEvent"; -import LegacyCallEventGrouper from "../../../../../src/components/structures/LegacyCallEventGrouper"; +import type LegacyCallEventGrouper from "../../../../../src/components/structures/LegacyCallEventGrouper"; const THEIR_USER_ID = "@them:here"; diff --git a/test/unit-tests/components/views/messages/MBeaconBody-test.tsx b/test/unit-tests/components/views/messages/MBeaconBody-test.tsx index 6827d45df0..3c6f05d7ec 100644 --- a/test/unit-tests/components/views/messages/MBeaconBody-test.tsx +++ b/test/unit-tests/components/views/messages/MBeaconBody-test.tsx @@ -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 React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import { act, fireEvent, render } from "jest-matrix-react"; import * as maplibregl from "maplibre-gl"; import { @@ -17,7 +17,7 @@ import { EventType, Relations, M_BEACON, - Room, + type Room, } from "matrix-js-sdk/src/matrix"; import MBeaconBody from "../../../../../src/components/views/messages/MBeaconBody"; @@ -28,8 +28,8 @@ import { makeRoomWithBeacons, makeRoomWithStateEvents, } from "../../../../test-utils"; -import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; -import { MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; +import { type RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; +import { type MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import Modal from "../../../../../src/Modal"; import { TILE_SERVER_WK_KEY } from "../../../../../src/utils/WellKnownUtils"; diff --git a/test/unit-tests/components/views/messages/MKeyVerificationRequest-test.tsx b/test/unit-tests/components/views/messages/MKeyVerificationRequest-test.tsx index 2f08a8bf93..a559fd2b6d 100644 --- a/test/unit-tests/components/views/messages/MKeyVerificationRequest-test.tsx +++ b/test/unit-tests/components/views/messages/MKeyVerificationRequest-test.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { RenderResult, render } from "jest-matrix-react"; -import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type RenderResult, render } from "jest-matrix-react"; +import { type MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; import MKeyVerificationRequest from "../../../../../src/components/views/messages/MKeyVerificationRequest"; import TileErrorBoundary from "../../../../../src/components/views/messages/TileErrorBoundary"; diff --git a/test/unit-tests/components/views/messages/MLocationBody-test.tsx b/test/unit-tests/components/views/messages/MLocationBody-test.tsx index f0f7bae8a7..18a1abb4a9 100644 --- a/test/unit-tests/components/views/messages/MLocationBody-test.tsx +++ b/test/unit-tests/components/views/messages/MLocationBody-test.tsx @@ -15,8 +15,8 @@ import { sleep } from "matrix-js-sdk/src/utils"; import MLocationBody from "../../../../../src/components/views/messages/MLocationBody"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; -import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; -import { MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; +import { type RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; +import { type MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; import Modal from "../../../../../src/Modal"; import SdkConfig from "../../../../../src/SdkConfig"; import { TILE_SERVER_WK_KEY } from "../../../../../src/utils/WellKnownUtils"; diff --git a/test/unit-tests/components/views/messages/MPollBody-test.tsx b/test/unit-tests/components/views/messages/MPollBody-test.tsx index 86849a1069..b4f1566a08 100644 --- a/test/unit-tests/components/views/messages/MPollBody-test.tsx +++ b/test/unit-tests/components/views/messages/MPollBody-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { act, fireEvent, render, RenderResult, waitForElementToBeRemoved, waitFor } from "jest-matrix-react"; +import { act, fireEvent, render, type RenderResult, waitForElementToBeRemoved, waitFor } from "jest-matrix-react"; import { MatrixEvent, Relations, @@ -15,8 +15,8 @@ import { M_POLL_KIND_UNDISCLOSED, M_POLL_RESPONSE, M_POLL_START, - PollStartEventContent, - PollAnswer, + type PollStartEventContent, + type PollAnswer, M_TEXT, } from "matrix-js-sdk/src/matrix"; @@ -25,7 +25,7 @@ import MPollBody, { findTopAnswer, isPollEnded, } from "../../../../../src/components/views/messages/MPollBody"; -import { IBodyProps } from "../../../../../src/components/views/messages/IBodyProps"; +import { type IBodyProps } from "../../../../../src/components/views/messages/IBodyProps"; import { flushPromises, getMockClientWithEventEmitter, @@ -34,8 +34,8 @@ import { setupRoomWithPollEvents, } from "../../../../test-utils"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; -import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; -import { MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; +import { type RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; +import { type MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; import * as languageHandler from "../../../../../src/languageHandler"; const CHECKED = "mx_PollOption_checked"; diff --git a/test/unit-tests/components/views/messages/MPollEndBody-test.tsx b/test/unit-tests/components/views/messages/MPollEndBody-test.tsx index cc27c8a4d9..3b3b4eb5c9 100644 --- a/test/unit-tests/components/views/messages/MPollEndBody-test.tsx +++ b/test/unit-tests/components/views/messages/MPollEndBody-test.tsx @@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, waitFor } from "jest-matrix-react"; -import { EventTimeline, MatrixEvent, Room, M_TEXT } from "matrix-js-sdk/src/matrix"; +import { type EventTimeline, type MatrixEvent, Room, M_TEXT } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; -import { IBodyProps } from "../../../../../src/components/views/messages/IBodyProps"; +import { type IBodyProps } from "../../../../../src/components/views/messages/IBodyProps"; import { MPollEndBody } from "../../../../../src/components/views/messages/MPollEndBody"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; -import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; -import { MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; +import { type RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; +import { type MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; import { flushPromises, getMockClientWithEventEmitter, diff --git a/test/unit-tests/components/views/messages/MVideoBody-test.tsx b/test/unit-tests/components/views/messages/MVideoBody-test.tsx index e445dc1711..0dd0c917dd 100644 --- a/test/unit-tests/components/views/messages/MVideoBody-test.tsx +++ b/test/unit-tests/components/views/messages/MVideoBody-test.tsx @@ -7,12 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { EventType, getHttpUriForMxc, IContent, MatrixEvent } from "matrix-js-sdk/src/matrix"; -import { render, RenderResult } from "jest-matrix-react"; +import { EventType, getHttpUriForMxc, type IContent, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { render, type RenderResult } from "jest-matrix-react"; import fetchMock from "fetch-mock-jest"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; -import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; +import { type RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; import { MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; import { getMockClientWithEventEmitter, diff --git a/test/unit-tests/components/views/messages/MessageActionBar-test.tsx b/test/unit-tests/components/views/messages/MessageActionBar-test.tsx index 1f28f1d008..1059263533 100644 --- a/test/unit-tests/components/views/messages/MessageActionBar-test.tsx +++ b/test/unit-tests/components/views/messages/MessageActionBar-test.tsx @@ -30,7 +30,7 @@ import { } from "../../../../test-utils"; import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; import RoomContext, { TimelineRenderingType } from "../../../../../src/contexts/RoomContext"; -import { IRoomState } from "../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../src/components/structures/RoomView"; import dispatcher from "../../../../../src/dispatcher/dispatcher"; import SettingsStore from "../../../../../src/settings/SettingsStore"; import { Action } from "../../../../../src/dispatcher/actions"; diff --git a/test/unit-tests/components/views/messages/MessageEvent-test.tsx b/test/unit-tests/components/views/messages/MessageEvent-test.tsx index 63e00134fa..8b643fd1b5 100644 --- a/test/unit-tests/components/views/messages/MessageEvent-test.tsx +++ b/test/unit-tests/components/views/messages/MessageEvent-test.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, RenderResult } from "jest-matrix-react"; -import { MatrixClient, MatrixEvent, EventType, Room, MsgType } from "matrix-js-sdk/src/matrix"; +import { render, type RenderResult } from "jest-matrix-react"; +import { type MatrixClient, type MatrixEvent, EventType, type Room, MsgType } from "matrix-js-sdk/src/matrix"; import fetchMock from "fetch-mock-jest"; import fs from "fs"; import path from "path"; diff --git a/test/unit-tests/components/views/messages/ReactionsRowButton-test.tsx b/test/unit-tests/components/views/messages/ReactionsRowButton-test.tsx index d00237e5d2..3b4298a61c 100644 --- a/test/unit-tests/components/views/messages/ReactionsRowButton-test.tsx +++ b/test/unit-tests/components/views/messages/ReactionsRowButton-test.tsx @@ -7,12 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { IContent, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { type IContent, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { render } from "jest-matrix-react"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import { getMockClientWithEventEmitter } from "../../../../test-utils"; -import ReactionsRowButton, { IProps } from "../../../../../src/components/views/messages/ReactionsRowButton"; +import ReactionsRowButton, { type IProps } from "../../../../../src/components/views/messages/ReactionsRowButton"; describe("ReactionsRowButton", () => { const userId = "@alice:server"; diff --git a/test/unit-tests/components/views/messages/TextualBody-test.tsx b/test/unit-tests/components/views/messages/TextualBody-test.tsx index 2f6e1eedb6..a10e4bebe0 100644 --- a/test/unit-tests/components/views/messages/TextualBody-test.tsx +++ b/test/unit-tests/components/views/messages/TextualBody-test.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixClient, MatrixEvent, PushRuleKind } from "matrix-js-sdk/src/matrix"; -import { mocked, MockedObject } from "jest-mock"; +import { type MatrixClient, type MatrixEvent, PushRuleKind } from "matrix-js-sdk/src/matrix"; +import { mocked, type MockedObject } from "jest-mock"; import { render, waitFor } from "jest-matrix-react"; import { getMockClientWithEventEmitter, mkEvent, mkMessage, mkStubRoom } from "../../../../test-utils"; @@ -18,7 +18,7 @@ import DMRoomMap from "../../../../../src/utils/DMRoomMap"; import TextualBody from "../../../../../src/components/views/messages/TextualBody"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; -import { MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; +import { type MediaEventHelper } from "../../../../../src/utils/MediaEventHelper"; const room1Id = "!room1:example.com"; const room2Id = "!room2:example.com"; diff --git a/test/unit-tests/components/views/polls/pollHistory/PollHistory-test.tsx b/test/unit-tests/components/views/polls/pollHistory/PollHistory-test.tsx index 55dcdda163..05ad7c3e33 100644 --- a/test/unit-tests/components/views/polls/pollHistory/PollHistory-test.tsx +++ b/test/unit-tests/components/views/polls/pollHistory/PollHistory-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { fireEvent, render } from "jest-matrix-react"; -import { Filter, EventTimeline, Room, MatrixEvent, M_POLL_START } from "matrix-js-sdk/src/matrix"; +import { Filter, EventTimeline, Room, type MatrixEvent, M_POLL_START } from "matrix-js-sdk/src/matrix"; import { PollHistory } from "../../../../../../src/components/views/polls/pollHistory/PollHistory"; import { diff --git a/test/unit-tests/components/views/polls/pollHistory/PollListItemEnded-test.tsx b/test/unit-tests/components/views/polls/pollHistory/PollListItemEnded-test.tsx index 492a86f679..219c616327 100644 --- a/test/unit-tests/components/views/polls/pollHistory/PollListItemEnded-test.tsx +++ b/test/unit-tests/components/views/polls/pollHistory/PollListItemEnded-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render } from "jest-matrix-react"; -import { MatrixEvent, Poll, Room, M_TEXT } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent, type Poll, Room, M_TEXT } from "matrix-js-sdk/src/matrix"; import { PollListItemEnded } from "../../../../../../src/components/views/polls/pollHistory/PollListItemEnded"; import { diff --git a/test/unit-tests/components/views/right_panel/ExtensionsCard-test.tsx b/test/unit-tests/components/views/right_panel/ExtensionsCard-test.tsx index 2b74276f28..e11b4092d7 100644 --- a/test/unit-tests/components/views/right_panel/ExtensionsCard-test.tsx +++ b/test/unit-tests/components/views/right_panel/ExtensionsCard-test.tsx @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { mocked, Mocked } from "jest-mock"; +import { mocked, type Mocked } from "jest-mock"; import { render, screen } from "jest-matrix-react"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { MatrixWidgetType } from "matrix-widget-api"; import userEvent from "@testing-library/user-event"; import ExtensionsCard from "../../../../../src/components/views/right_panel/ExtensionsCard"; import { stubClient } from "../../../../test-utils"; -import { IApp } from "../../../../../src/stores/WidgetStore"; +import { type IApp } from "../../../../../src/stores/WidgetStore"; import WidgetUtils, { useWidgets } from "../../../../../src/utils/WidgetUtils"; import { WidgetLayoutStore } from "../../../../../src/stores/widgets/WidgetLayoutStore"; import { IntegrationManagers } from "../../../../../src/integrations/IntegrationManagers"; diff --git a/test/unit-tests/components/views/right_panel/PinnedMessagesCard-test.tsx b/test/unit-tests/components/views/right_panel/PinnedMessagesCard-test.tsx index b63b84c7e6..7196667d9c 100644 --- a/test/unit-tests/components/views/right_panel/PinnedMessagesCard-test.tsx +++ b/test/unit-tests/components/views/right_panel/PinnedMessagesCard-test.tsx @@ -7,19 +7,19 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, act, RenderResult, waitForElementToBeRemoved, screen, waitFor } from "jest-matrix-react"; -import { mocked, MockedObject } from "jest-mock"; +import { render, act, type RenderResult, waitForElementToBeRemoved, screen, waitFor } from "jest-matrix-react"; +import { mocked, type MockedObject } from "jest-mock"; import { MatrixEvent, RoomStateEvent, Room, - IMinimalEvent, + type IMinimalEvent, EventType, RelationType, MsgType, M_POLL_KIND_DISCLOSED, EventTimeline, - MatrixClient, + type MatrixClient, } from "matrix-js-sdk/src/matrix"; import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent"; import { PollResponseEvent } from "matrix-js-sdk/src/extensible_events_v1/PollResponseEvent"; diff --git a/test/unit-tests/components/views/right_panel/RoomSummaryCard-test.tsx b/test/unit-tests/components/views/right_panel/RoomSummaryCard-test.tsx index 48ba88d88a..e0b055e181 100644 --- a/test/unit-tests/components/views/right_panel/RoomSummaryCard-test.tsx +++ b/test/unit-tests/components/views/right_panel/RoomSummaryCard-test.tsx @@ -8,9 +8,9 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, fireEvent, screen, waitFor } from "jest-matrix-react"; -import { EventType, MatrixEvent, Room, MatrixClient, JoinRule } from "matrix-js-sdk/src/matrix"; +import { EventType, MatrixEvent, Room, type MatrixClient, JoinRule } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import { mocked, MockedObject } from "jest-mock"; +import { mocked, type MockedObject } from "jest-mock"; import userEvent from "@testing-library/user-event"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; diff --git a/test/unit-tests/components/views/right_panel/UserInfo-test.tsx b/test/unit-tests/components/views/right_panel/UserInfo-test.tsx index db7af71c24..de0c0c39a6 100644 --- a/test/unit-tests/components/views/right_panel/UserInfo-test.tsx +++ b/test/unit-tests/components/views/right_panel/UserInfo-test.tsx @@ -9,18 +9,26 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { fireEvent, render, screen, cleanup, act, within, waitForElementToBeRemoved } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { Mocked, mocked } from "jest-mock"; -import { Room, User, MatrixClient, RoomMember, MatrixEvent, EventType, Device } from "matrix-js-sdk/src/matrix"; +import { type Mocked, mocked } from "jest-mock"; +import { + type Room, + User, + type MatrixClient, + RoomMember, + MatrixEvent, + EventType, + Device, +} from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { defer } from "matrix-js-sdk/src/utils"; import { EventEmitter } from "events"; import { UserVerificationStatus, - VerificationRequest, + type VerificationRequest, VerificationPhase as Phase, VerificationRequestEvent, - CryptoApi, - DeviceVerificationStatus, + type CryptoApi, + type DeviceVerificationStatus, } from "matrix-js-sdk/src/crypto-api"; import UserInfo, { diff --git a/test/unit-tests/components/views/right_panel/VerificationPanel-test.tsx b/test/unit-tests/components/views/right_panel/VerificationPanel-test.tsx index 4d1252ac3a..0fbe248d44 100644 --- a/test/unit-tests/components/views/right_panel/VerificationPanel-test.tsx +++ b/test/unit-tests/components/views/right_panel/VerificationPanel-test.tsx @@ -7,18 +7,18 @@ Please see LICENSE files in the repository root for full details. */ import { act, render, waitFor } from "jest-matrix-react"; -import React, { ComponentProps } from "react"; -import { User, TypedEventEmitter, Device, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { mocked, Mocked } from "jest-mock"; +import React, { type ComponentProps } from "react"; +import { User, TypedEventEmitter, Device, type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { mocked, type Mocked } from "jest-mock"; import { - EmojiMapping, - ShowSasCallbacks, + type EmojiMapping, + type ShowSasCallbacks, VerificationPhase as Phase, - VerificationRequest, - VerificationRequestEvent, - Verifier, + type VerificationRequest, + type VerificationRequestEvent, + type Verifier, VerifierEvent, - VerifierEventHandlerMap, + type VerifierEventHandlerMap, } from "matrix-js-sdk/src/crypto-api"; import VerificationPanel from "../../../../../src/components/views/right_panel/VerificationPanel"; diff --git a/test/unit-tests/components/views/room_settings/RoomProfileSettings-test.tsx b/test/unit-tests/components/views/room_settings/RoomProfileSettings-test.tsx index a6af82d94b..0acb182dba 100644 --- a/test/unit-tests/components/views/room_settings/RoomProfileSettings-test.tsx +++ b/test/unit-tests/components/views/room_settings/RoomProfileSettings-test.tsx @@ -9,7 +9,7 @@ import React from "react"; import { render, screen, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { mocked } from "jest-mock"; -import { EventType, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixClient, type MatrixEvent, type Room } from "matrix-js-sdk/src/matrix"; import { mkStubRoom, stubClient } from "../../../../test-utils"; import RoomProfileSettings from "../../../../../src/components/views/room_settings/RoomProfileSettings"; diff --git a/test/unit-tests/components/views/room_settings/UrlPreviewSettings-test.tsx b/test/unit-tests/components/views/room_settings/UrlPreviewSettings-test.tsx index fa4f34aa34..c392788e38 100644 --- a/test/unit-tests/components/views/room_settings/UrlPreviewSettings-test.tsx +++ b/test/unit-tests/components/views/room_settings/UrlPreviewSettings-test.tsx @@ -6,7 +6,7 @@ */ import React from "react"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import { render, screen } from "jest-matrix-react"; import { waitFor } from "@testing-library/dom"; diff --git a/test/unit-tests/components/views/rooms/AppsDrawer-test.tsx b/test/unit-tests/components/views/rooms/AppsDrawer-test.tsx index 71e69bd91b..14c8bde3a2 100644 --- a/test/unit-tests/components/views/rooms/AppsDrawer-test.tsx +++ b/test/unit-tests/components/views/rooms/AppsDrawer-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix"; import { render } from "jest-matrix-react"; import { stubClient } from "../../../../test-utils"; diff --git a/test/unit-tests/components/views/rooms/BasicMessageComposer-test.tsx b/test/unit-tests/components/views/rooms/BasicMessageComposer-test.tsx index b8864624e5..798f948114 100644 --- a/test/unit-tests/components/views/rooms/BasicMessageComposer-test.tsx +++ b/test/unit-tests/components/views/rooms/BasicMessageComposer-test.tsx @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import BasicMessageComposer from "../../../../../src/components/views/rooms/BasicMessageComposer"; import * as TestUtils from "../../../../test-utils"; diff --git a/test/unit-tests/components/views/rooms/EditMessageComposer-test.tsx b/test/unit-tests/components/views/rooms/EditMessageComposer-test.tsx index cdc961f73c..137ca3036d 100644 --- a/test/unit-tests/components/views/rooms/EditMessageComposer-test.tsx +++ b/test/unit-tests/components/views/rooms/EditMessageComposer-test.tsx @@ -10,7 +10,7 @@ import React from "react"; import { fireEvent, render, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { Room } from "matrix-js-sdk/src/matrix"; -import { ReplacementEvent, RoomMessageEventContent } from "matrix-js-sdk/src/types"; +import { type ReplacementEvent, type RoomMessageEventContent } from "matrix-js-sdk/src/types"; import EditMessageComposerWithMatrixClient, { createEditContent, @@ -27,9 +27,9 @@ import { import DocumentOffset from "../../../../../src/editor/offset"; import SettingsStore from "../../../../../src/settings/SettingsStore"; import EditorStateTransfer from "../../../../../src/utils/EditorStateTransfer"; -import { IRoomState } from "../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../src/components/structures/RoomView"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; -import Autocompleter, { IProviderCompletions } from "../../../../../src/autocomplete/Autocompleter"; +import Autocompleter, { type IProviderCompletions } from "../../../../../src/autocomplete/Autocompleter"; import NotifProvider from "../../../../../src/autocomplete/NotifProvider"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; import { ScopedRoomContextProvider } from "../../../../../src/contexts/ScopedRoomContext.tsx"; diff --git a/test/unit-tests/components/views/rooms/EventTile-test.tsx b/test/unit-tests/components/views/rooms/EventTile-test.tsx index 057d93ee51..90ff709c5a 100644 --- a/test/unit-tests/components/views/rooms/EventTile-test.tsx +++ b/test/unit-tests/components/views/rooms/EventTile-test.tsx @@ -11,8 +11,8 @@ import { act, fireEvent, render, screen, waitFor } from "jest-matrix-react"; import { mocked } from "jest-mock"; import { EventType, - IEventDecryptionResult, - MatrixClient, + type IEventDecryptionResult, + type MatrixClient, MatrixEvent, NotificationCountType, PendingEventOrdering, @@ -20,15 +20,15 @@ import { TweakName, } from "matrix-js-sdk/src/matrix"; import { - CryptoApi, + type CryptoApi, DecryptionFailureCode, - EventEncryptionInfo, + type EventEncryptionInfo, EventShieldColour, EventShieldReason, } from "matrix-js-sdk/src/crypto-api"; import { mkEncryptedMatrixEvent } from "matrix-js-sdk/src/testing"; -import EventTile, { EventTileProps } from "../../../../../src/components/views/rooms/EventTile"; +import EventTile, { type EventTileProps } from "../../../../../src/components/views/rooms/EventTile"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import { TimelineRenderingType } from "../../../../../src/contexts/RoomContext"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; @@ -37,7 +37,7 @@ import { mkThread } from "../../../../test-utils/threads"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; import dis from "../../../../../src/dispatcher/dispatcher"; import { Action } from "../../../../../src/dispatcher/actions"; -import { IRoomState } from "../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../src/components/structures/RoomView"; import PinningUtils from "../../../../../src/utils/PinningUtils"; import { Layout } from "../../../../../src/settings/enums/Layout"; import { ScopedRoomContextProvider } from "../../../../../src/contexts/ScopedRoomContext.tsx"; diff --git a/test/unit-tests/components/views/rooms/EventTile/EventTileThreadToolbar-test.tsx b/test/unit-tests/components/views/rooms/EventTile/EventTileThreadToolbar-test.tsx index f08dbc4042..38785d5b45 100644 --- a/test/unit-tests/components/views/rooms/EventTile/EventTileThreadToolbar-test.tsx +++ b/test/unit-tests/components/views/rooms/EventTile/EventTileThreadToolbar-test.tsx @@ -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 { getByLabelText, render, RenderResult } from "jest-matrix-react"; +import { getByLabelText, render, type RenderResult } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import { EventTileThreadToolbar } from "../../../../../../src/components/views/rooms/EventTile/EventTileThreadToolbar"; diff --git a/test/unit-tests/components/views/rooms/ExtraTile-test.tsx b/test/unit-tests/components/views/rooms/ExtraTile-test.tsx index 6330b5bbc8..a1a957dbce 100644 --- a/test/unit-tests/components/views/rooms/ExtraTile-test.tsx +++ b/test/unit-tests/components/views/rooms/ExtraTile-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { getByRole, render } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import ExtraTile from "../../../../../src/components/views/rooms/ExtraTile"; diff --git a/test/unit-tests/components/views/rooms/MessageComposer-test.tsx b/test/unit-tests/components/views/rooms/MessageComposer-test.tsx index 895b5f09a7..49521422c6 100644 --- a/test/unit-tests/components/views/rooms/MessageComposer-test.tsx +++ b/test/unit-tests/components/views/rooms/MessageComposer-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import * as React from "react"; -import { EventType, MatrixEvent, RoomMember, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixEvent, RoomMember, THREAD_RELATION_TYPE } from "matrix-js-sdk/src/matrix"; import { act, fireEvent, render, screen, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { initOnce } from "@vector-im/matrix-wysiwyg"; @@ -24,7 +24,7 @@ import { import MessageComposer from "../../../../../src/components/views/rooms/MessageComposer"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; -import { IRoomState } from "../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../src/components/structures/RoomView"; import ResizeNotifier from "../../../../../src/utils/ResizeNotifier"; import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; import { LocalRoom } from "../../../../../src/models/LocalRoom"; diff --git a/test/unit-tests/components/views/rooms/MessageComposerButtons-test.tsx b/test/unit-tests/components/views/rooms/MessageComposerButtons-test.tsx index fffb852ebf..634a72866d 100644 --- a/test/unit-tests/components/views/rooms/MessageComposerButtons-test.tsx +++ b/test/unit-tests/components/views/rooms/MessageComposerButtons-test.tsx @@ -11,7 +11,7 @@ import { render, screen, waitFor } from "jest-matrix-react"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import { createTestClient, getRoomContext, mkStubRoom } from "../../../../test-utils"; -import { IRoomState } from "../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../src/components/structures/RoomView"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; import MessageComposerButtons from "../../../../../src/components/views/rooms/MessageComposerButtons"; import { ScopedRoomContextProvider } from "../../../../../src/contexts/ScopedRoomContext.tsx"; diff --git a/test/unit-tests/components/views/rooms/NewRoomIntro-test.tsx b/test/unit-tests/components/views/rooms/NewRoomIntro-test.tsx index a5d598e1b4..333e0e1020 100644 --- a/test/unit-tests/components/views/rooms/NewRoomIntro-test.tsx +++ b/test/unit-tests/components/views/rooms/NewRoomIntro-test.tsx @@ -9,13 +9,13 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen } from "jest-matrix-react"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { LocalRoom } from "../../../../../src/models/LocalRoom"; import { filterConsole, mkRoomMemberJoinEvent, mkThirdPartyInviteEvent, stubClient } from "../../../../test-utils"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import NewRoomIntro from "../../../../../src/components/views/rooms/NewRoomIntro"; -import { IRoomState } from "../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../src/components/structures/RoomView"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; import { DirectoryMember } from "../../../../../src/utils/direct-messages"; import { ScopedRoomContextProvider } from "../../../../../src/contexts/ScopedRoomContext.tsx"; diff --git a/test/unit-tests/components/views/rooms/PinnedEventTile-test.tsx b/test/unit-tests/components/views/rooms/PinnedEventTile-test.tsx index 9031d238a8..101c04a07b 100644 --- a/test/unit-tests/components/views/rooms/PinnedEventTile-test.tsx +++ b/test/unit-tests/components/views/rooms/PinnedEventTile-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen, waitFor } from "jest-matrix-react"; -import { EventTimeline, EventType, IEvent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { EventTimeline, EventType, type IEvent, type MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import userEvent from "@testing-library/user-event"; import { RoomPermalinkCreator } from "../../../../../src/utils/permalinks/Permalinks"; diff --git a/test/unit-tests/components/views/rooms/PinnedMessageBanner-test.tsx b/test/unit-tests/components/views/rooms/PinnedMessageBanner-test.tsx index 66e0e32f38..b7c0e4a430 100644 --- a/test/unit-tests/components/views/rooms/PinnedMessageBanner-test.tsx +++ b/test/unit-tests/components/views/rooms/PinnedMessageBanner-test.tsx @@ -8,7 +8,7 @@ import { act, screen, render } from "jest-matrix-react"; import React from "react"; -import { EventType, IEvent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { EventType, type IEvent, type MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import userEvent from "@testing-library/user-event"; import * as pinnedEventHooks from "../../../../../src/hooks/usePinnedEvents"; diff --git a/test/unit-tests/components/views/rooms/ReadReceiptGroup-test.tsx b/test/unit-tests/components/views/rooms/ReadReceiptGroup-test.tsx index ec9884591f..0a3cfafb85 100644 --- a/test/unit-tests/components/views/rooms/ReadReceiptGroup-test.tsx +++ b/test/unit-tests/components/views/rooms/ReadReceiptGroup-test.tsx @@ -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 React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import { render, screen, waitFor } from "jest-matrix-react"; import { RoomMember } from "matrix-js-sdk/src/matrix"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/views/rooms/ReadReceiptMarker-test.tsx b/test/unit-tests/components/views/rooms/ReadReceiptMarker-test.tsx index 68b7bc9799..a55636d581 100644 --- a/test/unit-tests/components/views/rooms/ReadReceiptMarker-test.tsx +++ b/test/unit-tests/components/views/rooms/ReadReceiptMarker-test.tsx @@ -9,7 +9,9 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen } from "jest-matrix-react"; -import ReadReceiptMarker, { IReadReceiptPosition } from "../../../../../src/components/views/rooms/ReadReceiptMarker"; +import ReadReceiptMarker, { + type IReadReceiptPosition, +} from "../../../../../src/components/views/rooms/ReadReceiptMarker"; describe("ReadReceiptMarker", () => { afterEach(() => { diff --git a/test/unit-tests/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx b/test/unit-tests/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx index a89058d730..8365b458e4 100644 --- a/test/unit-tests/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomHeader/CallGuestLinkButton-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { fireEvent, getByLabelText, getByText, render, screen, waitFor } from "jest-matrix-react"; -import { EventTimeline, JoinRule, Room } from "matrix-js-sdk/src/matrix"; +import { type EventTimeline, JoinRule, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { SDKContext, SdkContextClass } from "../../../../../../src/contexts/SDKContext"; diff --git a/test/unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx b/test/unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx index 6385356b96..7ca97d1fc2 100644 --- a/test/unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomHeader/RoomHeader-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { CallType, MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { CallType, type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; import { EventType, JoinRule, @@ -29,11 +29,11 @@ import { queryAllByLabelText, queryByLabelText, render, - RenderOptions, + type RenderOptions, screen, waitFor, } from "jest-matrix-react"; -import { ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; +import { type ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; import { mocked } from "jest-mock"; import { filterConsole, stubClient } from "../../../../../test-utils"; @@ -47,14 +47,14 @@ import SettingsStore from "../../../../../../src/settings/SettingsStore"; import SdkConfig from "../../../../../../src/SdkConfig"; import dispatcher from "../../../../../../src/dispatcher/dispatcher"; import { CallStore } from "../../../../../../src/stores/CallStore"; -import { Call, ElementCall } from "../../../../../../src/models/Call"; +import { type Call, ElementCall } from "../../../../../../src/models/Call"; import * as ShieldUtils from "../../../../../../src/utils/ShieldUtils"; import { Container, WidgetLayoutStore } from "../../../../../../src/stores/widgets/WidgetLayoutStore"; import MatrixClientContext from "../../../../../../src/contexts/MatrixClientContext"; import { _t } from "../../../../../../src/languageHandler"; import * as UseCall from "../../../../../../src/hooks/useCall"; import { SdkContextClass } from "../../../../../../src/contexts/SDKContext"; -import WidgetStore, { IApp } from "../../../../../../src/stores/WidgetStore"; +import WidgetStore, { type IApp } from "../../../../../../src/stores/WidgetStore"; import { UIFeature } from "../../../../../../src/settings/UIFeature"; jest.mock("../../../../../../src/utils/ShieldUtils"); diff --git a/test/unit-tests/components/views/rooms/RoomHeader/VideoRoomChatButton-test.tsx b/test/unit-tests/components/views/rooms/RoomHeader/VideoRoomChatButton-test.tsx index 9a1466a261..5ae6560779 100644 --- a/test/unit-tests/components/views/rooms/RoomHeader/VideoRoomChatButton-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomHeader/VideoRoomChatButton-test.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MockedObject } from "jest-mock"; +import { type MockedObject } from "jest-mock"; import { Room } from "matrix-js-sdk/src/matrix"; import { fireEvent, render, screen, waitFor } from "jest-matrix-react"; import { VideoRoomChatButton } from "../../../../../../src/components/views/rooms/RoomHeader/VideoRoomChatButton"; import { SDKContext, SdkContextClass } from "../../../../../../src/contexts/SDKContext"; -import RightPanelStore from "../../../../../../src/stores/right-panel/RightPanelStore"; +import type RightPanelStore from "../../../../../../src/stores/right-panel/RightPanelStore"; import { getMockClientWithEventEmitter, mockClientMethodsUser } from "../../../../../test-utils"; import { RoomNotificationState } from "../../../../../../src/stores/notifications/RoomNotificationState"; import { NotificationLevel } from "../../../../../../src/stores/notifications/NotificationLevel"; diff --git a/test/unit-tests/components/views/rooms/RoomList-test.tsx b/test/unit-tests/components/views/rooms/RoomList-test.tsx index 4ee68deb21..288f0c53e5 100644 --- a/test/unit-tests/components/views/rooms/RoomList-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomList-test.tsx @@ -11,7 +11,7 @@ import React from "react"; import { cleanup, queryByRole, render, screen, within } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { mocked } from "jest-mock"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import RoomList from "../../../../../src/components/views/rooms/RoomList"; import ResizeNotifier from "../../../../../src/utils/ResizeNotifier"; @@ -26,7 +26,7 @@ import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; import SpaceStore from "../../../../../src/stores/spaces/SpaceStore"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; import RoomListStore from "../../../../../src/stores/room-list/RoomListStore"; -import { ITagMap } from "../../../../../src/stores/room-list/algorithms/models"; +import { type ITagMap } from "../../../../../src/stores/room-list/algorithms/models"; import { DefaultTagID } from "../../../../../src/stores/room-list/models"; jest.mock("../../../../../src/customisations/helpers/UIComponents", () => ({ diff --git a/test/unit-tests/components/views/rooms/RoomListHeader-test.tsx b/test/unit-tests/components/views/rooms/RoomListHeader-test.tsx index ade08b8f95..9c9b35e414 100644 --- a/test/unit-tests/components/views/rooms/RoomListHeader-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomListHeader-test.tsx @@ -7,9 +7,9 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { MatrixClient, Room, EventType } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room, EventType } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; -import { act, render, screen, fireEvent, RenderResult } from "jest-matrix-react"; +import { act, render, screen, fireEvent, type RenderResult } from "jest-matrix-react"; import SpaceStore from "../../../../../src/stores/spaces/SpaceStore"; import { MetaSpace } from "../../../../../src/stores/spaces"; diff --git a/test/unit-tests/components/views/rooms/RoomPreviewBar-test.tsx b/test/unit-tests/components/views/rooms/RoomPreviewBar-test.tsx index 112b088709..2eb0581ff3 100644 --- a/test/unit-tests/components/views/rooms/RoomPreviewBar-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomPreviewBar-test.tsx @@ -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, { ComponentProps } from "react"; -import { render, fireEvent, RenderResult, waitFor, waitForElementToBeRemoved } from "jest-matrix-react"; -import { Room, RoomMember, MatrixError, IContent } from "matrix-js-sdk/src/matrix"; +import React, { type ComponentProps } from "react"; +import { render, fireEvent, type RenderResult, waitFor, waitForElementToBeRemoved } from "jest-matrix-react"; +import { Room, type RoomMember, MatrixError, type IContent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { withClientContextRenderOptions, stubClient } from "../../../../test-utils"; diff --git a/test/unit-tests/components/views/rooms/RoomPreviewCard-test.tsx b/test/unit-tests/components/views/rooms/RoomPreviewCard-test.tsx index b80ce4bb5b..375366e8f9 100644 --- a/test/unit-tests/components/views/rooms/RoomPreviewCard-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomPreviewCard-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { mocked, Mocked } from "jest-mock"; +import { mocked, type Mocked } from "jest-mock"; import { render, screen, act } from "jest-matrix-react"; import { PendingEventOrdering, Room, RoomStateEvent, RoomType } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; diff --git a/test/unit-tests/components/views/rooms/RoomTile-test.tsx b/test/unit-tests/components/views/rooms/RoomTile-test.tsx index e5169d9121..4b785d2c24 100644 --- a/test/unit-tests/components/views/rooms/RoomTile-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomTile-test.tsx @@ -7,13 +7,19 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, screen, act, RenderResult } from "jest-matrix-react"; -import { mocked, Mocked } from "jest-mock"; -import { MatrixClient, PendingEventOrdering, Room, RoomStateEvent, Thread } from "matrix-js-sdk/src/matrix"; +import { render, screen, act, type RenderResult } from "jest-matrix-react"; +import { mocked, type Mocked } from "jest-mock"; +import { + type MatrixClient, + PendingEventOrdering, + Room, + RoomStateEvent, + type Thread, + type RoomMember, +} from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { Widget } from "matrix-widget-api"; -import type { RoomMember } from "matrix-js-sdk/src/matrix"; import type { ClientWidgetApi } from "matrix-widget-api"; import { stubClient, @@ -31,7 +37,7 @@ import RoomTile from "../../../../../src/components/views/rooms/RoomTile"; import { DefaultTagID } from "../../../../../src/stores/room-list/models"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; import PlatformPeg from "../../../../../src/PlatformPeg"; -import BasePlatform from "../../../../../src/BasePlatform"; +import type BasePlatform from "../../../../../src/BasePlatform"; import { WidgetMessagingStore } from "../../../../../src/stores/widgets/WidgetMessagingStore"; import { TestSdkContext } from "../../../TestSdkContext"; import { SDKContext } from "../../../../../src/contexts/SDKContext"; diff --git a/test/unit-tests/components/views/rooms/SendMessageComposer-test.tsx b/test/unit-tests/components/views/rooms/SendMessageComposer-test.tsx index ad0ec2afdf..fe36a0a7f0 100644 --- a/test/unit-tests/components/views/rooms/SendMessageComposer-test.tsx +++ b/test/unit-tests/components/views/rooms/SendMessageComposer-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { fireEvent, render, waitFor } from "jest-matrix-react"; -import { IContent, MatrixClient, MsgType } from "matrix-js-sdk/src/matrix"; +import { type IContent, type MatrixClient, MsgType } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import userEvent from "@testing-library/user-event"; @@ -26,7 +26,7 @@ import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; import defaultDispatcher from "../../../../../src/dispatcher/dispatcher"; import DocumentOffset from "../../../../../src/editor/offset"; import { Layout } from "../../../../../src/settings/enums/Layout"; -import { IRoomState, MainSplitContentType } from "../../../../../src/components/structures/RoomView"; +import { type IRoomState, MainSplitContentType } from "../../../../../src/components/structures/RoomView"; import { mockPlatformPeg } from "../../../../test-utils/platform"; import { doMaybeLocalRoomAction } from "../../../../../src/utils/local-room"; import { addTextToComposer } from "../../../../test-utils/composer"; diff --git a/test/unit-tests/components/views/rooms/ThirdPartyMemberInfo-test.tsx b/test/unit-tests/components/views/rooms/ThirdPartyMemberInfo-test.tsx index 60541cd30a..147e412d8f 100644 --- a/test/unit-tests/components/views/rooms/ThirdPartyMemberInfo-test.tsx +++ b/test/unit-tests/components/views/rooms/ThirdPartyMemberInfo-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen } from "jest-matrix-react"; -import { EventType, IEvent, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { EventType, type IEvent, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix"; import ThirdPartyMemberInfo from "../../../../../src/components/views/rooms/ThirdPartyMemberInfo"; import { getMockClientWithEventEmitter, mockClientMethodsUser } from "../../../../test-utils"; diff --git a/test/unit-tests/components/views/rooms/UserIdentityWarning-test.tsx b/test/unit-tests/components/views/rooms/UserIdentityWarning-test.tsx index 7548854baf..e1fa041747 100644 --- a/test/unit-tests/components/views/rooms/UserIdentityWarning-test.tsx +++ b/test/unit-tests/components/views/rooms/UserIdentityWarning-test.tsx @@ -9,12 +9,12 @@ import React from "react"; import { sleep, defer } from "matrix-js-sdk/src/utils"; import { EventType, - MatrixClient, + type MatrixClient, MatrixEvent, - Room, + type Room, RoomState, RoomStateEvent, - RoomMember, + type RoomMember, } from "matrix-js-sdk/src/matrix"; import { CryptoEvent, UserVerificationStatus } from "matrix-js-sdk/src/crypto-api"; import { act, render, screen, waitFor } from "jest-matrix-react"; diff --git a/test/unit-tests/components/views/rooms/VoiceRecordComposerTile-test.tsx b/test/unit-tests/components/views/rooms/VoiceRecordComposerTile-test.tsx index 06d314b588..743062ddd3 100644 --- a/test/unit-tests/components/views/rooms/VoiceRecordComposerTile-test.tsx +++ b/test/unit-tests/components/views/rooms/VoiceRecordComposerTile-test.tsx @@ -6,17 +6,17 @@ 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, { createRef, RefObject } from "react"; +import React, { createRef, type RefObject } from "react"; import { render } from "jest-matrix-react"; -import { MatrixClient, MsgType, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, MsgType, type Room } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import VoiceRecordComposerTile from "../../../../../src/components/views/rooms/VoiceRecordComposerTile"; import { doMaybeLocalRoomAction } from "../../../../../src/utils/local-room"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; -import { IUpload, VoiceMessageRecording } from "../../../../../src/audio/VoiceMessageRecording"; +import { type IUpload, type VoiceMessageRecording } from "../../../../../src/audio/VoiceMessageRecording"; import { VoiceRecordingStore } from "../../../../../src/stores/VoiceRecordingStore"; -import { PlaybackClock } from "../../../../../src/audio/PlaybackClock"; +import { type PlaybackClock } from "../../../../../src/audio/PlaybackClock"; import { mkEvent } from "../../../../test-utils"; jest.mock("../../../../../src/utils/local-room", () => ({ diff --git a/test/unit-tests/components/views/rooms/memberlist/MemberListHeaderView-test.tsx b/test/unit-tests/components/views/rooms/memberlist/MemberListHeaderView-test.tsx index 4ad9502961..16b9cdaf89 100644 --- a/test/unit-tests/components/views/rooms/memberlist/MemberListHeaderView-test.tsx +++ b/test/unit-tests/components/views/rooms/memberlist/MemberListHeaderView-test.tsx @@ -7,15 +7,15 @@ 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 from "react"; import { act, fireEvent, screen, waitFor } from "jest-matrix-react"; import { RoomMember, User, RoomEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { mocked } from "jest-mock"; +import type React from "react"; import { shouldShowComponent } from "../../../../../../src/customisations/helpers/UIComponents"; import defaultDispatcher from "../../../../../../src/dispatcher/dispatcher"; -import { Rendered, renderMemberList } from "./common"; +import { type Rendered, renderMemberList } from "./common"; jest.mock("../../../../../../src/customisations/helpers/UIComponents", () => ({ shouldShowComponent: jest.fn(), diff --git a/test/unit-tests/components/views/rooms/memberlist/MemberListView-test.tsx b/test/unit-tests/components/views/rooms/memberlist/MemberListView-test.tsx index 518ed4f690..5877416dae 100644 --- a/test/unit-tests/components/views/rooms/memberlist/MemberListView-test.tsx +++ b/test/unit-tests/components/views/rooms/memberlist/MemberListView-test.tsx @@ -7,12 +7,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, { act } from "react"; +import { act } from "react"; import { waitFor } from "jest-matrix-react"; -import { Room, RoomMember, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, type RoomMember, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import type React from "react"; import { filterConsole } from "../../../../../test-utils"; -import { Rendered, renderMemberList } from "./common"; +import { type Rendered, renderMemberList } from "./common"; jest.mock("../../../../../../src/customisations/helpers/UIComponents", () => ({ shouldShowComponent: jest.fn(), diff --git a/test/unit-tests/components/views/rooms/memberlist/MemberTileView-test.tsx b/test/unit-tests/components/views/rooms/memberlist/MemberTileView-test.tsx index 284483a839..4f06c90b43 100644 --- a/test/unit-tests/components/views/rooms/memberlist/MemberTileView-test.tsx +++ b/test/unit-tests/components/views/rooms/memberlist/MemberTileView-test.tsx @@ -8,13 +8,13 @@ import React from "react"; import { render, screen, waitFor } from "jest-matrix-react"; -import { MatrixClient, RoomMember as SdkRoomMember, Device, Room } from "matrix-js-sdk/src/matrix"; -import { UserVerificationStatus, DeviceVerificationStatus } from "matrix-js-sdk/src/crypto-api"; +import { type MatrixClient, RoomMember as SdkRoomMember, type Device, Room } from "matrix-js-sdk/src/matrix"; +import { type UserVerificationStatus, type DeviceVerificationStatus } from "matrix-js-sdk/src/crypto-api"; import { mocked } from "jest-mock"; import userEvent from "@testing-library/user-event"; import * as TestUtils from "../../../../../test-utils"; -import { RoomMember } from "../../../../../../src/models/rooms/RoomMember"; +import { type RoomMember } from "../../../../../../src/models/rooms/RoomMember"; import { getPending3PidInvites, sdkRoomMemberToRoomMember, diff --git a/test/unit-tests/components/views/rooms/memberlist/common.tsx b/test/unit-tests/components/views/rooms/memberlist/common.tsx index 2d602356a7..786c9c875e 100644 --- a/test/unit-tests/components/views/rooms/memberlist/common.tsx +++ b/test/unit-tests/components/views/rooms/memberlist/common.tsx @@ -8,8 +8,16 @@ Please see LICENSE files in the repository root for full details. */ import React, { act } from "react"; -import { render, RenderResult, waitFor } from "jest-matrix-react"; -import { Room, MatrixClient, RoomState, RoomMember, User, EventType, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { render, type RenderResult, waitFor } from "jest-matrix-react"; +import { + Room, + type MatrixClient, + type RoomState, + RoomMember, + User, + EventType, + RoomStateEvent, +} from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { MatrixClientPeg } from "../../../../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/EditWysiwygComposer-test.tsx b/test/unit-tests/components/views/rooms/wysiwyg_composer/EditWysiwygComposer-test.tsx index 05c7bc4608..14905f05cc 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/EditWysiwygComposer-test.tsx +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/EditWysiwygComposer-test.tsx @@ -19,8 +19,11 @@ import { EditWysiwygComposer } from "../../../../../../src/components/views/room import EditorStateTransfer from "../../../../../../src/utils/EditorStateTransfer"; import { Emoji } from "../../../../../../src/components/views/rooms/wysiwyg_composer/components/Emoji"; import { ChevronFace } from "../../../../../../src/components/structures/ContextMenu"; -import { ComposerInsertPayload, ComposerType } from "../../../../../../src/dispatcher/payloads/ComposerInsertPayload"; -import { ActionPayload } from "../../../../../../src/dispatcher/payloads"; +import { + type ComposerInsertPayload, + ComposerType, +} from "../../../../../../src/dispatcher/payloads/ComposerInsertPayload"; +import { type ActionPayload } from "../../../../../../src/dispatcher/payloads"; import * as EmojiButton from "../../../../../../src/components/views/rooms/EmojiButton"; import { createMocks } from "./utils"; import { ScopedRoomContextProvider } from "../../../../../../src/contexts/ScopedRoomContext.tsx"; diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/SendWysiwygComposer-test.tsx b/test/unit-tests/components/views/rooms/wysiwyg_composer/SendWysiwygComposer-test.tsx index 4cba44bd9c..d8215a101e 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/SendWysiwygComposer-test.tsx +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/SendWysiwygComposer-test.tsx @@ -17,7 +17,10 @@ import { Action } from "../../../../../../src/dispatcher/actions"; import { flushPromises } from "../../../../../test-utils"; import { SendWysiwygComposer } from "../../../../../../src/components/views/rooms/wysiwyg_composer/"; import { aboveLeftOf } from "../../../../../../src/components/structures/ContextMenu"; -import { ComposerInsertPayload, ComposerType } from "../../../../../../src/dispatcher/payloads/ComposerInsertPayload"; +import { + type ComposerInsertPayload, + ComposerType, +} from "../../../../../../src/dispatcher/payloads/ComposerInsertPayload"; import { setSelection } from "../../../../../../src/components/views/rooms/wysiwyg_composer/utils/selection"; import { createMocks } from "./utils"; import { ScopedRoomContextProvider } from "../../../../../../src/contexts/ScopedRoomContext.tsx"; diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/components/FormattingButtons-test.tsx b/test/unit-tests/components/views/rooms/wysiwyg_composer/components/FormattingButtons-test.tsx index e0f9e2d8b4..94d207eb91 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/components/FormattingButtons-test.tsx +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/components/FormattingButtons-test.tsx @@ -9,7 +9,12 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { cleanup, render, screen, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { ActionState, ActionTypes, AllActionStates, FormattingFunctions } from "@vector-im/matrix-wysiwyg"; +import { + type ActionState, + type ActionTypes, + type AllActionStates, + type FormattingFunctions, +} from "@vector-im/matrix-wysiwyg"; import { FormattingButtons } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/components/FormattingButtons"; import * as LinkModal from "../../../../../../../src/components/views/rooms/wysiwyg_composer/components/LinkModal"; diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/components/LinkModal-test.tsx b/test/unit-tests/components/views/rooms/wysiwyg_composer/components/LinkModal-test.tsx index f864f27de2..4ff9b893db 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/components/LinkModal-test.tsx +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/components/LinkModal-test.tsx @@ -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 { FormattingFunctions } from "@vector-im/matrix-wysiwyg"; +import { type FormattingFunctions } from "@vector-im/matrix-wysiwyg"; import { render, screen, waitFor } from "jest-matrix-react"; import React from "react"; import userEvent from "@testing-library/user-event"; @@ -14,7 +14,7 @@ import userEvent from "@testing-library/user-event"; import { LinkModal } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/components/LinkModal"; import { mockPlatformPeg } from "../../../../../../test-utils"; import * as selection from "../../../../../../../src/components/views/rooms/wysiwyg_composer/utils/selection"; -import { SubSelection } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/types"; +import { type SubSelection } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/types"; describe("LinkModal", () => { const formattingFunctions = { diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete-test.tsx b/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete-test.tsx index 5886b501b4..8a3d0af791 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete-test.tsx +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete-test.tsx @@ -14,9 +14,9 @@ import { initOnce } from "@vector-im/matrix-wysiwyg"; import MatrixClientContext from "../../../../../../../src/contexts/MatrixClientContext"; import { WysiwygAutocomplete } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/components/WysiwygAutocomplete"; import { getRoomContext, mkStubRoom, stubClient } from "../../../../../../test-utils"; -import Autocomplete from "../../../../../../../src/components/views/rooms/Autocomplete"; -import Autocompleter, { ICompletion } from "../../../../../../../src/autocomplete/Autocompleter"; -import AutocompleteProvider from "../../../../../../../src/autocomplete/AutocompleteProvider"; +import type Autocomplete from "../../../../../../../src/components/views/rooms/Autocomplete"; +import Autocompleter, { type ICompletion } from "../../../../../../../src/autocomplete/Autocompleter"; +import type AutocompleteProvider from "../../../../../../../src/autocomplete/AutocompleteProvider"; import { ScopedRoomContextProvider } from "../../../../../../../src/contexts/ScopedRoomContext.tsx"; const mockCompletion: ICompletion[] = [ diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygComposer-test.tsx b/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygComposer-test.tsx index e86488660e..2d670dbc6b 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygComposer-test.tsx +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/components/WysiwygComposer-test.tsx @@ -24,14 +24,14 @@ import { getDefaultContextValue, } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/ComposerContext"; import { createMocks } from "../utils"; -import EditorStateTransfer from "../../../../../../../src/utils/EditorStateTransfer"; -import { SubSelection } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/types"; +import type EditorStateTransfer from "../../../../../../../src/utils/EditorStateTransfer"; +import { type SubSelection } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/types"; import { setSelection } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/utils/selection"; import { parseEditorStateTransfer } from "../../../../../../../src/components/views/rooms/wysiwyg_composer/hooks/useInitialContent"; -import Autocompleter, { ICompletion } from "../../../../../../../src/autocomplete/Autocompleter"; -import AutocompleteProvider from "../../../../../../../src/autocomplete/AutocompleteProvider"; +import Autocompleter, { type ICompletion } from "../../../../../../../src/autocomplete/Autocompleter"; +import type AutocompleteProvider from "../../../../../../../src/autocomplete/AutocompleteProvider"; import * as Permalinks from "../../../../../../../src/utils/permalinks/Permalinks"; -import { PermalinkParts } from "../../../../../../../src/utils/permalinks/PermalinkConstructor"; +import { type PermalinkParts } from "../../../../../../../src/utils/permalinks/PermalinkConstructor"; import { ScopedRoomContextProvider } from "../../../../../../../src/contexts/ScopedRoomContext.tsx"; beforeAll(initOnce, 10000); diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx b/test/unit-tests/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx index 06762b2c8f..203f82cc66 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/hooks/useSuggestion-test.tsx @@ -5,10 +5,9 @@ Copyright 2023 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import React from "react"; - +import type React from "react"; import { - Suggestion, + type Suggestion, findSuggestionInText, getMappedSuggestion, processCommand, diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/hooks/utils-test.tsx b/test/unit-tests/components/views/rooms/wysiwyg_composer/hooks/utils-test.tsx index c691756200..f47c8075fd 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/hooks/utils-test.tsx +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/hooks/utils-test.tsx @@ -5,13 +5,13 @@ Copyright 2023 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import { IEventRelation, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type IEventRelation, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { waitFor } from "jest-matrix-react"; import { TimelineRenderingType } from "../../../../../../../src/contexts/RoomContext"; import { mkStubRoom, stubClient } from "../../../../../../test-utils"; import ContentMessages from "../../../../../../../src/ContentMessages"; -import { IRoomState } from "../../../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../../../src/components/structures/RoomView"; import { handleClipboardEvent, isEventToHandleAsClipboardEvent, diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/utils.ts b/test/unit-tests/components/views/rooms/wysiwyg_composer/utils.ts index cb72c90fb3..3a9e18fd0a 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/utils.ts +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/utils.ts @@ -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 { EventTimeline, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type EventTimeline, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { getRoomContext, mkEvent, mkStubRoom, stubClient } from "../../../../../test-utils"; -import { IRoomState } from "../../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../../src/components/structures/RoomView"; import EditorStateTransfer from "../../../../../../src/utils/EditorStateTransfer"; export function createMocks(eventContent = "Replying to this new content") { diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/utils/autocomplete-test.ts b/test/unit-tests/components/views/rooms/wysiwyg_composer/utils/autocomplete-test.ts index 292314f87f..bc572412c5 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/utils/autocomplete-test.ts +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/utils/autocomplete-test.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import { mocked } from "jest-mock"; import React from "react"; -import { ICompletion } from "../../../../../../../src/autocomplete/Autocompleter"; +import { type ICompletion } from "../../../../../../../src/autocomplete/Autocompleter"; import { buildQuery, getRoomFromCompletion, diff --git a/test/unit-tests/components/views/rooms/wysiwyg_composer/utils/message-test.ts b/test/unit-tests/components/views/rooms/wysiwyg_composer/utils/message-test.ts index 867947bef9..23f46244db 100644 --- a/test/unit-tests/components/views/rooms/wysiwyg_composer/utils/message-test.ts +++ b/test/unit-tests/components/views/rooms/wysiwyg_composer/utils/message-test.ts @@ -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 { EventStatus, IEventRelation, MsgType } from "matrix-js-sdk/src/matrix"; +import { EventStatus, type IEventRelation, MsgType } from "matrix-js-sdk/src/matrix"; -import { IRoomState } from "../../../../../../../src/components/structures/RoomView"; +import { type IRoomState } from "../../../../../../../src/components/structures/RoomView"; import { editMessage, sendMessage, diff --git a/test/unit-tests/components/views/settings/AddPrivilegedUsers-test.tsx b/test/unit-tests/components/views/settings/AddPrivilegedUsers-test.tsx index 875b5d9f19..e64752c5ab 100644 --- a/test/unit-tests/components/views/settings/AddPrivilegedUsers-test.tsx +++ b/test/unit-tests/components/views/settings/AddPrivilegedUsers-test.tsx @@ -19,7 +19,7 @@ import { hasLowerOrEqualLevelThanDefaultLevel, } from "../../../../../src/components/views/settings/AddPrivilegedUsers"; import UserProvider from "../../../../../src/autocomplete/UserProvider"; -import { ICompletion } from "../../../../../src/autocomplete/Autocompleter"; +import { type ICompletion } from "../../../../../src/autocomplete/Autocompleter"; jest.mock("../../../../../src/autocomplete/UserProvider"); jest.mock("../../../../../src/stores/WidgetStore"); diff --git a/test/unit-tests/components/views/settings/AddRemoveThreepids-test.tsx b/test/unit-tests/components/views/settings/AddRemoveThreepids-test.tsx index dacd2c52a5..5685f1eb8f 100644 --- a/test/unit-tests/components/views/settings/AddRemoveThreepids-test.tsx +++ b/test/unit-tests/components/views/settings/AddRemoveThreepids-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { render, screen, waitFor, cleanup } from "jest-matrix-react"; -import { MatrixClient, MatrixError, ThreepidMedium } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, MatrixError, ThreepidMedium } from "matrix-js-sdk/src/matrix"; import React from "react"; import userEvent from "@testing-library/user-event"; import { mocked } from "jest-mock"; diff --git a/test/unit-tests/components/views/settings/CrossSigningPanel-test.tsx b/test/unit-tests/components/views/settings/CrossSigningPanel-test.tsx index ee7c642587..7c1f6b4d1f 100644 --- a/test/unit-tests/components/views/settings/CrossSigningPanel-test.tsx +++ b/test/unit-tests/components/views/settings/CrossSigningPanel-test.tsx @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen } from "jest-matrix-react"; -import { Mocked, mocked } from "jest-mock"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Mocked, mocked } from "jest-mock"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import CrossSigningPanel from "../../../../../src/components/views/settings/CrossSigningPanel"; import { diff --git a/test/unit-tests/components/views/settings/CryptographyPanel-test.tsx b/test/unit-tests/components/views/settings/CryptographyPanel-test.tsx index 3d36873473..1ee64afe0f 100644 --- a/test/unit-tests/components/views/settings/CryptographyPanel-test.tsx +++ b/test/unit-tests/components/views/settings/CryptographyPanel-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, waitFor, screen, fireEvent } from "jest-matrix-react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/components/views/settings/EventIndexPanel-test.tsx b/test/unit-tests/components/views/settings/EventIndexPanel-test.tsx index c154a3c2a8..690d9ed2f3 100644 --- a/test/unit-tests/components/views/settings/EventIndexPanel-test.tsx +++ b/test/unit-tests/components/views/settings/EventIndexPanel-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { fireEvent, render, screen, within } from "jest-matrix-react"; -import { defer, IDeferred } from "matrix-js-sdk/src/utils"; +import { defer, type IDeferred } from "matrix-js-sdk/src/utils"; import EventIndexPanel from "../../../../../src/components/views/settings/EventIndexPanel"; import EventIndexPeg from "../../../../../src/indexing/EventIndexPeg"; diff --git a/test/unit-tests/components/views/settings/JoinRuleSettings-test.tsx b/test/unit-tests/components/views/settings/JoinRuleSettings-test.tsx index 87cef69786..7fd34159a0 100644 --- a/test/unit-tests/components/views/settings/JoinRuleSettings-test.tsx +++ b/test/unit-tests/components/views/settings/JoinRuleSettings-test.tsx @@ -10,8 +10,8 @@ import React from "react"; import { act, fireEvent, render, screen, waitFor, within } from "jest-matrix-react"; import { EventType, - GuestAccess, - HistoryVisibility, + type GuestAccess, + type HistoryVisibility, JoinRule, MatrixEvent, Room, @@ -21,7 +21,7 @@ import { Visibility, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; -import { defer, IDeferred } from "matrix-js-sdk/src/utils"; +import { defer, type IDeferred } from "matrix-js-sdk/src/utils"; import { clearAllModals, @@ -30,7 +30,9 @@ import { mockClientMethodsUser, } from "../../../../test-utils"; import { filterBoolean } from "../../../../../src/utils/arrays"; -import JoinRuleSettings, { JoinRuleSettingsProps } from "../../../../../src/components/views/settings/JoinRuleSettings"; +import JoinRuleSettings, { + type JoinRuleSettingsProps, +} from "../../../../../src/components/views/settings/JoinRuleSettings"; import { PreferredRoomVersions } from "../../../../../src/utils/PreferredRoomVersions"; import SpaceStore from "../../../../../src/stores/spaces/SpaceStore"; import SettingsStore from "../../../../../src/settings/SettingsStore"; diff --git a/test/unit-tests/components/views/settings/Notifications-test.tsx b/test/unit-tests/components/views/settings/Notifications-test.tsx index d004fa5efd..00653e1a3b 100644 --- a/test/unit-tests/components/views/settings/Notifications-test.tsx +++ b/test/unit-tests/components/views/settings/Notifications-test.tsx @@ -8,19 +8,19 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { - IPushRule, - IPushRules, + type IPushRule, + type IPushRules, RuleId, - IPusher, + type IPusher, LOCAL_NOTIFICATION_SETTINGS_PREFIX, MatrixEvent, Room, PushRuleActionName, TweakName, ConditionKind, - IPushRuleCondition, + type IPushRuleCondition, PushRuleKind, - IThreepid, + type IThreepid, ThreepidMedium, } from "matrix-js-sdk/src/matrix"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; diff --git a/test/unit-tests/components/views/settings/PowerLevelSelector-test.tsx b/test/unit-tests/components/views/settings/PowerLevelSelector-test.tsx index d94587f0f3..7837db5f71 100644 --- a/test/unit-tests/components/views/settings/PowerLevelSelector-test.tsx +++ b/test/unit-tests/components/views/settings/PowerLevelSelector-test.tsx @@ -7,7 +7,7 @@ */ import { render, screen } from "jest-matrix-react"; -import React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import userEvent from "@testing-library/user-event"; import { PowerLevelSelector } from "../../../../../src/components/views/settings/PowerLevelSelector"; diff --git a/test/unit-tests/components/views/settings/ThemeChoicePanel-test.tsx b/test/unit-tests/components/views/settings/ThemeChoicePanel-test.tsx index 354fd44b9d..f1dbc9a2e0 100644 --- a/test/unit-tests/components/views/settings/ThemeChoicePanel-test.tsx +++ b/test/unit-tests/components/views/settings/ThemeChoicePanel-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { act, render, screen, waitFor } from "jest-matrix-react"; -import { mocked, MockedObject } from "jest-mock"; +import { mocked, type MockedObject } from "jest-mock"; import userEvent from "@testing-library/user-event"; import fetchMock from "fetch-mock-jest"; diff --git a/test/unit-tests/components/views/settings/UserProfileSettings-test.tsx b/test/unit-tests/components/views/settings/UserProfileSettings-test.tsx index 0c80cd6f5d..9a5b8043ac 100644 --- a/test/unit-tests/components/views/settings/UserProfileSettings-test.tsx +++ b/test/unit-tests/components/views/settings/UserProfileSettings-test.tsx @@ -6,16 +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 React, { ChangeEvent } from "react"; +import React, { type ChangeEvent } from "react"; import { act, render, screen } from "jest-matrix-react"; -import { MatrixClient, UploadResponse } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type UploadResponse } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import userEvent from "@testing-library/user-event"; import { TooltipProvider } from "@vector-im/compound-web"; import UserProfileSettings from "../../../../../src/components/views/settings/UserProfileSettings"; import { mkStubRoom, stubClient } from "../../../../test-utils"; -import { ToastContext, ToastRack } from "../../../../../src/contexts/ToastContext"; +import { ToastContext, type ToastRack } from "../../../../../src/contexts/ToastContext"; import { OwnProfileStore } from "../../../../../src/stores/OwnProfileStore"; import MatrixClientContext from "../../../../../src/contexts/MatrixClientContext"; import dis from "../../../../../src/dispatcher/dispatcher"; diff --git a/test/unit-tests/components/views/settings/devices/DeviceDetailHeading-test.tsx b/test/unit-tests/components/views/settings/devices/DeviceDetailHeading-test.tsx index d963acf76b..807a91843d 100644 --- a/test/unit-tests/components/views/settings/devices/DeviceDetailHeading-test.tsx +++ b/test/unit-tests/components/views/settings/devices/DeviceDetailHeading-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, render, RenderResult } from "jest-matrix-react"; +import { fireEvent, render, type RenderResult } from "jest-matrix-react"; import { DeviceDetailHeading } from "../../../../../../src/components/views/settings/devices/DeviceDetailHeading"; import { flushPromisesWithFakeTimers } from "../../../../../test-utils"; diff --git a/test/unit-tests/components/views/settings/devices/DeviceDetails-test.tsx b/test/unit-tests/components/views/settings/devices/DeviceDetails-test.tsx index 765621eee5..58179edae8 100644 --- a/test/unit-tests/components/views/settings/devices/DeviceDetails-test.tsx +++ b/test/unit-tests/components/views/settings/devices/DeviceDetails-test.tsx @@ -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 React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import { fireEvent, render } from "jest-matrix-react"; import { PUSHER_ENABLED } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/components/views/settings/devices/DeviceTile-test.tsx b/test/unit-tests/components/views/settings/devices/DeviceTile-test.tsx index a868b45f27..a87561d872 100644 --- a/test/unit-tests/components/views/settings/devices/DeviceTile-test.tsx +++ b/test/unit-tests/components/views/settings/devices/DeviceTile-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render } from "jest-matrix-react"; -import { IMyDevice } from "matrix-js-sdk/src/matrix"; +import { type IMyDevice } from "matrix-js-sdk/src/matrix"; import DeviceTile from "../../../../../../src/components/views/settings/devices/DeviceTile"; import { DeviceType } from "../../../../../../src/utils/device/parseUserAgent"; diff --git a/test/unit-tests/components/views/settings/devices/DeviceVerificationStatusCard-test.tsx b/test/unit-tests/components/views/settings/devices/DeviceVerificationStatusCard-test.tsx index 8ffb9889e6..4059c9a6a4 100644 --- a/test/unit-tests/components/views/settings/devices/DeviceVerificationStatusCard-test.tsx +++ b/test/unit-tests/components/views/settings/devices/DeviceVerificationStatusCard-test.tsx @@ -11,9 +11,9 @@ import React from "react"; import { DeviceVerificationStatusCard, - DeviceVerificationStatusCardProps, + type DeviceVerificationStatusCardProps, } from "../../../../../../src/components/views/settings/devices/DeviceVerificationStatusCard"; -import { ExtendedDevice } from "../../../../../../src/components/views/settings/devices/types"; +import { type ExtendedDevice } from "../../../../../../src/components/views/settings/devices/types"; import { DeviceType } from "../../../../../../src/utils/device/parseUserAgent"; describe("", () => { diff --git a/test/unit-tests/components/views/settings/devices/FilteredDeviceList-test.tsx b/test/unit-tests/components/views/settings/devices/FilteredDeviceList-test.tsx index 3318a13e6a..2992b95a5d 100644 --- a/test/unit-tests/components/views/settings/devices/FilteredDeviceList-test.tsx +++ b/test/unit-tests/components/views/settings/devices/FilteredDeviceList-test.tsx @@ -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 React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import { act, fireEvent, render } from "jest-matrix-react"; import { FilteredDeviceList } from "../../../../../../src/components/views/settings/devices/FilteredDeviceList"; diff --git a/test/unit-tests/components/views/settings/devices/LoginWithQR-test.tsx b/test/unit-tests/components/views/settings/devices/LoginWithQR-test.tsx index 7b50ae0278..d9e9b3e391 100644 --- a/test/unit-tests/components/views/settings/devices/LoginWithQR-test.tsx +++ b/test/unit-tests/components/views/settings/devices/LoginWithQR-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { cleanup, render, waitFor } from "jest-matrix-react"; -import { mocked, MockedObject } from "jest-mock"; +import { mocked, type MockedObject } from "jest-mock"; import React from "react"; import { ClientRendezvousFailureReason, @@ -15,7 +15,7 @@ import { MSC4108SignInWithQR, RendezvousError, } from "matrix-js-sdk/src/rendezvous"; -import { HTTPError, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { HTTPError, type MatrixClient } from "matrix-js-sdk/src/matrix"; import LoginWithQR from "../../../../../../src/components/views/auth/LoginWithQR"; import { Click, Mode, Phase } from "../../../../../../src/components/views/auth/LoginWithQR-types"; diff --git a/test/unit-tests/components/views/settings/devices/LoginWithQRFlow-test.tsx b/test/unit-tests/components/views/settings/devices/LoginWithQRFlow-test.tsx index 9120ff4f66..9d9c5763be 100644 --- a/test/unit-tests/components/views/settings/devices/LoginWithQRFlow-test.tsx +++ b/test/unit-tests/components/views/settings/devices/LoginWithQRFlow-test.tsx @@ -11,7 +11,7 @@ import React from "react"; import { ClientRendezvousFailureReason, MSC4108FailureReason } from "matrix-js-sdk/src/rendezvous"; import LoginWithQRFlow from "../../../../../../src/components/views/auth/LoginWithQRFlow"; -import { LoginWithQRFailureReason, FailureReason } from "../../../../../../src/components/views/auth/LoginWithQR"; +import { LoginWithQRFailureReason, type FailureReason } from "../../../../../../src/components/views/auth/LoginWithQR"; import { Click, Phase } from "../../../../../../src/components/views/auth/LoginWithQR-types"; describe("", () => { diff --git a/test/unit-tests/components/views/settings/devices/LoginWithQRSection-test.tsx b/test/unit-tests/components/views/settings/devices/LoginWithQRSection-test.tsx index ebbc359889..c9511fb188 100644 --- a/test/unit-tests/components/views/settings/devices/LoginWithQRSection-test.tsx +++ b/test/unit-tests/components/views/settings/devices/LoginWithQRSection-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { render } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { IClientWellKnown, IServerVersions, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type IClientWellKnown, type IServerVersions, type MatrixClient } from "matrix-js-sdk/src/matrix"; import React from "react"; import fetchMock from "fetch-mock-jest"; diff --git a/test/unit-tests/components/views/settings/devices/deleteDevices-test.tsx b/test/unit-tests/components/views/settings/devices/deleteDevices-test.tsx index 9aeaa5afcd..3b030c61c9 100644 --- a/test/unit-tests/components/views/settings/devices/deleteDevices-test.tsx +++ b/test/unit-tests/components/views/settings/devices/deleteDevices-test.tsx @@ -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 { MatrixError, UIAFlow } from "matrix-js-sdk/src/matrix"; +import { MatrixError, type UIAFlow } from "matrix-js-sdk/src/matrix"; import { deleteDevicesWithInteractiveAuth } from "../../../../../../src/components/views/settings/devices/deleteDevices"; import Modal from "../../../../../../src/Modal"; diff --git a/test/unit-tests/components/views/settings/discovery/DiscoverySettings-test.tsx b/test/unit-tests/components/views/settings/discovery/DiscoverySettings-test.tsx index 261a6f1d72..999029d7c7 100644 --- a/test/unit-tests/components/views/settings/discovery/DiscoverySettings-test.tsx +++ b/test/unit-tests/components/views/settings/discovery/DiscoverySettings-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { act, render, screen } from "jest-matrix-react"; -import { MatrixClient, MatrixEvent, Terms, ThreepidMedium } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, MatrixEvent, type Terms, ThreepidMedium } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/views/settings/encryption/AdvancedPanel-test.tsx b/test/unit-tests/components/views/settings/encryption/AdvancedPanel-test.tsx index 2ec51b5363..76d7ab712b 100644 --- a/test/unit-tests/components/views/settings/encryption/AdvancedPanel-test.tsx +++ b/test/unit-tests/components/views/settings/encryption/AdvancedPanel-test.tsx @@ -6,7 +6,7 @@ */ import React from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { render, screen, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/views/settings/encryption/ChangeRecoveryKey-test.tsx b/test/unit-tests/components/views/settings/encryption/ChangeRecoveryKey-test.tsx index 8929916a0e..783aaf701c 100644 --- a/test/unit-tests/components/views/settings/encryption/ChangeRecoveryKey-test.tsx +++ b/test/unit-tests/components/views/settings/encryption/ChangeRecoveryKey-test.tsx @@ -7,7 +7,7 @@ import React from "react"; import { render, screen, waitFor } from "jest-matrix-react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import userEvent from "@testing-library/user-event"; import { ChangeRecoveryKey } from "../../../../../../src/components/views/settings/encryption/ChangeRecoveryKey"; diff --git a/test/unit-tests/components/views/settings/encryption/RecoveryPanel-test.tsx b/test/unit-tests/components/views/settings/encryption/RecoveryPanel-test.tsx index d13e857954..f0a129e6a1 100644 --- a/test/unit-tests/components/views/settings/encryption/RecoveryPanel-test.tsx +++ b/test/unit-tests/components/views/settings/encryption/RecoveryPanel-test.tsx @@ -6,7 +6,7 @@ */ import React from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { render, screen } from "jest-matrix-react"; import { waitFor } from "@testing-library/dom"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/views/settings/encryption/ResetIdentityPanel-test.tsx b/test/unit-tests/components/views/settings/encryption/ResetIdentityPanel-test.tsx index 3caa1cc667..7b3095b5b4 100644 --- a/test/unit-tests/components/views/settings/encryption/ResetIdentityPanel-test.tsx +++ b/test/unit-tests/components/views/settings/encryption/ResetIdentityPanel-test.tsx @@ -6,7 +6,7 @@ */ import React from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { render, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; diff --git a/test/unit-tests/components/views/settings/notifications/Notifications2-test.tsx b/test/unit-tests/components/views/settings/notifications/Notifications2-test.tsx index 24441689a2..2a6a3d56db 100644 --- a/test/unit-tests/components/views/settings/notifications/Notifications2-test.tsx +++ b/test/unit-tests/components/views/settings/notifications/Notifications2-test.tsx @@ -10,8 +10,8 @@ import { act, findByRole, getByRole, queryByRole, render, waitFor } from "jest-m import userEvent from "@testing-library/user-event"; import { ThreepidMedium, - IPushRules, - MatrixClient, + type IPushRules, + type MatrixClient, NotificationCountType, PushRuleKind, Room, diff --git a/test/unit-tests/components/views/settings/tabs/SettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/SettingsTab-test.tsx index ff4d781e48..72f7a85b3c 100644 --- a/test/unit-tests/components/views/settings/tabs/SettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/SettingsTab-test.tsx @@ -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 React, { ReactElement } from "react"; +import React, { type ReactElement } from "react"; import { render } from "jest-matrix-react"; -import SettingsTab, { SettingsTabProps } from "../../../../../../src/components/views/settings/tabs/SettingsTab"; +import SettingsTab, { type SettingsTabProps } from "../../../../../../src/components/views/settings/tabs/SettingsTab"; describe("", () => { const getComponent = (props: SettingsTabProps): ReactElement => ; diff --git a/test/unit-tests/components/views/settings/tabs/room/AdvancedRoomSettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/room/AdvancedRoomSettingsTab-test.tsx index b19424f192..b587c03626 100644 --- a/test/unit-tests/components/views/settings/tabs/room/AdvancedRoomSettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/room/AdvancedRoomSettingsTab-test.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, render, RenderResult, screen } from "jest-matrix-react"; -import { MatrixClient, Room, EventType, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { fireEvent, render, type RenderResult, screen } from "jest-matrix-react"; +import { type MatrixClient, type Room, EventType, MatrixEvent } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import AdvancedRoomSettingsTab from "../../../../../../../src/components/views/settings/tabs/room/AdvancedRoomSettingsTab"; diff --git a/test/unit-tests/components/views/settings/tabs/room/NotificationSettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/room/NotificationSettingsTab-test.tsx index 47e9565329..54d8bd7ac0 100644 --- a/test/unit-tests/components/views/settings/tabs/room/NotificationSettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/room/NotificationSettingsTab-test.tsx @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, RenderResult, screen } from "jest-matrix-react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { render, type RenderResult, screen } from "jest-matrix-react"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import userEvent from "@testing-library/user-event"; import NotificationSettingsTab from "../../../../../../../src/components/views/settings/tabs/room/NotificationSettingsTab"; import { mkStubRoom, stubClient } from "../../../../../../test-utils"; import { MatrixClientPeg } from "../../../../../../../src/MatrixClientPeg"; import { EchoChamber } from "../../../../../../../src/stores/local-echo/EchoChamber"; -import { RoomEchoChamber } from "../../../../../../../src/stores/local-echo/RoomEchoChamber"; +import { type RoomEchoChamber } from "../../../../../../../src/stores/local-echo/RoomEchoChamber"; import SettingsStore from "../../../../../../../src/settings/SettingsStore"; import { SettingLevel } from "../../../../../../../src/settings/SettingLevel"; diff --git a/test/unit-tests/components/views/settings/tabs/room/RolesRoomSettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/room/RolesRoomSettingsTab-test.tsx index 6d3d688112..9dc5860119 100644 --- a/test/unit-tests/components/views/settings/tabs/room/RolesRoomSettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/room/RolesRoomSettingsTab-test.tsx @@ -7,8 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, getByRole, render, RenderResult, screen, waitFor } from "jest-matrix-react"; -import { MatrixClient, EventType, MatrixEvent, Room, RoomMember, ISendEventResponse } from "matrix-js-sdk/src/matrix"; +import { fireEvent, getByRole, render, type RenderResult, screen, waitFor } from "jest-matrix-react"; +import { + type MatrixClient, + EventType, + MatrixEvent, + Room, + RoomMember, + type ISendEventResponse, +} from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { mocked } from "jest-mock"; import { defer } from "matrix-js-sdk/src/utils"; diff --git a/test/unit-tests/components/views/settings/tabs/room/VoipRoomSettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/room/VoipRoomSettingsTab-test.tsx index 8e244999ad..4184e76360 100644 --- a/test/unit-tests/components/views/settings/tabs/room/VoipRoomSettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/room/VoipRoomSettingsTab-test.tsx @@ -7,8 +7,8 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, render, RenderResult, waitFor } from "jest-matrix-react"; -import { MatrixClient, Room, MatrixEvent, EventType, JoinRule } from "matrix-js-sdk/src/matrix"; +import { fireEvent, render, type RenderResult, waitFor } from "jest-matrix-react"; +import { type MatrixClient, type Room, type MatrixEvent, EventType, JoinRule } from "matrix-js-sdk/src/matrix"; import { mkStubRoom, stubClient } from "../../../../../../test-utils"; import { MatrixClientPeg } from "../../../../../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/components/views/settings/tabs/user/AccountUserSettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/user/AccountUserSettingsTab-test.tsx index 18ad320b02..f6b6b2e850 100644 --- a/test/unit-tests/components/views/settings/tabs/user/AccountUserSettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/user/AccountUserSettingsTab-test.tsx @@ -8,10 +8,10 @@ Please see LICENSE files in the repository root for full details. import { fireEvent, render, screen, within } from "jest-matrix-react"; import React from "react"; -import { MatrixClient, ThreepidMedium } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, ThreepidMedium } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import userEvent from "@testing-library/user-event"; -import { MockedObject } from "jest-mock"; +import { type MockedObject } from "jest-mock"; import AccountUserSettingsTab from "../../../../../../../src/components/views/settings/tabs/user/AccountUserSettingsTab"; import { SdkContextClass, SDKContext } from "../../../../../../../src/contexts/SDKContext"; @@ -24,7 +24,7 @@ import { flushPromises, } from "../../../../../../test-utils"; import { UIFeature } from "../../../../../../../src/settings/UIFeature"; -import { OidcClientStore } from "../../../../../../../src/stores/oidc/OidcClientStore"; +import { type OidcClientStore } from "../../../../../../../src/stores/oidc/OidcClientStore"; import MatrixClientContext from "../../../../../../../src/contexts/MatrixClientContext"; import Modal from "../../../../../../../src/Modal"; diff --git a/test/unit-tests/components/views/settings/tabs/user/AppearanceUserSettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/user/AppearanceUserSettingsTab-test.tsx index 81ea635609..69f06d455c 100644 --- a/test/unit-tests/components/views/settings/tabs/user/AppearanceUserSettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/user/AppearanceUserSettingsTab-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { render } from "jest-matrix-react"; import React from "react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import AppearanceUserSettingsTab from "../../../../../../../src/components/views/settings/tabs/user/AppearanceUserSettingsTab"; import { withClientContextRenderOptions, stubClient } from "../../../../../../test-utils"; diff --git a/test/unit-tests/components/views/settings/tabs/user/EncryptionUserSettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/user/EncryptionUserSettingsTab-test.tsx index eccbb4b0fa..fdf8f7106d 100644 --- a/test/unit-tests/components/views/settings/tabs/user/EncryptionUserSettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/user/EncryptionUserSettingsTab-test.tsx @@ -7,14 +7,14 @@ import React from "react"; import { render, screen } from "jest-matrix-react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { waitFor } from "@testing-library/dom"; import userEvent from "@testing-library/user-event"; import { mocked } from "jest-mock"; import { EncryptionUserSettingsTab, - State, + type State, } from "../../../../../../../src/components/views/settings/tabs/user/EncryptionUserSettingsTab"; import { createTestClient, withClientContextRenderOptions } from "../../../../../../test-utils"; import Modal from "../../../../../../../src/Modal"; diff --git a/test/unit-tests/components/views/settings/tabs/user/PreferencesUserSettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/user/PreferencesUserSettingsTab-test.tsx index edecef24bb..0918b7809f 100644 --- a/test/unit-tests/components/views/settings/tabs/user/PreferencesUserSettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/user/PreferencesUserSettingsTab-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { fireEvent, render, RenderResult, screen, waitFor } from "jest-matrix-react"; +import { fireEvent, render, type RenderResult, screen, waitFor } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import PreferencesUserSettingsTab from "../../../../../../../src/components/views/settings/tabs/user/PreferencesUserSettingsTab"; @@ -17,7 +17,7 @@ import SettingsStore from "../../../../../../../src/settings/SettingsStore"; import { SettingLevel } from "../../../../../../../src/settings/SettingLevel"; import MatrixClientBackedController from "../../../../../../../src/settings/controllers/MatrixClientBackedController"; import PlatformPeg from "../../../../../../../src/PlatformPeg"; -import { SettingKey } from "../../../../../../../src/settings/Settings.tsx"; +import { type SettingKey } from "../../../../../../../src/settings/Settings.tsx"; describe("PreferencesUserSettingsTab", () => { beforeEach(() => { diff --git a/test/unit-tests/components/views/settings/tabs/user/SessionManagerTab-test.tsx b/test/unit-tests/components/views/settings/tabs/user/SessionManagerTab-test.tsx index 193c77448d..625aafe731 100644 --- a/test/unit-tests/components/views/settings/tabs/user/SessionManagerTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/user/SessionManagerTab-test.tsx @@ -11,29 +11,29 @@ import { act, fireEvent, render, - RenderResult, + type RenderResult, screen, waitFor, waitForElementToBeRemoved, within, } from "jest-matrix-react"; import { logger } from "matrix-js-sdk/src/logger"; -import { CryptoApi, DeviceVerificationStatus, VerificationRequest } from "matrix-js-sdk/src/crypto-api"; +import { type CryptoApi, DeviceVerificationStatus, type VerificationRequest } from "matrix-js-sdk/src/crypto-api"; import { defer, sleep } from "matrix-js-sdk/src/utils"; import { ClientEvent, Device, - IMyDevice, + type IMyDevice, LOCAL_NOTIFICATION_SETTINGS_PREFIX, MatrixEvent, PUSHER_DEVICE_ID, PUSHER_ENABLED, - IAuthData, + type IAuthData, GET_LOGIN_TOKEN_CAPABILITY, MatrixError, - MatrixClient, + type MatrixClient, } from "matrix-js-sdk/src/matrix"; -import { mocked, MockedObject } from "jest-mock"; +import { mocked, type MockedObject } from "jest-mock"; import fetchMock from "fetch-mock-jest"; import { @@ -50,13 +50,13 @@ import Modal from "../../../../../../../src/Modal"; import LogoutDialog from "../../../../../../../src/components/views/dialogs/LogoutDialog"; import { DeviceSecurityVariation, - ExtendedDevice, + type ExtendedDevice, } from "../../../../../../../src/components/views/settings/devices/types"; import { INACTIVE_DEVICE_AGE_MS } from "../../../../../../../src/components/views/settings/devices/filter"; import SettingsStore from "../../../../../../../src/settings/SettingsStore"; import { getClientInformationEventType } from "../../../../../../../src/utils/device/clientInformation"; import { SDKContext, SdkContextClass } from "../../../../../../../src/contexts/SDKContext"; -import { OidcClientStore } from "../../../../../../../src/stores/oidc/OidcClientStore"; +import { type OidcClientStore } from "../../../../../../../src/stores/oidc/OidcClientStore"; import { makeDelegatedAuthConfig } from "../../../../../../test-utils/oidc"; import MatrixClientContext from "../../../../../../../src/contexts/MatrixClientContext"; diff --git a/test/unit-tests/components/views/settings/tabs/user/VoiceUserSettingsTab-test.tsx b/test/unit-tests/components/views/settings/tabs/user/VoiceUserSettingsTab-test.tsx index 1c8ff6f267..d4519d429a 100644 --- a/test/unit-tests/components/views/settings/tabs/user/VoiceUserSettingsTab-test.tsx +++ b/test/unit-tests/components/views/settings/tabs/user/VoiceUserSettingsTab-test.tsx @@ -12,7 +12,10 @@ import { fireEvent, render, screen } from "jest-matrix-react"; import { logger } from "matrix-js-sdk/src/logger"; import VoiceUserSettingsTab from "../../../../../../../src/components/views/settings/tabs/user/VoiceUserSettingsTab"; -import MediaDeviceHandler, { IMediaDevices, MediaDeviceKindEnum } from "../../../../../../../src/MediaDeviceHandler"; +import MediaDeviceHandler, { + type IMediaDevices, + MediaDeviceKindEnum, +} from "../../../../../../../src/MediaDeviceHandler"; import { flushPromises } from "../../../../../../test-utils"; jest.mock("../../../../../../../src/MediaDeviceHandler"); diff --git a/test/unit-tests/components/views/spaces/AddExistingToSpaceDialog-test.tsx b/test/unit-tests/components/views/spaces/AddExistingToSpaceDialog-test.tsx index c06847e700..c450f607d7 100644 --- a/test/unit-tests/components/views/spaces/AddExistingToSpaceDialog-test.tsx +++ b/test/unit-tests/components/views/spaces/AddExistingToSpaceDialog-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { render } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import React from "react"; import AddExistingToSpaceDialog from "../../../../../src/components/views/dialogs/AddExistingToSpaceDialog"; diff --git a/test/unit-tests/components/views/spaces/SpacePanel-test.tsx b/test/unit-tests/components/views/spaces/SpacePanel-test.tsx index 3331de9334..496b160130 100644 --- a/test/unit-tests/components/views/spaces/SpacePanel-test.tsx +++ b/test/unit-tests/components/views/spaces/SpacePanel-test.tsx @@ -9,17 +9,17 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen, fireEvent, act, cleanup } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; -import { MetaSpace, SpaceKey } from "../../../../../src/stores/spaces"; +import { MetaSpace, type SpaceKey } from "../../../../../src/stores/spaces"; import { shouldShowComponent } from "../../../../../src/customisations/helpers/UIComponents"; import { UIComponent } from "../../../../../src/settings/UIFeature"; import { mkStubRoom, wrapInMatrixClientContext, wrapInSdkContext } from "../../../../test-utils"; import { SdkContextClass } from "../../../../../src/contexts/SDKContext"; import SpaceStore from "../../../../../src/stores/spaces/SpaceStore"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; -import { SpaceNotificationState } from "../../../../../src/stores/notifications/SpaceNotificationState"; +import { type SpaceNotificationState } from "../../../../../src/stores/notifications/SpaceNotificationState"; import SettingsStore from "../../../../../src/settings/SettingsStore"; import UnwrappedSpacePanel from "../../../../../src/components/views/spaces/SpacePanel"; diff --git a/test/unit-tests/components/views/spaces/SpaceSettingsVisibilityTab-test.tsx b/test/unit-tests/components/views/spaces/SpaceSettingsVisibilityTab-test.tsx index 3891e1eda5..a8b4dd895c 100644 --- a/test/unit-tests/components/views/spaces/SpaceSettingsVisibilityTab-test.tsx +++ b/test/unit-tests/components/views/spaces/SpaceSettingsVisibilityTab-test.tsx @@ -9,8 +9,15 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { mocked } from "jest-mock"; import { secureRandomString } from "matrix-js-sdk/src/randomstring"; -import { act, fireEvent, render, RenderResult } from "jest-matrix-react"; -import { EventType, MatrixClient, Room, GuestAccess, HistoryVisibility, JoinRule } from "matrix-js-sdk/src/matrix"; +import { act, fireEvent, render, type RenderResult } from "jest-matrix-react"; +import { + EventType, + type MatrixClient, + type Room, + GuestAccess, + HistoryVisibility, + JoinRule, +} from "matrix-js-sdk/src/matrix"; import _SpaceSettingsVisibilityTab from "../../../../../src/components/views/spaces/SpaceSettingsVisibilityTab"; import { diff --git a/test/unit-tests/components/views/spaces/SpaceTreeLevel-test.tsx b/test/unit-tests/components/views/spaces/SpaceTreeLevel-test.tsx index 98dc9723ab..c46b9681a9 100644 --- a/test/unit-tests/components/views/spaces/SpaceTreeLevel-test.tsx +++ b/test/unit-tests/components/views/spaces/SpaceTreeLevel-test.tsx @@ -15,7 +15,7 @@ import DMRoomMap from "../../../../../src/utils/DMRoomMap"; import defaultDispatcher from "../../../../../src/dispatcher/dispatcher"; import { Action } from "../../../../../src/dispatcher/actions"; import { SpaceButton } from "../../../../../src/components/views/spaces/SpaceTreeLevel"; -import { MetaSpace, SpaceKey } from "../../../../../src/stores/spaces"; +import { MetaSpace, type SpaceKey } from "../../../../../src/stores/spaces"; import SpaceStore from "../../../../../src/stores/spaces/SpaceStore"; import { StaticNotificationState } from "../../../../../src/stores/notifications/StaticNotificationState"; import { NotificationLevel } from "../../../../../src/stores/notifications/NotificationLevel"; diff --git a/test/unit-tests/components/views/spaces/ThreadsActivityCentre-test.tsx b/test/unit-tests/components/views/spaces/ThreadsActivityCentre-test.tsx index ecbe550d60..ed03dc6012 100644 --- a/test/unit-tests/components/views/spaces/ThreadsActivityCentre-test.tsx +++ b/test/unit-tests/components/views/spaces/ThreadsActivityCentre-test.tsx @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import React, { ComponentProps } from "react"; +import React, { type ComponentProps } from "react"; import { getByText, render, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; import { NotificationCountType, PendingEventOrdering, Room } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/components/views/spaces/useUnreadThreadRooms-test.tsx b/test/unit-tests/components/views/spaces/useUnreadThreadRooms-test.tsx index f8e32289e9..d2c5a74247 100644 --- a/test/unit-tests/components/views/spaces/useUnreadThreadRooms-test.tsx +++ b/test/unit-tests/components/views/spaces/useUnreadThreadRooms-test.tsx @@ -8,7 +8,7 @@ import React from "react"; import { - MatrixClient, + type MatrixClient, MatrixEventEvent, NotificationCountType, PendingEventOrdering, diff --git a/test/unit-tests/components/views/toasts/GenericToast-test.tsx b/test/unit-tests/components/views/toasts/GenericToast-test.tsx index 5947dcdbc6..e40e914177 100644 --- a/test/unit-tests/components/views/toasts/GenericToast-test.tsx +++ b/test/unit-tests/components/views/toasts/GenericToast-test.tsx @@ -6,8 +6,8 @@ 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 { render, RenderResult } from "jest-matrix-react"; -import React, { ComponentProps } from "react"; +import { render, type RenderResult } from "jest-matrix-react"; +import React, { type ComponentProps } from "react"; import GenericToast from "../../../../../src/components/views/toasts/GenericToast"; diff --git a/test/unit-tests/components/views/toasts/VerificationRequestToast-test.tsx b/test/unit-tests/components/views/toasts/VerificationRequestToast-test.tsx index 1f22da8d75..f813e89286 100644 --- a/test/unit-tests/components/views/toasts/VerificationRequestToast-test.tsx +++ b/test/unit-tests/components/views/toasts/VerificationRequestToast-test.tsx @@ -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 React, { ComponentProps } from "react"; -import { mocked, Mocked } from "jest-mock"; -import { render, RenderResult } from "jest-matrix-react"; -import { TypedEventEmitter, IMyDevice, MatrixClient, Device } from "matrix-js-sdk/src/matrix"; -import { VerificationRequest, VerificationRequestEvent } from "matrix-js-sdk/src/crypto-api"; +import React, { type ComponentProps } from "react"; +import { mocked, type Mocked } from "jest-mock"; +import { render, type RenderResult } from "jest-matrix-react"; +import { TypedEventEmitter, type IMyDevice, type MatrixClient, Device } from "matrix-js-sdk/src/matrix"; +import { type VerificationRequest, VerificationRequestEvent } from "matrix-js-sdk/src/crypto-api"; import VerificationRequestToast from "../../../../../src/components/views/toasts/VerificationRequestToast"; import { diff --git a/test/unit-tests/components/views/voip/CallView-test.tsx b/test/unit-tests/components/views/voip/CallView-test.tsx index cb1cc6ffb1..5299807484 100644 --- a/test/unit-tests/components/views/voip/CallView-test.tsx +++ b/test/unit-tests/components/views/voip/CallView-test.tsx @@ -9,11 +9,16 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { zip } from "lodash"; import { render, screen, act, fireEvent, waitFor, cleanup } from "jest-matrix-react"; -import { mocked, Mocked } from "jest-mock"; -import { MatrixClient, PendingEventOrdering, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { mocked, type Mocked } from "jest-mock"; +import { + type MatrixClient, + PendingEventOrdering, + Room, + RoomStateEvent, + type RoomMember, +} from "matrix-js-sdk/src/matrix"; import { Widget } from "matrix-widget-api"; -import type { RoomMember } from "matrix-js-sdk/src/matrix"; import type { ClientWidgetApi } from "matrix-widget-api"; import { stubClient, diff --git a/test/unit-tests/components/views/voip/VideoFeed-test.tsx b/test/unit-tests/components/views/voip/VideoFeed-test.tsx index d9a396d664..bcb1632a38 100644 --- a/test/unit-tests/components/views/voip/VideoFeed-test.tsx +++ b/test/unit-tests/components/views/voip/VideoFeed-test.tsx @@ -8,14 +8,14 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen } from "jest-matrix-react"; -import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; -import { MatrixCall } from "matrix-js-sdk/src/webrtc/call"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; +import { type MatrixCall } from "matrix-js-sdk/src/webrtc/call"; +import { type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import * as AvatarModule from "../../../../../src/Avatar"; import VideoFeed from "../../../../../src/components/views/voip/VideoFeed"; import { stubClient, useMockedCalls } from "../../../../test-utils"; -import LegacyCallHandler from "../../../../../src/LegacyCallHandler"; +import type LegacyCallHandler from "../../../../../src/LegacyCallHandler"; import DMRoomMap from "../../../../../src/utils/DMRoomMap"; const FAKE_AVATAR_URL = "http://fakeurl.dummy/fake.png"; diff --git a/test/unit-tests/contexts/SdkContext-test.ts b/test/unit-tests/contexts/SdkContext-test.ts index 0ccf638aa2..edb7f92592 100644 --- a/test/unit-tests/contexts/SdkContext-test.ts +++ b/test/unit-tests/contexts/SdkContext-test.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { SdkContextClass } from "../../../src/contexts/SDKContext"; import { OidcClientStore } from "../../../src/stores/oidc/OidcClientStore"; diff --git a/test/unit-tests/createRoom-test.ts b/test/unit-tests/createRoom-test.ts index f3dc57fed4..c75bebc0fb 100644 --- a/test/unit-tests/createRoom-test.ts +++ b/test/unit-tests/createRoom-test.ts @@ -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 { mocked, Mocked } from "jest-mock"; -import { MatrixClient, Device, Preset, RoomType } from "matrix-js-sdk/src/matrix"; -import { CryptoApi } from "matrix-js-sdk/src/crypto-api"; +import { mocked, type Mocked } from "jest-mock"; +import { type MatrixClient, type Device, Preset, RoomType } from "matrix-js-sdk/src/matrix"; +import { type CryptoApi } from "matrix-js-sdk/src/crypto-api"; import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc"; import { stubClient, setupAsyncStoreWithClient, mockPlatformPeg, getMockClientWithEventEmitter } from "../test-utils"; diff --git a/test/unit-tests/editor/deserialize-test.ts b/test/unit-tests/editor/deserialize-test.ts index b5b8dc1b9f..e178ab8fba 100644 --- a/test/unit-tests/editor/deserialize-test.ts +++ b/test/unit-tests/editor/deserialize-test.ts @@ -5,10 +5,10 @@ Copyright 2019 The Matrix.org Foundation C.I.C. SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE files in the repository root for full details. */ -import { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { parseEvent } from "../../../src/editor/deserialize"; -import { Part } from "../../../src/editor/parts"; +import { type Part } from "../../../src/editor/parts"; import { createPartCreator } from "./mock"; const FOUR_SPACES = " ".repeat(4); diff --git a/test/unit-tests/editor/history-test.ts b/test/unit-tests/editor/history-test.ts index 2ae284d0d8..7ff8916247 100644 --- a/test/unit-tests/editor/history-test.ts +++ b/test/unit-tests/editor/history-test.ts @@ -6,8 +6,8 @@ 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 HistoryManager, { IHistory, MAX_STEP_LENGTH } from "../../../src/editor/history"; -import EditorModel from "../../../src/editor/model"; +import HistoryManager, { type IHistory, MAX_STEP_LENGTH } from "../../../src/editor/history"; +import type EditorModel from "../../../src/editor/model"; import DocumentPosition from "../../../src/editor/position"; describe("editor/history", function () { diff --git a/test/unit-tests/editor/mock.ts b/test/unit-tests/editor/mock.ts index e49a4558a4..e7bbe1c8ba 100644 --- a/test/unit-tests/editor/mock.ts +++ b/test/unit-tests/editor/mock.ts @@ -6,11 +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 { Room, MatrixClient, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type Room, type MatrixClient, type RoomMember } from "matrix-js-sdk/src/matrix"; -import AutocompleteWrapperModel, { UpdateCallback } from "../../../src/editor/autocomplete"; -import { Caret } from "../../../src/editor/caret"; -import { PillPart, Part, PartCreator } from "../../../src/editor/parts"; +import { type UpdateCallback } from "../../../src/editor/autocomplete"; +import type AutocompleteWrapperModel from "../../../src/editor/autocomplete"; +import { type Caret } from "../../../src/editor/caret"; +import { type PillPart, type Part, PartCreator } from "../../../src/editor/parts"; import DocumentPosition from "../../../src/editor/position"; export class MockAutoComplete { diff --git a/test/unit-tests/editor/model-test.ts b/test/unit-tests/editor/model-test.ts index 5d548ce7fc..e1bac72884 100644 --- a/test/unit-tests/editor/model-test.ts +++ b/test/unit-tests/editor/model-test.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import EditorModel from "../../../src/editor/model"; -import { createPartCreator, createRenderer, MockAutoComplete } from "./mock"; +import { createPartCreator, createRenderer, type MockAutoComplete } from "./mock"; import DocumentOffset from "../../../src/editor/offset"; -import { PillPart } from "../../../src/editor/parts"; -import DocumentPosition from "../../../src/editor/position"; +import { type PillPart } from "../../../src/editor/parts"; +import type DocumentPosition from "../../../src/editor/position"; describe("editor/model", function () { describe("plain text manipulation", function () { diff --git a/test/unit-tests/editor/operations-test.ts b/test/unit-tests/editor/operations-test.ts index d0dc1e837d..90e98b161c 100644 --- a/test/unit-tests/editor/operations-test.ts +++ b/test/unit-tests/editor/operations-test.ts @@ -17,7 +17,7 @@ import { } from "../../../src/editor/operations"; import { Formatting } from "../../../src/components/views/rooms/MessageComposerFormatBar"; import { longestBacktickSequence } from "../../../src/editor/deserialize"; -import DocumentPosition from "../../../src/editor/position"; +import type DocumentPosition from "../../../src/editor/position"; const SERIALIZED_NEWLINE = { text: "\n", type: "newline" }; diff --git a/test/unit-tests/editor/roundtrip-test.ts b/test/unit-tests/editor/roundtrip-test.ts index dfce37472f..08c80a849c 100644 --- a/test/unit-tests/editor/roundtrip-test.ts +++ b/test/unit-tests/editor/roundtrip-test.ts @@ -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 { MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { parseEvent } from "../../../src/editor/deserialize"; import EditorModel from "../../../src/editor/model"; diff --git a/test/unit-tests/editor/serialize-test.ts b/test/unit-tests/editor/serialize-test.ts index 3162f1464a..915b78bdfa 100644 --- a/test/unit-tests/editor/serialize-test.ts +++ b/test/unit-tests/editor/serialize-test.ts @@ -11,7 +11,7 @@ import { mocked } from "jest-mock"; import EditorModel from "../../../src/editor/model"; import { htmlSerializeFromMdIfNeeded, htmlSerializeIfNeeded } from "../../../src/editor/serialize"; import { createPartCreator } from "./mock"; -import { IConfigOptions } from "../../../src/IConfigOptions"; +import { type IConfigOptions } from "../../../src/IConfigOptions"; import SettingsStore from "../../../src/settings/SettingsStore"; import SdkConfig from "../../../src/SdkConfig"; diff --git a/test/unit-tests/events/EventTileFactory-test.ts b/test/unit-tests/events/EventTileFactory-test.ts index eee94791fc..6a4b5fa355 100644 --- a/test/unit-tests/events/EventTileFactory-test.ts +++ b/test/unit-tests/events/EventTileFactory-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { EventType, MatrixClient, MatrixEvent, MsgType, Room } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixClient, MatrixEvent, MsgType, Room } from "matrix-js-sdk/src/matrix"; import { JSONEventFactory, diff --git a/test/unit-tests/events/RelationsHelper-test.ts b/test/unit-tests/events/RelationsHelper-test.ts index fa693a8953..c8992fc922 100644 --- a/test/unit-tests/events/RelationsHelper-test.ts +++ b/test/unit-tests/events/RelationsHelper-test.ts @@ -7,7 +7,14 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { EventType, MatrixClient, MatrixEvent, MatrixEventEvent, RelationType, Room } from "matrix-js-sdk/src/matrix"; +import { + EventType, + type MatrixClient, + type MatrixEvent, + MatrixEventEvent, + RelationType, + Room, +} from "matrix-js-sdk/src/matrix"; import { RelationsHelper, RelationsHelperEvent } from "../../../src/events/RelationsHelper"; import { mkEvent, stubClient } from "../../test-utils"; diff --git a/test/unit-tests/hooks/room/useRoomThreadNotifications-test.tsx b/test/unit-tests/hooks/room/useRoomThreadNotifications-test.tsx index 26698af058..bf1c5de37a 100644 --- a/test/unit-tests/hooks/room/useRoomThreadNotifications-test.tsx +++ b/test/unit-tests/hooks/room/useRoomThreadNotifications-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { renderHook } from "jest-matrix-react"; -import { MatrixClient, NotificationCountType, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, NotificationCountType, Room } from "matrix-js-sdk/src/matrix"; import { useRoomThreadNotifications } from "../../../../src/hooks/room/useRoomThreadNotifications"; import { stubClient } from "../../../test-utils"; diff --git a/test/unit-tests/hooks/useLatestResult-test.tsx b/test/unit-tests/hooks/useLatestResult-test.tsx index 5a70d2148c..74848b0b9d 100644 --- a/test/unit-tests/hooks/useLatestResult-test.tsx +++ b/test/unit-tests/hooks/useLatestResult-test.tsx @@ -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 { renderHook, RenderHookResult } from "jest-matrix-react"; +import { renderHook, type RenderHookResult } from "jest-matrix-react"; import { useLatestResult } from "../../../src/hooks/useLatestResult"; diff --git a/test/unit-tests/hooks/useNotificationSettings-test.tsx b/test/unit-tests/hooks/useNotificationSettings-test.tsx index b05c868a12..f8d2047e9b 100644 --- a/test/unit-tests/hooks/useNotificationSettings-test.tsx +++ b/test/unit-tests/hooks/useNotificationSettings-test.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import { waitFor, renderHook } from "jest-matrix-react"; -import { IPushRules, MatrixClient, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; +import { type IPushRules, type MatrixClient, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; import { useNotificationSettings } from "../../../src/hooks/useNotificationSettings"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; import { DefaultNotificationSettings, - NotificationSettings, + type NotificationSettings, } from "../../../src/models/notificationsettings/NotificationSettings"; import { StandardActions } from "../../../src/notifications/StandardActions"; import { RoomNotifState } from "../../../src/RoomNotifs"; diff --git a/test/unit-tests/hooks/useProfileInfo-test.tsx b/test/unit-tests/hooks/useProfileInfo-test.tsx index 1b3c4b5980..0294771de3 100644 --- a/test/unit-tests/hooks/useProfileInfo-test.tsx +++ b/test/unit-tests/hooks/useProfileInfo-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { waitFor, renderHook, act } from "jest-matrix-react"; -import { EmptyObject, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type EmptyObject, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { useProfileInfo } from "../../../src/hooks/useProfileInfo"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/hooks/usePublicRoomDirectory-test.tsx b/test/unit-tests/hooks/usePublicRoomDirectory-test.tsx index 980c8b2aa1..cc35a49bf7 100644 --- a/test/unit-tests/hooks/usePublicRoomDirectory-test.tsx +++ b/test/unit-tests/hooks/usePublicRoomDirectory-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { waitFor, renderHook, act } from "jest-matrix-react"; -import { IRoomDirectoryOptions, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type IRoomDirectoryOptions, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { usePublicRoomDirectory } from "../../../src/hooks/usePublicRoomDirectory"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/hooks/useRoomMembers-test.tsx b/test/unit-tests/hooks/useRoomMembers-test.tsx index df572ead08..dc5bf0e318 100644 --- a/test/unit-tests/hooks/useRoomMembers-test.tsx +++ b/test/unit-tests/hooks/useRoomMembers-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { waitFor, renderHook, act } from "jest-matrix-react"; -import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/hooks/useSlidingSyncRoomSearch-test.tsx b/test/unit-tests/hooks/useSlidingSyncRoomSearch-test.tsx index f8c33ac16b..d2ee9ad3bb 100644 --- a/test/unit-tests/hooks/useSlidingSyncRoomSearch-test.tsx +++ b/test/unit-tests/hooks/useSlidingSyncRoomSearch-test.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { waitFor, renderHook, act } from "jest-matrix-react"; import { mocked } from "jest-mock"; -import { SlidingSync } from "matrix-js-sdk/src/sliding-sync"; +import { type SlidingSync } from "matrix-js-sdk/src/sliding-sync"; import { Room } from "matrix-js-sdk/src/matrix"; import { useSlidingSyncRoomSearch } from "../../../src/hooks/useSlidingSyncRoomSearch"; diff --git a/test/unit-tests/hooks/useUserDirectory-test.tsx b/test/unit-tests/hooks/useUserDirectory-test.tsx index a2a8f62e31..c71b0d924d 100644 --- a/test/unit-tests/hooks/useUserDirectory-test.tsx +++ b/test/unit-tests/hooks/useUserDirectory-test.tsx @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { waitFor, renderHook, act } from "jest-matrix-react"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { useUserDirectory } from "../../../src/hooks/useUserDirectory"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/integrations/IntegrationManagers-test.ts b/test/unit-tests/integrations/IntegrationManagers-test.ts index e094926e4e..88da290bb9 100644 --- a/test/unit-tests/integrations/IntegrationManagers-test.ts +++ b/test/unit-tests/integrations/IntegrationManagers-test.ts @@ -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 { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import { IntegrationManagers } from "../../../src/integrations/IntegrationManagers"; diff --git a/test/unit-tests/languageHandler-test.tsx b/test/unit-tests/languageHandler-test.tsx index 1969c857cc..19107aaf27 100644 --- a/test/unit-tests/languageHandler-test.tsx +++ b/test/unit-tests/languageHandler-test.tsx @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import fetchMock from "fetch-mock-jest"; -import { Translation } from "matrix-web-i18n"; -import { TranslationStringsObject } from "@matrix-org/react-sdk-module-api"; +import { type Translation } from "matrix-web-i18n"; +import { type TranslationStringsObject } from "@matrix-org/react-sdk-module-api"; import SdkConfig from "../../src/SdkConfig"; import { @@ -21,11 +21,11 @@ import { setLanguage, setMissingEntryGenerator, substitute, - TranslatedString, + type TranslatedString, UserFriendlyError, - TranslationKey, - IVariables, - Tags, + type TranslationKey, + type IVariables, + type Tags, } from "../../src/languageHandler"; import { stubClient } from "../test-utils"; import { setupLanguageMock } from "../setup/setupLanguage"; diff --git a/test/unit-tests/linkify-matrix-test.ts b/test/unit-tests/linkify-matrix-test.ts index 70a6e18b3b..26c2a809d0 100644 --- a/test/unit-tests/linkify-matrix-test.ts +++ b/test/unit-tests/linkify-matrix-test.ts @@ -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 { EventListeners } from "linkifyjs"; +import { type EventListeners } from "linkifyjs"; import { linkify, Type, options } from "../../src/linkify-matrix"; import dispatcher from "../../src/dispatcher/dispatcher"; diff --git a/test/unit-tests/models/Call-test.ts b/test/unit-tests/models/Call-test.ts index 0da3e60ad8..a41629810c 100644 --- a/test/unit-tests/models/Call-test.ts +++ b/test/unit-tests/models/Call-test.ts @@ -16,22 +16,24 @@ import { MatrixEvent, RoomStateEvent, PendingEventOrdering, - IContent, + type IContent, + type MatrixClient, + type IMyDevice, + type RoomMember, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { Widget } from "matrix-widget-api"; import { - CallMembership, + type CallMembership, MatrixRTCSessionManagerEvents, MatrixRTCSession, MatrixRTCSessionEvent, } from "matrix-js-sdk/src/matrixrtc"; import type { Mocked } from "jest-mock"; -import type { MatrixClient, IMyDevice, RoomMember } from "matrix-js-sdk/src/matrix"; import type { ClientWidgetApi } from "matrix-widget-api"; import { - JitsiCallMemberContent, + type JitsiCallMemberContent, Layout, Call, CallEvent, @@ -48,7 +50,7 @@ import ActiveWidgetStore, { ActiveWidgetStoreEvent } from "../../../src/stores/A import { ElementWidgetActions } from "../../../src/stores/widgets/ElementWidgetActions"; import SettingsStore from "../../../src/settings/SettingsStore"; import { PosthogAnalytics } from "../../../src/PosthogAnalytics"; -import { SettingKey } from "../../../src/settings/Settings.tsx"; +import { type SettingKey } from "../../../src/settings/Settings.tsx"; jest.spyOn(MediaDeviceHandler, "getDevices").mockResolvedValue({ [MediaDeviceKindEnum.AudioInput]: [ diff --git a/test/unit-tests/models/LocalRoom-test.ts b/test/unit-tests/models/LocalRoom-test.ts index b5398c00ae..64e3f51240 100644 --- a/test/unit-tests/models/LocalRoom-test.ts +++ b/test/unit-tests/models/LocalRoom-test.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { LocalRoom, LocalRoomState, LOCAL_ROOM_ID_PREFIX } from "../../../src/models/LocalRoom"; import { createTestClient } from "../../test-utils"; diff --git a/test/unit-tests/models/notificationsettings/NotificationSettings-test.ts b/test/unit-tests/models/notificationsettings/NotificationSettings-test.ts index 68bc6a5a4c..a51540129b 100644 --- a/test/unit-tests/models/notificationsettings/NotificationSettings-test.ts +++ b/test/unit-tests/models/notificationsettings/NotificationSettings-test.ts @@ -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 { IPushRules, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; +import { type IPushRules, PushRuleKind, RuleId } from "matrix-js-sdk/src/matrix"; import { DefaultNotificationSettings, - NotificationSettings, + type NotificationSettings, } from "../../../../src/models/notificationsettings/NotificationSettings"; import { reconcileNotificationSettings } from "../../../../src/models/notificationsettings/reconcileNotificationSettings"; import { toNotificationSettings } from "../../../../src/models/notificationsettings/toNotificationSettings"; diff --git a/test/unit-tests/modules/MockModule.ts b/test/unit-tests/modules/MockModule.ts index f699f68dea..981cafa6e0 100644 --- a/test/unit-tests/modules/MockModule.ts +++ b/test/unit-tests/modules/MockModule.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { RuntimeModule } from "@matrix-org/react-sdk-module-api/lib/RuntimeModule"; -import { ModuleApi } from "@matrix-org/react-sdk-module-api/lib/ModuleApi"; -import { AllExtensions } from "@matrix-org/react-sdk-module-api/lib/types/extensions"; -import { ProvideCryptoSetupExtensions } from "@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions"; -import { ProvideExperimentalExtensions } from "@matrix-org/react-sdk-module-api/lib/lifecycles/ExperimentalExtensions"; +import { type ModuleApi } from "@matrix-org/react-sdk-module-api/lib/ModuleApi"; +import { type AllExtensions } from "@matrix-org/react-sdk-module-api/lib/types/extensions"; +import { type ProvideCryptoSetupExtensions } from "@matrix-org/react-sdk-module-api/lib/lifecycles/CryptoSetupExtensions"; +import { type ProvideExperimentalExtensions } from "@matrix-org/react-sdk-module-api/lib/lifecycles/ExperimentalExtensions"; import { ModuleRunner } from "../../../src/modules/ModuleRunner"; diff --git a/test/unit-tests/modules/ModuleRunner-test.ts b/test/unit-tests/modules/ModuleRunner-test.ts index 69a3baf9f0..bc581105b5 100644 --- a/test/unit-tests/modules/ModuleRunner-test.ts +++ b/test/unit-tests/modules/ModuleRunner-test.ts @@ -6,10 +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 { RoomPreviewOpts, RoomViewLifecycle } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; +import { + type RoomPreviewOpts, + RoomViewLifecycle, +} from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; import { - MockModule, + type MockModule, registerMockModule, registerMockModuleWithCryptoSetupExtension, registerMockModuleWithExperimentalExtension, diff --git a/test/unit-tests/modules/ProxiedModuleApi-test.tsx b/test/unit-tests/modules/ProxiedModuleApi-test.tsx index 34c3c534dd..4a325050ec 100644 --- a/test/unit-tests/modules/ProxiedModuleApi-test.tsx +++ b/test/unit-tests/modules/ProxiedModuleApi-test.tsx @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { TranslationStringsObject } from "@matrix-org/react-sdk-module-api/lib/types/translations"; -import { AccountAuthInfo } from "@matrix-org/react-sdk-module-api/lib/types/AccountAuthInfo"; -import { DialogContent, DialogProps } from "@matrix-org/react-sdk-module-api/lib/components/DialogContent"; +import { type TranslationStringsObject } from "@matrix-org/react-sdk-module-api/lib/types/translations"; +import { type AccountAuthInfo } from "@matrix-org/react-sdk-module-api/lib/types/AccountAuthInfo"; +import { DialogContent, type DialogProps } from "@matrix-org/react-sdk-module-api/lib/components/DialogContent"; import { screen, within } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; -import { Mocked } from "jest-mock"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Mocked } from "jest-mock"; import { ProxiedModuleApi } from "../../../src/modules/ProxiedModuleApi"; import { getMockClientWithEventEmitter, mkRoom, stubClient } from "../../test-utils"; @@ -22,7 +22,7 @@ import { ModuleRunner } from "../../../src/modules/ModuleRunner"; import { registerMockModule } from "./MockModule"; import defaultDispatcher from "../../../src/dispatcher/dispatcher"; import { Action } from "../../../src/dispatcher/actions"; -import WidgetStore, { IApp } from "../../../src/stores/WidgetStore"; +import WidgetStore, { type IApp } from "../../../src/stores/WidgetStore"; import { Container, WidgetLayoutStore } from "../../../src/stores/widgets/WidgetLayoutStore"; describe("ProxiedApiModule", () => { diff --git a/test/unit-tests/notifications/ContentRules-test.ts b/test/unit-tests/notifications/ContentRules-test.ts index 16bd082156..7f900b1d08 100644 --- a/test/unit-tests/notifications/ContentRules-test.ts +++ b/test/unit-tests/notifications/ContentRules-test.ts @@ -7,7 +7,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 { TweakName, PushRuleActionName, TweakHighlight, TweakSound } from "matrix-js-sdk/src/matrix"; +import { TweakName, PushRuleActionName, type TweakHighlight, type TweakSound } from "matrix-js-sdk/src/matrix"; import { ContentRules, PushRuleVectorState } from "../../../src/notifications"; diff --git a/test/unit-tests/notifications/PushRuleVectorState-test.ts b/test/unit-tests/notifications/PushRuleVectorState-test.ts index d495752a68..8179bde13e 100644 --- a/test/unit-tests/notifications/PushRuleVectorState-test.ts +++ b/test/unit-tests/notifications/PushRuleVectorState-test.ts @@ -7,7 +7,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 { PushRuleActionName, TweakHighlight, TweakName, TweakSound } from "matrix-js-sdk/src/matrix"; +import { PushRuleActionName, type TweakHighlight, TweakName, type TweakSound } from "matrix-js-sdk/src/matrix"; import { PushRuleVectorState } from "../../../src/notifications"; diff --git a/test/unit-tests/settings/SettingsStore-test.ts b/test/unit-tests/settings/SettingsStore-test.ts index 74da89bde2..03d45a9828 100644 --- a/test/unit-tests/settings/SettingsStore-test.ts +++ b/test/unit-tests/settings/SettingsStore-test.ts @@ -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 { ClientEvent, MatrixClient, Room, SyncState } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type MatrixClient, type Room, SyncState } from "matrix-js-sdk/src/matrix"; -import BasePlatform from "../../../src/BasePlatform"; +import type BasePlatform from "../../../src/BasePlatform"; import SdkConfig from "../../../src/SdkConfig"; import { SettingLevel } from "../../../src/settings/SettingLevel"; import SettingsStore from "../../../src/settings/SettingsStore"; import { mkStubRoom, mockPlatformPeg, stubClient } from "../../test-utils"; -import { SettingKey } from "../../../src/settings/Settings.tsx"; +import { type SettingKey } from "../../../src/settings/Settings.tsx"; const TEST_DATA = [ { diff --git a/test/unit-tests/settings/controllers/IncompatibleController-test.ts b/test/unit-tests/settings/controllers/IncompatibleController-test.ts index 3025a8142e..43dec5fc44 100644 --- a/test/unit-tests/settings/controllers/IncompatibleController-test.ts +++ b/test/unit-tests/settings/controllers/IncompatibleController-test.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import IncompatibleController from "../../../../src/settings/controllers/IncompatibleController"; import { SettingLevel } from "../../../../src/settings/SettingLevel"; import SettingsStore from "../../../../src/settings/SettingsStore"; -import { FeatureSettingKey } from "../../../../src/settings/Settings.tsx"; +import { type FeatureSettingKey } from "../../../../src/settings/Settings.tsx"; describe("IncompatibleController", () => { const settingsGetValueSpy = jest.spyOn(SettingsStore, "getValue"); diff --git a/test/unit-tests/settings/controllers/ServerSupportUnstableFeatureController-test.ts b/test/unit-tests/settings/controllers/ServerSupportUnstableFeatureController-test.ts index 8dd74c4de5..fe96ca448b 100644 --- a/test/unit-tests/settings/controllers/ServerSupportUnstableFeatureController-test.ts +++ b/test/unit-tests/settings/controllers/ServerSupportUnstableFeatureController-test.ts @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import { defer } from "matrix-js-sdk/src/utils"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import ServerSupportUnstableFeatureController from "../../../../src/settings/controllers/ServerSupportUnstableFeatureController"; import { SettingLevel } from "../../../../src/settings/SettingLevel"; -import { FeatureSettingKey, LabGroup, SETTINGS } from "../../../../src/settings/Settings"; +import { type FeatureSettingKey, LabGroup, SETTINGS } from "../../../../src/settings/Settings"; import { stubClient } from "../../../test-utils"; import { WatchManager } from "../../../../src/settings/WatchManager"; import MatrixClientBackedController from "../../../../src/settings/controllers/MatrixClientBackedController"; -import { TranslationKey } from "../../../../src/languageHandler"; +import { type TranslationKey } from "../../../../src/languageHandler"; describe("ServerSupportUnstableFeatureController", () => { const watchers = new WatchManager(); diff --git a/test/unit-tests/settings/handlers/DeviceSettingsHandler-test.ts b/test/unit-tests/settings/handlers/DeviceSettingsHandler-test.ts index 7b86e08517..d7580adf1c 100644 --- a/test/unit-tests/settings/handlers/DeviceSettingsHandler-test.ts +++ b/test/unit-tests/settings/handlers/DeviceSettingsHandler-test.ts @@ -11,7 +11,7 @@ import { MatrixClient } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; import DeviceSettingsHandler from "../../../../src/settings/handlers/DeviceSettingsHandler"; -import { CallbackFn, WatchManager } from "../../../../src/settings/WatchManager"; +import { type CallbackFn, WatchManager } from "../../../../src/settings/WatchManager"; import { stubClient } from "../../../test-utils/test-utils"; describe("DeviceSettingsHandler", () => { diff --git a/test/unit-tests/settings/handlers/RoomDeviceSettingsHandler-test.ts b/test/unit-tests/settings/handlers/RoomDeviceSettingsHandler-test.ts index 8c3b1a7435..1852acaf17 100644 --- a/test/unit-tests/settings/handlers/RoomDeviceSettingsHandler-test.ts +++ b/test/unit-tests/settings/handlers/RoomDeviceSettingsHandler-test.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import RoomDeviceSettingsHandler from "../../../../src/settings/handlers/RoomDeviceSettingsHandler"; import { SettingLevel } from "../../../../src/settings/SettingLevel"; -import { CallbackFn, WatchManager } from "../../../../src/settings/WatchManager"; +import { type CallbackFn, WatchManager } from "../../../../src/settings/WatchManager"; describe("RoomDeviceSettingsHandler", () => { const roomId = "!room:example.com"; diff --git a/test/unit-tests/settings/watchers/ThemeWatcher-test.tsx b/test/unit-tests/settings/watchers/ThemeWatcher-test.tsx index 3e094e0711..3b98e504dd 100644 --- a/test/unit-tests/settings/watchers/ThemeWatcher-test.tsx +++ b/test/unit-tests/settings/watchers/ThemeWatcher-test.tsx @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import SettingsStore from "../../../../src/settings/SettingsStore"; import ThemeWatcher from "../../../../src/settings/watchers/ThemeWatcher"; -import { SettingLevel } from "../../../../src/settings/SettingLevel"; -import { SettingKey, Settings } from "../../../../src/settings/Settings.tsx"; +import { type SettingLevel } from "../../../../src/settings/SettingLevel"; +import { type SettingKey, type Settings } from "../../../../src/settings/Settings.tsx"; function makeMatchMedia(values: any) { class FakeMediaQueryList { diff --git a/test/unit-tests/stores/AutoRageshakeStore-test.ts b/test/unit-tests/stores/AutoRageshakeStore-test.ts index cbfd40b7f4..e7f15233f4 100644 --- a/test/unit-tests/stores/AutoRageshakeStore-test.ts +++ b/test/unit-tests/stores/AutoRageshakeStore-test.ts @@ -10,8 +10,8 @@ import { mocked } from "jest-mock"; import { ClientEvent, EventType, - MatrixClient, - MatrixEvent, + type MatrixClient, + type MatrixEvent, MatrixEventEvent, SyncState, } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/stores/BreadcrumbsStore-test.ts b/test/unit-tests/stores/BreadcrumbsStore-test.ts index a73a2f6095..66cd88f41e 100644 --- a/test/unit-tests/stores/BreadcrumbsStore-test.ts +++ b/test/unit-tests/stores/BreadcrumbsStore-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { createTestClient, flushPromises, setupAsyncStoreWithClient } from "../../test-utils"; import SettingsStore from "../../../src/settings/SettingsStore"; diff --git a/test/unit-tests/stores/InitialCryptoSetupStore-test.ts b/test/unit-tests/stores/InitialCryptoSetupStore-test.ts index 32f63edd68..46c3f3c1cb 100644 --- a/test/unit-tests/stores/InitialCryptoSetupStore-test.ts +++ b/test/unit-tests/stores/InitialCryptoSetupStore-test.ts @@ -6,7 +6,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { waitFor } from "jest-matrix-react"; import { sleep } from "matrix-js-sdk/src/utils"; diff --git a/test/unit-tests/stores/MemberListStore-test.ts b/test/unit-tests/stores/MemberListStore-test.ts index c61bb90425..883bb13f11 100644 --- a/test/unit-tests/stores/MemberListStore-test.ts +++ b/test/unit-tests/stores/MemberListStore-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { EventType, IContent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { EventType, type IContent, type MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import SdkConfig from "../../../src/SdkConfig"; diff --git a/test/unit-tests/stores/OwnBeaconStore-test.ts b/test/unit-tests/stores/OwnBeaconStore-test.ts index bd35d03765..383488466a 100644 --- a/test/unit-tests/stores/OwnBeaconStore-test.ts +++ b/test/unit-tests/stores/OwnBeaconStore-test.ts @@ -11,7 +11,7 @@ import { Beacon, BeaconEvent, getBeaconInfoIdentifier, - MatrixEvent, + type MatrixEvent, RoomStateEvent, RoomMember, ContentHelpers, @@ -19,7 +19,7 @@ import { } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; -import { Mocked } from "jest-mock"; +import { type Mocked } from "jest-mock"; import { OwnBeaconStore, OwnBeaconStoreEvent } from "../../../src/stores/OwnBeaconStore"; import { diff --git a/test/unit-tests/stores/OwnProfileStore-test.ts b/test/unit-tests/stores/OwnProfileStore-test.ts index 57234091d0..63d84521fe 100644 --- a/test/unit-tests/stores/OwnProfileStore-test.ts +++ b/test/unit-tests/stores/OwnProfileStore-test.ts @@ -6,8 +6,8 @@ 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, MatrixError } from "matrix-js-sdk/src/matrix"; -import { MockedObject, mocked } from "jest-mock"; +import { type MatrixClient, MatrixError } from "matrix-js-sdk/src/matrix"; +import { type MockedObject, mocked } from "jest-mock"; import { stubClient } from "../../test-utils"; import { OwnProfileStore } from "../../../src/stores/OwnProfileStore"; diff --git a/test/unit-tests/stores/ReleaseAnnouncementStore-test.tsx b/test/unit-tests/stores/ReleaseAnnouncementStore-test.tsx index 61cfa93f42..7b02225cd6 100644 --- a/test/unit-tests/stores/ReleaseAnnouncementStore-test.tsx +++ b/test/unit-tests/stores/ReleaseAnnouncementStore-test.tsx @@ -8,9 +8,9 @@ import { mocked } from "jest-mock"; -import SettingsStore, { CallbackFn } from "../../../src/settings/SettingsStore"; -import { Feature, ReleaseAnnouncementStore } from "../../../src/stores/ReleaseAnnouncementStore"; -import { SettingLevel } from "../../../src/settings/SettingLevel"; +import SettingsStore, { type CallbackFn } from "../../../src/settings/SettingsStore"; +import { type Feature, ReleaseAnnouncementStore } from "../../../src/stores/ReleaseAnnouncementStore"; +import { type SettingLevel } from "../../../src/settings/SettingLevel"; jest.mock("../../../src/settings/SettingsStore"); diff --git a/test/unit-tests/stores/RoomNotificationStateStore-test.ts b/test/unit-tests/stores/RoomNotificationStateStore-test.ts index 7787b28b68..4855ca1098 100644 --- a/test/unit-tests/stores/RoomNotificationStateStore-test.ts +++ b/test/unit-tests/stores/RoomNotificationStateStore-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { ClientEvent, MatrixClient, Room, SyncState } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type MatrixClient, Room, SyncState } from "matrix-js-sdk/src/matrix"; import { createTestClient, setupAsyncStoreWithClient } from "../../test-utils"; import { diff --git a/test/unit-tests/stores/RoomViewStore-test.ts b/test/unit-tests/stores/RoomViewStore-test.ts index dc18d68cbd..74aa952036 100644 --- a/test/unit-tests/stores/RoomViewStore-test.ts +++ b/test/unit-tests/stores/RoomViewStore-test.ts @@ -9,7 +9,10 @@ Please see LICENSE files in the repository root for full details. import { mocked } from "jest-mock"; import { MatrixError, Room } from "matrix-js-sdk/src/matrix"; import { sleep } from "matrix-js-sdk/src/utils"; -import { RoomViewLifecycle, ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; +import { + RoomViewLifecycle, + type ViewRoomOpts, +} from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle"; import { RoomViewStore } from "../../../src/stores/RoomViewStore"; import { Action } from "../../../src/dispatcher/actions"; @@ -20,15 +23,15 @@ import { PosthogAnalytics } from "../../../src/PosthogAnalytics"; import { TimelineRenderingType } from "../../../src/contexts/RoomContext"; import { MatrixDispatcher } from "../../../src/dispatcher/dispatcher"; import { UPDATE_EVENT } from "../../../src/stores/AsyncStore"; -import { ActiveRoomChangedPayload } from "../../../src/dispatcher/payloads/ActiveRoomChangedPayload"; +import { type ActiveRoomChangedPayload } from "../../../src/dispatcher/payloads/ActiveRoomChangedPayload"; import { SpaceStoreClass } from "../../../src/stores/spaces/SpaceStore"; import { TestSdkContext } from "../TestSdkContext"; -import { ViewRoomPayload } from "../../../src/dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../src/dispatcher/payloads/ViewRoomPayload"; import Modal from "../../../src/Modal"; import ErrorDialog from "../../../src/components/views/dialogs/ErrorDialog"; -import { CancelAskToJoinPayload } from "../../../src/dispatcher/payloads/CancelAskToJoinPayload"; -import { JoinRoomErrorPayload } from "../../../src/dispatcher/payloads/JoinRoomErrorPayload"; -import { SubmitAskToJoinPayload } from "../../../src/dispatcher/payloads/SubmitAskToJoinPayload"; +import { type CancelAskToJoinPayload } from "../../../src/dispatcher/payloads/CancelAskToJoinPayload"; +import { type JoinRoomErrorPayload } from "../../../src/dispatcher/payloads/JoinRoomErrorPayload"; +import { type SubmitAskToJoinPayload } from "../../../src/dispatcher/payloads/SubmitAskToJoinPayload"; import { ModuleRunner } from "../../../src/modules/ModuleRunner"; jest.mock("../../../src/Modal"); diff --git a/test/unit-tests/stores/SetupEncryptionStore-test.ts b/test/unit-tests/stores/SetupEncryptionStore-test.ts index 0609dbe66f..c30f0e38ec 100644 --- a/test/unit-tests/stores/SetupEncryptionStore-test.ts +++ b/test/unit-tests/stores/SetupEncryptionStore-test.ts @@ -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 { mocked, Mocked } from "jest-mock"; -import { MatrixClient, Device } from "matrix-js-sdk/src/matrix"; -import { SecretStorageKeyDescriptionAesV1, ServerSideSecretStorage } from "matrix-js-sdk/src/secret-storage"; -import { BootstrapCrossSigningOpts, CryptoApi, DeviceVerificationStatus } from "matrix-js-sdk/src/crypto-api"; +import { mocked, type Mocked } from "jest-mock"; +import { type MatrixClient, Device } from "matrix-js-sdk/src/matrix"; +import { type SecretStorageKeyDescriptionAesV1, type ServerSideSecretStorage } from "matrix-js-sdk/src/secret-storage"; +import { type BootstrapCrossSigningOpts, type CryptoApi, DeviceVerificationStatus } from "matrix-js-sdk/src/crypto-api"; import { accessSecretStorage } from "../../../src/SecurityManager"; import { SetupEncryptionStore } from "../../../src/stores/SetupEncryptionStore"; diff --git a/test/unit-tests/stores/SpaceStore-test.ts b/test/unit-tests/stores/SpaceStore-test.ts index 27ec09b856..9855b264b5 100644 --- a/test/unit-tests/stores/SpaceStore-test.ts +++ b/test/unit-tests/stores/SpaceStore-test.ts @@ -6,18 +6,18 @@ 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 { type EventEmitter } from "events"; import { mocked } from "jest-mock"; import { EventType, RoomMember, RoomStateEvent, ClientEvent, - MatrixEvent, - Room, + type MatrixEvent, + type Room, RoomEvent, JoinRule, - RoomState, + type RoomState, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { defer } from "matrix-js-sdk/src/utils"; diff --git a/test/unit-tests/stores/ToastStore-test.ts b/test/unit-tests/stores/ToastStore-test.ts index 8332cc823d..612721a1c5 100644 --- a/test/unit-tests/stores/ToastStore-test.ts +++ b/test/unit-tests/stores/ToastStore-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import GenericToast from "../../../src/components/views/toasts/GenericToast"; -import ToastStore, { IToast } from "../../../src/stores/ToastStore"; +import ToastStore, { type IToast } from "../../../src/stores/ToastStore"; describe("ToastStore", () => { const makeToast = (priority: number, key?: string): IToast => ({ diff --git a/test/unit-tests/stores/TypingStore-test.ts b/test/unit-tests/stores/TypingStore-test.ts index af055a32f9..3cf5e17ad1 100644 --- a/test/unit-tests/stores/TypingStore-test.ts +++ b/test/unit-tests/stores/TypingStore-test.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import TypingStore from "../../../src/stores/TypingStore"; import { LOCAL_ROOM_ID_PREFIX } from "../../../src/models/LocalRoom"; diff --git a/test/unit-tests/stores/UserProfilesStore-test.ts b/test/unit-tests/stores/UserProfilesStore-test.ts index 8dec46e93b..ea0d06f4b1 100644 --- a/test/unit-tests/stores/UserProfilesStore-test.ts +++ b/test/unit-tests/stores/UserProfilesStore-test.ts @@ -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 { mocked, Mocked } from "jest-mock"; +import { mocked, type Mocked } from "jest-mock"; import { - IMatrixProfile, - MatrixClient, + type IMatrixProfile, + type MatrixClient, MatrixError, - MatrixEvent, + type MatrixEvent, Room, RoomMemberEvent, } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/stores/VoiceRecordingStore-test.ts b/test/unit-tests/stores/VoiceRecordingStore-test.ts index 8b0ba3d065..e1d0bf6336 100644 --- a/test/unit-tests/stores/VoiceRecordingStore-test.ts +++ b/test/unit-tests/stores/VoiceRecordingStore-test.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { VoiceRecordingStore } from "../../../src/stores/VoiceRecordingStore"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/stores/WidgetLayoutStore-test.ts b/test/unit-tests/stores/WidgetLayoutStore-test.ts index 5697cac331..1b5748f3a8 100644 --- a/test/unit-tests/stores/WidgetLayoutStore-test.ts +++ b/test/unit-tests/stores/WidgetLayoutStore-test.ts @@ -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 { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; -import WidgetStore, { IApp } from "../../../src/stores/WidgetStore"; +import WidgetStore, { type IApp } from "../../../src/stores/WidgetStore"; import { Container, WidgetLayoutStore } from "../../../src/stores/widgets/WidgetLayoutStore"; import { stubClient } from "../../test-utils"; import defaultDispatcher from "../../../src/dispatcher/dispatcher"; diff --git a/test/unit-tests/stores/right-panel/RightPanelStore-test.ts b/test/unit-tests/stores/right-panel/RightPanelStore-test.ts index 8dc197405b..bed26a1cac 100644 --- a/test/unit-tests/stores/right-panel/RightPanelStore-test.ts +++ b/test/unit-tests/stores/right-panel/RightPanelStore-test.ts @@ -6,15 +6,15 @@ 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, MockedObject } from "jest-mock"; -import { MatrixClient, RoomMember } from "matrix-js-sdk/src/matrix"; +import { mocked, type MockedObject } from "jest-mock"; +import { type MatrixClient, RoomMember } from "matrix-js-sdk/src/matrix"; import { stubClient } from "../../../test-utils"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; import DMRoomMap from "../../../../src/utils/DMRoomMap"; import { Action } from "../../../../src/dispatcher/actions"; import defaultDispatcher from "../../../../src/dispatcher/dispatcher"; -import { ActiveRoomChangedPayload } from "../../../../src/dispatcher/payloads/ActiveRoomChangedPayload"; +import { type ActiveRoomChangedPayload } from "../../../../src/dispatcher/payloads/ActiveRoomChangedPayload"; import RightPanelStore from "../../../../src/stores/right-panel/RightPanelStore"; import { RightPanelPhases } from "../../../../src/stores/right-panel/RightPanelStorePhases"; import SettingsStore from "../../../../src/settings/SettingsStore"; diff --git a/test/unit-tests/stores/right-panel/action-handlers/View3pidInvite-test.ts b/test/unit-tests/stores/right-panel/action-handlers/View3pidInvite-test.ts index 757c1b93b4..3230101cb7 100644 --- a/test/unit-tests/stores/right-panel/action-handlers/View3pidInvite-test.ts +++ b/test/unit-tests/stores/right-panel/action-handlers/View3pidInvite-test.ts @@ -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 { MockedObject } from "jest-mock"; +import { type MockedObject } from "jest-mock"; import { EventType, MatrixEvent } from "matrix-js-sdk/src/matrix"; import { Action } from "../../../../../src/dispatcher/actions"; import { onView3pidInvite } from "../../../../../src/stores/right-panel/action-handlers"; -import RightPanelStore from "../../../../../src/stores/right-panel/RightPanelStore"; +import type RightPanelStore from "../../../../../src/stores/right-panel/RightPanelStore"; import { RightPanelPhases } from "../../../../../src/stores/right-panel/RightPanelStorePhases"; describe("onView3pidInvite()", () => { diff --git a/test/unit-tests/stores/room-list/MessagePreviewStore-test.ts b/test/unit-tests/stores/room-list/MessagePreviewStore-test.ts index 864fa6c2b4..c6d1d9d56c 100644 --- a/test/unit-tests/stores/room-list/MessagePreviewStore-test.ts +++ b/test/unit-tests/stores/room-list/MessagePreviewStore-test.ts @@ -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, mocked } from "jest-mock"; +import { type Mocked, mocked } from "jest-mock"; import { EventStatus, EventTimeline, EventType, - MatrixClient, - MatrixEvent, + type MatrixClient, + type MatrixEvent, PendingEventOrdering, RelationType, Room, diff --git a/test/unit-tests/stores/room-list/RoomListStore-test.ts b/test/unit-tests/stores/room-list/RoomListStore-test.ts index a84ea341bc..d1ab2e7183 100644 --- a/test/unit-tests/stores/room-list/RoomListStore-test.ts +++ b/test/unit-tests/stores/room-list/RoomListStore-test.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import { ConditionKind, EventType, - IPushRule, + type IPushRule, JoinRule, MatrixEvent, PendingEventOrdering, @@ -19,9 +19,9 @@ import { import { KnownMembership } from "matrix-js-sdk/src/types"; import { mocked } from "jest-mock"; -import defaultDispatcher, { MatrixDispatcher } from "../../../../src/dispatcher/dispatcher"; +import defaultDispatcher, { type MatrixDispatcher } from "../../../../src/dispatcher/dispatcher"; import { SettingLevel } from "../../../../src/settings/SettingLevel"; -import SettingsStore, { CallbackFn } from "../../../../src/settings/SettingsStore"; +import SettingsStore, { type CallbackFn } from "../../../../src/settings/SettingsStore"; import { ListAlgorithm, SortAlgorithm } from "../../../../src/stores/room-list/algorithms/models"; import { DefaultTagID, OrderedDefaultTagIDs, RoomUpdateCause } from "../../../../src/stores/room-list/models"; import RoomListStore, { RoomListStoreClass } from "../../../../src/stores/room-list/RoomListStore"; diff --git a/test/unit-tests/stores/room-list/SlidingRoomListStore-test.ts b/test/unit-tests/stores/room-list/SlidingRoomListStore-test.ts index 40d8cbbc65..dbe06ab326 100644 --- a/test/unit-tests/stores/room-list/SlidingRoomListStore-test.ts +++ b/test/unit-tests/stores/room-list/SlidingRoomListStore-test.ts @@ -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 { mocked } from "jest-mock"; -import { SlidingSync, SlidingSyncEvent } from "matrix-js-sdk/src/sliding-sync"; +import { type SlidingSync, SlidingSyncEvent } from "matrix-js-sdk/src/sliding-sync"; import { Room } from "matrix-js-sdk/src/matrix"; import { @@ -14,14 +14,14 @@ import { SlidingRoomListStoreClass, SlidingSyncSortToFilter, } from "../../../../src/stores/room-list/SlidingRoomListStore"; -import { SpaceStoreClass } from "../../../../src/stores/spaces/SpaceStore"; +import { type SpaceStoreClass } from "../../../../src/stores/spaces/SpaceStore"; import { MockEventEmitter, stubClient, untilEmission } from "../../../test-utils"; import { TestSdkContext } from "../../TestSdkContext"; import { SlidingSyncManager } from "../../../../src/SlidingSyncManager"; -import { RoomViewStore } from "../../../../src/stores/RoomViewStore"; +import { type RoomViewStore } from "../../../../src/stores/RoomViewStore"; import { MatrixDispatcher } from "../../../../src/dispatcher/dispatcher"; import { SortAlgorithm } from "../../../../src/stores/room-list/algorithms/models"; -import { DefaultTagID, TagID } from "../../../../src/stores/room-list/models"; +import { DefaultTagID, type TagID } from "../../../../src/stores/room-list/models"; import { MetaSpace, UPDATE_SELECTED_SPACE } from "../../../../src/stores/spaces"; import { LISTS_LOADING_EVENT } from "../../../../src/stores/room-list/RoomListStore"; import { UPDATE_EVENT } from "../../../../src/stores/AsyncStore"; diff --git a/test/unit-tests/stores/room-list/SpaceWatcher-test.ts b/test/unit-tests/stores/room-list/SpaceWatcher-test.ts index 62686c7d3b..fdb2d4cb49 100644 --- a/test/unit-tests/stores/room-list/SpaceWatcher-test.ts +++ b/test/unit-tests/stores/room-list/SpaceWatcher-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import { SpaceWatcher } from "../../../../src/stores/room-list/SpaceWatcher"; import type { RoomListStoreClass } from "../../../../src/stores/room-list/RoomListStore"; diff --git a/test/unit-tests/stores/room-list/algorithms/Algorithm-test.ts b/test/unit-tests/stores/room-list/algorithms/Algorithm-test.ts index 07a668624c..4294f82af2 100644 --- a/test/unit-tests/stores/room-list/algorithms/Algorithm-test.ts +++ b/test/unit-tests/stores/room-list/algorithms/Algorithm-test.ts @@ -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 { mocked, MockedObject } from "jest-mock"; +import { mocked, type MockedObject } from "jest-mock"; import { PendingEventOrdering, Room, RoomStateEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { Widget } from "matrix-widget-api"; diff --git a/test/unit-tests/stores/room-list/algorithms/RecentAlgorithm-test.ts b/test/unit-tests/stores/room-list/algorithms/RecentAlgorithm-test.ts index 42fe0ca3dd..3b7b031e27 100644 --- a/test/unit-tests/stores/room-list/algorithms/RecentAlgorithm-test.ts +++ b/test/unit-tests/stores/room-list/algorithms/RecentAlgorithm-test.ts @@ -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 { Room, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { Room, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { mkMessage, mkRoom, stubClient } from "../../../../test-utils"; diff --git a/test/unit-tests/stores/room-list/filters/SpaceFilterCondition-test.ts b/test/unit-tests/stores/room-list/filters/SpaceFilterCondition-test.ts index f0a27c43a1..915094c844 100644 --- a/test/unit-tests/stores/room-list/filters/SpaceFilterCondition-test.ts +++ b/test/unit-tests/stores/room-list/filters/SpaceFilterCondition-test.ts @@ -7,12 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { Room } from "matrix-js-sdk/src/matrix"; +import { type Room } from "matrix-js-sdk/src/matrix"; import SettingsStore from "../../../../../src/settings/SettingsStore"; import { FILTER_CHANGED } from "../../../../../src/stores/room-list/filters/IFilterCondition"; import { SpaceFilterCondition } from "../../../../../src/stores/room-list/filters/SpaceFilterCondition"; -import { MetaSpace, SpaceKey } from "../../../../../src/stores/spaces"; +import { MetaSpace, type SpaceKey } from "../../../../../src/stores/spaces"; import SpaceStore from "../../../../../src/stores/spaces/SpaceStore"; jest.mock("../../../../../src/settings/SettingsStore"); diff --git a/test/unit-tests/stores/room-list/filters/VisibilityProvider-test.ts b/test/unit-tests/stores/room-list/filters/VisibilityProvider-test.ts index 0ccb70c308..3ba1fb3de6 100644 --- a/test/unit-tests/stores/room-list/filters/VisibilityProvider-test.ts +++ b/test/unit-tests/stores/room-list/filters/VisibilityProvider-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { Room, RoomType } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomType } from "matrix-js-sdk/src/matrix"; import { VisibilityProvider } from "../../../../../src/stores/room-list/filters/VisibilityProvider"; import LegacyCallHandler from "../../../../../src/LegacyCallHandler"; diff --git a/test/unit-tests/stores/room-list/previews/PollStartEventPreview-test.ts b/test/unit-tests/stores/room-list/previews/PollStartEventPreview-test.ts index 2b09294c61..bf6f82a5d8 100644 --- a/test/unit-tests/stores/room-list/previews/PollStartEventPreview-test.ts +++ b/test/unit-tests/stores/room-list/previews/PollStartEventPreview-test.ts @@ -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 { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { PollStartEventPreview } from "../../../../../src/stores/room-list/previews/PollStartEventPreview"; import { MatrixClientPeg } from "../../../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/stores/room-list/utils/roomMute-test.ts b/test/unit-tests/stores/room-list/utils/roomMute-test.ts index 9e6009e52a..5934bcefdc 100644 --- a/test/unit-tests/stores/room-list/utils/roomMute-test.ts +++ b/test/unit-tests/stores/room-list/utils/roomMute-test.ts @@ -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 { ConditionKind, EventType, IPushRule, MatrixEvent, PushRuleActionName } from "matrix-js-sdk/src/matrix"; +import { ConditionKind, EventType, type IPushRule, MatrixEvent, PushRuleActionName } from "matrix-js-sdk/src/matrix"; import { getChangedOverrideRoomMutePushRules } from "../../../../../src/stores/room-list/utils/roomMute"; import { DEFAULT_PUSH_RULES, getDefaultRuleWithKind, makePushRule } from "../../../../test-utils/pushRules"; diff --git a/test/unit-tests/stores/widgets/StopGapWidget-test.ts b/test/unit-tests/stores/widgets/StopGapWidget-test.ts index 2422b176be..d61070b1e4 100644 --- a/test/unit-tests/stores/widgets/StopGapWidget-test.ts +++ b/test/unit-tests/stores/widgets/StopGapWidget-test.ts @@ -6,21 +6,21 @@ 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, MockedFunction, MockedObject } from "jest-mock"; +import { mocked, type MockedFunction, type MockedObject } from "jest-mock"; import { findLast, last } from "lodash"; import { MatrixEvent, - MatrixClient, + type MatrixClient, ClientEvent, - EventTimeline, + type EventTimeline, EventType, MatrixEventEvent, RoomStateEvent, - RoomState, + type RoomState, } from "matrix-js-sdk/src/matrix"; import { ClientWidgetApi, WidgetApiFromWidgetAction } from "matrix-widget-api"; import { waitFor } from "jest-matrix-react"; -import { Optional } from "matrix-events-sdk"; +import { type Optional } from "matrix-events-sdk"; import { stubClient, mkRoom, mkEvent } from "../../../test-utils"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; diff --git a/test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts b/test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts index ccf2638d50..7d9da6e0d2 100644 --- a/test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts +++ b/test/unit-tests/stores/widgets/StopGapWidgetDriver-test.ts @@ -6,33 +6,33 @@ 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, MockedObject } from "jest-mock"; +import { mocked, type MockedObject } from "jest-mock"; import fetchMockJest from "fetch-mock-jest"; import { - MatrixClient, + type MatrixClient, ClientEvent, - ITurnServer as IClientTurnServer, + type ITurnServer as IClientTurnServer, Direction, EventType, MatrixEvent, MsgType, RelationType, - Room, + type Room, } from "matrix-js-sdk/src/matrix"; import { Widget, MatrixWidgetType, WidgetKind, - WidgetDriver, - ITurnServer, + type WidgetDriver, + type ITurnServer, SimpleObservable, OpenIDRequestState, - IOpenIDUpdate, + type IOpenIDUpdate, UpdateDelayedEventAction, } from "matrix-widget-api"; import { - ApprovalOpts, - CapabilitiesOpts, + type ApprovalOpts, + type CapabilitiesOpts, WidgetLifecycle, } from "@matrix-org/react-sdk-module-api/lib/lifecycles/WidgetLifecycle"; diff --git a/test/unit-tests/stores/widgets/WidgetPermissionStore-test.ts b/test/unit-tests/stores/widgets/WidgetPermissionStore-test.ts index 1dc9936d89..84612fe236 100644 --- a/test/unit-tests/stores/widgets/WidgetPermissionStore-test.ts +++ b/test/unit-tests/stores/widgets/WidgetPermissionStore-test.ts @@ -7,13 +7,13 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient } from "matrix-js-sdk/src/matrix"; import { MatrixWidgetType, Widget, WidgetKind } from "matrix-widget-api"; import { OIDCState, WidgetPermissionStore } from "../../../../src/stores/widgets/WidgetPermissionStore"; import SettingsStore from "../../../../src/settings/SettingsStore"; import { TestSdkContext } from "../../TestSdkContext"; -import { SettingLevel } from "../../../../src/settings/SettingLevel"; +import { type SettingLevel } from "../../../../src/settings/SettingLevel"; import { SdkContextClass } from "../../../../src/contexts/SDKContext"; import { stubClient } from "../../../test-utils"; import { StopGapWidgetDriver } from "../../../../src/stores/widgets/StopGapWidgetDriver"; diff --git a/test/unit-tests/submit-rageshake-test.ts b/test/unit-tests/submit-rageshake-test.ts index 44e4e3b517..4eda347a98 100644 --- a/test/unit-tests/submit-rageshake-test.ts +++ b/test/unit-tests/submit-rageshake-test.ts @@ -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 { Mocked, mocked } from "jest-mock"; +import { type Mocked, mocked } from "jest-mock"; import { - HttpApiEvent, - HttpApiEventHandlerMap, - IHttpOpts, - MatrixClient, + type HttpApiEvent, + type HttpApiEventHandlerMap, + type IHttpOpts, + type MatrixClient, TypedEventEmitter, MatrixHttpApi, } from "matrix-js-sdk/src/matrix"; @@ -20,8 +20,8 @@ import fetchMock from "fetch-mock-jest"; import { getMockClientWithEventEmitter, mockClientMethodsCrypto, mockPlatformPeg } from "../test-utils"; import { collectBugReport } from "../../src/rageshake/submit-rageshake"; import SettingsStore from "../../src/settings/SettingsStore"; -import { ConsoleLogger } from "../../src/rageshake/rageshake"; -import { FeatureSettingKey, SettingKey } from "../../src/settings/Settings.tsx"; +import { type ConsoleLogger } from "../../src/rageshake/rageshake"; +import { type FeatureSettingKey, type SettingKey } from "../../src/settings/Settings.tsx"; describe("Rageshakes", () => { const RUST_CRYPTO_VERSION = "Rust SDK 0.7.0 (691ec63), Vodozemac 0.5.0"; diff --git a/test/unit-tests/toasts/IncomingCallToast-test.tsx b/test/unit-tests/toasts/IncomingCallToast-test.tsx index 2d035c94dd..f73a24dc44 100644 --- a/test/unit-tests/toasts/IncomingCallToast-test.tsx +++ b/test/unit-tests/toasts/IncomingCallToast-test.tsx @@ -8,12 +8,18 @@ Please see LICENSE files in the repository root for full details. import React from "react"; import { render, screen, cleanup, fireEvent, waitFor } from "jest-matrix-react"; -import { mocked, Mocked } from "jest-mock"; -import { Room, RoomStateEvent, MatrixEvent, MatrixEventEvent, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { ClientWidgetApi, Widget } from "matrix-widget-api"; -import { ICallNotifyContent } from "matrix-js-sdk/src/matrixrtc"; +import { mocked, type Mocked } from "jest-mock"; +import { + Room, + RoomStateEvent, + type MatrixEvent, + MatrixEventEvent, + type MatrixClient, + type RoomMember, +} from "matrix-js-sdk/src/matrix"; +import { type ClientWidgetApi, Widget } from "matrix-widget-api"; +import { type ICallNotifyContent } from "matrix-js-sdk/src/matrixrtc"; -import type { RoomMember } from "matrix-js-sdk/src/matrix"; import { useMockedCalls, MockedCall, diff --git a/test/unit-tests/toasts/UnverifiedSessionToast-test.tsx b/test/unit-tests/toasts/UnverifiedSessionToast-test.tsx index 14cacb4629..ee67599b63 100644 --- a/test/unit-tests/toasts/UnverifiedSessionToast-test.tsx +++ b/test/unit-tests/toasts/UnverifiedSessionToast-test.tsx @@ -7,11 +7,11 @@ Please see LICENSE files in the repository root for full details. */ import React from "react"; -import { render, RenderResult, screen } from "jest-matrix-react"; +import { render, type RenderResult, screen } from "jest-matrix-react"; import userEvent from "@testing-library/user-event"; -import { mocked, Mocked } from "jest-mock"; -import { IMyDevice, MatrixClient } from "matrix-js-sdk/src/matrix"; -import { CryptoApi, DeviceVerificationStatus } from "matrix-js-sdk/src/crypto-api"; +import { mocked, type Mocked } from "jest-mock"; +import { type IMyDevice, type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type CryptoApi, DeviceVerificationStatus } from "matrix-js-sdk/src/crypto-api"; import dis from "../../../src/dispatcher/dispatcher"; import { showToast } from "../../../src/toasts/UnverifiedSessionToast"; diff --git a/test/unit-tests/utils/AutoDiscoveryUtils-test.tsx b/test/unit-tests/utils/AutoDiscoveryUtils-test.tsx index 575dc885a0..85d6309f07 100644 --- a/test/unit-tests/utils/AutoDiscoveryUtils-test.tsx +++ b/test/unit-tests/utils/AutoDiscoveryUtils-test.tsx @@ -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 { AutoDiscovery, AutoDiscoveryAction, ClientConfig } from "matrix-js-sdk/src/matrix"; +import { AutoDiscovery, AutoDiscoveryAction, type ClientConfig } from "matrix-js-sdk/src/matrix"; import { logger } from "matrix-js-sdk/src/logger"; import fetchMock from "fetch-mock-jest"; diff --git a/test/unit-tests/utils/DMRoomMap-test.ts b/test/unit-tests/utils/DMRoomMap-test.ts index d8c44da954..69360a277d 100644 --- a/test/unit-tests/utils/DMRoomMap-test.ts +++ b/test/unit-tests/utils/DMRoomMap-test.ts @@ -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 { mocked, Mocked } from "jest-mock"; +import { mocked, type Mocked } from "jest-mock"; import { logger } from "matrix-js-sdk/src/logger"; -import { ClientEvent, EventType, IContent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { + ClientEvent, + EventType, + type IContent, + type MatrixClient, + type MatrixEvent, + type Room, +} from "matrix-js-sdk/src/matrix"; import DMRoomMap from "../../../src/utils/DMRoomMap"; import { mkEvent, stubClient } from "../../test-utils"; diff --git a/test/unit-tests/utils/ErrorUtils-test.ts b/test/unit-tests/utils/ErrorUtils-test.ts index f3ede81eb7..170a639af3 100644 --- a/test/unit-tests/utils/ErrorUtils-test.ts +++ b/test/unit-tests/utils/ErrorUtils-test.ts @@ -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 { ReactElement } from "react"; +import { type ReactElement } from "react"; import { render } from "jest-matrix-react"; import { MatrixError, ConnectionError } from "matrix-js-sdk/src/matrix"; diff --git a/test/unit-tests/utils/EventUtils-test.ts b/test/unit-tests/utils/EventUtils-test.ts index 94f1c6d262..82c7eb7191 100644 --- a/test/unit-tests/utils/EventUtils-test.ts +++ b/test/unit-tests/utils/EventUtils-test.ts @@ -10,8 +10,8 @@ import { M_LOCATION, EventStatus, EventType, - IEvent, - MatrixClient, + type IEvent, + type MatrixClient, MatrixEvent, MsgType, PendingEventOrdering, diff --git a/test/unit-tests/utils/FileUtils-test.ts b/test/unit-tests/utils/FileUtils-test.ts index c15c58fd87..68e0c3ae06 100644 --- a/test/unit-tests/utils/FileUtils-test.ts +++ b/test/unit-tests/utils/FileUtils-test.ts @@ -5,7 +5,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 { MediaEventContent } from "matrix-js-sdk/src/types"; +import { type MediaEventContent } from "matrix-js-sdk/src/types"; import { downloadLabelForFile } from "../../../src/utils/FileUtils.ts"; diff --git a/test/unit-tests/utils/MultiInviter-test.ts b/test/unit-tests/utils/MultiInviter-test.ts index 15d1fc2dbb..998334c9af 100644 --- a/test/unit-tests/utils/MultiInviter-test.ts +++ b/test/unit-tests/utils/MultiInviter-test.ts @@ -7,15 +7,15 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { EventType, MatrixClient, MatrixError, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixClient, MatrixError, MatrixEvent, Room, RoomMember } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; -import Modal, { ComponentType, ComponentProps } from "../../../src/Modal"; +import Modal, { type ComponentType, type ComponentProps } from "../../../src/Modal"; import SettingsStore from "../../../src/settings/SettingsStore"; -import MultiInviter, { CompletionStates } from "../../../src/utils/MultiInviter"; +import MultiInviter, { type CompletionStates } from "../../../src/utils/MultiInviter"; import * as TestUtilsMatrix from "../../test-utils"; -import AskInviteAnywayDialog from "../../../src/components/views/dialogs/AskInviteAnywayDialog"; +import type AskInviteAnywayDialog from "../../../src/components/views/dialogs/AskInviteAnywayDialog"; import ConfirmUserActionDialog from "../../../src/components/views/dialogs/ConfirmUserActionDialog"; const ROOMID = "!room:server"; diff --git a/test/unit-tests/utils/PinningUtils-test.ts b/test/unit-tests/utils/PinningUtils-test.ts index 59436ce48d..38ca05244d 100644 --- a/test/unit-tests/utils/PinningUtils-test.ts +++ b/test/unit-tests/utils/PinningUtils-test.ts @@ -6,7 +6,7 @@ * Please see LICENSE files in the repository root for full details. */ -import { EventTimeline, EventType, IEvent, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { EventTimeline, EventType, type IEvent, type MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; import { createTestClient } from "../../test-utils"; diff --git a/test/unit-tests/utils/ShieldUtils-test.ts b/test/unit-tests/utils/ShieldUtils-test.ts index 02c69444dc..43f978cd4a 100644 --- a/test/unit-tests/utils/ShieldUtils-test.ts +++ b/test/unit-tests/utils/ShieldUtils-test.ts @@ -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 { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import { UserVerificationStatus } from "matrix-js-sdk/src/crypto-api"; import { shieldStatusForRoom } from "../../../src/utils/ShieldUtils"; diff --git a/test/unit-tests/utils/beacon/bounds-test.ts b/test/unit-tests/utils/beacon/bounds-test.ts index b517a4910d..0a9876d237 100644 --- a/test/unit-tests/utils/beacon/bounds-test.ts +++ b/test/unit-tests/utils/beacon/bounds-test.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import { Beacon } from "matrix-js-sdk/src/matrix"; -import { Bounds, getBeaconBounds } from "../../../../src/utils/beacon/bounds"; +import { type Bounds, getBeaconBounds } from "../../../../src/utils/beacon/bounds"; import { makeBeaconEvent, makeBeaconInfoEvent } from "../../../test-utils"; describe("getBeaconBounds()", () => { diff --git a/test/unit-tests/utils/beacon/geolocation-test.ts b/test/unit-tests/utils/beacon/geolocation-test.ts index f509434772..f8203519ee 100644 --- a/test/unit-tests/utils/beacon/geolocation-test.ts +++ b/test/unit-tests/utils/beacon/geolocation-test.ts @@ -7,10 +7,10 @@ Please see LICENSE files in the repository root for full details. */ import { logger } from "matrix-js-sdk/src/logger"; -import { Mocked } from "jest-mock"; +import { type Mocked } from "jest-mock"; import { - GenericPosition, + type GenericPosition, GeolocationError, getGeoUri, mapGeolocationError, diff --git a/test/unit-tests/utils/connection-test.ts b/test/unit-tests/utils/connection-test.ts index f39c5164e4..1df67070b3 100644 --- a/test/unit-tests/utils/connection-test.ts +++ b/test/unit-tests/utils/connection-test.ts @@ -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 { ClientEvent, ClientEventHandlerMap, SyncState } from "matrix-js-sdk/src/matrix"; +import { type ClientEvent, type ClientEventHandlerMap, SyncState } from "matrix-js-sdk/src/matrix"; import { createReconnectedListener } from "../../../src/utils/connection"; diff --git a/test/unit-tests/utils/createVoiceMessageContent-test.ts b/test/unit-tests/utils/createVoiceMessageContent-test.ts index 6790104fc6..83f14cbb97 100644 --- a/test/unit-tests/utils/createVoiceMessageContent-test.ts +++ b/test/unit-tests/utils/createVoiceMessageContent-test.ts @@ -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 { EncryptedFile } from "matrix-js-sdk/src/types"; +import { type EncryptedFile } from "matrix-js-sdk/src/types"; import { createVoiceMessageContent } from "../../../src/utils/createVoiceMessageContent"; diff --git a/test/unit-tests/utils/crypto/deviceInfo-test.ts b/test/unit-tests/utils/crypto/deviceInfo-test.ts index a5348781fd..616b47ae69 100644 --- a/test/unit-tests/utils/crypto/deviceInfo-test.ts +++ b/test/unit-tests/utils/crypto/deviceInfo-test.ts @@ -6,8 +6,8 @@ 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, mocked } from "jest-mock"; -import { Device, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Mocked, mocked } from "jest-mock"; +import { type Device, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { getDeviceCryptoInfo, getUserDeviceIds } from "../../../../src/utils/crypto/deviceInfo"; import { getMockClientWithEventEmitter, mockClientMethodsCrypto } from "../../../test-utils"; diff --git a/test/unit-tests/utils/device/clientInformation-test.ts b/test/unit-tests/utils/device/clientInformation-test.ts index c85dbba4e6..8d73cde9f5 100644 --- a/test/unit-tests/utils/device/clientInformation-test.ts +++ b/test/unit-tests/utils/device/clientInformation-test.ts @@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details. import { MatrixEvent } from "matrix-js-sdk/src/matrix"; -import BasePlatform from "../../../../src/BasePlatform"; -import { IConfigOptions } from "../../../../src/IConfigOptions"; +import type BasePlatform from "../../../../src/BasePlatform"; +import { type IConfigOptions } from "../../../../src/IConfigOptions"; import { getDeviceClientInformation, recordClientInformation } from "../../../../src/utils/device/clientInformation"; import { getMockClientWithEventEmitter } from "../../../test-utils"; import { DEFAULTS } from "../../../../src/SdkConfig"; -import { DeepReadonly } from "../../../../src/@types/common"; +import { type DeepReadonly } from "../../../../src/@types/common"; describe("recordClientInformation()", () => { const deviceId = "my-device-id"; diff --git a/test/unit-tests/utils/device/parseUserAgent-test.ts b/test/unit-tests/utils/device/parseUserAgent-test.ts index 26cdb22a37..7ed2af4682 100644 --- a/test/unit-tests/utils/device/parseUserAgent-test.ts +++ b/test/unit-tests/utils/device/parseUserAgent-test.ts @@ -6,7 +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 { DeviceType, ExtendedDeviceInformation, parseUserAgent } from "../../../../src/utils/device/parseUserAgent"; +import { + DeviceType, + type ExtendedDeviceInformation, + parseUserAgent, +} from "../../../../src/utils/device/parseUserAgent"; const makeDeviceExtendedInfo = ( deviceType: DeviceType, diff --git a/test/unit-tests/utils/direct-messages-test.ts b/test/unit-tests/utils/direct-messages-test.ts index cebb80db95..45bf7d1f7b 100644 --- a/test/unit-tests/utils/direct-messages-test.ts +++ b/test/unit-tests/utils/direct-messages-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { ClientEvent, MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { ClientEvent, type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { logger } from "matrix-js-sdk/src/logger"; @@ -22,7 +22,7 @@ import { waitForRoomReadyAndApplyAfterCreateCallbacks } from "../../../src/utils import { findDMRoom } from "../../../src/utils/dm/findDMRoom"; import { createDmLocalRoom } from "../../../src/utils/dm/createDmLocalRoom"; import { startDm } from "../../../src/utils/dm/startDm"; -import { Member } from "../../../src/utils/direct-messages"; +import { type Member } from "../../../src/utils/direct-messages"; import { resolveThreePids } from "../../../src/utils/threepids"; jest.mock("../../../src/utils/rooms", () => ({ diff --git a/test/unit-tests/utils/dm/createDmLocalRoom-test.ts b/test/unit-tests/utils/dm/createDmLocalRoom-test.ts index f42804489d..bb23b2f2d5 100644 --- a/test/unit-tests/utils/dm/createDmLocalRoom-test.ts +++ b/test/unit-tests/utils/dm/createDmLocalRoom-test.ts @@ -7,12 +7,12 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { EventType, KNOWN_SAFE_ROOM_VERSION, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { EventType, KNOWN_SAFE_ROOM_VERSION, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { canEncryptToAllUsers } from "../../../../src/createRoom"; -import { LocalRoom, LOCAL_ROOM_ID_PREFIX } from "../../../../src/models/LocalRoom"; -import { DirectoryMember, Member, ThreepidMember } from "../../../../src/utils/direct-messages"; +import { type LocalRoom, LOCAL_ROOM_ID_PREFIX } from "../../../../src/models/LocalRoom"; +import { DirectoryMember, type Member, ThreepidMember } from "../../../../src/utils/direct-messages"; import { createDmLocalRoom } from "../../../../src/utils/dm/createDmLocalRoom"; import { privateShouldBeEncrypted } from "../../../../src/utils/rooms"; import { createTestClient } from "../../../test-utils"; diff --git a/test/unit-tests/utils/dm/findDMForUser-test.ts b/test/unit-tests/utils/dm/findDMForUser-test.ts index 1e12eebcd1..c5bd6eef38 100644 --- a/test/unit-tests/utils/dm/findDMForUser-test.ts +++ b/test/unit-tests/utils/dm/findDMForUser-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import DMRoomMap from "../../../../src/utils/DMRoomMap"; diff --git a/test/unit-tests/utils/dm/findDMRoom-test.ts b/test/unit-tests/utils/dm/findDMRoom-test.ts index 17efd31d9c..170ed774bf 100644 --- a/test/unit-tests/utils/dm/findDMRoom-test.ts +++ b/test/unit-tests/utils/dm/findDMRoom-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; import { DirectoryMember, ThreepidMember } from "../../../../src/utils/direct-messages"; diff --git a/test/unit-tests/utils/export-test.tsx b/test/unit-tests/utils/export-test.tsx index 3ff63da4b3..b113b19104 100644 --- a/test/unit-tests/utils/export-test.tsx +++ b/test/unit-tests/utils/export-test.tsx @@ -8,18 +8,18 @@ Please see LICENSE files in the repository root for full details. import { render } from "jest-matrix-react"; import { - IContent, - MatrixClient, + type IContent, + type MatrixClient, MatrixEvent, Room, - RoomMember, + type RoomMember, RelationType, EventType, } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; -import { IExportOptions, ExportType, ExportFormat } from "../../../src/utils/exportUtils/exportUtils"; +import { type IExportOptions, ExportType, ExportFormat } from "../../../src/utils/exportUtils/exportUtils"; import PlainTextExporter from "../../../src/utils/exportUtils/PlainTextExport"; import HTMLExporter from "../../../src/utils/exportUtils/HtmlExport"; import * as TestUtilsMatrix from "../../test-utils"; diff --git a/test/unit-tests/utils/exportUtils/HTMLExport-test.ts b/test/unit-tests/utils/exportUtils/HTMLExport-test.ts index e2ee0b670e..6415efaf1d 100644 --- a/test/unit-tests/utils/exportUtils/HTMLExport-test.ts +++ b/test/unit-tests/utils/exportUtils/HTMLExport-test.ts @@ -8,10 +8,10 @@ Please see LICENSE files in the repository root for full details. import { EventTimeline, - EventTimelineSet, + type EventTimelineSet, EventType, - IRoomEvent, - MatrixClient, + type IRoomEvent, + type MatrixClient, MatrixEvent, MsgType, Relations, @@ -22,10 +22,10 @@ import { } from "matrix-js-sdk/src/matrix"; import fetchMock from "fetch-mock-jest"; import escapeHtml from "escape-html"; -import { RelationsContainer } from "matrix-js-sdk/src/models/relations-container"; +import { type RelationsContainer } from "matrix-js-sdk/src/models/relations-container"; import { filterConsole, mkReaction, mkStubRoom, REPEATABLE_DATE, stubClient } from "../../../test-utils"; -import { ExportType, IExportOptions } from "../../../../src/utils/exportUtils/exportUtils"; +import { ExportType, type IExportOptions } from "../../../../src/utils/exportUtils/exportUtils"; import SdkConfig from "../../../../src/SdkConfig"; import HTMLExporter from "../../../../src/utils/exportUtils/HtmlExport"; import DMRoomMap from "../../../../src/utils/DMRoomMap"; diff --git a/test/unit-tests/utils/exportUtils/JSONExport-test.ts b/test/unit-tests/utils/exportUtils/JSONExport-test.ts index 0dcf49059d..9cc071b4e2 100644 --- a/test/unit-tests/utils/exportUtils/JSONExport-test.ts +++ b/test/unit-tests/utils/exportUtils/JSONExport-test.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import JSONExporter from "../../../../src/utils/exportUtils/JSONExport"; import { createTestClient, mkStubRoom, REPEATABLE_DATE } from "../../../test-utils"; -import { ExportType, IExportOptions } from "../../../../src/utils/exportUtils/exportUtils"; +import { ExportType, type IExportOptions } from "../../../../src/utils/exportUtils/exportUtils"; describe("JSONExport", () => { beforeEach(() => { diff --git a/test/unit-tests/utils/exportUtils/PlainTextExport-test.ts b/test/unit-tests/utils/exportUtils/PlainTextExport-test.ts index 4b28c5bfb4..006e86b3bf 100644 --- a/test/unit-tests/utils/exportUtils/PlainTextExport-test.ts +++ b/test/unit-tests/utils/exportUtils/PlainTextExport-test.ts @@ -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 { MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { MatrixEvent, type Room } from "matrix-js-sdk/src/matrix"; import { createTestClient, mkStubRoom, REPEATABLE_DATE } from "../../../test-utils"; -import { ExportType, IExportOptions } from "../../../../src/utils/exportUtils/exportUtils"; +import { ExportType, type IExportOptions } from "../../../../src/utils/exportUtils/exportUtils"; import PlainTextExporter from "../../../../src/utils/exportUtils/PlainTextExport"; import SettingsStore from "../../../../src/settings/SettingsStore"; diff --git a/test/unit-tests/utils/leave-behaviour-test.ts b/test/unit-tests/utils/leave-behaviour-test.ts index f42fc07233..23be7fef98 100644 --- a/test/unit-tests/utils/leave-behaviour-test.ts +++ b/test/unit-tests/utils/leave-behaviour-test.ts @@ -6,21 +6,21 @@ 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, Mocked } from "jest-mock"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { mocked, type Mocked } from "jest-mock"; +import { type MatrixClient, type Room } from "matrix-js-sdk/src/matrix"; import { sleep } from "matrix-js-sdk/src/utils"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; import { mkRoom, resetAsyncStoreWithClient, setupAsyncStoreWithClient, stubClient } from "../../test-utils"; import defaultDispatcher from "../../../src/dispatcher/dispatcher"; -import { ViewRoomPayload } from "../../../src/dispatcher/payloads/ViewRoomPayload"; +import { type ViewRoomPayload } from "../../../src/dispatcher/payloads/ViewRoomPayload"; import { Action } from "../../../src/dispatcher/actions"; import { leaveRoomBehaviour } from "../../../src/utils/leave-behaviour"; import { SdkContextClass } from "../../../src/contexts/SDKContext"; import DMRoomMap from "../../../src/utils/DMRoomMap"; import SpaceStore from "../../../src/stores/spaces/SpaceStore"; import { MetaSpace } from "../../../src/stores/spaces"; -import { ActionPayload } from "../../../src/dispatcher/payloads"; +import { type ActionPayload } from "../../../src/dispatcher/payloads"; import SettingsStore from "../../../src/settings/SettingsStore"; describe("leaveRoomBehaviour", () => { diff --git a/test/unit-tests/utils/local-room-test.ts b/test/unit-tests/utils/local-room-test.ts index 91219dcb58..01ad1977b9 100644 --- a/test/unit-tests/utils/local-room-test.ts +++ b/test/unit-tests/utils/local-room-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { LocalRoom, LocalRoomState, LOCAL_ROOM_ID_PREFIX } from "../../../src/models/LocalRoom"; diff --git a/test/unit-tests/utils/localRoom/isRoomReady-test.ts b/test/unit-tests/utils/localRoom/isRoomReady-test.ts index 2effc7c6a9..d257f1e2a2 100644 --- a/test/unit-tests/utils/localRoom/isRoomReady-test.ts +++ b/test/unit-tests/utils/localRoom/isRoomReady-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { EventType, MatrixClient, Room } from "matrix-js-sdk/src/matrix"; +import { EventType, type MatrixClient, Room } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { LocalRoom, LOCAL_ROOM_ID_PREFIX } from "../../../../src/models/LocalRoom"; diff --git a/test/unit-tests/utils/location/isSelfLocation-test.ts b/test/unit-tests/utils/location/isSelfLocation-test.ts index 6cccc63f72..927fa2ed62 100644 --- a/test/unit-tests/utils/location/isSelfLocation-test.ts +++ b/test/unit-tests/utils/location/isSelfLocation-test.ts @@ -8,8 +8,8 @@ Please see LICENSE files in the repository root for full details. import { M_TEXT, - ILocationContent, - LocationAssetType, + type ILocationContent, + type LocationAssetType, M_ASSET, M_LOCATION, M_TIMESTAMP, diff --git a/test/unit-tests/utils/membership-test.ts b/test/unit-tests/utils/membership-test.ts index c63dbe9074..e0ade64186 100644 --- a/test/unit-tests/utils/membership-test.ts +++ b/test/unit-tests/utils/membership-test.ts @@ -6,7 +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 { MatrixClient, MatrixEvent, Room, RoomMember, RoomState, RoomStateEvent } from "matrix-js-sdk/src/matrix"; +import { + type MatrixClient, + type MatrixEvent, + Room, + type RoomMember, + type RoomState, + RoomStateEvent, +} from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import { mocked } from "jest-mock"; diff --git a/test/unit-tests/utils/notifications-test.ts b/test/unit-tests/utils/notifications-test.ts index eeec145a36..2a761f7670 100644 --- a/test/unit-tests/utils/notifications-test.ts +++ b/test/unit-tests/utils/notifications-test.ts @@ -10,11 +10,11 @@ import { MatrixEvent, NotificationCountType, Room, - MatrixClient, + type MatrixClient, ReceiptType, - AccountDataEvents, + type AccountDataEvents, } from "matrix-js-sdk/src/matrix"; -import { Mocked, mocked } from "jest-mock"; +import { type Mocked, mocked } from "jest-mock"; import { localNotificationsAreSilenced, diff --git a/test/unit-tests/utils/oidc/authorize-test.ts b/test/unit-tests/utils/oidc/authorize-test.ts index af2fd432bc..cade0c42ca 100644 --- a/test/unit-tests/utils/oidc/authorize-test.ts +++ b/test/unit-tests/utils/oidc/authorize-test.ts @@ -9,7 +9,7 @@ Please see LICENSE files in the repository root for full details. import fetchMock from "fetch-mock-jest"; import { completeAuthorizationCodeGrant } from "matrix-js-sdk/src/oidc/authorize"; import * as randomStringUtils from "matrix-js-sdk/src/randomstring"; -import { BearerTokenResponse } from "matrix-js-sdk/src/oidc/validate"; +import { type BearerTokenResponse } from "matrix-js-sdk/src/oidc/validate"; import { mocked } from "jest-mock"; import { Crypto } from "@peculiar/webcrypto"; import { getRandomValues } from "node:crypto"; diff --git a/test/unit-tests/utils/oidc/persistOidcSettings-test.ts b/test/unit-tests/utils/oidc/persistOidcSettings-test.ts index 4ffbfd43b2..5b81d142b0 100644 --- a/test/unit-tests/utils/oidc/persistOidcSettings-test.ts +++ b/test/unit-tests/utils/oidc/persistOidcSettings-test.ts @@ -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 { IdTokenClaims } from "oidc-client-ts"; +import { type IdTokenClaims } from "oidc-client-ts"; import { decodeIdToken } from "matrix-js-sdk/src/matrix"; import { mocked } from "jest-mock"; diff --git a/test/unit-tests/utils/oidc/registerClient-test.ts b/test/unit-tests/utils/oidc/registerClient-test.ts index 197beeb2bf..b266f4f4cd 100644 --- a/test/unit-tests/utils/oidc/registerClient-test.ts +++ b/test/unit-tests/utils/oidc/registerClient-test.ts @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. import fetchMockJest from "fetch-mock-jest"; import { OidcError } from "matrix-js-sdk/src/oidc/error"; -import { OidcClientConfig } from "matrix-js-sdk/src/matrix"; +import { type OidcClientConfig } from "matrix-js-sdk/src/matrix"; import { getOidcClientId } from "../../../../src/utils/oidc/registerClient"; import { mockPlatformPeg } from "../../../test-utils"; diff --git a/test/unit-tests/utils/permalinks/Permalinks-test.ts b/test/unit-tests/utils/permalinks/Permalinks-test.ts index c961ff2646..5effb8ed43 100644 --- a/test/unit-tests/utils/permalinks/Permalinks-test.ts +++ b/test/unit-tests/utils/permalinks/Permalinks-test.ts @@ -7,7 +7,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 { EventEmitter } from "events"; +import { type EventEmitter } from "events"; import { Room, RoomMember, EventType, MatrixEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; @@ -19,7 +19,7 @@ import { parsePermalink, RoomPermalinkCreator, } from "../../../../src/utils/permalinks/Permalinks"; -import { IConfigOptions } from "../../../../src/IConfigOptions"; +import { type IConfigOptions } from "../../../../src/IConfigOptions"; import SdkConfig from "../../../../src/SdkConfig"; import { getMockClientWithEventEmitter } from "../../../test-utils"; diff --git a/test/unit-tests/utils/room/getJoinedNonFunctionalMembers-test.ts b/test/unit-tests/utils/room/getJoinedNonFunctionalMembers-test.ts index bd31269d33..1c397e143e 100644 --- a/test/unit-tests/utils/room/getJoinedNonFunctionalMembers-test.ts +++ b/test/unit-tests/utils/room/getJoinedNonFunctionalMembers-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient, Room, RoomMember } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, Room, RoomMember } from "matrix-js-sdk/src/matrix"; import { getFunctionalMembers } from "../../../../src/utils/room/getFunctionalMembers"; import { getJoinedNonFunctionalMembers } from "../../../../src/utils/room/getJoinedNonFunctionalMembers"; diff --git a/test/unit-tests/utils/room/shouldEncryptRoomWithSingle3rdPartyInvite-test.ts b/test/unit-tests/utils/room/shouldEncryptRoomWithSingle3rdPartyInvite-test.ts index 290dc8cf6c..8e3de54896 100644 --- a/test/unit-tests/utils/room/shouldEncryptRoomWithSingle3rdPartyInvite-test.ts +++ b/test/unit-tests/utils/room/shouldEncryptRoomWithSingle3rdPartyInvite-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { mocked } from "jest-mock"; -import { MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; +import { type MatrixClient, type MatrixEvent, Room } from "matrix-js-sdk/src/matrix"; import DMRoomMap from "../../../../src/utils/DMRoomMap"; import { shouldEncryptRoomWithSingle3rdPartyInvite } from "../../../../src/utils/room/shouldEncryptRoomWithSingle3rdPartyInvite"; diff --git a/test/unit-tests/utils/room/tagRoom-test.ts b/test/unit-tests/utils/room/tagRoom-test.ts index 41dc9ef115..fa1850415e 100644 --- a/test/unit-tests/utils/room/tagRoom-test.ts +++ b/test/unit-tests/utils/room/tagRoom-test.ts @@ -10,7 +10,7 @@ import { Room } from "matrix-js-sdk/src/matrix"; import RoomListActions from "../../../../src/actions/RoomListActions"; import defaultDispatcher from "../../../../src/dispatcher/dispatcher"; -import { DefaultTagID, TagID } from "../../../../src/stores/room-list/models"; +import { DefaultTagID, type TagID } from "../../../../src/stores/room-list/models"; import RoomListStore from "../../../../src/stores/room-list/RoomListStore"; import { tagRoom } from "../../../../src/utils/room/tagRoom"; import { getMockClientWithEventEmitter } from "../../../test-utils"; diff --git a/test/unit-tests/utils/threepids-test.ts b/test/unit-tests/utils/threepids-test.ts index 01b580abb0..4cf2a427d1 100644 --- a/test/unit-tests/utils/threepids-test.ts +++ b/test/unit-tests/utils/threepids-test.ts @@ -6,8 +6,8 @@ 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 { IIdentityServerProvider, MatrixClient } from "matrix-js-sdk/src/matrix"; +import { type Mocked } from "jest-mock"; +import { type IIdentityServerProvider, type MatrixClient } from "matrix-js-sdk/src/matrix"; import { DirectoryMember, ThreepidMember } from "../../../src/utils/direct-messages"; import { lookupThreePids, resolveThreePids } from "../../../src/utils/threepids"; diff --git a/test/unit-tests/utils/tooltipify-test.tsx b/test/unit-tests/utils/tooltipify-test.tsx index 459cf2d2bf..1bfdcad968 100644 --- a/test/unit-tests/utils/tooltipify-test.tsx +++ b/test/unit-tests/utils/tooltipify-test.tsx @@ -11,7 +11,7 @@ import { act, render } from "jest-matrix-react"; import { tooltipifyLinks } from "../../../src/utils/tooltipify"; import PlatformPeg from "../../../src/PlatformPeg"; -import BasePlatform from "../../../src/BasePlatform"; +import type BasePlatform from "../../../src/BasePlatform"; import { ReactRootManager } from "../../../src/utils/react.tsx"; describe("tooltipify", () => { diff --git a/test/unit-tests/vector/routing-test.ts b/test/unit-tests/vector/routing-test.ts index 09b2df1d12..a9a078f760 100644 --- a/test/unit-tests/vector/routing-test.ts +++ b/test/unit-tests/vector/routing-test.ts @@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details. */ import { getInitialScreenAfterLogin, init, onNewScreen } from "../../../src/vector/routing"; -import MatrixChat from "../../../src/components/structures/MatrixChat.tsx"; +import type MatrixChat from "../../../src/components/structures/MatrixChat.tsx"; describe("onNewScreen", () => { it("should replace history if stripping via fields", () => { diff --git a/yarn.lock b/yarn.lock index 3257ae50dc..6df92c61c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4115,7 +4115,7 @@ axe-core@^4.10.0, axe-core@~4.10.2: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.10.2.tgz#85228e3e1d8b8532a27659b332e39b7fa0e022df" integrity sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w== -axios@^1.7.8: +axios@^1.7.9: version "1.7.9" resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.9.tgz#d7d071380c132a24accda1b2cfc1535b79ec650a" integrity sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw== @@ -6012,9 +6012,9 @@ eslint-plugin-jsx-a11y@^6.5.1: string.prototype.includes "^2.0.1" eslint-plugin-matrix-org@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-2.0.2.tgz#95b86b0f16704ab19740f7c3c62eae69e20365e6" - integrity sha512-cQy5Rjeq6uyu1mLXlPZwEJdyM0NmclrnEz68y792FSuuxzMyJNNYLGDQ5CkYW8H+PrD825HUFZ34pNXnjMOzOw== + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-matrix-org/-/eslint-plugin-matrix-org-2.1.0.tgz#9053726119f107154f5210665c2f84219425c190" + integrity sha512-YjVQ0qunzVV34tpUchLWhOrOalGfRLm0tclS4dPYnXS8Ui+p12o/YtRHt+26Mg5tJ0QH76HsGC0LJKLVLNoqfg== eslint-plugin-react-compiler@^19.0.0-beta-df7b47d-20241124: version "19.0.0-beta-df7b47d-20241124" @@ -8629,11 +8629,11 @@ magic-string@0.30.8: "@jridgewell/sourcemap-codec" "^1.4.15" mailpit-api@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/mailpit-api/-/mailpit-api-1.0.5.tgz#3383593707a7bc502af0ae6bf1296160daf8c730" - integrity sha512-55OjUjNv4hwrQKIzN8DqWywuW7UIyzN1FrEd3A87sJ9Ni07LZC/f7hgeW7dp36YYxrmV8voGzUmCY3dWJ3D6Og== + version "1.0.6" + resolved "https://registry.yarnpkg.com/mailpit-api/-/mailpit-api-1.0.6.tgz#b3a552281d90aafceed3d8792936eb386ab751ce" + integrity sha512-k/ESNdqKo4FQY4hFELQ4saBJJr5+XVnl+7qjgFjPyBHswa9ZPLCJ7opIXBmugX6403HUyJUDkqwlJ0To/nfDFw== dependencies: - axios "^1.7.8" + axios "^1.7.9" make-dir@^4.0.0: version "4.0.0"