[Refactoring] Prefer import type (#1884)

This commit is contained in:
Alexander Zinchuk 2022-05-30 15:40:11 +04:00
parent 9544663aa1
commit 70ccff110a
582 changed files with 1691 additions and 1340 deletions

View File

@ -95,6 +95,13 @@
"@typescript-eslint/member-delimiter-style": "error", "@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/default-param-last": "off", "@typescript-eslint/default-param-last": "off",
"@typescript-eslint/return-await": ["error", "in-try-catch"], "@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" "teactn/prefer-separate-component-file": "off"
}, },
"settings": { "settings": {

View File

@ -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 { getActions, withGlobal } from './global';
import { GlobalState } from './global/types'; import type { GlobalState } from './global/types';
import { INACTIVE_MARKER, PAGE_TITLE } from './config'; import { INACTIVE_MARKER, PAGE_TITLE } from './config';
import { pick } from './util/iteratees'; import { pick } from './util/iteratees';

View File

@ -2,7 +2,7 @@
import BigInt from 'big-integer'; import BigInt from 'big-integer';
import localDb from '../localDb'; import localDb from '../localDb';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { ApiAppConfig } from '../../types'; import type { ApiAppConfig } from '../../types';
import { buildJson } from './misc'; import { buildJson } from './misc';
type GramJsAppConfig = { type GramJsAppConfig = {

View File

@ -1,5 +1,5 @@
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiAttachMenuBot, ApiAttachMenuBot,
ApiAttachMenuBotIcon, ApiAttachMenuBotIcon,
ApiBotCommand, ApiBotCommand,

View File

@ -6,7 +6,7 @@ import type {
SsrcGroup, SsrcGroup,
} from '../../../lib/secret-sauce'; } from '../../../lib/secret-sauce';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { ApiGroupCall, ApiPhoneCall } from '../../types'; import type { ApiGroupCall, ApiPhoneCall } from '../../types';
import { getApiChatIdFromMtpPeer, isPeerUser } from './peers'; import { getApiChatIdFromMtpPeer, isPeerUser } from './peers';
export function buildApiGroupCallParticipant(participant: GramJs.GroupCallParticipant): GroupCallParticipant { export function buildApiGroupCallParticipant(participant: GramJs.GroupCallParticipant): GroupCallParticipant {

View File

@ -1,6 +1,6 @@
import BigInt from 'big-integer'; import type BigInt from 'big-integer';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiChat, ApiChat,
ApiChatAdminRights, ApiChatAdminRights,
ApiChatBannedRights, ApiChatBannedRights,

View File

@ -1,7 +1,7 @@
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { strippedPhotoToJpg } from '../../../lib/gramjs/Utils'; import { strippedPhotoToJpg } from '../../../lib/gramjs/Utils';
import { import type {
ApiPhoto, ApiPhotoSize, ApiThumbnail, ApiPhoto, ApiPhotoSize, ApiThumbnail,
} from '../../types'; } from '../../types';
import { bytesToDataUri } from './helpers'; import { bytesToDataUri } from './helpers';

View File

@ -1,4 +1,4 @@
import { Api as GramJs } from '../../../lib/gramjs'; import type { Api as GramJs } from '../../../lib/gramjs';
type VirtualFields = type VirtualFields =
'flags' 'flags'

View File

@ -1,5 +1,5 @@
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiMessage, ApiMessage,
ApiMessageForwardInfo, ApiMessageForwardInfo,
ApiPhoto, ApiPhoto,

View File

@ -1,9 +1,9 @@
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiCountry, ApiSession, ApiWallpaper, ApiCountry, ApiSession, ApiWallpaper,
} from '../../types'; } from '../../types';
import { ApiPrivacySettings, ApiPrivacyKey, PrivacyVisibility } from '../../../types'; import type { ApiPrivacySettings, ApiPrivacyKey, PrivacyVisibility } from '../../../types';
import { buildApiDocument } from './messages'; import { buildApiDocument } from './messages';
import { buildApiPeerId, getApiChatIdFromMtpPeer } from './peers'; import { buildApiPeerId, getApiChatIdFromMtpPeer } from './peers';

View File

@ -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) { export function buildShippingOptions(shippingOptions: GramJs.ShippingOption[] | undefined) {
if (!shippingOptions) { if (!shippingOptions) {

View File

@ -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 { export function isPeerUser(peer: GramJs.TypePeer | GramJs.TypeInputPeer): peer is GramJs.PeerUser {
return peer.hasOwnProperty('userId'); return peer.hasOwnProperty('userId');

View File

@ -1,5 +1,5 @@
import { Api as GramJs } from '../../../lib/gramjs'; import type { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiChannelStatistics, ApiChannelStatistics,
ApiGroupStatistics, ApiGroupStatistics,
ApiMessageStatistics, ApiMessageStatistics,

View File

@ -1,5 +1,5 @@
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiEmojiInteraction, ApiSticker, ApiStickerSet, GramJsEmojiInteraction, ApiEmojiInteraction, ApiSticker, ApiStickerSet, GramJsEmojiInteraction,
} from '../../types'; } from '../../types';
import { NO_STICKER_SET_ID } from '../../../config'; import { NO_STICKER_SET_ID } from '../../../config';

View File

@ -1,5 +1,5 @@
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiUser, ApiUserStatus, ApiUserType, ApiUser, ApiUserStatus, ApiUserType,
} from '../../types'; } from '../../types';
import { buildApiPeerId } from './peers'; import { buildApiPeerId } from './peers';

View File

@ -1,16 +1,15 @@
import BigInt from 'big-integer'; import BigInt from 'big-integer';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { ApiPrivacyKey } from '../../../types'; import type { ApiPrivacyKey } from '../../../types';
import { generateRandomBytes, readBigIntFromBuffer } from '../../../lib/gramjs/Helpers'; import { generateRandomBytes, readBigIntFromBuffer } from '../../../lib/gramjs/Helpers';
import { import type {
ApiChatAdminRights, ApiChatAdminRights,
ApiChatBannedRights, ApiChatBannedRights,
ApiChatFolder, ApiChatFolder,
ApiGroupCall, ApiGroupCall,
ApiMessageEntity, ApiMessageEntity,
ApiMessageEntityTypes,
ApiNewPoll, ApiNewPoll,
ApiPhoto, ApiPhoto,
ApiPhoneCall, ApiPhoneCall,
@ -20,6 +19,9 @@ import {
ApiVideo, ApiVideo,
ApiThemeParameters, ApiThemeParameters,
} from '../../types'; } from '../../types';
import {
ApiMessageEntityTypes,
} from '../../types';
import localDb from '../localDb'; import localDb from '../localDb';
import { pick } from '../../../util/iteratees'; import { pick } from '../../../util/iteratees';
import { deserializeBytes } from '../helpers'; import { deserializeBytes } from '../helpers';

View File

@ -1,5 +1,5 @@
import { Api as GramJs } from '../../lib/gramjs'; import type { Api as GramJs } from '../../lib/gramjs';
import { ApiMessage } from '../types'; import type { ApiMessage } from '../types';
interface LocalDb { interface LocalDb {
localMessages: Record<string, ApiMessage>; localMessages: Record<string, ApiMessage>;

View File

@ -1,5 +1,5 @@
import BigInt from 'big-integer'; import BigInt from 'big-integer';
import { import type {
ApiChat, ApiPhoto, ApiReportReason, ApiUser, ApiChat, ApiPhoto, ApiReportReason, ApiUser,
} from '../../types'; } from '../../types';
import { invokeRequest } from './client'; import { invokeRequest } from './client';

View File

@ -1,5 +1,5 @@
import { errors } from '../../../lib/gramjs'; import { errors } from '../../../lib/gramjs';
import { import type {
ApiUpdateAuthorizationState, ApiUpdateAuthorizationState,
ApiUpdateAuthorizationStateType, ApiUpdateAuthorizationStateType,
OnApiUpdate, OnApiUpdate,

View File

@ -1,7 +1,7 @@
import BigInt from 'big-integer'; import BigInt from 'big-integer';
import { Api as GramJs } from '../../../lib/gramjs'; 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 localDb from '../localDb';
import { invokeRequest } from './client'; import { invokeRequest } from './client';

View File

@ -1,6 +1,6 @@
import BigInt from 'big-integer'; import BigInt from 'big-integer';
import type { JoinGroupCallPayload } from '../../../lib/secret-sauce'; import type { JoinGroupCallPayload } from '../../../lib/secret-sauce';
import { import type {
ApiChat, ApiUser, OnApiUpdate, ApiGroupCall, ApiPhoneCall, ApiChat, ApiUser, OnApiUpdate, ApiGroupCall, ApiPhoneCall,
} from '../../types'; } from '../../types';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';

View File

@ -1,6 +1,6 @@
import BigInt from 'big-integer'; import type BigInt from 'big-integer';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
OnApiUpdate, OnApiUpdate,
ApiChat, ApiChat,
ApiMessage, ApiMessage,

View File

@ -4,9 +4,9 @@ import {
import TelegramClient from '../../../lib/gramjs/client/TelegramClient'; import TelegramClient from '../../../lib/gramjs/client/TelegramClient';
import { Logger as GramJsLogger } from '../../../lib/gramjs/extensions/index'; 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, ApiInitialArgs,
ApiMediaFormat, ApiMediaFormat,
ApiOnProgress, ApiOnProgress,

View File

@ -2,7 +2,7 @@ import { Api as GramJs } from '../../../lib/gramjs';
import { invokeRequest } from './client'; import { invokeRequest } from './client';
import { buildInputEntity, buildInputPeer } from '../gramjsBuilders'; import { buildInputEntity, buildInputPeer } from '../gramjsBuilders';
import { ApiChat, ApiUser, OnApiUpdate } from '../../types'; import type { ApiChat, ApiUser, OnApiUpdate } from '../../types';
import { addEntitiesWithPhotosToLocalDb } from '../helpers'; import { addEntitiesWithPhotosToLocalDb } from '../helpers';
import { buildApiExportedInvite, buildChatInviteImporter } from '../apiBuilders/chats'; import { buildApiExportedInvite, buildChatInviteImporter } from '../apiBuilders/chats';
import { buildApiUser } from '../apiBuilders/users'; import { buildApiUser } from '../apiBuilders/users';

View File

@ -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 { import {
ApiMediaFormat, ApiOnProgress, ApiParsedMedia, ApiPreparedMedia, ApiMediaFormat,
} from '../../types'; } from '../../types';
import { import {

View File

@ -1,5 +1,5 @@
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiAttachment, ApiAttachment,
ApiChat, ApiChat,
ApiGlobalMessageSearchType, ApiGlobalMessageSearchType,
@ -13,13 +13,15 @@ import {
ApiThreadInfo, ApiThreadInfo,
ApiUser, ApiUser,
ApiVideo, ApiVideo,
MAIN_THREAD_ID,
MESSAGE_DELETED,
OnApiUpdate, OnApiUpdate,
ApiSponsoredMessage, ApiSponsoredMessage,
ApiSendMessageAction, ApiSendMessageAction,
ApiContact, ApiContact,
} from '../../types'; } from '../../types';
import {
MAIN_THREAD_ID,
MESSAGE_DELETED,
} from '../../types';
import { import {
ALL_FOLDER_ID, ALL_FOLDER_ID,

View File

@ -3,7 +3,7 @@ import { Api as GramJs } from '../../../lib/gramjs';
import { invokeRequest } from './client'; import { invokeRequest } from './client';
import { buildInputPeer, buildShippingInfo } from '../gramjsBuilders'; import { buildInputPeer, buildShippingInfo } from '../gramjsBuilders';
import { buildShippingOptions, buildPaymentForm, buildReceipt } from '../apiBuilders/payments'; import { buildShippingOptions, buildPaymentForm, buildReceipt } from '../apiBuilders/payments';
import { ApiChat, OnApiUpdate } from '../../types'; import type { ApiChat, OnApiUpdate } from '../../types';
let onUpdate: OnApiUpdate; let onUpdate: OnApiUpdate;

View File

@ -1,4 +1,4 @@
import { ApiChat, ApiUser } from '../../types'; import type { ApiChat, ApiUser } from '../../types';
import { invokeRequest } from './client'; import { invokeRequest } from './client';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { buildInputPeer } from '../gramjsBuilders'; import { buildInputPeer } from '../gramjsBuilders';

View File

@ -1,7 +1,7 @@
import BigInt from 'big-integer'; import BigInt from 'big-integer';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiAppConfig, ApiAppConfig,
ApiChat, ApiChat,
ApiLangString, ApiLangString,
@ -10,9 +10,10 @@ import {
ApiUser, ApiUser,
ApiWallpaper, ApiWallpaper,
} from '../../types'; } 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 { import {
buildApiCountryList, buildApiCountryList,
buildApiNotifyException, buildApiNotifyException,

View File

@ -1,7 +1,7 @@
import BigInt from 'big-integer'; import BigInt from 'big-integer';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
ApiChat, ApiChannelStatistics, ApiGroupStatistics, ApiMessageStatistics, StatisticsGraph, ApiChat, ApiChannelStatistics, ApiGroupStatistics, ApiMessageStatistics, StatisticsGraph,
} from '../../types'; } from '../../types';

View File

@ -1,6 +1,6 @@
import BigInt from 'big-integer'; import BigInt from 'big-integer';
import { Api as GramJs } from '../../../lib/gramjs'; 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 { invokeRequest } from './client';
import { buildStickerFromDocument, buildStickerSet, buildStickerSetCovered } from '../apiBuilders/symbols'; import { buildStickerFromDocument, buildStickerSet, buildStickerSetCovered } from '../apiBuilders/symbols';

View File

@ -1,6 +1,6 @@
import { Api as GramJs, errors } from '../../../lib/gramjs'; import { Api as GramJs, errors } from '../../../lib/gramjs';
import { OnApiUpdate } from '../../types'; import type { OnApiUpdate } from '../../types';
import { DEBUG } from '../../../config'; import { DEBUG } from '../../../config';
import { invokeRequest, updateTwoFaSettings } from './client'; import { invokeRequest, updateTwoFaSettings } from './client';

View File

@ -1,4 +1,4 @@
import * as methods from './index'; import type * as methods from './index';
export type Methods = typeof methods; export type Methods = typeof methods;
export type MethodArgs<N extends keyof Methods> = Parameters<Methods[N]>; export type MethodArgs<N extends keyof Methods> = Parameters<Methods[N]>;

View File

@ -1,6 +1,6 @@
import BigInt from 'big-integer'; import BigInt from 'big-integer';
import { Api as GramJs } from '../../../lib/gramjs'; import { Api as GramJs } from '../../../lib/gramjs';
import { import type {
OnApiUpdate, ApiUser, ApiChat, ApiPhoto, OnApiUpdate, ApiUser, ApiChat, ApiPhoto,
} from '../../types'; } from '../../types';

View File

@ -1,10 +1,10 @@
import { import type {
OnApiUpdate, OnApiUpdate,
ApiInitialArgs, ApiInitialArgs,
ApiUpdate, ApiUpdate,
ApiOnProgress, ApiOnProgress,
} from '../types'; } 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 { API_THROTTLE_RESET_UPDATES, API_UPDATE_THROTTLE } from '../../config';
import { throttle, throttleWithTickEnd } from '../../util/schedulers'; import { throttle, throttleWithTickEnd } from '../../util/schedulers';

View File

@ -1,6 +1,6 @@
import type { GroupCallConnectionData } from '../../lib/secret-sauce'; import type { GroupCallConnectionData } from '../../lib/secret-sauce';
import { Api as GramJs, connection } from '../../lib/gramjs'; 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 { pick } from '../../util/iteratees';
import { import {

View File

@ -1,7 +1,7 @@
import { Api } from '../../../lib/gramjs'; import type { Api } from '../../../lib/gramjs';
import { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types'; import type { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types';
import { Methods, MethodArgs, MethodResponse } from '../methods/types'; import type { Methods, MethodArgs, MethodResponse } from '../methods/types';
import { WorkerMessageEvent, OriginRequest } from './types'; import type { WorkerMessageEvent, OriginRequest } from './types';
import { DEBUG } from '../../../config'; import { DEBUG } from '../../../config';
import generateIdFor from '../../../util/generateIdFor'; import generateIdFor from '../../../util/generateIdFor';

View File

@ -1,5 +1,5 @@
import { ApiInitialArgs, ApiUpdate } from '../../types'; import type { ApiInitialArgs, ApiUpdate } from '../../types';
import { Methods, MethodArgs, MethodResponse } from '../methods/types'; import type { Methods, MethodArgs, MethodResponse } from '../methods/types';
export type ThenArg<T> = T extends Promise<infer U> ? U : T; export type ThenArg<T> = T extends Promise<infer U> ? U : T;

View File

@ -1,5 +1,5 @@
import { ApiOnProgress, ApiUpdate } from '../../types'; import type { ApiOnProgress, ApiUpdate } from '../../types';
import { OriginMessageEvent, WorkerMessageData } from './types'; import type { OriginMessageEvent, WorkerMessageData } from './types';
import { DEBUG } from '../../../config'; import { DEBUG } from '../../../config';
import { initApi, callApi, cancelApiProgress } from '../provider'; import { initApi, callApi, cancelApiProgress } from '../provider';

View File

@ -1,4 +1,4 @@
import { import type {
ApiPhoto, ApiSticker, ApiThumbnail, ApiVideo, ApiPhoto, ApiSticker, ApiThumbnail, ApiVideo,
} from './messages'; } from './messages';

View File

@ -1,7 +1,7 @@
import { ApiMessage, ApiPhoto, ApiStickerSet } from './messages'; import type { ApiMessage, ApiPhoto, ApiStickerSet } from './messages';
import { ApiBotCommand } from './bots'; import type { ApiBotCommand } from './bots';
import { ApiChatInviteImporter } from './misc'; import type { ApiChatInviteImporter } from './misc';
import { ApiFakeType } from './users'; import type { ApiFakeType } from './users';
type ApiChatType = ( type ApiChatType = (
'chatTypePrivate' | 'chatTypeSecret' | 'chatTypePrivate' | 'chatTypeSecret' |

View File

@ -1,4 +1,4 @@
import { ApiGroupCall, PhoneCallAction } from './calls'; import type { ApiGroupCall, PhoneCallAction } from './calls';
export interface ApiDimensions { export interface ApiDimensions {
width: number; width: number;

View File

@ -1,4 +1,4 @@
import { ApiDocument, ApiPhoto } from './messages'; import type { ApiDocument, ApiPhoto } from './messages';
export interface ApiInitialArgs { export interface ApiInitialArgs {
userAgent: string; userAgent: string;

View File

@ -1,4 +1,4 @@
import { ApiMessage } from './messages'; import type { ApiMessage } from './messages';
export interface ApiChannelStatistics { export interface ApiChannelStatistics {
growthGraph?: StatisticsGraph | string; growthGraph?: StatisticsGraph | string;

View File

@ -5,24 +5,24 @@ import type {
VideoState, VideoState,
VideoRotation, VideoRotation,
} from '../../lib/secret-sauce'; } from '../../lib/secret-sauce';
import { import type {
ApiChat, ApiChat,
ApiChatFullInfo, ApiChatFullInfo,
ApiTypingStatus, ApiTypingStatus,
ApiChatMember, ApiChatMember,
ApiChatFolder, ApiChatFolder,
} from './chats'; } from './chats';
import { import type {
ApiFormattedText, ApiMessage, ApiPhoto, ApiPoll, ApiReactions, ApiStickerSet, ApiThreadInfo, ApiFormattedText, ApiMessage, ApiPhoto, ApiPoll, ApiReactions, ApiStickerSet, ApiThreadInfo,
} from './messages'; } from './messages';
import { ApiUser, ApiUserFullInfo, ApiUserStatus } from './users'; import type { ApiUser, ApiUserFullInfo, ApiUserStatus } from './users';
import { import type {
ApiEmojiInteraction, ApiError, ApiInviteInfo, ApiNotifyException, ApiSessionData, ApiEmojiInteraction, ApiError, ApiInviteInfo, ApiNotifyException, ApiSessionData,
} from './misc'; } from './misc';
import { import type {
ApiGroupCall, ApiPhoneCall, ApiGroupCall, ApiPhoneCall,
} from './calls'; } from './calls';
import { ApiBotMenuButton } from './bots'; import type { ApiBotMenuButton } from './bots';
import type { ApiPrivacyKey, PrivacyVisibility } from '../../types'; import type { ApiPrivacyKey, PrivacyVisibility } from '../../types';
export type ApiUpdateReady = { export type ApiUpdateReady = {

View File

@ -1,5 +1,5 @@
import { ApiDocument, ApiPhoto } from './messages'; import type { ApiDocument, ApiPhoto } from './messages';
import { ApiBotInfo } from './bots'; import type { ApiBotInfo } from './bots';
export interface ApiUser { export interface ApiUser {
id: string; id: string;

View File

@ -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 { getActions, withGlobal } from '../../global';
import { GlobalState } from '../../global/types'; import type { GlobalState } from '../../global/types';
import '../../global/actions/initial'; import '../../global/actions/initial';
import { pick } from '../../util/iteratees'; import { pick } from '../../util/iteratees';

View File

@ -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 { Bundles } from '../../util/moduleLoader';
import useModuleLoader from '../../hooks/useModuleLoader'; import useModuleLoader from '../../hooks/useModuleLoader';

View File

@ -1,9 +1,10 @@
import { FormEvent } from 'react'; import type { FormEvent } from 'react';
import type { FC } from '../../lib/teact/teact';
import React, { import React, {
FC, useState, useEffect, useCallback, memo, useRef, useState, useEffect, useCallback, memo, useRef,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { getActions, withGlobal } from '../../global'; import { getActions, withGlobal } from '../../global';
import { GlobalState } from '../../global/types'; import type { GlobalState } from '../../global/types';
import { IS_TOUCH_ENV } from '../../util/environment'; import { IS_TOUCH_ENV } from '../../util/environment';
import { pick } from '../../util/iteratees'; import { pick } from '../../util/iteratees';

View File

@ -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 { Bundles } from '../../util/moduleLoader';
import useModuleLoader from '../../hooks/useModuleLoader'; import useModuleLoader from '../../hooks/useModuleLoader';

View File

@ -1,9 +1,8 @@
import React, { import type { FC } from '../../lib/teact/teact';
FC, memo, useCallback, useState, import React, { memo, useCallback, useState } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { getActions, withGlobal } from '../../global'; import { getActions, withGlobal } from '../../global';
import { GlobalState } from '../../global/types'; import type { GlobalState } from '../../global/types';
import { pick } from '../../util/iteratees'; import { pick } from '../../util/iteratees';
import useLang from '../../hooks/useLang'; import useLang from '../../hooks/useLang';

View File

@ -1,15 +1,16 @@
import { ChangeEvent } from 'react'; import type { ChangeEvent } from 'react';
import monkeyPath from '../../assets/monkey.svg'; import monkeyPath from '../../assets/monkey.svg';
import type { FC } from '../../lib/teact/teact';
import React, { import React, {
FC, memo, useCallback, useEffect, useLayoutEffect, useRef, useState, memo, useCallback, useEffect, useLayoutEffect, useRef, useState,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { getActions, withGlobal } from '../../global'; import { getActions, withGlobal } from '../../global';
import { GlobalState } from '../../global/types'; import type { GlobalState } from '../../global/types';
import { LangCode } from '../../types'; import type { LangCode } from '../../types';
import { ApiCountryCode } from '../../api/types'; import type { ApiCountryCode } from '../../api/types';
import { IS_SAFARI, IS_TOUCH_ENV } from '../../util/environment'; import { IS_SAFARI, IS_TOUCH_ENV } from '../../util/environment';
import { preloadImage } from '../../util/files'; import { preloadImage } from '../../util/files';

View File

@ -1,11 +1,12 @@
import QrCodeStyling from 'qr-code-styling'; import QrCodeStyling from 'qr-code-styling';
import type { FC } from '../../lib/teact/teact';
import React, { import React, {
FC, useEffect, useRef, memo, useCallback, useState, useEffect, useRef, memo, useCallback, useState,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { getActions, withGlobal } from '../../global'; import { getActions, withGlobal } from '../../global';
import { GlobalState } from '../../global/types'; import type { GlobalState } from '../../global/types';
import { LangCode } from '../../types'; import type { LangCode } from '../../types';
import { DEFAULT_LANG_CODE } from '../../config'; import { DEFAULT_LANG_CODE } from '../../config';
import { setLanguage } from '../../util/langProvider'; import { setLanguage } from '../../util/langProvider';

View File

@ -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 { Bundles } from '../../util/moduleLoader';
import useModuleLoader from '../../hooks/useModuleLoader'; import useModuleLoader from '../../hooks/useModuleLoader';

View File

@ -1,10 +1,9 @@
import { ChangeEvent } from 'react'; import type { ChangeEvent } from 'react';
import React, { import type { FC } from '../../lib/teact/teact';
FC, useState, memo, useCallback, import React, { useState, memo, useCallback } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { getActions, withGlobal } from '../../global'; import { getActions, withGlobal } from '../../global';
import { GlobalState } from '../../global/types'; import type { GlobalState } from '../../global/types';
import { pick } from '../../util/iteratees'; import { pick } from '../../util/iteratees';
import useLang from '../../hooks/useLang'; import useLang from '../../hooks/useLang';

View File

@ -1,9 +1,10 @@
import type { FC } from '../../lib/teact/teact';
import React, { import React, {
FC, useState, memo, useCallback, useRef, useState, memo, useCallback, useRef,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { withGlobal } from '../../global'; import { withGlobal } from '../../global';
import { ApiCountryCode } from '../../api/types'; import type { ApiCountryCode } from '../../api/types';
import { ANIMATION_END_DELAY } from '../../config'; import { ANIMATION_END_DELAY } from '../../config';
import { prepareSearchWordsForNeedle } from '../../util/searchWords'; import { prepareSearchWordsForNeedle } from '../../util/searchWords';

View File

@ -1,4 +1,4 @@
import { LangCode } from '../../../types'; import type { LangCode } from '../../../types';
export function getSuggestedLanguage() { export function getSuggestedLanguage() {
let suggestedLanguage = navigator.language; let suggestedLanguage = navigator.language;

View File

@ -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 useModuleLoader from '../../hooks/useModuleLoader';
import { Bundles } from '../../util/moduleLoader'; import { Bundles } from '../../util/moduleLoader';

View File

@ -1,9 +1,8 @@
import React, { import type { FC } from '../../lib/teact/teact';
FC, memo, useEffect, import React, { memo, useEffect } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { getActions, withGlobal } from '../../global'; 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 { selectActiveGroupCall, selectPhoneCallUser } from '../../global/selectors/calls';
import buildClassName from '../../util/buildClassName'; import buildClassName from '../../util/buildClassName';

View File

@ -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 useModuleLoader from '../../../hooks/useModuleLoader';
import { Bundles } from '../../../util/moduleLoader'; import { Bundles } from '../../../util/moduleLoader';
import { OwnProps } from './GroupCall'; import type { OwnProps } from './GroupCall';
const GroupCallAsync: FC<OwnProps> = (props) => { const GroupCallAsync: FC<OwnProps> = (props) => {
const { groupCallId } = props; const { groupCallId } = props;

View File

@ -1,14 +1,17 @@
import { import type {
GroupCallConnectionState, GroupCallParticipant as TypeGroupCallParticipant, GroupCallConnectionState, GroupCallParticipant as TypeGroupCallParticipant,
} from '../../../lib/secret-sauce';
import {
IS_SCREENSHARE_SUPPORTED, switchCameraInput, toggleSpeaker, IS_SCREENSHARE_SUPPORTED, switchCameraInput, toggleSpeaker,
} from '../../../lib/secret-sauce'; } from '../../../lib/secret-sauce';
import type { FC } from '../../../lib/teact/teact';
import React, { import React, {
FC, memo, useCallback, useEffect, useMemo, useRef, useState, memo, useCallback, useEffect, useMemo, useRef, useState,
} from '../../../lib/teact/teact'; } from '../../../lib/teact/teact';
import { getActions, withGlobal } from '../../../global'; import { getActions, withGlobal } from '../../../global';
import '../../../global/actions/calls'; import '../../../global/actions/calls';
import { IAnchorPosition } from '../../../types'; import type { IAnchorPosition } from '../../../types';
import { import {
IS_ANDROID, IS_ANDROID,

View File

@ -1,10 +1,10 @@
import { GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce'; import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
import React, { import { THRESHOLD } from '../../../lib/secret-sauce';
FC, memo, useMemo, useRef, import type { FC } from '../../../lib/teact/teact';
} from '../../../lib/teact/teact'; import React, { memo, useMemo, useRef } from '../../../lib/teact/teact';
import { withGlobal } from '../../../global'; import { withGlobal } from '../../../global';
import { ApiChat, ApiUser } from '../../../api/types'; import type { ApiChat, ApiUser } from '../../../api/types';
import buildClassName from '../../../util/buildClassName'; import buildClassName from '../../../util/buildClassName';
import { selectChat, selectUser } from '../../../global/selectors'; import { selectChat, selectUser } from '../../../global/selectors';

View File

@ -1,5 +1,6 @@
import { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce'; import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
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 { getActions, withGlobal } from '../../../global'; import { getActions, withGlobal } from '../../../global';
import useLang from '../../../hooks/useLang'; import useLang from '../../../hooks/useLang';

View File

@ -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, { import React, {
FC, memo, useCallback, useEffect, useState, memo, useCallback, useEffect, useState,
} from '../../../lib/teact/teact'; } from '../../../lib/teact/teact';
import { getActions, withGlobal } from '../../../global'; import { getActions, withGlobal } from '../../../global';
import { IAnchorPosition } from '../../../types'; import type { IAnchorPosition } from '../../../types';
import buildClassName from '../../../util/buildClassName'; import buildClassName from '../../../util/buildClassName';
import useRunThrottled from '../../../hooks/useRunThrottled'; import useRunThrottled from '../../../hooks/useRunThrottled';

View File

@ -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, { import React, {
FC, memo, useCallback, useMemo, useState, memo, useCallback, useMemo, useState,
} from '../../../lib/teact/teact'; } from '../../../lib/teact/teact';
import { withGlobal } from '../../../global'; import { withGlobal } from '../../../global';
import GroupCallParticipantVideo from './GroupCallParticipantVideo'; import GroupCallParticipantVideo from './GroupCallParticipantVideo';

View File

@ -1,8 +1,10 @@
import { getUserStreams, GroupCallParticipant as TypeGroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce'; import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
import React, { FC, memo, useCallback } from '../../../lib/teact/teact'; 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 { withGlobal } from '../../../global';
import { ApiChat, ApiUser } from '../../../api/types'; import type { ApiChat, ApiUser } from '../../../api/types';
import buildClassName from '../../../util/buildClassName'; import buildClassName from '../../../util/buildClassName';
import { selectChat, selectUser } from '../../../global/selectors'; import { selectChat, selectUser } from '../../../global/selectors';

View File

@ -1,9 +1,10 @@
import type { FC } from '../../../lib/teact/teact';
import React, { import React, {
FC, memo, useCallback, useEffect, useMemo, memo, useCallback, useEffect, useMemo,
} from '../../../lib/teact/teact'; } from '../../../lib/teact/teact';
import { getActions, withGlobal } from '../../../global'; 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 { selectChatGroupCall } from '../../../global/selectors/calls';
import buildClassName from '../../../util/buildClassName'; import buildClassName from '../../../util/buildClassName';

View File

@ -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, { import React, {
FC, memo, useEffect, useMemo, useRef, useState, memo, useEffect, useMemo, useRef, useState,
} from '../../../lib/teact/teact'; } from '../../../lib/teact/teact';
import { getActions, withGlobal } from '../../../global'; import { getActions, withGlobal } from '../../../global';

View File

@ -1,5 +1,7 @@
import { GroupCallParticipant, THRESHOLD } from '../../../lib/secret-sauce'; import type { GroupCallParticipant } from '../../../lib/secret-sauce';
import React, { FC, memo, useMemo } from '../../../lib/teact/teact'; 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 AnimatedIcon from '../../common/AnimatedIcon';
import usePrevious from '../../../hooks/usePrevious'; import usePrevious from '../../../hooks/usePrevious';

View File

@ -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 useModuleLoader from '../../../hooks/useModuleLoader';
import { Bundles } from '../../../util/moduleLoader'; import { Bundles } from '../../../util/moduleLoader';

View File

@ -1,10 +1,11 @@
import type { FC } from '../../../lib/teact/teact';
import React, { import React, {
FC, memo, useCallback, useEffect, useMemo, useRef, memo, useCallback, useEffect, useMemo, useRef,
} from '../../../lib/teact/teact'; } from '../../../lib/teact/teact';
import { getActions, withGlobal } from '../../../global'; import { getActions, withGlobal } from '../../../global';
import '../../../global/actions/calls'; import '../../../global/actions/calls';
import { ApiPhoneCall, ApiUser } from '../../../api/types'; import type { ApiPhoneCall, ApiUser } from '../../../api/types';
import { import {
IS_ANDROID, IS_ANDROID,

View File

@ -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 buildClassName from '../../../util/buildClassName';

View File

@ -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 { Bundles } from '../../../util/moduleLoader';
import useModuleLoader from '../../../hooks/useModuleLoader'; import useModuleLoader from '../../../hooks/useModuleLoader';

View File

@ -1,6 +1,5 @@
import React, { import type { FC } from '../../../lib/teact/teact';
FC, memo, useRef, useState, import React, { memo, useRef, useState } from '../../../lib/teact/teact';
} from '../../../lib/teact/teact';
import { getActions } from '../../../global'; import { getActions } from '../../../global';
import useLang from '../../../hooks/useLang'; import useLang from '../../../hooks/useLang';

View File

@ -1,12 +1,13 @@
import React, { import type { FC } from '../../lib/teact/teact';
FC, memo, import React, { memo } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { ApiMediaFormat, ApiSticker } from '../../api/types'; import type { ApiSticker } from '../../api/types';
import { ActiveEmojiInteraction } from '../../global/types'; import { ApiMediaFormat } from '../../api/types';
import type { ActiveEmojiInteraction } from '../../global/types';
import buildClassName from '../../util/buildClassName'; 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 useMedia from '../../hooks/useMedia';
import useMediaTransition from '../../hooks/useMediaTransition'; import useMediaTransition from '../../hooks/useMediaTransition';
import useAnimatedEmoji from './hooks/useAnimatedEmoji'; import useAnimatedEmoji from './hooks/useAnimatedEmoji';

View File

@ -1,8 +1,8 @@
import React, { import type { FC } from '../../lib/teact/teact';
FC, memo, useEffect, useState, import React, { memo, useEffect, useState } from '../../lib/teact/teact';
} 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'; import AnimatedSticker from './AnimatedSticker';

View File

@ -1,5 +1,6 @@
import type { FC } from '../../lib/teact/teact';
import React, { import React, {
FC, useEffect, useRef, memo, useCallback, useState, useEffect, useRef, memo, useCallback, useState,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { fastRaf } from '../../util/schedulers'; import { fastRaf } from '../../util/schedulers';

View File

@ -1,12 +1,13 @@
import type { FC } from '../../lib/teact/teact';
import React, { import React, {
FC, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, memo, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { getActions } from '../../global'; import { getActions } from '../../global';
import { import type { ApiAudio, ApiMessage, ApiVoice } from '../../api/types';
ApiAudio, ApiMediaFormat, ApiMessage, ApiVoice, import { ApiMediaFormat } from '../../api/types';
} from '../../api/types'; import type { ISettings } from '../../types';
import { AudioOrigin, ISettings } from '../../types'; import { AudioOrigin } from '../../types';
import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment'; import { IS_SINGLE_COLUMN_LAYOUT } from '../../util/environment';
import { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dateFormat'; import { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dateFormat';
@ -25,9 +26,11 @@ import { getFileSizeString } from './helpers/documentInfo';
import { decodeWaveform, interpolateArray } from '../../util/waveform'; import { decodeWaveform, interpolateArray } from '../../util/waveform';
import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress'; import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';
import useShowTransition from '../../hooks/useShowTransition'; 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 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 { captureEvents } from '../../util/captureEvents';
import useMedia from '../../hooks/useMedia'; import useMedia from '../../hooks/useMedia';
import { makeTrackId } from '../../util/audioPlayer'; import { makeTrackId } from '../../util/audioPlayer';

View File

@ -1,11 +1,11 @@
import { MouseEvent as ReactMouseEvent } from 'react'; import type { MouseEvent as ReactMouseEvent } from 'react';
import React, { import type { FC, TeactNode } from '../../lib/teact/teact';
FC, memo, TeactNode, useCallback, import React, { memo, useCallback } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { import type {
ApiChat, ApiMediaFormat, ApiPhoto, ApiUser, ApiUserStatus, ApiChat, ApiPhoto, ApiUser, ApiUserStatus,
} from '../../api/types'; } from '../../api/types';
import { ApiMediaFormat } from '../../api/types';
import { IS_TEST } from '../../config'; import { IS_TEST } from '../../config';
import { import {

View File

@ -1,5 +1,6 @@
import React, { FC, memo } from '../../lib/teact/teact'; import type { FC } from '../../lib/teact/teact';
import { OwnProps } from './CalendarModal'; import React, { memo } from '../../lib/teact/teact';
import type { OwnProps } from './CalendarModal';
import { Bundles } from '../../util/moduleLoader'; import { Bundles } from '../../util/moduleLoader';
import useModuleLoader from '../../hooks/useModuleLoader'; import useModuleLoader from '../../hooks/useModuleLoader';

View File

@ -1,10 +1,12 @@
import type { FC } from '../../lib/teact/teact';
import React, { import React, {
FC, memo, useState, useEffect, useMemo, useCallback, memo, useState, useEffect, useMemo, useCallback,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import buildClassName from '../../util/buildClassName'; import buildClassName from '../../util/buildClassName';
import { formatTime, formatDateToString, getDayStart } from '../../util/dateFormat'; 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 usePrevious from '../../hooks/usePrevious';
import useFlag from '../../hooks/useFlag'; import useFlag from '../../hooks/useFlag';

View File

@ -1,10 +1,9 @@
import React, { import type { FC } from '../../lib/teact/teact';
FC, memo, useCallback, useEffect, import React, { memo, useCallback, useEffect } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { getActions, withGlobal } from '../../global'; import { getActions, withGlobal } from '../../global';
import { GlobalState } from '../../global/types'; import type { GlobalState } from '../../global/types';
import { ApiChat, ApiCountryCode, ApiUser } from '../../api/types'; import type { ApiChat, ApiCountryCode, ApiUser } from '../../api/types';
import { import {
selectChat, selectNotifyExceptions, selectNotifySettings, selectUser, selectChat, selectNotifyExceptions, selectNotifySettings, selectUser,

View File

@ -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 { getActions } from '../../global';
import buildClassName from '../../util/buildClassName'; import buildClassName from '../../util/buildClassName';

View File

@ -1,7 +1,6 @@
import { RefObject } from 'react'; import type { RefObject } from 'react';
import React, { import type { FC } from '../../lib/teact/teact';
FC, memo, useRef, useCallback, import React, { memo, useRef, useCallback } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { CHAT_HEIGHT_PX } from '../../config'; import { CHAT_HEIGHT_PX } from '../../config';
import useInfiniteScroll from '../../hooks/useInfiniteScroll'; import useInfiniteScroll from '../../hooks/useInfiniteScroll';

View File

@ -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 { getActions, withGlobal } from '../../global';
import { ApiChat } from '../../api/types'; import type { ApiChat } from '../../api/types';
import { selectIsChatWithSelf, selectUser } from '../../global/selectors'; import { selectIsChatWithSelf, selectUser } from '../../global/selectors';
import { import {

View File

@ -1,5 +1,6 @@
import React, { FC, memo } from '../../lib/teact/teact'; import type { FC } from '../../lib/teact/teact';
import { OwnProps } from './DeleteMessageModal'; import React, { memo } from '../../lib/teact/teact';
import type { OwnProps } from './DeleteMessageModal';
import { Bundles } from '../../util/moduleLoader'; import { Bundles } from '../../util/moduleLoader';
import useModuleLoader from '../../hooks/useModuleLoader'; import useModuleLoader from '../../hooks/useModuleLoader';

View File

@ -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 { getActions, withGlobal } from '../../global';
import { ApiMessage } from '../../api/types'; import type { ApiMessage } from '../../api/types';
import { IAlbum } from '../../types'; import type { IAlbum } from '../../types';
import { import {
selectAllowedMessageActions, selectAllowedMessageActions,

View File

@ -1,9 +1,10 @@
import type { FC } from '../../lib/teact/teact';
import React, { import React, {
FC, useCallback, memo, useRef, useEffect, useState, useCallback, memo, useRef, useEffect, useState,
} from '../../lib/teact/teact'; } from '../../lib/teact/teact';
import { getActions } from '../../global'; import { getActions } from '../../global';
import { ApiMessage } from '../../api/types'; import type { ApiMessage } from '../../api/types';
import { getDocumentExtension, getDocumentHasPreview } from './helpers/documentInfo'; import { getDocumentExtension, getDocumentHasPreview } from './helpers/documentInfo';
import { import {
@ -12,7 +13,8 @@ import {
getMessageMediaThumbDataUri, getMessageMediaThumbDataUri,
isMessageDocumentVideo, isMessageDocumentVideo,
} from '../../global/helpers'; } 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 useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';
import useMedia from '../../hooks/useMedia'; import useMedia from '../../hooks/useMedia';
import useFlag from '../../hooks/useFlag'; import useFlag from '../../hooks/useFlag';

View File

@ -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 useLang from '../../hooks/useLang';
import buildClassName from '../../util/buildClassName'; import buildClassName from '../../util/buildClassName';

View File

@ -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 { import {
getMessageMediaHash, getMessageMediaHash,
@ -11,7 +12,8 @@ import {
import renderText from './helpers/renderText'; import renderText from './helpers/renderText';
import { getPictogramDimensions } from './helpers/mediaDimensions'; import { getPictogramDimensions } from './helpers/mediaDimensions';
import buildClassName from '../../util/buildClassName'; 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 useMedia from '../../hooks/useMedia';
import useWebpThumbnail from '../../hooks/useWebpThumbnail'; import useWebpThumbnail from '../../hooks/useWebpThumbnail';
import useLang from '../../hooks/useLang'; import useLang from '../../hooks/useLang';

View File

@ -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'; import useLang from '../../hooks/useLang';

View File

@ -1,5 +1,6 @@
import { RefObject } from 'react'; import type { RefObject } from 'react';
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 useShowTransition from '../../hooks/useShowTransition'; import useShowTransition from '../../hooks/useShowTransition';
import useMediaTransition from '../../hooks/useMediaTransition'; import useMediaTransition from '../../hooks/useMediaTransition';

View File

@ -1,12 +1,15 @@
import type { FC } from '../../lib/teact/teact';
import React, { import React, {
FC, memo, useCallback, useEffect, useRef, memo, useCallback, useEffect, useRef,
} from '../../lib/teact/teact'; } 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 { IS_TOUCH_ENV } from '../../util/environment';
import buildClassName from '../../util/buildClassName'; 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 { preventMessageInputBlurWithBubbling } from '../middle/helpers/preventMessageInputBlur';
import useMedia from '../../hooks/useMedia'; import useMedia from '../../hooks/useMedia';

View File

@ -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'; import buildClassName from '../../util/buildClassName';

View File

@ -1,11 +1,10 @@
import { MouseEvent as ReactMouseEvent } from 'react'; import type { MouseEvent as ReactMouseEvent } from 'react';
import React, { import type { FC } from '../../lib/teact/teact';
FC, useEffect, useCallback, memo, import React, { useEffect, useCallback, memo } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { getActions, withGlobal } from '../../global'; import { getActions, withGlobal } from '../../global';
import { ApiChat, ApiTypingStatus } from '../../api/types'; import type { ApiChat, ApiTypingStatus } from '../../api/types';
import { GlobalState } from '../../global/types'; import type { GlobalState } from '../../global/types';
import { MediaViewerOrigin } from '../../types'; import { MediaViewerOrigin } from '../../types';
import { import {
@ -15,7 +14,8 @@ import {
} from '../../global/helpers'; } from '../../global/helpers';
import { selectChat, selectChatMessages, selectChatOnlineCount } from '../../global/selectors'; import { selectChat, selectChatMessages, selectChatOnlineCount } from '../../global/selectors';
import renderText from './helpers/renderText'; 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 Avatar from './Avatar';
import VerifiedIcon from './VerifiedIcon'; import VerifiedIcon from './VerifiedIcon';

View File

@ -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 { formatPastTimeShort } from '../../util/dateFormat';
import useLang from '../../hooks/useLang'; import useLang from '../../hooks/useLang';

View File

@ -1,11 +1,12 @@
import React, { import type { FC } from '../../lib/teact/teact';
FC, memo, useEffect, useState, import React, { memo, useEffect, useState } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { ActiveEmojiInteraction } from '../../global/types'; import type { ActiveEmojiInteraction } from '../../global/types';
import { ObserveFn, useIsIntersecting } from '../../hooks/useIntersectionObserver'; import type { ObserveFn } from '../../hooks/useIntersectionObserver';
import getAnimationData, { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets'; import { useIsIntersecting } from '../../hooks/useIntersectionObserver';
import type { ANIMATED_STICKERS_PATHS } from './helpers/animatedAssets';
import getAnimationData from './helpers/animatedAssets';
import useAnimatedEmoji from './hooks/useAnimatedEmoji'; import useAnimatedEmoji from './hooks/useAnimatedEmoji';
import AnimatedSticker from './AnimatedSticker'; import AnimatedSticker from './AnimatedSticker';

View File

@ -1,8 +1,7 @@
import React, { import type { FC } from '../../lib/teact/teact';
FC, memo, useCallback, useRef, import React, { memo, useCallback, useRef } from '../../lib/teact/teact';
} from '../../lib/teact/teact';
import { ApiMessage } from '../../api/types'; import type { ApiMessage } from '../../api/types';
import { formatMediaDuration } from '../../util/dateFormat'; import { formatMediaDuration } from '../../util/dateFormat';
import stopEvent from '../../util/stopEvent'; import stopEvent from '../../util/stopEvent';
@ -15,7 +14,8 @@ import {
import buildClassName from '../../util/buildClassName'; import buildClassName from '../../util/buildClassName';
import useMedia from '../../hooks/useMedia'; import useMedia from '../../hooks/useMedia';
import useMediaTransition from '../../hooks/useMediaTransition'; 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'; import './Media.scss';

View File

@ -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 { getActions } from '../../global';
import { ApiMessage } from '../../api/types'; import type { ApiMessage } from '../../api/types';
import buildClassName from '../../util/buildClassName'; import buildClassName from '../../util/buildClassName';

View File

@ -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'; import Transition from '../ui/Transition';

Some files were not shown because too many files have changed in this diff Show More