Files
Exiled-Exchange-2/ipc/types.ts
Kvan7 06c396f0cc v0.5.0 (#308)
* change discord id #278

* Update config & data

* Commit mockup image

* update mockup

* feat: filter quick update (#247)

* feat: filter generator in renderer

* feat: filter generator in main

* chore: some polishing

* feat: about section

* feat: i18n (-ish), only en text

* chore: cleanup

* chore: clarification regarding original filter

* chore: safety checks to ignore empty or not full identifier, or empty filters all together

* fix: linting fixes

* chore: locked version of winreg

* fix: dont hide divine orbs :O

* fix: set filter to hide would always hide it, even after turning it back
fix: updated config version

* fix: moved ignore low lvl area items down in filter order

* fix: drop winreg in favor of existing solution

* Change config file handling

* add in empty string check

* feat: changing filter generator into filter updater

* chore: simplify generator pages

* chore: removed code that is no longer needed

* chore: linter fixes

* fix: remove debug text

* feat: customizable folder path

* Add russian localization

* Merge commit 'ec35412d2694eb6a677415893776939b496b8aae'

* Revert "Merge commit 'ec35412d2694eb6a677415893776939b496b8aae'"

This reverts commit 8a3d84af91.

* Merge branch 'dev' into pr/tmakuch/247

* update config version

* Add note about case sensitivity

* run linter/formatter

* Features/germanLang (#300)

* add app_i18n.json

Co-authored-by: @professorspoon

* Update files

* official site

* Build files

* update description parser?

* [Not Recognized Modifier] - %phys #298

* add new unique stats, don't have roll values yet

* Update uniques again

* [PoE2] - Checking log book hard crashes #305

* run data script again?

* data files update for 0.1.1

* version bump
2025-01-16 15:57:50 -06:00

227 lines
4.2 KiB
TypeScript

export interface HostConfig {
shortcuts: ShortcutAction[];
restoreClipboard: boolean;
clientLog: string | null;
gameConfig: string | null;
stashScroll: boolean;
overlayKey: string;
logKeys: boolean;
windowTitle: string;
language: string;
}
export interface ShortcutAction {
shortcut: string;
keepModKeys?: true;
action:
| {
type: "copy-item";
focusOverlay?: boolean;
target: string;
}
| {
type: "ocr-text";
target: "heist-gems";
}
| {
type: "trigger-event";
target: string;
}
| {
type: "stash-search";
text: string;
}
| {
type: "toggle-overlay";
}
| {
type: "paste-in-chat";
text: string;
send: boolean;
}
| {
type: "test-only";
};
}
export type UpdateInfo =
| {
state: "initial" | "checking-for-update";
}
| {
state: "update-available";
version: string;
noDownloadReason: "not-supported" | "disabled-by-flag" | null;
}
| {
state: "update-downloaded";
version: string;
}
| {
state: "update-not-available" | "error";
checkedAt: number;
};
export interface HostState {
contents: string | null;
version: string;
updater: UpdateInfo;
}
export type IpcEvent =
// events that have meaning only in Overlay mode:
| IpcOverlayAttached
| IpcFocusChange
| IpcVisibility
| IpcFocusGame
| IpcHideExclusiveWidget
| IpcTrackArea
// events used by any type of Client:
| IpcSaveConfig
| IpcUpdaterState
| IpcGameLog
| IpcClientIsActive
| IpcLogEntry
| IpcHostConfig
| IpcWidgetAction
| IpcItemText
| IpcOcrText
| IpcConfigChanged
| IpcUserAction
| FilterGeneratorListEvent;
export type IpcEventPayload<
Name extends IpcEvent["name"],
T extends IpcEvent = IpcEvent
> = T extends { name: Name; payload: infer P } ? P : never;
type IpcOverlayAttached = Event<"MAIN->OVERLAY::overlay-attached">;
type IpcFocusChange = Event<
"MAIN->OVERLAY::focus-change",
{
game: boolean;
overlay: boolean;
usingHotkey: boolean;
}
>;
type IpcVisibility = Event<
"MAIN->OVERLAY::visibility",
{
isVisible: boolean;
}
>;
type IpcFocusGame = Event<"OVERLAY->MAIN::focus-game">;
type IpcHideExclusiveWidget = Event<"MAIN->OVERLAY::hide-exclusive-widget">;
type IpcTrackArea = Event<
"OVERLAY->MAIN::track-area",
{
holdKey: string;
closeThreshold: number;
from: { x: number; y: number };
area: { x: number; y: number; width: number; height: number };
dpr: number;
}
>;
type IpcHostConfig = Event<"CLIENT->MAIN::update-host-config", HostConfig>;
type IpcClientIsActive = Event<
"CLIENT->MAIN::used-recently",
{
isOverlay: boolean;
}
>;
type IpcSaveConfig = Event<
"CLIENT->MAIN::save-config",
{
contents: string;
isTemporary: boolean;
}
>;
type IpcConfigChanged = Event<
"MAIN->CLIENT::config-changed",
{
contents: string;
}
>;
type IpcLogEntry = Event<
"MAIN->CLIENT::log-entry",
{
message: string;
}
>;
type IpcWidgetAction = Event<
"MAIN->CLIENT::widget-action",
{
target: string;
}
>;
type IpcItemText = Event<
"MAIN->CLIENT::item-text",
{
target: string;
clipboard: string;
item?: unknown;
position: { x: number; y: number };
focusOverlay: boolean;
}
>;
type IpcOcrText = Event<
"MAIN->CLIENT::ocr-text",
{
target: string;
pressTime: number;
ocrTime: number;
paragraphs: string[];
}
>;
type IpcGameLog = Event<
"MAIN->CLIENT::game-log",
{
lines: string[];
}
>;
type IpcUpdaterState = Event<"MAIN->CLIENT::updater-state", UpdateInfo>;
// Hotkeyable actions are defined in `ShortcutAction`.
// Actions below are triggered by user interaction with the UI.
type IpcUserAction = Event<
"CLIENT->MAIN::user-action",
| {
action: "check-for-update" | "update-and-restart" | "quit";
}
| {
action:
| "stash-search"
| "filter-generator:update"
| "filter-generator:list";
text: string;
}
>;
type FilterGeneratorListEvent = Event<
"MAIN->CLIENT::filter-generator:list",
{
folder: string;
files: string[];
}
>;
interface Event<TName extends string, TPayload = undefined> {
name: TName;
payload: TPayload;
}