Move preferences.ts & settings.ts to utils/

This commit is contained in:
redphx 2024-04-27 15:23:49 +07:00
parent dcb4f7471f
commit 18f50e6a20
26 changed files with 32 additions and 33 deletions

1
.gitignore vendored
View File

@ -118,7 +118,6 @@ out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files

View File

@ -12,7 +12,7 @@ import { StreamStats } from "./modules/stream/stream-stats";
import { addCss } from "./utils/css";
import { Toast } from "./utils/toast";
import { setupBxUi, updateVideoPlayerCss } from "./modules/ui/ui";
import { PrefKey, getPref } from "./modules/preferences";
import { PrefKey, getPref } from "./utils/preferences";
import { LoadingScreen } from "./modules/loading-screen";
import { MouseCursorHider } from "./modules/mkb/mouse-cursor-hider";
import { TouchController } from "./modules/touch-controller";

View File

@ -1,7 +1,7 @@
import { CE } from "../utils/html";
import { getPreferredServerRegion } from "../utils/region";
import { TitlesInfo } from "../utils/titles-info";
import { PrefKey, getPref } from "./preferences";
import { PrefKey, getPref } from "../utils/preferences";
import { t } from "../utils/translation";
export class LoadingScreen {

View File

@ -2,7 +2,7 @@ import { MkbPreset } from "./mkb-preset";
import { GamepadKey, MkbPresetKey, GamepadStick, MouseMapTo } from "./definitions";
import { createButton, Icon, ButtonStyle, CE } from "../../utils/html";
import { BxEvent } from "../../utils/bx-event";
import { PrefKey, getPref } from "../preferences";
import { PrefKey, getPref } from "../../utils/preferences";
import { Toast } from "../../utils/toast";
import { t } from "../../utils/translation";
import { LocalDb } from "../../utils/local-db";

View File

@ -1,5 +1,5 @@
import { t } from "../../utils/translation";
import { SettingElementType } from "../settings";
import { SettingElementType } from "../../utils/settings";
import { GamepadKey, MouseButtonCode, MouseMapTo, MkbPresetKey } from "./definitions";
import { MkbHandler } from "./mkb-handler";
import type { MkbPresetData, MkbConvertedPresetData } from "../../types/mkb";

View File

@ -2,14 +2,14 @@ import { GamepadKey } from "./definitions";
import { CE, createButton, ButtonStyle } from "../../utils/html";
import { t } from "../../utils/translation";
import { Dialog } from "../dialog";
import { getPref, setPref, PrefKey } from "../preferences";
import { getPref, setPref, PrefKey } from "../../utils/preferences";
import { MkbPresetKey, GamepadKeyName } from "./definitions";
import { KeyHelper } from "./key-helper";
import { MkbPreset } from "./mkb-preset";
import { MkbHandler } from "./mkb-handler";
import { LocalDb } from "../../utils/local-db";
import { Icon } from "../../utils/html";
import { SettingElement } from "../settings";
import { SettingElement } from "../../utils/settings";
import type { MkbPresetData, MkbStoredPresets } from "../../types/mkb";

View File

@ -1,6 +1,6 @@
import { STATES } from "../utils/global";
import { BX_FLAGS } from "../utils/bx-flags";
import { getPref, PrefKey } from "./preferences";
import { getPref, PrefKey } from "../utils/preferences";
import { VibrationManager } from "./vibration-manager";
const PATCHES = {

View File

@ -2,7 +2,7 @@ import { STATES, AppInterface } from "../utils/global";
import { CE, createButton, ButtonStyle, Icon } from "../utils/html";
import { Toast } from "../utils/toast";
import { BxEvent } from "../utils/bx-event";
import { getPref, PrefKey, setPref } from "./preferences";
import { getPref, PrefKey, setPref } from "../utils/preferences";
import { t } from "../utils/translation";
import { localRedirect } from "./ui/ui";

View File

@ -1,6 +1,6 @@
import { PrefKey } from "../preferences"
import { PrefKey } from "../../utils/preferences"
import { BxEvent } from "../../utils/bx-event"
import { getPref } from "../preferences"
import { getPref } from "../../utils/preferences"
import { StreamBadges } from "./stream-badges"
import { CE } from "../../utils/html"
import { t } from "../../utils/translation"

View File

@ -1,7 +1,7 @@
import { STATES } from "../../utils/global";
import { Icon } from "../../utils/html";
import { BxEvent } from "../../utils/bx-event";
import { PrefKey, getPref } from "../preferences";
import { PrefKey, getPref } from "../../utils/preferences";
import { t } from "../../utils/translation";
import { StreamBadges } from "./stream-badges";
import { StreamStats } from "./stream-stats";

View File

@ -3,7 +3,7 @@ import { CE } from "../utils/html";
import { Toast } from "../utils/toast";
import { BxEvent } from "../utils/bx-event";
import { BX_FLAGS } from "../utils/bx-flags";
import { getPref, PrefKey } from "./preferences";
import { getPref, PrefKey } from "../utils/preferences";
import { t } from "../utils/translation";
export class TouchController {

View File

@ -2,7 +2,7 @@ import { STATES, AppInterface, SCRIPT_HOME, SCRIPT_VERSION } from "../../utils/g
import { CE, createButton, Icon, ButtonStyle } from "../../utils/html";
import { getPreferredServerRegion } from "../../utils/region";
import { UserAgent, UserAgentProfile } from "../../utils/user-agent";
import { getPref, Preferences, PrefKey, setPref, toPrefElement } from "../preferences";
import { getPref, Preferences, PrefKey, setPref, toPrefElement } from "../../utils/preferences";
import { t, refreshCurrentLocale } from "../../utils/translation";
const SETTINGS_UI = {

View File

@ -1,7 +1,7 @@
import { SCRIPT_VERSION } from "../../utils/global";
import { createButton, Icon, ButtonStyle } from "../../utils/html";
import { getPreferredServerRegion } from "../../utils/region";
import { PrefKey, getPref } from "../preferences";
import { PrefKey, getPref } from "../../utils/preferences";
import { RemotePlay } from "../remote-play";
import { t } from "../../utils/translation";
import { setupSettingsUi } from "./global-settings";

View File

@ -3,7 +3,7 @@ import { Icon, CE, createButton, ButtonStyle } from "../../utils/html";
import { UserAgent } from "../../utils/user-agent";
import { BxEvent } from "../../utils/bx-event";
import { MkbRemapper } from "../mkb/mkb-remapper";
import { getPref, PrefKey, toPrefElement } from "../preferences";
import { getPref, PrefKey, toPrefElement } from "../../utils/preferences";
import { setupScreenshotButton } from "../screenshot";
import { StreamStats } from "../stream/stream-stats";
import { TouchController } from "../touch-controller";

View File

@ -1,6 +1,6 @@
import { AppInterface } from "../utils/global";
import { BxEvent } from "../utils/bx-event";
import { PrefKey, getPref } from "./preferences";
import { PrefKey, getPref } from "../utils/preferences";
const VIBRATION_DATA_MAP = {
'gamepadIndex': 8,

View File

@ -1,5 +1,5 @@
import { CE } from "./html";
import { PrefKey, getPref } from "../modules/preferences";
import { PrefKey, getPref } from "./preferences";
import { renderStylus } from "../macros/build" with {type: "macro"};

View File

@ -1,5 +1,5 @@
import { MkbHandler } from "../modules/mkb/mkb-handler";
import { PrefKey, getPref } from "../modules/preferences";
import { PrefKey, getPref } from "./preferences";
import { t } from "./translation";
import { Toast } from "./toast";

View File

@ -1,5 +1,5 @@
import { MkbPreset } from "../modules/mkb/mkb-preset";
import { PrefKey, setPref } from "../modules/preferences";
import { PrefKey, setPref } from "./preferences";
import { t } from "./translation";
import type { MkbStoredPreset, MkbStoredPresets } from "../types/mkb";

View File

@ -1,5 +1,5 @@
import { BxEvent } from "./bx-event";
import { getPref, PrefKey } from "../modules/preferences";
import { getPref, PrefKey } from "./preferences";
import { STATES } from "./global";
import { UserAgent } from "./user-agent";

View File

@ -1,7 +1,7 @@
import { BxEvent } from "./bx-event";
import { BX_FLAGS } from "./bx-flags";
import { LoadingScreen } from "../modules/loading-screen";
import { PrefKey, getPref } from "../modules/preferences";
import { PrefKey, getPref } from "./preferences";
import { RemotePlay } from "../modules/remote-play";
import { StreamBadges } from "../modules/stream/stream-badges";
import { TouchController } from "../modules/touch-controller";

View File

@ -1,10 +1,10 @@
import { CE } from "../utils/html";
import { SUPPORTED_LANGUAGES, t } from "../utils/translation";
import { CE } from "./html";
import { SUPPORTED_LANGUAGES, t } from "./translation";
import { SettingElement, SettingElementType } from "./settings";
import { UserAgentProfile } from "../utils/user-agent";
import { StreamStat } from "./stream/stream-stats";
import { UserAgentProfile } from "./user-agent";
import { StreamStat } from "../modules/stream/stream-stats";
import type { PreferenceSettings } from "../types/preferences";
import { STATES } from "../utils/global";
import { STATES } from "./global";
export enum PrefKey {
LAST_UPDATE_CHECK = 'version_last_check',

View File

@ -1,4 +1,4 @@
import { getPref, PrefKey } from "../modules/preferences";
import { getPref, PrefKey } from "./preferences";
import { STATES } from "./global";

View File

@ -1,5 +1,5 @@
import type { PreferenceSetting } from "../types/preferences";
import { CE } from "../utils/html";
import { CE } from "./html";
type MultipleOptionsParams = {
size?: number;

View File

@ -1,5 +1,5 @@
import { PrefKey } from "../modules/preferences";
import { getPref } from "../modules/preferences";
import { PrefKey } from "./preferences";
import { getPref } from "./preferences";
import { STATES } from "./global";
import { UserAgent } from "./user-agent";

View File

@ -1,4 +1,4 @@
import { PrefKey, getPref } from "../modules/preferences";
import { PrefKey, getPref } from "./preferences";
export enum UserAgentProfile {
EDGE_WINDOWS = 'edge-windows',

View File

@ -1,4 +1,4 @@
import { PrefKey, getPref, setPref } from "../modules/preferences";
import { PrefKey, getPref, setPref } from "./preferences";
import { SCRIPT_VERSION } from "./global";
import { UserAgent } from "./user-agent";