From 4e9e426519f247339c455384bde4333eeb6fa917 Mon Sep 17 00:00:00 2001 From: hypercross Date: Sun, 19 Apr 2026 14:47:58 +0800 Subject: [PATCH] feat(samples): add Item type to desert data Export the Item type from item.csv and add explicit typing to startingItems in the desert sample data. --- src/samples/slay-the-spire-like/data/desert/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/samples/slay-the-spire-like/data/desert/index.ts b/src/samples/slay-the-spire-like/data/desert/index.ts index a00f499..b7df6b7 100644 --- a/src/samples/slay-the-spire-like/data/desert/index.ts +++ b/src/samples/slay-the-spire-like/data/desert/index.ts @@ -3,7 +3,7 @@ import getEffects from "./effect.csv"; import getEncounters from "./encounter.csv"; import getEnemies from "./enemy.csv"; import getIntents from "./intent.csv"; -import getItems from "./item.csv"; +import getItems, { Item } from "./item.csv"; export { default as dialogues } from "./dialogues/dialogues.yarnproject"; export { addTriggers } from "./triggers"; @@ -14,6 +14,6 @@ export const enemies = getEnemies(); export const intents = getIntents(); export const items = getItems(); -export const startingItems = ["剑", "盾", "水袋", "绷带"].map((key) => - items.find((item) => item.name === key), -); +export const startingItems: Item[] = ( + ["剑", "盾", "水袋", "绷带"] as string[] +).map((key) => items.find((item) => item.name === key) as Item);