import type { AnyCreature, BestiaryIndex, CreatureId, Encounter, Pf2eBestiaryIndex, 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( system: string, sourceCode: string, displayName: string, creatures: AnyCreature[], ): Promise; isSourceCached(system: string, sourceCode: string): Promise; getCachedSources(system?: string): Promise; clearSource(system: string, sourceCode: string): Promise; clearAll(): Promise; loadAllCachedCreatures(): Promise>; } export interface BestiaryIndexPort { loadIndex(): BestiaryIndex; getAllSourceCodes(): string[]; getDefaultFetchUrl(sourceCode: string, baseUrl?: string): string; getSourceDisplayName(sourceCode: string): string; } export interface Pf2eBestiaryIndexPort { loadIndex(): Pf2eBestiaryIndex; getAllSourceCodes(): string[]; getDefaultFetchUrl(sourceCode: string, baseUrl?: string): string; getSourceDisplayName(sourceCode: string): string; getCreaturePathsForSource(sourceCode: string): string[]; getCreatureNamesByPaths(paths: string[]): Map; }