From 70ccff110a990cc3d4a78f505c09f856c926e55c Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Mon, 30 May 2022 15:40:11 +0400 Subject: [PATCH] [Refactoring] Prefer `import type` (#1884) --- .eslintrc | 7 +++++++ src/App.tsx | 5 +++-- src/api/gramjs/apiBuilders/appConfig.ts | 2 +- src/api/gramjs/apiBuilders/bots.ts | 2 +- src/api/gramjs/apiBuilders/calls.ts | 2 +- src/api/gramjs/apiBuilders/chats.ts | 4 ++-- src/api/gramjs/apiBuilders/common.ts | 2 +- src/api/gramjs/apiBuilders/helpers.ts | 2 +- src/api/gramjs/apiBuilders/messages.ts | 2 +- src/api/gramjs/apiBuilders/misc.ts | 4 ++-- src/api/gramjs/apiBuilders/payments.ts | 2 +- src/api/gramjs/apiBuilders/peers.ts | 4 ++-- src/api/gramjs/apiBuilders/statistics.ts | 4 ++-- src/api/gramjs/apiBuilders/symbols.ts | 2 +- src/api/gramjs/apiBuilders/users.ts | 2 +- src/api/gramjs/gramjsBuilders/index.ts | 8 +++++--- src/api/gramjs/localDb.ts | 4 ++-- src/api/gramjs/methods/account.ts | 2 +- src/api/gramjs/methods/auth.ts | 2 +- src/api/gramjs/methods/bots.ts | 2 +- src/api/gramjs/methods/calls.ts | 2 +- src/api/gramjs/methods/chats.ts | 4 ++-- src/api/gramjs/methods/client.ts | 4 ++-- src/api/gramjs/methods/management.ts | 2 +- src/api/gramjs/methods/media.ts | 6 ++++-- src/api/gramjs/methods/messages.ts | 8 +++++--- src/api/gramjs/methods/payments.ts | 2 +- src/api/gramjs/methods/reactions.ts | 2 +- src/api/gramjs/methods/settings.ts | 7 ++++--- src/api/gramjs/methods/statistics.ts | 2 +- src/api/gramjs/methods/symbols.ts | 2 +- src/api/gramjs/methods/twoFaSettings.ts | 2 +- src/api/gramjs/methods/types.ts | 2 +- src/api/gramjs/methods/users.ts | 2 +- src/api/gramjs/provider.ts | 4 ++-- src/api/gramjs/updater.ts | 2 +- src/api/gramjs/worker/provider.ts | 8 ++++---- src/api/gramjs/worker/types.ts | 4 ++-- src/api/gramjs/worker/worker.ts | 4 ++-- src/api/types/bots.ts | 2 +- src/api/types/chats.ts | 8 ++++---- src/api/types/messages.ts | 2 +- src/api/types/misc.ts | 2 +- src/api/types/statistics.ts | 2 +- src/api/types/updates.ts | 12 ++++++------ src/api/types/users.ts | 4 ++-- src/components/auth/Auth.tsx | 5 +++-- src/components/auth/AuthCode.async.tsx | 3 ++- src/components/auth/AuthCode.tsx | 7 ++++--- src/components/auth/AuthPassword.async.tsx | 3 ++- src/components/auth/AuthPassword.tsx | 7 +++---- src/components/auth/AuthPhoneNumber.tsx | 11 ++++++----- src/components/auth/AuthQrCode.tsx | 7 ++++--- src/components/auth/AuthRegister.async.tsx | 3 ++- src/components/auth/AuthRegister.tsx | 9 ++++----- src/components/auth/CountryCodeInput.tsx | 5 +++-- .../auth/helpers/getSuggestedLanguage.ts | 2 +- src/components/calls/ActiveCallHeader.async.tsx | 3 ++- src/components/calls/ActiveCallHeader.tsx | 7 +++---- src/components/calls/group/GroupCall.async.tsx | 5 +++-- src/components/calls/group/GroupCall.tsx | 9 ++++++--- .../calls/group/GroupCallParticipant.tsx | 10 +++++----- .../calls/group/GroupCallParticipantList.tsx | 5 +++-- .../calls/group/GroupCallParticipantMenu.tsx | 7 ++++--- .../calls/group/GroupCallParticipantStreams.tsx | 5 +++-- .../calls/group/GroupCallParticipantVideo.tsx | 8 +++++--- src/components/calls/group/GroupCallTopPane.tsx | 5 +++-- src/components/calls/group/MicrophoneButton.tsx | 5 +++-- .../calls/group/OutlinedMicrophoneIcon.tsx | 6 ++++-- src/components/calls/phone/PhoneCall.async.tsx | 3 ++- src/components/calls/phone/PhoneCall.tsx | 5 +++-- src/components/calls/phone/PhoneCallButton.tsx | 3 ++- .../calls/phone/RatePhoneCallModal.async.tsx | 5 +++-- .../calls/phone/RatePhoneCallModal.tsx | 5 ++--- src/components/common/AnimatedEmoji.tsx | 13 +++++++------ src/components/common/AnimatedIcon.tsx | 8 ++++---- src/components/common/AnimatedSticker.tsx | 3 ++- src/components/common/Audio.tsx | 17 ++++++++++------- src/components/common/Avatar.tsx | 12 ++++++------ src/components/common/CalendarModal.async.tsx | 5 +++-- src/components/common/CalendarModal.tsx | 6 ++++-- src/components/common/ChatExtra.tsx | 9 ++++----- src/components/common/ChatLink.tsx | 3 ++- src/components/common/ChatOrUserPicker.tsx | 7 +++---- src/components/common/DeleteChatModal.tsx | 5 +++-- .../common/DeleteMessageModal.async.tsx | 5 +++-- src/components/common/DeleteMessageModal.tsx | 7 ++++--- src/components/common/Document.tsx | 8 +++++--- src/components/common/DotAnimation.tsx | 3 ++- src/components/common/EmbeddedMessage.tsx | 8 +++++--- src/components/common/FakeIcon.tsx | 5 +++-- src/components/common/File.tsx | 5 +++-- src/components/common/GifButton.tsx | 9 ++++++--- src/components/common/GroupCallLink.tsx | 5 +++-- src/components/common/GroupChatInfo.tsx | 14 +++++++------- src/components/common/LastMessageMeta.tsx | 5 +++-- src/components/common/LocalAnimatedEmoji.tsx | 13 +++++++------ src/components/common/Media.tsx | 10 +++++----- src/components/common/MessageLink.tsx | 5 +++-- src/components/common/MessageOutgoingStatus.tsx | 5 +++-- src/components/common/NothingFound.tsx | 3 ++- src/components/common/PasswordForm.tsx | 5 +++-- src/components/common/PasswordMonkey.tsx | 3 ++- src/components/common/Picker.tsx | 3 ++- src/components/common/PickerSelectedItem.tsx | 5 +++-- src/components/common/PinMessageModal.async.tsx | 5 +++-- src/components/common/PinMessageModal.tsx | 3 ++- src/components/common/PrivateChatInfo.tsx | 11 +++++------ src/components/common/ProfileInfo.tsx | 7 ++++--- src/components/common/ProfilePhoto.tsx | 8 ++++---- src/components/common/ReactionStaticEmoji.tsx | 5 +++-- src/components/common/ReportModal.tsx | 7 ++++--- src/components/common/SafeLink.tsx | 3 ++- src/components/common/SeenByModal.async.tsx | 5 +++-- src/components/common/SeenByModal.tsx | 3 ++- src/components/common/StickerButton.tsx | 8 +++++--- src/components/common/StickerSetModal.async.tsx | 5 +++-- src/components/common/StickerSetModal.tsx | 5 +++-- src/components/common/TrackingMonkey.tsx | 3 ++- src/components/common/TypingStatus.tsx | 5 +++-- src/components/common/UiLoader.tsx | 7 ++++--- .../common/UnpinAllMessagesModal.async.tsx | 5 +++-- src/components/common/UnpinAllMessagesModal.tsx | 3 ++- src/components/common/UnreadCounter.tsx | 3 ++- src/components/common/UserLink.tsx | 5 +++-- src/components/common/UsernameInput.tsx | 5 +++-- src/components/common/VerifiedIcon.tsx | 3 ++- src/components/common/WebLink.tsx | 9 +++++---- src/components/common/code/CodeBlock.tsx | 5 ++--- src/components/common/code/CodeOverlay.tsx | 3 ++- src/components/common/code/PreBlock.tsx | 5 ++--- src/components/common/helpers/documentInfo.ts | 2 +- .../common/helpers/mediaDimensions.ts | 2 +- .../common/helpers/renderActionMessageText.tsx | 6 +++--- .../common/helpers/renderMessageText.ts | 7 ++++--- src/components/common/helpers/renderText.tsx | 2 +- .../common/helpers/renderTextWithEntities.tsx | 10 ++++++---- src/components/common/hooks/useAnimatedEmoji.ts | 2 +- src/components/common/hooks/usePhotosPreload.ts | 5 ++--- src/components/common/spoiler/Spoiler.tsx | 5 +++-- src/components/left/ArchivedChats.async.tsx | 5 +++-- src/components/left/ArchivedChats.tsx | 5 +++-- src/components/left/ChatFolderModal.async.tsx | 5 +++-- src/components/left/ChatFolderModal.tsx | 5 +++-- src/components/left/ConnectionStatusOverlay.tsx | 5 +++-- src/components/left/LeftColumn.tsx | 3 ++- src/components/left/NewChatButton.tsx | 3 ++- src/components/left/main/Badge.tsx | 5 +++-- src/components/left/main/Chat.tsx | 11 +++++++---- src/components/left/main/ChatCallStatus.tsx | 3 ++- src/components/left/main/ChatFolders.tsx | 9 +++++---- src/components/left/main/ChatList.tsx | 9 ++++----- src/components/left/main/ContactList.async.tsx | 5 +++-- src/components/left/main/ContactList.tsx | 7 +++---- src/components/left/main/EmptyFolder.tsx | 7 ++++--- src/components/left/main/LeftMain.tsx | 8 +++++--- src/components/left/main/LeftMainHeader.tsx | 12 ++++++------ src/components/left/newChat/NewChat.async.tsx | 5 +++-- src/components/left/newChat/NewChat.tsx | 5 ++--- .../left/newChat/NewChatStep1.async.tsx | 5 +++-- src/components/left/newChat/NewChatStep1.tsx | 7 +++---- .../left/newChat/NewChatStep2.async.tsx | 5 +++-- src/components/left/newChat/NewChatStep2.tsx | 3 ++- src/components/left/search/AudioResults.tsx | 8 ++++---- src/components/left/search/ChatMessage.tsx | 10 +++++----- .../left/search/ChatMessageResults.tsx | 7 +++---- src/components/left/search/ChatResults.tsx | 5 +++-- src/components/left/search/DateSuggest.tsx | 3 ++- src/components/left/search/FileResults.tsx | 8 +++++--- src/components/left/search/LeftSearch.async.tsx | 5 +++-- src/components/left/search/LeftSearch.tsx | 3 ++- .../left/search/LeftSearchResultChat.tsx | 7 +++---- src/components/left/search/LinkResults.tsx | 6 ++++-- src/components/left/search/MediaResults.tsx | 6 ++++-- src/components/left/search/RecentContacts.tsx | 5 +++-- .../search/helpers/createMapStateToProps.ts | 6 +++--- .../left/search/helpers/getSenderName.ts | 4 ++-- src/components/left/settings/BlockUserModal.tsx | 5 +++-- src/components/left/settings/Settings.async.tsx | 5 +++-- src/components/left/settings/Settings.tsx | 5 +++-- .../left/settings/SettingsActiveSession.tsx | 5 +++-- .../left/settings/SettingsActiveSessions.tsx | 5 +++-- .../left/settings/SettingsDataStorage.tsx | 5 +++-- .../left/settings/SettingsEditProfile.tsx | 5 +++-- .../left/settings/SettingsGeneral.tsx | 11 +++++++---- .../left/settings/SettingsGeneralBackground.tsx | 8 +++++--- .../settings/SettingsGeneralBackgroundColor.tsx | 10 ++++++---- src/components/left/settings/SettingsHeader.tsx | 3 ++- .../left/settings/SettingsLanguage.tsx | 7 ++++--- src/components/left/settings/SettingsMain.tsx | 5 +++-- .../left/settings/SettingsNotifications.tsx | 7 +++---- .../left/settings/SettingsPrivacy.tsx | 6 ++++-- .../settings/SettingsPrivacyBlockedUsers.tsx | 7 +++---- .../left/settings/SettingsPrivacyVisibility.tsx | 10 +++++----- .../SettingsPrivacyVisibilityExceptionList.tsx | 8 +++++--- .../left/settings/SettingsQuickReaction.tsx | 5 +++-- .../left/settings/SettingsStickerSet.tsx | 9 ++++----- src/components/left/settings/WallpaperTile.tsx | 8 +++++--- .../left/settings/folders/SettingsFolders.tsx | 7 ++++--- .../folders/SettingsFoldersChatFilters.tsx | 9 +++++---- .../folders/SettingsFoldersChatsPicker.tsx | 5 +++-- .../settings/folders/SettingsFoldersEdit.tsx | 9 ++++++--- .../settings/folders/SettingsFoldersMain.tsx | 5 +++-- .../left/settings/helpers/getSessionIcon.ts | 2 +- src/components/left/settings/helpers/privacy.ts | 3 ++- .../left/settings/twoFa/SettingsTwoFa.tsx | 9 ++++----- .../twoFa/SettingsTwoFaCongratulations.tsx | 5 +++-- .../settings/twoFa/SettingsTwoFaEmailCode.tsx | 5 +++-- .../settings/twoFa/SettingsTwoFaEnabled.tsx | 5 +++-- .../settings/twoFa/SettingsTwoFaPassword.tsx | 5 ++--- .../twoFa/SettingsTwoFaSkippableForm.tsx | 5 +++-- .../left/settings/twoFa/SettingsTwoFaStart.tsx | 5 +++-- src/components/main/AppInactive.tsx | 3 ++- src/components/main/BotAttachModal.async.tsx | 5 +++-- src/components/main/BotAttachModal.tsx | 5 +++-- src/components/main/BotTrustModal.async.tsx | 5 +++-- src/components/main/BotTrustModal.tsx | 5 +++-- src/components/main/Dialogs.async.tsx | 3 ++- src/components/main/Dialogs.tsx | 5 +++-- src/components/main/DownloadManager.tsx | 10 +++++----- src/components/main/ForwardPicker.async.tsx | 5 +++-- src/components/main/ForwardPicker.tsx | 8 +++++--- src/components/main/GameModal.tsx | 7 +++---- src/components/main/HistoryCalendar.async.tsx | 5 +++-- src/components/main/HistoryCalendar.tsx | 3 ++- src/components/main/Main.async.tsx | 3 ++- src/components/main/Main.tsx | 9 +++++---- src/components/main/NewContactModal.async.tsx | 5 +++-- src/components/main/NewContactModal.tsx | 5 +++-- src/components/main/Notifications.async.tsx | 3 ++- src/components/main/Notifications.tsx | 5 +++-- src/components/main/SafeLinkModal.async.tsx | 5 +++-- src/components/main/SafeLinkModal.tsx | 3 ++- src/components/main/WebAppModal.async.tsx | 5 +++-- src/components/main/WebAppModal.tsx | 12 +++++++----- .../mediaViewer/MediaViewer.async.tsx | 3 ++- src/components/mediaViewer/MediaViewer.tsx | 8 +++++--- .../mediaViewer/MediaViewerActions.tsx | 4 ++-- .../mediaViewer/MediaViewerContent.tsx | 8 +++++--- .../mediaViewer/MediaViewerFooter.tsx | 5 +++-- .../mediaViewer/MediaViewerSlides.tsx | 8 +++++--- src/components/mediaViewer/PanZoom.tsx | 3 ++- src/components/mediaViewer/SenderInfo.tsx | 5 +++-- src/components/mediaViewer/SlideTransition.tsx | 6 ++++-- src/components/mediaViewer/VideoPlayer.tsx | 5 +++-- .../mediaViewer/VideoPlayerControls.tsx | 5 +++-- src/components/mediaViewer/ZoomControls.tsx | 3 ++- .../mediaViewer/helpers/ghostAnimation.ts | 2 +- src/components/middle/ActionMessage.tsx | 10 ++++++---- src/components/middle/AudioPlayer.tsx | 9 ++++----- src/components/middle/ChatReportPanel.tsx | 7 +++---- src/components/middle/ContactGreeting.tsx | 5 +++-- .../middle/DeleteSelectedMessageModal.tsx | 5 ++--- .../middle/EmojiInteractionAnimation.async.tsx | 5 +++-- .../middle/EmojiInteractionAnimation.tsx | 5 +++-- src/components/middle/FloatingActionButtons.tsx | 5 +++-- src/components/middle/HeaderActions.tsx | 7 ++++--- .../middle/HeaderMenuContainer.async.tsx | 5 +++-- src/components/middle/HeaderMenuContainer.tsx | 7 ++++--- src/components/middle/HeaderPinnedMessage.tsx | 5 +++-- src/components/middle/MessageList.tsx | 10 +++++----- src/components/middle/MessageListContent.tsx | 10 ++++++---- .../middle/MessageListHistoryHandler.tsx | 5 +++-- .../middle/MessageSelectToolbar.async.tsx | 5 +++-- src/components/middle/MessageSelectToolbar.tsx | 7 +++---- src/components/middle/MiddleColumn.tsx | 10 ++++++---- src/components/middle/MiddleHeader.tsx | 10 ++++++---- src/components/middle/MobileSearch.async.tsx | 5 +++-- src/components/middle/MobileSearch.tsx | 5 +++-- src/components/middle/NoMessages.tsx | 8 +++++--- .../middle/PinnedMessageNavigation.tsx | 2 +- .../middle/ReactorListModal.async.tsx | 5 +++-- src/components/middle/ReactorListModal.tsx | 5 +++-- src/components/middle/ScrollDownButton.tsx | 3 ++- src/components/middle/composer/AttachMenu.tsx | 9 ++++----- .../middle/composer/AttachmentMenuBotIcon.tsx | 8 +++++--- .../middle/composer/AttachmentMenuBotItem.tsx | 7 ++++--- .../middle/composer/AttachmentModal.async.tsx | 5 +++-- .../middle/composer/AttachmentModal.tsx | 5 +++-- src/components/middle/composer/BotCommand.tsx | 5 +++-- .../middle/composer/BotCommandMenu.async.tsx | 5 +++-- .../middle/composer/BotCommandMenu.tsx | 5 +++-- .../middle/composer/BotCommandTooltip.async.tsx | 5 +++-- .../middle/composer/BotCommandTooltip.tsx | 5 +++-- .../middle/composer/BotKeyboardMenu.tsx | 7 +++---- .../middle/composer/BotMenuButton.tsx | 5 ++--- src/components/middle/composer/Composer.tsx | 13 ++++++++----- .../middle/composer/ComposerEmbeddedMessage.tsx | 7 +++---- .../middle/composer/CustomSendMenu.async.tsx | 5 +++-- .../middle/composer/CustomSendMenu.tsx | 3 ++- .../middle/composer/DropArea.async.tsx | 5 +++-- src/components/middle/composer/DropArea.tsx | 3 ++- src/components/middle/composer/DropTarget.tsx | 3 ++- src/components/middle/composer/EmojiButton.tsx | 5 ++--- .../middle/composer/EmojiCategory.tsx | 6 ++++-- src/components/middle/composer/EmojiPicker.tsx | 9 ++++++--- .../middle/composer/EmojiTooltip.async.tsx | 5 +++-- src/components/middle/composer/EmojiTooltip.tsx | 3 ++- src/components/middle/composer/GifPicker.tsx | 5 +++-- .../middle/composer/InlineBotTooltip.async.tsx | 5 +++-- .../middle/composer/InlineBotTooltip.tsx | 5 +++-- .../middle/composer/MentionTooltip.async.tsx | 5 +++-- .../middle/composer/MentionTooltip.tsx | 5 +++-- src/components/middle/composer/MessageInput.tsx | 7 ++++--- .../middle/composer/PollModal.async.tsx | 5 +++-- src/components/middle/composer/PollModal.tsx | 7 ++++--- .../middle/composer/SendAsMenu.async.tsx | 5 +++-- src/components/middle/composer/SendAsMenu.tsx | 3 ++- .../middle/composer/StickerPicker.tsx | 7 ++++--- src/components/middle/composer/StickerSet.tsx | 10 ++++++---- .../middle/composer/StickerSetCover.tsx | 10 +++++----- .../middle/composer/StickerSetCoverAnimated.tsx | 11 ++++++----- .../middle/composer/StickerTooltip.async.tsx | 5 +++-- .../middle/composer/StickerTooltip.tsx | 7 +++---- .../middle/composer/SymbolMenu.async.tsx | 5 +++-- src/components/middle/composer/SymbolMenu.tsx | 5 +++-- .../middle/composer/SymbolMenuFooter.tsx | 3 ++- .../middle/composer/TextFormatter.async.tsx | 5 +++-- .../middle/composer/TextFormatter.tsx | 5 +++-- .../middle/composer/WebPagePreview.tsx | 10 +++++----- .../middle/composer/helpers/buildAttachment.ts | 2 +- .../composer/hooks/useBotCommandTooltip.ts | 2 +- .../middle/composer/hooks/useClipboardPaste.ts | 5 +++-- .../middle/composer/hooks/useDraft.ts | 2 +- .../middle/composer/hooks/useEditing.ts | 4 ++-- .../middle/composer/hooks/useEmojiTooltip.ts | 5 ++--- .../composer/hooks/useInlineBotTooltip.ts | 2 +- .../middle/composer/hooks/useMentionTooltip.ts | 3 ++- .../middle/composer/hooks/useStickerTooltip.ts | 2 +- .../composer/inlineResults/ArticleResult.tsx | 5 +++-- .../composer/inlineResults/BaseResult.tsx | 5 +++-- .../middle/composer/inlineResults/GifResult.tsx | 9 ++++----- .../composer/inlineResults/MediaResult.tsx | 5 +++-- .../composer/inlineResults/StickerResult.tsx | 7 ++++--- src/components/middle/helpers/groupMessages.ts | 4 ++-- .../middle/helpers/preventMessageInputBlur.ts | 2 +- .../middle/hooks/useMessageObservers.ts | 4 ++-- src/components/middle/hooks/useScrollHooks.ts | 4 ++-- src/components/middle/message/Album.tsx | 14 ++++++++------ src/components/middle/message/CommentButton.tsx | 7 +++---- src/components/middle/message/Contact.tsx | 5 +++-- .../message/ContextMenuContainer.async.tsx | 5 +++-- .../middle/message/ContextMenuContainer.tsx | 9 +++++---- src/components/middle/message/Game.tsx | 7 +++---- src/components/middle/message/InlineButtons.tsx | 5 +++-- src/components/middle/message/Invoice.tsx | 9 ++++----- src/components/middle/message/Location.tsx | 7 ++++--- src/components/middle/message/MentionLink.tsx | 5 +++-- src/components/middle/message/Message.tsx | 12 +++++++----- .../middle/message/MessageContextMenu.tsx | 7 ++++--- src/components/middle/message/MessageMeta.tsx | 9 ++++----- .../middle/message/MessagePhoneCall.tsx | 7 +++---- src/components/middle/message/Photo.tsx | 12 +++++++----- src/components/middle/message/Poll.tsx | 7 ++++--- src/components/middle/message/PollOption.tsx | 7 +++---- .../middle/message/ReactionAnimatedEmoji.tsx | 8 +++++--- .../middle/message/ReactionButton.tsx | 9 ++++----- .../middle/message/ReactionSelector.tsx | 7 +++---- .../middle/message/ReactionSelectorReaction.tsx | 8 ++++---- src/components/middle/message/Reactions.tsx | 7 ++++--- src/components/middle/message/RoundVideo.tsx | 8 +++++--- .../middle/message/SponsoredMessage.tsx | 7 ++++--- src/components/middle/message/Sticker.tsx | 8 +++++--- src/components/middle/message/Video.tsx | 13 +++++++------ src/components/middle/message/WebPage.tsx | 9 +++++---- .../message/helpers/buildContentClassName.ts | 2 +- .../message/helpers/calculateAlbumLayout.ts | 4 ++-- .../middle/message/helpers/copyOptions.ts | 3 ++- .../message/helpers/getCustomAppendixBg.ts | 2 +- .../middle/message/helpers/mediaDimensions.ts | 2 +- .../middle/message/hocs/withSelectControl.tsx | 8 ++++---- .../message/hooks/useBlurredMediaThumbRef.ts | 2 +- .../middle/message/hooks/useFocusMessage.ts | 2 +- .../middle/message/hooks/useInnerHandlers.ts | 13 +++++++------ .../middle/message/hooks/useOuterHandlers.ts | 5 +++-- src/components/payment/CardInput.tsx | 3 ++- src/components/payment/Checkout.tsx | 7 +++---- src/components/payment/ConfirmPayment.tsx | 3 ++- src/components/payment/ExpiryInput.tsx | 5 ++--- src/components/payment/PaymentInfo.tsx | 7 ++++--- src/components/payment/PaymentModal.async.tsx | 5 +++-- src/components/payment/PaymentModal.tsx | 13 ++++++++----- src/components/payment/ReceiptModal.async.tsx | 5 +++-- src/components/payment/ReceiptModal.tsx | 9 ++++----- src/components/payment/Shipping.tsx | 7 ++++--- src/components/payment/ShippingInfo.tsx | 7 ++++--- src/components/right/AddChatMembers.tsx | 5 +++-- src/components/right/DeleteMemberModal.tsx | 5 +++-- src/components/right/GifSearch.async.tsx | 3 ++- src/components/right/GifSearch.tsx | 7 +++---- src/components/right/PollAnswerResults.tsx | 5 +++-- src/components/right/PollResults.async.tsx | 3 ++- src/components/right/PollResults.tsx | 5 +++-- src/components/right/Profile.tsx | 14 ++++++++++---- src/components/right/RightColumn.tsx | 3 ++- src/components/right/RightHeader.tsx | 5 +++-- src/components/right/RightSearch.async.tsx | 5 +++-- src/components/right/RightSearch.tsx | 7 +++---- src/components/right/StickerSearch.async.tsx | 3 ++- src/components/right/StickerSearch.tsx | 3 ++- src/components/right/StickerSetResult.tsx | 7 ++++--- .../right/hooks/useProfileViewportIds.ts | 4 ++-- src/components/right/management/JoinRequest.tsx | 5 +++-- .../right/management/ManageChannel.tsx | 8 +++++--- .../management/ManageChatAdministrators.tsx | 7 +++---- .../right/management/ManageChatPrivacyType.tsx | 5 +++-- .../right/management/ManageChatRemovedUsers.tsx | 7 +++---- .../right/management/ManageDiscussion.tsx | 5 +++-- src/components/right/management/ManageGroup.tsx | 10 +++++----- .../right/management/ManageGroupAdminRights.tsx | 5 +++-- .../right/management/ManageGroupMembers.tsx | 5 +++-- .../right/management/ManageGroupPermissions.tsx | 5 +++-- .../management/ManageGroupRecentActions.tsx | 7 +++---- .../management/ManageGroupUserPermissions.tsx | 5 +++-- .../ManageGroupUserPermissionsCreate.tsx | 7 +++---- .../right/management/ManageInvite.tsx | 9 ++++----- .../right/management/ManageInviteInfo.tsx | 7 +++---- .../right/management/ManageInvites.tsx | 5 +++-- .../right/management/ManageJoinRequests.tsx | 5 +++-- .../right/management/ManageReactions.tsx | 5 +++-- src/components/right/management/ManageUser.tsx | 7 ++++--- .../right/management/Management.async.tsx | 5 +++-- src/components/right/management/Management.tsx | 6 ++++-- .../right/management/RemoveGroupUserModal.tsx | 5 +++-- .../statistics/MessageStatistics.async.tsx | 5 +++-- .../right/statistics/MessageStatistics.tsx | 5 +++-- .../right/statistics/Statistics.async.tsx | 5 +++-- src/components/right/statistics/Statistics.tsx | 5 +++-- .../right/statistics/StatisticsOverview.tsx | 5 +++-- .../statistics/StatisticsRecentMessage.tsx | 8 +++++--- src/components/test/ErrorTest.tsx | 3 ++- src/components/test/SubTest.tsx | 5 +++-- src/components/test/Test.tsx | 5 +++-- src/components/test/TestNoRedundancy.tsx | 5 +++-- src/components/test/TestOrdered.tsx | 5 +++-- src/components/test/TestPortal.tsx | 3 ++- src/components/ui/AvatarEditable.tsx | 5 +++-- src/components/ui/Button.tsx | 7 +++---- src/components/ui/Checkbox.tsx | 7 +++---- src/components/ui/CheckboxGroup.tsx | 7 +++---- src/components/ui/ConfirmDialog.tsx | 7 +++---- src/components/ui/CropModal.tsx | 3 ++- src/components/ui/DropdownMenu.tsx | 5 ++--- src/components/ui/FloatingActionButton.tsx | 6 ++++-- src/components/ui/InfiniteScroll.tsx | 5 +++-- src/components/ui/InputText.tsx | 5 +++-- src/components/ui/Link.tsx | 3 ++- src/components/ui/ListItem.tsx | 5 +++-- src/components/ui/Loading.tsx | 3 ++- src/components/ui/Menu.tsx | 5 +++-- src/components/ui/MenuItem.tsx | 3 ++- src/components/ui/Modal.tsx | 9 ++++----- src/components/ui/Notification.tsx | 4 ++-- src/components/ui/Portal.ts | 5 ++--- src/components/ui/ProgressSpinner.tsx | 5 ++--- src/components/ui/Radio.tsx | 5 +++-- src/components/ui/RadioGroup.tsx | 7 +++---- src/components/ui/RangeSlider.tsx | 7 +++---- src/components/ui/ResponsiveHoverButton.tsx | 8 ++++---- src/components/ui/RippleEffect.tsx | 3 ++- src/components/ui/SearchInput.tsx | 5 +++-- src/components/ui/Select.tsx | 5 +++-- src/components/ui/ShowMoreButton.tsx | 3 ++- src/components/ui/ShowTransition.tsx | 3 ++- src/components/ui/Skeleton.tsx | 3 ++- src/components/ui/Spinner.tsx | 3 ++- src/components/ui/Switcher.tsx | 5 +++-- src/components/ui/Tab.tsx | 5 ++--- src/components/ui/TabList.tsx | 5 ++--- src/components/ui/Transition.tsx | 9 ++++----- src/global/actions/api/bots.ts | 4 ++-- src/global/actions/api/chats.ts | 7 +++---- src/global/actions/api/globalSearch.ts | 2 +- src/global/actions/api/localSearch.ts | 5 +++-- src/global/actions/api/messages.ts | 6 ++++-- src/global/actions/api/payments.ts | 2 +- src/global/actions/api/reactions.ts | 3 ++- src/global/actions/api/settings.ts | 7 +++++-- src/global/actions/api/statistics.ts | 2 +- src/global/actions/api/symbols.ts | 4 ++-- src/global/actions/api/sync.ts | 7 +++---- src/global/actions/api/users.ts | 2 +- src/global/actions/apiUpdaters/calls.async.ts | 4 ++-- src/global/actions/apiUpdaters/initial.ts | 4 ++-- src/global/actions/apiUpdaters/messages.ts | 7 ++++--- src/global/actions/apiUpdaters/misc.ts | 3 ++- src/global/actions/apiUpdaters/users.ts | 2 +- src/global/actions/ui/calls.ts | 4 ++-- src/global/actions/ui/localSearch.ts | 2 +- src/global/actions/ui/messages.ts | 5 +++-- src/global/actions/ui/misc.ts | 2 +- src/global/actions/ui/settings.ts | 2 +- src/global/cache.ts | 2 +- src/global/helpers/chats.ts | 8 +++++--- src/global/helpers/messageMedia.ts | 6 ++++-- src/global/helpers/messageSummary.ts | 7 ++++--- src/global/helpers/messages.ts | 7 ++++--- src/global/helpers/payments.ts | 2 +- src/global/helpers/reactions.ts | 4 ++-- src/global/helpers/users.ts | 4 ++-- src/global/index.ts | 2 +- src/global/initialState.ts | 2 +- src/global/reducers/bots.ts | 4 ++-- src/global/reducers/calls.ts | 6 +++--- src/global/reducers/chats.ts | 4 ++-- src/global/reducers/globalSearch.ts | 6 +++--- src/global/reducers/localSearch.ts | 6 +++--- src/global/reducers/management.ts | 4 ++-- src/global/reducers/messages.ts | 9 ++++----- src/global/reducers/payments.ts | 6 +++--- src/global/reducers/reactions.ts | 4 ++-- src/global/reducers/settings.ts | 6 +++--- src/global/reducers/statistics.ts | 4 ++-- src/global/reducers/symbols.ts | 4 ++-- src/global/reducers/twoFaSettings.ts | 2 +- src/global/reducers/users.ts | 4 ++-- src/global/selectors/calls.ts | 2 +- src/global/selectors/chats.ts | 5 +++-- src/global/selectors/globalSearch.ts | 2 +- src/global/selectors/localSearch.ts | 2 +- src/global/selectors/management.ts | 2 +- src/global/selectors/messages.ts | 6 ++++-- src/global/selectors/payments.ts | 2 +- src/global/selectors/settings.ts | 2 +- src/global/selectors/statistics.ts | 2 +- src/global/selectors/symbols.ts | 4 ++-- src/global/selectors/ui.ts | 2 +- src/global/selectors/users.ts | 4 ++-- src/global/types.ts | 4 ++-- src/hooks/reducers/useFoldersReducer.ts | 5 +++-- src/hooks/reducers/usePaymentReducer.ts | 3 ++- src/hooks/reducers/useTwoFaReducer.ts | 3 ++- src/hooks/useAudioPlayer.ts | 6 ++++-- src/hooks/useBuffering.ts | 3 ++- src/hooks/useChatContextActions.ts | 2 +- src/hooks/useConnectionStatus.ts | 4 ++-- src/hooks/useContextMenuHandlers.ts | 4 ++-- src/hooks/useContextMenuPosition.ts | 2 +- src/hooks/useCustomBackground.ts | 2 +- src/hooks/useEnsureMessage.ts | 2 +- src/hooks/useFocusAfterAnimation.tsx | 2 +- src/hooks/useInputFocusOnOpen.ts | 2 +- src/hooks/useIntersectionObserver.ts | 2 +- src/hooks/useKeyboardListNavigation.ts | 2 +- src/hooks/useMessageMediaMetadata.ts | 2 +- src/hooks/useModuleLoader.ts | 5 ++--- src/hooks/useResize.ts | 2 +- src/hooks/useSendMessageAction.ts | 2 +- src/hooks/useVideoCleanup.ts | 2 +- src/hooks/useVirtualBackdrop.ts | 2 +- src/hooks/useWebpThumbnail.ts | 2 +- src/hooks/useWindowSize.ts | 2 +- src/lib/rlottie/rlottie.worker.ts | 2 +- src/lib/secret-sauce/buildSdp.d.ts | 2 +- src/lib/secret-sauce/p2p.d.ts | 2 +- src/lib/secret-sauce/p2pMessage.d.ts | 2 +- src/lib/secret-sauce/parseSdp.d.ts | 2 +- src/lib/secret-sauce/secretsauce.d.ts | 2 +- src/lib/secret-sauce/utils.d.ts | 2 +- src/lib/teact/teact-dom.ts | 10 ++++++---- src/lib/teact/teactn.tsx | 5 ++--- src/types/index.ts | 4 ++-- src/util/audioPlayer.ts | 5 +++-- src/util/createWorkerInterface.ts | 2 +- src/util/dateFormat.ts | 2 +- src/util/environmentSystemTheme.ts | 2 +- src/util/fallbackLangPack.ts | 2 +- src/util/folderManager.ts | 9 +++++---- src/util/formatCurrency.ts | 2 +- src/util/getReadableErrorText.ts | 2 +- src/util/highlightCode.ts | 3 ++- src/util/langProvider.ts | 4 ++-- src/util/mediaLoader.ts | 6 ++++-- src/util/notifications.ts | 5 +++-- src/util/parseMessageInput.ts | 3 ++- src/util/phoneNumber.ts | 2 +- src/util/routing.ts | 2 +- src/util/sessions.ts | 2 +- src/util/stopEvent.ts | 2 +- src/util/switchTheme.ts | 2 +- src/util/themeStyle.ts | 2 +- src/util/voiceRecording.ts | 2 +- 582 files changed, 1691 insertions(+), 1340 deletions(-) diff --git a/.eslintrc b/.eslintrc index 16540e6e..7a2a436e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -95,6 +95,13 @@ "@typescript-eslint/member-delimiter-style": "error", "@typescript-eslint/default-param-last": "off", "@typescript-eslint/return-await": ["error", "in-try-catch"], + "@typescript-eslint/consistent-type-imports": [ + "error", + { + "prefer": "type-imports", + "disallowTypeAnnotations": false + } + ], "teactn/prefer-separate-component-file": "off" }, "settings": { diff --git a/src/App.tsx b/src/App.tsx index ba04ea8a..b8c1fc49 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,8 @@ -import React, { FC, useEffect } from './lib/teact/teact'; +import type { FC } from './lib/teact/teact'; +import React, { useEffect } from './lib/teact/teact'; import { getActions, withGlobal } from './global'; -import { GlobalState } from './global/types'; +import type { GlobalState } from './global/types'; import { INACTIVE_MARKER, PAGE_TITLE } from './config'; import { pick } from './util/iteratees'; diff --git a/src/api/gramjs/apiBuilders/appConfig.ts b/src/api/gramjs/apiBuilders/appConfig.ts index c8fb4b73..51487529 100644 --- a/src/api/gramjs/apiBuilders/appConfig.ts +++ b/src/api/gramjs/apiBuilders/appConfig.ts @@ -2,7 +2,7 @@ import BigInt from 'big-integer'; import localDb from '../localDb'; import { Api as GramJs } from '../../../lib/gramjs'; -import { ApiAppConfig } from '../../types'; +import type { ApiAppConfig } from '../../types'; import { buildJson } from './misc'; type GramJsAppConfig = { diff --git a/src/api/gramjs/apiBuilders/bots.ts b/src/api/gramjs/apiBuilders/bots.ts index 512539b8..d0b1f983 100644 --- a/src/api/gramjs/apiBuilders/bots.ts +++ b/src/api/gramjs/apiBuilders/bots.ts @@ -1,5 +1,5 @@ import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { ApiAttachMenuBot, ApiAttachMenuBotIcon, ApiBotCommand, diff --git a/src/api/gramjs/apiBuilders/calls.ts b/src/api/gramjs/apiBuilders/calls.ts index 8e9c1681..633867ac 100644 --- a/src/api/gramjs/apiBuilders/calls.ts +++ b/src/api/gramjs/apiBuilders/calls.ts @@ -6,7 +6,7 @@ import type { SsrcGroup, } from '../../../lib/secret-sauce'; import { Api as GramJs } from '../../../lib/gramjs'; -import { ApiGroupCall, ApiPhoneCall } from '../../types'; +import type { ApiGroupCall, ApiPhoneCall } from '../../types'; import { getApiChatIdFromMtpPeer, isPeerUser } from './peers'; export function buildApiGroupCallParticipant(participant: GramJs.GroupCallParticipant): GroupCallParticipant { diff --git a/src/api/gramjs/apiBuilders/chats.ts b/src/api/gramjs/apiBuilders/chats.ts index 3e7505ed..d13ae527 100644 --- a/src/api/gramjs/apiBuilders/chats.ts +++ b/src/api/gramjs/apiBuilders/chats.ts @@ -1,6 +1,6 @@ -import BigInt from 'big-integer'; +import type BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { ApiChat, ApiChatAdminRights, ApiChatBannedRights, diff --git a/src/api/gramjs/apiBuilders/common.ts b/src/api/gramjs/apiBuilders/common.ts index f755e3ab..85e2ac72 100644 --- a/src/api/gramjs/apiBuilders/common.ts +++ b/src/api/gramjs/apiBuilders/common.ts @@ -1,7 +1,7 @@ import { Api as GramJs } from '../../../lib/gramjs'; import { strippedPhotoToJpg } from '../../../lib/gramjs/Utils'; -import { +import type { ApiPhoto, ApiPhotoSize, ApiThumbnail, } from '../../types'; import { bytesToDataUri } from './helpers'; diff --git a/src/api/gramjs/apiBuilders/helpers.ts b/src/api/gramjs/apiBuilders/helpers.ts index ba654b0a..f565684b 100644 --- a/src/api/gramjs/apiBuilders/helpers.ts +++ b/src/api/gramjs/apiBuilders/helpers.ts @@ -1,4 +1,4 @@ -import { Api as GramJs } from '../../../lib/gramjs'; +import type { Api as GramJs } from '../../../lib/gramjs'; type VirtualFields = 'flags' diff --git a/src/api/gramjs/apiBuilders/messages.ts b/src/api/gramjs/apiBuilders/messages.ts index 48d4ba2e..e4338b16 100644 --- a/src/api/gramjs/apiBuilders/messages.ts +++ b/src/api/gramjs/apiBuilders/messages.ts @@ -1,5 +1,5 @@ import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { ApiMessage, ApiMessageForwardInfo, ApiPhoto, diff --git a/src/api/gramjs/apiBuilders/misc.ts b/src/api/gramjs/apiBuilders/misc.ts index 2c217fb9..35c48e6a 100644 --- a/src/api/gramjs/apiBuilders/misc.ts +++ b/src/api/gramjs/apiBuilders/misc.ts @@ -1,9 +1,9 @@ import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { ApiCountry, ApiSession, ApiWallpaper, } from '../../types'; -import { ApiPrivacySettings, ApiPrivacyKey, PrivacyVisibility } from '../../../types'; +import type { ApiPrivacySettings, ApiPrivacyKey, PrivacyVisibility } from '../../../types'; import { buildApiDocument } from './messages'; import { buildApiPeerId, getApiChatIdFromMtpPeer } from './peers'; diff --git a/src/api/gramjs/apiBuilders/payments.ts b/src/api/gramjs/apiBuilders/payments.ts index 359309ff..c8752fd8 100644 --- a/src/api/gramjs/apiBuilders/payments.ts +++ b/src/api/gramjs/apiBuilders/payments.ts @@ -1,4 +1,4 @@ -import { Api as GramJs } from '../../../lib/gramjs'; +import type { Api as GramJs } from '../../../lib/gramjs'; export function buildShippingOptions(shippingOptions: GramJs.ShippingOption[] | undefined) { if (!shippingOptions) { diff --git a/src/api/gramjs/apiBuilders/peers.ts b/src/api/gramjs/apiBuilders/peers.ts index 883e332e..fce49190 100644 --- a/src/api/gramjs/apiBuilders/peers.ts +++ b/src/api/gramjs/apiBuilders/peers.ts @@ -1,6 +1,6 @@ -import BigInt from 'big-integer'; +import type BigInt from 'big-integer'; -import { Api as GramJs } from '../../../lib/gramjs'; +import type { Api as GramJs } from '../../../lib/gramjs'; export function isPeerUser(peer: GramJs.TypePeer | GramJs.TypeInputPeer): peer is GramJs.PeerUser { return peer.hasOwnProperty('userId'); diff --git a/src/api/gramjs/apiBuilders/statistics.ts b/src/api/gramjs/apiBuilders/statistics.ts index 90da66b6..0d1ca96c 100644 --- a/src/api/gramjs/apiBuilders/statistics.ts +++ b/src/api/gramjs/apiBuilders/statistics.ts @@ -1,5 +1,5 @@ -import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { Api as GramJs } from '../../../lib/gramjs'; +import type { ApiChannelStatistics, ApiGroupStatistics, ApiMessageStatistics, diff --git a/src/api/gramjs/apiBuilders/symbols.ts b/src/api/gramjs/apiBuilders/symbols.ts index 4c3f3aba..bde29e8c 100644 --- a/src/api/gramjs/apiBuilders/symbols.ts +++ b/src/api/gramjs/apiBuilders/symbols.ts @@ -1,5 +1,5 @@ import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { ApiEmojiInteraction, ApiSticker, ApiStickerSet, GramJsEmojiInteraction, } from '../../types'; import { NO_STICKER_SET_ID } from '../../../config'; diff --git a/src/api/gramjs/apiBuilders/users.ts b/src/api/gramjs/apiBuilders/users.ts index 97046a95..12449de2 100644 --- a/src/api/gramjs/apiBuilders/users.ts +++ b/src/api/gramjs/apiBuilders/users.ts @@ -1,5 +1,5 @@ import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { ApiUser, ApiUserStatus, ApiUserType, } from '../../types'; import { buildApiPeerId } from './peers'; diff --git a/src/api/gramjs/gramjsBuilders/index.ts b/src/api/gramjs/gramjsBuilders/index.ts index 86d7c16f..7900a4e6 100644 --- a/src/api/gramjs/gramjsBuilders/index.ts +++ b/src/api/gramjs/gramjsBuilders/index.ts @@ -1,16 +1,15 @@ import BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; -import { ApiPrivacyKey } from '../../../types'; +import type { ApiPrivacyKey } from '../../../types'; import { generateRandomBytes, readBigIntFromBuffer } from '../../../lib/gramjs/Helpers'; -import { +import type { ApiChatAdminRights, ApiChatBannedRights, ApiChatFolder, ApiGroupCall, ApiMessageEntity, - ApiMessageEntityTypes, ApiNewPoll, ApiPhoto, ApiPhoneCall, @@ -20,6 +19,9 @@ import { ApiVideo, ApiThemeParameters, } from '../../types'; +import { + ApiMessageEntityTypes, +} from '../../types'; import localDb from '../localDb'; import { pick } from '../../../util/iteratees'; import { deserializeBytes } from '../helpers'; diff --git a/src/api/gramjs/localDb.ts b/src/api/gramjs/localDb.ts index 589a5fc9..ccabb12a 100644 --- a/src/api/gramjs/localDb.ts +++ b/src/api/gramjs/localDb.ts @@ -1,5 +1,5 @@ -import { Api as GramJs } from '../../lib/gramjs'; -import { ApiMessage } from '../types'; +import type { Api as GramJs } from '../../lib/gramjs'; +import type { ApiMessage } from '../types'; interface LocalDb { localMessages: Record; diff --git a/src/api/gramjs/methods/account.ts b/src/api/gramjs/methods/account.ts index cc694fa8..61c1bd0c 100644 --- a/src/api/gramjs/methods/account.ts +++ b/src/api/gramjs/methods/account.ts @@ -1,5 +1,5 @@ import BigInt from 'big-integer'; -import { +import type { ApiChat, ApiPhoto, ApiReportReason, ApiUser, } from '../../types'; import { invokeRequest } from './client'; diff --git a/src/api/gramjs/methods/auth.ts b/src/api/gramjs/methods/auth.ts index c65806c4..5375aa55 100644 --- a/src/api/gramjs/methods/auth.ts +++ b/src/api/gramjs/methods/auth.ts @@ -1,5 +1,5 @@ import { errors } from '../../../lib/gramjs'; -import { +import type { ApiUpdateAuthorizationState, ApiUpdateAuthorizationStateType, OnApiUpdate, diff --git a/src/api/gramjs/methods/bots.ts b/src/api/gramjs/methods/bots.ts index fa55173e..f7b7f836 100644 --- a/src/api/gramjs/methods/bots.ts +++ b/src/api/gramjs/methods/bots.ts @@ -1,7 +1,7 @@ import BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; -import { ApiChat, ApiThemeParameters, ApiUser } from '../../types'; +import type { ApiChat, ApiThemeParameters, ApiUser } from '../../types'; import localDb from '../localDb'; import { invokeRequest } from './client'; diff --git a/src/api/gramjs/methods/calls.ts b/src/api/gramjs/methods/calls.ts index 92e7fe04..893ce28b 100644 --- a/src/api/gramjs/methods/calls.ts +++ b/src/api/gramjs/methods/calls.ts @@ -1,6 +1,6 @@ import BigInt from 'big-integer'; import type { JoinGroupCallPayload } from '../../../lib/secret-sauce'; -import { +import type { ApiChat, ApiUser, OnApiUpdate, ApiGroupCall, ApiPhoneCall, } from '../../types'; import { Api as GramJs } from '../../../lib/gramjs'; diff --git a/src/api/gramjs/methods/chats.ts b/src/api/gramjs/methods/chats.ts index 8ce3fb0a..90cf7dd2 100644 --- a/src/api/gramjs/methods/chats.ts +++ b/src/api/gramjs/methods/chats.ts @@ -1,6 +1,6 @@ -import BigInt from 'big-integer'; +import type BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { OnApiUpdate, ApiChat, ApiMessage, diff --git a/src/api/gramjs/methods/client.ts b/src/api/gramjs/methods/client.ts index 430c2e42..0a184493 100644 --- a/src/api/gramjs/methods/client.ts +++ b/src/api/gramjs/methods/client.ts @@ -4,9 +4,9 @@ import { import TelegramClient from '../../../lib/gramjs/client/TelegramClient'; import { Logger as GramJsLogger } from '../../../lib/gramjs/extensions/index'; -import { TwoFaParams } from '../../../lib/gramjs/client/2fa'; +import type { TwoFaParams } from '../../../lib/gramjs/client/2fa'; -import { +import type { ApiInitialArgs, ApiMediaFormat, ApiOnProgress, diff --git a/src/api/gramjs/methods/management.ts b/src/api/gramjs/methods/management.ts index 32231807..d5d230f4 100644 --- a/src/api/gramjs/methods/management.ts +++ b/src/api/gramjs/methods/management.ts @@ -2,7 +2,7 @@ import { Api as GramJs } from '../../../lib/gramjs'; import { invokeRequest } from './client'; import { buildInputEntity, buildInputPeer } from '../gramjsBuilders'; -import { ApiChat, ApiUser, OnApiUpdate } from '../../types'; +import type { ApiChat, ApiUser, OnApiUpdate } from '../../types'; import { addEntitiesWithPhotosToLocalDb } from '../helpers'; import { buildApiExportedInvite, buildChatInviteImporter } from '../apiBuilders/chats'; import { buildApiUser } from '../apiBuilders/users'; diff --git a/src/api/gramjs/methods/media.ts b/src/api/gramjs/methods/media.ts index 68c1dfcf..70983a8b 100644 --- a/src/api/gramjs/methods/media.ts +++ b/src/api/gramjs/methods/media.ts @@ -1,6 +1,8 @@ -import { Api as GramJs, TelegramClient } from '../../../lib/gramjs'; +import type { TelegramClient } from '../../../lib/gramjs'; +import { Api as GramJs } from '../../../lib/gramjs'; +import type { ApiOnProgress, ApiParsedMedia, ApiPreparedMedia } from '../../types'; import { - ApiMediaFormat, ApiOnProgress, ApiParsedMedia, ApiPreparedMedia, + ApiMediaFormat, } from '../../types'; import { diff --git a/src/api/gramjs/methods/messages.ts b/src/api/gramjs/methods/messages.ts index f7fca4e4..17d49ae9 100644 --- a/src/api/gramjs/methods/messages.ts +++ b/src/api/gramjs/methods/messages.ts @@ -1,5 +1,5 @@ import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { ApiAttachment, ApiChat, ApiGlobalMessageSearchType, @@ -13,13 +13,15 @@ import { ApiThreadInfo, ApiUser, ApiVideo, - MAIN_THREAD_ID, - MESSAGE_DELETED, OnApiUpdate, ApiSponsoredMessage, ApiSendMessageAction, ApiContact, } from '../../types'; +import { + MAIN_THREAD_ID, + MESSAGE_DELETED, +} from '../../types'; import { ALL_FOLDER_ID, diff --git a/src/api/gramjs/methods/payments.ts b/src/api/gramjs/methods/payments.ts index 4c2eb8c7..936fef33 100644 --- a/src/api/gramjs/methods/payments.ts +++ b/src/api/gramjs/methods/payments.ts @@ -3,7 +3,7 @@ import { Api as GramJs } from '../../../lib/gramjs'; import { invokeRequest } from './client'; import { buildInputPeer, buildShippingInfo } from '../gramjsBuilders'; import { buildShippingOptions, buildPaymentForm, buildReceipt } from '../apiBuilders/payments'; -import { ApiChat, OnApiUpdate } from '../../types'; +import type { ApiChat, OnApiUpdate } from '../../types'; let onUpdate: OnApiUpdate; diff --git a/src/api/gramjs/methods/reactions.ts b/src/api/gramjs/methods/reactions.ts index a274fcd6..3cbfaa40 100644 --- a/src/api/gramjs/methods/reactions.ts +++ b/src/api/gramjs/methods/reactions.ts @@ -1,4 +1,4 @@ -import { ApiChat, ApiUser } from '../../types'; +import type { ApiChat, ApiUser } from '../../types'; import { invokeRequest } from './client'; import { Api as GramJs } from '../../../lib/gramjs'; import { buildInputPeer } from '../gramjsBuilders'; diff --git a/src/api/gramjs/methods/settings.ts b/src/api/gramjs/methods/settings.ts index 1af6262f..f8200280 100644 --- a/src/api/gramjs/methods/settings.ts +++ b/src/api/gramjs/methods/settings.ts @@ -1,7 +1,7 @@ import BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { ApiAppConfig, ApiChat, ApiLangString, @@ -10,9 +10,10 @@ import { ApiUser, ApiWallpaper, } from '../../types'; -import { ApiPrivacyKey, InputPrivacyRules, LangCode } from '../../../types'; +import type { ApiPrivacyKey, InputPrivacyRules, LangCode } from '../../../types'; -import { BLOCKED_LIST_LIMIT, DEFAULT_LANG_PACK, LANG_PACKS } from '../../../config'; +import type { LANG_PACKS } from '../../../config'; +import { BLOCKED_LIST_LIMIT, DEFAULT_LANG_PACK } from '../../../config'; import { buildApiCountryList, buildApiNotifyException, diff --git a/src/api/gramjs/methods/statistics.ts b/src/api/gramjs/methods/statistics.ts index 3d0b45cf..1501f6ba 100644 --- a/src/api/gramjs/methods/statistics.ts +++ b/src/api/gramjs/methods/statistics.ts @@ -1,7 +1,7 @@ import BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { ApiChat, ApiChannelStatistics, ApiGroupStatistics, ApiMessageStatistics, StatisticsGraph, } from '../../types'; diff --git a/src/api/gramjs/methods/symbols.ts b/src/api/gramjs/methods/symbols.ts index 1ed7224e..6d1f736b 100644 --- a/src/api/gramjs/methods/symbols.ts +++ b/src/api/gramjs/methods/symbols.ts @@ -1,6 +1,6 @@ import BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; -import { ApiSticker, ApiVideo, OnApiUpdate } from '../../types'; +import type { ApiSticker, ApiVideo, OnApiUpdate } from '../../types'; import { invokeRequest } from './client'; import { buildStickerFromDocument, buildStickerSet, buildStickerSetCovered } from '../apiBuilders/symbols'; diff --git a/src/api/gramjs/methods/twoFaSettings.ts b/src/api/gramjs/methods/twoFaSettings.ts index 9a49a7a5..52ddd22f 100644 --- a/src/api/gramjs/methods/twoFaSettings.ts +++ b/src/api/gramjs/methods/twoFaSettings.ts @@ -1,6 +1,6 @@ import { Api as GramJs, errors } from '../../../lib/gramjs'; -import { OnApiUpdate } from '../../types'; +import type { OnApiUpdate } from '../../types'; import { DEBUG } from '../../../config'; import { invokeRequest, updateTwoFaSettings } from './client'; diff --git a/src/api/gramjs/methods/types.ts b/src/api/gramjs/methods/types.ts index 5665bb64..caa7be23 100644 --- a/src/api/gramjs/methods/types.ts +++ b/src/api/gramjs/methods/types.ts @@ -1,4 +1,4 @@ -import * as methods from './index'; +import type * as methods from './index'; export type Methods = typeof methods; export type MethodArgs = Parameters; diff --git a/src/api/gramjs/methods/users.ts b/src/api/gramjs/methods/users.ts index dafde583..647063b3 100644 --- a/src/api/gramjs/methods/users.ts +++ b/src/api/gramjs/methods/users.ts @@ -1,6 +1,6 @@ import BigInt from 'big-integer'; import { Api as GramJs } from '../../../lib/gramjs'; -import { +import type { OnApiUpdate, ApiUser, ApiChat, ApiPhoto, } from '../../types'; diff --git a/src/api/gramjs/provider.ts b/src/api/gramjs/provider.ts index de5ab435..08cae296 100644 --- a/src/api/gramjs/provider.ts +++ b/src/api/gramjs/provider.ts @@ -1,10 +1,10 @@ -import { +import type { OnApiUpdate, ApiInitialArgs, ApiUpdate, ApiOnProgress, } from '../types'; -import { Methods, MethodArgs, MethodResponse } from './methods/types'; +import type { Methods, MethodArgs, MethodResponse } from './methods/types'; import { API_THROTTLE_RESET_UPDATES, API_UPDATE_THROTTLE } from '../../config'; import { throttle, throttleWithTickEnd } from '../../util/schedulers'; diff --git a/src/api/gramjs/updater.ts b/src/api/gramjs/updater.ts index 293d3e9d..60475114 100644 --- a/src/api/gramjs/updater.ts +++ b/src/api/gramjs/updater.ts @@ -1,6 +1,6 @@ import type { GroupCallConnectionData } from '../../lib/secret-sauce'; import { Api as GramJs, connection } from '../../lib/gramjs'; -import { ApiMessage, ApiUpdateConnectionStateType, OnApiUpdate } from '../types'; +import type { ApiMessage, ApiUpdateConnectionStateType, OnApiUpdate } from '../types'; import { pick } from '../../util/iteratees'; import { diff --git a/src/api/gramjs/worker/provider.ts b/src/api/gramjs/worker/provider.ts index 7f02ee8c..f89bf9be 100644 --- a/src/api/gramjs/worker/provider.ts +++ b/src/api/gramjs/worker/provider.ts @@ -1,7 +1,7 @@ -import { Api } from '../../../lib/gramjs'; -import { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types'; -import { Methods, MethodArgs, MethodResponse } from '../methods/types'; -import { WorkerMessageEvent, OriginRequest } from './types'; +import type { Api } from '../../../lib/gramjs'; +import type { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types'; +import type { Methods, MethodArgs, MethodResponse } from '../methods/types'; +import type { WorkerMessageEvent, OriginRequest } from './types'; import { DEBUG } from '../../../config'; import generateIdFor from '../../../util/generateIdFor'; diff --git a/src/api/gramjs/worker/types.ts b/src/api/gramjs/worker/types.ts index 6200c399..68324216 100644 --- a/src/api/gramjs/worker/types.ts +++ b/src/api/gramjs/worker/types.ts @@ -1,5 +1,5 @@ -import { ApiInitialArgs, ApiUpdate } from '../../types'; -import { Methods, MethodArgs, MethodResponse } from '../methods/types'; +import type { ApiInitialArgs, ApiUpdate } from '../../types'; +import type { Methods, MethodArgs, MethodResponse } from '../methods/types'; export type ThenArg = T extends Promise ? U : T; diff --git a/src/api/gramjs/worker/worker.ts b/src/api/gramjs/worker/worker.ts index 87072e40..25b1345f 100644 --- a/src/api/gramjs/worker/worker.ts +++ b/src/api/gramjs/worker/worker.ts @@ -1,5 +1,5 @@ -import { ApiOnProgress, ApiUpdate } from '../../types'; -import { OriginMessageEvent, WorkerMessageData } from './types'; +import type { ApiOnProgress, ApiUpdate } from '../../types'; +import type { OriginMessageEvent, WorkerMessageData } from './types'; import { DEBUG } from '../../../config'; import { initApi, callApi, cancelApiProgress } from '../provider'; diff --git a/src/api/types/bots.ts b/src/api/types/bots.ts index c5166c8e..13a54c40 100644 --- a/src/api/types/bots.ts +++ b/src/api/types/bots.ts @@ -1,4 +1,4 @@ -import { +import type { ApiPhoto, ApiSticker, ApiThumbnail, ApiVideo, } from './messages'; diff --git a/src/api/types/chats.ts b/src/api/types/chats.ts index 5941b531..4443488a 100644 --- a/src/api/types/chats.ts +++ b/src/api/types/chats.ts @@ -1,7 +1,7 @@ -import { ApiMessage, ApiPhoto, ApiStickerSet } from './messages'; -import { ApiBotCommand } from './bots'; -import { ApiChatInviteImporter } from './misc'; -import { ApiFakeType } from './users'; +import type { ApiMessage, ApiPhoto, ApiStickerSet } from './messages'; +import type { ApiBotCommand } from './bots'; +import type { ApiChatInviteImporter } from './misc'; +import type { ApiFakeType } from './users'; type ApiChatType = ( 'chatTypePrivate' | 'chatTypeSecret' | diff --git a/src/api/types/messages.ts b/src/api/types/messages.ts index 479e64b1..921c0ffb 100644 --- a/src/api/types/messages.ts +++ b/src/api/types/messages.ts @@ -1,4 +1,4 @@ -import { ApiGroupCall, PhoneCallAction } from './calls'; +import type { ApiGroupCall, PhoneCallAction } from './calls'; export interface ApiDimensions { width: number; diff --git a/src/api/types/misc.ts b/src/api/types/misc.ts index 37e98f87..0edc5441 100644 --- a/src/api/types/misc.ts +++ b/src/api/types/misc.ts @@ -1,4 +1,4 @@ -import { ApiDocument, ApiPhoto } from './messages'; +import type { ApiDocument, ApiPhoto } from './messages'; export interface ApiInitialArgs { userAgent: string; diff --git a/src/api/types/statistics.ts b/src/api/types/statistics.ts index 443970fd..34c6a5a4 100644 --- a/src/api/types/statistics.ts +++ b/src/api/types/statistics.ts @@ -1,4 +1,4 @@ -import { ApiMessage } from './messages'; +import type { ApiMessage } from './messages'; export interface ApiChannelStatistics { growthGraph?: StatisticsGraph | string; diff --git a/src/api/types/updates.ts b/src/api/types/updates.ts index eaf0f3b3..dc43c88a 100644 --- a/src/api/types/updates.ts +++ b/src/api/types/updates.ts @@ -5,24 +5,24 @@ import type { VideoState, VideoRotation, } from '../../lib/secret-sauce'; -import { +import type { ApiChat, ApiChatFullInfo, ApiTypingStatus, ApiChatMember, ApiChatFolder, } from './chats'; -import { +import type { ApiFormattedText, ApiMessage, ApiPhoto, ApiPoll, ApiReactions, ApiStickerSet, ApiThreadInfo, } from './messages'; -import { ApiUser, ApiUserFullInfo, ApiUserStatus } from './users'; -import { +import type { ApiUser, ApiUserFullInfo, ApiUserStatus } from './users'; +import type { ApiEmojiInteraction, ApiError, ApiInviteInfo, ApiNotifyException, ApiSessionData, } from './misc'; -import { +import type { ApiGroupCall, ApiPhoneCall, } from './calls'; -import { ApiBotMenuButton } from './bots'; +import type { ApiBotMenuButton } from './bots'; import type { ApiPrivacyKey, PrivacyVisibility } from '../../types'; export type ApiUpdateReady = { diff --git a/src/api/types/users.ts b/src/api/types/users.ts index e5e213ac..2e36fdcb 100644 --- a/src/api/types/users.ts +++ b/src/api/types/users.ts @@ -1,5 +1,5 @@ -import { ApiDocument, ApiPhoto } from './messages'; -import { ApiBotInfo } from './bots'; +import type { ApiDocument, ApiPhoto } from './messages'; +import type { ApiBotInfo } from './bots'; export interface ApiUser { id: string; diff --git a/src/components/auth/Auth.tsx b/src/components/auth/Auth.tsx index fe9e0c59..bc8c83bc 100644 --- a/src/components/auth/Auth.tsx +++ b/src/components/auth/Auth.tsx @@ -1,7 +1,8 @@ -import React, { FC, useEffect, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useEffect, memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; +import type { GlobalState } from '../../global/types'; import '../../global/actions/initial'; import { pick } from '../../util/iteratees'; diff --git a/src/components/auth/AuthCode.async.tsx b/src/components/auth/AuthCode.async.tsx index 54458e94..d18bbcdc 100644 --- a/src/components/auth/AuthCode.async.tsx +++ b/src/components/auth/AuthCode.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/auth/AuthCode.tsx b/src/components/auth/AuthCode.tsx index 904fd0f7..6f50fe29 100644 --- a/src/components/auth/AuthCode.tsx +++ b/src/components/auth/AuthCode.tsx @@ -1,9 +1,10 @@ -import { FormEvent } from 'react'; +import type { FormEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useState, useEffect, useCallback, memo, useRef, + useState, useEffect, useCallback, memo, useRef, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; +import type { GlobalState } from '../../global/types'; import { IS_TOUCH_ENV } from '../../util/environment'; import { pick } from '../../util/iteratees'; diff --git a/src/components/auth/AuthPassword.async.tsx b/src/components/auth/AuthPassword.async.tsx index d7b5d20a..a4701a87 100644 --- a/src/components/auth/AuthPassword.async.tsx +++ b/src/components/auth/AuthPassword.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/auth/AuthPassword.tsx b/src/components/auth/AuthPassword.tsx index f704b1d3..627736b2 100644 --- a/src/components/auth/AuthPassword.tsx +++ b/src/components/auth/AuthPassword.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useState, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback, useState } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; +import type { GlobalState } from '../../global/types'; import { pick } from '../../util/iteratees'; import useLang from '../../hooks/useLang'; diff --git a/src/components/auth/AuthPhoneNumber.tsx b/src/components/auth/AuthPhoneNumber.tsx index fa9022ae..f8ffaed3 100644 --- a/src/components/auth/AuthPhoneNumber.tsx +++ b/src/components/auth/AuthPhoneNumber.tsx @@ -1,15 +1,16 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; import monkeyPath from '../../assets/monkey.svg'; +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState, + memo, useCallback, useEffect, useLayoutEffect, useRef, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; -import { LangCode } from '../../types'; -import { ApiCountryCode } from '../../api/types'; +import type { GlobalState } from '../../global/types'; +import type { LangCode } from '../../types'; +import type { ApiCountryCode } from '../../api/types'; import { IS_SAFARI, IS_TOUCH_ENV } from '../../util/environment'; import { preloadImage } from '../../util/files'; diff --git a/src/components/auth/AuthQrCode.tsx b/src/components/auth/AuthQrCode.tsx index 9b324759..2b82000d 100644 --- a/src/components/auth/AuthQrCode.tsx +++ b/src/components/auth/AuthQrCode.tsx @@ -1,11 +1,12 @@ import QrCodeStyling from 'qr-code-styling'; +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useEffect, useRef, memo, useCallback, useState, + useEffect, useRef, memo, useCallback, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; -import { LangCode } from '../../types'; +import type { GlobalState } from '../../global/types'; +import type { LangCode } from '../../types'; import { DEFAULT_LANG_CODE } from '../../config'; import { setLanguage } from '../../util/langProvider'; diff --git a/src/components/auth/AuthRegister.async.tsx b/src/components/auth/AuthRegister.async.tsx index 50512d04..c184e981 100644 --- a/src/components/auth/AuthRegister.async.tsx +++ b/src/components/auth/AuthRegister.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/auth/AuthRegister.tsx b/src/components/auth/AuthRegister.tsx index 4b50e7cc..af96a15c 100644 --- a/src/components/auth/AuthRegister.tsx +++ b/src/components/auth/AuthRegister.tsx @@ -1,10 +1,9 @@ -import { ChangeEvent } from 'react'; -import React, { - FC, useState, memo, useCallback, -} from '../../lib/teact/teact'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { useState, memo, useCallback } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; +import type { GlobalState } from '../../global/types'; import { pick } from '../../util/iteratees'; import useLang from '../../hooks/useLang'; diff --git a/src/components/auth/CountryCodeInput.tsx b/src/components/auth/CountryCodeInput.tsx index 943eb1c1..67a29935 100644 --- a/src/components/auth/CountryCodeInput.tsx +++ b/src/components/auth/CountryCodeInput.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useState, memo, useCallback, useRef, + useState, memo, useCallback, useRef, } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; -import { ApiCountryCode } from '../../api/types'; +import type { ApiCountryCode } from '../../api/types'; import { ANIMATION_END_DELAY } from '../../config'; import { prepareSearchWordsForNeedle } from '../../util/searchWords'; diff --git a/src/components/auth/helpers/getSuggestedLanguage.ts b/src/components/auth/helpers/getSuggestedLanguage.ts index 66a0bc32..4c93a9e8 100644 --- a/src/components/auth/helpers/getSuggestedLanguage.ts +++ b/src/components/auth/helpers/getSuggestedLanguage.ts @@ -1,4 +1,4 @@ -import { LangCode } from '../../../types'; +import type { LangCode } from '../../../types'; export function getSuggestedLanguage() { let suggestedLanguage = navigator.language; diff --git a/src/components/calls/ActiveCallHeader.async.tsx b/src/components/calls/ActiveCallHeader.async.tsx index 30d74dd3..64188919 100644 --- a/src/components/calls/ActiveCallHeader.async.tsx +++ b/src/components/calls/ActiveCallHeader.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import useModuleLoader from '../../hooks/useModuleLoader'; import { Bundles } from '../../util/moduleLoader'; diff --git a/src/components/calls/ActiveCallHeader.tsx b/src/components/calls/ActiveCallHeader.tsx index 54c68a58..a6b3df18 100644 --- a/src/components/calls/ActiveCallHeader.tsx +++ b/src/components/calls/ActiveCallHeader.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useEffect, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useEffect } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiGroupCall, ApiUser } from '../../api/types'; +import type { ApiGroupCall, ApiUser } from '../../api/types'; import { selectActiveGroupCall, selectPhoneCallUser } from '../../global/selectors/calls'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/calls/group/GroupCall.async.tsx b/src/components/calls/group/GroupCall.async.tsx index 1317e420..cce3ced7 100644 --- a/src/components/calls/group/GroupCall.async.tsx +++ b/src/components/calls/group/GroupCall.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import useModuleLoader from '../../../hooks/useModuleLoader'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './GroupCall'; +import type { OwnProps } from './GroupCall'; const GroupCallAsync: FC = (props) => { const { groupCallId } = props; diff --git a/src/components/calls/group/GroupCall.tsx b/src/components/calls/group/GroupCall.tsx index 4e00c2fd..5c23ccc0 100644 --- a/src/components/calls/group/GroupCall.tsx +++ b/src/components/calls/group/GroupCall.tsx @@ -1,14 +1,17 @@ -import { +import type { GroupCallConnectionState, GroupCallParticipant as TypeGroupCallParticipant, +} from '../../../lib/secret-sauce'; +import { IS_SCREENSHARE_SUPPORTED, switchCameraInput, toggleSpeaker, } from '../../../lib/secret-sauce'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useRef, useState, + memo, useCallback, useEffect, useMemo, useRef, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import '../../../global/actions/calls'; -import { IAnchorPosition } from '../../../types'; +import type { IAnchorPosition } from '../../../types'; import { IS_ANDROID, diff --git a/src/components/calls/group/GroupCallParticipant.tsx b/src/components/calls/group/GroupCallParticipant.tsx index 8809b991..d1b10c89 100644 --- a/src/components/calls/group/GroupCallParticipant.tsx +++ b/src/components/calls/group/GroupCallParticipant.tsx @@ -1,10 +1,10 @@ -import { GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce'; -import React, { - FC, memo, useMemo, useRef, -} from '../../../lib/teact/teact'; +import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce'; +import { THRESHOLD } from '../../../lib/secret-sauce'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useMemo, useRef } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; -import { ApiChat, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiUser } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import { selectChat, selectUser } from '../../../global/selectors'; diff --git a/src/components/calls/group/GroupCallParticipantList.tsx b/src/components/calls/group/GroupCallParticipantList.tsx index db20af06..ff5c54bf 100644 --- a/src/components/calls/group/GroupCallParticipantList.tsx +++ b/src/components/calls/group/GroupCallParticipantList.tsx @@ -1,5 +1,6 @@ -import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce'; -import React, { FC, memo, useMemo } from '../../../lib/teact/teact'; +import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useMemo } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/calls/group/GroupCallParticipantMenu.tsx b/src/components/calls/group/GroupCallParticipantMenu.tsx index f1621dcd..bbe6d9ec 100644 --- a/src/components/calls/group/GroupCallParticipantMenu.tsx +++ b/src/components/calls/group/GroupCallParticipantMenu.tsx @@ -1,10 +1,11 @@ -import { GroupCallParticipant } from '../../../lib/secret-sauce'; +import type { GroupCallParticipant } from '../../../lib/secret-sauce'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useState, + memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { IAnchorPosition } from '../../../types'; +import type { IAnchorPosition } from '../../../types'; import buildClassName from '../../../util/buildClassName'; import useRunThrottled from '../../../hooks/useRunThrottled'; diff --git a/src/components/calls/group/GroupCallParticipantStreams.tsx b/src/components/calls/group/GroupCallParticipantStreams.tsx index c7570a05..d3c84210 100644 --- a/src/components/calls/group/GroupCallParticipantStreams.tsx +++ b/src/components/calls/group/GroupCallParticipantStreams.tsx @@ -1,6 +1,7 @@ -import { GroupCallParticipant } from '../../../lib/secret-sauce'; +import type { GroupCallParticipant } from '../../../lib/secret-sauce'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useState, + memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; import GroupCallParticipantVideo from './GroupCallParticipantVideo'; diff --git a/src/components/calls/group/GroupCallParticipantVideo.tsx b/src/components/calls/group/GroupCallParticipantVideo.tsx index dbf6ed1b..8314c619 100644 --- a/src/components/calls/group/GroupCallParticipantVideo.tsx +++ b/src/components/calls/group/GroupCallParticipantVideo.tsx @@ -1,8 +1,10 @@ -import { getUserStreams, GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce'; -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce'; +import { getUserStreams, THRESHOLD } from '../../../lib/secret-sauce'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; -import { ApiChat, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiUser } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import { selectChat, selectUser } from '../../../global/selectors'; diff --git a/src/components/calls/group/GroupCallTopPane.tsx b/src/components/calls/group/GroupCallTopPane.tsx index 0696b237..0bb954b1 100644 --- a/src/components/calls/group/GroupCallTopPane.tsx +++ b/src/components/calls/group/GroupCallTopPane.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, + memo, useCallback, useEffect, useMemo, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiGroupCall, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiGroupCall, ApiUser } from '../../../api/types'; import { selectChatGroupCall } from '../../../global/selectors/calls'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/calls/group/MicrophoneButton.tsx b/src/components/calls/group/MicrophoneButton.tsx index 73b7ba14..16b64917 100644 --- a/src/components/calls/group/MicrophoneButton.tsx +++ b/src/components/calls/group/MicrophoneButton.tsx @@ -1,6 +1,7 @@ -import { GroupCallConnectionState } from '../../../lib/secret-sauce'; +import type { GroupCallConnectionState } from '../../../lib/secret-sauce'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useEffect, useMemo, useRef, useState, + memo, useEffect, useMemo, useRef, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; diff --git a/src/components/calls/group/OutlinedMicrophoneIcon.tsx b/src/components/calls/group/OutlinedMicrophoneIcon.tsx index 9033e8bb..9be3abcd 100644 --- a/src/components/calls/group/OutlinedMicrophoneIcon.tsx +++ b/src/components/calls/group/OutlinedMicrophoneIcon.tsx @@ -1,5 +1,7 @@ -import { GroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce'; -import React, { FC, memo, useMemo } from '../../../lib/teact/teact'; +import type { GroupCallParticipant } from '../../../lib/secret-sauce'; +import { THRESHOLD } from '../../../lib/secret-sauce'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useMemo } from '../../../lib/teact/teact'; import AnimatedIcon from '../../common/AnimatedIcon'; import usePrevious from '../../../hooks/usePrevious'; diff --git a/src/components/calls/phone/PhoneCall.async.tsx b/src/components/calls/phone/PhoneCall.async.tsx index 9122e5e9..ff25cb96 100644 --- a/src/components/calls/phone/PhoneCall.async.tsx +++ b/src/components/calls/phone/PhoneCall.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import useModuleLoader from '../../../hooks/useModuleLoader'; import { Bundles } from '../../../util/moduleLoader'; diff --git a/src/components/calls/phone/PhoneCall.tsx b/src/components/calls/phone/PhoneCall.tsx index d8edf20f..d9e6e2b2 100644 --- a/src/components/calls/phone/PhoneCall.tsx +++ b/src/components/calls/phone/PhoneCall.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useRef, + memo, useCallback, useEffect, useMemo, useRef, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import '../../../global/actions/calls'; -import { ApiPhoneCall, ApiUser } from '../../../api/types'; +import type { ApiPhoneCall, ApiUser } from '../../../api/types'; import { IS_ANDROID, diff --git a/src/components/calls/phone/PhoneCallButton.tsx b/src/components/calls/phone/PhoneCallButton.tsx index 050b744a..dc71d42e 100644 --- a/src/components/calls/phone/PhoneCallButton.tsx +++ b/src/components/calls/phone/PhoneCallButton.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/calls/phone/RatePhoneCallModal.async.tsx b/src/components/calls/phone/RatePhoneCallModal.async.tsx index 14dae153..16cffa14 100644 --- a/src/components/calls/phone/RatePhoneCallModal.async.tsx +++ b/src/components/calls/phone/RatePhoneCallModal.async.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; -import { OwnProps } from './RatePhoneCallModal'; +import type { OwnProps } from './RatePhoneCallModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/calls/phone/RatePhoneCallModal.tsx b/src/components/calls/phone/RatePhoneCallModal.tsx index e4a92207..80a9da9d 100644 --- a/src/components/calls/phone/RatePhoneCallModal.tsx +++ b/src/components/calls/phone/RatePhoneCallModal.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useRef, useState, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useRef, useState } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/common/AnimatedEmoji.tsx b/src/components/common/AnimatedEmoji.tsx index bfb9e778..2c128e37 100644 --- a/src/components/common/AnimatedEmoji.tsx +++ b/src/components/common/AnimatedEmoji.tsx @@ -1,12 +1,13 @@ -import React, { - FC, memo, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; -import { ApiMediaFormat, ApiSticker } from '../../api/types'; -import { ActiveEmojiInteraction } from '../../global/types'; +import type { ApiSticker } from '../../api/types'; +import { ApiMediaFormat } from '../../api/types'; +import type { ActiveEmojiInteraction } from '../../global/types'; import buildClassName from '../../util/buildClassName'; -import { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; import useMedia from '../../hooks/useMedia'; import useMediaTransition from '../../hooks/useMediaTransition'; import useAnimatedEmoji from './hooks/useAnimatedEmoji'; diff --git a/src/components/common/AnimatedIcon.tsx b/src/components/common/AnimatedIcon.tsx index 3f4125ff..73eeec7d 100644 --- a/src/components/common/AnimatedIcon.tsx +++ b/src/components/common/AnimatedIcon.tsx @@ -1,8 +1,8 @@ -import React, { - FC, memo, useEffect, useState, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useEffect, useState } from '../../lib/teact/teact'; -import getAnimationData, { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets'; +import type { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets'; +import getAnimationData from './helpers/animatedAssets'; import AnimatedSticker from './AnimatedSticker'; diff --git a/src/components/common/AnimatedSticker.tsx b/src/components/common/AnimatedSticker.tsx index fbfdce78..cc8a2b95 100644 --- a/src/components/common/AnimatedSticker.tsx +++ b/src/components/common/AnimatedSticker.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useEffect, useRef, memo, useCallback, useState, + useEffect, useRef, memo, useCallback, useState, } from '../../lib/teact/teact'; import { fastRaf } from '../../util/schedulers'; diff --git a/src/components/common/Audio.tsx b/src/components/common/Audio.tsx index d960335b..ff0b9641 100644 --- a/src/components/common/Audio.tsx +++ b/src/components/common/Audio.tsx @@ -1,12 +1,13 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, + memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from '../../lib/teact/teact'; import { getActions } from '../../global'; -import { - ApiAudio, ApiMediaFormat, ApiMessage, ApiVoice, -} from '../../api/types'; -import { AudioOrigin, ISettings } from '../../types'; +import type { ApiAudio, ApiMessage, ApiVoice } from '../../api/types'; +import { ApiMediaFormat } from '../../api/types'; +import type { ISettings } from '../../types'; +import { AudioOrigin } from '../../types'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; import { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dateFormat'; @@ -25,9 +26,11 @@ import { getFileSizeString } from './helpers/documentInfo'; import { decodeWaveform, interpolateArray } from '../../util/waveform'; import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress'; import useShowTransition from '../../hooks/useShowTransition'; -import useBuffering, { BufferedRange } from '../../hooks/useBuffering'; +import type { BufferedRange } from '../../hooks/useBuffering'; +import useBuffering from '../../hooks/useBuffering'; import useAudioPlayer from '../../hooks/useAudioPlayer'; -import useLang, { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useLang'; +import useLang from '../../hooks/useLang'; import { captureEvents } from '../../util/captureEvents'; import useMedia from '../../hooks/useMedia'; import { makeTrackId } from '../../util/audioPlayer'; diff --git a/src/components/common/Avatar.tsx b/src/components/common/Avatar.tsx index 41441f8f..fecb2bb9 100644 --- a/src/components/common/Avatar.tsx +++ b/src/components/common/Avatar.tsx @@ -1,11 +1,11 @@ -import { MouseEvent as ReactMouseEvent } from 'react'; -import React, { - FC, memo, TeactNode, useCallback, -} from '../../lib/teact/teact'; +import type { MouseEvent as ReactMouseEvent } from 'react'; +import type { FC, TeactNode } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; -import { - ApiChat, ApiMediaFormat, ApiPhoto, ApiUser, ApiUserStatus, +import type { + ApiChat, ApiPhoto, ApiUser, ApiUserStatus, } from '../../api/types'; +import { ApiMediaFormat } from '../../api/types'; import { IS_TEST } from '../../config'; import { diff --git a/src/components/common/CalendarModal.async.tsx b/src/components/common/CalendarModal.async.tsx index b740bc14..8193e1f6 100644 --- a/src/components/common/CalendarModal.async.tsx +++ b/src/components/common/CalendarModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './CalendarModal'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './CalendarModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/common/CalendarModal.tsx b/src/components/common/CalendarModal.tsx index 7dbe6771..2b73a7d1 100644 --- a/src/components/common/CalendarModal.tsx +++ b/src/components/common/CalendarModal.tsx @@ -1,10 +1,12 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useState, useEffect, useMemo, useCallback, + memo, useState, useEffect, useMemo, useCallback, } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import { formatTime, formatDateToString, getDayStart } from '../../util/dateFormat'; -import useLang, { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useLang'; +import useLang from '../../hooks/useLang'; import usePrevious from '../../hooks/usePrevious'; import useFlag from '../../hooks/useFlag'; diff --git a/src/components/common/ChatExtra.tsx b/src/components/common/ChatExtra.tsx index ce9d84b5..3244eb95 100644 --- a/src/components/common/ChatExtra.tsx +++ b/src/components/common/ChatExtra.tsx @@ -1,10 +1,9 @@ -import React, { - FC, memo, useCallback, useEffect, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; -import { ApiChat, ApiCountryCode, ApiUser } from '../../api/types'; +import type { GlobalState } from '../../global/types'; +import type { ApiChat, ApiCountryCode, ApiUser } from '../../api/types'; import { selectChat, selectNotifyExceptions, selectNotifySettings, selectUser, diff --git a/src/components/common/ChatLink.tsx b/src/components/common/ChatLink.tsx index 559348c9..c7dd59f4 100644 --- a/src/components/common/ChatLink.tsx +++ b/src/components/common/ChatLink.tsx @@ -1,4 +1,5 @@ -import React, { FC, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback } from '../../lib/teact/teact'; import { getActions } from '../../global'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/common/ChatOrUserPicker.tsx b/src/components/common/ChatOrUserPicker.tsx index 00ba0dcf..8b0d2d77 100644 --- a/src/components/common/ChatOrUserPicker.tsx +++ b/src/components/common/ChatOrUserPicker.tsx @@ -1,7 +1,6 @@ -import { RefObject } from 'react'; -import React, { - FC, memo, useRef, useCallback, -} from '../../lib/teact/teact'; +import type { RefObject } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useRef, useCallback } from '../../lib/teact/teact'; import { CHAT_HEIGHT_PX } from '../../config'; import useInfiniteScroll from '../../hooks/useInfiniteScroll'; diff --git a/src/components/common/DeleteChatModal.tsx b/src/components/common/DeleteChatModal.tsx index 7024cc78..c248ac17 100644 --- a/src/components/common/DeleteChatModal.tsx +++ b/src/components/common/DeleteChatModal.tsx @@ -1,7 +1,8 @@ -import React, { FC, useCallback, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback, memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiChat } from '../../api/types'; +import type { ApiChat } from '../../api/types'; import { selectIsChatWithSelf, selectUser } from '../../global/selectors'; import { diff --git a/src/components/common/DeleteMessageModal.async.tsx b/src/components/common/DeleteMessageModal.async.tsx index 4748f6bb..c982101a 100644 --- a/src/components/common/DeleteMessageModal.async.tsx +++ b/src/components/common/DeleteMessageModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './DeleteMessageModal'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './DeleteMessageModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/common/DeleteMessageModal.tsx b/src/components/common/DeleteMessageModal.tsx index 35255e50..3463df8e 100644 --- a/src/components/common/DeleteMessageModal.tsx +++ b/src/components/common/DeleteMessageModal.tsx @@ -1,8 +1,9 @@ -import React, { FC, useCallback, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback, memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiMessage } from '../../api/types'; -import { IAlbum } from '../../types'; +import type { ApiMessage } from '../../api/types'; +import type { IAlbum } from '../../types'; import { selectAllowedMessageActions, diff --git a/src/components/common/Document.tsx b/src/components/common/Document.tsx index 71fe9bb9..94dd3337 100644 --- a/src/components/common/Document.tsx +++ b/src/components/common/Document.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, memo, useRef, useEffect, useState, + useCallback, memo, useRef, useEffect, useState, } from '../../lib/teact/teact'; import { getActions } from '../../global'; -import { ApiMessage } from '../../api/types'; +import type { ApiMessage } from '../../api/types'; import { getDocumentExtension, getDocumentHasPreview } from './helpers/documentInfo'; import { @@ -12,7 +13,8 @@ import { getMessageMediaThumbDataUri, isMessageDocumentVideo, } from '../../global/helpers'; -import { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress'; import useMedia from '../../hooks/useMedia'; import useFlag from '../../hooks/useFlag'; diff --git a/src/components/common/DotAnimation.tsx b/src/components/common/DotAnimation.tsx index 3c6f297a..9a48723c 100644 --- a/src/components/common/DotAnimation.tsx +++ b/src/components/common/DotAnimation.tsx @@ -1,4 +1,5 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import useLang from '../../hooks/useLang'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/common/EmbeddedMessage.tsx b/src/components/common/EmbeddedMessage.tsx index 0c56afa1..70e18e3b 100644 --- a/src/components/common/EmbeddedMessage.tsx +++ b/src/components/common/EmbeddedMessage.tsx @@ -1,6 +1,7 @@ -import React, { FC, useRef } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useRef } from '../../lib/teact/teact'; -import { ApiUser, ApiMessage, ApiChat } from '../../api/types'; +import type { ApiUser, ApiMessage, ApiChat } from '../../api/types'; import { getMessageMediaHash, @@ -11,7 +12,8 @@ import { import renderText from './helpers/renderText'; import { getPictogramDimensions } from './helpers/mediaDimensions'; import buildClassName from '../../util/buildClassName'; -import { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; import useMedia from '../../hooks/useMedia'; import useWebpThumbnail from '../../hooks/useWebpThumbnail'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/FakeIcon.tsx b/src/components/common/FakeIcon.tsx index 9ff249a8..3298857a 100644 --- a/src/components/common/FakeIcon.tsx +++ b/src/components/common/FakeIcon.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; -import { ApiFakeType } from '../../api/types'; +import type { ApiFakeType } from '../../api/types'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/File.tsx b/src/components/common/File.tsx index 9cbf9972..824d1004 100644 --- a/src/components/common/File.tsx +++ b/src/components/common/File.tsx @@ -1,5 +1,6 @@ -import { RefObject } from 'react'; -import React, { FC, memo, useRef } from '../../lib/teact/teact'; +import type { RefObject } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useRef } from '../../lib/teact/teact'; import useShowTransition from '../../hooks/useShowTransition'; import useMediaTransition from '../../hooks/useMediaTransition'; diff --git a/src/components/common/GifButton.tsx b/src/components/common/GifButton.tsx index e2ff0b00..8fac7f1a 100644 --- a/src/components/common/GifButton.tsx +++ b/src/components/common/GifButton.tsx @@ -1,12 +1,15 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../lib/teact/teact'; -import { ApiMediaFormat, ApiVideo } from '../../api/types'; +import type { ApiVideo } from '../../api/types'; +import { ApiMediaFormat } from '../../api/types'; import { IS_TOUCH_ENV } from '../../util/environment'; import buildClassName from '../../util/buildClassName'; -import { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; import { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur'; import useMedia from '../../hooks/useMedia'; diff --git a/src/components/common/GroupCallLink.tsx b/src/components/common/GroupCallLink.tsx index 2aefc296..3f281368 100644 --- a/src/components/common/GroupCallLink.tsx +++ b/src/components/common/GroupCallLink.tsx @@ -1,6 +1,7 @@ -import React, { FC, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback } from '../../lib/teact/teact'; -import { ApiGroupCall } from '../../api/types'; +import type { ApiGroupCall } from '../../api/types'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/common/GroupChatInfo.tsx b/src/components/common/GroupChatInfo.tsx index c83df575..3e1fa557 100644 --- a/src/components/common/GroupChatInfo.tsx +++ b/src/components/common/GroupChatInfo.tsx @@ -1,11 +1,10 @@ -import { MouseEvent as ReactMouseEvent } from 'react'; -import React, { - FC, useEffect, useCallback, memo, -} from '../../lib/teact/teact'; +import type { MouseEvent as ReactMouseEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { useEffect, useCallback, memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiChat, ApiTypingStatus } from '../../api/types'; -import { GlobalState } from '../../global/types'; +import type { ApiChat, ApiTypingStatus } from '../../api/types'; +import type { GlobalState } from '../../global/types'; import { MediaViewerOrigin } from '../../types'; import { @@ -15,7 +14,8 @@ import { } from '../../global/helpers'; import { selectChat, selectChatMessages, selectChatOnlineCount } from '../../global/selectors'; import renderText from './helpers/renderText'; -import useLang, { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useLang'; +import useLang from '../../hooks/useLang'; import Avatar from './Avatar'; import VerifiedIcon from './VerifiedIcon'; diff --git a/src/components/common/LastMessageMeta.tsx b/src/components/common/LastMessageMeta.tsx index 87e85f85..a54c38ff 100644 --- a/src/components/common/LastMessageMeta.tsx +++ b/src/components/common/LastMessageMeta.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; -import { ApiMessage, ApiMessageOutgoingStatus } from '../../api/types'; +import type { ApiMessage, ApiMessageOutgoingStatus } from '../../api/types'; import { formatPastTimeShort } from '../../util/dateFormat'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/LocalAnimatedEmoji.tsx b/src/components/common/LocalAnimatedEmoji.tsx index 3f4dda69..f2812c02 100644 --- a/src/components/common/LocalAnimatedEmoji.tsx +++ b/src/components/common/LocalAnimatedEmoji.tsx @@ -1,11 +1,12 @@ -import React, { - FC, memo, useEffect, useState, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useEffect, useState } from '../../lib/teact/teact'; -import { ActiveEmojiInteraction } from '../../global/types'; +import type { ActiveEmojiInteraction } from '../../global/types'; -import { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver'; -import getAnimationData, { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; +import type { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets'; +import getAnimationData from './helpers/animatedAssets'; import useAnimatedEmoji from './hooks/useAnimatedEmoji'; import AnimatedSticker from './AnimatedSticker'; diff --git a/src/components/common/Media.tsx b/src/components/common/Media.tsx index 21232b39..33c99747 100644 --- a/src/components/common/Media.tsx +++ b/src/components/common/Media.tsx @@ -1,8 +1,7 @@ -import React, { - FC, memo, useCallback, useRef, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback, useRef } from '../../lib/teact/teact'; -import { ApiMessage } from '../../api/types'; +import type { ApiMessage } from '../../api/types'; import { formatMediaDuration } from '../../util/dateFormat'; import stopEvent from '../../util/stopEvent'; @@ -15,7 +14,8 @@ import { import buildClassName from '../../util/buildClassName'; import useMedia from '../../hooks/useMedia'; import useMediaTransition from '../../hooks/useMediaTransition'; -import { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; import './Media.scss'; diff --git a/src/components/common/MessageLink.tsx b/src/components/common/MessageLink.tsx index 2c659b73..af67691a 100644 --- a/src/components/common/MessageLink.tsx +++ b/src/components/common/MessageLink.tsx @@ -1,7 +1,8 @@ -import React, { FC, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback } from '../../lib/teact/teact'; import { getActions } from '../../global'; -import { ApiMessage } from '../../api/types'; +import type { ApiMessage } from '../../api/types'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/common/MessageOutgoingStatus.tsx b/src/components/common/MessageOutgoingStatus.tsx index 4f86957d..e17a9a2e 100644 --- a/src/components/common/MessageOutgoingStatus.tsx +++ b/src/components/common/MessageOutgoingStatus.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; -import { ApiMessageOutgoingStatus } from '../../api/types'; +import type { ApiMessageOutgoingStatus } from '../../api/types'; import Transition from '../ui/Transition'; diff --git a/src/components/common/NothingFound.tsx b/src/components/common/NothingFound.tsx index ad8fa97f..5fd136f8 100644 --- a/src/components/common/NothingFound.tsx +++ b/src/components/common/NothingFound.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import useShowTransition from '../../hooks/useShowTransition'; diff --git a/src/components/common/PasswordForm.tsx b/src/components/common/PasswordForm.tsx index 25eb2bf7..fffb8c4f 100644 --- a/src/components/common/PasswordForm.tsx +++ b/src/components/common/PasswordForm.tsx @@ -1,6 +1,7 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useEffect, useRef, useState, + memo, useEffect, useRef, useState, } from '../../lib/teact/teact'; import { MIN_PASSWORD_LENGTH } from '../../config'; diff --git a/src/components/common/PasswordMonkey.tsx b/src/components/common/PasswordMonkey.tsx index a2ccc669..e00ca7d5 100644 --- a/src/components/common/PasswordMonkey.tsx +++ b/src/components/common/PasswordMonkey.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useState, useEffect, useCallback, memo, + useState, useEffect, useCallback, memo, } from '../../lib/teact/teact'; import { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config'; diff --git a/src/components/common/Picker.tsx b/src/components/common/Picker.tsx index 70c579ce..02508fb3 100644 --- a/src/components/common/Picker.tsx +++ b/src/components/common/Picker.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, useRef, useEffect, memo, + useCallback, useRef, useEffect, memo, } from '../../lib/teact/teact'; import { isUserId } from '../../global/helpers'; diff --git a/src/components/common/PickerSelectedItem.tsx b/src/components/common/PickerSelectedItem.tsx index bff87e9c..1ec4cb5e 100644 --- a/src/components/common/PickerSelectedItem.tsx +++ b/src/components/common/PickerSelectedItem.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, TeactNode } from '../../lib/teact/teact'; +import type { FC, TeactNode } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; -import { ApiChat, ApiUser } from '../../api/types'; +import type { ApiChat, ApiUser } from '../../api/types'; import { selectChat, selectUser } from '../../global/selectors'; import { getChatTitle, getUserFirstOrLastName, isUserId } from '../../global/helpers'; diff --git a/src/components/common/PinMessageModal.async.tsx b/src/components/common/PinMessageModal.async.tsx index 9c0b3995..fab9ee30 100644 --- a/src/components/common/PinMessageModal.async.tsx +++ b/src/components/common/PinMessageModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './PinMessageModal'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './PinMessageModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/common/PinMessageModal.tsx b/src/components/common/PinMessageModal.tsx index 449b371d..2ac5433d 100644 --- a/src/components/common/PinMessageModal.tsx +++ b/src/components/common/PinMessageModal.tsx @@ -1,4 +1,5 @@ -import React, { FC, useCallback, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback, memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; import { selectChat, selectIsChatWithSelf, selectUser } from '../../global/selectors'; diff --git a/src/components/common/PrivateChatInfo.tsx b/src/components/common/PrivateChatInfo.tsx index 62d37148..d03c6aa3 100644 --- a/src/components/common/PrivateChatInfo.tsx +++ b/src/components/common/PrivateChatInfo.tsx @@ -1,11 +1,10 @@ -import { MouseEvent as ReactMouseEvent } from 'react'; -import React, { - FC, useEffect, useCallback, memo, -} from '../../lib/teact/teact'; +import type { MouseEvent as ReactMouseEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { useEffect, useCallback, memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiUser, ApiTypingStatus, ApiUserStatus } from '../../api/types'; -import { GlobalState } from '../../global/types'; +import type { ApiUser, ApiTypingStatus, ApiUserStatus } from '../../api/types'; +import type { GlobalState } from '../../global/types'; import { MediaViewerOrigin } from '../../types'; import { selectChatMessages, selectUser, selectUserStatus } from '../../global/selectors'; diff --git a/src/components/common/ProfileInfo.tsx b/src/components/common/ProfileInfo.tsx index 7673d8fb..e3cb3099 100644 --- a/src/components/common/ProfileInfo.tsx +++ b/src/components/common/ProfileInfo.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useEffect, useCallback, memo, useState, + useEffect, useCallback, memo, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiUser, ApiChat, ApiUserStatus } from '../../api/types'; -import { GlobalState } from '../../global/types'; +import type { ApiUser, ApiChat, ApiUserStatus } from '../../api/types'; +import type { GlobalState } from '../../global/types'; import { MediaViewerOrigin } from '../../types'; import { IS_TOUCH_ENV } from '../../util/environment'; diff --git a/src/components/common/ProfilePhoto.tsx b/src/components/common/ProfilePhoto.tsx index 3c4537b0..a4939ba0 100644 --- a/src/components/common/ProfilePhoto.tsx +++ b/src/components/common/ProfilePhoto.tsx @@ -1,8 +1,8 @@ -import React, { FC, memo, TeactNode } from '../../lib/teact/teact'; +import type { FC, TeactNode } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; -import { - ApiChat, ApiMediaFormat, ApiPhoto, ApiUser, -} from '../../api/types'; +import type { ApiChat, ApiPhoto, ApiUser } from '../../api/types'; +import { ApiMediaFormat } from '../../api/types'; import { getChatAvatarHash, diff --git a/src/components/common/ReactionStaticEmoji.tsx b/src/components/common/ReactionStaticEmoji.tsx index 8a715e02..78181558 100644 --- a/src/components/common/ReactionStaticEmoji.tsx +++ b/src/components/common/ReactionStaticEmoji.tsx @@ -1,5 +1,6 @@ -import { RefObject } from 'react'; -import React, { FC, memo } from '../../lib/teact/teact'; +import type { RefObject } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { getGlobal } from '../../global'; import { ApiMediaFormat } from '../../api/types'; diff --git a/src/components/common/ReportModal.tsx b/src/components/common/ReportModal.tsx index 64e9a9a9..a006443b 100644 --- a/src/components/common/ReportModal.tsx +++ b/src/components/common/ReportModal.tsx @@ -1,11 +1,12 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useState, + memo, useCallback, useMemo, useState, } from '../../lib/teact/teact'; import { getActions } from '../../global'; -import { ApiPhoto, ApiReportReason } from '../../api/types'; +import type { ApiPhoto, ApiReportReason } from '../../api/types'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/SafeLink.tsx b/src/components/common/SafeLink.tsx index c9e97967..a301c691 100644 --- a/src/components/common/SafeLink.tsx +++ b/src/components/common/SafeLink.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; import { getActions } from '../../global'; import convertPunycode from '../../lib/punycode'; diff --git a/src/components/common/SeenByModal.async.tsx b/src/components/common/SeenByModal.async.tsx index 8e3b3be4..84986ed7 100644 --- a/src/components/common/SeenByModal.async.tsx +++ b/src/components/common/SeenByModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './SeenByModal'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './SeenByModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/common/SeenByModal.tsx b/src/components/common/SeenByModal.tsx index 5be4f4be..76fe9e8f 100644 --- a/src/components/common/SeenByModal.tsx +++ b/src/components/common/SeenByModal.tsx @@ -1,4 +1,5 @@ -import React, { FC, useCallback, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback, memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/StickerButton.tsx b/src/components/common/StickerButton.tsx index ffa50128..b1f3cf9f 100644 --- a/src/components/common/StickerButton.tsx +++ b/src/components/common/StickerButton.tsx @@ -1,17 +1,19 @@ -import { MouseEvent as ReactMouseEvent } from 'react'; +import type { MouseEvent as ReactMouseEvent } from 'react'; import React, { memo, useCallback, useEffect, useRef, } from '../../lib/teact/teact'; import { getActions } from '../../global'; -import { ApiBotInlineMediaResult, ApiMediaFormat, ApiSticker } from '../../api/types'; +import type { ApiBotInlineMediaResult, ApiSticker } from '../../api/types'; +import { ApiMediaFormat } from '../../api/types'; import buildClassName from '../../util/buildClassName'; import { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur'; import safePlay from '../../util/safePlay'; import { IS_TOUCH_ENV, IS_WEBM_SUPPORTED } from '../../util/environment'; -import { useIsIntersecting, ObserveFn } from '../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../hooks/useIntersectionObserver'; import useMedia from '../../hooks/useMedia'; import useShowTransition from '../../hooks/useShowTransition'; import useFlag from '../../hooks/useFlag'; diff --git a/src/components/common/StickerSetModal.async.tsx b/src/components/common/StickerSetModal.async.tsx index 78790ab2..596dae58 100644 --- a/src/components/common/StickerSetModal.async.tsx +++ b/src/components/common/StickerSetModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './StickerSetModal'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './StickerSetModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/common/StickerSetModal.tsx b/src/components/common/StickerSetModal.tsx index 14c80fa4..5cc5b878 100644 --- a/src/components/common/StickerSetModal.tsx +++ b/src/components/common/StickerSetModal.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiSticker, ApiStickerSet } from '../../api/types'; +import type { ApiSticker, ApiStickerSet } from '../../api/types'; import { STICKER_SIZE_MODAL } from '../../config'; import { diff --git a/src/components/common/TrackingMonkey.tsx b/src/components/common/TrackingMonkey.tsx index aee34522..003e936d 100644 --- a/src/components/common/TrackingMonkey.tsx +++ b/src/components/common/TrackingMonkey.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useState, useEffect, useCallback, memo, + useState, useEffect, useCallback, memo, } from '../../lib/teact/teact'; import { STICKER_SIZE_AUTH, STICKER_SIZE_AUTH_MOBILE, STICKER_SIZE_TWO_FA } from '../../config'; diff --git a/src/components/common/TypingStatus.tsx b/src/components/common/TypingStatus.tsx index 84244a1c..f3faf853 100644 --- a/src/components/common/TypingStatus.tsx +++ b/src/components/common/TypingStatus.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; -import { ApiUser, ApiTypingStatus } from '../../api/types'; +import type { ApiUser, ApiTypingStatus } from '../../api/types'; import { selectUser } from '../../global/selectors'; import { getUserFirstOrLastName } from '../../global/helpers'; diff --git a/src/components/common/UiLoader.tsx b/src/components/common/UiLoader.tsx index aa175273..ea73c92a 100644 --- a/src/components/common/UiLoader.tsx +++ b/src/components/common/UiLoader.tsx @@ -1,9 +1,10 @@ -import React, { FC, useEffect } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useEffect } from '../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../global'; import { ApiMediaFormat } from '../../api/types'; -import { GlobalState } from '../../global/types'; -import { ThemeKey } from '../../types'; +import type { GlobalState } from '../../global/types'; +import type { ThemeKey } from '../../types'; import { DARK_THEME_BG_COLOR, LIGHT_THEME_BG_COLOR } from '../../config'; import { getChatAvatarHash } from '../../global/helpers/chats'; // Direct import for better module splitting diff --git a/src/components/common/UnpinAllMessagesModal.async.tsx b/src/components/common/UnpinAllMessagesModal.async.tsx index 1a23bebf..ba965676 100644 --- a/src/components/common/UnpinAllMessagesModal.async.tsx +++ b/src/components/common/UnpinAllMessagesModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './UnpinAllMessagesModal'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './UnpinAllMessagesModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/common/UnpinAllMessagesModal.tsx b/src/components/common/UnpinAllMessagesModal.tsx index b7e553eb..347e0417 100644 --- a/src/components/common/UnpinAllMessagesModal.tsx +++ b/src/components/common/UnpinAllMessagesModal.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import useLang from '../../hooks/useLang'; diff --git a/src/components/common/UnreadCounter.tsx b/src/components/common/UnreadCounter.tsx index 6dfed89a..c2cfb966 100644 --- a/src/components/common/UnreadCounter.tsx +++ b/src/components/common/UnreadCounter.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo, useEffect } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useEffect } from '../../lib/teact/teact'; import { formatIntegerCompact } from '../../util/textFormat'; import { useFolderManagerForUnreadCounters } from '../../hooks/useFolderManager'; diff --git a/src/components/common/UserLink.tsx b/src/components/common/UserLink.tsx index 1ab38088..f5d96f5d 100644 --- a/src/components/common/UserLink.tsx +++ b/src/components/common/UserLink.tsx @@ -1,6 +1,7 @@ -import React, { FC, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback } from '../../lib/teact/teact'; -import { ApiChat, ApiUser } from '../../api/types'; +import type { ApiChat, ApiUser } from '../../api/types'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/common/UsernameInput.tsx b/src/components/common/UsernameInput.tsx index f85ef84f..84fd1252 100644 --- a/src/components/common/UsernameInput.tsx +++ b/src/components/common/UsernameInput.tsx @@ -1,6 +1,7 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useState, useCallback, memo, useEffect, useMemo, + useState, useCallback, memo, useEffect, useMemo, } from '../../lib/teact/teact'; import { debounce } from '../../util/schedulers'; diff --git a/src/components/common/VerifiedIcon.tsx b/src/components/common/VerifiedIcon.tsx index c17f70aa..6a1e66b2 100644 --- a/src/components/common/VerifiedIcon.tsx +++ b/src/components/common/VerifiedIcon.tsx @@ -1,4 +1,5 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import './VerifiedIcon.scss'; diff --git a/src/components/common/WebLink.tsx b/src/components/common/WebLink.tsx index 55fb30a0..36ebc345 100644 --- a/src/components/common/WebLink.tsx +++ b/src/components/common/WebLink.tsx @@ -1,8 +1,9 @@ -import React, { FC, memo, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; -import { ApiMessage, ApiWebPage } from '../../api/types'; -import { TextPart } from '../../types'; -import { ObserveFn } from '../../hooks/useIntersectionObserver'; +import type { ApiMessage, ApiWebPage } from '../../api/types'; +import type { TextPart } from '../../types'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; import { getFirstLinkInMessage, getMessageText, diff --git a/src/components/common/code/CodeBlock.tsx b/src/components/common/code/CodeBlock.tsx index 0ac21a9c..17e4553f 100644 --- a/src/components/common/code/CodeBlock.tsx +++ b/src/components/common/code/CodeBlock.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useCallback, useState, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useState } from '../../../lib/teact/teact'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/common/code/CodeOverlay.tsx b/src/components/common/code/CodeOverlay.tsx index 3dcfaea5..04cfbb72 100644 --- a/src/components/common/code/CodeOverlay.tsx +++ b/src/components/common/code/CodeOverlay.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; diff --git a/src/components/common/code/PreBlock.tsx b/src/components/common/code/PreBlock.tsx index 5bfd0220..3428cf94 100644 --- a/src/components/common/code/PreBlock.tsx +++ b/src/components/common/code/PreBlock.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useCallback, useState, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useState } from '../../../lib/teact/teact'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/common/helpers/documentInfo.ts b/src/components/common/helpers/documentInfo.ts index aeb6f00b..809ba507 100644 --- a/src/components/common/helpers/documentInfo.ts +++ b/src/components/common/helpers/documentInfo.ts @@ -1,4 +1,4 @@ -import { ApiDocument } from '../../../api/types'; +import type { ApiDocument } from '../../../api/types'; const ONE_GIGABYTE = 1024 * 1024 * 1024; const ONE_MEGABYTE = 1024 * 1024; diff --git a/src/components/common/helpers/mediaDimensions.ts b/src/components/common/helpers/mediaDimensions.ts index 30aa58ca..589b6e89 100644 --- a/src/components/common/helpers/mediaDimensions.ts +++ b/src/components/common/helpers/mediaDimensions.ts @@ -1,4 +1,4 @@ -import { +import type { ApiPhoto, ApiVideo, ApiSticker, ApiDimensions, } from '../../../api/types'; diff --git a/src/components/common/helpers/renderActionMessageText.tsx b/src/components/common/helpers/renderActionMessageText.tsx index be14d81f..4842fea3 100644 --- a/src/components/common/helpers/renderActionMessageText.tsx +++ b/src/components/common/helpers/renderActionMessageText.tsx @@ -1,11 +1,11 @@ import React from '../../../lib/teact/teact'; -import { +import type { ApiChat, ApiMessage, ApiUser, ApiGroupCall, } from '../../../api/types'; -import { TextPart } from '../../../types'; +import type { TextPart } from '../../../types'; -import { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useLang'; import { getChatTitle, getMessageSummaryText, diff --git a/src/components/common/helpers/renderMessageText.ts b/src/components/common/helpers/renderMessageText.ts index a10cb37e..d69776cd 100644 --- a/src/components/common/helpers/renderMessageText.ts +++ b/src/components/common/helpers/renderMessageText.ts @@ -1,5 +1,6 @@ -import { ApiMessage, ApiMessageEntityTypes } from '../../../api/types'; -import { TextPart } from '../../../types'; +import type { ApiMessage } from '../../../api/types'; +import { ApiMessageEntityTypes } from '../../../api/types'; +import type { TextPart } from '../../../types'; import { getMessageSummaryDescription, @@ -8,7 +9,7 @@ import { getMessageText, TRUNCATED_SUMMARY_LENGTH, } from '../../../global/helpers'; -import { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useLang'; import renderText from './renderText'; import { renderTextWithEntities } from './renderTextWithEntities'; import trimText from '../../../util/trimText'; diff --git a/src/components/common/helpers/renderText.tsx b/src/components/common/helpers/renderText.tsx index 1f1124ea..6c002a26 100644 --- a/src/components/common/helpers/renderText.tsx +++ b/src/components/common/helpers/renderText.tsx @@ -1,7 +1,7 @@ import React from '../../../lib/teact/teact'; import EMOJI_REGEX from '../../../lib/twemojiRegex'; -import { TextPart } from '../../../types'; +import type { TextPart } from '../../../types'; import { RE_LINK_TEMPLATE, RE_MENTION_TEMPLATE } from '../../../config'; import { IS_EMOJI_SUPPORTED } from '../../../util/environment'; diff --git a/src/components/common/helpers/renderTextWithEntities.tsx b/src/components/common/helpers/renderTextWithEntities.tsx index fe538bf0..5220f9cd 100644 --- a/src/components/common/helpers/renderTextWithEntities.tsx +++ b/src/components/common/helpers/renderTextWithEntities.tsx @@ -1,11 +1,13 @@ -import { MouseEvent } from 'react'; +import type { MouseEvent } from 'react'; import React from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { TextPart } from '../../../types'; -import { ApiFormattedText, ApiMessageEntity, ApiMessageEntityTypes } from '../../../api/types'; +import type { TextPart } from '../../../types'; +import type { ApiFormattedText, ApiMessageEntity } from '../../../api/types'; +import { ApiMessageEntityTypes } from '../../../api/types'; -import renderText, { TextFilter } from './renderText'; +import type { TextFilter } from './renderText'; +import renderText from './renderText'; import { copyTextToClipboard } from '../../../util/clipboard'; import { getTranslation } from '../../../util/langProvider'; diff --git a/src/components/common/hooks/useAnimatedEmoji.ts b/src/components/common/hooks/useAnimatedEmoji.ts index 9fc12883..56c79ed9 100644 --- a/src/components/common/hooks/useAnimatedEmoji.ts +++ b/src/components/common/hooks/useAnimatedEmoji.ts @@ -4,7 +4,7 @@ import { import safePlay from '../../../util/safePlay'; import { getActions } from '../../../global'; import useMedia from '../../../hooks/useMedia'; -import { ActiveEmojiInteraction } from '../../../global/types'; +import type { ActiveEmojiInteraction } from '../../../global/types'; import useFlag from '../../../hooks/useFlag'; import { selectLocalAnimatedEmojiEffectByName } from '../../../global/selectors'; diff --git a/src/components/common/hooks/usePhotosPreload.ts b/src/components/common/hooks/usePhotosPreload.ts index 0f01ac61..f4d3a94f 100644 --- a/src/components/common/hooks/usePhotosPreload.ts +++ b/src/components/common/hooks/usePhotosPreload.ts @@ -1,6 +1,5 @@ -import { - ApiChat, ApiMediaFormat, ApiPhoto, ApiUser, -} from '../../../api/types'; +import type { ApiChat, ApiPhoto, ApiUser } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; import { useEffect } from '../../../lib/teact/teact'; import * as mediaLoader from '../../../util/mediaLoader'; diff --git a/src/components/common/spoiler/Spoiler.tsx b/src/components/common/spoiler/Spoiler.tsx index 5bf8a1d1..f348d70f 100644 --- a/src/components/common/spoiler/Spoiler.tsx +++ b/src/components/common/spoiler/Spoiler.tsx @@ -1,6 +1,7 @@ -import { MouseEvent as ReactMouseEvent } from 'react'; +import type { MouseEvent as ReactMouseEvent } from 'react'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../../lib/teact/teact'; import { createClassNameBuilder } from '../../../util/buildClassName'; diff --git a/src/components/left/ArchivedChats.async.tsx b/src/components/left/ArchivedChats.async.tsx index 7b588009..54dfb01a 100644 --- a/src/components/left/ArchivedChats.async.tsx +++ b/src/components/left/ArchivedChats.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './ArchivedChats'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './ArchivedChats'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/left/ArchivedChats.tsx b/src/components/left/ArchivedChats.tsx index 707d73c6..f95594aa 100644 --- a/src/components/left/ArchivedChats.tsx +++ b/src/components/left/ArchivedChats.tsx @@ -1,11 +1,12 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import useLang from '../../hooks/useLang'; import useHistoryBack from '../../hooks/useHistoryBack'; import Button from '../ui/Button'; import ChatList from './main/ChatList'; -import { LeftColumnContent } from '../../types'; +import type { LeftColumnContent } from '../../types'; import './ArchivedChats.scss'; diff --git a/src/components/left/ChatFolderModal.async.tsx b/src/components/left/ChatFolderModal.async.tsx index 15d10171..fb2734af 100644 --- a/src/components/left/ChatFolderModal.async.tsx +++ b/src/components/left/ChatFolderModal.async.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; -import { OwnProps } from './ChatFolderModal'; +import type { OwnProps } from './ChatFolderModal'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/left/ChatFolderModal.tsx b/src/components/left/ChatFolderModal.tsx index aac30e45..2e78e4f7 100644 --- a/src/components/left/ChatFolderModal.tsx +++ b/src/components/left/ChatFolderModal.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, memo, useMemo, useState, + useCallback, memo, useMemo, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiChatFolder } from '../../api/types'; +import type { ApiChatFolder } from '../../api/types'; import useLang from '../../hooks/useLang'; diff --git a/src/components/left/ConnectionStatusOverlay.tsx b/src/components/left/ConnectionStatusOverlay.tsx index 72cee0b1..871c610f 100644 --- a/src/components/left/ConnectionStatusOverlay.tsx +++ b/src/components/left/ConnectionStatusOverlay.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import useLang from '../../hooks/useLang'; -import { ConnectionStatus } from '../../hooks/useConnectionStatus'; +import type { ConnectionStatus } from '../../hooks/useConnectionStatus'; import Transition from '../ui/Transition'; import Spinner from '../ui/Spinner'; diff --git a/src/components/left/LeftColumn.tsx b/src/components/left/LeftColumn.tsx index eef8c7a4..948a6fb3 100644 --- a/src/components/left/LeftColumn.tsx +++ b/src/components/left/LeftColumn.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; diff --git a/src/components/left/NewChatButton.tsx b/src/components/left/NewChatButton.tsx index 2edea8fd..6aa7e99c 100644 --- a/src/components/left/NewChatButton.tsx +++ b/src/components/left/NewChatButton.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useState, useEffect, memo, useCallback, + useState, useEffect, memo, useCallback, } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/left/main/Badge.tsx b/src/components/left/main/Badge.tsx index 9044e89b..68bad93a 100644 --- a/src/components/left/main/Badge.tsx +++ b/src/components/left/main/Badge.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; -import { ApiChat } from '../../../api/types'; +import type { ApiChat } from '../../../api/types'; import { formatIntegerCompact } from '../../../util/textFormat'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/left/main/Chat.tsx b/src/components/left/main/Chat.tsx index f33b1477..a64c9665 100644 --- a/src/components/left/main/Chat.tsx +++ b/src/components/left/main/Chat.tsx @@ -1,13 +1,16 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useLayoutEffect, useMemo, useRef, + memo, useCallback, useLayoutEffect, useMemo, useRef, } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; -import useLang, { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useLang'; +import useLang from '../../../hooks/useLang'; -import { - ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, ApiFormattedText, MAIN_THREAD_ID, ApiUserStatus, +import type { + ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, ApiFormattedText, ApiUserStatus, } from '../../../api/types'; +import { MAIN_THREAD_ID } from '../../../api/types'; import { ANIMATION_END_DELAY } from '../../../config'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; diff --git a/src/components/left/main/ChatCallStatus.tsx b/src/components/left/main/ChatCallStatus.tsx index f6ba47ad..d06fb713 100644 --- a/src/components/left/main/ChatCallStatus.tsx +++ b/src/components/left/main/ChatCallStatus.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import buildClassName from '../../../util/buildClassName'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; diff --git a/src/components/left/main/ChatFolders.tsx b/src/components/left/main/ChatFolders.tsx index 344bd862..bcd3e403 100644 --- a/src/components/left/main/ChatFolders.tsx +++ b/src/components/left/main/ChatFolders.tsx @@ -1,11 +1,12 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useRef, + memo, useCallback, useEffect, useMemo, useRef, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChatFolder } from '../../../api/types'; -import { SettingsScreens } from '../../../types'; -import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; +import type { ApiChatFolder } from '../../../api/types'; +import type { SettingsScreens } from '../../../types'; +import type { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; import { ALL_FOLDER_ID } from '../../../config'; import { IS_TOUCH_ENV } from '../../../util/environment'; diff --git a/src/components/left/main/ChatList.tsx b/src/components/left/main/ChatList.tsx index 9e89b333..9570b86c 100644 --- a/src/components/left/main/ChatList.tsx +++ b/src/components/left/main/ChatList.tsx @@ -1,10 +1,9 @@ -import React, { - FC, memo, useMemo, useEffect, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useMemo, useEffect } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { SettingsScreens } from '../../../types'; -import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; +import type { SettingsScreens } from '../../../types'; +import type { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; import { ALL_FOLDER_ID, diff --git a/src/components/left/main/ContactList.async.tsx b/src/components/left/main/ContactList.async.tsx index 382a938e..780d6ef4 100644 --- a/src/components/left/main/ContactList.async.tsx +++ b/src/components/left/main/ContactList.async.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './ContactList'; +import type { OwnProps } from './ContactList'; import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; diff --git a/src/components/left/main/ContactList.tsx b/src/components/left/main/ContactList.tsx index 2d92de56..704215c9 100644 --- a/src/components/left/main/ContactList.tsx +++ b/src/components/left/main/ContactList.tsx @@ -1,9 +1,8 @@ -import React, { - FC, useCallback, useMemo, memo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { useCallback, useMemo, memo } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiUser, ApiUserStatus } from '../../../api/types'; +import type { ApiUser, ApiUserStatus } from '../../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; import { filterUsersByName, sortUserIds } from '../../../global/helpers'; diff --git a/src/components/left/main/EmptyFolder.tsx b/src/components/left/main/EmptyFolder.tsx index 9dbf9bf1..a51000d8 100644 --- a/src/components/left/main/EmptyFolder.tsx +++ b/src/components/left/main/EmptyFolder.tsx @@ -1,9 +1,10 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; -import { ApiChatFolder, ApiSticker } from '../../../api/types'; +import type { ApiChatFolder, ApiSticker } from '../../../api/types'; import { SettingsScreens } from '../../../types'; -import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; +import type { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; import { selectAnimatedEmoji, selectChatFolder } from '../../../global/selectors'; diff --git a/src/components/left/main/LeftMain.tsx b/src/components/left/main/LeftMain.tsx index 44addf5a..eca2ace9 100644 --- a/src/components/left/main/LeftMain.tsx +++ b/src/components/left/main/LeftMain.tsx @@ -1,9 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../../lib/teact/teact'; -import { LeftColumnContent, SettingsScreens } from '../../../types'; -import { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; +import type { SettingsScreens } from '../../../types'; +import { LeftColumnContent } from '../../../types'; +import type { FolderEditDispatch } from '../../../hooks/reducers/useFoldersReducer'; import { IS_TOUCH_ENV } from '../../../util/environment'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/left/main/LeftMainHeader.tsx b/src/components/left/main/LeftMainHeader.tsx index 40ac21cc..3498ccec 100644 --- a/src/components/left/main/LeftMainHeader.tsx +++ b/src/components/left/main/LeftMainHeader.tsx @@ -1,11 +1,11 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ISettings, LeftColumnContent } from '../../../types'; -import { ApiChat } from '../../../api/types'; -import { GlobalState } from '../../../global/types'; +import type { ISettings } from '../../../types'; +import { LeftColumnContent } from '../../../types'; +import type { ApiChat } from '../../../api/types'; +import type { GlobalState } from '../../../global/types'; import { ANIMATION_LEVEL_MAX, diff --git a/src/components/left/newChat/NewChat.async.tsx b/src/components/left/newChat/NewChat.async.tsx index 8ef76487..c3390ace 100644 --- a/src/components/left/newChat/NewChat.async.tsx +++ b/src/components/left/newChat/NewChat.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './NewChat'; +import type { OwnProps } from './NewChat'; import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; diff --git a/src/components/left/newChat/NewChat.tsx b/src/components/left/newChat/NewChat.tsx index d4604771..369e7ea4 100644 --- a/src/components/left/newChat/NewChat.tsx +++ b/src/components/left/newChat/NewChat.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useCallback, useState, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useState } from '../../../lib/teact/teact'; import { LeftColumnContent } from '../../../types'; diff --git a/src/components/left/newChat/NewChatStep1.async.tsx b/src/components/left/newChat/NewChatStep1.async.tsx index 191626b8..25e807be 100644 --- a/src/components/left/newChat/NewChatStep1.async.tsx +++ b/src/components/left/newChat/NewChatStep1.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './NewChatStep1'; +import type { OwnProps } from './NewChatStep1'; import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; diff --git a/src/components/left/newChat/NewChatStep1.tsx b/src/components/left/newChat/NewChatStep1.tsx index ea20aad4..eb8ba47b 100644 --- a/src/components/left/newChat/NewChatStep1.tsx +++ b/src/components/left/newChat/NewChatStep1.tsx @@ -1,9 +1,8 @@ -import React, { - FC, useCallback, useMemo, memo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { useCallback, useMemo, memo } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; -import { ApiChat } from '../../../api/types'; +import type { ApiChat } from '../../../api/types'; import { unique } from '../../../util/iteratees'; import { filterUsersByName, isUserBot, sortChatIds } from '../../../global/helpers'; diff --git a/src/components/left/newChat/NewChatStep2.async.tsx b/src/components/left/newChat/NewChatStep2.async.tsx index 6196cca8..53b3697e 100644 --- a/src/components/left/newChat/NewChatStep2.async.tsx +++ b/src/components/left/newChat/NewChatStep2.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './NewChatStep2'; +import type { OwnProps } from './NewChatStep2'; import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; diff --git a/src/components/left/newChat/NewChatStep2.tsx b/src/components/left/newChat/NewChatStep2.tsx index 2efdb331..efcfc35f 100644 --- a/src/components/left/newChat/NewChatStep2.tsx +++ b/src/components/left/newChat/NewChatStep2.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useState, useCallback, useEffect, memo, + useState, useCallback, useEffect, memo, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; diff --git a/src/components/left/search/AudioResults.tsx b/src/components/left/search/AudioResults.tsx index 5332d0bb..8cba0538 100644 --- a/src/components/left/search/AudioResults.tsx +++ b/src/components/left/search/AudioResults.tsx @@ -1,13 +1,13 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import { AudioOrigin, LoadMoreDirection } from '../../../types'; import { SLIDE_TRANSITION_DURATION } from '../../../config'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; -import { createMapStateToProps, StateProps } from './helpers/createMapStateToProps'; +import type { StateProps } from './helpers/createMapStateToProps'; +import { createMapStateToProps } from './helpers/createMapStateToProps'; import { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat'; import { getSenderName } from './helpers/getSenderName'; import { throttle } from '../../../util/schedulers'; diff --git a/src/components/left/search/ChatMessage.tsx b/src/components/left/search/ChatMessage.tsx index 352f10a7..22f49a61 100644 --- a/src/components/left/search/ChatMessage.tsx +++ b/src/components/left/search/ChatMessage.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { +import type { ApiChat, ApiUser, ApiMessage, ApiMessageOutgoingStatus, } from '../../../api/types'; @@ -23,7 +22,8 @@ import { formatPastTimeShort } from '../../../util/dateFormat'; import { renderMessageSummary } from '../../common/helpers/renderMessageText'; import useMedia from '../../../hooks/useMedia'; -import useLang, { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useLang'; +import useLang from '../../../hooks/useLang'; import useSelectWithEnter from '../../../hooks/useSelectWithEnter'; import Avatar from '../../common/Avatar'; diff --git a/src/components/left/search/ChatMessageResults.tsx b/src/components/left/search/ChatMessageResults.tsx index 68cb6d71..4a045b0a 100644 --- a/src/components/left/search/ChatMessageResults.tsx +++ b/src/components/left/search/ChatMessageResults.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiMessage } from '../../../api/types'; +import type { ApiChat, ApiMessage } from '../../../api/types'; import { LoadMoreDirection } from '../../../types'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; diff --git a/src/components/left/search/ChatResults.tsx b/src/components/left/search/ChatResults.tsx index c226ec00..88d62695 100644 --- a/src/components/left/search/ChatResults.tsx +++ b/src/components/left/search/ChatResults.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useState, + memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; -import { ApiChat, ApiMessage } from '../../../api/types'; +import type { ApiChat, ApiMessage } from '../../../api/types'; import { LoadMoreDirection } from '../../../types'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; diff --git a/src/components/left/search/DateSuggest.tsx b/src/components/left/search/DateSuggest.tsx index df1b22c9..936c84d8 100644 --- a/src/components/left/search/DateSuggest.tsx +++ b/src/components/left/search/DateSuggest.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo, useMemo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useMemo } from '../../../lib/teact/teact'; import { formatDateToString } from '../../../util/dateFormat'; import './DateSuggest.scss'; diff --git a/src/components/left/search/FileResults.tsx b/src/components/left/search/FileResults.tsx index 3fff46a1..4c59a224 100644 --- a/src/components/left/search/FileResults.tsx +++ b/src/components/left/search/FileResults.tsx @@ -1,14 +1,16 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useRef, + memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiMessage } from '../../../api/types'; +import type { ApiMessage } from '../../../api/types'; import { LoadMoreDirection } from '../../../types'; import { SLIDE_TRANSITION_DURATION } from '../../../config'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; -import { createMapStateToProps, StateProps } from './helpers/createMapStateToProps'; +import type { StateProps } from './helpers/createMapStateToProps'; +import { createMapStateToProps } from './helpers/createMapStateToProps'; import { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat'; import { getSenderName } from './helpers/getSenderName'; import { throttle } from '../../../util/schedulers'; diff --git a/src/components/left/search/LeftSearch.async.tsx b/src/components/left/search/LeftSearch.async.tsx index af6747e1..2e853cc2 100644 --- a/src/components/left/search/LeftSearch.async.tsx +++ b/src/components/left/search/LeftSearch.async.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './LeftSearch'; +import type { OwnProps } from './LeftSearch'; import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; diff --git a/src/components/left/search/LeftSearch.tsx b/src/components/left/search/LeftSearch.tsx index 214c91d2..acc766f3 100644 --- a/src/components/left/search/LeftSearch.tsx +++ b/src/components/left/search/LeftSearch.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useState, useMemo, useRef, + memo, useCallback, useState, useMemo, useRef, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; diff --git a/src/components/left/search/LeftSearchResultChat.tsx b/src/components/left/search/LeftSearchResultChat.tsx index 63a14145..63499f6d 100644 --- a/src/components/left/search/LeftSearchResultChat.tsx +++ b/src/components/left/search/LeftSearchResultChat.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; -import { ApiChat, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiUser } from '../../../api/types'; import useChatContextActions from '../../../hooks/useChatContextActions'; import useFlag from '../../../hooks/useFlag'; diff --git a/src/components/left/search/LinkResults.tsx b/src/components/left/search/LinkResults.tsx index 7216ac0b..f6d04677 100644 --- a/src/components/left/search/LinkResults.tsx +++ b/src/components/left/search/LinkResults.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useRef, + memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; @@ -7,7 +8,8 @@ import { LoadMoreDirection } from '../../../types'; import { SLIDE_TRANSITION_DURATION } from '../../../config'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; -import { createMapStateToProps, StateProps } from './helpers/createMapStateToProps'; +import type { StateProps } from './helpers/createMapStateToProps'; +import { createMapStateToProps } from './helpers/createMapStateToProps'; import { formatMonthAndYear, toYearMonth } from '../../../util/dateFormat'; import { getSenderName } from './helpers/getSenderName'; import { throttle } from '../../../util/schedulers'; diff --git a/src/components/left/search/MediaResults.tsx b/src/components/left/search/MediaResults.tsx index 0d88165e..6510d824 100644 --- a/src/components/left/search/MediaResults.tsx +++ b/src/components/left/search/MediaResults.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useRef, + memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; @@ -7,7 +8,8 @@ import { LoadMoreDirection, MediaViewerOrigin } from '../../../types'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import { SLIDE_TRANSITION_DURATION } from '../../../config'; -import { createMapStateToProps, StateProps } from './helpers/createMapStateToProps'; +import type { StateProps } from './helpers/createMapStateToProps'; +import { createMapStateToProps } from './helpers/createMapStateToProps'; import buildClassName from '../../../util/buildClassName'; import { throttle } from '../../../util/schedulers'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/left/search/RecentContacts.tsx b/src/components/left/search/RecentContacts.tsx index 071b3740..4f035b17 100644 --- a/src/components/left/search/RecentContacts.tsx +++ b/src/components/left/search/RecentContacts.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useEffect, useCallback, useRef, memo, + useEffect, useCallback, useRef, memo, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiUser } from '../../../api/types'; +import type { ApiUser } from '../../../api/types'; import { getUserFirstOrLastName } from '../../../global/helpers'; import renderText from '../../common/helpers/renderText'; diff --git a/src/components/left/search/helpers/createMapStateToProps.ts b/src/components/left/search/helpers/createMapStateToProps.ts index e59e2bfa..9c6d7cea 100644 --- a/src/components/left/search/helpers/createMapStateToProps.ts +++ b/src/components/left/search/helpers/createMapStateToProps.ts @@ -1,8 +1,8 @@ -import { GlobalState } from '../../../../global/types'; -import { +import type { GlobalState } from '../../../../global/types'; +import type { ApiChat, ApiGlobalMessageSearchType, ApiMessage, ApiUser, } from '../../../../api/types'; -import { ISettings } from '../../../../types'; +import type { ISettings } from '../../../../types'; import { selectChat, selectTheme } from '../../../../global/selectors'; diff --git a/src/components/left/search/helpers/getSenderName.ts b/src/components/left/search/helpers/getSenderName.ts index ca01dc0e..5461dea6 100644 --- a/src/components/left/search/helpers/getSenderName.ts +++ b/src/components/left/search/helpers/getSenderName.ts @@ -1,11 +1,11 @@ -import { ApiChat, ApiMessage, ApiUser } from '../../../../api/types'; +import type { ApiChat, ApiMessage, ApiUser } from '../../../../api/types'; import { getChatTitle, getSenderTitle, isUserId, isChatGroup, } from '../../../../global/helpers'; -import { LangFn } from '../../../../hooks/useLang'; +import type { LangFn } from '../../../../hooks/useLang'; export function getSenderName( lang: LangFn, message: ApiMessage, chatsById: Record, usersById: Record, diff --git a/src/components/left/settings/BlockUserModal.tsx b/src/components/left/settings/BlockUserModal.tsx index 1a8804bd..d43c9194 100644 --- a/src/components/left/settings/BlockUserModal.tsx +++ b/src/components/left/settings/BlockUserModal.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useMemo, useState, memo, useRef, useCallback, useEffect, + useMemo, useState, memo, useRef, useCallback, useEffect, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiUser } from '../../../api/types'; +import type { ApiUser } from '../../../api/types'; import { filterUsersByName, getUserFullName } from '../../../global/helpers'; import { unique } from '../../../util/iteratees'; diff --git a/src/components/left/settings/Settings.async.tsx b/src/components/left/settings/Settings.async.tsx index 6b409bff..f62935b1 100644 --- a/src/components/left/settings/Settings.async.tsx +++ b/src/components/left/settings/Settings.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './Settings'; +import type { OwnProps } from './Settings'; import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; diff --git a/src/components/left/settings/Settings.tsx b/src/components/left/settings/Settings.tsx index cb70b5c2..89f875d2 100644 --- a/src/components/left/settings/Settings.tsx +++ b/src/components/left/settings/Settings.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { SettingsScreens } from '../../../types'; -import { FolderEditDispatch, FoldersState } from '../../../hooks/reducers/useFoldersReducer'; +import type { FolderEditDispatch, FoldersState } from '../../../hooks/reducers/useFoldersReducer'; import { LAYERS_ANIMATION_NAME } from '../../../util/environment'; import useTwoFaReducer from '../../../hooks/reducers/useTwoFaReducer'; diff --git a/src/components/left/settings/SettingsActiveSession.tsx b/src/components/left/settings/SettingsActiveSession.tsx index 4d240a06..42e2f379 100644 --- a/src/components/left/settings/SettingsActiveSession.tsx +++ b/src/components/left/settings/SettingsActiveSession.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiSession } from '../../../api/types'; +import type { ApiSession } from '../../../api/types'; import { formatDateTimeToString } from '../../../util/dateFormat'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/left/settings/SettingsActiveSessions.tsx b/src/components/left/settings/SettingsActiveSessions.tsx index 453db1e0..b01a14b8 100644 --- a/src/components/left/settings/SettingsActiveSessions.tsx +++ b/src/components/left/settings/SettingsActiveSessions.tsx @@ -1,10 +1,11 @@ /* eslint-disable react/jsx-no-bind */ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useState, + memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiSession } from '../../../api/types'; +import type { ApiSession } from '../../../api/types'; import { formatPastTimeShort } from '../../../util/dateFormat'; import useFlag from '../../../hooks/useFlag'; diff --git a/src/components/left/settings/SettingsDataStorage.tsx b/src/components/left/settings/SettingsDataStorage.tsx index d804605d..547c946f 100644 --- a/src/components/left/settings/SettingsDataStorage.tsx +++ b/src/components/left/settings/SettingsDataStorage.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ISettings } from '../../../types'; +import type { ISettings } from '../../../types'; import { AUTODOWNLOAD_FILESIZE_MB_LIMITS } from '../../../config'; import { pick } from '../../../util/iteratees'; diff --git a/src/components/left/settings/SettingsEditProfile.tsx b/src/components/left/settings/SettingsEditProfile.tsx index 75079da6..ca1b6312 100644 --- a/src/components/left/settings/SettingsEditProfile.tsx +++ b/src/components/left/settings/SettingsEditProfile.tsx @@ -1,6 +1,7 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useState, useCallback, memo, useEffect, useMemo, + useState, useCallback, memo, useEffect, useMemo, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; diff --git a/src/components/left/settings/SettingsGeneral.tsx b/src/components/left/settings/SettingsGeneral.tsx index d7b3e444..f3adeb15 100644 --- a/src/components/left/settings/SettingsGeneral.tsx +++ b/src/components/left/settings/SettingsGeneral.tsx @@ -1,10 +1,12 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useCallback, memo, useRef, useState, + useCallback, memo, useRef, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { SettingsScreens, ISettings, TimeFormat } from '../../../types'; -import { ApiSticker, ApiStickerSet } from '../../../api/types'; +import type { ISettings, TimeFormat } from '../../../types'; +import { SettingsScreens } from '../../../types'; +import type { ApiSticker, ApiStickerSet } from '../../../api/types'; import { getSystemTheme, IS_IOS, IS_MAC_OS, IS_TOUCH_ENV, @@ -19,7 +21,8 @@ import useHistoryBack from '../../../hooks/useHistoryBack'; import ListItem from '../../ui/ListItem'; import RangeSlider from '../../ui/RangeSlider'; import Checkbox from '../../ui/Checkbox'; -import RadioGroup, { IRadioOption } from '../../ui/RadioGroup'; +import type { IRadioOption } from '../../ui/RadioGroup'; +import RadioGroup from '../../ui/RadioGroup'; import SettingsStickerSet from './SettingsStickerSet'; import StickerSetModal from '../../common/StickerSetModal.async'; import ReactionStaticEmoji from '../../common/ReactionStaticEmoji'; diff --git a/src/components/left/settings/SettingsGeneralBackground.tsx b/src/components/left/settings/SettingsGeneralBackground.tsx index 80d9492b..6260e6d8 100644 --- a/src/components/left/settings/SettingsGeneralBackground.tsx +++ b/src/components/left/settings/SettingsGeneralBackground.tsx @@ -1,10 +1,12 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useEffect, useCallback, useRef, + memo, useEffect, useCallback, useRef, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { SettingsScreens, ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types'; -import { ApiWallpaper } from '../../../api/types'; +import type { ThemeKey } from '../../../types'; +import { SettingsScreens, UPLOADING_WALLPAPER_SLUG } from '../../../types'; +import type { ApiWallpaper } from '../../../api/types'; import { DARK_THEME_PATTERN_COLOR, DEFAULT_PATTERN_COLOR } from '../../../config'; import { throttle } from '../../../util/schedulers'; diff --git a/src/components/left/settings/SettingsGeneralBackgroundColor.tsx b/src/components/left/settings/SettingsGeneralBackgroundColor.tsx index 3db73c2b..fbf4f4ad 100644 --- a/src/components/left/settings/SettingsGeneralBackgroundColor.tsx +++ b/src/components/left/settings/SettingsGeneralBackgroundColor.tsx @@ -1,16 +1,18 @@ -import { ChangeEvent, MutableRefObject, RefObject } from 'react'; +import type { ChangeEvent, MutableRefObject, RefObject } from 'react'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ThemeKey } from '../../../types'; +import type { ThemeKey } from '../../../types'; import { pick } from '../../../util/iteratees'; import { getPatternColor, hex2rgb, hsb2rgb, rgb2hex, rgb2hsb, } from '../../../util/colors'; -import { captureEvents, RealTouchEvent } from '../../../util/captureEvents'; +import type { RealTouchEvent } from '../../../util/captureEvents'; +import { captureEvents } from '../../../util/captureEvents'; import { selectTheme } from '../../../global/selectors'; import useFlag from '../../../hooks/useFlag'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/left/settings/SettingsHeader.tsx b/src/components/left/settings/SettingsHeader.tsx index 4daa195c..acfab32b 100644 --- a/src/components/left/settings/SettingsHeader.tsx +++ b/src/components/left/settings/SettingsHeader.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useState, + memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; diff --git a/src/components/left/settings/SettingsLanguage.tsx b/src/components/left/settings/SettingsLanguage.tsx index 9cceec0a..ce8cf5e8 100644 --- a/src/components/left/settings/SettingsLanguage.tsx +++ b/src/components/left/settings/SettingsLanguage.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ISettings, LangCode } from '../../../types'; -import { ApiLanguage } from '../../../api/types'; +import type { ISettings, LangCode } from '../../../types'; +import type { ApiLanguage } from '../../../api/types'; import { setLanguage } from '../../../util/langProvider'; diff --git a/src/components/left/settings/SettingsMain.tsx b/src/components/left/settings/SettingsMain.tsx index dc3944a5..52dc21cb 100644 --- a/src/components/left/settings/SettingsMain.tsx +++ b/src/components/left/settings/SettingsMain.tsx @@ -1,8 +1,9 @@ -import React, { FC, memo, useEffect } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useEffect } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import { SettingsScreens } from '../../../types'; -import { ApiUser } from '../../../api/types'; +import type { ApiUser } from '../../../api/types'; import { selectUser } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/left/settings/SettingsNotifications.tsx b/src/components/left/settings/SettingsNotifications.tsx index 0a293090..cf5b5fd5 100644 --- a/src/components/left/settings/SettingsNotifications.tsx +++ b/src/components/left/settings/SettingsNotifications.tsx @@ -1,8 +1,7 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; import useRunDebounced from '../../../hooks/useRunDebounced'; -import React, { - FC, memo, useCallback, useEffect, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/left/settings/SettingsPrivacy.tsx b/src/components/left/settings/SettingsPrivacy.tsx index 4a91569b..561583ed 100644 --- a/src/components/left/settings/SettingsPrivacy.tsx +++ b/src/components/left/settings/SettingsPrivacy.tsx @@ -1,7 +1,9 @@ -import React, { FC, memo, useEffect } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useEffect } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiPrivacySettings, SettingsScreens } from '../../../types'; +import type { ApiPrivacySettings } from '../../../types'; +import { SettingsScreens } from '../../../types'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx b/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx index 4b37aa7f..49f2730b 100644 --- a/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx +++ b/src/components/left/settings/SettingsPrivacyBlockedUsers.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiCountryCode, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiCountryCode, ApiUser } from '../../../api/types'; import { CHAT_HEIGHT_PX } from '../../../config'; import { formatPhoneNumberWithCode } from '../../../util/phoneNumber'; diff --git a/src/components/left/settings/SettingsPrivacyVisibility.tsx b/src/components/left/settings/SettingsPrivacyVisibility.tsx index c05b2a25..2f7d558b 100644 --- a/src/components/left/settings/SettingsPrivacyVisibility.tsx +++ b/src/components/left/settings/SettingsPrivacyVisibility.tsx @@ -1,10 +1,10 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiUser } from '../../../api/types'; -import { ApiPrivacySettings, SettingsScreens } from '../../../types'; +import type { ApiChat, ApiUser } from '../../../api/types'; +import type { ApiPrivacySettings } from '../../../types'; +import { SettingsScreens } from '../../../types'; import useLang from '../../../hooks/useLang'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx b/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx index 5b32193f..50d5d142 100644 --- a/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx +++ b/src/components/left/settings/SettingsPrivacyVisibilityExceptionList.tsx @@ -1,10 +1,12 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useState, + memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; -import { GlobalState } from '../../../global/types'; -import { ApiPrivacySettings, SettingsScreens } from '../../../types'; +import type { GlobalState } from '../../../global/types'; +import type { ApiPrivacySettings } from '../../../types'; +import { SettingsScreens } from '../../../types'; import { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID } from '../../../config'; import { unique } from '../../../util/iteratees'; diff --git a/src/components/left/settings/SettingsQuickReaction.tsx b/src/components/left/settings/SettingsQuickReaction.tsx index 2b780d9e..300f9acd 100644 --- a/src/components/left/settings/SettingsQuickReaction.tsx +++ b/src/components/left/settings/SettingsQuickReaction.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiAvailableReaction } from '../../../api/types'; +import type { ApiAvailableReaction } from '../../../api/types'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/SettingsStickerSet.tsx b/src/components/left/settings/SettingsStickerSet.tsx index 97c26aea..632bc761 100644 --- a/src/components/left/settings/SettingsStickerSet.tsx +++ b/src/components/left/settings/SettingsStickerSet.tsx @@ -1,10 +1,9 @@ -import React, { - FC, memo, -} from '../../../lib/teact/teact'; -import { ApiSticker, ApiStickerSet } from '../../../api/types'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { ApiSticker, ApiStickerSet } from '../../../api/types'; import { STICKER_SIZE_GENERAL_SETTINGS } from '../../../config'; -import { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; import useLang from '../../../hooks/useLang'; import ListItem from '../../ui/ListItem'; diff --git a/src/components/left/settings/WallpaperTile.tsx b/src/components/left/settings/WallpaperTile.tsx index 3b8deaee..ca8ef49b 100644 --- a/src/components/left/settings/WallpaperTile.tsx +++ b/src/components/left/settings/WallpaperTile.tsx @@ -1,8 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useState, useRef, + memo, useCallback, useEffect, useState, useRef, } from '../../../lib/teact/teact'; -import { ApiWallpaper } from '../../../api/types'; -import { ThemeKey, UPLOADING_WALLPAPER_SLUG } from '../../../types'; +import type { ApiWallpaper } from '../../../api/types'; +import type { ThemeKey } from '../../../types'; +import { UPLOADING_WALLPAPER_SLUG } from '../../../types'; import { CUSTOM_BG_CACHE_NAME } from '../../../config'; import * as cacheApi from '../../../util/cacheApi'; diff --git a/src/components/left/settings/folders/SettingsFolders.tsx b/src/components/left/settings/folders/SettingsFolders.tsx index 2769c8dc..02c85605 100644 --- a/src/components/left/settings/folders/SettingsFolders.tsx +++ b/src/components/left/settings/folders/SettingsFolders.tsx @@ -1,9 +1,10 @@ -import React, { FC, memo, useCallback } from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../../lib/teact/teact'; -import { ApiChatFolder } from '../../../../api/types'; +import type { ApiChatFolder } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; -import { FolderEditDispatch, FoldersState } from '../../../../hooks/reducers/useFoldersReducer'; +import type { FolderEditDispatch, FoldersState } from '../../../../hooks/reducers/useFoldersReducer'; import SettingsFoldersMain from './SettingsFoldersMain'; import SettingsFoldersEdit from './SettingsFoldersEdit'; diff --git a/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx b/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx index d65575f7..d41fbd96 100644 --- a/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx +++ b/src/components/left/settings/folders/SettingsFoldersChatFilters.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useMemo, useCallback, -} from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo, useMemo, useCallback } from '../../../../lib/teact/teact'; import { getGlobal } from '../../../../global'; import { unique } from '../../../../util/iteratees'; @@ -10,9 +9,11 @@ import { filterChatsByName } from '../../../../global/helpers'; import useLang from '../../../../hooks/useLang'; import useHistoryBack from '../../../../hooks/useHistoryBack'; import { useFolderManagerForOrderedIds } from '../../../../hooks/useFolderManager'; -import { +import type { FoldersState, FolderEditDispatch, +} from '../../../../hooks/reducers/useFoldersReducer'; +import { selectChatFilters, } from '../../../../hooks/reducers/useFoldersReducer'; diff --git a/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx b/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx index c4ad5fd5..e7e16937 100644 --- a/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx +++ b/src/components/left/settings/folders/SettingsFoldersChatsPicker.tsx @@ -1,12 +1,13 @@ +import type { FC } from '../../../../lib/teact/teact'; import React, { - FC, useCallback, useRef, useEffect, memo, + useCallback, useRef, useEffect, memo, } from '../../../../lib/teact/teact'; import { isUserId } from '../../../../global/helpers'; +import type { FolderChatType } from '../../../../hooks/reducers/useFoldersReducer'; import { INCLUDED_CHAT_TYPES, EXCLUDED_CHAT_TYPES, - FolderChatType, } from '../../../../hooks/reducers/useFoldersReducer'; import useInfiniteScroll from '../../../../hooks/useInfiniteScroll'; import useLang from '../../../../hooks/useLang'; diff --git a/src/components/left/settings/folders/SettingsFoldersEdit.tsx b/src/components/left/settings/folders/SettingsFoldersEdit.tsx index 959ce000..25d4f65c 100644 --- a/src/components/left/settings/folders/SettingsFoldersEdit.tsx +++ b/src/components/left/settings/folders/SettingsFoldersEdit.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../../global'; @@ -7,10 +8,12 @@ import { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config'; import { findIntersectionWithSet } from '../../../../util/iteratees'; import { isUserId } from '../../../../global/helpers'; import getAnimationData from '../../../common/helpers/animatedAssets'; -import { - EXCLUDED_CHAT_TYPES, +import type { FolderEditDispatch, FoldersState, +} from '../../../../hooks/reducers/useFoldersReducer'; +import { + EXCLUDED_CHAT_TYPES, INCLUDED_CHAT_TYPES, selectChatFilters, } from '../../../../hooks/reducers/useFoldersReducer'; diff --git a/src/components/left/settings/folders/SettingsFoldersMain.tsx b/src/components/left/settings/folders/SettingsFoldersMain.tsx index 8d393279..180b2ffb 100644 --- a/src/components/left/settings/folders/SettingsFoldersMain.tsx +++ b/src/components/left/settings/folders/SettingsFoldersMain.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../../lib/teact/teact'; import React, { - FC, memo, useMemo, useCallback, useState, useEffect, + memo, useMemo, useCallback, useState, useEffect, } from '../../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../../global'; -import { ApiChatFolder } from '../../../../api/types'; +import type { ApiChatFolder } from '../../../../api/types'; import { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config'; import { throttle } from '../../../../util/schedulers'; diff --git a/src/components/left/settings/helpers/getSessionIcon.ts b/src/components/left/settings/helpers/getSessionIcon.ts index 50d5fe31..351c848a 100644 --- a/src/components/left/settings/helpers/getSessionIcon.ts +++ b/src/components/left/settings/helpers/getSessionIcon.ts @@ -1,4 +1,4 @@ -import { ApiSession } from '../../../../api/types'; +import type { ApiSession } from '../../../../api/types'; export default function getSessionIcon(session: ApiSession): string { const platform = session.platform.toLowerCase(); diff --git a/src/components/left/settings/helpers/privacy.ts b/src/components/left/settings/helpers/privacy.ts index 3cb30304..e97647ee 100644 --- a/src/components/left/settings/helpers/privacy.ts +++ b/src/components/left/settings/helpers/privacy.ts @@ -1,4 +1,5 @@ -import { ApiPrivacyKey, SettingsScreens } from '../../../../types'; +import type { ApiPrivacyKey } from '../../../../types'; +import { SettingsScreens } from '../../../../types'; export function getPrivacyKey(screen: SettingsScreens): ApiPrivacyKey | undefined { switch (screen) { diff --git a/src/components/left/settings/twoFa/SettingsTwoFa.tsx b/src/components/left/settings/twoFa/SettingsTwoFa.tsx index f8bab2dc..71e03133 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFa.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFa.tsx @@ -1,12 +1,11 @@ -import React, { - FC, memo, useCallback, useEffect, -} from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../../global'; -import { GlobalState } from '../../../../global/types'; +import type { GlobalState } from '../../../../global/types'; import { SettingsScreens } from '../../../../types'; -import { TwoFaDispatch, TwoFaState } from '../../../../hooks/reducers/useTwoFaReducer'; +import type { TwoFaDispatch, TwoFaState } from '../../../../hooks/reducers/useTwoFaReducer'; import useLang from '../../../../hooks/useLang'; import SettingsTwoFaEnabled from './SettingsTwoFaEnabled'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx b/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx index e3c590a8..60259040 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaCongratulations.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, useCallback } from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../../lib/teact/teact'; import { withGlobal } from '../../../../global'; -import { ApiSticker } from '../../../../api/types'; +import type { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; import { selectAnimatedEmoji } from '../../../../global/selectors'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx b/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx index c83d68e4..88de3ffe 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaEmailCode.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../../../lib/teact/teact'; import { withGlobal } from '../../../../global'; -import { ApiSticker } from '../../../../api/types'; +import type { ApiSticker } from '../../../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment'; import { selectAnimatedEmoji } from '../../../../global/selectors'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx b/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx index cab359dc..f74153d6 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaEnabled.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo } from '../../../../lib/teact/teact'; import { withGlobal } from '../../../../global'; -import { ApiSticker } from '../../../../api/types'; +import type { ApiSticker } from '../../../../api/types'; import { SettingsScreens } from '../../../../types'; import { selectAnimatedEmoji } from '../../../../global/selectors'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaPassword.tsx b/src/components/left/settings/twoFa/SettingsTwoFaPassword.tsx index 822d1021..35361f08 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaPassword.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaPassword.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useCallback, useState, -} from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo, useCallback, useState } from '../../../../lib/teact/teact'; import useLang from '../../../../hooks/useLang'; import useHistoryBack from '../../../../hooks/useHistoryBack'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx b/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx index 9fcacfbd..db39845e 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaSkippableForm.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../../../lib/teact/teact'; import { withGlobal } from '../../../../global'; -import { ApiSticker } from '../../../../api/types'; +import type { ApiSticker } from '../../../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../../util/environment'; import { selectAnimatedEmoji } from '../../../../global/selectors'; diff --git a/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx b/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx index 0b080549..47cdd089 100644 --- a/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx +++ b/src/components/left/settings/twoFa/SettingsTwoFaStart.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo } from '../../../../lib/teact/teact'; import { withGlobal } from '../../../../global'; -import { ApiSticker } from '../../../../api/types'; +import type { ApiSticker } from '../../../../api/types'; import { selectAnimatedEmoji } from '../../../../global/selectors'; import useLang from '../../../../hooks/useLang'; diff --git a/src/components/main/AppInactive.tsx b/src/components/main/AppInactive.tsx index 611c97c3..8ae585be 100644 --- a/src/components/main/AppInactive.tsx +++ b/src/components/main/AppInactive.tsx @@ -1,4 +1,5 @@ -import React, { FC, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback } from '../../lib/teact/teact'; import Button from '../ui/Button'; diff --git a/src/components/main/BotAttachModal.async.tsx b/src/components/main/BotAttachModal.async.tsx index 2b637a35..3136b904 100644 --- a/src/components/main/BotAttachModal.async.tsx +++ b/src/components/main/BotAttachModal.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; -import { OwnProps } from './BotAttachModal'; +import type { OwnProps } from './BotAttachModal'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/BotAttachModal.tsx b/src/components/main/BotAttachModal.tsx index 031d99cf..e5fbee35 100644 --- a/src/components/main/BotAttachModal.tsx +++ b/src/components/main/BotAttachModal.tsx @@ -1,7 +1,8 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import { getActions } from '../../global'; -import { ApiUser } from '../../api/types'; +import type { ApiUser } from '../../api/types'; import useLang from '../../hooks/useLang'; diff --git a/src/components/main/BotTrustModal.async.tsx b/src/components/main/BotTrustModal.async.tsx index b5e4c2b9..fd277029 100644 --- a/src/components/main/BotTrustModal.async.tsx +++ b/src/components/main/BotTrustModal.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; -import { OwnProps } from './BotTrustModal'; +import type { OwnProps } from './BotTrustModal'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/BotTrustModal.tsx b/src/components/main/BotTrustModal.tsx index f26152ff..bbc93d62 100644 --- a/src/components/main/BotTrustModal.tsx +++ b/src/components/main/BotTrustModal.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; import { getActions } from '../../global'; -import { ApiUser } from '../../api/types'; +import type { ApiUser } from '../../api/types'; import { getUserFullName } from '../../global/helpers'; import renderText from '../common/helpers/renderText'; diff --git a/src/components/main/Dialogs.async.tsx b/src/components/main/Dialogs.async.tsx index 0c214dda..c26ab7c4 100644 --- a/src/components/main/Dialogs.async.tsx +++ b/src/components/main/Dialogs.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/Dialogs.tsx b/src/components/main/Dialogs.tsx index 8182ef52..7d9e36f1 100644 --- a/src/components/main/Dialogs.tsx +++ b/src/components/main/Dialogs.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, useEffect } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useEffect } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { +import type { ApiContact, ApiError, ApiInviteInfo, ApiPhoto, } from '../../api/types'; diff --git a/src/components/main/DownloadManager.tsx b/src/components/main/DownloadManager.tsx index d44067a9..3a032311 100644 --- a/src/components/main/DownloadManager.tsx +++ b/src/components/main/DownloadManager.tsx @@ -1,10 +1,10 @@ -import { - FC, memo, useCallback, useEffect, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import { memo, useCallback, useEffect } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { Thread } from '../../global/types'; -import { ApiMediaFormat, ApiMessage } from '../../api/types'; +import type { Thread } from '../../global/types'; +import type { ApiMessage } from '../../api/types'; +import { ApiMediaFormat } from '../../api/types'; import * as mediaLoader from '../../util/mediaLoader'; import download from '../../util/download'; diff --git a/src/components/main/ForwardPicker.async.tsx b/src/components/main/ForwardPicker.async.tsx index b226ed86..5a764285 100644 --- a/src/components/main/ForwardPicker.async.tsx +++ b/src/components/main/ForwardPicker.async.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; -import { OwnProps } from './ForwardPicker'; +import type { OwnProps } from './ForwardPicker'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/ForwardPicker.tsx b/src/components/main/ForwardPicker.tsx index af53e19b..ad68ce17 100644 --- a/src/components/main/ForwardPicker.tsx +++ b/src/components/main/ForwardPicker.tsx @@ -1,10 +1,12 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useMemo, useState, memo, useRef, useCallback, useEffect, + useMemo, useState, memo, useRef, useCallback, useEffect, } from '../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../global'; -import { ApiChat, MAIN_THREAD_ID } from '../../api/types'; -import { GlobalState } from '../../global/types'; +import type { ApiChat } from '../../api/types'; +import { MAIN_THREAD_ID } from '../../api/types'; +import type { GlobalState } from '../../global/types'; import { filterChatsByName, diff --git a/src/components/main/GameModal.tsx b/src/components/main/GameModal.tsx index c4405ca5..4d1995d5 100644 --- a/src/components/main/GameModal.tsx +++ b/src/components/main/GameModal.tsx @@ -1,8 +1,7 @@ -import React, { - FC, memo, useCallback, useEffect, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../lib/teact/teact'; import { getActions } from '../../lib/teact/teactn'; -import { GlobalState } from '../../global/types'; +import type { GlobalState } from '../../global/types'; import windowSize from '../../util/windowSize'; diff --git a/src/components/main/HistoryCalendar.async.tsx b/src/components/main/HistoryCalendar.async.tsx index 830846bb..7fcb5788 100644 --- a/src/components/main/HistoryCalendar.async.tsx +++ b/src/components/main/HistoryCalendar.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; -import { OwnProps } from './HistoryCalendar'; +import type { OwnProps } from './HistoryCalendar'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/HistoryCalendar.tsx b/src/components/main/HistoryCalendar.tsx index 161fa547..00481d2b 100644 --- a/src/components/main/HistoryCalendar.tsx +++ b/src/components/main/HistoryCalendar.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; import useLang from '../../hooks/useLang'; diff --git a/src/components/main/Main.async.tsx b/src/components/main/Main.async.tsx index 915d5efd..69e4aa59 100644 --- a/src/components/main/Main.async.tsx +++ b/src/components/main/Main.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/Main.tsx b/src/components/main/Main.tsx index dc64b447..114ffce9 100644 --- a/src/components/main/Main.tsx +++ b/src/components/main/Main.tsx @@ -1,13 +1,14 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useEffect, memo, useCallback, useState, useRef, + useEffect, memo, useCallback, useState, useRef, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { LangCode } from '../../types'; -import { +import type { LangCode } from '../../types'; +import type { ApiChat, ApiMessage, ApiUpdateAuthorizationStateType, ApiUpdateConnectionStateType, } from '../../api/types'; -import { GlobalState } from '../../global/types'; +import type { GlobalState } from '../../global/types'; import '../../global/actions/all'; import { diff --git a/src/components/main/NewContactModal.async.tsx b/src/components/main/NewContactModal.async.tsx index f681e9f7..9d3af48c 100644 --- a/src/components/main/NewContactModal.async.tsx +++ b/src/components/main/NewContactModal.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; -import { OwnProps } from './NewContactModal'; +import type { OwnProps } from './NewContactModal'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/NewContactModal.tsx b/src/components/main/NewContactModal.tsx index 9ba8aae5..625f50c6 100644 --- a/src/components/main/NewContactModal.tsx +++ b/src/components/main/NewContactModal.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiCountryCode, ApiUser, ApiUserStatus } from '../../api/types'; +import type { ApiCountryCode, ApiUser, ApiUserStatus } from '../../api/types'; import { IS_TOUCH_ENV } from '../../util/environment'; import { getUserStatus } from '../../global/helpers'; diff --git a/src/components/main/Notifications.async.tsx b/src/components/main/Notifications.async.tsx index 8e457a56..ceb7d2db 100644 --- a/src/components/main/Notifications.async.tsx +++ b/src/components/main/Notifications.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/Notifications.tsx b/src/components/main/Notifications.tsx index 09752187..ce0dbe06 100644 --- a/src/components/main/Notifications.tsx +++ b/src/components/main/Notifications.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiNotification } from '../../api/types'; +import type { ApiNotification } from '../../api/types'; import { pick } from '../../util/iteratees'; import renderText from '../common/helpers/renderText'; diff --git a/src/components/main/SafeLinkModal.async.tsx b/src/components/main/SafeLinkModal.async.tsx index 1010c5c3..d63c6f52 100644 --- a/src/components/main/SafeLinkModal.async.tsx +++ b/src/components/main/SafeLinkModal.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; -import { OwnProps } from './SafeLinkModal'; +import type { OwnProps } from './SafeLinkModal'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/SafeLinkModal.tsx b/src/components/main/SafeLinkModal.tsx index 01e4b1ee..4429964b 100644 --- a/src/components/main/SafeLinkModal.tsx +++ b/src/components/main/SafeLinkModal.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; import { getActions } from '../../global'; import { ensureProtocol } from '../../util/ensureProtocol'; diff --git a/src/components/main/WebAppModal.async.tsx b/src/components/main/WebAppModal.async.tsx index 9ffb9494..c3c35fa6 100644 --- a/src/components/main/WebAppModal.async.tsx +++ b/src/components/main/WebAppModal.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; -import { OwnProps } from './WebAppModal'; +import type { OwnProps } from './WebAppModal'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/main/WebAppModal.tsx b/src/components/main/WebAppModal.tsx index 6f17fd07..270c2aba 100644 --- a/src/components/main/WebAppModal.tsx +++ b/src/components/main/WebAppModal.tsx @@ -1,11 +1,12 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useRef, useState, + memo, useCallback, useEffect, useMemo, useRef, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiChat } from '../../api/types'; -import { GlobalState } from '../../global/types'; -import { ThemeKey } from '../../types'; +import type { ApiChat } from '../../api/types'; +import type { GlobalState } from '../../global/types'; +import type { ThemeKey } from '../../types'; import windowSize from '../../util/windowSize'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; @@ -16,7 +17,8 @@ import { extractCurrentThemeParams, validateHexColor } from '../../util/themeSty import useInterval from '../../hooks/useInterval'; import useLang from '../../hooks/useLang'; import useOnChange from '../../hooks/useOnChange'; -import useWebAppFrame, { WebAppInboundEvent } from './hooks/useWebAppFrame'; +import type { WebAppInboundEvent } from './hooks/useWebAppFrame'; +import useWebAppFrame from './hooks/useWebAppFrame'; import usePrevious from '../../hooks/usePrevious'; import Modal from '../ui/Modal'; diff --git a/src/components/mediaViewer/MediaViewer.async.tsx b/src/components/mediaViewer/MediaViewer.async.tsx index 1b0efe89..39a07ac1 100644 --- a/src/components/mediaViewer/MediaViewer.async.tsx +++ b/src/components/mediaViewer/MediaViewer.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/mediaViewer/MediaViewer.tsx b/src/components/mediaViewer/MediaViewer.tsx index 7fc38083..a0353aa8 100644 --- a/src/components/mediaViewer/MediaViewer.tsx +++ b/src/components/mediaViewer/MediaViewer.tsx @@ -1,11 +1,13 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useRef, useState, + memo, useCallback, useEffect, useMemo, useRef, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { - ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser, +import type { + ApiChat, ApiDimensions, ApiMessage, ApiUser, } from '../../api/types'; +import { ApiMediaFormat } from '../../api/types'; import { MediaViewerOrigin } from '../../types'; import { ANIMATION_END_DELAY } from '../../config'; diff --git a/src/components/mediaViewer/MediaViewerActions.tsx b/src/components/mediaViewer/MediaViewerActions.tsx index b6e0e080..d4429b32 100644 --- a/src/components/mediaViewer/MediaViewerActions.tsx +++ b/src/components/mediaViewer/MediaViewerActions.tsx @@ -1,12 +1,12 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiMessage } from '../../api/types'; +import type { ApiMessage } from '../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; import { getMessageMediaHash } from '../../global/helpers'; diff --git a/src/components/mediaViewer/MediaViewerContent.tsx b/src/components/mediaViewer/MediaViewerContent.tsx index f5cc71a8..4108719b 100644 --- a/src/components/mediaViewer/MediaViewerContent.tsx +++ b/src/components/mediaViewer/MediaViewerContent.tsx @@ -1,9 +1,11 @@ -import React, { FC, memo, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; -import { - ApiChat, ApiDimensions, ApiMediaFormat, ApiMessage, ApiUser, +import type { + ApiChat, ApiDimensions, ApiMessage, ApiUser, } from '../../api/types'; +import { ApiMediaFormat } from '../../api/types'; import { MediaViewerOrigin } from '../../types'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../util/environment'; diff --git a/src/components/mediaViewer/MediaViewerFooter.tsx b/src/components/mediaViewer/MediaViewerFooter.tsx index deb4355f..b080b5ef 100644 --- a/src/components/mediaViewer/MediaViewerFooter.tsx +++ b/src/components/mediaViewer/MediaViewerFooter.tsx @@ -1,6 +1,7 @@ -import React, { FC, useEffect, useState } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useEffect, useState } from '../../lib/teact/teact'; -import { TextPart } from '../../types'; +import type { TextPart } from '../../types'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; import { throttle } from '../../util/schedulers'; diff --git a/src/components/mediaViewer/MediaViewerSlides.tsx b/src/components/mediaViewer/MediaViewerSlides.tsx index 7e666223..fc5d23c8 100644 --- a/src/components/mediaViewer/MediaViewerSlides.tsx +++ b/src/components/mediaViewer/MediaViewerSlides.tsx @@ -1,13 +1,15 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; -import { MediaViewerOrigin } from '../../types'; +import type { MediaViewerOrigin } from '../../types'; import useForceUpdate from '../../hooks/useForceUpdate'; import { animateNumber, timingFunctions } from '../../util/animation'; import arePropsShallowEqual from '../../util/arePropsShallowEqual'; -import { captureEvents, IOS_SCREEN_EDGE_THRESHOLD, RealTouchEvent } from '../../util/captureEvents'; +import type { RealTouchEvent } from '../../util/captureEvents'; +import { captureEvents, IOS_SCREEN_EDGE_THRESHOLD } from '../../util/captureEvents'; import { IS_IOS, IS_TOUCH_ENV } from '../../util/environment'; import { debounce } from '../../util/schedulers'; import useTimeout from '../../hooks/useTimeout'; diff --git a/src/components/mediaViewer/PanZoom.tsx b/src/components/mediaViewer/PanZoom.tsx index 220b10e2..3c72ccb4 100644 --- a/src/components/mediaViewer/PanZoom.tsx +++ b/src/components/mediaViewer/PanZoom.tsx @@ -4,8 +4,9 @@ Heavily inspired/lifted from this idea: https://stackoverflow.com/a/39311435/661768 without jqueryUI or jquery dependency. */ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useEffect, useRef, useState, + memo, useEffect, useRef, useState, } from '../../lib/teact/teact'; import { areSortedArraysEqual } from '../../util/iteratees'; diff --git a/src/components/mediaViewer/SenderInfo.tsx b/src/components/mediaViewer/SenderInfo.tsx index dc70b031..aa955ed1 100644 --- a/src/components/mediaViewer/SenderInfo.tsx +++ b/src/components/mediaViewer/SenderInfo.tsx @@ -1,7 +1,8 @@ -import React, { FC, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiChat, ApiMessage, ApiUser } from '../../api/types'; +import type { ApiChat, ApiMessage, ApiUser } from '../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; import { getSenderTitle, isUserId } from '../../global/helpers'; diff --git a/src/components/mediaViewer/SlideTransition.tsx b/src/components/mediaViewer/SlideTransition.tsx index 1ea53a42..50817080 100644 --- a/src/components/mediaViewer/SlideTransition.tsx +++ b/src/components/mediaViewer/SlideTransition.tsx @@ -1,8 +1,10 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import { IS_TOUCH_ENV } from '../../util/environment'; -import Transition, { ChildrenFn, TransitionProps } from '../ui/Transition'; +import type { ChildrenFn, TransitionProps } from '../ui/Transition'; +import Transition from '../ui/Transition'; const SlideTransition: FC = ({ children, ...props }) => { if (IS_TOUCH_ENV) return children(true, true, 1); diff --git a/src/components/mediaViewer/VideoPlayer.tsx b/src/components/mediaViewer/VideoPlayer.tsx index fc78793e..04ed9345 100644 --- a/src/components/mediaViewer/VideoPlayer.tsx +++ b/src/components/mediaViewer/VideoPlayer.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; import { getActions } from '../../global'; -import { ApiDimensions } from '../../api/types'; +import type { ApiDimensions } from '../../api/types'; import useBuffering from '../../hooks/useBuffering'; import useFullscreenStatus from '../../hooks/useFullscreen'; diff --git a/src/components/mediaViewer/VideoPlayerControls.tsx b/src/components/mediaViewer/VideoPlayerControls.tsx index ebf99f3f..46604fbc 100644 --- a/src/components/mediaViewer/VideoPlayerControls.tsx +++ b/src/components/mediaViewer/VideoPlayerControls.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useEffect, useRef, useCallback, useMemo, + useEffect, useRef, useCallback, useMemo, } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; @@ -8,7 +9,7 @@ import { IS_IOS, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; import { formatMediaDuration } from '../../util/dateFormat'; import formatFileSize from './helpers/formatFileSize'; import useLang from '../../hooks/useLang'; -import { BufferedRange } from '../../hooks/useBuffering'; +import type { BufferedRange } from '../../hooks/useBuffering'; import { captureEvents } from '../../util/captureEvents'; import Button from '../ui/Button'; diff --git a/src/components/mediaViewer/ZoomControls.tsx b/src/components/mediaViewer/ZoomControls.tsx index 963be515..1eba2992 100644 --- a/src/components/mediaViewer/ZoomControls.tsx +++ b/src/components/mediaViewer/ZoomControls.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; diff --git a/src/components/mediaViewer/helpers/ghostAnimation.ts b/src/components/mediaViewer/helpers/ghostAnimation.ts index 38569285..0ed68631 100644 --- a/src/components/mediaViewer/helpers/ghostAnimation.ts +++ b/src/components/mediaViewer/helpers/ghostAnimation.ts @@ -1,4 +1,4 @@ -import { ApiMessage, ApiDimensions } from '../../../api/types'; +import type { ApiMessage, ApiDimensions } from '../../../api/types'; import { MediaViewerOrigin } from '../../../types'; diff --git a/src/components/middle/ActionMessage.tsx b/src/components/middle/ActionMessage.tsx index 6e0fd200..88df0e00 100644 --- a/src/components/middle/ActionMessage.tsx +++ b/src/components/middle/ActionMessage.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useEffect, useMemo, useRef, + memo, useEffect, useMemo, useRef, } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; -import { ApiUser, ApiMessage, ApiChat } from '../../api/types'; -import { FocusDirection } from '../../types'; +import type { ApiUser, ApiMessage, ApiChat } from '../../api/types'; +import type { FocusDirection } from '../../types'; import { selectUser, @@ -17,7 +18,8 @@ import buildClassName from '../../util/buildClassName'; import { renderActionMessageText } from '../common/helpers/renderActionMessageText'; import useEnsureMessage from '../../hooks/useEnsureMessage'; import useContextMenuHandlers from '../../hooks/useContextMenuHandlers'; -import { ObserveFn, useOnIntersect } from '../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; +import { useOnIntersect } from '../../hooks/useIntersectionObserver'; import useFocusMessage from './message/hooks/useFocusMessage'; import useLang from '../../hooks/useLang'; diff --git a/src/components/middle/AudioPlayer.tsx b/src/components/middle/AudioPlayer.tsx index 5e2b2dc0..68bab165 100644 --- a/src/components/middle/AudioPlayer.tsx +++ b/src/components/middle/AudioPlayer.tsx @@ -1,10 +1,9 @@ -import React, { - FC, useCallback, useEffect, useMemo, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback, useEffect, useMemo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { AudioOrigin } from '../../types'; -import { +import type { AudioOrigin } from '../../types'; +import type { ApiAudio, ApiChat, ApiMessage, ApiUser, } from '../../api/types'; diff --git a/src/components/middle/ChatReportPanel.tsx b/src/components/middle/ChatReportPanel.tsx index 72fdcb7b..0fbb6270 100644 --- a/src/components/middle/ChatReportPanel.tsx +++ b/src/components/middle/ChatReportPanel.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useState, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback, useState } from '../../lib/teact/teact'; import { withGlobal, getActions } from '../../global'; -import { ApiChat, ApiChatSettings, ApiUser } from '../../api/types'; +import type { ApiChat, ApiChatSettings, ApiUser } from '../../api/types'; import { selectChat, selectUser } from '../../global/selectors'; import { diff --git a/src/components/middle/ContactGreeting.tsx b/src/components/middle/ContactGreeting.tsx index 6c71c338..9703cddf 100644 --- a/src/components/middle/ContactGreeting.tsx +++ b/src/components/middle/ContactGreeting.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types'; +import type { ApiSticker, ApiUpdateConnectionStateType } from '../../api/types'; import { selectChat } from '../../global/selectors'; import { useIntersectionObserver } from '../../hooks/useIntersectionObserver'; diff --git a/src/components/middle/DeleteSelectedMessageModal.tsx b/src/components/middle/DeleteSelectedMessageModal.tsx index e01670e8..a289cdea 100644 --- a/src/components/middle/DeleteSelectedMessageModal.tsx +++ b/src/components/middle/DeleteSelectedMessageModal.tsx @@ -1,6 +1,5 @@ -import React, { - FC, useCallback, memo, useEffect, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback, memo, useEffect } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; import { selectCanDeleteSelectedMessages, selectCurrentChat, selectUser } from '../../global/selectors'; diff --git a/src/components/middle/EmojiInteractionAnimation.async.tsx b/src/components/middle/EmojiInteractionAnimation.async.tsx index 77c51b43..5b1a32ff 100644 --- a/src/components/middle/EmojiInteractionAnimation.async.tsx +++ b/src/components/middle/EmojiInteractionAnimation.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './EmojiInteractionAnimation'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './EmojiInteractionAnimation'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/middle/EmojiInteractionAnimation.tsx b/src/components/middle/EmojiInteractionAnimation.tsx index 3f6eb36d..b484d5d9 100644 --- a/src/components/middle/EmojiInteractionAnimation.tsx +++ b/src/components/middle/EmojiInteractionAnimation.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState, + memo, useCallback, useEffect, useLayoutEffect, useRef, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ActiveEmojiInteraction } from '../../global/types'; +import type { ActiveEmojiInteraction } from '../../global/types'; import { ApiMediaFormat } from '../../api/types'; import { IS_ANDROID } from '../../util/environment'; diff --git a/src/components/middle/FloatingActionButtons.tsx b/src/components/middle/FloatingActionButtons.tsx index 46c04e72..4514f0e9 100644 --- a/src/components/middle/FloatingActionButtons.tsx +++ b/src/components/middle/FloatingActionButtons.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, memo, useRef, useEffect, + useCallback, memo, useRef, useEffect, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { MessageListType } from '../../global/types'; +import type { MessageListType } from '../../global/types'; import { MAIN_THREAD_ID } from '../../api/types'; import { selectChat, selectCurrentMessageList } from '../../global/selectors'; diff --git a/src/components/middle/HeaderActions.tsx b/src/components/middle/HeaderActions.tsx index b645a28b..d0bf8d78 100644 --- a/src/components/middle/HeaderActions.tsx +++ b/src/components/middle/HeaderActions.tsx @@ -1,5 +1,5 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useRef, useCallback, @@ -7,9 +7,10 @@ import React, { } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { MessageListType } from '../../global/types'; +import type { MessageListType } from '../../global/types'; import { MAIN_THREAD_ID } from '../../api/types'; -import { IAnchorPosition, ManagementScreens } from '../../types'; +import type { IAnchorPosition } from '../../types'; +import { ManagementScreens } from '../../types'; import { ARE_CALLS_SUPPORTED, IS_PWA, IS_SINGLE_COLUMN_LAYOUT, diff --git a/src/components/middle/HeaderMenuContainer.async.tsx b/src/components/middle/HeaderMenuContainer.async.tsx index 47e309e1..2e6a24be 100644 --- a/src/components/middle/HeaderMenuContainer.async.tsx +++ b/src/components/middle/HeaderMenuContainer.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './HeaderMenuContainer'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './HeaderMenuContainer'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/middle/HeaderMenuContainer.tsx b/src/components/middle/HeaderMenuContainer.tsx index 8bad2d14..a367fb0d 100644 --- a/src/components/middle/HeaderMenuContainer.tsx +++ b/src/components/middle/HeaderMenuContainer.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiBotCommand, ApiChat } from '../../api/types'; -import { IAnchorPosition } from '../../types'; +import type { ApiBotCommand, ApiChat } from '../../api/types'; +import type { IAnchorPosition } from '../../types'; import { REPLIES_USER_ID } from '../../config'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; diff --git a/src/components/middle/HeaderPinnedMessage.tsx b/src/components/middle/HeaderPinnedMessage.tsx index 9d221fed..8035c7a8 100644 --- a/src/components/middle/HeaderPinnedMessage.tsx +++ b/src/components/middle/HeaderPinnedMessage.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; import { getActions } from '../../global'; -import { ApiMessage } from '../../api/types'; +import type { ApiMessage } from '../../api/types'; import { getPictogramDimensions } from '../common/helpers/mediaDimensions'; import { getMessageMediaHash, getMessageSingleInlineButton } from '../../global/helpers'; diff --git a/src/components/middle/MessageList.tsx b/src/components/middle/MessageList.tsx index c44e7bdf..6d8050c2 100644 --- a/src/components/middle/MessageList.tsx +++ b/src/components/middle/MessageList.tsx @@ -1,12 +1,12 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useRef, useState, + memo, useCallback, useEffect, useMemo, useRef, useState, } from '../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../global'; -import { - ApiMessage, ApiRestrictionReason, MAIN_THREAD_ID, -} from '../../api/types'; -import { MessageListType } from '../../global/types'; +import type { ApiMessage, ApiRestrictionReason } from '../../api/types'; +import { MAIN_THREAD_ID } from '../../api/types'; +import type { MessageListType } from '../../global/types'; import { LoadMoreDirection } from '../../types'; import { ANIMATION_END_DELAY, LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SLICE } from '../../config'; diff --git a/src/components/middle/MessageListContent.tsx b/src/components/middle/MessageListContent.tsx index 1c8dedda..fb865444 100644 --- a/src/components/middle/MessageListContent.tsx +++ b/src/components/middle/MessageListContent.tsx @@ -1,7 +1,8 @@ -import { RefObject } from 'react'; -import React, { FC, memo } from '../../lib/teact/teact'; +import type { RefObject } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; -import { MessageListType } from '../../global/types'; +import type { MessageListType } from '../../global/types'; import { SCHEDULED_WHEN_ONLINE } from '../../config'; import buildClassName from '../../util/buildClassName'; @@ -11,7 +12,8 @@ import { getMessageHtmlId, getMessageOriginalId, isActionMessage, isOwnMessage, } from '../../global/helpers'; import useLang from '../../hooks/useLang'; -import { isAlbum, MessageDateGroup } from './helpers/groupMessages'; +import type { MessageDateGroup } from './helpers/groupMessages'; +import { isAlbum } from './helpers/groupMessages'; import { preventMessageInputBlur } from './helpers/preventMessageInputBlur'; import useScrollHooks from './hooks/useScrollHooks'; import useMessageObservers from './hooks/useMessageObservers'; diff --git a/src/components/middle/MessageListHistoryHandler.tsx b/src/components/middle/MessageListHistoryHandler.tsx index 7267f67a..ccc0d244 100644 --- a/src/components/middle/MessageListHistoryHandler.tsx +++ b/src/components/middle/MessageListHistoryHandler.tsx @@ -1,9 +1,10 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../lib/teact/teactn'; import { createMessageHash } from '../../util/routing'; import useHistoryBack from '../../hooks/useHistoryBack'; -import { MessageList as GlobalMessageList } from '../../global/types'; +import type { MessageList as GlobalMessageList } from '../../global/types'; type StateProps = { messageLists?: GlobalMessageList[]; diff --git a/src/components/middle/MessageSelectToolbar.async.tsx b/src/components/middle/MessageSelectToolbar.async.tsx index 7e74f283..e2b87e40 100644 --- a/src/components/middle/MessageSelectToolbar.async.tsx +++ b/src/components/middle/MessageSelectToolbar.async.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; -import { OwnProps } from './MessageSelectToolbar'; +import type { OwnProps } from './MessageSelectToolbar'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/middle/MessageSelectToolbar.tsx b/src/components/middle/MessageSelectToolbar.tsx index abc074a9..294db266 100644 --- a/src/components/middle/MessageSelectToolbar.tsx +++ b/src/components/middle/MessageSelectToolbar.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useEffect, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { MessageListType } from '../../global/types'; +import type { MessageListType } from '../../global/types'; import { selectCanDeleteSelectedMessages, diff --git a/src/components/middle/MiddleColumn.tsx b/src/components/middle/MiddleColumn.tsx index c53db5d2..706431fe 100644 --- a/src/components/middle/MiddleColumn.tsx +++ b/src/components/middle/MiddleColumn.tsx @@ -1,14 +1,16 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useEffect, useState, memo, useMemo, useCallback, + useEffect, useState, memo, useMemo, useCallback, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiChatBannedRights, MAIN_THREAD_ID } from '../../api/types'; -import { +import type { ApiChatBannedRights } from '../../api/types'; +import { MAIN_THREAD_ID } from '../../api/types'; +import type { MessageListType, ActiveEmojiInteraction, } from '../../global/types'; -import { ThemeKey } from '../../types'; +import type { ThemeKey } from '../../types'; import { MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN, diff --git a/src/components/middle/MiddleHeader.tsx b/src/components/middle/MiddleHeader.tsx index 56e4a2be..c6e6ce80 100644 --- a/src/components/middle/MiddleHeader.tsx +++ b/src/components/middle/MiddleHeader.tsx @@ -1,13 +1,15 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; import cycleRestrict from '../../util/cycleRestrict'; -import { GlobalState, MessageListType } from '../../global/types'; -import { - ApiChat, ApiMessage, ApiTypingStatus, ApiUser, MAIN_THREAD_ID, +import type { GlobalState, MessageListType } from '../../global/types'; +import type { + ApiChat, ApiMessage, ApiTypingStatus, ApiUser, } from '../../api/types'; +import { MAIN_THREAD_ID } from '../../api/types'; import { EDITABLE_INPUT_CSS_SELECTOR, diff --git a/src/components/middle/MobileSearch.async.tsx b/src/components/middle/MobileSearch.async.tsx index c22731ec..4ec09dff 100644 --- a/src/components/middle/MobileSearch.async.tsx +++ b/src/components/middle/MobileSearch.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './MobileSearch'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './MobileSearch'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/middle/MobileSearch.tsx b/src/components/middle/MobileSearch.tsx index b5d2b383..391d52dc 100644 --- a/src/components/middle/MobileSearch.tsx +++ b/src/components/middle/MobileSearch.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, useLayoutEffect, + memo, useCallback, useEffect, useRef, useState, useLayoutEffect, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiChat } from '../../api/types'; +import type { ApiChat } from '../../api/types'; import { debounce } from '../../util/schedulers'; import { selectCurrentTextSearch, selectCurrentChat } from '../../global/selectors'; diff --git a/src/components/middle/NoMessages.tsx b/src/components/middle/NoMessages.tsx index c4d73fb4..00ae868c 100644 --- a/src/components/middle/NoMessages.tsx +++ b/src/components/middle/NoMessages.tsx @@ -1,8 +1,10 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; -import { MessageListType } from '../../global/types'; +import type { MessageListType } from '../../global/types'; -import useLang, { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useLang'; +import useLang from '../../hooks/useLang'; import './NoMessages.scss'; diff --git a/src/components/middle/PinnedMessageNavigation.tsx b/src/components/middle/PinnedMessageNavigation.tsx index 96ac7143..996787fa 100644 --- a/src/components/middle/PinnedMessageNavigation.tsx +++ b/src/components/middle/PinnedMessageNavigation.tsx @@ -1,5 +1,5 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useRef, useEffect, useMemo, diff --git a/src/components/middle/ReactorListModal.async.tsx b/src/components/middle/ReactorListModal.async.tsx index 8d221cbb..87cb96d4 100644 --- a/src/components/middle/ReactorListModal.async.tsx +++ b/src/components/middle/ReactorListModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './ReactorListModal'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './ReactorListModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/middle/ReactorListModal.tsx b/src/components/middle/ReactorListModal.tsx index d12dc88e..1979795c 100644 --- a/src/components/middle/ReactorListModal.tsx +++ b/src/components/middle/ReactorListModal.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, memo, useMemo, useEffect, useState, useRef, + useCallback, memo, useMemo, useEffect, useState, useRef, } from '../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../global'; -import { ApiMessage } from '../../api/types'; +import type { ApiMessage } from '../../api/types'; import { LoadMoreDirection } from '../../types'; import useLang from '../../hooks/useLang'; diff --git a/src/components/middle/ScrollDownButton.tsx b/src/components/middle/ScrollDownButton.tsx index c4c408ed..d9fa9cc4 100644 --- a/src/components/middle/ScrollDownButton.tsx +++ b/src/components/middle/ScrollDownButton.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo, useRef } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useRef } from '../../lib/teact/teact'; import { formatIntegerCompact } from '../../util/textFormat'; import useLang from '../../hooks/useLang'; diff --git a/src/components/middle/composer/AttachMenu.tsx b/src/components/middle/composer/AttachMenu.tsx index 9e33f08e..9227501e 100644 --- a/src/components/middle/composer/AttachMenu.tsx +++ b/src/components/middle/composer/AttachMenu.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useEffect, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../../lib/teact/teact'; -import { GlobalState } from '../../../global/types'; -import { ISettings } from '../../../types'; +import type { GlobalState } from '../../../global/types'; +import type { ISettings } from '../../../types'; import { CONTENT_TYPES_WITH_PREVIEW } from '../../../config'; import { IS_TOUCH_ENV } from '../../../util/environment'; diff --git a/src/components/middle/composer/AttachmentMenuBotIcon.tsx b/src/components/middle/composer/AttachmentMenuBotIcon.tsx index 94e5c454..f224452a 100644 --- a/src/components/middle/composer/AttachmentMenuBotIcon.tsx +++ b/src/components/middle/composer/AttachmentMenuBotIcon.tsx @@ -1,7 +1,9 @@ -import React, { FC, memo, useMemo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useMemo } from '../../../lib/teact/teact'; -import { ISettings } from '../../../types'; -import { ApiDocument, ApiMediaFormat } from '../../../api/types'; +import type { ISettings } from '../../../types'; +import type { ApiDocument } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; import { IS_COMPACT_MENU } from '../../../util/environment'; import useMedia from '../../../hooks/useMedia'; diff --git a/src/components/middle/composer/AttachmentMenuBotItem.tsx b/src/components/middle/composer/AttachmentMenuBotItem.tsx index 272e92ae..3d8e44b5 100644 --- a/src/components/middle/composer/AttachmentMenuBotItem.tsx +++ b/src/components/middle/composer/AttachmentMenuBotItem.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useState, + memo, useCallback, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { IAnchorPosition, ISettings } from '../../../types'; -import { ApiAttachMenuBot } from '../../../api/types'; +import type { IAnchorPosition, ISettings } from '../../../types'; +import type { ApiAttachMenuBot } from '../../../api/types'; import useFlag from '../../../hooks/useFlag'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/middle/composer/AttachmentModal.async.tsx b/src/components/middle/composer/AttachmentModal.async.tsx index 933bb169..56dea431 100644 --- a/src/components/middle/composer/AttachmentModal.async.tsx +++ b/src/components/middle/composer/AttachmentModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './AttachmentModal'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './AttachmentModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/AttachmentModal.tsx b/src/components/middle/composer/AttachmentModal.tsx index f279aab8..2d032124 100644 --- a/src/components/middle/composer/AttachmentModal.tsx +++ b/src/components/middle/composer/AttachmentModal.tsx @@ -1,8 +1,9 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../../lib/teact/teact'; -import { ApiAttachment, ApiChatMember } from '../../../api/types'; +import type { ApiAttachment, ApiChatMember } from '../../../api/types'; import { CONTENT_TYPES_WITH_PREVIEW, diff --git a/src/components/middle/composer/BotCommand.tsx b/src/components/middle/composer/BotCommand.tsx index e8df5e99..7d9ba2dd 100644 --- a/src/components/middle/composer/BotCommand.tsx +++ b/src/components/middle/composer/BotCommand.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; -import { ApiBotCommand, ApiUser } from '../../../api/types'; +import type { ApiBotCommand, ApiUser } from '../../../api/types'; import renderText from '../../common/helpers/renderText'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/composer/BotCommandMenu.async.tsx b/src/components/middle/composer/BotCommandMenu.async.tsx index dcc98042..0a3db04b 100644 --- a/src/components/middle/composer/BotCommandMenu.async.tsx +++ b/src/components/middle/composer/BotCommandMenu.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './BotCommandMenu'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './BotCommandMenu'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/BotCommandMenu.tsx b/src/components/middle/composer/BotCommandMenu.tsx index 022112c2..c5b0f5a7 100644 --- a/src/components/middle/composer/BotCommandMenu.tsx +++ b/src/components/middle/composer/BotCommandMenu.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; -import { ApiBotCommand } from '../../../api/types'; +import type { ApiBotCommand } from '../../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment'; import useMouseInside from '../../../hooks/useMouseInside'; diff --git a/src/components/middle/composer/BotCommandTooltip.async.tsx b/src/components/middle/composer/BotCommandTooltip.async.tsx index d6b41c73..18720f63 100644 --- a/src/components/middle/composer/BotCommandTooltip.async.tsx +++ b/src/components/middle/composer/BotCommandTooltip.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './BotCommandTooltip'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './BotCommandTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/BotCommandTooltip.tsx b/src/components/middle/composer/BotCommandTooltip.tsx index dc129e25..ce57a270 100644 --- a/src/components/middle/composer/BotCommandTooltip.tsx +++ b/src/components/middle/composer/BotCommandTooltip.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useCallback, useEffect, useRef, memo, + useCallback, useEffect, useRef, memo, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiBotCommand, ApiUser } from '../../../api/types'; +import type { ApiBotCommand, ApiUser } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import setTooltipItemVisible from '../../../util/setTooltipItemVisible'; diff --git a/src/components/middle/composer/BotKeyboardMenu.tsx b/src/components/middle/composer/BotKeyboardMenu.tsx index f05cc956..6d540ac8 100644 --- a/src/components/middle/composer/BotKeyboardMenu.tsx +++ b/src/components/middle/composer/BotKeyboardMenu.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useEffect, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiMessage } from '../../../api/types'; +import type { ApiMessage } from '../../../api/types'; import { IS_TOUCH_ENV } from '../../../util/environment'; import { selectChatMessage, selectCurrentMessageList } from '../../../global/selectors'; diff --git a/src/components/middle/composer/BotMenuButton.tsx b/src/components/middle/composer/BotMenuButton.tsx index 65fbdaa5..c7713b9e 100644 --- a/src/components/middle/composer/BotMenuButton.tsx +++ b/src/components/middle/composer/BotMenuButton.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useEffect, useRef, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useEffect, useRef } from '../../../lib/teact/teact'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/composer/Composer.tsx b/src/components/middle/composer/Composer.tsx index a38f9abf..1fb3a320 100644 --- a/src/components/middle/composer/Composer.tsx +++ b/src/components/middle/composer/Composer.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, + memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; -import { GlobalState, MessageListType } from '../../../global/types'; -import { +import type { GlobalState, MessageListType } from '../../../global/types'; +import type { ApiAttachment, ApiBotInlineResult, ApiBotInlineMediaResult, @@ -16,11 +17,13 @@ import { ApiChat, ApiChatMember, ApiUser, - MAIN_THREAD_ID, ApiBotCommand, ApiBotMenuButton, } from '../../../api/types'; -import { InlineBotSettings, ISettings } from '../../../types'; +import { + MAIN_THREAD_ID, +} from '../../../api/types'; +import type { InlineBotSettings, ISettings } from '../../../types'; import { BASE_EMOJI_KEYWORD_LANG, diff --git a/src/components/middle/composer/ComposerEmbeddedMessage.tsx b/src/components/middle/composer/ComposerEmbeddedMessage.tsx index 655474e1..ddd2bf29 100644 --- a/src/components/middle/composer/ComposerEmbeddedMessage.tsx +++ b/src/components/middle/composer/ComposerEmbeddedMessage.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useEffect, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiMessage, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiMessage, ApiUser } from '../../../api/types'; import { selectChat, diff --git a/src/components/middle/composer/CustomSendMenu.async.tsx b/src/components/middle/composer/CustomSendMenu.async.tsx index 9f6ca62a..5ceabe44 100644 --- a/src/components/middle/composer/CustomSendMenu.async.tsx +++ b/src/components/middle/composer/CustomSendMenu.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './CustomSendMenu'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './CustomSendMenu'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/CustomSendMenu.tsx b/src/components/middle/composer/CustomSendMenu.tsx index 7bd19a5f..2785b444 100644 --- a/src/components/middle/composer/CustomSendMenu.tsx +++ b/src/components/middle/composer/CustomSendMenu.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import { IS_TOUCH_ENV } from '../../../util/environment'; import useMouseInside from '../../../hooks/useMouseInside'; diff --git a/src/components/middle/composer/DropArea.async.tsx b/src/components/middle/composer/DropArea.async.tsx index 621f82c6..63ea2981 100644 --- a/src/components/middle/composer/DropArea.async.tsx +++ b/src/components/middle/composer/DropArea.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './DropArea'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './DropArea'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/DropArea.tsx b/src/components/middle/composer/DropArea.tsx index 4eb60ff4..92dd5c0e 100644 --- a/src/components/middle/composer/DropArea.tsx +++ b/src/components/middle/composer/DropArea.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../../lib/teact/teact'; import useShowTransition from '../../../hooks/useShowTransition'; diff --git a/src/components/middle/composer/DropTarget.tsx b/src/components/middle/composer/DropTarget.tsx index bd8fac34..4ca8c2a9 100644 --- a/src/components/middle/composer/DropTarget.tsx +++ b/src/components/middle/composer/DropTarget.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import useFlag from '../../../hooks/useFlag'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/composer/EmojiButton.tsx b/src/components/middle/composer/EmojiButton.tsx index 0cf7c764..92dc626b 100644 --- a/src/components/middle/composer/EmojiButton.tsx +++ b/src/components/middle/composer/EmojiButton.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useCallback, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { IS_EMOJI_SUPPORTED } from '../../../util/environment'; import { handleEmojiLoad, LOADED_EMOJIS } from '../../../util/emoji'; diff --git a/src/components/middle/composer/EmojiCategory.tsx b/src/components/middle/composer/EmojiCategory.tsx index dd9f0c5b..13767d61 100644 --- a/src/components/middle/composer/EmojiCategory.tsx +++ b/src/components/middle/composer/EmojiCategory.tsx @@ -1,11 +1,13 @@ -import React, { FC, memo, useRef } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useRef } from '../../../lib/teact/teact'; import { RECENT_SYMBOL_SET_ID } from '../../../config'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; import buildClassName from '../../../util/buildClassName'; import windowSize from '../../../util/windowSize'; -import { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import { useOnIntersect } from '../../../hooks/useIntersectionObserver'; import useMediaTransition from '../../../hooks/useMediaTransition'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/middle/composer/EmojiPicker.tsx b/src/components/middle/composer/EmojiPicker.tsx index a8b9d669..07398515 100644 --- a/src/components/middle/composer/EmojiPicker.tsx +++ b/src/components/middle/composer/EmojiPicker.tsx @@ -1,17 +1,20 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useState, useEffect, memo, useRef, useMemo, useCallback, + useState, useEffect, memo, useRef, useMemo, useCallback, } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; -import { GlobalState } from '../../../global/types'; +import type { GlobalState } from '../../../global/types'; import { MENU_TRANSITION_DURATION, RECENT_SYMBOL_SET_ID } from '../../../config'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment'; import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; -import { +import type { EmojiModule, EmojiRawData, EmojiData, +} from '../../../util/emoji'; +import { uncompressEmoji, } from '../../../util/emoji'; import fastSmoothScroll from '../../../util/fastSmoothScroll'; diff --git a/src/components/middle/composer/EmojiTooltip.async.tsx b/src/components/middle/composer/EmojiTooltip.async.tsx index e581b315..10f90997 100644 --- a/src/components/middle/composer/EmojiTooltip.async.tsx +++ b/src/components/middle/composer/EmojiTooltip.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './EmojiTooltip'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './EmojiTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/EmojiTooltip.tsx b/src/components/middle/composer/EmojiTooltip.tsx index 28ea5c86..83d8a995 100644 --- a/src/components/middle/composer/EmojiTooltip.tsx +++ b/src/components/middle/composer/EmojiTooltip.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../../lib/teact/teact'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/composer/GifPicker.tsx b/src/components/middle/composer/GifPicker.tsx index fc3ac694..9ce380b4 100644 --- a/src/components/middle/composer/GifPicker.tsx +++ b/src/components/middle/composer/GifPicker.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useEffect, memo, useRef, useCallback, + useEffect, memo, useRef, useCallback, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiVideo } from '../../../api/types'; +import type { ApiVideo } from '../../../api/types'; import { SLIDE_TRANSITION_DURATION } from '../../../config'; import { IS_TOUCH_ENV } from '../../../util/environment'; diff --git a/src/components/middle/composer/InlineBotTooltip.async.tsx b/src/components/middle/composer/InlineBotTooltip.async.tsx index 8e1530ae..bb4fa6e6 100644 --- a/src/components/middle/composer/InlineBotTooltip.async.tsx +++ b/src/components/middle/composer/InlineBotTooltip.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './InlineBotTooltip'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './InlineBotTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/InlineBotTooltip.tsx b/src/components/middle/composer/InlineBotTooltip.tsx index 35b5e8c0..0de799da 100644 --- a/src/components/middle/composer/InlineBotTooltip.tsx +++ b/src/components/middle/composer/InlineBotTooltip.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm } from '../../../api/types'; +import type { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm } from '../../../api/types'; import { LoadMoreDirection } from '../../../types'; import { IS_TOUCH_ENV } from '../../../util/environment'; diff --git a/src/components/middle/composer/MentionTooltip.async.tsx b/src/components/middle/composer/MentionTooltip.async.tsx index 228d9a30..6edd2724 100644 --- a/src/components/middle/composer/MentionTooltip.async.tsx +++ b/src/components/middle/composer/MentionTooltip.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './MentionTooltip'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './MentionTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/MentionTooltip.tsx b/src/components/middle/composer/MentionTooltip.tsx index 19761017..a566b02a 100644 --- a/src/components/middle/composer/MentionTooltip.tsx +++ b/src/components/middle/composer/MentionTooltip.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useCallback, useEffect, useRef, memo, + useCallback, useEffect, useRef, memo, } from '../../../lib/teact/teact'; import { getGlobal } from '../../../global'; -import { ApiUser } from '../../../api/types'; +import type { ApiUser } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import setTooltipItemVisible from '../../../util/setTooltipItemVisible'; diff --git a/src/components/middle/composer/MessageInput.tsx b/src/components/middle/composer/MessageInput.tsx index 6d1ff2d5..209ce90d 100644 --- a/src/components/middle/composer/MessageInput.tsx +++ b/src/components/middle/composer/MessageInput.tsx @@ -1,10 +1,11 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useEffect, useRef, memo, useState, useCallback, + useEffect, useRef, memo, useState, useCallback, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { IAnchorPosition, ISettings } from '../../../types'; +import type { IAnchorPosition, ISettings } from '../../../types'; import { EDITABLE_INPUT_ID } from '../../../config'; import { selectReplyingToId } from '../../../global/selectors'; diff --git a/src/components/middle/composer/PollModal.async.tsx b/src/components/middle/composer/PollModal.async.tsx index bdbd373f..8abdbfac 100644 --- a/src/components/middle/composer/PollModal.async.tsx +++ b/src/components/middle/composer/PollModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './PollModal'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './PollModal'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/PollModal.tsx b/src/components/middle/composer/PollModal.tsx index 55d70df2..f19ac5ad 100644 --- a/src/components/middle/composer/PollModal.tsx +++ b/src/components/middle/composer/PollModal.tsx @@ -1,9 +1,10 @@ -import { ChangeEvent, RefObject } from 'react'; +import type { ChangeEvent, RefObject } from 'react'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState, + memo, useCallback, useEffect, useLayoutEffect, useRef, useState, } from '../../../lib/teact/teact'; -import { ApiNewPoll } from '../../../api/types'; +import type { ApiNewPoll } from '../../../api/types'; import captureEscKeyListener from '../../../util/captureEscKeyListener'; import parseMessageInput from '../../../util/parseMessageInput'; diff --git a/src/components/middle/composer/SendAsMenu.async.tsx b/src/components/middle/composer/SendAsMenu.async.tsx index 72a8ba20..bfc74d23 100644 --- a/src/components/middle/composer/SendAsMenu.async.tsx +++ b/src/components/middle/composer/SendAsMenu.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './SendAsMenu'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './SendAsMenu'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/SendAsMenu.tsx b/src/components/middle/composer/SendAsMenu.tsx index c98cb35a..76bdc73c 100644 --- a/src/components/middle/composer/SendAsMenu.tsx +++ b/src/components/middle/composer/SendAsMenu.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useCallback, useEffect, useRef, memo, + useCallback, useEffect, useRef, memo, } from '../../../lib/teact/teact'; import setTooltipItemVisible from '../../../util/setTooltipItemVisible'; diff --git a/src/components/middle/composer/StickerPicker.tsx b/src/components/middle/composer/StickerPicker.tsx index fafa19b5..013547ee 100644 --- a/src/components/middle/composer/StickerPicker.tsx +++ b/src/components/middle/composer/StickerPicker.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useState, useEffect, memo, useRef, useMemo, useCallback, + useState, useEffect, memo, useRef, useMemo, useCallback, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiStickerSet, ApiSticker, ApiChat } from '../../../api/types'; -import { StickerSetOrRecent } from '../../../types'; +import type { ApiStickerSet, ApiSticker, ApiChat } from '../../../api/types'; +import type { StickerSetOrRecent } from '../../../types'; import { CHAT_STICKER_SET_ID, diff --git a/src/components/middle/composer/StickerSet.tsx b/src/components/middle/composer/StickerSet.tsx index ed0717de..9366c5ac 100644 --- a/src/components/middle/composer/StickerSet.tsx +++ b/src/components/middle/composer/StickerSet.tsx @@ -1,11 +1,13 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useRef, + memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { ApiSticker } from '../../../api/types'; -import { StickerSetOrRecent } from '../../../types'; -import { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver'; +import type { ApiSticker } from '../../../api/types'; +import type { StickerSetOrRecent } from '../../../types'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import { useOnIntersect } from '../../../hooks/useIntersectionObserver'; import { FAVORITE_SYMBOL_SET_ID, RECENT_SYMBOL_SET_ID, STICKER_SIZE_PICKER } from '../../../config'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; diff --git a/src/components/middle/composer/StickerSetCover.tsx b/src/components/middle/composer/StickerSetCover.tsx index 11b01450..b37b2b32 100644 --- a/src/components/middle/composer/StickerSetCover.tsx +++ b/src/components/middle/composer/StickerSetCover.tsx @@ -1,12 +1,12 @@ -import React, { - FC, memo, useMemo, useRef, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useMemo, useRef } from '../../../lib/teact/teact'; -import { ApiStickerSet } from '../../../api/types'; +import type { ApiStickerSet } from '../../../api/types'; import { IS_WEBM_SUPPORTED } from '../../../util/environment'; import { getFirstLetters } from '../../../util/textFormat'; -import { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../../hooks/useIntersectionObserver'; import useMedia from '../../../hooks/useMedia'; import useMediaTransition from '../../../hooks/useMediaTransition'; diff --git a/src/components/middle/composer/StickerSetCoverAnimated.tsx b/src/components/middle/composer/StickerSetCoverAnimated.tsx index c01854be..b164e671 100644 --- a/src/components/middle/composer/StickerSetCoverAnimated.tsx +++ b/src/components/middle/composer/StickerSetCoverAnimated.tsx @@ -1,11 +1,12 @@ -import React, { - FC, memo, useMemo, useRef, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useMemo, useRef } from '../../../lib/teact/teact'; -import { ApiMediaFormat, ApiStickerSet } from '../../../api/types'; +import type { ApiStickerSet } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; import { STICKER_SIZE_PICKER_HEADER } from '../../../config'; -import { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../../hooks/useIntersectionObserver'; import useMedia from '../../../hooks/useMedia'; import useMediaTransition from '../../../hooks/useMediaTransition'; import { getFirstLetters } from '../../../util/textFormat'; diff --git a/src/components/middle/composer/StickerTooltip.async.tsx b/src/components/middle/composer/StickerTooltip.async.tsx index 10fb478f..8b9188b6 100644 --- a/src/components/middle/composer/StickerTooltip.async.tsx +++ b/src/components/middle/composer/StickerTooltip.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './StickerTooltip'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './StickerTooltip'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/StickerTooltip.tsx b/src/components/middle/composer/StickerTooltip.tsx index f1f8962d..b68ce756 100644 --- a/src/components/middle/composer/StickerTooltip.tsx +++ b/src/components/middle/composer/StickerTooltip.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useEffect, useRef, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useEffect, useRef } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiSticker } from '../../../api/types'; +import type { ApiSticker } from '../../../api/types'; import { STICKER_SIZE_PICKER } from '../../../config'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/composer/SymbolMenu.async.tsx b/src/components/middle/composer/SymbolMenu.async.tsx index 9d06659f..bfa6ff6e 100644 --- a/src/components/middle/composer/SymbolMenu.async.tsx +++ b/src/components/middle/composer/SymbolMenu.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './SymbolMenu'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './SymbolMenu'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/SymbolMenu.tsx b/src/components/middle/composer/SymbolMenu.tsx index 7cb50293..0115eb9a 100644 --- a/src/components/middle/composer/SymbolMenu.tsx +++ b/src/components/middle/composer/SymbolMenu.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState, + memo, useCallback, useEffect, useLayoutEffect, useRef, useState, } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; -import { ApiSticker, ApiVideo } from '../../../api/types'; +import type { ApiSticker, ApiVideo } from '../../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TOUCH_ENV } from '../../../util/environment'; import { fastRaf } from '../../../util/schedulers'; diff --git a/src/components/middle/composer/SymbolMenuFooter.tsx b/src/components/middle/composer/SymbolMenuFooter.tsx index b4511ce2..d7d9b8be 100644 --- a/src/components/middle/composer/SymbolMenuFooter.tsx +++ b/src/components/middle/composer/SymbolMenuFooter.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/middle/composer/TextFormatter.async.tsx b/src/components/middle/composer/TextFormatter.async.tsx index fa588d8b..b4563cd0 100644 --- a/src/components/middle/composer/TextFormatter.async.tsx +++ b/src/components/middle/composer/TextFormatter.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './TextFormatter'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './TextFormatter'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/composer/TextFormatter.tsx b/src/components/middle/composer/TextFormatter.tsx index f5686853..48340551 100644 --- a/src/components/middle/composer/TextFormatter.tsx +++ b/src/components/middle/composer/TextFormatter.tsx @@ -1,8 +1,9 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../../lib/teact/teact'; -import { IAnchorPosition } from '../../../types'; +import type { IAnchorPosition } from '../../../types'; import { ApiMessageEntityTypes } from '../../../api/types'; import { EDITABLE_INPUT_ID } from '../../../config'; diff --git a/src/components/middle/composer/WebPagePreview.tsx b/src/components/middle/composer/WebPagePreview.tsx index b958acfd..7adb0e30 100644 --- a/src/components/middle/composer/WebPagePreview.tsx +++ b/src/components/middle/composer/WebPagePreview.tsx @@ -1,10 +1,10 @@ -import React, { - FC, memo, useCallback, useEffect, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiMessage, ApiMessageEntityTypes, ApiWebPage } from '../../../api/types'; -import { ISettings } from '../../../types'; +import type { ApiMessage, ApiWebPage } from '../../../api/types'; +import { ApiMessageEntityTypes } from '../../../api/types'; +import type { ISettings } from '../../../types'; import { RE_LINK_TEMPLATE } from '../../../config'; import { selectNoWebPage, selectTheme } from '../../../global/selectors'; diff --git a/src/components/middle/composer/helpers/buildAttachment.ts b/src/components/middle/composer/helpers/buildAttachment.ts index e290658c..3ed38503 100644 --- a/src/components/middle/composer/helpers/buildAttachment.ts +++ b/src/components/middle/composer/helpers/buildAttachment.ts @@ -1,4 +1,4 @@ -import { ApiAttachment } from '../../../../api/types'; +import type { ApiAttachment } from '../../../../api/types'; import { SUPPORTED_AUDIO_CONTENT_TYPES, SUPPORTED_IMAGE_CONTENT_TYPES, diff --git a/src/components/middle/composer/hooks/useBotCommandTooltip.ts b/src/components/middle/composer/hooks/useBotCommandTooltip.ts index f26e2958..58687c20 100644 --- a/src/components/middle/composer/hooks/useBotCommandTooltip.ts +++ b/src/components/middle/composer/hooks/useBotCommandTooltip.ts @@ -2,7 +2,7 @@ import { useCallback, useEffect, useState, } from '../../../../lib/teact/teact'; -import { ApiBotCommand } from '../../../../api/types'; +import type { ApiBotCommand } from '../../../../api/types'; import { prepareForRegExp } from '../helpers/prepareForRegExp'; import { throttle } from '../../../../util/schedulers'; diff --git a/src/components/middle/composer/hooks/useClipboardPaste.ts b/src/components/middle/composer/hooks/useClipboardPaste.ts index f6718915..ed5f276b 100644 --- a/src/components/middle/composer/hooks/useClipboardPaste.ts +++ b/src/components/middle/composer/hooks/useClipboardPaste.ts @@ -1,5 +1,6 @@ -import { StateHookSetter, useEffect } from '../../../../lib/teact/teact'; -import { ApiAttachment, ApiMessage } from '../../../../api/types'; +import type { StateHookSetter } from '../../../../lib/teact/teact'; +import { useEffect } from '../../../../lib/teact/teact'; +import type { ApiAttachment, ApiMessage } from '../../../../api/types'; import buildAttachment from '../helpers/buildAttachment'; import { EDITABLE_INPUT_ID, EDITABLE_INPUT_MODAL_ID } from '../../../../config'; diff --git a/src/components/middle/composer/hooks/useDraft.ts b/src/components/middle/composer/hooks/useDraft.ts index 08c069eb..7942829e 100644 --- a/src/components/middle/composer/hooks/useDraft.ts +++ b/src/components/middle/composer/hooks/useDraft.ts @@ -1,7 +1,7 @@ import { useCallback, useEffect, useMemo } from '../../../../lib/teact/teact'; import { getActions } from '../../../../global'; -import { ApiFormattedText, ApiMessage } from '../../../../api/types'; +import type { ApiFormattedText, ApiMessage } from '../../../../api/types'; import { DRAFT_DEBOUNCE, EDITABLE_INPUT_CSS_SELECTOR } from '../../../../config'; import usePrevious from '../../../../hooks/usePrevious'; diff --git a/src/components/middle/composer/hooks/useEditing.ts b/src/components/middle/composer/hooks/useEditing.ts index dc38f0bd..aa59aa5c 100644 --- a/src/components/middle/composer/hooks/useEditing.ts +++ b/src/components/middle/composer/hooks/useEditing.ts @@ -1,8 +1,8 @@ import { useCallback, useEffect } from '../../../../lib/teact/teact'; import { getActions } from '../../../../global'; -import { ApiFormattedText, ApiMessage } from '../../../../api/types'; -import { MessageListType } from '../../../../global/types'; +import type { ApiFormattedText, ApiMessage } from '../../../../api/types'; +import type { MessageListType } from '../../../../global/types'; import useEffectWithPrevDeps from '../../../../hooks/useEffectWithPrevDeps'; import { EDITABLE_INPUT_CSS_SELECTOR } from '../../../../config'; diff --git a/src/components/middle/composer/hooks/useEmojiTooltip.ts b/src/components/middle/composer/hooks/useEmojiTooltip.ts index cba8cb5d..16b06d81 100644 --- a/src/components/middle/composer/hooks/useEmojiTooltip.ts +++ b/src/components/middle/composer/hooks/useEmojiTooltip.ts @@ -5,9 +5,8 @@ import { import { EDITABLE_INPUT_CSS_SELECTOR, EDITABLE_INPUT_ID } from '../../../../config'; import { MEMO_EMPTY_ARRAY } from '../../../../util/memo'; import { prepareForRegExp } from '../helpers/prepareForRegExp'; -import { - EmojiData, EmojiModule, EmojiRawData, uncompressEmoji, -} from '../../../../util/emoji'; +import type { EmojiData, EmojiModule, EmojiRawData } from '../../../../util/emoji'; +import { uncompressEmoji } from '../../../../util/emoji'; import focusEditableElement from '../../../../util/focusEditableElement'; import { buildCollectionByKey, mapValues, pickTruthy, unique, diff --git a/src/components/middle/composer/hooks/useInlineBotTooltip.ts b/src/components/middle/composer/hooks/useInlineBotTooltip.ts index 62d69500..3088aee9 100644 --- a/src/components/middle/composer/hooks/useInlineBotTooltip.ts +++ b/src/components/middle/composer/hooks/useInlineBotTooltip.ts @@ -1,6 +1,6 @@ import { useCallback, useEffect } from '../../../../lib/teact/teact'; import { getActions } from '../../../../global'; -import { InlineBotSettings } from '../../../../types'; +import type { InlineBotSettings } from '../../../../types'; import useFlag from '../../../../hooks/useFlag'; import usePrevious from '../../../../hooks/usePrevious'; import useDebouncedMemo from '../../../../hooks/useDebouncedMemo'; diff --git a/src/components/middle/composer/hooks/useMentionTooltip.ts b/src/components/middle/composer/hooks/useMentionTooltip.ts index 9e0ddaa8..94a854cd 100644 --- a/src/components/middle/composer/hooks/useMentionTooltip.ts +++ b/src/components/middle/composer/hooks/useMentionTooltip.ts @@ -3,7 +3,8 @@ import { } from '../../../../lib/teact/teact'; import { getGlobal } from '../../../../global'; -import { ApiMessageEntityTypes, ApiChatMember, ApiUser } from '../../../../api/types'; +import type { ApiChatMember, ApiUser } from '../../../../api/types'; +import { ApiMessageEntityTypes } from '../../../../api/types'; import { EDITABLE_INPUT_ID } from '../../../../config'; import { filterUsersByName, getUserFirstOrLastName } from '../../../../global/helpers'; import { prepareForRegExp } from '../helpers/prepareForRegExp'; diff --git a/src/components/middle/composer/hooks/useStickerTooltip.ts b/src/components/middle/composer/hooks/useStickerTooltip.ts index 1eb61806..4efb7373 100644 --- a/src/components/middle/composer/hooks/useStickerTooltip.ts +++ b/src/components/middle/composer/hooks/useStickerTooltip.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo } from '../../../../lib/teact/teact'; import { getActions } from '../../../../global'; -import { ApiSticker } from '../../../../api/types'; +import type { ApiSticker } from '../../../../api/types'; import { IS_EMOJI_SUPPORTED } from '../../../../util/environment'; diff --git a/src/components/middle/composer/inlineResults/ArticleResult.tsx b/src/components/middle/composer/inlineResults/ArticleResult.tsx index 11ee7de0..e4100948 100644 --- a/src/components/middle/composer/inlineResults/ArticleResult.tsx +++ b/src/components/middle/composer/inlineResults/ArticleResult.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo, useCallback } from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../../lib/teact/teact'; -import { ApiBotInlineResult } from '../../../../api/types'; +import type { ApiBotInlineResult } from '../../../../api/types'; import BaseResult from './BaseResult'; diff --git a/src/components/middle/composer/inlineResults/BaseResult.tsx b/src/components/middle/composer/inlineResults/BaseResult.tsx index ca3745a2..8465dca7 100644 --- a/src/components/middle/composer/inlineResults/BaseResult.tsx +++ b/src/components/middle/composer/inlineResults/BaseResult.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo, TeactNode } from '../../../../lib/teact/teact'; +import type { FC, TeactNode } from '../../../../lib/teact/teact'; +import React, { memo } from '../../../../lib/teact/teact'; -import { ApiWebDocument } from '../../../../api/types'; +import type { ApiWebDocument } from '../../../../api/types'; import { getFirstLetters } from '../../../../util/textFormat'; import renderText from '../../../common/helpers/renderText'; diff --git a/src/components/middle/composer/inlineResults/GifResult.tsx b/src/components/middle/composer/inlineResults/GifResult.tsx index 297a4d57..28d0107f 100644 --- a/src/components/middle/composer/inlineResults/GifResult.tsx +++ b/src/components/middle/composer/inlineResults/GifResult.tsx @@ -1,10 +1,9 @@ -import React, { - FC, memo, useCallback, -} from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../../lib/teact/teact'; -import { ApiBotInlineMediaResult, ApiBotInlineResult, ApiVideo } from '../../../../api/types'; +import type { ApiBotInlineMediaResult, ApiBotInlineResult, ApiVideo } from '../../../../api/types'; -import { ObserveFn } from '../../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../../hooks/useIntersectionObserver'; import GifButton from '../../../common/GifButton'; diff --git a/src/components/middle/composer/inlineResults/MediaResult.tsx b/src/components/middle/composer/inlineResults/MediaResult.tsx index 2f6d64d2..9e80b313 100644 --- a/src/components/middle/composer/inlineResults/MediaResult.tsx +++ b/src/components/middle/composer/inlineResults/MediaResult.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo, useCallback } from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../../lib/teact/teact'; -import { +import type { ApiBotInlineMediaResult, ApiBotInlineResult, ApiPhoto, ApiThumbnail, ApiWebDocument, } from '../../../../api/types'; diff --git a/src/components/middle/composer/inlineResults/StickerResult.tsx b/src/components/middle/composer/inlineResults/StickerResult.tsx index a9254af3..896067d6 100644 --- a/src/components/middle/composer/inlineResults/StickerResult.tsx +++ b/src/components/middle/composer/inlineResults/StickerResult.tsx @@ -1,9 +1,10 @@ -import React, { FC, memo } from '../../../../lib/teact/teact'; +import type { FC } from '../../../../lib/teact/teact'; +import React, { memo } from '../../../../lib/teact/teact'; -import { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types'; +import type { ApiBotInlineMediaResult, ApiBotInlineResult } from '../../../../api/types'; import { STICKER_SIZE_INLINE_BOT_RESULT } from '../../../../config'; -import { ObserveFn } from '../../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../../hooks/useIntersectionObserver'; import StickerButton from '../../../common/StickerButton'; diff --git a/src/components/middle/helpers/groupMessages.ts b/src/components/middle/helpers/groupMessages.ts index 07331d89..5db9d00d 100644 --- a/src/components/middle/helpers/groupMessages.ts +++ b/src/components/middle/helpers/groupMessages.ts @@ -1,5 +1,5 @@ -import { ApiMessage } from '../../../api/types'; -import { IAlbum } from '../../../types'; +import type { ApiMessage } from '../../../api/types'; +import type { IAlbum } from '../../../types'; import { getDayStartAt } from '../../../util/dateFormat'; import { isActionMessage } from '../../../global/helpers'; diff --git a/src/components/middle/helpers/preventMessageInputBlur.ts b/src/components/middle/helpers/preventMessageInputBlur.ts index 0771e166..4c340c44 100644 --- a/src/components/middle/helpers/preventMessageInputBlur.ts +++ b/src/components/middle/helpers/preventMessageInputBlur.ts @@ -1,4 +1,4 @@ -import React from '../../../lib/teact/teact'; +import type React from '../../../lib/teact/teact'; import { EDITABLE_INPUT_ID } from '../../../config'; import { IS_IOS } from '../../../util/environment'; diff --git a/src/components/middle/hooks/useMessageObservers.ts b/src/components/middle/hooks/useMessageObservers.ts index fec23144..6a51d583 100644 --- a/src/components/middle/hooks/useMessageObservers.ts +++ b/src/components/middle/hooks/useMessageObservers.ts @@ -1,7 +1,7 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { getActions } from '../../../global'; -import { MessageListType } from '../../../global/types'; +import type { MessageListType } from '../../../global/types'; import { IS_ANDROID, IS_SINGLE_COLUMN_LAYOUT } from '../../../util/environment'; import { useIntersectionObserver } from '../../../hooks/useIntersectionObserver'; diff --git a/src/components/middle/hooks/useScrollHooks.ts b/src/components/middle/hooks/useScrollHooks.ts index 10042a53..cb87d1a9 100644 --- a/src/components/middle/hooks/useScrollHooks.ts +++ b/src/components/middle/hooks/useScrollHooks.ts @@ -1,9 +1,9 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { getActions } from '../../../global'; import { useMemo, useRef } from '../../../lib/teact/teact'; import { LoadMoreDirection } from '../../../types'; -import { MessageListType } from '../../../global/types'; +import type { MessageListType } from '../../../global/types'; import { LOCAL_MESSAGE_ID_BASE, MESSAGE_LIST_SLICE } from '../../../config'; import { IS_SCROLL_PATCH_NEEDED, MESSAGE_LIST_SENSITIVE_AREA } from '../../../util/environment'; diff --git a/src/components/middle/message/Album.tsx b/src/components/middle/message/Album.tsx index 5d5f6336..c71a2f45 100644 --- a/src/components/middle/message/Album.tsx +++ b/src/components/middle/message/Album.tsx @@ -1,14 +1,16 @@ -import React, { FC, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { useCallback } from '../../../lib/teact/teact'; -import { GlobalState } from '../../../global/types'; -import { ApiMessage } from '../../../api/types'; -import { IAlbum, ISettings } from '../../../types'; -import { AlbumRectPart, IAlbumLayout } from './helpers/calculateAlbumLayout'; +import type { GlobalState } from '../../../global/types'; +import type { ApiMessage } from '../../../api/types'; +import type { IAlbum, ISettings } from '../../../types'; +import type { IAlbumLayout } from './helpers/calculateAlbumLayout'; +import { AlbumRectPart } from './helpers/calculateAlbumLayout'; import { getMessageContent, getMessageHtmlId } from '../../../global/helpers'; import { getActions, getGlobal, withGlobal } from '../../../global'; import withSelectControl from './hocs/withSelectControl'; -import { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; import { selectActiveDownloadIds, selectCanAutoLoadMedia, diff --git a/src/components/middle/message/CommentButton.tsx b/src/components/middle/message/CommentButton.tsx index a6faca13..9ddc152c 100644 --- a/src/components/middle/message/CommentButton.tsx +++ b/src/components/middle/message/CommentButton.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getActions, getGlobal } from '../../../global'; -import { +import type { ApiChat, ApiThreadInfo, ApiUser, } from '../../../api/types'; diff --git a/src/components/middle/message/Contact.tsx b/src/components/middle/message/Contact.tsx index f8bff416..5503a6fe 100644 --- a/src/components/middle/message/Contact.tsx +++ b/src/components/middle/message/Contact.tsx @@ -1,7 +1,8 @@ -import React, { FC, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { useCallback } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiUser, ApiContact, ApiCountryCode } from '../../../api/types'; +import type { ApiUser, ApiContact, ApiCountryCode } from '../../../api/types'; import { selectUser } from '../../../global/selectors'; import { formatPhoneNumberWithCode } from '../../../util/phoneNumber'; diff --git a/src/components/middle/message/ContextMenuContainer.async.tsx b/src/components/middle/message/ContextMenuContainer.async.tsx index 22176b75..b2120e6c 100644 --- a/src/components/middle/message/ContextMenuContainer.async.tsx +++ b/src/components/middle/message/ContextMenuContainer.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; -import { OwnProps } from './ContextMenuContainer'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; +import type { OwnProps } from './ContextMenuContainer'; import { Bundles } from '../../../util/moduleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/middle/message/ContextMenuContainer.tsx b/src/components/middle/message/ContextMenuContainer.tsx index 855a0677..3a4fe111 100644 --- a/src/components/middle/message/ContextMenuContainer.tsx +++ b/src/components/middle/message/ContextMenuContainer.tsx @@ -1,11 +1,12 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; -import { MessageListType } from '../../../global/types'; -import { ApiAvailableReaction, ApiMessage } from '../../../api/types'; -import { IAlbum, IAnchorPosition } from '../../../types'; +import type { MessageListType } from '../../../global/types'; +import type { ApiAvailableReaction, ApiMessage } from '../../../api/types'; +import type { IAlbum, IAnchorPosition } from '../../../types'; import { selectActiveDownloadIds, diff --git a/src/components/middle/message/Game.tsx b/src/components/middle/message/Game.tsx index 3cb894f5..31336eda 100644 --- a/src/components/middle/message/Game.tsx +++ b/src/components/middle/message/Game.tsx @@ -1,8 +1,7 @@ -import React, { - FC, memo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; -import { ApiMessage } from '../../../api/types'; +import type { ApiMessage } from '../../../api/types'; import { getActions } from '../../../global'; import { getGamePreviewPhotoHash, getGamePreviewVideoHash, getMessageText } from '../../../global/helpers'; diff --git a/src/components/middle/message/InlineButtons.tsx b/src/components/middle/message/InlineButtons.tsx index ae17e0ce..c3f3247d 100644 --- a/src/components/middle/message/InlineButtons.tsx +++ b/src/components/middle/message/InlineButtons.tsx @@ -1,6 +1,7 @@ -import React, { FC } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React from '../../../lib/teact/teact'; -import { ApiKeyboardButton, ApiMessage } from '../../../api/types'; +import type { ApiKeyboardButton, ApiMessage } from '../../../api/types'; import { RE_TME_LINK } from '../../../config'; import renderText from '../../common/helpers/renderText'; diff --git a/src/components/middle/message/Invoice.tsx b/src/components/middle/message/Invoice.tsx index 51b11584..d01a4fe4 100644 --- a/src/components/middle/message/Invoice.tsx +++ b/src/components/middle/message/Invoice.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useLayoutEffect, useRef, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useLayoutEffect, useRef } from '../../../lib/teact/teact'; -import { ApiMessage } from '../../../api/types'; -import { ISettings } from '../../../types'; +import type { ApiMessage } from '../../../api/types'; +import type { ISettings } from '../../../types'; import { CUSTOM_APPENDIX_ATTRIBUTE } from '../../../config'; import { getMessageInvoice } from '../../../global/helpers'; diff --git a/src/components/middle/message/Location.tsx b/src/components/middle/message/Location.tsx index e5e53133..fb5e91d3 100644 --- a/src/components/middle/message/Location.tsx +++ b/src/components/middle/message/Location.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, + memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from '../../../lib/teact/teact'; -import { ApiChat, ApiMessage, ApiUser } from '../../../api/types'; -import { ISettings } from '../../../types'; +import type { ApiChat, ApiMessage, ApiUser } from '../../../api/types'; +import type { ISettings } from '../../../types'; import { CUSTOM_APPENDIX_ATTRIBUTE } from '../../../config'; import { diff --git a/src/components/middle/message/MentionLink.tsx b/src/components/middle/message/MentionLink.tsx index df731073..2a0f7842 100644 --- a/src/components/middle/message/MentionLink.tsx +++ b/src/components/middle/message/MentionLink.tsx @@ -1,7 +1,8 @@ -import React, { FC } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiUser } from '../../../api/types'; import { selectUser } from '../../../global/selectors'; diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index c44cfd17..c4184015 100644 --- a/src/components/middle/message/Message.tsx +++ b/src/components/middle/message/Message.tsx @@ -1,5 +1,5 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, @@ -8,8 +8,8 @@ import React, { } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ActiveEmojiInteraction, ActiveReaction, MessageListType } from '../../../global/types'; -import { +import type { ActiveEmojiInteraction, ActiveReaction, MessageListType } from '../../../global/types'; +import type { ApiMessage, ApiMessageOutgoingStatus, ApiUser, @@ -18,8 +18,9 @@ import { ApiThreadInfo, ApiAvailableReaction, } from '../../../api/types'; +import type { FocusDirection, IAlbum, ISettings } from '../../../types'; import { - AudioOrigin, FocusDirection, IAlbum, ISettings, + AudioOrigin, } from '../../../types'; import { IS_ANDROID, IS_TOUCH_ENV } from '../../../util/environment'; @@ -82,7 +83,8 @@ import { getMinMediaWidth, calculateMediaDimensions } from './helpers/mediaDimen import { calculateAlbumLayout } from './helpers/calculateAlbumLayout'; import renderText from '../../common/helpers/renderText'; import calculateAuthorWidth from './helpers/calculateAuthorWidth'; -import { ObserveFn, useOnIntersect } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import { useOnIntersect } from '../../../hooks/useIntersectionObserver'; import useLang from '../../../hooks/useLang'; import useShowTransition from '../../../hooks/useShowTransition'; import useFlag from '../../../hooks/useFlag'; diff --git a/src/components/middle/message/MessageContextMenu.tsx b/src/components/middle/message/MessageContextMenu.tsx index 970c8709..260164ae 100644 --- a/src/components/middle/message/MessageContextMenu.tsx +++ b/src/components/middle/message/MessageContextMenu.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { ApiAvailableReaction, ApiMessage, ApiUser } from '../../../api/types'; -import { IAnchorPosition } from '../../../types'; +import type { ApiAvailableReaction, ApiMessage, ApiUser } from '../../../api/types'; +import type { IAnchorPosition } from '../../../types'; import { getMessageCopyOptions } from './helpers/copyOptions'; import { disableScrolling, enableScrolling } from '../../../util/scrollLock'; diff --git a/src/components/middle/message/MessageMeta.tsx b/src/components/middle/message/MessageMeta.tsx index 282e5c28..19224029 100644 --- a/src/components/middle/message/MessageMeta.tsx +++ b/src/components/middle/message/MessageMeta.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useMemo } from '../../../lib/teact/teact'; -import { ApiAvailableReaction, ApiMessage, ApiMessageOutgoingStatus } from '../../../api/types'; -import { ActiveReaction } from '../../../global/types'; +import type { ApiAvailableReaction, ApiMessage, ApiMessageOutgoingStatus } from '../../../api/types'; +import type { ActiveReaction } from '../../../global/types'; import { formatDateTimeToString, formatTime } from '../../../util/dateFormat'; import { formatIntegerCompact } from '../../../util/textFormat'; diff --git a/src/components/middle/message/MessagePhoneCall.tsx b/src/components/middle/message/MessagePhoneCall.tsx index 3b4882a8..54d94f72 100644 --- a/src/components/middle/message/MessagePhoneCall.tsx +++ b/src/components/middle/message/MessagePhoneCall.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { ApiMessage, PhoneCallAction } from '../../../api/types'; +import type { ApiMessage, PhoneCallAction } from '../../../api/types'; import useLang from '../../../hooks/useLang'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/message/Photo.tsx b/src/components/middle/message/Photo.tsx index d1746369..05a3b5e5 100644 --- a/src/components/middle/message/Photo.tsx +++ b/src/components/middle/message/Photo.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useCallback, useLayoutEffect, useRef, useState, + useCallback, useLayoutEffect, useRef, useState, } from '../../../lib/teact/teact'; -import { ApiMessage } from '../../../api/types'; -import { ISettings } from '../../../types'; -import { IMediaDimensions } from './helpers/calculateAlbumLayout'; +import type { ApiMessage } from '../../../api/types'; +import type { ISettings } from '../../../types'; +import type { IMediaDimensions } from './helpers/calculateAlbumLayout'; import { CUSTOM_APPENDIX_ATTRIBUTE } from '../../../config'; import { @@ -14,7 +15,8 @@ import { getMediaTransferState, isOwnMessage, } from '../../../global/helpers'; -import { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../../hooks/useIntersectionObserver'; import useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress'; import useShowTransition from '../../../hooks/useShowTransition'; import useBlurredMediaThumbRef from './hooks/useBlurredMediaThumbRef'; diff --git a/src/components/middle/message/Poll.tsx b/src/components/middle/message/Poll.tsx index 0cdd2598..609de0ce 100644 --- a/src/components/middle/message/Poll.tsx +++ b/src/components/middle/message/Poll.tsx @@ -1,5 +1,5 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useCallback, useEffect, useState, @@ -9,14 +9,15 @@ import React, { } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { +import type { ApiMessage, ApiPoll, ApiUser, ApiPollAnswer, } from '../../../api/types'; import renderText from '../../common/helpers/renderText'; import { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities'; import { formatMediaDuration } from '../../../util/dateFormat'; -import useLang, { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useLang'; +import useLang from '../../../hooks/useLang'; import CheckboxGroup from '../../ui/CheckboxGroup'; import RadioGroup from '../../ui/RadioGroup'; diff --git a/src/components/middle/message/PollOption.tsx b/src/components/middle/message/PollOption.tsx index 67820c10..949cf182 100644 --- a/src/components/middle/message/PollOption.tsx +++ b/src/components/middle/message/PollOption.tsx @@ -1,8 +1,7 @@ -import React, { - FC, useState, useEffect, useRef, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { useState, useEffect, useRef } from '../../../lib/teact/teact'; -import { ApiPollAnswer, ApiPollResult } from '../../../api/types'; +import type { ApiPollAnswer, ApiPollResult } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import renderText from '../../common/helpers/renderText'; diff --git a/src/components/middle/message/ReactionAnimatedEmoji.tsx b/src/components/middle/message/ReactionAnimatedEmoji.tsx index 9001e9d7..09f2c0ab 100644 --- a/src/components/middle/message/ReactionAnimatedEmoji.tsx +++ b/src/components/middle/message/ReactionAnimatedEmoji.tsx @@ -1,8 +1,10 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { ActiveReaction } from '../../../global/types'; -import { ApiAvailableReaction, ApiMediaFormat } from '../../../api/types'; +import type { ActiveReaction } from '../../../global/types'; +import type { ApiAvailableReaction } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import useMedia from '../../../hooks/useMedia'; diff --git a/src/components/middle/message/ReactionButton.tsx b/src/components/middle/message/ReactionButton.tsx index c7d1ec6b..977fc838 100644 --- a/src/components/middle/message/ReactionButton.tsx +++ b/src/components/middle/message/ReactionButton.tsx @@ -1,12 +1,11 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getActions, getGlobal } from '../../../global'; -import { +import type { ApiAvailableReaction, ApiMessage, ApiReactionCount, ApiUser, } from '../../../api/types'; -import { ActiveReaction } from '../../../global/types'; +import type { ActiveReaction } from '../../../global/types'; import buildClassName from '../../../util/buildClassName'; import { formatIntegerCompact } from '../../../util/textFormat'; diff --git a/src/components/middle/message/ReactionSelector.tsx b/src/components/middle/message/ReactionSelector.tsx index 06c66aeb..4ed1cadc 100644 --- a/src/components/middle/message/ReactionSelector.tsx +++ b/src/components/middle/message/ReactionSelector.tsx @@ -1,8 +1,7 @@ -import React, { - FC, memo, useLayoutEffect, useRef, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useLayoutEffect, useRef } from '../../../lib/teact/teact'; -import { ApiAvailableReaction } from '../../../api/types'; +import type { ApiAvailableReaction } from '../../../api/types'; import useHorizontalScroll from '../../../hooks/useHorizontalScroll'; import useFlag from '../../../hooks/useFlag'; diff --git a/src/components/middle/message/ReactionSelectorReaction.tsx b/src/components/middle/message/ReactionSelectorReaction.tsx index 5d622998..2b93d273 100644 --- a/src/components/middle/message/ReactionSelectorReaction.tsx +++ b/src/components/middle/message/ReactionSelectorReaction.tsx @@ -1,8 +1,8 @@ -import React, { - FC, memo, useRef, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useRef } from '../../../lib/teact/teact'; -import { ApiAvailableReaction, ApiMediaFormat } from '../../../api/types'; +import type { ApiAvailableReaction } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; import useMedia from '../../../hooks/useMedia'; import useFlag from '../../../hooks/useFlag'; diff --git a/src/components/middle/message/Reactions.tsx b/src/components/middle/message/Reactions.tsx index dfa476d4..ecd83dd0 100644 --- a/src/components/middle/message/Reactions.tsx +++ b/src/components/middle/message/Reactions.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; -import { ApiAvailableReaction, ApiMessage } from '../../../api/types'; -import { ActiveReaction } from '../../../global/types'; +import type { ApiAvailableReaction, ApiMessage } from '../../../api/types'; +import type { ActiveReaction } from '../../../global/types'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/middle/message/RoundVideo.tsx b/src/components/middle/message/RoundVideo.tsx index faa4cdea..9a69cbef 100644 --- a/src/components/middle/message/RoundVideo.tsx +++ b/src/components/middle/message/RoundVideo.tsx @@ -1,5 +1,5 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useCallback, useEffect, useRef, @@ -7,7 +7,8 @@ import React, { } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { ApiMediaFormat, ApiMessage } from '../../../api/types'; +import type { ApiMessage } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; import { ROUND_VIDEO_DIMENSIONS_PX } from '../../common/helpers/mediaDimensions'; import { getMessageMediaFormat, getMessageMediaHash } from '../../../global/helpers'; @@ -16,7 +17,8 @@ import buildClassName from '../../../util/buildClassName'; import { stopCurrentAudio } from '../../../util/audioPlayer'; import safePlay from '../../../util/safePlay'; import { fastRaf } from '../../../util/schedulers'; -import { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../../hooks/useIntersectionObserver'; import useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress'; import useShowTransition from '../../../hooks/useShowTransition'; import useMediaTransition from '../../../hooks/useMediaTransition'; diff --git a/src/components/middle/message/SponsoredMessage.tsx b/src/components/middle/message/SponsoredMessage.tsx index 08f5c1ff..b2a200ec 100644 --- a/src/components/middle/message/SponsoredMessage.tsx +++ b/src/components/middle/message/SponsoredMessage.tsx @@ -1,10 +1,11 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, + memo, useCallback, useEffect, useRef, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiSponsoredMessage, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiSponsoredMessage, ApiUser } from '../../../api/types'; import { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities'; import { selectChat, selectSponsoredMessage, selectUser } from '../../../global/selectors'; diff --git a/src/components/middle/message/Sticker.tsx b/src/components/middle/message/Sticker.tsx index 95a2e0ae..3e3155d4 100644 --- a/src/components/middle/message/Sticker.tsx +++ b/src/components/middle/message/Sticker.tsx @@ -1,12 +1,14 @@ -import React, { FC, useEffect, useRef } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { useEffect, useRef } from '../../../lib/teact/teact'; -import { ApiMessage } from '../../../api/types'; +import type { ApiMessage } from '../../../api/types'; import { NO_STICKER_SET_ID } from '../../../config'; import { getStickerDimensions } from '../../common/helpers/mediaDimensions'; import { getMessageMediaFormat, getMessageMediaHash } from '../../../global/helpers'; import buildClassName from '../../../util/buildClassName'; -import { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../../hooks/useIntersectionObserver'; import useMedia from '../../../hooks/useMedia'; import useMediaTransition from '../../../hooks/useMediaTransition'; import useFlag from '../../../hooks/useFlag'; diff --git a/src/components/middle/message/Video.tsx b/src/components/middle/message/Video.tsx index eeb65515..058dc595 100644 --- a/src/components/middle/message/Video.tsx +++ b/src/components/middle/message/Video.tsx @@ -1,10 +1,10 @@ -import React, { - FC, useCallback, useRef, useState, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { useCallback, useRef, useState } from '../../../lib/teact/teact'; import { getActions } from '../../../global'; -import { ApiMediaFormat, ApiMessage } from '../../../api/types'; -import { IMediaDimensions } from './helpers/calculateAlbumLayout'; +import type { ApiMessage } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; +import type { IMediaDimensions } from './helpers/calculateAlbumLayout'; import { formatMediaDuration } from '../../../util/dateFormat'; import buildClassName from '../../../util/buildClassName'; @@ -18,7 +18,8 @@ import { isForwardedMessage, isOwnMessage, } from '../../../global/helpers'; -import { ObserveFn, useIsIntersecting } from '../../../hooks/useIntersectionObserver'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import { useIsIntersecting } from '../../../hooks/useIntersectionObserver'; import useMediaWithLoadProgress from '../../../hooks/useMediaWithLoadProgress'; import useMedia from '../../../hooks/useMedia'; import useShowTransition from '../../../hooks/useShowTransition'; diff --git a/src/components/middle/message/WebPage.tsx b/src/components/middle/message/WebPage.tsx index f735affe..9bfc6778 100644 --- a/src/components/middle/message/WebPage.tsx +++ b/src/components/middle/message/WebPage.tsx @@ -1,8 +1,9 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; -import { ApiMessage } from '../../../api/types'; -import { ObserveFn } from '../../../hooks/useIntersectionObserver'; -import { ISettings } from '../../../types'; +import type { ApiMessage } from '../../../api/types'; +import type { ObserveFn } from '../../../hooks/useIntersectionObserver'; +import type { ISettings } from '../../../types'; import { getMessageWebPage } from '../../../global/helpers'; import { calculateMediaDimensions } from './helpers/mediaDimensions'; diff --git a/src/components/middle/message/helpers/buildContentClassName.ts b/src/components/middle/message/helpers/buildContentClassName.ts index a8662946..294ee10c 100644 --- a/src/components/middle/message/helpers/buildContentClassName.ts +++ b/src/components/middle/message/helpers/buildContentClassName.ts @@ -1,4 +1,4 @@ -import { ApiMessage } from '../../../../api/types'; +import type { ApiMessage } from '../../../../api/types'; import { getMessageContent } from '../../../../global/helpers'; diff --git a/src/components/middle/message/helpers/calculateAlbumLayout.ts b/src/components/middle/message/helpers/calculateAlbumLayout.ts index 7e89ddeb..bf251c4a 100644 --- a/src/components/middle/message/helpers/calculateAlbumLayout.ts +++ b/src/components/middle/message/helpers/calculateAlbumLayout.ts @@ -3,8 +3,8 @@ // https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/SourceFiles/ui/grouped_layout.cpp // https://github.com/overtake/TelegramSwift/blob/master/Telegram-Mac/GroupedLayout.swift#L83 -import { IAlbum } from '../../../../types'; -import { ApiMessage, ApiDimensions } from '../../../../api/types'; +import type { IAlbum } from '../../../../types'; +import type { ApiMessage, ApiDimensions } from '../../../../api/types'; import { getAvailableWidth, REM } from '../../../common/helpers/mediaDimensions'; import { calculateMediaDimensions } from './mediaDimensions'; diff --git a/src/components/middle/message/helpers/copyOptions.ts b/src/components/middle/message/helpers/copyOptions.ts index e8085eff..762a7cdb 100644 --- a/src/components/middle/message/helpers/copyOptions.ts +++ b/src/components/middle/message/helpers/copyOptions.ts @@ -1,4 +1,5 @@ -import { ApiMediaFormat, ApiMessage } from '../../../../api/types'; +import type { ApiMessage } from '../../../../api/types'; +import { ApiMediaFormat } from '../../../../api/types'; import * as mediaLoader from '../../../../util/mediaLoader'; import { diff --git a/src/components/middle/message/helpers/getCustomAppendixBg.ts b/src/components/middle/message/helpers/getCustomAppendixBg.ts index 5f0a2ced..8e7a05c6 100644 --- a/src/components/middle/message/helpers/getCustomAppendixBg.ts +++ b/src/components/middle/message/helpers/getCustomAppendixBg.ts @@ -1,4 +1,4 @@ -import { ISettings } from '../../../../types'; +import type { ISettings } from '../../../../types'; const SELECTED_APPENDIX_COLORS = { dark: { diff --git a/src/components/middle/message/helpers/mediaDimensions.ts b/src/components/middle/message/helpers/mediaDimensions.ts index 942fdacd..c46a7699 100644 --- a/src/components/middle/message/helpers/mediaDimensions.ts +++ b/src/components/middle/message/helpers/mediaDimensions.ts @@ -1,4 +1,4 @@ -import { ApiMessage } from '../../../../api/types'; +import type { ApiMessage } from '../../../../api/types'; import { calculateInlineImageDimensions, calculateVideoDimensions } from '../../../common/helpers/mediaDimensions'; import { getMessageText, diff --git a/src/components/middle/message/hocs/withSelectControl.tsx b/src/components/middle/message/hocs/withSelectControl.tsx index 88fc339f..ac42e28f 100644 --- a/src/components/middle/message/hocs/withSelectControl.tsx +++ b/src/components/middle/message/hocs/withSelectControl.tsx @@ -1,14 +1,14 @@ -import { MouseEvent as ReactMouseEvent } from 'react'; +import type { MouseEvent as ReactMouseEvent } from 'react'; +import type { FC } from '../../../../lib/teact/teact'; import React, { - FC, useCallback, useMemo, memo, } from '../../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../../global'; -import { OwnProps as PhotoProps } from '../Photo'; -import { OwnProps as VideoProps } from '../Video'; +import type { OwnProps as PhotoProps } from '../Photo'; +import type { OwnProps as VideoProps } from '../Video'; import buildClassName from '../../../../util/buildClassName'; import { diff --git a/src/components/middle/message/hooks/useBlurredMediaThumbRef.ts b/src/components/middle/message/hooks/useBlurredMediaThumbRef.ts index 01a0cfc0..1971316e 100644 --- a/src/components/middle/message/hooks/useBlurredMediaThumbRef.ts +++ b/src/components/middle/message/hooks/useBlurredMediaThumbRef.ts @@ -1,4 +1,4 @@ -import { ApiMessage } from '../../../../api/types'; +import type { ApiMessage } from '../../../../api/types'; import { IS_CANVAS_FILTER_SUPPORTED, IS_SINGLE_COLUMN_LAYOUT } from '../../../../util/environment'; import { getMessageMediaThumbDataUri } from '../../../../global/helpers'; diff --git a/src/components/middle/message/hooks/useFocusMessage.ts b/src/components/middle/message/hooks/useFocusMessage.ts index 10bc5a66..b7cf7adf 100644 --- a/src/components/middle/message/hooks/useFocusMessage.ts +++ b/src/components/middle/message/hooks/useFocusMessage.ts @@ -1,4 +1,4 @@ -import { FocusDirection } from '../../../../types'; +import type { FocusDirection } from '../../../../types'; import { useLayoutEffect } from '../../../../lib/teact/teact'; import fastSmoothScroll from '../../../../util/fastSmoothScroll'; diff --git a/src/components/middle/message/hooks/useInnerHandlers.ts b/src/components/middle/message/hooks/useInnerHandlers.ts index 66e3e01a..a81847d4 100644 --- a/src/components/middle/message/hooks/useInnerHandlers.ts +++ b/src/components/middle/message/hooks/useInnerHandlers.ts @@ -1,11 +1,12 @@ -import React, { useCallback } from '../../../../lib/teact/teact'; +import type React from '../../../../lib/teact/teact'; +import { useCallback } from '../../../../lib/teact/teact'; import { getActions } from '../../../../global'; -import { IAlbum, MediaViewerOrigin } from '../../../../types'; -import { - ApiChat, ApiMessage, ApiUser, MAIN_THREAD_ID, -} from '../../../../api/types'; -import { LangFn } from '../../../../hooks/useLang'; +import type { IAlbum } from '../../../../types'; +import { MediaViewerOrigin } from '../../../../types'; +import type { ApiChat, ApiMessage, ApiUser } from '../../../../api/types'; +import { MAIN_THREAD_ID } from '../../../../api/types'; +import type { LangFn } from '../../../../hooks/useLang'; export default function useInnerHandlers( lang: LangFn, diff --git a/src/components/middle/message/hooks/useOuterHandlers.ts b/src/components/middle/message/hooks/useOuterHandlers.ts index 63927d64..f507ec74 100644 --- a/src/components/middle/message/hooks/useOuterHandlers.ts +++ b/src/components/middle/message/hooks/useOuterHandlers.ts @@ -1,5 +1,6 @@ -import { RefObject } from 'react'; -import React, { useEffect, useRef } from '../../../../lib/teact/teact'; +import type { RefObject } from 'react'; +import type React from '../../../../lib/teact/teact'; +import { useEffect, useRef } from '../../../../lib/teact/teact'; import { getActions } from '../../../../global'; import { IS_ANDROID, IS_TOUCH_ENV } from '../../../../util/environment'; diff --git a/src/components/payment/CardInput.tsx b/src/components/payment/CardInput.tsx index 51b2a555..e7db621e 100644 --- a/src/components/payment/CardInput.tsx +++ b/src/components/payment/CardInput.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useState, useRef, useEffect, + memo, useCallback, useState, useRef, useEffect, } from '../../lib/teact/teact'; import { formatCardNumber } from '../middle/helpers/inputFormatters'; diff --git a/src/components/payment/Checkout.tsx b/src/components/payment/Checkout.tsx index 1d4cffb5..a540553c 100644 --- a/src/components/payment/Checkout.tsx +++ b/src/components/payment/Checkout.tsx @@ -1,8 +1,7 @@ -import React, { - FC, memo, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; -import { LangCode, Price } from '../../types'; +import type { LangCode, Price } from '../../types'; import { formatCurrency } from '../../util/formatCurrency'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/payment/ConfirmPayment.tsx b/src/components/payment/ConfirmPayment.tsx index 8b3645ab..5281e6d2 100644 --- a/src/components/payment/ConfirmPayment.tsx +++ b/src/components/payment/ConfirmPayment.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import useLang from '../../hooks/useLang'; diff --git a/src/components/payment/ExpiryInput.tsx b/src/components/payment/ExpiryInput.tsx index b71d8fb9..c5257744 100644 --- a/src/components/payment/ExpiryInput.tsx +++ b/src/components/payment/ExpiryInput.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useCallback, useRef, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback, useRef } from '../../lib/teact/teact'; import { formatCardExpiry } from '../middle/helpers/inputFormatters'; diff --git a/src/components/payment/PaymentInfo.tsx b/src/components/payment/PaymentInfo.tsx index 3d2302cb..6d05ebf3 100644 --- a/src/components/payment/PaymentInfo.tsx +++ b/src/components/payment/PaymentInfo.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, memo, useRef, useEffect, + useCallback, memo, useRef, useEffect, } from '../../lib/teact/teact'; -import { ApiCountry } from '../../api/types'; +import type { ApiCountry } from '../../api/types'; -import { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer'; +import type { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer'; import useLang from '../../hooks/useLang'; import InputText from '../ui/InputText'; diff --git a/src/components/payment/PaymentModal.async.tsx b/src/components/payment/PaymentModal.async.tsx index b00277b4..5ba630ad 100644 --- a/src/components/payment/PaymentModal.async.tsx +++ b/src/components/payment/PaymentModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './PaymentModal'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './PaymentModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/payment/PaymentModal.tsx b/src/components/payment/PaymentModal.tsx index e5fd825a..961383be 100644 --- a/src/components/payment/PaymentModal.tsx +++ b/src/components/payment/PaymentModal.tsx @@ -1,15 +1,18 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; -import { ApiCountry } from '../../api/types'; -import { PaymentStep, ShippingOption, Price } from '../../types'; +import type { GlobalState } from '../../global/types'; +import type { ApiCountry } from '../../api/types'; +import type { ShippingOption, Price } from '../../types'; +import { PaymentStep } from '../../types'; import { formatCurrency } from '../../util/formatCurrency'; import { detectCardTypeText } from '../common/helpers/detectCardType'; -import usePaymentReducer, { FormState } from '../../hooks/reducers/usePaymentReducer'; +import type { FormState } from '../../hooks/reducers/usePaymentReducer'; +import usePaymentReducer from '../../hooks/reducers/usePaymentReducer'; import useLang from '../../hooks/useLang'; import ShippingInfo from './ShippingInfo'; diff --git a/src/components/payment/ReceiptModal.async.tsx b/src/components/payment/ReceiptModal.async.tsx index d2a051aa..fef8801c 100644 --- a/src/components/payment/ReceiptModal.async.tsx +++ b/src/components/payment/ReceiptModal.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './ReceiptModal'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './ReceiptModal'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/payment/ReceiptModal.tsx b/src/components/payment/ReceiptModal.tsx index 9184e30b..a5d5b295 100644 --- a/src/components/payment/ReceiptModal.tsx +++ b/src/components/payment/ReceiptModal.tsx @@ -1,10 +1,9 @@ -import React, { - FC, memo, useMemo, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useMemo } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; -import { Price } from '../../types'; -import { ApiShippingAddress } from '../../api/types'; +import type { Price } from '../../types'; +import type { ApiShippingAddress } from '../../api/types'; import useLang from '../../hooks/useLang'; diff --git a/src/components/payment/Shipping.tsx b/src/components/payment/Shipping.tsx index 5c40f1d1..dd9586fd 100644 --- a/src/components/payment/Shipping.tsx +++ b/src/components/payment/Shipping.tsx @@ -1,11 +1,12 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, memo, useMemo, useEffect, + useCallback, memo, useMemo, useEffect, } from '../../lib/teact/teact'; -import { ShippingOption } from '../../types'; +import type { ShippingOption } from '../../types'; import { formatCurrency } from '../../util/formatCurrency'; -import { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer'; +import type { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer'; import useLang from '../../hooks/useLang'; import RadioGroup from '../ui/RadioGroup'; diff --git a/src/components/payment/ShippingInfo.tsx b/src/components/payment/ShippingInfo.tsx index 7ba4fe8f..321b9962 100644 --- a/src/components/payment/ShippingInfo.tsx +++ b/src/components/payment/ShippingInfo.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useRef, useCallback, useEffect, memo, + useRef, useCallback, useEffect, memo, } from '../../lib/teact/teact'; -import { ApiCountry } from '../../api/types'; +import type { ApiCountry } from '../../api/types'; -import { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer'; +import type { FormState, FormEditDispatch } from '../../hooks/reducers/usePaymentReducer'; import useFocusAfterAnimation from '../../hooks/useFocusAfterAnimation'; import useLang from '../../hooks/useLang'; diff --git a/src/components/right/AddChatMembers.tsx b/src/components/right/AddChatMembers.tsx index 333cdd1e..8be2f5df 100644 --- a/src/components/right/AddChatMembers.tsx +++ b/src/components/right/AddChatMembers.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, useMemo, memo, useState, + useCallback, useMemo, memo, useState, } from '../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../global'; -import { +import type { ApiChat, ApiChatMember, } from '../../api/types'; import { NewChatMembersProgress } from '../../types'; diff --git a/src/components/right/DeleteMemberModal.tsx b/src/components/right/DeleteMemberModal.tsx index 9e1921ac..951fb692 100644 --- a/src/components/right/DeleteMemberModal.tsx +++ b/src/components/right/DeleteMemberModal.tsx @@ -1,7 +1,8 @@ -import React, { FC, useCallback, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback, memo } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiChat } from '../../api/types'; +import type { ApiChat } from '../../api/types'; import { selectCurrentChat, selectUser } from '../../global/selectors'; import { getUserFirstOrLastName } from '../../global/helpers'; diff --git a/src/components/right/GifSearch.async.tsx b/src/components/right/GifSearch.async.tsx index 1bc07485..61fe242f 100644 --- a/src/components/right/GifSearch.async.tsx +++ b/src/components/right/GifSearch.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/right/GifSearch.tsx b/src/components/right/GifSearch.tsx index 57ef416d..3713340d 100644 --- a/src/components/right/GifSearch.tsx +++ b/src/components/right/GifSearch.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useRef, useCallback, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useRef, useCallback } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiChat, ApiVideo } from '../../api/types'; +import type { ApiChat, ApiVideo } from '../../api/types'; import { IS_TOUCH_ENV } from '../../util/environment'; import { diff --git a/src/components/right/PollAnswerResults.tsx b/src/components/right/PollAnswerResults.tsx index adba4f51..3fa535cb 100644 --- a/src/components/right/PollAnswerResults.tsx +++ b/src/components/right/PollAnswerResults.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, useState, memo, useEffect, + useCallback, useState, memo, useEffect, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { +import type { ApiChat, ApiMessage, ApiPollAnswer, diff --git a/src/components/right/PollResults.async.tsx b/src/components/right/PollResults.async.tsx index dcf36c81..0292023f 100644 --- a/src/components/right/PollResults.async.tsx +++ b/src/components/right/PollResults.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/right/PollResults.tsx b/src/components/right/PollResults.tsx index 5d95501e..396e2234 100644 --- a/src/components/right/PollResults.tsx +++ b/src/components/right/PollResults.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; -import { ApiMessage, ApiChat } from '../../api/types'; +import type { ApiMessage, ApiChat } from '../../api/types'; import { selectChat, selectChatMessage } from '../../global/selectors'; import { buildCollectionByKey } from '../../util/iteratees'; import { getMessagePoll } from '../../global/helpers'; diff --git a/src/components/right/Profile.tsx b/src/components/right/Profile.tsx index b3363c84..be580254 100644 --- a/src/components/right/Profile.tsx +++ b/src/components/right/Profile.tsx @@ -1,10 +1,10 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, useEffect, useMemo, useRef, useState, memo, + useCallback, useEffect, useMemo, useRef, useState, memo, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { - MAIN_THREAD_ID, +import type { ApiMessage, ApiChat, ApiChatMember, @@ -12,7 +12,13 @@ import { ApiUserStatus, } from '../../api/types'; import { - NewChatMembersProgress, ISettings, MediaViewerOrigin, ProfileState, ProfileTabType, SharedMediaType, AudioOrigin, + MAIN_THREAD_ID, +} from '../../api/types'; +import type { + ISettings, ProfileState, ProfileTabType, SharedMediaType, +} from '../../types'; +import { + NewChatMembersProgress, MediaViewerOrigin, AudioOrigin, } from '../../types'; import { diff --git a/src/components/right/RightColumn.tsx b/src/components/right/RightColumn.tsx index b9785dd5..c19461ca 100644 --- a/src/components/right/RightColumn.tsx +++ b/src/components/right/RightColumn.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useState, + memo, useCallback, useEffect, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; diff --git a/src/components/right/RightHeader.tsx b/src/components/right/RightHeader.tsx index 8433d46b..31fc7322 100644 --- a/src/components/right/RightHeader.tsx +++ b/src/components/right/RightHeader.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useRef, useState, + memo, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; import { ManagementScreens, ProfileState } from '../../types'; -import { ApiExportedInvite } from '../../api/types'; +import type { ApiExportedInvite } from '../../api/types'; import { ANIMATION_END_DELAY } from '../../config'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; diff --git a/src/components/right/RightSearch.async.tsx b/src/components/right/RightSearch.async.tsx index 4c2779d6..31b43f70 100644 --- a/src/components/right/RightSearch.async.tsx +++ b/src/components/right/RightSearch.async.tsx @@ -1,5 +1,6 @@ -import React, { FC, memo } from '../../lib/teact/teact'; -import { OwnProps } from './RightSearch'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; +import type { OwnProps } from './RightSearch'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/right/RightSearch.tsx b/src/components/right/RightSearch.tsx index f0b83223..6fae8f6c 100644 --- a/src/components/right/RightSearch.tsx +++ b/src/components/right/RightSearch.tsx @@ -1,9 +1,8 @@ -import React, { - FC, useMemo, memo, useRef, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useMemo, memo, useRef } from '../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../global'; -import { ApiMessage, ApiUser, ApiChat } from '../../api/types'; +import type { ApiMessage, ApiUser, ApiChat } from '../../api/types'; import { MEMO_EMPTY_ARRAY } from '../../util/memo'; import { diff --git a/src/components/right/StickerSearch.async.tsx b/src/components/right/StickerSearch.async.tsx index b857b13a..78e2e29d 100644 --- a/src/components/right/StickerSearch.async.tsx +++ b/src/components/right/StickerSearch.async.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import { Bundles } from '../../util/moduleLoader'; import useModuleLoader from '../../hooks/useModuleLoader'; diff --git a/src/components/right/StickerSearch.tsx b/src/components/right/StickerSearch.tsx index 7d1bf385..a459346d 100644 --- a/src/components/right/StickerSearch.tsx +++ b/src/components/right/StickerSearch.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, memo, useEffect, useRef, useState, + memo, useEffect, useRef, useState, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; diff --git a/src/components/right/StickerSetResult.tsx b/src/components/right/StickerSetResult.tsx index 1f140284..a7f445fc 100644 --- a/src/components/right/StickerSetResult.tsx +++ b/src/components/right/StickerSetResult.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useEffect, memo, useMemo, useCallback, + useEffect, memo, useMemo, useCallback, } from '../../lib/teact/teact'; import { getActions, withGlobal } from '../../global'; -import { ApiStickerSet } from '../../api/types'; -import { ObserveFn } from '../../hooks/useIntersectionObserver'; +import type { ApiStickerSet } from '../../api/types'; +import type { ObserveFn } from '../../hooks/useIntersectionObserver'; import { STICKER_SIZE_SEARCH } from '../../config'; import { selectShouldLoopStickers, selectStickerSet } from '../../global/selectors'; diff --git a/src/components/right/hooks/useProfileViewportIds.ts b/src/components/right/hooks/useProfileViewportIds.ts index e6e5b057..47cb3e82 100644 --- a/src/components/right/hooks/useProfileViewportIds.ts +++ b/src/components/right/hooks/useProfileViewportIds.ts @@ -1,9 +1,9 @@ import { useMemo, useRef } from '../../../lib/teact/teact'; -import { +import type { ApiChat, ApiChatMember, ApiMessage, ApiUser, ApiUserStatus, } from '../../../api/types'; -import { ProfileTabType, SharedMediaType } from '../../../types'; +import type { ProfileTabType, SharedMediaType } from '../../../types'; import { MEMBERS_SLICE, MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config'; import { getMessageContentIds, sortChatIds, sortUserIds } from '../../../global/helpers'; diff --git a/src/components/right/management/JoinRequest.tsx b/src/components/right/management/JoinRequest.tsx index 0bee9c61..ba5be616 100644 --- a/src/components/right/management/JoinRequest.tsx +++ b/src/components/right/management/JoinRequest.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiUser } from '../../../api/types'; +import type { ApiUser } from '../../../api/types'; import useLang from '../../../hooks/useLang'; import { getUserFullName } from '../../../global/helpers'; diff --git a/src/components/right/management/ManageChannel.tsx b/src/components/right/management/ManageChannel.tsx index 62f63014..891692b7 100644 --- a/src/components/right/management/ManageChannel.tsx +++ b/src/components/right/management/ManageChannel.tsx @@ -1,11 +1,13 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useState, + memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import { ManagementScreens, ManagementProgress } from '../../../types'; -import { ApiChat, ApiExportedInvite, ApiMediaFormat } from '../../../api/types'; +import type { ApiChat, ApiExportedInvite } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; import { getChatAvatarHash, getHasAdminRight } from '../../../global/helpers'; import useMedia from '../../../hooks/useMedia'; diff --git a/src/components/right/management/ManageChatAdministrators.tsx b/src/components/right/management/ManageChatAdministrators.tsx index ba7bd29d..4331aae9 100644 --- a/src/components/right/management/ManageChatAdministrators.tsx +++ b/src/components/right/management/ManageChatAdministrators.tsx @@ -1,10 +1,9 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getGlobal, withGlobal } from '../../../global'; import { ManagementScreens } from '../../../types'; -import { ApiChat, ApiChatMember } from '../../../api/types'; +import type { ApiChat, ApiChatMember } from '../../../api/types'; import { getUserFullName, isChatChannel } from '../../../global/helpers'; import { selectChat } from '../../../global/selectors'; diff --git a/src/components/right/management/ManageChatPrivacyType.tsx b/src/components/right/management/ManageChatPrivacyType.tsx index c48860d0..300d6b34 100644 --- a/src/components/right/management/ManageChatPrivacyType.tsx +++ b/src/components/right/management/ManageChatPrivacyType.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useState, + memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat } from '../../../api/types'; +import type { ApiChat } from '../../../api/types'; import { ManagementProgress } from '../../../types'; import { selectChat, selectManagement } from '../../../global/selectors'; diff --git a/src/components/right/management/ManageChatRemovedUsers.tsx b/src/components/right/management/ManageChatRemovedUsers.tsx index 077a4bbc..5e867990 100644 --- a/src/components/right/management/ManageChatRemovedUsers.tsx +++ b/src/components/right/management/ManageChatRemovedUsers.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiChatMember, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiChatMember, ApiUser } from '../../../api/types'; import { selectChat } from '../../../global/selectors'; import { getHasAdminRight, getUserFullName, isChatChannel } from '../../../global/helpers'; diff --git a/src/components/right/management/ManageDiscussion.tsx b/src/components/right/management/ManageDiscussion.tsx index 84300068..f1f307e3 100644 --- a/src/components/right/management/ManageDiscussion.tsx +++ b/src/components/right/management/ManageDiscussion.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useState, + memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat } from '../../../api/types'; +import type { ApiChat } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import { STICKER_SIZE_DISCUSSION_GROUPS } from '../../../config'; diff --git a/src/components/right/management/ManageGroup.tsx b/src/components/right/management/ManageGroup.tsx index 2f488332..4d2c222d 100644 --- a/src/components/right/management/ManageGroup.tsx +++ b/src/components/right/management/ManageGroup.tsx @@ -1,13 +1,13 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import { ManagementScreens, ManagementProgress } from '../../../types'; -import { - ApiChat, ApiChatBannedRights, ApiExportedInvite, ApiMediaFormat, -} from '../../../api/types'; +import type { ApiChat, ApiChatBannedRights, ApiExportedInvite } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; import { getChatAvatarHash, getHasAdminRight, isChatBasicGroup } from '../../../global/helpers'; import useMedia from '../../../hooks/useMedia'; diff --git a/src/components/right/management/ManageGroupAdminRights.tsx b/src/components/right/management/ManageGroupAdminRights.tsx index 08423f6b..1400f10b 100644 --- a/src/components/right/management/ManageGroupAdminRights.tsx +++ b/src/components/right/management/ManageGroupAdminRights.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; -import { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types'; +import type { ApiChat, ApiChatAdminRights, ApiUser } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import { selectChat } from '../../../global/selectors'; diff --git a/src/components/right/management/ManageGroupMembers.tsx b/src/components/right/management/ManageGroupMembers.tsx index 40322391..b3116ffa 100644 --- a/src/components/right/management/ManageGroupMembers.tsx +++ b/src/components/right/management/ManageGroupMembers.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useMemo, useRef, + memo, useCallback, useMemo, useRef, } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; -import { ApiChatMember, ApiUserStatus } from '../../../api/types'; +import type { ApiChatMember, ApiUserStatus } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import { unique } from '../../../util/iteratees'; diff --git a/src/components/right/management/ManageGroupPermissions.tsx b/src/components/right/management/ManageGroupPermissions.tsx index a389d8c3..c3371adb 100644 --- a/src/components/right/management/ManageGroupPermissions.tsx +++ b/src/components/right/management/ManageGroupPermissions.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import { ManagementScreens } from '../../../types'; -import { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types'; +import type { ApiChat, ApiChatBannedRights, ApiChatMember } from '../../../api/types'; import useLang from '../../../hooks/useLang'; import { selectChat } from '../../../global/selectors'; diff --git a/src/components/right/management/ManageGroupRecentActions.tsx b/src/components/right/management/ManageGroupRecentActions.tsx index 86da6249..2b88de7c 100644 --- a/src/components/right/management/ManageGroupRecentActions.tsx +++ b/src/components/right/management/ManageGroupRecentActions.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; -import { ApiChat, ApiChatMember } from '../../../api/types'; +import type { ApiChat, ApiChatMember } from '../../../api/types'; import useLang from '../../../hooks/useLang'; import { selectChat } from '../../../global/selectors'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/ManageGroupUserPermissions.tsx b/src/components/right/management/ManageGroupUserPermissions.tsx index 6f3eaffe..896e459d 100644 --- a/src/components/right/management/ManageGroupUserPermissions.tsx +++ b/src/components/right/management/ManageGroupUserPermissions.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiChatBannedRights } from '../../../api/types'; +import type { ApiChat, ApiChatBannedRights } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import { selectChat } from '../../../global/selectors'; diff --git a/src/components/right/management/ManageGroupUserPermissionsCreate.tsx b/src/components/right/management/ManageGroupUserPermissionsCreate.tsx index ce1a03ef..b4b1485a 100644 --- a/src/components/right/management/ManageGroupUserPermissionsCreate.tsx +++ b/src/components/right/management/ManageGroupUserPermissionsCreate.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useMemo, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useMemo } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; -import { ApiChatMember, ApiUser, ApiUserStatus } from '../../../api/types'; +import type { ApiChatMember, ApiUser, ApiUserStatus } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import { selectChat } from '../../../global/selectors'; diff --git a/src/components/right/management/ManageInvite.tsx b/src/components/right/management/ManageInvite.tsx index c9ed36f7..79bd0de9 100644 --- a/src/components/right/management/ManageInvite.tsx +++ b/src/components/right/management/ManageInvite.tsx @@ -1,10 +1,9 @@ -import { ChangeEvent } from 'react'; -import React, { - FC, memo, useCallback, useState, -} from '../../../lib/teact/teact'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useState } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiExportedInvite } from '../../../api/types'; +import type { ApiExportedInvite } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/ManageInviteInfo.tsx b/src/components/right/management/ManageInviteInfo.tsx index ddab5119..5dd1ca2d 100644 --- a/src/components/right/management/ManageInviteInfo.tsx +++ b/src/components/right/management/ManageInviteInfo.tsx @@ -1,9 +1,8 @@ -import React, { - FC, memo, useCallback, useEffect, -} from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback, useEffect } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChatInviteImporter, ApiExportedInvite, ApiUser } from '../../../api/types'; +import type { ApiChatInviteImporter, ApiExportedInvite, ApiUser } from '../../../api/types'; import useHistoryBack from '../../../hooks/useHistoryBack'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/right/management/ManageInvites.tsx b/src/components/right/management/ManageInvites.tsx index f237ae11..b048cdf8 100644 --- a/src/components/right/management/ManageInvites.tsx +++ b/src/components/right/management/ManageInvites.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useMemo, useState, + memo, useCallback, useEffect, useMemo, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat, ApiExportedInvite } from '../../../api/types'; +import type { ApiChat, ApiExportedInvite } from '../../../api/types'; import { ManagementScreens } from '../../../types'; import { STICKER_SIZE_INVITES } from '../../../config'; diff --git a/src/components/right/management/ManageJoinRequests.tsx b/src/components/right/management/ManageJoinRequests.tsx index fc4fcf28..fd837d35 100644 --- a/src/components/right/management/ManageJoinRequests.tsx +++ b/src/components/right/management/ManageJoinRequests.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useState, + memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiChat } from '../../../api/types'; +import type { ApiChat } from '../../../api/types'; import { STICKER_SIZE_JOIN_REQUESTS } from '../../../config'; import useHistoryBack from '../../../hooks/useHistoryBack'; diff --git a/src/components/right/management/ManageReactions.tsx b/src/components/right/management/ManageReactions.tsx index ac373549..0e669804 100644 --- a/src/components/right/management/ManageReactions.tsx +++ b/src/components/right/management/ManageReactions.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useState, + memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiAvailableReaction, ApiChat } from '../../../api/types'; +import type { ApiAvailableReaction, ApiChat } from '../../../api/types'; import { selectChat } from '../../../global/selectors'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/right/management/ManageUser.tsx b/src/components/right/management/ManageUser.tsx index 2dfa6b29..593a860c 100644 --- a/src/components/right/management/ManageUser.tsx +++ b/src/components/right/management/ManageUser.tsx @@ -1,10 +1,11 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useCallback, useEffect, useState, + memo, useCallback, useEffect, useState, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; -import { ApiUser } from '../../../api/types'; +import type { ApiUser } from '../../../api/types'; import { ManagementProgress } from '../../../types'; import { diff --git a/src/components/right/management/Management.async.tsx b/src/components/right/management/Management.async.tsx index 80d3747d..43f8efea 100644 --- a/src/components/right/management/Management.async.tsx +++ b/src/components/right/management/Management.async.tsx @@ -1,7 +1,8 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './Management'; +import type { OwnProps } from './Management'; import useModuleLoader from '../../../hooks/useModuleLoader'; diff --git a/src/components/right/management/Management.tsx b/src/components/right/management/Management.tsx index d54fc168..2549abe7 100644 --- a/src/components/right/management/Management.tsx +++ b/src/components/right/management/Management.tsx @@ -1,7 +1,9 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; import { withGlobal } from '../../../global'; -import { ManagementScreens, ManagementType } from '../../../types'; +import type { ManagementType } from '../../../types'; +import { ManagementScreens } from '../../../types'; import { selectCurrentManagementType } from '../../../global/selectors'; diff --git a/src/components/right/management/RemoveGroupUserModal.tsx b/src/components/right/management/RemoveGroupUserModal.tsx index fcf483ee..6001a980 100644 --- a/src/components/right/management/RemoveGroupUserModal.tsx +++ b/src/components/right/management/RemoveGroupUserModal.tsx @@ -1,9 +1,10 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, useMemo, useState, memo, useRef, useCallback, + useMemo, useState, memo, useRef, useCallback, } from '../../../lib/teact/teact'; import { getActions, getGlobal, withGlobal } from '../../../global'; -import { ApiChat } from '../../../api/types'; +import type { ApiChat } from '../../../api/types'; import { filterUsersByName } from '../../../global/helpers'; import useLang from '../../../hooks/useLang'; diff --git a/src/components/right/statistics/MessageStatistics.async.tsx b/src/components/right/statistics/MessageStatistics.async.tsx index 6954de4b..8c1b330a 100644 --- a/src/components/right/statistics/MessageStatistics.async.tsx +++ b/src/components/right/statistics/MessageStatistics.async.tsx @@ -1,7 +1,8 @@ -import React, { FC } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React from '../../../lib/teact/teact'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './MessageStatistics'; +import type { OwnProps } from './MessageStatistics'; import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; diff --git a/src/components/right/statistics/MessageStatistics.tsx b/src/components/right/statistics/MessageStatistics.tsx index 07715367..01650e51 100644 --- a/src/components/right/statistics/MessageStatistics.tsx +++ b/src/components/right/statistics/MessageStatistics.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useState, useEffect, useRef, + memo, useState, useEffect, useRef, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import { callApi } from '../../../api/gramjs'; -import { ApiMessageStatistics, StatisticsGraph } from '../../../api/types'; +import type { ApiMessageStatistics, StatisticsGraph } from '../../../api/types'; import { selectChat } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; diff --git a/src/components/right/statistics/Statistics.async.tsx b/src/components/right/statistics/Statistics.async.tsx index 6ef36b68..10cee815 100644 --- a/src/components/right/statistics/Statistics.async.tsx +++ b/src/components/right/statistics/Statistics.async.tsx @@ -1,7 +1,8 @@ -import React, { FC } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React from '../../../lib/teact/teact'; import { Bundles } from '../../../util/moduleLoader'; -import { OwnProps } from './Statistics'; +import type { OwnProps } from './Statistics'; import useModuleLoader from '../../../hooks/useModuleLoader'; import Loading from '../../ui/Loading'; diff --git a/src/components/right/statistics/Statistics.tsx b/src/components/right/statistics/Statistics.tsx index c833bf3e..868680cd 100644 --- a/src/components/right/statistics/Statistics.tsx +++ b/src/components/right/statistics/Statistics.tsx @@ -1,10 +1,11 @@ +import type { FC } from '../../../lib/teact/teact'; import React, { - FC, memo, useState, useEffect, useRef, useMemo, + memo, useState, useEffect, useRef, useMemo, } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; import { callApi } from '../../../api/gramjs'; -import { +import type { ApiMessage, ApiChannelStatistics, ApiGroupStatistics, diff --git a/src/components/right/statistics/StatisticsOverview.tsx b/src/components/right/statistics/StatisticsOverview.tsx index 7f63395d..fced9261 100644 --- a/src/components/right/statistics/StatisticsOverview.tsx +++ b/src/components/right/statistics/StatisticsOverview.tsx @@ -1,6 +1,7 @@ -import React, { FC, memo } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo } from '../../../lib/teact/teact'; -import { +import type { ApiChannelStatistics, ApiGroupStatistics, ApiMessageStatistics, StatisticsOverviewItem, } from '../../../api/types'; diff --git a/src/components/right/statistics/StatisticsRecentMessage.tsx b/src/components/right/statistics/StatisticsRecentMessage.tsx index 13e7fc02..ad9cac74 100644 --- a/src/components/right/statistics/StatisticsRecentMessage.tsx +++ b/src/components/right/statistics/StatisticsRecentMessage.tsx @@ -1,9 +1,11 @@ -import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; +import type { FC } from '../../../lib/teact/teact'; +import React, { memo, useCallback } from '../../../lib/teact/teact'; -import useLang, { LangFn } from '../../../hooks/useLang'; +import type { LangFn } from '../../../hooks/useLang'; +import useLang from '../../../hooks/useLang'; import { getActions } from '../../../global'; -import { ApiMessage, StatisticsRecentMessage as StatisticsRecentMessageType } from '../../../api/types'; +import type { ApiMessage, StatisticsRecentMessage as StatisticsRecentMessageType } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import { formatDateTimeToString } from '../../../util/dateFormat'; diff --git a/src/components/test/ErrorTest.tsx b/src/components/test/ErrorTest.tsx index aad43677..50e9b772 100644 --- a/src/components/test/ErrorTest.tsx +++ b/src/components/test/ErrorTest.tsx @@ -1,4 +1,5 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import { withGlobal } from '../../global'; type OwnProps = { diff --git a/src/components/test/SubTest.tsx b/src/components/test/SubTest.tsx index 2e24d2f8..b5de31ea 100644 --- a/src/components/test/SubTest.tsx +++ b/src/components/test/SubTest.tsx @@ -1,5 +1,6 @@ -import React, { FC, useState } from '../../lib/teact/teact'; -import { ApiUpdateAuthorizationStateType } from '../../api/types'; +import type { FC } from '../../lib/teact/teact'; +import React, { useState } from '../../lib/teact/teact'; +import type { ApiUpdateAuthorizationStateType } from '../../api/types'; type OwnProps = { authState?: ApiUpdateAuthorizationStateType; diff --git a/src/components/test/Test.tsx b/src/components/test/Test.tsx index afd7751a..f6565f35 100644 --- a/src/components/test/Test.tsx +++ b/src/components/test/Test.tsx @@ -1,6 +1,7 @@ -import React, { FC, useState } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useState } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; +import type { GlobalState } from '../../global/types'; import SubTest from './SubTest'; import ErrorTest from './ErrorTest'; diff --git a/src/components/test/TestNoRedundancy.tsx b/src/components/test/TestNoRedundancy.tsx index ab41aec0..8dc4dd8e 100644 --- a/src/components/test/TestNoRedundancy.tsx +++ b/src/components/test/TestNoRedundancy.tsx @@ -1,6 +1,7 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import { getGlobal, setGlobal, withGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; +import type { GlobalState } from '../../global/types'; document.ondblclick = () => { const value = Math.random(); diff --git a/src/components/test/TestOrdered.tsx b/src/components/test/TestOrdered.tsx index 08c45054..97895743 100644 --- a/src/components/test/TestOrdered.tsx +++ b/src/components/test/TestOrdered.tsx @@ -1,5 +1,6 @@ -import { ChangeEvent } from 'react'; -import React, { FC, useRef, useState } from '../../lib/teact/teact'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { useRef, useState } from '../../lib/teact/teact'; const TestOrdered: FC<{}> = () => { const [items, setItems] = useState>({ a: 1, b: 5, c: 10 }); diff --git a/src/components/test/TestPortal.tsx b/src/components/test/TestPortal.tsx index e131b366..139aedfa 100644 --- a/src/components/test/TestPortal.tsx +++ b/src/components/test/TestPortal.tsx @@ -1,4 +1,5 @@ -import React, { FC, useState } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useState } from '../../lib/teact/teact'; import Portal from '../ui/Portal'; diff --git a/src/components/ui/AvatarEditable.tsx b/src/components/ui/AvatarEditable.tsx index c068dafc..2c06c733 100644 --- a/src/components/ui/AvatarEditable.tsx +++ b/src/components/ui/AvatarEditable.tsx @@ -1,6 +1,7 @@ -import { ChangeEvent } from 'react'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useState, useEffect, memo, useCallback, + useState, useEffect, memo, useCallback, } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/Button.tsx b/src/components/ui/Button.tsx index 2d515c3a..02d3d7c6 100644 --- a/src/components/ui/Button.tsx +++ b/src/components/ui/Button.tsx @@ -1,8 +1,7 @@ -import { MouseEvent as ReactMouseEvent, RefObject } from 'react'; +import type { MouseEvent as ReactMouseEvent, RefObject } from 'react'; -import React, { - FC, useRef, useCallback, useState, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useRef, useCallback, useState } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/Checkbox.tsx b/src/components/ui/Checkbox.tsx index 4016fd76..b644c67b 100644 --- a/src/components/ui/Checkbox.tsx +++ b/src/components/ui/Checkbox.tsx @@ -1,7 +1,6 @@ -import { ChangeEvent } from 'react'; -import React, { - FC, memo, TeactNode, useCallback, -} from '../../lib/teact/teact'; +import type { ChangeEvent } from 'react'; +import type { FC, TeactNode } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import useLang from '../../hooks/useLang'; diff --git a/src/components/ui/CheckboxGroup.tsx b/src/components/ui/CheckboxGroup.tsx index 71a7762e..ffa4fb4c 100644 --- a/src/components/ui/CheckboxGroup.tsx +++ b/src/components/ui/CheckboxGroup.tsx @@ -1,7 +1,6 @@ -import { ChangeEvent } from 'react'; -import React, { - FC, useCallback, memo, useState, -} from '../../lib/teact/teact'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback, memo, useState } from '../../lib/teact/teact'; import Checkbox from './Checkbox'; diff --git a/src/components/ui/ConfirmDialog.tsx b/src/components/ui/ConfirmDialog.tsx index 21b3de16..93a0c33a 100644 --- a/src/components/ui/ConfirmDialog.tsx +++ b/src/components/ui/ConfirmDialog.tsx @@ -1,8 +1,7 @@ -import React, { - FC, memo, TeactNode, useCallback, useRef, -} from '../../lib/teact/teact'; +import type { FC, TeactNode } from '../../lib/teact/teact'; +import React, { memo, useCallback, useRef } from '../../lib/teact/teact'; -import { TextPart } from '../../types'; +import type { TextPart } from '../../types'; import useLang from '../../hooks/useLang'; import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation'; diff --git a/src/components/ui/CropModal.tsx b/src/components/ui/CropModal.tsx index b9ee6214..541e8f14 100644 --- a/src/components/ui/CropModal.tsx +++ b/src/components/ui/CropModal.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useEffect, useState, memo, useCallback, + useEffect, useState, memo, useCallback, } from '../../lib/teact/teact'; import { DEBUG } from '../../config'; diff --git a/src/components/ui/DropdownMenu.tsx b/src/components/ui/DropdownMenu.tsx index aa9d22cc..0f7224db 100644 --- a/src/components/ui/DropdownMenu.tsx +++ b/src/components/ui/DropdownMenu.tsx @@ -1,6 +1,5 @@ -import React, { - FC, useState, useRef, useCallback, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useState, useRef, useCallback } from '../../lib/teact/teact'; import Menu from './Menu'; diff --git a/src/components/ui/FloatingActionButton.tsx b/src/components/ui/FloatingActionButton.tsx index 8946159e..86dec6f3 100644 --- a/src/components/ui/FloatingActionButton.tsx +++ b/src/components/ui/FloatingActionButton.tsx @@ -1,8 +1,10 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; -import Button, { OwnProps as ButtonProps } from './Button'; +import type { OwnProps as ButtonProps } from './Button'; +import Button from './Button'; import './FloatingActionButton.scss'; diff --git a/src/components/ui/InfiniteScroll.tsx b/src/components/ui/InfiniteScroll.tsx index 7bf412c3..aa6718d6 100644 --- a/src/components/ui/InfiniteScroll.tsx +++ b/src/components/ui/InfiniteScroll.tsx @@ -1,8 +1,9 @@ -import { RefObject, UIEvent } from 'react'; +import type { RefObject, UIEvent } from 'react'; import { LoadMoreDirection } from '../../types'; +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, useEffect, useLayoutEffect, useMemo, useRef, + useCallback, useEffect, useLayoutEffect, useMemo, useRef, } from '../../lib/teact/teact'; import { debounce } from '../../util/schedulers'; diff --git a/src/components/ui/InputText.tsx b/src/components/ui/InputText.tsx index 1306c6ad..0a8a16e4 100644 --- a/src/components/ui/InputText.tsx +++ b/src/components/ui/InputText.tsx @@ -1,7 +1,8 @@ -import { +import type { ChangeEvent, FormEvent, RefObject, } from 'react'; -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import useLang from '../../hooks/useLang'; diff --git a/src/components/ui/Link.tsx b/src/components/ui/Link.tsx index 7aa615b0..bc488d8c 100644 --- a/src/components/ui/Link.tsx +++ b/src/components/ui/Link.tsx @@ -1,4 +1,5 @@ -import React, { FC, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/ListItem.tsx b/src/components/ui/ListItem.tsx index b038b3b9..92ba6752 100644 --- a/src/components/ui/ListItem.tsx +++ b/src/components/ui/ListItem.tsx @@ -1,5 +1,6 @@ -import { RefObject } from 'react'; -import React, { FC, useRef, useCallback } from '../../lib/teact/teact'; +import type { RefObject } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { useRef, useCallback } from '../../lib/teact/teact'; import { IS_TOUCH_ENV } from '../../util/environment'; import { fastRaf } from '../../util/schedulers'; diff --git a/src/components/ui/Loading.tsx b/src/components/ui/Loading.tsx index 6f2f00d8..f14d9057 100644 --- a/src/components/ui/Loading.tsx +++ b/src/components/ui/Loading.tsx @@ -1,4 +1,5 @@ -import React, { FC, memo } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import Spinner from './Spinner'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/Menu.tsx b/src/components/ui/Menu.tsx index 8226a712..0556512b 100644 --- a/src/components/ui/Menu.tsx +++ b/src/components/ui/Menu.tsx @@ -1,5 +1,6 @@ -import { RefObject } from 'react'; -import React, { FC, useEffect, useRef } from '../../lib/teact/teact'; +import type { RefObject } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { useEffect, useRef } from '../../lib/teact/teact'; import useShowTransition from '../../hooks/useShowTransition'; import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation'; diff --git a/src/components/ui/MenuItem.tsx b/src/components/ui/MenuItem.tsx index f96da748..73f05480 100644 --- a/src/components/ui/MenuItem.tsx +++ b/src/components/ui/MenuItem.tsx @@ -1,4 +1,5 @@ -import React, { FC, useCallback } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback } from '../../lib/teact/teact'; import { IS_TEST } from '../../config'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/Modal.tsx b/src/components/ui/Modal.tsx index b07de4d6..3801638d 100644 --- a/src/components/ui/Modal.tsx +++ b/src/components/ui/Modal.tsx @@ -1,9 +1,8 @@ -import { RefObject } from 'react'; -import React, { - FC, TeactNode, useEffect, useRef, -} from '../../lib/teact/teact'; +import type { RefObject } from 'react'; +import type { FC, TeactNode } from '../../lib/teact/teact'; +import React, { useEffect, useRef } from '../../lib/teact/teact'; -import { TextPart } from '../../types'; +import type { TextPart } from '../../types'; import captureKeyboardListeners from '../../util/captureKeyboardListeners'; import trapFocus from '../../util/trapFocus'; diff --git a/src/components/ui/Notification.tsx b/src/components/ui/Notification.tsx index 1691018a..39bb4290 100644 --- a/src/components/ui/Notification.tsx +++ b/src/components/ui/Notification.tsx @@ -1,12 +1,12 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, useEffect, useRef, useState, } from '../../lib/teact/teact'; -import { TextPart } from '../../types'; +import type { TextPart } from '../../types'; import { ANIMATION_END_DELAY } from '../../config'; import useShowTransition from '../../hooks/useShowTransition'; diff --git a/src/components/ui/Portal.ts b/src/components/ui/Portal.ts index 9846660a..69f8e7f3 100644 --- a/src/components/ui/Portal.ts +++ b/src/components/ui/Portal.ts @@ -1,6 +1,5 @@ -import { - FC, useRef, useLayoutEffect, VirtualElement, -} from '../../lib/teact/teact'; +import type { FC, VirtualElement } from '../../lib/teact/teact'; +import { useRef, useLayoutEffect } from '../../lib/teact/teact'; import TeactDOM from '../../lib/teact/teact-dom'; type OwnProps = { diff --git a/src/components/ui/ProgressSpinner.tsx b/src/components/ui/ProgressSpinner.tsx index b75d77e8..7c65df0e 100644 --- a/src/components/ui/ProgressSpinner.tsx +++ b/src/components/ui/ProgressSpinner.tsx @@ -1,6 +1,5 @@ -import React, { - FC, useEffect, useRef, memo, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useEffect, useRef, memo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/Radio.tsx b/src/components/ui/Radio.tsx index 8a593939..af51ceeb 100644 --- a/src/components/ui/Radio.tsx +++ b/src/components/ui/Radio.tsx @@ -1,5 +1,6 @@ -import { ChangeEvent } from 'react'; -import React, { FC, memo, TeactNode } from '../../lib/teact/teact'; +import type { ChangeEvent } from 'react'; +import type { FC, TeactNode } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import useLang from '../../hooks/useLang'; diff --git a/src/components/ui/RadioGroup.tsx b/src/components/ui/RadioGroup.tsx index 869de313..23c8fe7e 100644 --- a/src/components/ui/RadioGroup.tsx +++ b/src/components/ui/RadioGroup.tsx @@ -1,7 +1,6 @@ -import { ChangeEvent } from 'react'; -import React, { - FC, useCallback, memo, TeactNode, -} from '../../lib/teact/teact'; +import type { ChangeEvent } from 'react'; +import type { FC, TeactNode } from '../../lib/teact/teact'; +import React, { useCallback, memo } from '../../lib/teact/teact'; import Radio from './Radio'; diff --git a/src/components/ui/RangeSlider.tsx b/src/components/ui/RangeSlider.tsx index e3e9c165..818b1fd2 100644 --- a/src/components/ui/RangeSlider.tsx +++ b/src/components/ui/RangeSlider.tsx @@ -1,7 +1,6 @@ -import { ChangeEvent } from 'react'; -import React, { - FC, useCallback, useMemo, memo, -} from '../../lib/teact/teact'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { useCallback, useMemo, memo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import useLang from '../../hooks/useLang'; diff --git a/src/components/ui/ResponsiveHoverButton.tsx b/src/components/ui/ResponsiveHoverButton.tsx index 690b3308..c3561f09 100644 --- a/src/components/ui/ResponsiveHoverButton.tsx +++ b/src/components/ui/ResponsiveHoverButton.tsx @@ -1,10 +1,10 @@ -import React, { - FC, useRef, useCallback, memo, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useRef, useCallback, memo } from '../../lib/teact/teact'; import { IS_TOUCH_ENV } from '../../util/environment'; -import Button, { OwnProps as ButtonProps } from './Button'; +import type { OwnProps as ButtonProps } from './Button'; +import Button from './Button'; type OwnProps = { onActivate: NoneToVoidFunction; diff --git a/src/components/ui/RippleEffect.tsx b/src/components/ui/RippleEffect.tsx index 542623e9..6da3bc0b 100644 --- a/src/components/ui/RippleEffect.tsx +++ b/src/components/ui/RippleEffect.tsx @@ -1,5 +1,6 @@ +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useCallback, useMemo, useState, memo, + useCallback, useMemo, useState, memo, } from '../../lib/teact/teact'; import { debounce } from '../../util/schedulers'; diff --git a/src/components/ui/SearchInput.tsx b/src/components/ui/SearchInput.tsx index 4bcf0739..98bb70ca 100644 --- a/src/components/ui/SearchInput.tsx +++ b/src/components/ui/SearchInput.tsx @@ -1,6 +1,7 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; +import type { FC } from '../../lib/teact/teact'; import React, { - FC, useRef, useEffect, memo, useCallback, + useRef, useEffect, memo, useCallback, } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/Select.tsx b/src/components/ui/Select.tsx index 6bd4ad07..6e59cdcd 100644 --- a/src/components/ui/Select.tsx +++ b/src/components/ui/Select.tsx @@ -1,5 +1,6 @@ -import { ChangeEvent, RefObject } from 'react'; -import React, { FC, memo } from '../../lib/teact/teact'; +import type { ChangeEvent, RefObject } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/ShowMoreButton.tsx b/src/components/ui/ShowMoreButton.tsx index 37e72745..0e9fe06f 100644 --- a/src/components/ui/ShowMoreButton.tsx +++ b/src/components/ui/ShowMoreButton.tsx @@ -1,4 +1,5 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import useLang from '../../hooks/useLang'; diff --git a/src/components/ui/ShowTransition.tsx b/src/components/ui/ShowTransition.tsx index e4cb80c7..530c3e86 100644 --- a/src/components/ui/ShowTransition.tsx +++ b/src/components/ui/ShowTransition.tsx @@ -1,4 +1,5 @@ -import React, { FC, useRef } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useRef } from '../../lib/teact/teact'; import useShowTransition from '../../hooks/useShowTransition'; import usePrevious from '../../hooks/usePrevious'; diff --git a/src/components/ui/Skeleton.tsx b/src/components/ui/Skeleton.tsx index 2635f35c..2ac86c37 100644 --- a/src/components/ui/Skeleton.tsx +++ b/src/components/ui/Skeleton.tsx @@ -1,4 +1,5 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/Spinner.tsx b/src/components/ui/Spinner.tsx index d0be5707..cfd2cb13 100644 --- a/src/components/ui/Spinner.tsx +++ b/src/components/ui/Spinner.tsx @@ -1,4 +1,5 @@ -import React, { FC } from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/Switcher.tsx b/src/components/ui/Switcher.tsx index e84594ca..82182f82 100644 --- a/src/components/ui/Switcher.tsx +++ b/src/components/ui/Switcher.tsx @@ -1,5 +1,6 @@ -import { ChangeEvent } from 'react'; -import React, { FC, memo, useCallback } from '../../lib/teact/teact'; +import type { ChangeEvent } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useCallback } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; diff --git a/src/components/ui/Tab.tsx b/src/components/ui/Tab.tsx index 0f7d6c4c..aab39dae 100644 --- a/src/components/ui/Tab.tsx +++ b/src/components/ui/Tab.tsx @@ -1,6 +1,5 @@ -import React, { - FC, useRef, memo, useEffect, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { useRef, memo, useEffect } from '../../lib/teact/teact'; import buildClassName from '../../util/buildClassName'; import forceReflow from '../../util/forceReflow'; diff --git a/src/components/ui/TabList.tsx b/src/components/ui/TabList.tsx index aad98805..4f6b8800 100644 --- a/src/components/ui/TabList.tsx +++ b/src/components/ui/TabList.tsx @@ -1,6 +1,5 @@ -import React, { - FC, memo, useRef, useEffect, -} from '../../lib/teact/teact'; +import type { FC } from '../../lib/teact/teact'; +import React, { memo, useRef, useEffect } from '../../lib/teact/teact'; import { IS_ANDROID, IS_IOS } from '../../util/environment'; import fastSmoothScrollHorizontal from '../../util/fastSmoothScrollHorizontal'; diff --git a/src/components/ui/Transition.tsx b/src/components/ui/Transition.tsx index aedb58dc..699f59d9 100644 --- a/src/components/ui/Transition.tsx +++ b/src/components/ui/Transition.tsx @@ -1,9 +1,8 @@ -import { RefObject } from 'react'; -import React, { - FC, useLayoutEffect, useRef, -} from '../../lib/teact/teact'; +import type { RefObject } from 'react'; +import type { FC } from '../../lib/teact/teact'; +import React, { useLayoutEffect, useRef } from '../../lib/teact/teact'; import { getGlobal } from '../../global'; -import { GlobalState } from '../../global/types'; +import type { GlobalState } from '../../global/types'; import { ANIMATION_LEVEL_MIN } from '../../config'; import buildClassName from '../../util/buildClassName'; diff --git a/src/global/actions/api/bots.ts b/src/global/actions/api/bots.ts index f76fbca1..ad2e9464 100644 --- a/src/global/actions/api/bots.ts +++ b/src/global/actions/api/bots.ts @@ -2,8 +2,8 @@ import { addActionHandler, getActions, getGlobal, setGlobal, } from '../../index'; -import { ApiChat, ApiContact, ApiUser } from '../../../api/types'; -import { InlineBotSettings } from '../../../types'; +import type { ApiChat, ApiContact, ApiUser } from '../../../api/types'; +import type { InlineBotSettings } from '../../../types'; import { RE_TG_LINK, RE_TME_LINK, diff --git a/src/global/actions/api/chats.ts b/src/global/actions/api/chats.ts index 09c082fb..6fd72ebc 100644 --- a/src/global/actions/api/chats.ts +++ b/src/global/actions/api/chats.ts @@ -2,11 +2,10 @@ import { addActionHandler, getActions, getGlobal, setGlobal, } from '../../index'; -import { - ApiChat, ApiUser, ApiChatFolder, MAIN_THREAD_ID, -} from '../../../api/types'; +import type { ApiChat, ApiUser, ApiChatFolder } from '../../../api/types'; +import { MAIN_THREAD_ID } from '../../../api/types'; import { NewChatMembersProgress, ChatCreationProgress, ManagementProgress } from '../../../types'; -import { GlobalActions } from '../../types'; +import type { GlobalActions } from '../../types'; import { ARCHIVED_FOLDER_ID, diff --git a/src/global/actions/api/globalSearch.ts b/src/global/actions/api/globalSearch.ts index 6581ca3e..0702dbed 100644 --- a/src/global/actions/api/globalSearch.ts +++ b/src/global/actions/api/globalSearch.ts @@ -1,7 +1,7 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { callApi } from '../../../api/gramjs'; -import { ApiChat, ApiGlobalMessageSearchType } from '../../../api/types'; +import type { ApiChat, ApiGlobalMessageSearchType } from '../../../api/types'; import { addChats, diff --git a/src/global/actions/api/localSearch.ts b/src/global/actions/api/localSearch.ts index a3000135..95f80105 100644 --- a/src/global/actions/api/localSearch.ts +++ b/src/global/actions/api/localSearch.ts @@ -2,7 +2,8 @@ import { addActionHandler, getActions, getGlobal, setGlobal, } from '../../index'; -import { ApiChat, MAIN_THREAD_ID } from '../../../api/types'; +import type { ApiChat } from '../../../api/types'; +import { MAIN_THREAD_ID } from '../../../api/types'; import { MESSAGE_SEARCH_SLICE, SHARED_MEDIA_SLICE } from '../../../config'; import { callApi } from '../../../api/gramjs'; @@ -21,7 +22,7 @@ import { updateLocalMediaSearchResults, updateLocalTextSearchResults, } from '../../reducers'; -import { SharedMediaType } from '../../../types'; +import type { SharedMediaType } from '../../../types'; addActionHandler('searchTextMessagesLocal', (global) => { const { chatId, threadId } = selectCurrentMessageList(global) || {}; diff --git a/src/global/actions/api/messages.ts b/src/global/actions/api/messages.ts index 6ce9df76..11f897a3 100644 --- a/src/global/actions/api/messages.ts +++ b/src/global/actions/api/messages.ts @@ -1,7 +1,7 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; -import { GlobalActions } from '../../types'; -import { +import type { GlobalActions } from '../../types'; +import type { ApiAttachment, ApiChat, ApiMessage, @@ -11,6 +11,8 @@ import { ApiSticker, ApiUser, ApiVideo, +} from '../../../api/types'; +import { MAIN_THREAD_ID, MESSAGE_DELETED, } from '../../../api/types'; diff --git a/src/global/actions/api/payments.ts b/src/global/actions/api/payments.ts index b3c7c857..aac5d12f 100644 --- a/src/global/actions/api/payments.ts +++ b/src/global/actions/api/payments.ts @@ -1,7 +1,7 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { PaymentStep } from '../../../types'; -import { ApiChat } from '../../../api/types'; +import type { ApiChat } from '../../../api/types'; import { selectPaymentMessageId, diff --git a/src/global/actions/api/reactions.ts b/src/global/actions/api/reactions.ts index f8800914..1c237d31 100644 --- a/src/global/actions/api/reactions.ts +++ b/src/global/actions/api/reactions.ts @@ -1,7 +1,8 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { callApi } from '../../../api/gramjs'; import * as mediaLoader from '../../../util/mediaLoader'; -import { ApiAppConfig, ApiMediaFormat } from '../../../api/types'; +import type { ApiAppConfig } from '../../../api/types'; +import { ApiMediaFormat } from '../../../api/types'; import { selectChat, selectChatMessage, selectCurrentChat, diff --git a/src/global/actions/api/settings.ts b/src/global/actions/api/settings.ts index bd3e3152..cf05e157 100644 --- a/src/global/actions/api/settings.ts +++ b/src/global/actions/api/settings.ts @@ -1,8 +1,11 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; -import { GlobalState } from '../../types'; +import type { GlobalState } from '../../types'; +import type { + ApiPrivacyKey, PrivacyVisibility, InputPrivacyRules, InputPrivacyContact, +} from '../../../types'; import { - ApiPrivacyKey, PrivacyVisibility, ProfileEditProgress, InputPrivacyRules, InputPrivacyContact, + ProfileEditProgress, UPLOADING_WALLPAPER_SLUG, } from '../../../types'; diff --git a/src/global/actions/api/statistics.ts b/src/global/actions/api/statistics.ts index ac9b2bd4..fb920811 100644 --- a/src/global/actions/api/statistics.ts +++ b/src/global/actions/api/statistics.ts @@ -1,6 +1,6 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; -import { ApiChannelStatistics } from '../../../api/types'; +import type { ApiChannelStatistics } from '../../../api/types'; import { callApi } from '../../../api/gramjs'; import { updateStatistics, updateMessageStatistics, updateStatisticsGraph } from '../../reducers'; import { selectChatMessages, selectChat } from '../../selectors'; diff --git a/src/global/actions/api/symbols.ts b/src/global/actions/api/symbols.ts index e2cfa49c..d519a5af 100644 --- a/src/global/actions/api/symbols.ts +++ b/src/global/actions/api/symbols.ts @@ -2,8 +2,8 @@ import { addActionHandler, getActions, getGlobal, setGlobal, } from '../../index'; -import { ApiSticker } from '../../../api/types'; -import { LangCode } from '../../../types'; +import type { ApiSticker } from '../../../api/types'; +import type { LangCode } from '../../../types'; import { callApi } from '../../../api/gramjs'; import { onTickEnd, pause, throttle } from '../../../util/schedulers'; import { diff --git a/src/global/actions/api/sync.ts b/src/global/actions/api/sync.ts index 395b710a..3ed2eeb7 100644 --- a/src/global/actions/api/sync.ts +++ b/src/global/actions/api/sync.ts @@ -2,10 +2,9 @@ import { addActionHandler, getGlobal, setGlobal, getActions, } from '../../index'; -import { - ApiChat, ApiMessage, MAIN_THREAD_ID, -} from '../../../api/types'; -import { Thread } from '../../types'; +import type { ApiChat, ApiMessage } from '../../../api/types'; +import { MAIN_THREAD_ID } from '../../../api/types'; +import type { Thread } from '../../types'; import { DEBUG, MESSAGE_LIST_SLICE, SERVICE_NOTIFICATIONS_USER_ID, diff --git a/src/global/actions/api/users.ts b/src/global/actions/api/users.ts index a6c2c64d..1d37af0d 100644 --- a/src/global/actions/api/users.ts +++ b/src/global/actions/api/users.ts @@ -2,7 +2,7 @@ import { addActionHandler, getActions, getGlobal, setGlobal, } from '../../index'; -import { ApiUser } from '../../../api/types'; +import type { ApiUser } from '../../../api/types'; import { ManagementProgress } from '../../../types'; import { debounce, throttle } from '../../../util/schedulers'; diff --git a/src/global/actions/apiUpdaters/calls.async.ts b/src/global/actions/apiUpdaters/calls.async.ts index fc372782..752c6e1b 100644 --- a/src/global/actions/apiUpdaters/calls.async.ts +++ b/src/global/actions/apiUpdaters/calls.async.ts @@ -2,13 +2,13 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; import { selectActiveGroupCall, selectGroupCallParticipant, selectPhoneCallUser } from '../../selectors/calls'; import { updateGroupCall, updateGroupCallParticipant } from '../../reducers/calls'; import { omit } from '../../../util/iteratees'; +import type { ApiCallProtocol } from '../../../lib/secret-sauce'; import { - ApiCallProtocol, handleUpdateGroupCallConnection, handleUpdateGroupCallParticipants, joinPhoneCall, processSignalingMessage, } from '../../../lib/secret-sauce'; -import { ApiPhoneCall } from '../../../api/types'; +import type { ApiPhoneCall } from '../../../api/types'; import { ARE_CALLS_SUPPORTED } from '../../../util/environment'; import { callApi } from '../../../api/gramjs'; import * as langProvider from '../../../util/langProvider'; diff --git a/src/global/actions/apiUpdaters/initial.ts b/src/global/actions/apiUpdaters/initial.ts index 64e0f56b..cbd98d19 100644 --- a/src/global/actions/apiUpdaters/initial.ts +++ b/src/global/actions/apiUpdaters/initial.ts @@ -2,9 +2,9 @@ import { addActionHandler, getActions, getGlobal, setGlobal, } from '../../index'; -import { GlobalState } from '../../types'; +import type { GlobalState } from '../../types'; -import { +import type { ApiUpdateAuthorizationState, ApiUpdateAuthorizationError, ApiUpdateConnectionState, diff --git a/src/global/actions/apiUpdaters/messages.ts b/src/global/actions/apiUpdaters/messages.ts index 3f0ae782..e229e4c8 100644 --- a/src/global/actions/apiUpdaters/messages.ts +++ b/src/global/actions/apiUpdaters/messages.ts @@ -1,9 +1,10 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; -import { +import type { ApiChat, - ApiMessage, ApiPollResult, ApiReactions, ApiThreadInfo, MAIN_THREAD_ID, + ApiMessage, ApiPollResult, ApiReactions, ApiThreadInfo, } from '../../../api/types'; +import { MAIN_THREAD_ID } from '../../../api/types'; import { unique } from '../../../util/iteratees'; import { areDeepEqual } from '../../../util/areDeepEqual'; @@ -20,7 +21,7 @@ import { deleteChatScheduledMessages, updateThreadUnreadFromForwardedMessage, } from '../../reducers'; -import { ActiveEmojiInteraction, GlobalActions, GlobalState } from '../../types'; +import type { ActiveEmojiInteraction, GlobalActions, GlobalState } from '../../types'; import { selectChatMessage, selectChatMessages, diff --git a/src/global/actions/apiUpdaters/misc.ts b/src/global/actions/apiUpdaters/misc.ts index 1f2a2012..fa1a0860 100644 --- a/src/global/actions/apiUpdaters/misc.ts +++ b/src/global/actions/apiUpdaters/misc.ts @@ -1,6 +1,7 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; -import { ApiPrivacyKey, PaymentStep } from '../../../types'; +import type { ApiPrivacyKey } from '../../../types'; +import { PaymentStep } from '../../../types'; import { addBlockedContact, removeBlockedContact, setConfirmPaymentUrl, setPaymentStep, diff --git a/src/global/actions/apiUpdaters/users.ts b/src/global/actions/apiUpdaters/users.ts index 2cbc550e..9b79b6e5 100644 --- a/src/global/actions/apiUpdaters/users.ts +++ b/src/global/actions/apiUpdaters/users.ts @@ -1,6 +1,6 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; -import { ApiUserStatus } from '../../../api/types'; +import type { ApiUserStatus } from '../../../api/types'; import { deleteContact, replaceUserStatuses, updateUser } from '../../reducers'; import { throttle } from '../../../util/schedulers'; diff --git a/src/global/actions/ui/calls.ts b/src/global/actions/ui/calls.ts index 300f9c54..06468967 100644 --- a/src/global/actions/ui/calls.ts +++ b/src/global/actions/ui/calls.ts @@ -3,7 +3,7 @@ import { selectActiveGroupCall, selectChatGroupCall, selectGroupCall } from '../ import { callApi } from '../../../api/gramjs'; import { selectChat, selectUser } from '../../selectors'; import { copyTextToClipboard } from '../../../util/clipboard'; -import { ApiGroupCall } from '../../../api/types'; +import type { ApiGroupCall } from '../../../api/types'; import { updateGroupCall } from '../../reducers/calls'; import { buildCollectionByKey, omit } from '../../../util/iteratees'; import { addChats, addUsers } from '../../reducers'; @@ -11,7 +11,7 @@ import { fetchChatByUsername, loadFullChat } from '../api/chats'; import safePlay from '../../../util/safePlay'; import { ARE_CALLS_SUPPORTED } from '../../../util/environment'; import * as langProvider from '../../../util/langProvider'; -import { CallSound } from '../../types'; +import type { CallSound } from '../../types'; // Workaround for Safari not playing audio without user interaction let audioElement: HTMLAudioElement | undefined; diff --git a/src/global/actions/ui/localSearch.ts b/src/global/actions/ui/localSearch.ts index 7e8e0c75..184128e3 100644 --- a/src/global/actions/ui/localSearch.ts +++ b/src/global/actions/ui/localSearch.ts @@ -8,7 +8,7 @@ import { import { MEMO_EMPTY_ARRAY } from '../../../util/memo'; import { selectCurrentMessageList } from '../../selectors'; import { buildChatThreadKey } from '../../helpers'; -import { GlobalState } from '../../types'; +import type { GlobalState } from '../../types'; addActionHandler('openLocalTextSearch', (global) => { const { chatId, threadId } = selectCurrentMessageList(global) || {}; diff --git a/src/global/actions/ui/messages.ts b/src/global/actions/ui/messages.ts index c6535261..9beb7eba 100644 --- a/src/global/actions/ui/messages.ts +++ b/src/global/actions/ui/messages.ts @@ -1,6 +1,7 @@ import { addActionHandler, getGlobal, setGlobal } from '../../index'; -import { ApiMessage, MAIN_THREAD_ID } from '../../../api/types'; +import type { ApiMessage } from '../../../api/types'; +import { MAIN_THREAD_ID } from '../../../api/types'; import { FocusDirection } from '../../../types'; import { @@ -42,7 +43,7 @@ import parseMessageInput from '../../../util/parseMessageInput'; import { getMessageSummaryText, getSenderTitle } from '../../helpers'; import * as langProvider from '../../../util/langProvider'; import { copyTextToClipboard } from '../../../util/clipboard'; -import { GlobalState } from '../../types'; +import type { GlobalState } from '../../types'; const FOCUS_DURATION = 1500; const FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY; diff --git a/src/global/actions/ui/misc.ts b/src/global/actions/ui/misc.ts index 0c123350..e7de4152 100644 --- a/src/global/actions/ui/misc.ts +++ b/src/global/actions/ui/misc.ts @@ -1,6 +1,6 @@ import { addActionHandler, setGlobal } from '../../index'; -import { ApiError } from '../../../api/types'; +import type { ApiError } from '../../../api/types'; import { IS_SINGLE_COLUMN_LAYOUT, IS_TABLET_COLUMN_LAYOUT } from '../../../util/environment'; import getReadableErrorText from '../../../util/getReadableErrorText'; diff --git a/src/global/actions/ui/settings.ts b/src/global/actions/ui/settings.ts index 0233b9b1..d7d61f18 100644 --- a/src/global/actions/ui/settings.ts +++ b/src/global/actions/ui/settings.ts @@ -1,5 +1,5 @@ import { addActionHandler } from '../../index'; -import { ISettings, IThemeSettings, ThemeKey } from '../../../types'; +import type { ISettings, IThemeSettings, ThemeKey } from '../../../types'; import { replaceSettings, replaceThemeSettings } from '../../reducers'; addActionHandler('setSettingOption', (global, actions, payload?: Partial) => { diff --git a/src/global/cache.ts b/src/global/cache.ts index a9504868..87e0f9e0 100644 --- a/src/global/cache.ts +++ b/src/global/cache.ts @@ -2,7 +2,7 @@ import { addCallback, removeCallback } from '../lib/teact/teactn'; import { addActionHandler, getGlobal } from './index'; -import { GlobalState } from './types'; +import type { GlobalState } from './types'; import { MAIN_THREAD_ID } from '../api/types'; import { onBeforeUnload, onIdle, throttle } from '../util/schedulers'; diff --git a/src/global/helpers/chats.ts b/src/global/helpers/chats.ts index 39a5e459..11c8a925 100644 --- a/src/global/helpers/chats.ts +++ b/src/global/helpers/chats.ts @@ -1,14 +1,16 @@ -import { +import type { ApiChat, ApiUser, ApiChatBannedRights, ApiChatAdminRights, ApiChatFolder, +} from '../../api/types'; +import { MAIN_THREAD_ID, } from '../../api/types'; -import { NotifyException, NotifySettings } from '../../types'; -import { LangFn } from '../../hooks/useLang'; +import type { NotifyException, NotifySettings } from '../../types'; +import type { LangFn } from '../../hooks/useLang'; import { ARCHIVED_FOLDER_ID, REPLIES_USER_ID } from '../../config'; import { orderBy } from '../../util/iteratees'; diff --git a/src/global/helpers/messageMedia.ts b/src/global/helpers/messageMedia.ts index 5fa1cb72..e99d8480 100644 --- a/src/global/helpers/messageMedia.ts +++ b/src/global/helpers/messageMedia.ts @@ -1,6 +1,5 @@ -import { +import type { ApiAudio, - ApiMediaFormat, ApiMessage, ApiMessageSearchType, ApiPhoto, @@ -10,6 +9,9 @@ import { ApiGame, ApiDocument, } from '../../api/types'; +import { + ApiMediaFormat, +} from '../../api/types'; import { IS_OPUS_SUPPORTED, IS_PROGRESSIVE_SUPPORTED, IS_SAFARI } from '../../util/environment'; import { getMessageKey, isMessageLocal, matchLinkInMessageText } from './messages'; diff --git a/src/global/helpers/messageSummary.ts b/src/global/helpers/messageSummary.ts index 39e944f3..153f5a61 100644 --- a/src/global/helpers/messageSummary.ts +++ b/src/global/helpers/messageSummary.ts @@ -1,8 +1,9 @@ -import { ApiMessage, ApiMessageEntityTypes } from '../../api/types'; +import type { ApiMessage } from '../../api/types'; +import { ApiMessageEntityTypes } from '../../api/types'; import { CONTENT_NOT_SUPPORTED } from '../../config'; -import { TextPart } from '../../types'; -import { LangFn } from '../../hooks/useLang'; +import type { TextPart } from '../../types'; +import type { LangFn } from '../../hooks/useLang'; import trimText from '../../util/trimText'; import { getMessageText } from './messages'; diff --git a/src/global/helpers/messages.ts b/src/global/helpers/messages.ts index d8e25b1b..1a36d916 100644 --- a/src/global/helpers/messages.ts +++ b/src/global/helpers/messages.ts @@ -1,7 +1,8 @@ -import { - ApiChat, ApiMessage, ApiMessageEntityTypes, ApiReactions, ApiUser, +import type { + ApiChat, ApiMessage, ApiReactions, ApiUser, } from '../../api/types'; -import { LangFn } from '../../hooks/useLang'; +import { ApiMessageEntityTypes } from '../../api/types'; +import type { LangFn } from '../../hooks/useLang'; import { CONTENT_NOT_SUPPORTED, diff --git a/src/global/helpers/payments.ts b/src/global/helpers/payments.ts index 223a16fb..fe8c20b4 100644 --- a/src/global/helpers/payments.ts +++ b/src/global/helpers/payments.ts @@ -1,4 +1,4 @@ -import { ApiFieldError } from '../../api/types'; +import type { ApiFieldError } from '../../api/types'; const STRIPE_ERRORS: Record = { missing_payment_information: { diff --git a/src/global/helpers/reactions.ts b/src/global/helpers/reactions.ts index 5c1f9e8f..8e552b18 100644 --- a/src/global/helpers/reactions.ts +++ b/src/global/helpers/reactions.ts @@ -1,5 +1,5 @@ -import { ApiMessage, ApiReactions } from '../../api/types'; -import { GlobalState } from '../types'; +import type { ApiMessage, ApiReactions } from '../../api/types'; +import type { GlobalState } from '../types'; export function getMessageRecentReaction(message: Partial) { return message.isOutgoing ? message.reactions?.recentReactions?.[0] : undefined; diff --git a/src/global/helpers/users.ts b/src/global/helpers/users.ts index 5d7204e3..6208c898 100644 --- a/src/global/helpers/users.ts +++ b/src/global/helpers/users.ts @@ -1,9 +1,9 @@ -import { ApiChat, ApiUser, ApiUserStatus } from '../../api/types'; +import type { ApiChat, ApiUser, ApiUserStatus } from '../../api/types'; import { SERVICE_NOTIFICATIONS_USER_ID } from '../../config'; import { formatFullDate, formatTime } from '../../util/dateFormat'; import { orderBy } from '../../util/iteratees'; -import { LangFn } from '../../hooks/useLang'; +import type { LangFn } from '../../hooks/useLang'; import { getServerTime } from '../../util/serverTime'; import { prepareSearchWordsForNeedle } from '../../util/searchWords'; import { formatPhoneNumber } from '../../util/phoneNumber'; diff --git a/src/global/index.ts b/src/global/index.ts index c80ecaad..fb571eec 100644 --- a/src/global/index.ts +++ b/src/global/index.ts @@ -1,5 +1,5 @@ import { typify } from '../lib/teact/teactn'; -import { GlobalState, ActionPayloads, NonTypedActionNames } from './types'; +import type { GlobalState, ActionPayloads, NonTypedActionNames } from './types'; const typed = typify(); diff --git a/src/global/initialState.ts b/src/global/initialState.ts index 82d560f5..e7004b52 100644 --- a/src/global/initialState.ts +++ b/src/global/initialState.ts @@ -1,4 +1,4 @@ -import { GlobalState } from './types'; +import type { GlobalState } from './types'; import { NewChatMembersProgress } from '../types'; import { diff --git a/src/global/reducers/bots.ts b/src/global/reducers/bots.ts index dea7d3ab..3f0532dc 100644 --- a/src/global/reducers/bots.ts +++ b/src/global/reducers/bots.ts @@ -1,5 +1,5 @@ -import { GlobalState } from '../types'; -import { InlineBotSettings } from '../../types'; +import type { GlobalState } from '../types'; +import type { InlineBotSettings } from '../../types'; export function replaceInlineBotSettings( global: GlobalState, username: string, inlineBotSettings: InlineBotSettings | false, diff --git a/src/global/reducers/calls.ts b/src/global/reducers/calls.ts index ccec8b7a..153bef78 100644 --- a/src/global/reducers/calls.ts +++ b/src/global/reducers/calls.ts @@ -1,6 +1,6 @@ -import { GroupCallParticipant } from '../../lib/secret-sauce'; -import { GlobalState } from '../types'; -import { ApiGroupCall } from '../../api/types'; +import type { GroupCallParticipant } from '../../lib/secret-sauce'; +import type { GlobalState } from '../types'; +import type { ApiGroupCall } from '../../api/types'; import { selectGroupCall } from '../selectors/calls'; import { omit } from '../../util/iteratees'; import { updateChat } from './chats'; diff --git a/src/global/reducers/chats.ts b/src/global/reducers/chats.ts index 4ce45c9d..1f5daaec 100644 --- a/src/global/reducers/chats.ts +++ b/src/global/reducers/chats.ts @@ -1,5 +1,5 @@ -import { GlobalState } from '../types'; -import { ApiChat, ApiChatMember, ApiPhoto } from '../../api/types'; +import type { GlobalState } from '../types'; +import type { ApiChat, ApiChatMember, ApiPhoto } from '../../api/types'; import { ARCHIVED_FOLDER_ID } from '../../config'; import { areSortedArraysEqual, omit } from '../../util/iteratees'; diff --git a/src/global/reducers/globalSearch.ts b/src/global/reducers/globalSearch.ts index 2c5b5060..3a6d7445 100644 --- a/src/global/reducers/globalSearch.ts +++ b/src/global/reducers/globalSearch.ts @@ -1,6 +1,6 @@ -import { GlobalState } from '../types'; -import { GlobalSearchContent } from '../../types'; -import { ApiGlobalMessageSearchType, ApiMessage } from '../../api/types'; +import type { GlobalState } from '../types'; +import type { GlobalSearchContent } from '../../types'; +import type { ApiGlobalMessageSearchType, ApiMessage } from '../../api/types'; import { areSortedArraysEqual } from '../../util/iteratees'; const getComplexKey = (message: ApiMessage) => `${message.chatId}_${message.id}`; diff --git a/src/global/reducers/localSearch.ts b/src/global/reducers/localSearch.ts index 94801005..ec7a3463 100644 --- a/src/global/reducers/localSearch.ts +++ b/src/global/reducers/localSearch.ts @@ -1,8 +1,8 @@ -import { GlobalState } from '../types'; -import { ApiMessageSearchType } from '../../api/types'; +import type { GlobalState } from '../types'; +import type { ApiMessageSearchType } from '../../api/types'; import { areSortedArraysEqual, unique } from '../../util/iteratees'; -import { SharedMediaType } from '../../types'; +import type { SharedMediaType } from '../../types'; import { buildChatThreadKey } from '../helpers'; interface TextSearchParams { diff --git a/src/global/reducers/management.ts b/src/global/reducers/management.ts index 1e7f016a..77e444a7 100644 --- a/src/global/reducers/management.ts +++ b/src/global/reducers/management.ts @@ -1,5 +1,5 @@ -import { GlobalState } from '../types'; -import { ManagementProgress, ManagementState } from '../../types'; +import type { GlobalState } from '../types'; +import type { ManagementProgress, ManagementState } from '../../types'; export function updateManagementProgress(global: GlobalState, progress: ManagementProgress): GlobalState { return { diff --git a/src/global/reducers/messages.ts b/src/global/reducers/messages.ts index 02d533c1..ca0367ec 100644 --- a/src/global/reducers/messages.ts +++ b/src/global/reducers/messages.ts @@ -1,10 +1,9 @@ -import { +import type { GlobalState, MessageList, MessageListType, Thread, } from '../types'; -import { - ApiMessage, ApiSponsoredMessage, ApiThreadInfo, MAIN_THREAD_ID, -} from '../../api/types'; -import { FocusDirection } from '../../types'; +import type { ApiMessage, ApiSponsoredMessage, ApiThreadInfo } from '../../api/types'; +import { MAIN_THREAD_ID } from '../../api/types'; +import type { FocusDirection } from '../../types'; import { IS_MOCKED_CLIENT, diff --git a/src/global/reducers/payments.ts b/src/global/reducers/payments.ts index 23823c4d..5852d625 100644 --- a/src/global/reducers/payments.ts +++ b/src/global/reducers/payments.ts @@ -1,6 +1,6 @@ -import { GlobalState } from '../types'; -import { ShippingOption, PaymentStep } from '../../types'; -import { ApiMessage, ApiPaymentForm, ApiReceipt } from '../../api/types'; +import type { GlobalState } from '../types'; +import type { ShippingOption, PaymentStep } from '../../types'; +import type { ApiMessage, ApiPaymentForm, ApiReceipt } from '../../api/types'; export function updateShippingOptions( global: GlobalState, diff --git a/src/global/reducers/reactions.ts b/src/global/reducers/reactions.ts index e104c776..aebdc4da 100644 --- a/src/global/reducers/reactions.ts +++ b/src/global/reducers/reactions.ts @@ -1,5 +1,5 @@ import { updateChatMessage } from './messages'; -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; import { selectChatMessage } from '../selectors'; import { MIN_SCREEN_WIDTH_FOR_STATIC_LEFT_COLUMN, MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN } from '../../config'; import { @@ -9,7 +9,7 @@ import { import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; import windowSize from '../../util/windowSize'; import { updateChat } from './chats'; -import { ApiChat } from '../../api/types'; +import type { ApiChat } from '../../api/types'; function getLeftColumnWidth(windowWidth: number) { if (windowWidth > MIN_SCREEN_WIDTH_FOR_STATIC_RIGHT_COLUMN) { diff --git a/src/global/reducers/settings.ts b/src/global/reducers/settings.ts index 17910c05..92f4a4d4 100644 --- a/src/global/reducers/settings.ts +++ b/src/global/reducers/settings.ts @@ -1,8 +1,8 @@ -import { GlobalState } from '../types'; -import { +import type { GlobalState } from '../types'; +import type { ISettings, IThemeSettings, ThemeKey, NotifyException, } from '../../types'; -import { ApiNotifyException } from '../../api/types'; +import type { ApiNotifyException } from '../../api/types'; import { updateUserBlockedState } from './users'; export function replaceSettings(global: GlobalState, newSettings?: Partial): GlobalState { diff --git a/src/global/reducers/statistics.ts b/src/global/reducers/statistics.ts index c88804fd..195f0754 100644 --- a/src/global/reducers/statistics.ts +++ b/src/global/reducers/statistics.ts @@ -1,5 +1,5 @@ -import { GlobalState } from '../types'; -import { +import type { GlobalState } from '../types'; +import type { ApiChannelStatistics, ApiGroupStatistics, ApiMessageStatistics, StatisticsGraph, } from '../../api/types'; diff --git a/src/global/reducers/symbols.ts b/src/global/reducers/symbols.ts index 01f2027b..c563a5a6 100644 --- a/src/global/reducers/symbols.ts +++ b/src/global/reducers/symbols.ts @@ -1,5 +1,5 @@ -import { GlobalState } from '../types'; -import { ApiSticker, ApiStickerSet, ApiVideo } from '../../api/types'; +import type { GlobalState } from '../types'; +import type { ApiSticker, ApiStickerSet, ApiVideo } from '../../api/types'; import { buildCollectionByKey, unique } from '../../util/iteratees'; import { selectStickersForEmoji } from '../selectors'; diff --git a/src/global/reducers/twoFaSettings.ts b/src/global/reducers/twoFaSettings.ts index 380edda8..f1e6c34d 100644 --- a/src/global/reducers/twoFaSettings.ts +++ b/src/global/reducers/twoFaSettings.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; export function updateTwoFaSettings( global: GlobalState, diff --git a/src/global/reducers/users.ts b/src/global/reducers/users.ts index 21766602..9f71af59 100644 --- a/src/global/reducers/users.ts +++ b/src/global/reducers/users.ts @@ -1,5 +1,5 @@ -import { GlobalState } from '../types'; -import { ApiUser, ApiUserStatus } from '../../api/types'; +import type { GlobalState } from '../types'; +import type { ApiUser, ApiUserStatus } from '../../api/types'; import { omit, pick } from '../../util/iteratees'; import { MEMO_EMPTY_ARRAY } from '../../util/memo'; diff --git a/src/global/selectors/calls.ts b/src/global/selectors/calls.ts index 961edf5e..3008c275 100644 --- a/src/global/selectors/calls.ts +++ b/src/global/selectors/calls.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; import { selectChat } from './chats'; import { isChatBasicGroup } from '../helpers'; import { selectUser } from './users'; diff --git a/src/global/selectors/chats.ts b/src/global/selectors/chats.ts index 910aec47..6c9717d5 100644 --- a/src/global/selectors/chats.ts +++ b/src/global/selectors/chats.ts @@ -1,5 +1,6 @@ -import { ApiChat, ApiUser, MAIN_THREAD_ID } from '../../api/types'; -import { GlobalState } from '../types'; +import type { ApiChat, ApiUser } from '../../api/types'; +import { MAIN_THREAD_ID } from '../../api/types'; +import type { GlobalState } from '../types'; import { getPrivateChatUserId, isChatChannel, isUserId, isHistoryClearMessage, isUserBot, isUserOnline, diff --git a/src/global/selectors/globalSearch.ts b/src/global/selectors/globalSearch.ts index a77cfd22..418e4ca8 100644 --- a/src/global/selectors/globalSearch.ts +++ b/src/global/selectors/globalSearch.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; export function selectCurrentGlobalSearchQuery(global: GlobalState) { return global.globalSearch.query; diff --git a/src/global/selectors/localSearch.ts b/src/global/selectors/localSearch.ts index 871aa306..08679733 100644 --- a/src/global/selectors/localSearch.ts +++ b/src/global/selectors/localSearch.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; import { selectCurrentMessageList } from './messages'; import { buildChatThreadKey } from '../helpers'; diff --git a/src/global/selectors/management.ts b/src/global/selectors/management.ts index aa66ba87..68e10568 100644 --- a/src/global/selectors/management.ts +++ b/src/global/selectors/management.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; import { selectCurrentMessageList } from './messages'; import { selectChat } from './chats'; diff --git a/src/global/selectors/messages.ts b/src/global/selectors/messages.ts index de18b2f0..f5fb7814 100644 --- a/src/global/selectors/messages.ts +++ b/src/global/selectors/messages.ts @@ -1,9 +1,11 @@ -import { GlobalState, MessageListType, Thread } from '../types'; -import { +import type { GlobalState, MessageListType, Thread } from '../types'; +import type { ApiChat, ApiMessage, ApiMessageOutgoingStatus, ApiUser, +} from '../../api/types'; +import { MAIN_THREAD_ID, } from '../../api/types'; diff --git a/src/global/selectors/payments.ts b/src/global/selectors/payments.ts index 9377e702..1dac1d00 100644 --- a/src/global/selectors/payments.ts +++ b/src/global/selectors/payments.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; export function selectPaymentChatId(global: GlobalState) { return global.payment.chatId; diff --git a/src/global/selectors/settings.ts b/src/global/selectors/settings.ts index 4d923378..4ce4f779 100644 --- a/src/global/selectors/settings.ts +++ b/src/global/selectors/settings.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; export function selectNotifySettings(global: GlobalState) { return global.settings.byKey; diff --git a/src/global/selectors/statistics.ts b/src/global/selectors/statistics.ts index 5057c85b..1d2cef88 100644 --- a/src/global/selectors/statistics.ts +++ b/src/global/selectors/statistics.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; import { selectCurrentMessageList } from './messages'; import { selectChat } from './chats'; diff --git a/src/global/selectors/symbols.ts b/src/global/selectors/symbols.ts index 2fc8d004..8ea9ae39 100644 --- a/src/global/selectors/symbols.ts +++ b/src/global/selectors/symbols.ts @@ -1,5 +1,5 @@ -import { GlobalState } from '../types'; -import { ApiSticker } from '../../api/types'; +import type { GlobalState } from '../types'; +import type { ApiSticker } from '../../api/types'; export function selectIsStickerFavorite(global: GlobalState, sticker: ApiSticker) { const { stickers } = global.stickers.favorite; diff --git a/src/global/selectors/ui.ts b/src/global/selectors/ui.ts index c7f50330..8a40f74f 100644 --- a/src/global/selectors/ui.ts +++ b/src/global/selectors/ui.ts @@ -1,4 +1,4 @@ -import { GlobalState } from '../types'; +import type { GlobalState } from '../types'; import { NewChatMembersProgress, RightColumnContent } from '../../types'; import { getSystemTheme, IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; diff --git a/src/global/selectors/users.ts b/src/global/selectors/users.ts index e3668878..7e9055ad 100644 --- a/src/global/selectors/users.ts +++ b/src/global/selectors/users.ts @@ -1,5 +1,5 @@ -import { GlobalState } from '../types'; -import { ApiChat, ApiUser, ApiUserStatus } from '../../api/types'; +import type { GlobalState } from '../types'; +import type { ApiChat, ApiUser, ApiUserStatus } from '../../api/types'; import { isUserBot } from '../helpers'; export function selectUser(global: GlobalState, userId: string): ApiUser | undefined { diff --git a/src/global/types.ts b/src/global/types.ts index 23c99b75..6f899d6f 100644 --- a/src/global/types.ts +++ b/src/global/types.ts @@ -1,4 +1,4 @@ -import { +import type { ApiChat, ApiMessage, ApiThreadInfo, @@ -38,7 +38,7 @@ import { ApiAttachMenuBot, ApiPhoneCall, } from '../api/types'; -import { +import type { FocusDirection, ISettings, MediaViewerOrigin, diff --git a/src/hooks/reducers/useFoldersReducer.ts b/src/hooks/reducers/useFoldersReducer.ts index b92626b7..b6264b86 100644 --- a/src/hooks/reducers/useFoldersReducer.ts +++ b/src/hooks/reducers/useFoldersReducer.ts @@ -1,5 +1,6 @@ -import useReducer, { StateReducer, Dispatch } from '../useReducer'; -import { ApiChatFolder } from '../../api/types'; +import type { StateReducer, Dispatch } from '../useReducer'; +import useReducer from '../useReducer'; +import type { ApiChatFolder } from '../../api/types'; import { pick, omit } from '../../util/iteratees'; export type FolderChatType = { diff --git a/src/hooks/reducers/usePaymentReducer.ts b/src/hooks/reducers/usePaymentReducer.ts index ab2e68bb..d31c4d5d 100644 --- a/src/hooks/reducers/usePaymentReducer.ts +++ b/src/hooks/reducers/usePaymentReducer.ts @@ -1,4 +1,5 @@ -import useReducer, { StateReducer, Dispatch } from '../useReducer'; +import type { StateReducer, Dispatch } from '../useReducer'; +import useReducer from '../useReducer'; export type FormState = { streetLine1: string; diff --git a/src/hooks/reducers/useTwoFaReducer.ts b/src/hooks/reducers/useTwoFaReducer.ts index 5c9eed29..346ba14f 100644 --- a/src/hooks/reducers/useTwoFaReducer.ts +++ b/src/hooks/reducers/useTwoFaReducer.ts @@ -1,4 +1,5 @@ -import useReducer, { StateReducer, Dispatch } from '../useReducer'; +import type { StateReducer, Dispatch } from '../useReducer'; +import useReducer from '../useReducer'; export type TwoFaActions = ( 'setCurrentPassword' | 'setPassword' | 'setHint' | 'setEmail' | 'reset' diff --git a/src/hooks/useAudioPlayer.ts b/src/hooks/useAudioPlayer.ts index 008b4dea..f0f768ec 100644 --- a/src/hooks/useAudioPlayer.ts +++ b/src/hooks/useAudioPlayer.ts @@ -3,12 +3,14 @@ import { } from '../lib/teact/teact'; import { getActions, getGlobal } from '../global'; -import { register, Track, TrackId } from '../util/audioPlayer'; +import type { Track, TrackId } from '../util/audioPlayer'; +import { register } from '../util/audioPlayer'; import useEffectWithPrevDeps from './useEffectWithPrevDeps'; import { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio'; import useOnChange from './useOnChange'; +import type { MediaSessionHandlers } from '../util/mediaSession'; import { - MediaSessionHandlers, registerMediaSession, setPlaybackState, setPositionState, updateMetadata, + registerMediaSession, setPlaybackState, setPositionState, updateMetadata, } from '../util/mediaSession'; type Handler = (e: Event) => void; diff --git a/src/hooks/useBuffering.ts b/src/hooks/useBuffering.ts index 3655770a..c2021dd2 100644 --- a/src/hooks/useBuffering.ts +++ b/src/hooks/useBuffering.ts @@ -1,4 +1,5 @@ -import React, { useCallback, useMemo, useState } from '../lib/teact/teact'; +import type React from '../lib/teact/teact'; +import { useCallback, useMemo, useState } from '../lib/teact/teact'; import { debounce } from '../util/schedulers'; import { isSafariPatchInProgress } from '../util/patchSafariProgressiveAudio'; diff --git a/src/hooks/useChatContextActions.ts b/src/hooks/useChatContextActions.ts index 497a1793..8f41e6c1 100644 --- a/src/hooks/useChatContextActions.ts +++ b/src/hooks/useChatContextActions.ts @@ -1,7 +1,7 @@ import { useMemo } from '../lib/teact/teact'; import { getActions } from '../global'; -import { ApiChat, ApiUser } from '../api/types'; +import type { ApiChat, ApiUser } from '../api/types'; import { SERVICE_NOTIFICATIONS_USER_ID } from '../config'; import { diff --git a/src/hooks/useConnectionStatus.ts b/src/hooks/useConnectionStatus.ts index b3c9e895..c74d318f 100644 --- a/src/hooks/useConnectionStatus.ts +++ b/src/hooks/useConnectionStatus.ts @@ -1,7 +1,7 @@ -import { GlobalState } from '../global/types'; +import type { GlobalState } from '../global/types'; import useBrowserOnline from './useBrowserOnline'; -import { LangFn } from './useLang'; +import type { LangFn } from './useLang'; export enum ConnectionStatus { waitingForNetwork, diff --git a/src/hooks/useContextMenuHandlers.ts b/src/hooks/useContextMenuHandlers.ts index a33a6e8c..0aefc963 100644 --- a/src/hooks/useContextMenuHandlers.ts +++ b/src/hooks/useContextMenuHandlers.ts @@ -1,7 +1,7 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { useState, useEffect, useCallback } from '../lib/teact/teact'; -import { IAnchorPosition } from '../types'; +import type { IAnchorPosition } from '../types'; import { IS_TOUCH_ENV, IS_PWA, IS_IOS, } from '../util/environment'; diff --git a/src/hooks/useContextMenuPosition.ts b/src/hooks/useContextMenuPosition.ts index 5083795f..6b93d31b 100644 --- a/src/hooks/useContextMenuPosition.ts +++ b/src/hooks/useContextMenuPosition.ts @@ -1,5 +1,5 @@ import { useState, useEffect } from '../lib/teact/teact'; -import { IAnchorPosition } from '../types'; +import type { IAnchorPosition } from '../types'; interface Layout { extraPaddingX?: number; diff --git a/src/hooks/useCustomBackground.ts b/src/hooks/useCustomBackground.ts index 932e66ad..a8091ee0 100644 --- a/src/hooks/useCustomBackground.ts +++ b/src/hooks/useCustomBackground.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from '../lib/teact/teact'; -import { ThemeKey } from '../types'; +import type { ThemeKey } from '../types'; import { CUSTOM_BG_CACHE_NAME } from '../config'; import * as cacheApi from '../util/cacheApi'; diff --git a/src/hooks/useEnsureMessage.ts b/src/hooks/useEnsureMessage.ts index 2f076071..b74bf307 100644 --- a/src/hooks/useEnsureMessage.ts +++ b/src/hooks/useEnsureMessage.ts @@ -1,7 +1,7 @@ import { useEffect, useMemo } from '../lib/teact/teact'; import { getActions } from '../global'; -import { ApiMessage } from '../api/types'; +import type { ApiMessage } from '../api/types'; import { throttle } from '../util/schedulers'; diff --git a/src/hooks/useFocusAfterAnimation.tsx b/src/hooks/useFocusAfterAnimation.tsx index fcc96418..a03fe72b 100644 --- a/src/hooks/useFocusAfterAnimation.tsx +++ b/src/hooks/useFocusAfterAnimation.tsx @@ -1,4 +1,4 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { IS_TOUCH_ENV } from '../util/environment'; import { fastRaf } from '../util/schedulers'; diff --git a/src/hooks/useInputFocusOnOpen.ts b/src/hooks/useInputFocusOnOpen.ts index 4da1cb31..6a093726 100644 --- a/src/hooks/useInputFocusOnOpen.ts +++ b/src/hooks/useInputFocusOnOpen.ts @@ -1,4 +1,4 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { useEffect } from '../lib/teact/teact'; import { IS_SINGLE_COLUMN_LAYOUT } from '../util/environment'; diff --git a/src/hooks/useIntersectionObserver.ts b/src/hooks/useIntersectionObserver.ts index 8bb94095..629674a1 100644 --- a/src/hooks/useIntersectionObserver.ts +++ b/src/hooks/useIntersectionObserver.ts @@ -1,4 +1,4 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { useEffect, useRef, useCallback, useState, } from '../lib/teact/teact'; diff --git a/src/hooks/useKeyboardListNavigation.ts b/src/hooks/useKeyboardListNavigation.ts index fc6524c2..654751eb 100644 --- a/src/hooks/useKeyboardListNavigation.ts +++ b/src/hooks/useKeyboardListNavigation.ts @@ -1,4 +1,4 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { useState, useCallback, useEffect } from '../lib/teact/teact'; const useKeyboardListNavigation = ( diff --git a/src/hooks/useMessageMediaMetadata.ts b/src/hooks/useMessageMediaMetadata.ts index e0cfe77a..07a0868c 100644 --- a/src/hooks/useMessageMediaMetadata.ts +++ b/src/hooks/useMessageMediaMetadata.ts @@ -1,6 +1,6 @@ import { useMemo } from '../lib/teact/teact'; -import { +import type { ApiAudio, ApiChat, ApiMessage, ApiUser, ApiVoice, } from '../api/types'; diff --git a/src/hooks/useModuleLoader.ts b/src/hooks/useModuleLoader.ts index 0ac900f1..3eea5a44 100644 --- a/src/hooks/useModuleLoader.ts +++ b/src/hooks/useModuleLoader.ts @@ -1,8 +1,7 @@ import { useEffect } from '../lib/teact/teact'; -import { - BundleModules, Bundles, getModuleFromMemory, loadModule, addLoadListener, -} from '../util/moduleLoader'; +import type { BundleModules, Bundles } from '../util/moduleLoader'; +import { getModuleFromMemory, loadModule, addLoadListener } from '../util/moduleLoader'; import useForceUpdate from './useForceUpdate'; diff --git a/src/hooks/useResize.ts b/src/hooks/useResize.ts index 5a607292..1f7105d4 100644 --- a/src/hooks/useResize.ts +++ b/src/hooks/useResize.ts @@ -1,4 +1,4 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { useState, useEffect } from '../lib/teact/teact'; import useFlag from './useFlag'; diff --git a/src/hooks/useSendMessageAction.ts b/src/hooks/useSendMessageAction.ts index 31d61965..268f6de3 100644 --- a/src/hooks/useSendMessageAction.ts +++ b/src/hooks/useSendMessageAction.ts @@ -1,7 +1,7 @@ import { useMemo } from '../lib/teact/teact'; import { getActions } from '../global'; -import { ApiSendMessageAction } from '../api/types'; +import type { ApiSendMessageAction } from '../api/types'; import { SEND_MESSAGE_ACTION_INTERVAL } from '../config'; import { throttle } from '../util/schedulers'; diff --git a/src/hooks/useVideoCleanup.ts b/src/hooks/useVideoCleanup.ts index 5dc78ef7..02f1962d 100644 --- a/src/hooks/useVideoCleanup.ts +++ b/src/hooks/useVideoCleanup.ts @@ -1,4 +1,4 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { useEffect } from '../lib/teact/teact'; import { fastRaf } from '../util/schedulers'; diff --git a/src/hooks/useVirtualBackdrop.ts b/src/hooks/useVirtualBackdrop.ts index dd64d028..c6f9f0a9 100644 --- a/src/hooks/useVirtualBackdrop.ts +++ b/src/hooks/useVirtualBackdrop.ts @@ -1,4 +1,4 @@ -import { RefObject } from 'react'; +import type { RefObject } from 'react'; import { useEffect } from '../lib/teact/teact'; const BACKDROP_CLASSNAME = 'backdrop'; diff --git a/src/hooks/useWebpThumbnail.ts b/src/hooks/useWebpThumbnail.ts index a78311ee..deb68c8b 100644 --- a/src/hooks/useWebpThumbnail.ts +++ b/src/hooks/useWebpThumbnail.ts @@ -1,6 +1,6 @@ import { useLayoutEffect, useState } from '../lib/teact/teact'; -import { ApiMessage } from '../api/types'; +import type { ApiMessage } from '../api/types'; import { DEBUG } from '../config'; import { isWebpSupported } from '../util/environment'; diff --git a/src/hooks/useWindowSize.ts b/src/hooks/useWindowSize.ts index 61fdf9c0..3238acf9 100644 --- a/src/hooks/useWindowSize.ts +++ b/src/hooks/useWindowSize.ts @@ -2,7 +2,7 @@ import { useEffect, useState } from '../lib/teact/teact'; import { throttle } from '../util/schedulers'; import windowSize from '../util/windowSize'; -import { ApiDimensions } from '../api/types'; +import type { ApiDimensions } from '../api/types'; const THROTTLE = 250; diff --git a/src/lib/rlottie/rlottie.worker.ts b/src/lib/rlottie/rlottie.worker.ts index 46212f75..7a5eeb5a 100644 --- a/src/lib/rlottie/rlottie.worker.ts +++ b/src/lib/rlottie/rlottie.worker.ts @@ -1,6 +1,6 @@ import { inflate } from 'pako/dist/pako_inflate'; import createWorkerInterface from '../../util/createWorkerInterface'; -import { CancellableCallback } from '../../util/WorkerConnector'; +import type { CancellableCallback } from '../../util/WorkerConnector'; declare const Module: any; diff --git a/src/lib/secret-sauce/buildSdp.d.ts b/src/lib/secret-sauce/buildSdp.d.ts index ea2c1c99..f0f674a9 100644 --- a/src/lib/secret-sauce/buildSdp.d.ts +++ b/src/lib/secret-sauce/buildSdp.d.ts @@ -1,4 +1,4 @@ -import { GroupCallTransport, PayloadType, RTPExtension, SsrcGroup } from './types'; +import type { GroupCallTransport, PayloadType, RTPExtension, SsrcGroup } from './types'; export declare type Conference = { sessionId: number; audioExtensions: RTPExtension[]; diff --git a/src/lib/secret-sauce/p2p.d.ts b/src/lib/secret-sauce/p2p.d.ts index 3e646493..f6865d85 100644 --- a/src/lib/secret-sauce/p2p.d.ts +++ b/src/lib/secret-sauce/p2p.d.ts @@ -1,4 +1,4 @@ -import { ApiPhoneCallConnection } from './types'; +import type { ApiPhoneCallConnection } from './types'; import { P2pMessage } from './p2pMessage'; import { StreamType } from './secretsauce'; export declare function getStreams(): { diff --git a/src/lib/secret-sauce/p2pMessage.d.ts b/src/lib/secret-sauce/p2pMessage.d.ts index ace6969e..2cab48ac 100644 --- a/src/lib/secret-sauce/p2pMessage.d.ts +++ b/src/lib/secret-sauce/p2pMessage.d.ts @@ -1,4 +1,4 @@ -import { Fingerprint, RTCPFeedbackParam, RTPExtension } from './types'; +import type { Fingerprint, RTCPFeedbackParam, RTPExtension } from './types'; export declare type VideoState = 'inactive' | 'active' | 'suspended'; export declare type VideoRotation = 0 | 90 | 180 | 270; export declare type MediaStateMessage = { diff --git a/src/lib/secret-sauce/parseSdp.d.ts b/src/lib/secret-sauce/parseSdp.d.ts index 1d3c0246..bf0f5e4f 100644 --- a/src/lib/secret-sauce/parseSdp.d.ts +++ b/src/lib/secret-sauce/parseSdp.d.ts @@ -1,3 +1,3 @@ -import { JoinGroupCallPayload } from './types'; +import type { JoinGroupCallPayload } from './types'; declare const _default: (sessionDescription: RTCSessionDescriptionInit, isP2p?: boolean) => JoinGroupCallPayload; export default _default; diff --git a/src/lib/secret-sauce/secretsauce.d.ts b/src/lib/secret-sauce/secretsauce.d.ts index 10f35f45..21137651 100644 --- a/src/lib/secret-sauce/secretsauce.d.ts +++ b/src/lib/secret-sauce/secretsauce.d.ts @@ -1,4 +1,4 @@ -import { GroupCallConnectionData, GroupCallParticipant, JoinGroupCallPayload } from './types'; +import type { GroupCallConnectionData, GroupCallParticipant, JoinGroupCallPayload } from './types'; export declare type StreamType = 'audio' | 'video' | 'presentation'; export declare function getDevices(streamType: StreamType, isInput?: boolean): Promise; export declare function toggleSpeaker(): void; diff --git a/src/lib/secret-sauce/utils.d.ts b/src/lib/secret-sauce/utils.d.ts index bd0cd666..31601f9f 100644 --- a/src/lib/secret-sauce/utils.d.ts +++ b/src/lib/secret-sauce/utils.d.ts @@ -1,5 +1,5 @@ import { P2PPayloadType } from './p2pMessage'; -import { PayloadType } from './types'; +import type { PayloadType } from './types'; export declare function toTelegramSource(source: number): number; export declare function fromTelegramSource(source: number): number; export declare function getAmplitude(array: Uint8Array, scale?: number): number; diff --git a/src/lib/teact/teact-dom.ts b/src/lib/teact/teact-dom.ts index 75c63d02..5d6110ea 100644 --- a/src/lib/teact/teact-dom.ts +++ b/src/lib/teact/teact-dom.ts @@ -1,3 +1,9 @@ +import type { + VirtualElement, + VirtualElementComponent, + VirtualRealElement, + VirtualElementChildren, +} from './teact'; import { hasElementChanged, isComponentElement, @@ -9,10 +15,6 @@ import { unmountTree, getTarget, setTarget, - VirtualElement, - VirtualElementComponent, - VirtualRealElement, - VirtualElementChildren, } from './teact'; import generateIdFor from '../../util/generateIdFor'; import { DEBUG } from '../../config'; diff --git a/src/lib/teact/teactn.tsx b/src/lib/teact/teactn.tsx index 90cc2420..9d9e3019 100644 --- a/src/lib/teact/teactn.tsx +++ b/src/lib/teact/teactn.tsx @@ -1,6 +1,5 @@ -import React, { - FC, FC_withDebug, Props, useEffect, useState, -} from './teact'; +import type { FC, FC_withDebug, Props } from './teact'; +import React, { useEffect, useState } from './teact'; import { DEBUG, DEBUG_MORE } from '../../config'; import useForceUpdate from '../../hooks/useForceUpdate'; diff --git a/src/types/index.ts b/src/types/index.ts index 8f29ccb9..297a2bf2 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,5 +1,5 @@ -import { TeactNode } from '../lib/teact/teact'; -import { +import type { TeactNode } from '../lib/teact/teact'; +import type { ApiBotInlineMediaResult, ApiBotInlineResult, ApiBotInlineSwitchPm, ApiChatInviteImporter, ApiExportedInvite, diff --git a/src/util/audioPlayer.ts b/src/util/audioPlayer.ts index 15a27664..5473d88b 100644 --- a/src/util/audioPlayer.ts +++ b/src/util/audioPlayer.ts @@ -1,12 +1,13 @@ import { getActions, getGlobal } from '../global'; import { AudioOrigin, GlobalSearchContent } from '../types'; -import { ApiMessage } from '../api/types'; +import type { ApiMessage } from '../api/types'; import { IS_SAFARI } from './environment'; import safePlay from './safePlay'; import { patchSafariProgressiveAudio, isSafariPatchInProgress } from './patchSafariProgressiveAudio'; -import { getMessageKey, MessageKey, parseMessageKey } from '../global/helpers'; +import type { MessageKey } from '../global/helpers'; +import { getMessageKey, parseMessageKey } from '../global/helpers'; import { fastRaf } from './schedulers'; import { selectCurrentMessageList } from '../global/selectors'; diff --git a/src/util/createWorkerInterface.ts b/src/util/createWorkerInterface.ts index 2b66790b..4842af13 100644 --- a/src/util/createWorkerInterface.ts +++ b/src/util/createWorkerInterface.ts @@ -1,4 +1,4 @@ -import { CancellableCallback, OriginMessageEvent, WorkerMessageData } from './WorkerConnector'; +import type { CancellableCallback, OriginMessageEvent, WorkerMessageData } from './WorkerConnector'; import { DEBUG } from '../config'; declare const self: WorkerGlobalScope; diff --git a/src/util/dateFormat.ts b/src/util/dateFormat.ts index 25fde833..3a30c7cc 100644 --- a/src/util/dateFormat.ts +++ b/src/util/dateFormat.ts @@ -1,4 +1,4 @@ -import { LangFn } from '../hooks/useLang'; +import type { LangFn } from '../hooks/useLang'; import withCache from './withCache'; const WEEKDAYS_FULL = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; diff --git a/src/util/environmentSystemTheme.ts b/src/util/environmentSystemTheme.ts index 1c16393f..03b67154 100644 --- a/src/util/environmentSystemTheme.ts +++ b/src/util/environmentSystemTheme.ts @@ -1,4 +1,4 @@ -import { ThemeKey } from '../types'; +import type { ThemeKey } from '../types'; let systemThemeCache: ThemeKey = ( window.matchMedia?.('(prefers-color-scheme: dark)').matches diff --git a/src/util/fallbackLangPack.ts b/src/util/fallbackLangPack.ts index ace31398..2172d0cb 100644 --- a/src/util/fallbackLangPack.ts +++ b/src/util/fallbackLangPack.ts @@ -1,6 +1,6 @@ /* eslint-disable max-len */ -import { ApiLangPack } from '../api/types'; +import type { ApiLangPack } from '../api/types'; export default { Search: { diff --git a/src/util/folderManager.ts b/src/util/folderManager.ts index 05d55aa7..57b87425 100644 --- a/src/util/folderManager.ts +++ b/src/util/folderManager.ts @@ -1,9 +1,9 @@ import { addCallback } from '../lib/teact/teactn'; import { addActionHandler, getGlobal } from '../global'; -import { GlobalState } from '../global/types'; -import { NotifyException, NotifySettings } from '../types'; -import { ApiChat, ApiChatFolder, ApiUser } from '../api/types'; +import type { GlobalState } from '../global/types'; +import type { NotifyException, NotifySettings } from '../types'; +import type { ApiChat, ApiChatFolder, ApiUser } from '../api/types'; import { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, DEBUG } from '../config'; import { selectNotifySettings, selectNotifyExceptions } from '../global/selectors'; @@ -11,7 +11,8 @@ import { selectIsChatMuted } from '../global/helpers'; import { onIdle, throttle } from './schedulers'; import { areSortedArraysEqual, unique } from './iteratees'; import arePropsShallowEqual from './arePropsShallowEqual'; -import { CallbackManager, createCallbackManager } from './callbacks'; +import type { CallbackManager } from './callbacks'; +import { createCallbackManager } from './callbacks'; interface FolderSummary { id: number; diff --git a/src/util/formatCurrency.ts b/src/util/formatCurrency.ts index 8b3018a9..2c8d342b 100644 --- a/src/util/formatCurrency.ts +++ b/src/util/formatCurrency.ts @@ -1,4 +1,4 @@ -import { LangCode } from '../types'; +import type { LangCode } from '../types'; export function formatCurrency(totalPrice: number, currency?: string, locale: LangCode = 'en') { return new Intl.NumberFormat(locale, { diff --git a/src/util/getReadableErrorText.ts b/src/util/getReadableErrorText.ts index 78bebf9b..66ad08f1 100644 --- a/src/util/getReadableErrorText.ts +++ b/src/util/getReadableErrorText.ts @@ -1,4 +1,4 @@ -import { ApiError, ApiFieldError } from '../api/types'; +import type { ApiError, ApiFieldError } from '../api/types'; import { DEBUG } from '../config'; diff --git a/src/util/highlightCode.ts b/src/util/highlightCode.ts index 202926d8..6ec28787 100644 --- a/src/util/highlightCode.ts +++ b/src/util/highlightCode.ts @@ -1,6 +1,7 @@ import type { Element, Root } from 'hast'; import { lowlight } from 'lowlight/lib/core'; -import Teact, { TeactNode } from '../lib/teact/teact'; +import type { TeactNode } from '../lib/teact/teact'; +import Teact from '../lib/teact/teact'; // First element in alias array MUST BE a language package name const SUPPORTED_LANGUAGES = { diff --git a/src/util/langProvider.ts b/src/util/langProvider.ts index 3694d547..239a4d9f 100644 --- a/src/util/langProvider.ts +++ b/src/util/langProvider.ts @@ -1,7 +1,7 @@ import { getGlobal } from '../global'; -import { ApiLangPack, ApiLangString } from '../api/types'; -import { LangCode, TimeFormat } from '../types'; +import type { ApiLangPack, ApiLangString } from '../api/types'; +import type { LangCode, TimeFormat } from '../types'; import { DEFAULT_LANG_CODE, DEFAULT_LANG_PACK, LANG_CACHE_NAME, LANG_PACKS, diff --git a/src/util/mediaLoader.ts b/src/util/mediaLoader.ts index 8c992ec6..32abadbf 100644 --- a/src/util/mediaLoader.ts +++ b/src/util/mediaLoader.ts @@ -1,9 +1,11 @@ -import { - ApiMediaFormat, +import type { ApiOnProgress, ApiParsedMedia, ApiPreparedMedia, } from '../api/types'; +import { + ApiMediaFormat, +} from '../api/types'; import { DEBUG, MEDIA_CACHE_DISABLED, MEDIA_CACHE_NAME, MEDIA_CACHE_NAME_AVATARS, diff --git a/src/util/notifications.ts b/src/util/notifications.ts index 1b38a246..c6e54146 100644 --- a/src/util/notifications.ts +++ b/src/util/notifications.ts @@ -1,7 +1,8 @@ import { callApi } from '../api/gramjs'; -import { - ApiChat, ApiMediaFormat, ApiMessage, ApiPhoneCall, ApiUser, ApiUserReaction, +import type { + ApiChat, ApiMessage, ApiPhoneCall, ApiUser, ApiUserReaction, } from '../api/types'; +import { ApiMediaFormat } from '../api/types'; import { renderActionMessageText } from '../components/common/helpers/renderActionMessageText'; import { DEBUG, IS_TEST } from '../config'; import { getActions, getGlobal, setGlobal } from '../global'; diff --git a/src/util/parseMessageInput.ts b/src/util/parseMessageInput.ts index 8bc75511..2de95219 100644 --- a/src/util/parseMessageInput.ts +++ b/src/util/parseMessageInput.ts @@ -1,4 +1,5 @@ -import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../api/types'; +import type { ApiMessageEntity, ApiFormattedText } from '../api/types'; +import { ApiMessageEntityTypes } from '../api/types'; import { IS_EMOJI_SUPPORTED } from './environment'; import { RE_LINK_TEMPLATE } from '../config'; diff --git a/src/util/phoneNumber.ts b/src/util/phoneNumber.ts index 7d322e9e..00fc8f69 100644 --- a/src/util/phoneNumber.ts +++ b/src/util/phoneNumber.ts @@ -1,4 +1,4 @@ -import { ApiCountryCode } from '../api/types'; +import type { ApiCountryCode } from '../api/types'; const PATTERN_PLACEHOLDER = 'X'; const DEFAULT_PATTERN = 'XXX XXX XXX XXX'; diff --git a/src/util/routing.ts b/src/util/routing.ts index eeb02ddf..d0643a37 100644 --- a/src/util/routing.ts +++ b/src/util/routing.ts @@ -1,4 +1,4 @@ -import { MessageListType } from '../global/types'; +import type { MessageListType } from '../global/types'; import { MAIN_THREAD_ID } from '../api/types'; import { LOCATION_HASH } from '../hooks/useHistoryBack'; diff --git a/src/util/sessions.ts b/src/util/sessions.ts index f97c7fe7..1ec5234e 100644 --- a/src/util/sessions.ts +++ b/src/util/sessions.ts @@ -1,6 +1,6 @@ import * as idb from 'idb-keyval'; -import { ApiSessionData } from '../api/types'; +import type { ApiSessionData } from '../api/types'; import { DEBUG, LEGACY_SESSION_KEY, SESSION_USER_KEY } from '../config'; import * as cacheApi from './cacheApi'; diff --git a/src/util/stopEvent.ts b/src/util/stopEvent.ts index b6fd3de6..475c55c0 100644 --- a/src/util/stopEvent.ts +++ b/src/util/stopEvent.ts @@ -1,4 +1,4 @@ -import React from '../lib/teact/teact'; +import type React from '../lib/teact/teact'; const stopEvent = (e: React.UIEvent | Event) => { e.stopPropagation(); diff --git a/src/util/switchTheme.ts b/src/util/switchTheme.ts index 04f153c3..721c0f2c 100644 --- a/src/util/switchTheme.ts +++ b/src/util/switchTheme.ts @@ -1,4 +1,4 @@ -import { ISettings } from '../types'; +import type { ISettings } from '../types'; import { animateSingle } from './animation'; import { fastRaf } from './schedulers'; diff --git a/src/util/themeStyle.ts b/src/util/themeStyle.ts index 31716f06..f05fb565 100644 --- a/src/util/themeStyle.ts +++ b/src/util/themeStyle.ts @@ -1,4 +1,4 @@ -import { ApiThemeParameters } from '../api/types'; +import type { ApiThemeParameters } from '../api/types'; export function extractCurrentThemeParams(): ApiThemeParameters { const style = getComputedStyle(document.documentElement); diff --git a/src/util/voiceRecording.ts b/src/util/voiceRecording.ts index f8d62c1a..d0834a4c 100644 --- a/src/util/voiceRecording.ts +++ b/src/util/voiceRecording.ts @@ -1,4 +1,4 @@ -import { IOpusRecorder } from 'opus-recorder'; +import type { IOpusRecorder } from 'opus-recorder'; export type Result = { blob: Blob; duration: number; waveform: number[] };