[Refactoring] Fix incorrect typing for SharedSettings
This commit is contained in:
parent
0a9cf1ca0a
commit
347fb38b0b
@ -4,7 +4,8 @@ import {
|
||||
} from '../../../lib/teact/teact';
|
||||
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 { SettingsScreens } from '../../../types';
|
||||
|
||||
|
||||
@ -4,7 +4,8 @@ import {
|
||||
} from '../../../lib/teact/teact';
|
||||
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 { selectIsCurrentUserPremium } from '../../../global/selectors';
|
||||
|
||||
@ -9,8 +9,9 @@ import {
|
||||
import { getActions, withGlobal } from '../../../global';
|
||||
|
||||
import type { ApiInputMessageReplyInfo } from '../../../api/types';
|
||||
import type { SharedSettings } from '../../../global/types';
|
||||
import type {
|
||||
IAnchorPosition, MessageListType, SharedSettings, ThreadId,
|
||||
IAnchorPosition, MessageListType, ThreadId,
|
||||
} from '../../../types';
|
||||
import type { Signal } from '../../../util/signals';
|
||||
|
||||
|
||||
@ -1,35 +1,30 @@
|
||||
import type { ApiLanguage } from '../../api/types';
|
||||
import type {
|
||||
AnimationLevel,
|
||||
PerformanceType,
|
||||
Point,
|
||||
Size,
|
||||
ThemeKey,
|
||||
TimeFormat,
|
||||
} from '../../types';
|
||||
import type { AnimationLevel, PerformanceType, Point, Size, ThemeKey, TimeFormat } from '../../types';
|
||||
|
||||
export type SharedState = {
|
||||
settings: {
|
||||
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;
|
||||
};
|
||||
export interface SharedState {
|
||||
settings: SharedSettings;
|
||||
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,
|
||||
ApiInputSuggestedPostInfo,
|
||||
ApiLabeledPrice,
|
||||
ApiLanguage,
|
||||
ApiMediaFormat,
|
||||
ApiMessage,
|
||||
ApiMessageEntity,
|
||||
@ -160,34 +159,6 @@ export interface AccountSettings {
|
||||
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 = {
|
||||
x: number;
|
||||
y: number;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user