Add local save selection and editing

This commit is contained in:
N0VAN0M4LY committed 2026-11-29 15:42:28 +08:00
1 parent 900eb90b42
commit d19baec90b
18 files changed
+634 -4

No files matched your search

@@ -0,0 +1,16 @@
import type { AppErrorCode } from '@shared/errors.ts';
import type { CurrencyEdits, SaveDetails, SaveList } from '@shared/schemas/saves.ts';
interface Location {
readonly gameFolder: string;
readonly dataFolder: string;
}
export type SaveTask = Location & (
| { readonly operation: 'list' }
| { readonly operation: 'details'; readonly userId: string }
| { readonly operation: 'edit'; readonly userId: string; readonly values: CurrencyEdits }
| { readonly operation: 'create'; readonly login: string; readonly password: string; readonly nick: string }
);
export type SaveResult = SaveList['saves'] | SaveDetails | { userId: string } | null;
export type SaveReply = { ok: true; result: SaveResult } | { ok: false; error: AppErrorCode };