declare const brand: unique symbol; // branded typing export type Brand = T & { [brand]: TBrand; }; export type Player = Brand; export type CardId = Brand; export type FactionId = Brand; export type FrontId = 'a' | 'm' | 'n' | 's'; export interface Game { [index: number]: any; seed: number; log: string[]; undo: Game[]; turn: number; year: number; active: Player | null; state: string | null; bag_of_glory: Record; blank_markers: number[][]; bonuses: number[]; chosen_cards: Record; current_events: CardId[]; discard: Record; engine: EngineNode[]; fronts: { a: number; m: number; n: number; s: number; }; hands: Record; hero_points: Record; initiative: FactionId; medaillons: Array; tableaus: Record; tracks: number[]; trash: Record; triggered_track_effects: number[][]; result?: string; victory?: string; location?: string; selected?: string; state_data: any; // played_card: CardId // turn: Turn } export interface View { engine: Game['engine']; log: number | string[]; active?: string | null; prompt: string | null; actions?: any; victory?: string; location?: string; selected?: string; selected_card: CardId | null; bonuses: Game['bonuses']; current_events: CardId[]; fronts: Game['fronts']; hand: CardId[]; medaillons: Game['medaillons']; tableaus: Game['tableaus']; tracks: number[]; triggered_track_effects: Game['triggered_track_effects']; } export type States = { [key: string]: any; }; export type EngineNode = FunctionNode | LeafNode | SeqNode; export interface FunctionNode { t: 'f'; f: string; // function to be triggered a?: any; // args r?: 0 | 1; // 1 if resolved } export interface SeqNode { t: 's'; // Type c: EngineNode[]; } export interface LeafNode { t: 'l'; s: string; // State p: FactionId; // Player a?: any; // args r?: 0 | 1; // 1 if resolved } export interface CardBase { id: number; title: string; } export type Card = EventCard | PlayerCard; export interface EventCard extends CardBase { type: 'ec'; year: number; effects: Effect[]; test: { front: FrontId; value: number; pass: Effect; fail: Effect; }; } export type Icon = | 'add_to_front' | 'collectivization' | 'd_collectivization' | 'd_foreign_aid' | 'd_government' | 'd_liberty' | 'd_soviet_support' | 'draw_card' | 'foreign_aid' | 'government' | 'government_to_center' | 'liberty' | 'soviet_support' | 'teamwork_on'; export interface PlayerCard extends CardBase { type: 'pc'; strength: number; effects: Effect[]; icons: Icon[]; } export interface Effect { type: | 'attack' | 'track' | 'bonus' | 'hero_points' | 'front' | 'medaillon' | 'draw_card' | 'play_card' | 'swap_card_tableau_hand' | 'add_to_tableau' | 'remove_blank_marker' | 'return_card'; target: string | number; value: number; } export interface StaticData { cards: Card[]; fronts: Array<{ id: string; name: string; left: number; top: number; }>; medaillons: Array<{ id: number; name: string; }>; tracks: Array<{ id: number; name: string; triggers: Array; }>; }