import type { BestiaryIndex, Creature, CreatureId, Encounter, PlayerCharacter, UndoRedoState, } from "@initiative/domain"; export interface EncounterPersistence { load(): Encounter | null; save(encounter: Encounter): void; } export interface UndoRedoPersistence { load(): UndoRedoState; save(state: UndoRedoState): void; } export interface PlayerCharacterPersistence { load(): PlayerCharacter[]; save(characters: PlayerCharacter[]): void; } export interface CachedSourceInfo { readonly sourceCode: string; readonly displayName: string; readonly creatureCount: number; readonly cachedAt: number; } export interface BestiaryCachePort { cacheSource( sourceCode: string, displayName: string, creatures: Creature[], ): Promise; isSourceCached(sourceCode: string): Promise; getCachedSources(): Promise; clearSource(sourceCode: string): Promise; clearAll(): Promise; loadAllCachedCreatures(): Promise>; } export interface BestiaryIndexPort { loadIndex(): BestiaryIndex; getAllSourceCodes(): string[]; getDefaultFetchUrl(sourceCode: string, baseUrl?: string): string; getSourceDisplayName(sourceCode: string): string; }