Update MKB codes

This commit is contained in:
redphx
2024-04-21 11:21:59 +07:00
parent 0febae28da
commit 27a277309b
11 changed files with 222 additions and 175 deletions

View File

@@ -39,6 +39,8 @@ type BxStates = {
appContext: any | null;
}
type DualEnum = {[index: string]: number} & {[index: number]: string};
declare var window: Window & typeof globalThis;
declare var AppInterface: any;
declare var STREAM_WEBRTC: RTCPeerConnection;

27
src/types/mkb.d.ts vendored Normal file
View File

@@ -0,0 +1,27 @@
import { MkbPresetKey } from "../modules/mkb/definitions";
type GamepadKeyNameType = {[index: string | number]: string[]};
type MkbStoredPreset = {
id?: number;
name: string;
data: MkbPresetData;
};
type MkbStoredPresets = {
[index: number]: MkbStoredPreset;
}
type MkbPresetData = {
mapping: {[index: number]: (string | null)[]};
mouse: Omit<{
[index in MkbPresetKey]: number | null;
}, MkbPresetKey.MOUSE_MAP_TO> & {
[MkbPresetKey.MOUSE_MAP_TO]?: string;
};
};
type MkbConvertedPresetData = {
mapping: {[index: string]: number?};
mouse: MkbNormalPreset.mouse;
};

18
src/types/preferences.d.ts vendored Normal file
View File

@@ -0,0 +1,18 @@
export type PreferenceSetting = {
default: any;
options?: {[index: string]: string};
multiple_options?: {[index: string]: string};
unsupported?: string | boolean;
note?: string | HTMLElement;
type?: SettingElementType;
ready?: () => void;
migrate?: (savedPrefs: any, value: any) => {};
min?: number;
max?: number;
steps?: number;
experimental?: boolean;
params?: any;
label?: string;
};
export type PreferenceSettings = {[index in PrefKey]: PreferenceSetting};