Files
STARTLINER/src/types.ts
2025-04-19 19:48:08 +00:00

175 lines
3.5 KiB
TypeScript

export interface Package {
namespace: string;
name: string;
description: string;
loc: {
version: string;
path: string;
dependencies: string[];
status: Status;
icon: string;
} | null;
rmt: {
version: string;
package_url: string;
download_url: string;
deprecated: boolean;
nsfw: boolean;
categories: string[];
icon: string;
} | null;
js: {
downloading: boolean;
};
}
export enum Feature {
Mod = 1 << 0,
Aime = 1 << 1,
AMNet = 1 << 2,
Mu3Hook = 1 << 3,
Mu3IO = 1 << 4,
ChusanHook = 1 << 5,
ChuniIO = 1 << 6,
Mempatcher = 1 << 7,
GameDLL = 1 << 8,
AmdDLL = 1 << 9,
}
export type Status =
| 'Unchecked'
| 'Unsupported'
| {
OK: [Feature, String, String];
};
export type Game = 'ongeki' | 'chunithm';
export interface ProfileMeta {
game: Game;
name: string;
}
export interface ProfileData {
mods: string[];
sgt: SegatoolsConfig;
display: DisplayConfig;
network: NetworkConfig;
bepinex: BepInExConfig;
mu3_ini: Mu3IniConfig | undefined;
keyboard: KeyboardConfig | undefined;
patches: {
[key: string]: 'enabled' | { number: number } | { hex: Int8Array };
};
}
export interface SegatoolsConfig {
target: string;
hook: string | null;
io2: 'segatools_built_in' | 'hardware' | { custom: string };
amfs: string;
option: string;
appdata: string;
aime: { AMNet: string } | { Other: string } | 'BuiltIn' | 'Disabled';
intel: boolean;
amnet: {
name: string;
addr: string;
physical: boolean;
};
aime_port: number;
}
export interface DisplayConfig {
target: String;
rez: [number, number];
mode: 'Window' | 'Borderless' | 'Fullscreen';
rotation: number | null;
frequency: number;
borderless_fullscreen: boolean;
dont_switch_primary: boolean;
monitor_index_override: number | null;
}
export interface NetworkConfig {
network_type: 'Remote' | 'Artemis';
local_path: string;
local_console: boolean;
remote_address: string;
keychip: string;
subnet: string;
suffix: number | null;
}
export interface BepInExConfig {
console: boolean;
}
export interface Mu3IniConfig {
audio?: 'Shared' | 'Excl6Ch' | 'Excl2Ch';
sample_rate: number;
blacklist?: [number, number];
gp: number;
enable_bonus_tracks: boolean;
}
export interface OngekiButtons {
use_mouse: boolean;
enabled: boolean;
coin: number;
svc: number;
test: number;
lmenu: number;
rmenu: number;
l1: number;
l2: number;
l3: number;
r1: number;
r2: number;
r3: number;
lwad: number;
rwad: number;
}
export interface ChunithmButtons {
enabled: boolean;
coin: number;
svc: number;
test: number;
cell: number[];
ir: number[];
}
export type KeyboardConfig =
| {
game: 'Ongeki';
data: OngekiButtons;
}
| {
game: 'Chunithm';
data: ChunithmButtons;
};
export interface Profile {
meta: ProfileMeta;
data: ProfileData;
}
export type Module = 'sgt' | 'display' | 'network';
export interface Dirs {
config_dir: string;
data_dir: string;
cache_dir: string;
}
export interface Patch {
id: string;
name: string;
tooltip: string;
type: undefined | 'number';
default: number;
min: number;
max: number;
}