From 5a837cc373cb3199feaf0e6544fe3387ea26cc7a Mon Sep 17 00:00:00 2001 From: dylan <> Date: Mon, 18 Dec 2023 21:58:27 -0800 Subject: [PATCH] brainstorming typescript --- src/types.ts | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/types.ts diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..c1dc104 --- /dev/null +++ b/src/types.ts @@ -0,0 +1,67 @@ +type DominionText = string; + +type DominionColor = { + color: string; + priority: number; // highest priority is "primary", second highest is "secondary". + overridesAction: boolean; +}; + +type DominionBasicCardType = { + typeType: "basic"; + name: "Action" | "Treasure" | "Victory" | "Reaction" | "Duration" | "Reserve" | "Night" | "Attack" | "Command"; + color: null | DominionColor; +}; +type DominionBasicLandscapeType = { + typeType: "basic"; + name: "Event" | "Landmark" | "Project" | "Way" | "Trait"; + color: null | DominionColor; +}; + +type DominionCardType = DominionBasicCardType | DominionCustomCardType; +type DominionLandscapeType = DominionBasicLandscapeType | DominionCustomLandscapeType; + +type DominionCard = { + orientation: "card"; + title: string; + description: DominionText; + type: Array; + image: string; + artist: string; + author: string; + version: string; + price: DominionText; + preview: DominionText; +} | { + orientation: "landscape"; + title: string; + description: DominionText; + type: Array; + image: string; + artist: string; + author: string; + version: string; + price: DominionText; +}; + +type DominionCustomSymbol = { + image: string; +}; + +type DominionCustomCardType = { + typeType: "custom"; + name: string; + color: DominionColor +}; +type DominionCustomLandscapeType = { + typeType: "custom"; + name: string; + color: DominionColor +}; + +type DominionExpansion = { + cards: Array; + icon: string; + customSymbols: Array; + customCardTypes: Array; + customLandscapeTypes: Array; +}