[Refactoring] Fix incorrect typing for SharedSettings
This commit is contained in:
parent
0a9cf1ca0a
commit
347fb38b0b
@ -4,7 +4,8 @@ import {
|
|||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
|
|
||||||
import type { SharedSettings, ThemeKey, TimeFormat } from '../../../types';
|
import type { SharedSettings } from '../../../global/types';
|
||||||
|
import type { ThemeKey, TimeFormat } from '../../../types';
|
||||||
import type { IRadioOption } from '../../ui/RadioGroup';
|
import type { IRadioOption } from '../../ui/RadioGroup';
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,8 @@ import {
|
|||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
|
|
||||||
import type { AccountSettings, LangCode, SharedSettings } from '../../../types';
|
import type { SharedSettings } from '../../../global/types';
|
||||||
|
import type { AccountSettings, LangCode } from '../../../types';
|
||||||
import { SettingsScreens } from '../../../types';
|
import { SettingsScreens } from '../../../types';
|
||||||
|
|
||||||
import { selectIsCurrentUserPremium } from '../../../global/selectors';
|
import { selectIsCurrentUserPremium } from '../../../global/selectors';
|
||||||
|
|||||||
@ -9,8 +9,9 @@ import {
|
|||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
|
|
||||||
import type { ApiInputMessageReplyInfo } from '../../../api/types';
|
import type { ApiInputMessageReplyInfo } from '../../../api/types';
|
||||||
|
import type { SharedSettings } from '../../../global/types';
|
||||||
import type {
|
import type {
|
||||||
IAnchorPosition, MessageListType, SharedSettings, ThreadId,
|
IAnchorPosition, MessageListType, ThreadId,
|
||||||
} from '../../../types';
|
} from '../../../types';
|
||||||
import type { Signal } from '../../../util/signals';
|
import type { Signal } from '../../../util/signals';
|
||||||
|
|
||||||
|
|||||||
@ -1,35 +1,30 @@
|
|||||||
import type { ApiLanguage } from '../../api/types';
|
import type { ApiLanguage } from '../../api/types';
|
||||||
import type {
|
import type { AnimationLevel, PerformanceType, Point, Size, ThemeKey, TimeFormat } from '../../types';
|
||||||
AnimationLevel,
|
|
||||||
PerformanceType,
|
|
||||||
Point,
|
|
||||||
Size,
|
|
||||||
ThemeKey,
|
|
||||||
TimeFormat,
|
|
||||||
} from '../../types';
|
|
||||||
|
|
||||||
export type SharedState = {
|
export interface SharedState {
|
||||||
settings: {
|
settings: SharedSettings;
|
||||||
shouldUseSystemTheme: boolean;
|
|
||||||
theme: ThemeKey;
|
|
||||||
language: string;
|
|
||||||
languages?: ApiLanguage[];
|
|
||||||
performance: PerformanceType;
|
|
||||||
messageTextSize: number;
|
|
||||||
animationLevel: AnimationLevel;
|
|
||||||
messageSendKeyCombo: 'enter' | 'ctrl-enter';
|
|
||||||
miniAppsCachedPosition?: Point;
|
|
||||||
miniAppsCachedSize?: Size;
|
|
||||||
timeFormat: TimeFormat;
|
|
||||||
wasTimeFormatSetManually: boolean;
|
|
||||||
isConnectionStatusMinimized: boolean;
|
|
||||||
canDisplayChatInTitle: boolean;
|
|
||||||
shouldForceHttpTransport?: boolean;
|
|
||||||
shouldAllowHttpTransport?: boolean;
|
|
||||||
shouldCollectDebugLogs?: boolean;
|
|
||||||
shouldDebugExportedSenders?: boolean;
|
|
||||||
shouldWarnAboutSvg?: boolean;
|
|
||||||
shouldSkipWebAppCloseConfirmation: boolean;
|
|
||||||
};
|
|
||||||
isInitial?: true;
|
isInitial?: true;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export interface SharedSettings {
|
||||||
|
shouldUseSystemTheme: boolean;
|
||||||
|
theme: ThemeKey;
|
||||||
|
language: string;
|
||||||
|
languages?: ApiLanguage[];
|
||||||
|
performance: PerformanceType;
|
||||||
|
messageTextSize: number;
|
||||||
|
animationLevel: AnimationLevel;
|
||||||
|
messageSendKeyCombo: 'enter' | 'ctrl-enter';
|
||||||
|
miniAppsCachedPosition?: Point;
|
||||||
|
miniAppsCachedSize?: Size;
|
||||||
|
timeFormat: TimeFormat;
|
||||||
|
wasTimeFormatSetManually: boolean;
|
||||||
|
isConnectionStatusMinimized: boolean;
|
||||||
|
canDisplayChatInTitle: boolean;
|
||||||
|
shouldForceHttpTransport?: boolean;
|
||||||
|
shouldAllowHttpTransport?: boolean;
|
||||||
|
shouldCollectDebugLogs?: boolean;
|
||||||
|
shouldDebugExportedSenders?: boolean;
|
||||||
|
shouldWarnAboutSvg?: boolean;
|
||||||
|
shouldSkipWebAppCloseConfirmation: boolean;
|
||||||
|
}
|
||||||
|
|||||||
@ -18,7 +18,6 @@ import type {
|
|||||||
ApiInputReplyInfo,
|
ApiInputReplyInfo,
|
||||||
ApiInputSuggestedPostInfo,
|
ApiInputSuggestedPostInfo,
|
||||||
ApiLabeledPrice,
|
ApiLabeledPrice,
|
||||||
ApiLanguage,
|
|
||||||
ApiMediaFormat,
|
ApiMediaFormat,
|
||||||
ApiMessage,
|
ApiMessage,
|
||||||
ApiMessageEntity,
|
ApiMessageEntity,
|
||||||
@ -160,34 +159,6 @@ export interface AccountSettings {
|
|||||||
shouldPaidMessageAutoApprove: boolean;
|
shouldPaidMessageAutoApprove: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SharedSettings {
|
|
||||||
shouldUseSystemTheme: boolean;
|
|
||||||
theme: ThemeKey;
|
|
||||||
themes: Partial<Record<ThemeKey, IThemeSettings>>;
|
|
||||||
language: string;
|
|
||||||
languages?: ApiLanguage[];
|
|
||||||
performance: PerformanceType;
|
|
||||||
messageTextSize: number;
|
|
||||||
animationLevel: AnimationLevel;
|
|
||||||
messageSendKeyCombo: 'enter' | 'ctrl-enter';
|
|
||||||
miniAppsCachedPosition?: Point;
|
|
||||||
miniAppsCachedSize?: Size;
|
|
||||||
timeFormat: TimeFormat;
|
|
||||||
wasTimeFormatSetManually: boolean;
|
|
||||||
isConnectionStatusMinimized: boolean;
|
|
||||||
canDisplayChatInTitle: boolean;
|
|
||||||
shouldForceHttpTransport?: boolean;
|
|
||||||
shouldAllowHttpTransport?: boolean;
|
|
||||||
shouldCollectDebugLogs?: boolean;
|
|
||||||
shouldDebugExportedSenders?: boolean;
|
|
||||||
shouldWarnAboutSvg?: boolean;
|
|
||||||
shouldSkipWebAppCloseConfirmation: boolean;
|
|
||||||
hasContactJoinedNotifications?: boolean;
|
|
||||||
hasWebNotifications: boolean;
|
|
||||||
hasPushNotifications: boolean;
|
|
||||||
notificationSoundVolume: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type IAnchorPosition = {
|
export type IAnchorPosition = {
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user