///
/* Add language here */
type AvailableLanguages = "en" | "fr" | "ch" | "de" | "tr";
type RyzenControllerTabForRyzenAdj = "power" | "cpu" | "gpu";
type RyzenAdjArguments =
| "--slow-time="
| "--psi0-current="
| "--vrmmax-current="
| "--min-gfxclk="
| "--max-gfxclk="
| "--min-fclk-frequency="
| "--max-fclk-frequency="
| "--tctl-temp="
| "--stapm-limit="
| "--stapm-time="
| "--fast-limit="
| "--slow-limit=";
type RyzenAdjConverter = "toHex" | "roundTen" | "toThousand" | null;
type RyzenAdjOptionDefinition = {
description: string;
label: string;
tab: RyzenControllerTabForRyzenAdj;
min: number;
max: number;
step: number;
default: number;
ryzenadj_arg: RyzenAdjArguments;
ryzenadj_value_convert: RyzenAdjConverter;
};
type RyzenAdjOptionValue = {
enabled: boolean;
value: number;
};
type RyzenAdjOptionListType = { [args in RyzenAdjArguments]: RyzenAdjOptionValue };
type RyzenAdjOptionListNamedType = { [name: string]: RyzenAdjOptionListType };
type PartialRyzenAdjOptionListType = { [args in RyzenAdjArguments]?: RyzenAdjOptionValue };
type PartialRyzenAdjOptionListNamedType = {
[name: string]: PartialRyzenAdjOptionListType;
};
type RyzenAdjOptionContextType = {
update(name: RyzenAdjArguments, value: Partial): void;
list: PartialRyzenAdjOptionListType;
};
type RyzenControllerSettingsNames =
| "autoStartOnBoot"
| "minimizeOnLaunch"
| "minimizeToTray"
| "reApplyPeriodically"
| "ryzenAdjPath"
| "onLaptopPluggedIn"
| "onLaptopPluggedOut"
| "onRCStart"
| "onSessionResume";
type RyzenControllerSettings = {
autoStartOnBoot: boolean;
minimizeOnLaunch: boolean;
minimizeToTray: boolean;
reApplyPeriodically: number | false;
ryzenAdjPath: string;
onLaptopPluggedIn: string | false;
onLaptopPluggedOut: string | false;
onRCStart: string | false;
onSessionResume: string | false;
};
type RyzenControllerSettingDefinition = {
displayTitle: boolean;
name: string;
short_description: string;
description?: string;
type: "boolean" | "range" | "path";
default: boolean | number | string;
compatibility: {
win32: boolean;
linux: boolean;
};
apply(value: boolean | number | string): Promise;
};
type RyzenControllerSettingDefinitionList = {
[args in RyzenControllerSettingsNames]: RyzenControllerSettingDefinition;
};
type RyzenControllerAppContextType = {
latestSettings: RyzenAdjOptionListType;
currentSettings: RyzenAdjOptionListType;
presets: RyzenAdjOptionListNamedType;
settings: RyzenControllerSettings;
updateLatestSettings(): void;
updateCurrentSettings(list: PartialRyzenAdjOptionListType): void;
addPreset(name: string, preset: PartialRyzenAdjOptionListType): void;
removePreset(name: keyof RyzenAdjOptionListNamedType): void;
updateSettings(settings: Partial): void;
};
type ApiPreset = {
id: number;
systemHash: string;
upvote: number;
downvote: number;
name: string;
ryzenAdjArguments: RyzenAdjOptionListType;
};
type PresetsOnlineContextType = {
loading: boolean;
list: Array;
update(): void;
uploadPreset(preset: Partial): Promise;
upvote(presetId: number): Promise;
downvote(presetId: number): Promise;
};