Add JSON import/export for full encounter state
Export and import encounter, undo/redo history, and player characters as a downloadable .json file. Export/import actions are in the action bar overflow menu. Import validates using existing rehydration functions and shows a confirmation dialog when replacing a non-empty encounter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
11
packages/domain/src/export-bundle.ts
Normal file
11
packages/domain/src/export-bundle.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { PlayerCharacter } from "./player-character-types.js";
|
||||
import type { Encounter } from "./types.js";
|
||||
|
||||
export interface ExportBundle {
|
||||
readonly version: number;
|
||||
readonly exportedAt: string;
|
||||
readonly encounter: Encounter;
|
||||
readonly undoStack: readonly Encounter[];
|
||||
readonly redoStack: readonly Encounter[];
|
||||
readonly playerCharacters: readonly PlayerCharacter[];
|
||||
}
|
||||
@@ -71,6 +71,7 @@ export type {
|
||||
TurnAdvanced,
|
||||
TurnRetreated,
|
||||
} from "./events.js";
|
||||
export type { ExportBundle } from "./export-bundle.js";
|
||||
export { deriveHpStatus, type HpStatus } from "./hp-status.js";
|
||||
export {
|
||||
calculateInitiative,
|
||||
|
||||
Reference in New Issue
Block a user