@jeremyckahn/farmhand 1.19.19 → 1.19.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index-BxA2fVaN.js → index-CG_lY1MJ.js} +9 -9
- package/dist/assets/{index-BxA2fVaN.js.map → index-CG_lY1MJ.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.map +1 -1
- package/package.json +3 -2
- package/src/common/services/{randomNumber.js → randomNumber.ts} +1 -0
- package/src/common/{utils.js → utils.ts} +1 -1
- package/src/components/AccountingView/{AccountingView.js → AccountingView.tsx} +1 -0
- package/src/components/AchievementsView/{AchievementsView.js → AchievementsView.tsx} +6 -4
- package/src/components/AnimatedNumber/{AnimatedNumber.js → AnimatedNumber.tsx} +9 -6
- package/src/components/AppBar/{AppBar.js → AppBar.tsx} +5 -2
- package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.js → BailOutErrorBoundary.tsx} +2 -0
- package/src/components/Cellar/{CellarInventoryTabPanel.js → CellarInventoryTabPanel.tsx} +2 -0
- package/src/components/Cellar/{Keg.js → Keg.tsx} +0 -1
- package/src/components/ContextPane/{ContextPane.test.js → ContextPane.test.tsx} +3 -0
- package/src/components/ContextPane/{ContextPane.js → ContextPane.tsx} +2 -0
- package/src/components/CowCard/Bloodline/{Bloodline.test.js → Bloodline.test.tsx} +6 -3
- package/src/components/CowCard/{CowCard.js → CowCard.tsx} +6 -4
- package/src/components/CowCard/Subheader/{Subheader.js → Subheader.tsx} +1 -0
- package/src/components/CowPen/{Cow.js → Cow.tsx} +27 -13
- package/src/components/CowPen/{CowPen.test.js → CowPen.test.tsx} +15 -1
- package/src/components/CowPen/{Tumbleweeds.js → Tumbleweeds.tsx} +2 -1
- package/src/components/Farmhand/{Farmhand.context.js → Farmhand.context.tsx} +2 -2
- package/src/components/Farmhand/{Farmhand.js → Farmhand.tsx} +91 -24
- package/src/components/FermentationRecipeList/{FermentationRecipe.js → FermentationRecipe.tsx} +4 -3
- package/src/components/FermentationRecipeList/{FermentationRecipeList.test.js → FermentationRecipeList.test.tsx} +5 -0
- package/src/components/FermentationRecipeList/{FermentationRecipeList.js → FermentationRecipeList.tsx} +3 -0
- package/src/components/Field/{Field.test.js → Field.test.tsx} +2 -3
- package/src/components/Field/{Field.js → Field.tsx} +23 -18
- package/src/components/Home/{Home.js → Home.tsx} +1 -0
- package/src/components/Home/{SnowBackground.js → SnowBackground.tsx} +2 -0
- package/src/components/Inventory/{Inventory.js → Inventory.tsx} +33 -25
- package/src/components/Item/{Item.js → Item.tsx} +2 -1
- package/src/components/LogView/{LogView.js → LogView.tsx} +23 -18
- package/src/components/Navigation/{Navigation.js → Navigation.tsx} +5 -6
- package/src/components/NotificationSystem/{NotificationSystem.js → NotificationSystem.tsx} +0 -1
- package/src/components/OnlinePeersView/{OnlinePeersView.js → OnlinePeersView.tsx} +7 -4
- package/src/components/Plot/{Plot.test.js → Plot.test.tsx} +8 -8
- package/src/components/Plot/{Plot.js → Plot.tsx} +5 -0
- package/src/components/PriceEventView/{PriceEventView.test.js → PriceEventView.test.tsx} +1 -0
- package/src/components/ProgressBar/{ProgressBar.js → ProgressBar.tsx} +2 -0
- package/src/components/QuantityInput/{QuantityInput.js → QuantityInput.tsx} +1 -0
- package/src/components/Recipe/{Recipe.js → Recipe.tsx} +1 -2
- package/src/components/SettingsView/{RandomSeedInput.js → RandomSeedInput.tsx} +1 -1
- package/src/components/Shop/{Shop.js → Shop.tsx} +2 -1
- package/src/components/Stage/{Stage.test.js → Stage.test.tsx} +1 -0
- package/src/components/Stage/{Stage.js → Stage.tsx} +6 -3
- package/src/components/TierPurchase/{TierPurchase.js → TierPurchase.tsx} +3 -3
- package/src/components/Toolbelt/{Toolbelt.js → Toolbelt.tsx} +3 -0
- package/src/components/UpgradePurchase/{UpgradePurchase.js → UpgradePurchase.tsx} +0 -1
- package/src/components/WineRecipeList/{WineRecipe.test.js → WineRecipe.test.tsx} +10 -1
- package/src/components/WineRecipeList/{WineRecipe.js → WineRecipe.tsx} +2 -1
- package/src/components/WineRecipeList/{WineRecipeList.js → WineRecipeList.tsx} +1 -0
- package/src/components/Workshop/{ForgeTabPanel.js → ForgeTabPanel.tsx} +1 -0
- package/src/components/Workshop/{Workshop.test.js → Workshop.test.tsx} +2 -2
- package/src/components/Workshop/{getUpgradesAvailable.test.js → getUpgradesAvailable.test.ts} +1 -0
- package/src/components/Workshop/{getUpgradesAvailable.js → getUpgradesAvailable.ts} +2 -0
- package/src/{constants.js → constants.ts} +2 -2
- package/src/data/{achievements.test.js → achievements.test.ts} +2 -1
- package/src/data/{achievements.js → achievements.ts} +9 -0
- package/src/data/{crop.js → crop.ts} +5 -4
- package/src/data/crops/{asparagus.js → asparagus.ts} +2 -0
- package/src/data/crops/{carrot.js → carrot.ts} +2 -0
- package/src/data/crops/{corn.js → corn.ts} +2 -0
- package/src/data/crops/{garlic.js → garlic.ts} +2 -0
- package/src/data/crops/{grape.js → grape.ts} +11 -7
- package/src/data/crops/{jalapeno.js → jalapeno.ts} +2 -0
- package/src/data/crops/{olive.js → olive.ts} +2 -0
- package/src/data/crops/{onion.js → onion.ts} +2 -0
- package/src/data/crops/{pea.js → pea.ts} +2 -0
- package/src/data/crops/{potato.js → potato.ts} +2 -0
- package/src/data/crops/{pumpkin.js → pumpkin.ts} +2 -0
- package/src/data/crops/{soybean.js → soybean.ts} +2 -0
- package/src/data/crops/{spinach.js → spinach.ts} +2 -0
- package/src/data/crops/{strawberry.js → strawberry.ts} +2 -0
- package/src/data/crops/{sunflower.js → sunflower.ts} +2 -0
- package/src/data/crops/{sweet-potato.js → sweet-potato.ts} +2 -0
- package/src/data/crops/{tomato.js → tomato.ts} +2 -0
- package/src/data/crops/{watermelon.js → watermelon.ts} +2 -0
- package/src/data/crops/{wheat.js → wheat.ts} +2 -0
- package/src/data/{items.js → items.ts} +12 -12
- package/src/data/{levels.js → levels.ts} +28 -0
- package/src/data/{maps.js → maps.ts} +2 -1
- package/src/data/ores/{bronzeOre.js → bronzeOre.ts} +1 -1
- package/src/data/ores/{coal.js → coal.ts} +1 -1
- package/src/data/ores/{goldOre.js → goldOre.ts} +1 -1
- package/src/data/ores/{ironOre.js → ironOre.ts} +1 -1
- package/src/data/ores/{saltRock.js → saltRock.ts} +1 -1
- package/src/data/ores/{silverOre.js → silverOre.ts} +1 -1
- package/src/data/ores/{stone.js → stone.ts} +1 -1
- package/src/data/{recipes.js → recipes.ts} +43 -43
- package/src/data/{upgrades.js → upgrades.ts} +4 -4
- package/src/{enums.js → enums.ts} +28 -28
- package/src/factories/{CoalFactory.js → CoalFactory.ts} +2 -0
- package/src/factories/{OreFactory.js → OreFactory.ts} +3 -0
- package/src/factories/{ResourceFactory.test.js → ResourceFactory.test.ts} +4 -0
- package/src/factories/{ResourceFactory.js → ResourceFactory.ts} +4 -0
- package/src/factories/{StoneFactory.js → StoneFactory.ts} +1 -0
- package/src/{fetch-utils.js → fetch-utils.ts} +2 -0
- package/src/game-logic/{field-purchase.test.js → field-purchase.test.ts} +4 -2
- package/src/game-logic/reducers/{applyCrows.js → applyCrows.ts} +3 -0
- package/src/game-logic/reducers/{applyLoanInterest.js → applyLoanInterest.ts} +1 -1
- package/src/game-logic/reducers/{applyPrecipitation.js → applyPrecipitation.ts} +6 -6
- package/src/game-logic/reducers/{changeCowAutomaticHugState.js → changeCowAutomaticHugState.ts} +2 -2
- package/src/game-logic/reducers/{computeStateForNextDay.js → computeStateForNextDay.ts} +2 -2
- package/src/game-logic/reducers/{consumeIngredients.js → consumeIngredients.ts} +2 -2
- package/src/game-logic/reducers/{harvestPlot.js → harvestPlot.ts} +4 -4
- package/src/game-logic/reducers/{makeFermentationRecipe.js → makeFermentationRecipe.ts} +1 -0
- package/src/game-logic/reducers/{makeRecipe.test.js → makeRecipe.test.ts} +11 -8
- package/src/game-logic/reducers/{makeWine.test.js → makeWine.test.ts} +0 -2
- package/src/game-logic/reducers/{makeWine.js → makeWine.ts} +1 -0
- package/src/game-logic/reducers/{minePlot.js → minePlot.ts} +1 -0
- package/src/game-logic/reducers/{processCellarSpoilage.test.js → processCellarSpoilage.test.ts} +0 -5
- package/src/game-logic/reducers/{processCellarSpoilage.js → processCellarSpoilage.ts} +0 -1
- package/src/game-logic/reducers/{processCowFertilizerProduction.js → processCowFertilizerProduction.ts} +1 -1
- package/src/game-logic/reducers/{processLevelUp.js → processLevelUp.ts} +3 -0
- package/src/game-logic/reducers/{purchaseField.test.js → purchaseField.test.ts} +2 -0
- package/src/game-logic/reducers/{purchaseField.js → purchaseField.ts} +3 -2
- package/src/game-logic/reducers/{purchaseForest.test.js → purchaseForest.test.tsx} +6 -2
- package/src/game-logic/reducers/{purchaseForest.js → purchaseForest.ts} +3 -2
- package/src/game-logic/reducers/{rotateNotificationLogs.js → rotateNotificationLogs.ts} +1 -1
- package/src/game-logic/reducers/{sellCow.test.js → sellCow.test.ts} +3 -3
- package/src/game-logic/reducers/{sellItem.test.js → sellItem.test.ts} +0 -3
- package/src/game-logic/reducers/{sellKeg.js → sellKeg.ts} +0 -1
- package/src/game-logic/reducers/{spawnWeeds.js → spawnWeeds.ts} +1 -0
- package/src/game-logic/reducers/{updateAchievements.js → updateAchievements.ts} +10 -9
- package/src/game-logic/reducers/{updatePeer.test.js → updatePeer.test.ts} +0 -4
- package/src/game-logic/reducers/{updatePeer.js → updatePeer.ts} +1 -0
- package/src/game-logic/reducers/{updatePlotShoveledState.test.js → updatePlotShoveledState.test.ts} +0 -1
- package/src/handlers/{peer-events.js → peer-events.ts} +9 -3
- package/src/handlers/{ui-events.test.js → ui-events.test.ts} +2 -0
- package/src/handlers/{ui-events.js → ui-events.tsx} +107 -25
- package/src/{index.js → index.tsx} +2 -0
- package/src/scripts/{generate-crop-table.js → generate-crop-table.ts} +5 -4
- package/src/services/{cellar.test.js → cellar.test.ts} +1 -1
- package/src/services/{wine.js → wine.ts} +1 -0
- package/src/shell/{notifications.test.js → notifications.test.ts} +19 -13
- package/src/{templates.js → templates.ts} +8 -0
- package/src/test-utils/{index.js → index.ts} +3 -3
- package/src/test-utils/stubs/{getKegStub.js → getKegStub.ts} +1 -0
- package/src/utils/{farmProductsSold.js → farmProductsSold.tsx} +2 -0
- package/src/utils/{getCropLifecycleDuration.js → getCropLifecycleDuration.ts} +1 -0
- package/src/utils/{getCropsAvailableToFerment.js → getCropsAvailableToFerment.ts} +1 -0
- package/src/utils/{getInventoryQuantityMap.js → getInventoryQuantityMap.ts} +1 -0
- package/src/utils/{getLevelEntitlements.js → getLevelEntitlements.ts} +4 -0
- package/src/utils/{getMaxYieldOfFermentationRecipe.js → getMaxYieldOfFermentationRecipe.ts} +1 -0
- package/src/utils/{getWineVarietiesAvailableToMake.js → getWineVarietiesAvailableToMake.ts} +2 -0
- package/src/utils/{index.test.js → index.test.ts} +0 -2
- package/src/utils/{index.js → index.tsx} +31 -18
- package/src/utils/{isItemAFarmProduct.js → isItemAFarmProduct.ts} +1 -1
- package/src/utils/{memoize.js → memoize.ts} +2 -0
- package/src/utils/{totalIngredientsInRecipe.js → totalIngredientsInRecipe.ts} +2 -0
- /package/src/common/{constants.js → constants.ts} +0 -0
- /package/src/common/services/{randomNumber.test.js → randomNumber.test.ts} +0 -0
- /package/src/common/{utils.test.js → utils.test.ts} +0 -0
- /package/src/components/AccountingView/{AccountingView.test.js → AccountingView.test.tsx} +0 -0
- /package/src/components/AccountingView/{index.js → index.ts} +0 -0
- /package/src/components/Achievement/{Achievement.test.js → Achievement.test.tsx} +0 -0
- /package/src/components/Achievement/{Achievement.js → Achievement.tsx} +0 -0
- /package/src/components/Achievement/{index.js → index.ts} +0 -0
- /package/src/components/AchievementsView/{AchievementsView.test.js → AchievementsView.test.tsx} +0 -0
- /package/src/components/AchievementsView/{index.js → index.ts} +0 -0
- /package/src/components/AnimatedNumber/{AnimatedNumber.test.js → AnimatedNumber.test.tsx} +0 -0
- /package/src/components/AnimatedNumber/{index.js → index.ts} +0 -0
- /package/src/components/AppBar/{AppBar.test.js → AppBar.test.tsx} +0 -0
- /package/src/components/AppBar/{index.js → index.ts} +0 -0
- /package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.test.js → BailOutErrorBoundary.test.tsx} +0 -0
- /package/src/components/BailOutErrorBoundary/{index.js → index.ts} +0 -0
- /package/src/components/Cellar/{Cellar.js → Cellar.tsx} +0 -0
- /package/src/components/Cellar/{FermentationTabPanel.js → FermentationTabPanel.tsx} +0 -0
- /package/src/components/Cellar/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Cellar/{WinemakingTabPanel.js → WinemakingTabPanel.tsx} +0 -0
- /package/src/components/Cellar/{index.js → index.ts} +0 -0
- /package/src/components/ChatRoom/{ChatRoom.js → ChatRoom.tsx} +0 -0
- /package/src/components/ChatRoom/{index.js → index.ts} +0 -0
- /package/src/components/ContextPane/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/Bloodline/{Bloodline.js → Bloodline.tsx} +0 -0
- /package/src/components/CowCard/Bloodline/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/{CowCard.test.js → CowCard.test.tsx} +0 -0
- /package/src/components/CowCard/Subheader/{Subheader.test.js → Subheader.test.tsx} +0 -0
- /package/src/components/CowCard/Subheader/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/{index.js → index.ts} +0 -0
- /package/src/components/CowPen/{CowPen.js → CowPen.tsx} +0 -0
- /package/src/components/CowPen/{index.js → index.ts} +0 -0
- /package/src/components/CowPenContextMenu/{CowPenContextMenu.test.js → CowPenContextMenu.test.tsx} +0 -0
- /package/src/components/CowPenContextMenu/{CowPenContextMenu.js → CowPenContextMenu.tsx} +0 -0
- /package/src/components/CowPenContextMenu/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/CowPenContextMenu/{index.js → index.ts} +0 -0
- /package/src/components/Elements/{index.js → index.ts} +0 -0
- /package/src/components/Farmhand/{Farmhand.test.js → Farmhand.test.ts} +0 -0
- /package/src/components/Farmhand/{FarmhandReducers.js → FarmhandReducers.tsx} +0 -0
- /package/src/components/Farmhand/helpers/{getInventoryQuantities.test.js → getInventoryQuantities.test.ts} +0 -0
- /package/src/components/Farmhand/helpers/{getInventoryQuantities.js → getInventoryQuantities.ts} +0 -0
- /package/src/components/Farmhand/{index.js → index.ts} +0 -0
- /package/src/components/Field/{index.js → index.ts} +0 -0
- /package/src/components/Forest/{Forest.js → Forest.tsx} +0 -0
- /package/src/components/Forest/{index.js → index.ts} +0 -0
- /package/src/components/Home/{Home.test.js → Home.test.tsx} +0 -0
- /package/src/components/Home/{index.js → index.ts} +0 -0
- /package/src/components/IngredientsList/{IngredientsList.test.js → IngredientsList.test.tsx} +0 -0
- /package/src/components/IngredientsList/{IngredientsList.js → IngredientsList.tsx} +0 -0
- /package/src/components/IngredientsList/{index.js → index.ts} +0 -0
- /package/src/components/Inventory/{Inventory.test.js → Inventory.test.tsx} +0 -0
- /package/src/components/Inventory/{index.js → index.ts} +0 -0
- /package/src/components/Item/{Item.test.js → Item.test.tsx} +0 -0
- /package/src/components/Item/{index.js → index.ts} +0 -0
- /package/src/components/KeybindingsView/{KeybindingsView.test.js → KeybindingsView.test.tsx} +0 -0
- /package/src/components/KeybindingsView/{KeybindingsView.js → KeybindingsView.tsx} +0 -0
- /package/src/components/KeybindingsView/{index.js → index.ts} +0 -0
- /package/src/components/LogView/{LogView.test.js → LogView.test.tsx} +0 -0
- /package/src/components/LogView/{index.js → index.ts} +0 -0
- /package/src/components/Navigation/{DayAndProgressContainer.js → DayAndProgressContainer.tsx} +0 -0
- /package/src/components/Navigation/{Navigation.test.js → Navigation.test.tsx} +0 -0
- /package/src/components/Navigation/{index.js → index.ts} +0 -0
- /package/src/components/NotificationSystem/{NotificationSystem.test.js → NotificationSystem.test.tsx} +0 -0
- /package/src/components/NotificationSystem/{index.js → index.ts} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.test.js → OnlinePeer.test.tsx} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.js → OnlinePeer.tsx} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{index.js → index.ts} +0 -0
- /package/src/components/OnlinePeersView/{OnlinePeersView.test.js → OnlinePeersView.test.tsx} +0 -0
- /package/src/components/OnlinePeersView/{index.js → index.ts} +0 -0
- /package/src/components/Plot/{index.js → index.ts} +0 -0
- /package/src/components/PriceEventView/{PriceEventView.js → PriceEventView.tsx} +0 -0
- /package/src/components/PriceEventView/{index.js → index.ts} +0 -0
- /package/src/components/ProgressBar/{ProgressBar.test.js → ProgressBar.test.tsx} +0 -0
- /package/src/components/ProgressBar/{index.js → index.ts} +0 -0
- /package/src/components/QuantityInput/{QuantityInput.test.js → QuantityInput.test.tsx} +0 -0
- /package/src/components/QuantityInput/{index.js → index.ts} +0 -0
- /package/src/components/QuickSelect/{QuickSelect.test.js → QuickSelect.test.tsx} +0 -0
- /package/src/components/QuickSelect/{QuickSelect.js → QuickSelect.tsx} +0 -0
- /package/src/components/QuickSelect/{index.js → index.ts} +0 -0
- /package/src/components/Recipe/{Recipe.test.js → Recipe.test.tsx} +0 -0
- /package/src/components/Recipe/{index.js → index.ts} +0 -0
- /package/src/components/RecipeList/{RecipeList.js → RecipeList.tsx} +0 -0
- /package/src/components/SearchBar/{SearchBar.test.js → SearchBar.test.tsx} +0 -0
- /package/src/components/SearchBar/{SearchBar.js → SearchBar.tsx} +0 -0
- /package/src/components/SearchBar/{index.js → index.ts} +0 -0
- /package/src/components/SettingsView/{RandomSeedInput.test.js → RandomSeedInput.test.tsx} +0 -0
- /package/src/components/SettingsView/{SettingsView.test.js → SettingsView.test.tsx} +0 -0
- /package/src/components/SettingsView/{SettingsView.js → SettingsView.tsx} +0 -0
- /package/src/components/SettingsView/{index.js → index.ts} +0 -0
- /package/src/components/Shop/{Shop.test.js → Shop.test.tsx} +0 -0
- /package/src/components/Shop/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Shop/{index.js → index.ts} +0 -0
- /package/src/components/Stage/{index.js → index.ts} +0 -0
- /package/src/components/StatsView/{StatsView.test.js → StatsView.test.tsx} +0 -0
- /package/src/components/StatsView/{StatsView.js → StatsView.tsx} +0 -0
- /package/src/components/StatsView/{index.js → index.ts} +0 -0
- /package/src/components/TierPurchase/{TierPurchase.test.js → TierPurchase.test.tsx} +0 -0
- /package/src/components/TierPurchase/{index.js → index.ts} +0 -0
- /package/src/components/Toolbelt/{Toolbelt.test.js → Toolbelt.test.tsx} +0 -0
- /package/src/components/Toolbelt/{index.js → index.ts} +0 -0
- /package/src/components/UpdateNotifier/{UpdateNotifier.js → UpdateNotifier.tsx} +0 -0
- /package/src/components/UpdateNotifier/{index.js → index.ts} +0 -0
- /package/src/components/UpgradePurchase/{UpgradePurchase.test.js → UpgradePurchase.test.tsx} +0 -0
- /package/src/components/UpgradePurchase/{index.js → index.ts} +0 -0
- /package/src/components/Workshop/{KitchenTabPanel.js → KitchenTabPanel.tsx} +0 -0
- /package/src/components/Workshop/{RecyclingTabPanel.js → RecyclingTabPanel.tsx} +0 -0
- /package/src/components/Workshop/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Workshop/{Workshop.js → Workshop.tsx} +0 -0
- /package/src/components/Workshop/{index.js → index.ts} +0 -0
- /package/src/{config.js → config.ts} +0 -0
- /package/src/data/__mocks__/{items.js → items.ts} +0 -0
- /package/src/data/__mocks__/{maps.js → maps.ts} +0 -0
- /package/src/data/__mocks__/{recipes.js → recipes.ts} +0 -0
- /package/src/data/__mocks__/{shop-inventory.js → shop-inventory.ts} +0 -0
- /package/src/data/crops/{index.js → index.ts} +0 -0
- /package/src/data/{fruit-names.js → fruit-names.ts} +0 -0
- /package/src/data/{items-map.js → items-map.ts} +0 -0
- /package/src/data/ores/{index.js → index.ts} +0 -0
- /package/src/data/{shop-inventory-cow.js → shop-inventory-cow.ts} +0 -0
- /package/src/data/{shop-inventory.js → shop-inventory.ts} +0 -0
- /package/src/data/{tools.js → tools.ts} +0 -0
- /package/src/factories/{CoalFactory.test.js → CoalFactory.test.ts} +0 -0
- /package/src/factories/{OreFactory.test.js → OreFactory.test.ts} +0 -0
- /package/src/factories/{StoneFactory.test.js → StoneFactory.test.ts} +0 -0
- /package/src/factories/{index.js → index.ts} +0 -0
- /package/src/game-logic/cows/{cow-selection.test.js → cow-selection.test.ts} +0 -0
- /package/src/game-logic/{item-purchase.test.js → item-purchase.test.ts} +0 -0
- /package/src/game-logic/{item-sell.test.js → item-sell.test.ts} +0 -0
- /package/src/game-logic/reducers/{addCowToInventory.js → addCowToInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addExperience.test.js → addExperience.test.ts} +0 -0
- /package/src/game-logic/reducers/{addExperience.js → addExperience.ts} +0 -0
- /package/src/game-logic/reducers/{addItemToInventory.test.js → addItemToInventory.test.ts} +0 -0
- /package/src/game-logic/reducers/{addItemToInventory.js → addItemToInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addKegToCellarInventory.js → addKegToCellarInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addPeer.js → addPeer.ts} +0 -0
- /package/src/game-logic/reducers/{addRevenue.js → addRevenue.ts} +0 -0
- /package/src/game-logic/reducers/{adjustLoan.test.js → adjustLoan.test.ts} +0 -0
- /package/src/game-logic/reducers/{adjustLoan.js → adjustLoan.ts} +0 -0
- /package/src/game-logic/reducers/{applyCrows.test.js → applyCrows.test.ts} +0 -0
- /package/src/game-logic/reducers/{applyLoanInterest.test.js → applyLoanInterest.test.ts} +0 -0
- /package/src/game-logic/reducers/{applyPrecipitation.test.js → applyPrecipitation.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowAutomaticHugState.test.js → changeCowAutomaticHugState.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowBreedingPenResident.test.js → changeCowBreedingPenResident.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowBreedingPenResident.js → changeCowBreedingPenResident.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowName.test.js → changeCowName.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowName.js → changeCowName.ts} +0 -0
- /package/src/game-logic/reducers/{clearPlot.test.js → clearPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{clearPlot.js → clearPlot.ts} +0 -0
- /package/src/game-logic/reducers/{computeCowInventoryForNextDay.test.js → computeCowInventoryForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{computeCowInventoryForNextDay.js → computeCowInventoryForNextDay.ts} +0 -0
- /package/src/game-logic/reducers/{computeStateForNextDay.test.js → computeStateForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{consumeIngredients.test.js → consumeIngredients.test.ts} +0 -0
- /package/src/game-logic/reducers/{createPriceEvent.test.js → createPriceEvent.test.ts} +0 -0
- /package/src/game-logic/reducers/{createPriceEvent.js → createPriceEvent.ts} +0 -0
- /package/src/game-logic/reducers/{decrementItemFromInventory.test.js → decrementItemFromInventory.test.ts} +0 -0
- /package/src/game-logic/reducers/{decrementItemFromInventory.js → decrementItemFromInventory.ts} +0 -0
- /package/src/game-logic/reducers/{fertilizePlot.test.js → fertilizePlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{fertilizePlot.js → fertilizePlot.ts} +0 -0
- /package/src/game-logic/reducers/{forRange.test.js → forRange.test.ts} +0 -0
- /package/src/game-logic/reducers/{forRange.js → forRange.ts} +0 -0
- /package/src/game-logic/reducers/{generatePriceEvents.test.js → generatePriceEvents.test.ts} +0 -0
- /package/src/game-logic/reducers/{generatePriceEvents.js → generatePriceEvents.ts} +0 -0
- /package/src/game-logic/reducers/{harvestPlot.test.js → harvestPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{helpers.js → helpers.tsx} +0 -0
- /package/src/game-logic/reducers/{hugCow.test.js → hugCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{hugCow.js → hugCow.ts} +0 -0
- /package/src/game-logic/reducers/{incrementPlotContentAge.test.js → incrementPlotContentAge.test.ts} +0 -0
- /package/src/game-logic/reducers/{incrementPlotContentAge.js → incrementPlotContentAge.ts} +0 -0
- /package/src/game-logic/reducers/{index.js → index.ts} +0 -0
- /package/src/game-logic/reducers/{makeFermentationRecipe.test.js → makeFermentationRecipe.test.ts} +0 -0
- /package/src/game-logic/reducers/{makeRecipe.js → makeRecipe.ts} +0 -0
- /package/src/game-logic/reducers/{minePlot.test.js → minePlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{modifyCow.js → modifyCow.ts} +0 -0
- /package/src/game-logic/reducers/{modifyFieldPlotAt.js → modifyFieldPlotAt.ts} +0 -0
- /package/src/game-logic/reducers/{offerCow.test.js → offerCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{offerCow.js → offerCow.ts} +0 -0
- /package/src/game-logic/reducers/{plantInPlot.test.js → plantInPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{plantInPlot.js → plantInPlot.ts} +0 -0
- /package/src/game-logic/reducers/{prependPendingPeerMessage.test.js → prependPendingPeerMessage.test.ts} +0 -0
- /package/src/game-logic/reducers/{prependPendingPeerMessage.js → prependPendingPeerMessage.ts} +0 -0
- /package/src/game-logic/reducers/{processCellar.test.js → processCellar.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCellar.js → processCellar.ts} +0 -0
- /package/src/game-logic/reducers/{processCowAttrition.test.js → processCowAttrition.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCowAttrition.js → processCowAttrition.ts} +0 -0
- /package/src/game-logic/reducers/{processCowBreeding.test.js → processCowBreeding.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCowBreeding.js → processCowBreeding.ts} +0 -0
- /package/src/game-logic/reducers/{processCowFertilizerProduction.test.js → processCowFertilizerProduction.test.ts} +0 -0
- /package/src/game-logic/reducers/{processFeedingCows.test.js → processFeedingCows.test.ts} +0 -0
- /package/src/game-logic/reducers/{processFeedingCows.js → processFeedingCows.ts} +0 -0
- /package/src/game-logic/reducers/{processField.js → processField.ts} +0 -0
- /package/src/game-logic/reducers/{processLevelUp.test.js → processLevelUp.test.ts} +0 -0
- /package/src/game-logic/reducers/{processMilkingCows.test.js → processMilkingCows.test.ts} +0 -0
- /package/src/game-logic/reducers/{processMilkingCows.js → processMilkingCows.ts} +0 -0
- /package/src/game-logic/reducers/{processNerfs.test.js → processNerfs.test.ts} +0 -0
- /package/src/game-logic/reducers/{processNerfs.js → processNerfs.ts} +0 -0
- /package/src/game-logic/reducers/{processSprinklers.test.js → processSprinklers.test.ts} +0 -0
- /package/src/game-logic/reducers/{processSprinklers.js → processSprinklers.ts} +0 -0
- /package/src/game-logic/reducers/{processWeather.test.js → processWeather.test.ts} +0 -0
- /package/src/game-logic/reducers/{processWeather.js → processWeather.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCellar.test.js → purchaseCellar.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCellar.js → purchaseCellar.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCombine.test.js → purchaseCombine.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCombine.js → purchaseCombine.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseComposter.test.js → purchaseComposter.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseComposter.js → purchaseComposter.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCow.test.js → purchaseCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCow.js → purchaseCow.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCowPen.test.js → purchaseCowPen.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCowPen.js → purchaseCowPen.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseItem.test.js → purchaseItem.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseItem.js → purchaseItem.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseSmelter.test.js → purchaseSmelter.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseSmelter.js → purchaseSmelter.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseStorageExpansion.test.js → purchaseStorageExpansion.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseStorageExpansion.js → purchaseStorageExpansion.ts} +0 -0
- /package/src/game-logic/reducers/{removeCowFromInventory.js → removeCowFromInventory.ts} +0 -0
- /package/src/game-logic/reducers/{removeFieldPlotAt.js → removeFieldPlotAt.ts} +0 -0
- /package/src/game-logic/reducers/{removeKegFromCellar.js → removeKegFromCellar.ts} +0 -0
- /package/src/game-logic/reducers/{removePeer.js → removePeer.ts} +0 -0
- /package/src/game-logic/reducers/{rotateNotificationLogs.test.js → rotateNotificationLogs.test.ts} +0 -0
- /package/src/game-logic/reducers/{selectCow.test.js → selectCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{selectCow.js → selectCow.ts} +0 -0
- /package/src/game-logic/reducers/{sellCow.js → sellCow.ts} +0 -0
- /package/src/game-logic/reducers/{sellItem.js → sellItem.ts} +0 -0
- /package/src/game-logic/reducers/{sellKeg.test.js → sellKeg.test.ts} +0 -0
- /package/src/game-logic/reducers/{setScarecrow.test.js → setScarecrow.test.ts} +0 -0
- /package/src/game-logic/reducers/{setScarecrow.js → setScarecrow.ts} +0 -0
- /package/src/game-logic/reducers/{setSprinkler.test.js → setSprinkler.test.ts} +0 -0
- /package/src/game-logic/reducers/{setSprinkler.js → setSprinkler.ts} +0 -0
- /package/src/game-logic/reducers/{showNotification.test.js → showNotification.test.ts} +0 -0
- /package/src/game-logic/reducers/{showNotification.js → showNotification.ts} +0 -0
- /package/src/game-logic/reducers/{spawnWeeds.test.js → spawnWeeds.test.ts} +0 -0
- /package/src/game-logic/reducers/{unlockTool.test.js → unlockTool.test.ts} +0 -0
- /package/src/game-logic/reducers/{unlockTool.js → unlockTool.ts} +0 -0
- /package/src/game-logic/reducers/{updateAchievements.test.js → updateAchievements.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateFinancialRecords.test.js → updateFinancialRecords.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateFinancialRecords.js → updateFinancialRecords.ts} +0 -0
- /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.test.js → updateInventoryRecordsForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.js → updateInventoryRecordsForNextDay.ts} +0 -0
- /package/src/game-logic/reducers/{updateLearnedRecipes.test.js → updateLearnedRecipes.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateLearnedRecipes.js → updateLearnedRecipes.ts} +0 -0
- /package/src/game-logic/reducers/{updatePlotShoveledState.js → updatePlotShoveledState.ts} +0 -0
- /package/src/game-logic/reducers/{updatePriceEvents.test.js → updatePriceEvents.test.ts} +0 -0
- /package/src/game-logic/reducers/{updatePriceEvents.js → updatePriceEvents.tsx} +0 -0
- /package/src/game-logic/reducers/{upgradeTool.test.js → upgradeTool.test.ts} +0 -0
- /package/src/game-logic/reducers/{upgradeTool.js → upgradeTool.ts} +0 -0
- /package/src/game-logic/reducers/{waterAllPlots.test.js → waterAllPlots.test.ts} +0 -0
- /package/src/game-logic/reducers/{waterAllPlots.js → waterAllPlots.ts} +0 -0
- /package/src/game-logic/reducers/{waterField.js → waterField.ts} +0 -0
- /package/src/game-logic/reducers/{waterPlot.test.js → waterPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{waterPlot.js → waterPlot.ts} +0 -0
- /package/src/game-logic/reducers/{withdrawCow.test.js → withdrawCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{withdrawCow.js → withdrawCow.ts} +0 -0
- /package/src/img/__mocks__/{index.js → index.ts} +0 -0
- /package/src/img/{index.js → index.ts} +0 -0
- /package/src/interfaces/{Factory.js → Factory.ts} +0 -0
- /package/src/{mui-theme.js → mui-theme.ts} +0 -0
- /package/src/{polyfills.js → polyfills.ts} +0 -0
- /package/src/services/{cellar.js → cellar.ts} +0 -0
- /package/src/services/{wine.test.js → wine.test.ts} +0 -0
- /package/src/{setupTests.js → setupTests.ts} +0 -0
- /package/src/shell/{bootup.test.js → bootup.test.ts} +0 -0
- /package/src/shell/{field.test.js → field.test.ts} +0 -0
- /package/src/shell/{game-saving.test.js → game-saving.test.ts} +0 -0
- /package/src/shell/{navigation.test.js → navigation.test.ts} +0 -0
- /package/src/shell/{pending-notifications.test.js → pending-notifications.test.ts} +0 -0
- /package/src/{strings.js → strings.ts} +0 -0
- /package/src/test-utils/stubs/{cowStub.js → cowStub.ts} +0 -0
- /package/src/test-utils/stubs/{farmhandStub.js → farmhandStub.tsx} +0 -0
- /package/src/test-utils/stubs/{itemStub.js → itemStub.ts} +0 -0
- /package/src/test-utils/stubs/{peerMetadataStub.js → peerMetadataStub.ts} +0 -0
- /package/src/test-utils/stubs/{saveDataStubFactory.js → saveDataStubFactory.ts} +0 -0
- /package/src/test-utils/{ui.js → ui.ts} +0 -0
- /package/src/utils/__snapshots__/{index.test.js.snap → index.test.ts.snap} +0 -0
- /package/src/utils/{findInField.test.js → findInField.test.ts} +0 -0
- /package/src/utils/{findInField.js → findInField.ts} +0 -0
- /package/src/utils/{getCropLifecycleDuration.test.js → getCropLifecycleDuration.test.ts} +0 -0
- /package/src/utils/{getCropsAvailableToFerment.test.js → getCropsAvailableToFerment.test.ts} +0 -0
- /package/src/utils/{getItemBaseValue.js → getItemBaseValue.ts} +0 -0
- /package/src/utils/{getKegSpoilageRate.test.js → getKegSpoilageRate.test.ts} +0 -0
- /package/src/utils/{getKegSpoilageRate.js → getKegSpoilageRate.ts} +0 -0
- /package/src/utils/{getKegValue.test.js → getKegValue.test.ts} +0 -0
- /package/src/utils/{getKegValue.js → getKegValue.ts} +0 -0
- /package/src/utils/{getLevelEntitlements.test.js → getLevelEntitlements.test.ts} +0 -0
- /package/src/utils/{getMaxYieldOfFermentationRecipe.test.js → getMaxYieldOfFermentationRecipe.test.ts} +0 -0
- /package/src/utils/{getSaltRequirementsForFermentationRecipe.js → getSaltRequirementsForFermentationRecipe.ts} +0 -0
- /package/src/utils/{getWineVarietiesAvailableToMake.test.js → getWineVarietiesAvailableToMake.test.ts} +0 -0
- /package/src/utils/{getYeastRequiredForWine.js → getYeastRequiredForWine.ts} +0 -0
- /package/src/utils/{isItemAGrownCrop.js → isItemAGrownCrop.ts} +0 -0
- /package/src/utils/{levelAchieved.js → levelAchieved.ts} +0 -0
- /package/src/utils/{moneyString.test.js → moneyString.test.ts} +0 -0
- /package/src/utils/{moneyString.js → moneyString.ts} +0 -0
- /package/src/utils/{noop.js → noop.ts} +0 -0
- /package/src/utils/{totalIngredientsInRecipe.test.js → totalIngredientsInRecipe.test.ts} +0 -0
|
@@ -50,6 +50,7 @@ export default {
|
|
|
50
50
|
* @param {number} [howMany=1]
|
|
51
51
|
*/
|
|
52
52
|
handleItemPurchaseClick(item, howMany = 1) {
|
|
53
|
+
// @ts-expect-error
|
|
53
54
|
this.purchaseItem(item, howMany)
|
|
54
55
|
},
|
|
55
56
|
|
|
@@ -58,6 +59,7 @@ export default {
|
|
|
58
59
|
* @param {number} [howMany=1]
|
|
59
60
|
*/
|
|
60
61
|
handleMakeRecipeClick(recipe, howMany = 1) {
|
|
62
|
+
// @ts-expect-error
|
|
61
63
|
this.makeRecipe(recipe, howMany)
|
|
62
64
|
},
|
|
63
65
|
|
|
@@ -66,6 +68,7 @@ export default {
|
|
|
66
68
|
* @param {number} [howMany=1]
|
|
67
69
|
*/
|
|
68
70
|
handleMakeFermentationRecipeClick(fermentationRecipe, howMany = 1) {
|
|
71
|
+
// @ts-expect-error
|
|
69
72
|
this.makeFermentationRecipe(fermentationRecipe, howMany)
|
|
70
73
|
},
|
|
71
74
|
|
|
@@ -74,6 +77,7 @@ export default {
|
|
|
74
77
|
* @param {number} [howMany=1]
|
|
75
78
|
*/
|
|
76
79
|
handleMakeWineClick(grape, howMany = 1) {
|
|
80
|
+
// @ts-expect-error
|
|
77
81
|
this.makeWine(grape, howMany)
|
|
78
82
|
},
|
|
79
83
|
|
|
@@ -81,6 +85,7 @@ export default {
|
|
|
81
85
|
* @param {keg} keg
|
|
82
86
|
*/
|
|
83
87
|
handleSellKegClick(keg) {
|
|
88
|
+
// @ts-expect-error
|
|
84
89
|
this.sellKeg(keg)
|
|
85
90
|
},
|
|
86
91
|
|
|
@@ -88,6 +93,7 @@ export default {
|
|
|
88
93
|
* @param {keg} keg
|
|
89
94
|
*/
|
|
90
95
|
handleThrowAwayKegClick(keg) {
|
|
96
|
+
// @ts-expect-error
|
|
91
97
|
this.removeKegFromCellar(keg.id)
|
|
92
98
|
},
|
|
93
99
|
|
|
@@ -95,6 +101,7 @@ export default {
|
|
|
95
101
|
* @param {farmhand.upgradesMetadatum} upgrade
|
|
96
102
|
*/
|
|
97
103
|
handleUpgradeTool(upgrade) {
|
|
104
|
+
// @ts-expect-error
|
|
98
105
|
this.upgradeTool(upgrade)
|
|
99
106
|
},
|
|
100
107
|
|
|
@@ -102,6 +109,7 @@ export default {
|
|
|
102
109
|
* @param {farmhand.cow} cow
|
|
103
110
|
*/
|
|
104
111
|
handleCowPurchaseClick(cow) {
|
|
112
|
+
// @ts-expect-error
|
|
105
113
|
this.purchaseCow(cow)
|
|
106
114
|
},
|
|
107
115
|
|
|
@@ -109,6 +117,7 @@ export default {
|
|
|
109
117
|
* @param {farmhand.cow} cow
|
|
110
118
|
*/
|
|
111
119
|
handleCowSellClick(cow) {
|
|
120
|
+
// @ts-expect-error
|
|
112
121
|
this.sellCow(cow)
|
|
113
122
|
},
|
|
114
123
|
|
|
@@ -116,6 +125,7 @@ export default {
|
|
|
116
125
|
* @param {farmhand.cow} cow
|
|
117
126
|
*/
|
|
118
127
|
handleCowTradeClick(cow) {
|
|
128
|
+
// @ts-expect-error
|
|
119
129
|
this.tradeForPeerCow(cow)
|
|
120
130
|
},
|
|
121
131
|
|
|
@@ -124,6 +134,7 @@ export default {
|
|
|
124
134
|
* @param {farmhand.cow} cow
|
|
125
135
|
*/
|
|
126
136
|
handleCowAutomaticHugChange({ target: { checked } }, cow) {
|
|
137
|
+
// @ts-expect-error
|
|
127
138
|
this.changeCowAutomaticHugState(cow, checked)
|
|
128
139
|
},
|
|
129
140
|
|
|
@@ -133,6 +144,7 @@ export default {
|
|
|
133
144
|
*/
|
|
134
145
|
handleCowBreedChange({ target }, cow) {
|
|
135
146
|
const { checked } = target
|
|
147
|
+
// @ts-expect-error
|
|
136
148
|
this.changeCowBreedingPenResident(cow, checked)
|
|
137
149
|
},
|
|
138
150
|
|
|
@@ -140,6 +152,7 @@ export default {
|
|
|
140
152
|
* @param {farmhand.cow} cow
|
|
141
153
|
*/
|
|
142
154
|
handleCowHugClick(cow) {
|
|
155
|
+
// @ts-expect-error
|
|
143
156
|
this.hugCow(cow.id)
|
|
144
157
|
},
|
|
145
158
|
|
|
@@ -147,6 +160,7 @@ export default {
|
|
|
147
160
|
* @param {farmhand.cow} cow
|
|
148
161
|
*/
|
|
149
162
|
handleCowOfferClick(cow) {
|
|
163
|
+
// @ts-expect-error
|
|
150
164
|
this.offerCow(cow.id)
|
|
151
165
|
},
|
|
152
166
|
|
|
@@ -154,6 +168,7 @@ export default {
|
|
|
154
168
|
* @param {farmhand.cow} cow
|
|
155
169
|
*/
|
|
156
170
|
handleCowWithdrawClick(cow) {
|
|
171
|
+
// @ts-expect-error
|
|
157
172
|
this.withdrawCow(cow.id)
|
|
158
173
|
},
|
|
159
174
|
|
|
@@ -163,6 +178,7 @@ export default {
|
|
|
163
178
|
*/
|
|
164
179
|
handleCowNameInputChange({ target }, cow) {
|
|
165
180
|
const { value } = target
|
|
181
|
+
// @ts-expect-error
|
|
166
182
|
this.changeCowName(cow.id, value)
|
|
167
183
|
},
|
|
168
184
|
|
|
@@ -171,6 +187,7 @@ export default {
|
|
|
171
187
|
* @param {number} [howMany=1]
|
|
172
188
|
*/
|
|
173
189
|
handleItemSellClick(item, howMany = 1) {
|
|
190
|
+
// @ts-expect-error
|
|
174
191
|
this.sellItem(item, howMany)
|
|
175
192
|
},
|
|
176
193
|
|
|
@@ -179,8 +196,9 @@ export default {
|
|
|
179
196
|
*/
|
|
180
197
|
handleViewChange({ target }) {
|
|
181
198
|
const { value } = target
|
|
199
|
+
// @ts-expect-error
|
|
182
200
|
this.setState({
|
|
183
|
-
stageFocus: /** @type {farmhand.stageFocusType} */
|
|
201
|
+
stageFocus: /** @type {farmhand.stageFocusType} */ value,
|
|
184
202
|
})
|
|
185
203
|
},
|
|
186
204
|
|
|
@@ -188,21 +206,22 @@ export default {
|
|
|
188
206
|
* @param {farmhand.stageFocusType} stageFocus
|
|
189
207
|
*/
|
|
190
208
|
handleViewChangeButtonClick(stageFocus) {
|
|
209
|
+
// @ts-expect-error
|
|
191
210
|
this.setState({ stageFocus })
|
|
192
211
|
},
|
|
193
212
|
|
|
194
213
|
/**
|
|
195
|
-
* @param {farmhand.fieldMode}
|
|
214
|
+
* @param {farmhand.fieldMode} selectedFieldMode
|
|
196
215
|
*/
|
|
197
|
-
handleFieldModeSelect(
|
|
216
|
+
handleFieldModeSelect(selectedFieldMode) {
|
|
217
|
+
// @ts-expect-error
|
|
198
218
|
this.setState(({ selectedItemId }) => ({
|
|
199
219
|
selectedItemId:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
TOOLBELT_FIELD_MODES.has(fieldMode)
|
|
220
|
+
selectedFieldMode !== PLANT ||
|
|
221
|
+
TOOLBELT_FIELD_MODES.has(selectedFieldMode)
|
|
203
222
|
? ''
|
|
204
223
|
: selectedItemId,
|
|
205
|
-
fieldMode,
|
|
224
|
+
fieldMode: selectedFieldMode,
|
|
206
225
|
}))
|
|
207
226
|
},
|
|
208
227
|
|
|
@@ -210,6 +229,7 @@ export default {
|
|
|
210
229
|
* @param {item} item
|
|
211
230
|
*/
|
|
212
231
|
handleItemSelectClick({ id, enablesFieldMode }) {
|
|
232
|
+
// @ts-expect-error
|
|
213
233
|
this.setState({
|
|
214
234
|
fieldMode: enablesFieldMode,
|
|
215
235
|
selectedItemId: id,
|
|
@@ -222,26 +242,35 @@ export default {
|
|
|
222
242
|
*/
|
|
223
243
|
handlePlotClick(x, y) {
|
|
224
244
|
const {
|
|
225
|
-
fieldMode,
|
|
245
|
+
fieldMode: fieldModeValue,
|
|
226
246
|
hoveredPlotRangeSize: rangeRadius,
|
|
227
247
|
selectedItemId,
|
|
248
|
+
// @ts-expect-error
|
|
228
249
|
} = this.state
|
|
229
250
|
|
|
230
|
-
if (
|
|
251
|
+
if (fieldModeValue === PLANT) {
|
|
252
|
+
// @ts-expect-error
|
|
231
253
|
this.forRange(plantInPlot, rangeRadius, x, y, selectedItemId)
|
|
232
|
-
} else if (
|
|
254
|
+
} else if (fieldModeValue === HARVEST) {
|
|
255
|
+
// @ts-expect-error
|
|
233
256
|
this.forRange(harvestPlot, rangeRadius, x, y)
|
|
234
|
-
} else if (
|
|
257
|
+
} else if (fieldModeValue === MINE) {
|
|
258
|
+
// @ts-expect-error
|
|
235
259
|
this.forRange(minePlot, rangeRadius, x, y)
|
|
236
|
-
} else if (
|
|
260
|
+
} else if (fieldModeValue === CLEANUP) {
|
|
261
|
+
// @ts-expect-error
|
|
237
262
|
this.forRange(clearPlot, rangeRadius, x, y)
|
|
238
|
-
} else if (
|
|
263
|
+
} else if (fieldModeValue === WATER) {
|
|
264
|
+
// @ts-expect-error
|
|
239
265
|
this.forRange(waterPlot, rangeRadius, x, y)
|
|
240
|
-
} else if (
|
|
266
|
+
} else if (fieldModeValue === FERTILIZE) {
|
|
267
|
+
// @ts-expect-error
|
|
241
268
|
this.forRange(fertilizePlot, rangeRadius, x, y)
|
|
242
|
-
} else if (
|
|
269
|
+
} else if (fieldModeValue === SET_SPRINKLER) {
|
|
270
|
+
// @ts-expect-error
|
|
243
271
|
this.setSprinkler(x, y)
|
|
244
|
-
} else if (
|
|
272
|
+
} else if (fieldModeValue === SET_SCARECROW) {
|
|
273
|
+
// @ts-expect-error
|
|
245
274
|
this.setScarecrow(x, y)
|
|
246
275
|
}
|
|
247
276
|
},
|
|
@@ -250,15 +279,18 @@ export default {
|
|
|
250
279
|
* @param {number} range
|
|
251
280
|
*/
|
|
252
281
|
handleFieldActionRangeChange(range) {
|
|
282
|
+
// @ts-expect-error
|
|
253
283
|
this.setState(() => ({ hoveredPlotRangeSize: range }))
|
|
254
284
|
},
|
|
255
285
|
|
|
256
286
|
handleClickEndDayButton() {
|
|
287
|
+
// @ts-expect-error
|
|
257
288
|
this.incrementDay()
|
|
258
289
|
|
|
259
290
|
// Prevent the player from spamming the End Day button
|
|
260
291
|
// https://www.reddit.com/r/incremental_games/comments/jusn9i/farmhand_updates_for_November_2020/gcmi6x6/?context=3
|
|
261
|
-
const activeElement = /** @type {HTMLElement} */
|
|
292
|
+
const activeElement = /** @type {HTMLElement} */ document.activeElement
|
|
293
|
+
// @ts-expect-error
|
|
262
294
|
activeElement.blur()
|
|
263
295
|
},
|
|
264
296
|
|
|
@@ -266,14 +298,17 @@ export default {
|
|
|
266
298
|
* @param {number} amount
|
|
267
299
|
*/
|
|
268
300
|
handleAddMoneyClick(amount) {
|
|
301
|
+
// @ts-expect-error
|
|
269
302
|
this.setState(({ money }) => ({ money: moneyTotal(money, amount) }))
|
|
270
303
|
},
|
|
271
304
|
|
|
272
305
|
handleClearPersistedDataClick() {
|
|
306
|
+
// @ts-expect-error
|
|
273
307
|
this.clearPersistedData()
|
|
274
308
|
},
|
|
275
309
|
|
|
276
310
|
handleWaterAllPlotsClick() {
|
|
311
|
+
// @ts-expect-error
|
|
277
312
|
this.waterAllPlots(this.state)
|
|
278
313
|
},
|
|
279
314
|
|
|
@@ -281,6 +316,7 @@ export default {
|
|
|
281
316
|
* @param {number} fieldId
|
|
282
317
|
*/
|
|
283
318
|
handleFieldPurchase(fieldId) {
|
|
319
|
+
// @ts-expect-error
|
|
284
320
|
this.purchaseField(fieldId)
|
|
285
321
|
},
|
|
286
322
|
|
|
@@ -288,6 +324,7 @@ export default {
|
|
|
288
324
|
* @param {number} forestId
|
|
289
325
|
*/
|
|
290
326
|
handleForestPurchase(forestId) {
|
|
327
|
+
// @ts-expect-error
|
|
291
328
|
this.purchaseForest(forestId)
|
|
292
329
|
},
|
|
293
330
|
|
|
@@ -295,6 +332,7 @@ export default {
|
|
|
295
332
|
* @param {number} combineId
|
|
296
333
|
*/
|
|
297
334
|
handleCombinePurchase(combineId) {
|
|
335
|
+
// @ts-expect-error
|
|
298
336
|
this.purchaseCombine(combineId)
|
|
299
337
|
},
|
|
300
338
|
|
|
@@ -302,6 +340,7 @@ export default {
|
|
|
302
340
|
* @param {number} composterId
|
|
303
341
|
*/
|
|
304
342
|
handleComposterPurchase(composterId) {
|
|
343
|
+
// @ts-expect-error
|
|
305
344
|
this.purchaseComposter(composterId)
|
|
306
345
|
},
|
|
307
346
|
|
|
@@ -309,6 +348,7 @@ export default {
|
|
|
309
348
|
* @param {number} smelterId
|
|
310
349
|
*/
|
|
311
350
|
handleSmelterPurchase(smelterId) {
|
|
351
|
+
// @ts-expect-error
|
|
312
352
|
this.purchaseSmelter(smelterId)
|
|
313
353
|
},
|
|
314
354
|
|
|
@@ -316,6 +356,7 @@ export default {
|
|
|
316
356
|
* @param {number} cowPenId
|
|
317
357
|
*/
|
|
318
358
|
handleCowPenPurchase(cowPenId) {
|
|
359
|
+
// @ts-expect-error
|
|
319
360
|
this.purchaseCowPen(cowPenId)
|
|
320
361
|
},
|
|
321
362
|
|
|
@@ -323,27 +364,32 @@ export default {
|
|
|
323
364
|
* @param {number} cellarId
|
|
324
365
|
*/
|
|
325
366
|
handleCellarPurchase(cellarId) {
|
|
367
|
+
// @ts-expect-error
|
|
326
368
|
this.purchaseCellar(cellarId)
|
|
327
369
|
},
|
|
328
370
|
|
|
329
371
|
handleStorageExpansionPurchase() {
|
|
372
|
+
// @ts-expect-error
|
|
330
373
|
this.purchaseStorageExpansion()
|
|
331
374
|
},
|
|
332
375
|
|
|
333
376
|
/**
|
|
334
377
|
* @param {boolean} [setOpen]
|
|
335
378
|
*/
|
|
336
|
-
handleMenuToggle(setOpen = /** @type {boolean | undefined} */
|
|
379
|
+
handleMenuToggle(setOpen = /** @type {boolean | undefined} */ undefined) {
|
|
380
|
+
// @ts-expect-error
|
|
337
381
|
this.setState(({ isMenuOpen }) => ({
|
|
338
382
|
isMenuOpen: setOpen == null ? !isMenuOpen : setOpen,
|
|
339
383
|
}))
|
|
340
384
|
},
|
|
341
385
|
|
|
342
386
|
handleClickNextMenuButton() {
|
|
387
|
+
// @ts-expect-error
|
|
343
388
|
this.focusNextView()
|
|
344
389
|
},
|
|
345
390
|
|
|
346
391
|
handleClickPreviousMenuButton() {
|
|
392
|
+
// @ts-expect-error
|
|
347
393
|
this.focusPreviousView()
|
|
348
394
|
},
|
|
349
395
|
|
|
@@ -351,6 +397,7 @@ export default {
|
|
|
351
397
|
* @param {farmhand.cow} cow
|
|
352
398
|
*/
|
|
353
399
|
handleCowSelect(cow) {
|
|
400
|
+
// @ts-expect-error
|
|
354
401
|
this.selectCow(cow)
|
|
355
402
|
},
|
|
356
403
|
|
|
@@ -358,28 +405,35 @@ export default {
|
|
|
358
405
|
* @param {farmhand.cow} cow
|
|
359
406
|
*/
|
|
360
407
|
handleCowClick(cow) {
|
|
408
|
+
// @ts-expect-error
|
|
361
409
|
this.selectCow(cow)
|
|
410
|
+
// @ts-expect-error
|
|
362
411
|
this.hugCow(cow.id)
|
|
363
412
|
},
|
|
364
413
|
|
|
365
414
|
handleCowPenUnmount() {
|
|
415
|
+
// @ts-expect-error
|
|
366
416
|
this.setState({ selectedCowId: '' })
|
|
367
417
|
},
|
|
368
418
|
|
|
369
419
|
/**
|
|
370
|
-
* @param {farmhand.dialogView}
|
|
420
|
+
* @param {farmhand.dialogView} selectedDialogView
|
|
371
421
|
*/
|
|
372
|
-
handleClickDialogViewButton(
|
|
373
|
-
|
|
422
|
+
handleClickDialogViewButton(selectedDialogView) {
|
|
423
|
+
// @ts-expect-error
|
|
424
|
+
this.openDialogView(selectedDialogView)
|
|
374
425
|
},
|
|
375
426
|
|
|
376
427
|
handleCloseDialogView() {
|
|
428
|
+
// @ts-expect-error
|
|
377
429
|
if (this.state.isAwaitingCowTradeRequest) return
|
|
378
430
|
|
|
431
|
+
// @ts-expect-error
|
|
379
432
|
this.closeDialogView()
|
|
380
433
|
},
|
|
381
434
|
|
|
382
435
|
handleDialogViewExited() {
|
|
436
|
+
// @ts-expect-error
|
|
383
437
|
this.setState({ currentDialogView: dialogView.NONE })
|
|
384
438
|
},
|
|
385
439
|
|
|
@@ -387,6 +441,7 @@ export default {
|
|
|
387
441
|
* @param {number} paydownAmount
|
|
388
442
|
*/
|
|
389
443
|
handleClickLoanPaydownButton(paydownAmount) {
|
|
444
|
+
// @ts-expect-error
|
|
390
445
|
this.adjustLoan(-paydownAmount)
|
|
391
446
|
},
|
|
392
447
|
|
|
@@ -394,11 +449,13 @@ export default {
|
|
|
394
449
|
* @param {number} loanAmount
|
|
395
450
|
*/
|
|
396
451
|
handleClickTakeOutLoanButton(loanAmount) {
|
|
452
|
+
// @ts-expect-error
|
|
397
453
|
this.adjustLoan(loanAmount)
|
|
398
454
|
},
|
|
399
455
|
|
|
400
456
|
handleExportDataClick() {
|
|
401
457
|
const blob = new Blob(
|
|
458
|
+
// @ts-expect-error
|
|
402
459
|
[JSON.stringify(reduceByPersistedKeys(this.state), null, 2)],
|
|
403
460
|
{
|
|
404
461
|
type: 'application/json;charset=utf-8',
|
|
@@ -417,34 +474,40 @@ export default {
|
|
|
417
474
|
const [, file] = data
|
|
418
475
|
const fileReader = new FileReader()
|
|
419
476
|
|
|
420
|
-
fileReader.addEventListener('loadend',
|
|
477
|
+
fileReader.addEventListener('loadend', eImport => {
|
|
421
478
|
try {
|
|
422
|
-
const
|
|
423
|
-
|
|
479
|
+
const target = /** @type {FileReader} */ eImport.target
|
|
480
|
+
// @ts-expect-error
|
|
481
|
+
const json = String(target.result)
|
|
424
482
|
const parsedJson = JSON.parse(json)
|
|
425
483
|
const transformedStateData = transformStateDataForImport(parsedJson)
|
|
426
484
|
const state = reduceByPersistedKeys(transformedStateData)
|
|
427
485
|
|
|
428
486
|
if (
|
|
429
487
|
Object.keys(state).some(
|
|
488
|
+
// @ts-expect-error
|
|
430
489
|
key => typeof this.state[key] !== typeof state[key]
|
|
431
490
|
)
|
|
432
491
|
) {
|
|
433
492
|
throw new Error(INVALID_DATA_PROVIDED)
|
|
434
493
|
}
|
|
435
494
|
|
|
495
|
+
// @ts-expect-error
|
|
436
496
|
this.setState({
|
|
437
497
|
...transformStateDataForImport({
|
|
498
|
+
// @ts-expect-error
|
|
438
499
|
...this.createInitialState(),
|
|
439
500
|
...state,
|
|
440
501
|
}),
|
|
441
502
|
hasBooted: true,
|
|
442
503
|
})
|
|
443
504
|
|
|
505
|
+
// @ts-expect-error
|
|
444
506
|
this.showNotification('Data loaded!', 'success')
|
|
445
507
|
} catch (e) {
|
|
446
508
|
console.error(e)
|
|
447
|
-
|
|
509
|
+
// @ts-expect-error
|
|
510
|
+
this.showNotification(/** @type {Error} */ e.message, 'error')
|
|
448
511
|
}
|
|
449
512
|
})
|
|
450
513
|
|
|
@@ -452,7 +515,9 @@ export default {
|
|
|
452
515
|
},
|
|
453
516
|
|
|
454
517
|
async handleSaveButtonClick() {
|
|
518
|
+
// @ts-expect-error
|
|
455
519
|
await this.persistState()
|
|
520
|
+
// @ts-expect-error
|
|
456
521
|
this.showNotification(PROGRESS_SAVED_MESSAGE, 'info')
|
|
457
522
|
},
|
|
458
523
|
|
|
@@ -460,10 +525,12 @@ export default {
|
|
|
460
525
|
* @param {string} farmName
|
|
461
526
|
*/
|
|
462
527
|
handleFarmNameUpdate(farmName) {
|
|
528
|
+
// @ts-expect-error
|
|
463
529
|
this.setState({ farmName })
|
|
464
530
|
},
|
|
465
531
|
|
|
466
532
|
handleCombineEnabledChange(_e, enableCombine) {
|
|
533
|
+
// @ts-expect-error
|
|
467
534
|
this.setState({ isCombineEnabled: enableCombine })
|
|
468
535
|
},
|
|
469
536
|
|
|
@@ -471,26 +538,33 @@ export default {
|
|
|
471
538
|
_e,
|
|
472
539
|
useAlternateEndDayButtonPosition
|
|
473
540
|
) {
|
|
541
|
+
// @ts-expect-error
|
|
474
542
|
this.setState({ useAlternateEndDayButtonPosition })
|
|
475
543
|
},
|
|
476
544
|
|
|
477
545
|
handleAllowCustomPeerCowNamesChange(_e, allowCustomPeerCowNames) {
|
|
546
|
+
// @ts-expect-error
|
|
478
547
|
this.setState({ allowCustomPeerCowNames })
|
|
479
548
|
},
|
|
480
549
|
|
|
481
550
|
handleShowHomeScreenChange(_e, showHomeScreen) {
|
|
551
|
+
// @ts-expect-error
|
|
482
552
|
if (this.state.stageFocus === stageFocusType.HOME && !showHomeScreen) {
|
|
553
|
+
// @ts-expect-error
|
|
483
554
|
this.focusNextView()
|
|
484
555
|
}
|
|
485
556
|
|
|
557
|
+
// @ts-expect-error
|
|
486
558
|
this.setState({ showHomeScreen })
|
|
487
559
|
},
|
|
488
560
|
|
|
489
561
|
handleShowNotificationsChange({ target: { checked } }) {
|
|
562
|
+
// @ts-expect-error
|
|
490
563
|
this.setState({ showNotifications: checked })
|
|
491
564
|
},
|
|
492
565
|
|
|
493
566
|
handleClickNotificationIndicator() {
|
|
567
|
+
// @ts-expect-error
|
|
494
568
|
this.openDialogView(dialogView.FARMERS_LOG)
|
|
495
569
|
},
|
|
496
570
|
|
|
@@ -499,9 +573,11 @@ export default {
|
|
|
499
573
|
*/
|
|
500
574
|
handleOnlineToggleChange(goOnline) {
|
|
501
575
|
if (!goOnline) {
|
|
576
|
+
// @ts-expect-error
|
|
502
577
|
this.showNotification(DISCONNECTING_FROM_SERVER, 'info')
|
|
503
578
|
}
|
|
504
579
|
|
|
580
|
+
// @ts-expect-error
|
|
505
581
|
this.setState(({ room }) =>
|
|
506
582
|
goOnline
|
|
507
583
|
? {
|
|
@@ -518,6 +594,7 @@ export default {
|
|
|
518
594
|
* @param {string} room
|
|
519
595
|
*/
|
|
520
596
|
handleRoomChange(room) {
|
|
597
|
+
// @ts-expect-error
|
|
521
598
|
this.setState(() => ({
|
|
522
599
|
room,
|
|
523
600
|
redirect: `/online/${encodeURIComponent(room.trim() || DEFAULT_ROOM)}`,
|
|
@@ -525,6 +602,7 @@ export default {
|
|
|
525
602
|
},
|
|
526
603
|
|
|
527
604
|
handleActivePlayerButtonClick() {
|
|
605
|
+
// @ts-expect-error
|
|
528
606
|
this.openDialogView(dialogView.ONLINE_PEERS)
|
|
529
607
|
},
|
|
530
608
|
|
|
@@ -540,11 +618,13 @@ export default {
|
|
|
540
618
|
randomNumberService.unseedRandomNumber()
|
|
541
619
|
queryParams.delete('seed')
|
|
542
620
|
|
|
621
|
+
// @ts-expect-error
|
|
543
622
|
this.showNotification('Random seed reset', 'info')
|
|
544
623
|
} else {
|
|
545
624
|
randomNumberService.seedRandomNumber(trimmedSeed)
|
|
546
625
|
queryParams.set('seed', trimmedSeed)
|
|
547
626
|
|
|
627
|
+
// @ts-expect-error
|
|
548
628
|
this.showNotification(`Random seed set to "${trimmedSeed}"`, 'success')
|
|
549
629
|
}
|
|
550
630
|
|
|
@@ -559,6 +639,7 @@ export default {
|
|
|
559
639
|
* @param {boolean} isChatOpen
|
|
560
640
|
*/
|
|
561
641
|
handleChatRoomOpenStateChange(isChatOpen) {
|
|
642
|
+
// @ts-expect-error
|
|
562
643
|
this.setState({ isChatOpen })
|
|
563
644
|
},
|
|
564
645
|
|
|
@@ -566,6 +647,7 @@ export default {
|
|
|
566
647
|
* @param {(reloadPage?: boolean) => Promise<void>} updateServiceWorker
|
|
567
648
|
*/
|
|
568
649
|
handleGameUpdateAvailable(updateServiceWorker) {
|
|
650
|
+
// @ts-expect-error
|
|
569
651
|
this.showNotification(UPDATE_AVAILABLE, 'success', () => {
|
|
570
652
|
updateServiceWorker(true)
|
|
571
653
|
})
|
|
@@ -10,7 +10,9 @@ import { HashRouter as Router, Route } from 'react-router-dom'
|
|
|
10
10
|
import './index.sass'
|
|
11
11
|
import Farmhand from './components/Farmhand/index.js'
|
|
12
12
|
import { features } from './config.js'
|
|
13
|
+
// @ts-expect-error
|
|
13
14
|
import '@fontsource/francois-one'
|
|
15
|
+
// @ts-expect-error
|
|
14
16
|
import '@fontsource/public-sans'
|
|
15
17
|
|
|
16
18
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -17,10 +17,8 @@ function getCropImage(seedItem, cropItem) {
|
|
|
17
17
|
if (Array.isArray(seedItem.growsInto)) {
|
|
18
18
|
return ``
|
|
20
|
+
}](https://raw.githubusercontent.com/jeremyckahn/farmhand/main/src/img/items/${cropItem.imageId ||
|
|
21
|
+
cropItem.id}.png)`
|
|
24
22
|
} else {
|
|
25
23
|
return ``
|
|
26
24
|
}
|
|
@@ -71,14 +69,17 @@ for (const level of levels) {
|
|
|
71
69
|
if (growsInto) {
|
|
72
70
|
const seedItem = item
|
|
73
71
|
if (Array.isArray(growsInto)) {
|
|
72
|
+
// @ts-expect-error
|
|
74
73
|
for (const cropItemId of growsInto) {
|
|
75
74
|
const cropItem = itemsMap[cropItemId]
|
|
76
75
|
|
|
76
|
+
// @ts-expect-error
|
|
77
77
|
rows.push(getCropRow(id, seedItem, cropItem))
|
|
78
78
|
}
|
|
79
79
|
} else {
|
|
80
80
|
const cropItem = itemsMap[growsInto]
|
|
81
81
|
|
|
82
|
+
// @ts-expect-error
|
|
82
83
|
rows.push(getCropRow(id, seedItem, cropItem))
|
|
83
84
|
}
|
|
84
85
|
}
|
|
@@ -8,7 +8,6 @@ import { cellarService } from './cellar.js'
|
|
|
8
8
|
const mockUuid = 'abc123'
|
|
9
9
|
|
|
10
10
|
beforeEach(() => {
|
|
11
|
-
// @ts-expect-error
|
|
12
11
|
vitest.spyOn(cellarService, '_uuid').mockReturnValue(mockUuid)
|
|
13
12
|
})
|
|
14
13
|
|
|
@@ -18,6 +17,7 @@ describe('CellarService', () => {
|
|
|
18
17
|
const keg = cellarService.generateKeg(pumpkin)
|
|
19
18
|
|
|
20
19
|
expect(keg).toEqual({
|
|
20
|
+
// @ts-expect-error
|
|
21
21
|
daysUntilMature: pumpkin.daysToFerment,
|
|
22
22
|
itemId: pumpkin.id,
|
|
23
23
|
id: mockUuid,
|
|
@@ -45,6 +45,7 @@ export class WineService {
|
|
|
45
45
|
getMaxWineYield = ({ grape, inventory, cellarInventory, cellarSize }) => {
|
|
46
46
|
const {
|
|
47
47
|
[grape.id]: grapeQuantityInInventory = 0,
|
|
48
|
+
// @ts-expect-error
|
|
48
49
|
[itemsMap.yeast.id]: yeastQuantityInInventory = 0,
|
|
49
50
|
} = getInventoryQuantityMap(inventory)
|
|
50
51
|
|
|
@@ -21,17 +21,19 @@ describe('notifications', () => {
|
|
|
21
21
|
|
|
22
22
|
const carrotItem = await getItemByName('Carrot')
|
|
23
23
|
const carrotInput = within(
|
|
24
|
-
|
|
24
|
+
// @ts-expect-error
|
|
25
|
+
/** @type {HTMLElement} */ carrotItem
|
|
25
26
|
).getByDisplayValue('1')
|
|
26
27
|
await userEvent.type(carrotInput, '10')
|
|
27
28
|
const carrotSellButton = within(
|
|
28
|
-
|
|
29
|
+
// @ts-expect-error
|
|
30
|
+
/** @type {HTMLElement} */ carrotItem
|
|
29
31
|
).getByText('Sell')
|
|
30
32
|
await userEvent.click(carrotSellButton)
|
|
31
33
|
const notification = await screen.findByRole('alert')
|
|
32
34
|
|
|
33
35
|
expect(
|
|
34
|
-
within(/** @type {HTMLElement} */
|
|
36
|
+
within(/** @type {HTMLElement} */ notification).getByText('Carrot Soup')
|
|
35
37
|
).toBeInTheDocument()
|
|
36
38
|
})
|
|
37
39
|
|
|
@@ -56,23 +58,29 @@ describe('notifications', () => {
|
|
|
56
58
|
const carrotItem = await getItemByName('Carrot')
|
|
57
59
|
|
|
58
60
|
const cornInput = within(
|
|
59
|
-
|
|
61
|
+
// @ts-expect-error
|
|
62
|
+
/** @type {HTMLElement} */ cornItem
|
|
60
63
|
).getByDisplayValue('1')
|
|
61
64
|
const spinachInput = within(
|
|
62
|
-
|
|
65
|
+
// @ts-expect-error
|
|
66
|
+
/** @type {HTMLElement} */ spinachItem
|
|
63
67
|
).getByDisplayValue('1')
|
|
64
68
|
const carrotInput = within(
|
|
65
|
-
|
|
69
|
+
// @ts-expect-error
|
|
70
|
+
/** @type {HTMLElement} */ carrotItem
|
|
66
71
|
).getByDisplayValue('1')
|
|
67
72
|
|
|
68
73
|
const cornSellButton = within(
|
|
69
|
-
|
|
74
|
+
// @ts-expect-error
|
|
75
|
+
/** @type {HTMLElement} */ cornItem
|
|
70
76
|
).getByText('Sell')
|
|
71
77
|
const spinachSellButton = within(
|
|
72
|
-
|
|
78
|
+
// @ts-expect-error
|
|
79
|
+
/** @type {HTMLElement} */ spinachItem
|
|
73
80
|
).getByText('Sell')
|
|
74
81
|
const carrotSellButton = within(
|
|
75
|
-
|
|
82
|
+
// @ts-expect-error
|
|
83
|
+
/** @type {HTMLElement} */ carrotItem
|
|
76
84
|
).getByText('Sell')
|
|
77
85
|
|
|
78
86
|
await userEvent.type(cornInput, '6')
|
|
@@ -89,12 +97,10 @@ describe('notifications', () => {
|
|
|
89
97
|
|
|
90
98
|
const notification = await screen.findByRole('alert')
|
|
91
99
|
expect(
|
|
92
|
-
within(/** @type {HTMLElement} */
|
|
100
|
+
within(/** @type {HTMLElement} */ notification).getByText('Carrot Soup')
|
|
93
101
|
).toBeInTheDocument()
|
|
94
102
|
expect(
|
|
95
|
-
within(/** @type {HTMLElement} */
|
|
96
|
-
'Summer Salad'
|
|
97
|
-
)
|
|
103
|
+
within(/** @type {HTMLElement} */ notification).getByText('Summer Salad')
|
|
98
104
|
).toBeInTheDocument()
|
|
99
105
|
})
|
|
100
106
|
})
|