@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.
Files changed (447) hide show
  1. package/dist/assets/{index-BxA2fVaN.js → index-CG_lY1MJ.js} +9 -9
  2. package/dist/assets/{index-BxA2fVaN.js.map → index-CG_lY1MJ.js.map} +1 -1
  3. package/dist/index.html +1 -1
  4. package/dist/service-worker.js +1 -1
  5. package/dist/service-worker.js.map +1 -1
  6. package/package.json +3 -2
  7. package/src/common/services/{randomNumber.js → randomNumber.ts} +1 -0
  8. package/src/common/{utils.js → utils.ts} +1 -1
  9. package/src/components/AccountingView/{AccountingView.js → AccountingView.tsx} +1 -0
  10. package/src/components/AchievementsView/{AchievementsView.js → AchievementsView.tsx} +6 -4
  11. package/src/components/AnimatedNumber/{AnimatedNumber.js → AnimatedNumber.tsx} +9 -6
  12. package/src/components/AppBar/{AppBar.js → AppBar.tsx} +5 -2
  13. package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.js → BailOutErrorBoundary.tsx} +2 -0
  14. package/src/components/Cellar/{CellarInventoryTabPanel.js → CellarInventoryTabPanel.tsx} +2 -0
  15. package/src/components/Cellar/{Keg.js → Keg.tsx} +0 -1
  16. package/src/components/ContextPane/{ContextPane.test.js → ContextPane.test.tsx} +3 -0
  17. package/src/components/ContextPane/{ContextPane.js → ContextPane.tsx} +2 -0
  18. package/src/components/CowCard/Bloodline/{Bloodline.test.js → Bloodline.test.tsx} +6 -3
  19. package/src/components/CowCard/{CowCard.js → CowCard.tsx} +6 -4
  20. package/src/components/CowCard/Subheader/{Subheader.js → Subheader.tsx} +1 -0
  21. package/src/components/CowPen/{Cow.js → Cow.tsx} +27 -13
  22. package/src/components/CowPen/{CowPen.test.js → CowPen.test.tsx} +15 -1
  23. package/src/components/CowPen/{Tumbleweeds.js → Tumbleweeds.tsx} +2 -1
  24. package/src/components/Farmhand/{Farmhand.context.js → Farmhand.context.tsx} +2 -2
  25. package/src/components/Farmhand/{Farmhand.js → Farmhand.tsx} +91 -24
  26. package/src/components/FermentationRecipeList/{FermentationRecipe.js → FermentationRecipe.tsx} +4 -3
  27. package/src/components/FermentationRecipeList/{FermentationRecipeList.test.js → FermentationRecipeList.test.tsx} +5 -0
  28. package/src/components/FermentationRecipeList/{FermentationRecipeList.js → FermentationRecipeList.tsx} +3 -0
  29. package/src/components/Field/{Field.test.js → Field.test.tsx} +2 -3
  30. package/src/components/Field/{Field.js → Field.tsx} +23 -18
  31. package/src/components/Home/{Home.js → Home.tsx} +1 -0
  32. package/src/components/Home/{SnowBackground.js → SnowBackground.tsx} +2 -0
  33. package/src/components/Inventory/{Inventory.js → Inventory.tsx} +33 -25
  34. package/src/components/Item/{Item.js → Item.tsx} +2 -1
  35. package/src/components/LogView/{LogView.js → LogView.tsx} +23 -18
  36. package/src/components/Navigation/{Navigation.js → Navigation.tsx} +5 -6
  37. package/src/components/NotificationSystem/{NotificationSystem.js → NotificationSystem.tsx} +0 -1
  38. package/src/components/OnlinePeersView/{OnlinePeersView.js → OnlinePeersView.tsx} +7 -4
  39. package/src/components/Plot/{Plot.test.js → Plot.test.tsx} +8 -8
  40. package/src/components/Plot/{Plot.js → Plot.tsx} +5 -0
  41. package/src/components/PriceEventView/{PriceEventView.test.js → PriceEventView.test.tsx} +1 -0
  42. package/src/components/ProgressBar/{ProgressBar.js → ProgressBar.tsx} +2 -0
  43. package/src/components/QuantityInput/{QuantityInput.js → QuantityInput.tsx} +1 -0
  44. package/src/components/Recipe/{Recipe.js → Recipe.tsx} +1 -2
  45. package/src/components/SettingsView/{RandomSeedInput.js → RandomSeedInput.tsx} +1 -1
  46. package/src/components/Shop/{Shop.js → Shop.tsx} +2 -1
  47. package/src/components/Stage/{Stage.test.js → Stage.test.tsx} +1 -0
  48. package/src/components/Stage/{Stage.js → Stage.tsx} +6 -3
  49. package/src/components/TierPurchase/{TierPurchase.js → TierPurchase.tsx} +3 -3
  50. package/src/components/Toolbelt/{Toolbelt.js → Toolbelt.tsx} +3 -0
  51. package/src/components/UpgradePurchase/{UpgradePurchase.js → UpgradePurchase.tsx} +0 -1
  52. package/src/components/WineRecipeList/{WineRecipe.test.js → WineRecipe.test.tsx} +10 -1
  53. package/src/components/WineRecipeList/{WineRecipe.js → WineRecipe.tsx} +2 -1
  54. package/src/components/WineRecipeList/{WineRecipeList.js → WineRecipeList.tsx} +1 -0
  55. package/src/components/Workshop/{ForgeTabPanel.js → ForgeTabPanel.tsx} +1 -0
  56. package/src/components/Workshop/{Workshop.test.js → Workshop.test.tsx} +2 -2
  57. package/src/components/Workshop/{getUpgradesAvailable.test.js → getUpgradesAvailable.test.ts} +1 -0
  58. package/src/components/Workshop/{getUpgradesAvailable.js → getUpgradesAvailable.ts} +2 -0
  59. package/src/{constants.js → constants.ts} +2 -2
  60. package/src/data/{achievements.test.js → achievements.test.ts} +2 -1
  61. package/src/data/{achievements.js → achievements.ts} +9 -0
  62. package/src/data/{crop.js → crop.ts} +5 -4
  63. package/src/data/crops/{asparagus.js → asparagus.ts} +2 -0
  64. package/src/data/crops/{carrot.js → carrot.ts} +2 -0
  65. package/src/data/crops/{corn.js → corn.ts} +2 -0
  66. package/src/data/crops/{garlic.js → garlic.ts} +2 -0
  67. package/src/data/crops/{grape.js → grape.ts} +11 -7
  68. package/src/data/crops/{jalapeno.js → jalapeno.ts} +2 -0
  69. package/src/data/crops/{olive.js → olive.ts} +2 -0
  70. package/src/data/crops/{onion.js → onion.ts} +2 -0
  71. package/src/data/crops/{pea.js → pea.ts} +2 -0
  72. package/src/data/crops/{potato.js → potato.ts} +2 -0
  73. package/src/data/crops/{pumpkin.js → pumpkin.ts} +2 -0
  74. package/src/data/crops/{soybean.js → soybean.ts} +2 -0
  75. package/src/data/crops/{spinach.js → spinach.ts} +2 -0
  76. package/src/data/crops/{strawberry.js → strawberry.ts} +2 -0
  77. package/src/data/crops/{sunflower.js → sunflower.ts} +2 -0
  78. package/src/data/crops/{sweet-potato.js → sweet-potato.ts} +2 -0
  79. package/src/data/crops/{tomato.js → tomato.ts} +2 -0
  80. package/src/data/crops/{watermelon.js → watermelon.ts} +2 -0
  81. package/src/data/crops/{wheat.js → wheat.ts} +2 -0
  82. package/src/data/{items.js → items.ts} +12 -12
  83. package/src/data/{levels.js → levels.ts} +28 -0
  84. package/src/data/{maps.js → maps.ts} +2 -1
  85. package/src/data/ores/{bronzeOre.js → bronzeOre.ts} +1 -1
  86. package/src/data/ores/{coal.js → coal.ts} +1 -1
  87. package/src/data/ores/{goldOre.js → goldOre.ts} +1 -1
  88. package/src/data/ores/{ironOre.js → ironOre.ts} +1 -1
  89. package/src/data/ores/{saltRock.js → saltRock.ts} +1 -1
  90. package/src/data/ores/{silverOre.js → silverOre.ts} +1 -1
  91. package/src/data/ores/{stone.js → stone.ts} +1 -1
  92. package/src/data/{recipes.js → recipes.ts} +43 -43
  93. package/src/data/{upgrades.js → upgrades.ts} +4 -4
  94. package/src/{enums.js → enums.ts} +28 -28
  95. package/src/factories/{CoalFactory.js → CoalFactory.ts} +2 -0
  96. package/src/factories/{OreFactory.js → OreFactory.ts} +3 -0
  97. package/src/factories/{ResourceFactory.test.js → ResourceFactory.test.ts} +4 -0
  98. package/src/factories/{ResourceFactory.js → ResourceFactory.ts} +4 -0
  99. package/src/factories/{StoneFactory.js → StoneFactory.ts} +1 -0
  100. package/src/{fetch-utils.js → fetch-utils.ts} +2 -0
  101. package/src/game-logic/{field-purchase.test.js → field-purchase.test.ts} +4 -2
  102. package/src/game-logic/reducers/{applyCrows.js → applyCrows.ts} +3 -0
  103. package/src/game-logic/reducers/{applyLoanInterest.js → applyLoanInterest.ts} +1 -1
  104. package/src/game-logic/reducers/{applyPrecipitation.js → applyPrecipitation.ts} +6 -6
  105. package/src/game-logic/reducers/{changeCowAutomaticHugState.js → changeCowAutomaticHugState.ts} +2 -2
  106. package/src/game-logic/reducers/{computeStateForNextDay.js → computeStateForNextDay.ts} +2 -2
  107. package/src/game-logic/reducers/{consumeIngredients.js → consumeIngredients.ts} +2 -2
  108. package/src/game-logic/reducers/{harvestPlot.js → harvestPlot.ts} +4 -4
  109. package/src/game-logic/reducers/{makeFermentationRecipe.js → makeFermentationRecipe.ts} +1 -0
  110. package/src/game-logic/reducers/{makeRecipe.test.js → makeRecipe.test.ts} +11 -8
  111. package/src/game-logic/reducers/{makeWine.test.js → makeWine.test.ts} +0 -2
  112. package/src/game-logic/reducers/{makeWine.js → makeWine.ts} +1 -0
  113. package/src/game-logic/reducers/{minePlot.js → minePlot.ts} +1 -0
  114. package/src/game-logic/reducers/{processCellarSpoilage.test.js → processCellarSpoilage.test.ts} +0 -5
  115. package/src/game-logic/reducers/{processCellarSpoilage.js → processCellarSpoilage.ts} +0 -1
  116. package/src/game-logic/reducers/{processCowFertilizerProduction.js → processCowFertilizerProduction.ts} +1 -1
  117. package/src/game-logic/reducers/{processLevelUp.js → processLevelUp.ts} +3 -0
  118. package/src/game-logic/reducers/{purchaseField.test.js → purchaseField.test.ts} +2 -0
  119. package/src/game-logic/reducers/{purchaseField.js → purchaseField.ts} +3 -2
  120. package/src/game-logic/reducers/{purchaseForest.test.js → purchaseForest.test.tsx} +6 -2
  121. package/src/game-logic/reducers/{purchaseForest.js → purchaseForest.ts} +3 -2
  122. package/src/game-logic/reducers/{rotateNotificationLogs.js → rotateNotificationLogs.ts} +1 -1
  123. package/src/game-logic/reducers/{sellCow.test.js → sellCow.test.ts} +3 -3
  124. package/src/game-logic/reducers/{sellItem.test.js → sellItem.test.ts} +0 -3
  125. package/src/game-logic/reducers/{sellKeg.js → sellKeg.ts} +0 -1
  126. package/src/game-logic/reducers/{spawnWeeds.js → spawnWeeds.ts} +1 -0
  127. package/src/game-logic/reducers/{updateAchievements.js → updateAchievements.ts} +10 -9
  128. package/src/game-logic/reducers/{updatePeer.test.js → updatePeer.test.ts} +0 -4
  129. package/src/game-logic/reducers/{updatePeer.js → updatePeer.ts} +1 -0
  130. package/src/game-logic/reducers/{updatePlotShoveledState.test.js → updatePlotShoveledState.test.ts} +0 -1
  131. package/src/handlers/{peer-events.js → peer-events.ts} +9 -3
  132. package/src/handlers/{ui-events.test.js → ui-events.test.ts} +2 -0
  133. package/src/handlers/{ui-events.js → ui-events.tsx} +107 -25
  134. package/src/{index.js → index.tsx} +2 -0
  135. package/src/scripts/{generate-crop-table.js → generate-crop-table.ts} +5 -4
  136. package/src/services/{cellar.test.js → cellar.test.ts} +1 -1
  137. package/src/services/{wine.js → wine.ts} +1 -0
  138. package/src/shell/{notifications.test.js → notifications.test.ts} +19 -13
  139. package/src/{templates.js → templates.ts} +8 -0
  140. package/src/test-utils/{index.js → index.ts} +3 -3
  141. package/src/test-utils/stubs/{getKegStub.js → getKegStub.ts} +1 -0
  142. package/src/utils/{farmProductsSold.js → farmProductsSold.tsx} +2 -0
  143. package/src/utils/{getCropLifecycleDuration.js → getCropLifecycleDuration.ts} +1 -0
  144. package/src/utils/{getCropsAvailableToFerment.js → getCropsAvailableToFerment.ts} +1 -0
  145. package/src/utils/{getInventoryQuantityMap.js → getInventoryQuantityMap.ts} +1 -0
  146. package/src/utils/{getLevelEntitlements.js → getLevelEntitlements.ts} +4 -0
  147. package/src/utils/{getMaxYieldOfFermentationRecipe.js → getMaxYieldOfFermentationRecipe.ts} +1 -0
  148. package/src/utils/{getWineVarietiesAvailableToMake.js → getWineVarietiesAvailableToMake.ts} +2 -0
  149. package/src/utils/{index.test.js → index.test.ts} +0 -2
  150. package/src/utils/{index.js → index.tsx} +31 -18
  151. package/src/utils/{isItemAFarmProduct.js → isItemAFarmProduct.ts} +1 -1
  152. package/src/utils/{memoize.js → memoize.ts} +2 -0
  153. package/src/utils/{totalIngredientsInRecipe.js → totalIngredientsInRecipe.ts} +2 -0
  154. /package/src/common/{constants.js → constants.ts} +0 -0
  155. /package/src/common/services/{randomNumber.test.js → randomNumber.test.ts} +0 -0
  156. /package/src/common/{utils.test.js → utils.test.ts} +0 -0
  157. /package/src/components/AccountingView/{AccountingView.test.js → AccountingView.test.tsx} +0 -0
  158. /package/src/components/AccountingView/{index.js → index.ts} +0 -0
  159. /package/src/components/Achievement/{Achievement.test.js → Achievement.test.tsx} +0 -0
  160. /package/src/components/Achievement/{Achievement.js → Achievement.tsx} +0 -0
  161. /package/src/components/Achievement/{index.js → index.ts} +0 -0
  162. /package/src/components/AchievementsView/{AchievementsView.test.js → AchievementsView.test.tsx} +0 -0
  163. /package/src/components/AchievementsView/{index.js → index.ts} +0 -0
  164. /package/src/components/AnimatedNumber/{AnimatedNumber.test.js → AnimatedNumber.test.tsx} +0 -0
  165. /package/src/components/AnimatedNumber/{index.js → index.ts} +0 -0
  166. /package/src/components/AppBar/{AppBar.test.js → AppBar.test.tsx} +0 -0
  167. /package/src/components/AppBar/{index.js → index.ts} +0 -0
  168. /package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.test.js → BailOutErrorBoundary.test.tsx} +0 -0
  169. /package/src/components/BailOutErrorBoundary/{index.js → index.ts} +0 -0
  170. /package/src/components/Cellar/{Cellar.js → Cellar.tsx} +0 -0
  171. /package/src/components/Cellar/{FermentationTabPanel.js → FermentationTabPanel.tsx} +0 -0
  172. /package/src/components/Cellar/TabPanel/{index.js → index.tsx} +0 -0
  173. /package/src/components/Cellar/{WinemakingTabPanel.js → WinemakingTabPanel.tsx} +0 -0
  174. /package/src/components/Cellar/{index.js → index.ts} +0 -0
  175. /package/src/components/ChatRoom/{ChatRoom.js → ChatRoom.tsx} +0 -0
  176. /package/src/components/ChatRoom/{index.js → index.ts} +0 -0
  177. /package/src/components/ContextPane/{index.js → index.ts} +0 -0
  178. /package/src/components/CowCard/Bloodline/{Bloodline.js → Bloodline.tsx} +0 -0
  179. /package/src/components/CowCard/Bloodline/{index.js → index.ts} +0 -0
  180. /package/src/components/CowCard/{CowCard.test.js → CowCard.test.tsx} +0 -0
  181. /package/src/components/CowCard/Subheader/{Subheader.test.js → Subheader.test.tsx} +0 -0
  182. /package/src/components/CowCard/Subheader/{index.js → index.ts} +0 -0
  183. /package/src/components/CowCard/{index.js → index.ts} +0 -0
  184. /package/src/components/CowPen/{CowPen.js → CowPen.tsx} +0 -0
  185. /package/src/components/CowPen/{index.js → index.ts} +0 -0
  186. /package/src/components/CowPenContextMenu/{CowPenContextMenu.test.js → CowPenContextMenu.test.tsx} +0 -0
  187. /package/src/components/CowPenContextMenu/{CowPenContextMenu.js → CowPenContextMenu.tsx} +0 -0
  188. /package/src/components/CowPenContextMenu/TabPanel/{index.js → index.tsx} +0 -0
  189. /package/src/components/CowPenContextMenu/{index.js → index.ts} +0 -0
  190. /package/src/components/Elements/{index.js → index.ts} +0 -0
  191. /package/src/components/Farmhand/{Farmhand.test.js → Farmhand.test.ts} +0 -0
  192. /package/src/components/Farmhand/{FarmhandReducers.js → FarmhandReducers.tsx} +0 -0
  193. /package/src/components/Farmhand/helpers/{getInventoryQuantities.test.js → getInventoryQuantities.test.ts} +0 -0
  194. /package/src/components/Farmhand/helpers/{getInventoryQuantities.js → getInventoryQuantities.ts} +0 -0
  195. /package/src/components/Farmhand/{index.js → index.ts} +0 -0
  196. /package/src/components/Field/{index.js → index.ts} +0 -0
  197. /package/src/components/Forest/{Forest.js → Forest.tsx} +0 -0
  198. /package/src/components/Forest/{index.js → index.ts} +0 -0
  199. /package/src/components/Home/{Home.test.js → Home.test.tsx} +0 -0
  200. /package/src/components/Home/{index.js → index.ts} +0 -0
  201. /package/src/components/IngredientsList/{IngredientsList.test.js → IngredientsList.test.tsx} +0 -0
  202. /package/src/components/IngredientsList/{IngredientsList.js → IngredientsList.tsx} +0 -0
  203. /package/src/components/IngredientsList/{index.js → index.ts} +0 -0
  204. /package/src/components/Inventory/{Inventory.test.js → Inventory.test.tsx} +0 -0
  205. /package/src/components/Inventory/{index.js → index.ts} +0 -0
  206. /package/src/components/Item/{Item.test.js → Item.test.tsx} +0 -0
  207. /package/src/components/Item/{index.js → index.ts} +0 -0
  208. /package/src/components/KeybindingsView/{KeybindingsView.test.js → KeybindingsView.test.tsx} +0 -0
  209. /package/src/components/KeybindingsView/{KeybindingsView.js → KeybindingsView.tsx} +0 -0
  210. /package/src/components/KeybindingsView/{index.js → index.ts} +0 -0
  211. /package/src/components/LogView/{LogView.test.js → LogView.test.tsx} +0 -0
  212. /package/src/components/LogView/{index.js → index.ts} +0 -0
  213. /package/src/components/Navigation/{DayAndProgressContainer.js → DayAndProgressContainer.tsx} +0 -0
  214. /package/src/components/Navigation/{Navigation.test.js → Navigation.test.tsx} +0 -0
  215. /package/src/components/Navigation/{index.js → index.ts} +0 -0
  216. /package/src/components/NotificationSystem/{NotificationSystem.test.js → NotificationSystem.test.tsx} +0 -0
  217. /package/src/components/NotificationSystem/{index.js → index.ts} +0 -0
  218. /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.test.js → OnlinePeer.test.tsx} +0 -0
  219. /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.js → OnlinePeer.tsx} +0 -0
  220. /package/src/components/OnlinePeersView/OnlinePeer/{index.js → index.ts} +0 -0
  221. /package/src/components/OnlinePeersView/{OnlinePeersView.test.js → OnlinePeersView.test.tsx} +0 -0
  222. /package/src/components/OnlinePeersView/{index.js → index.ts} +0 -0
  223. /package/src/components/Plot/{index.js → index.ts} +0 -0
  224. /package/src/components/PriceEventView/{PriceEventView.js → PriceEventView.tsx} +0 -0
  225. /package/src/components/PriceEventView/{index.js → index.ts} +0 -0
  226. /package/src/components/ProgressBar/{ProgressBar.test.js → ProgressBar.test.tsx} +0 -0
  227. /package/src/components/ProgressBar/{index.js → index.ts} +0 -0
  228. /package/src/components/QuantityInput/{QuantityInput.test.js → QuantityInput.test.tsx} +0 -0
  229. /package/src/components/QuantityInput/{index.js → index.ts} +0 -0
  230. /package/src/components/QuickSelect/{QuickSelect.test.js → QuickSelect.test.tsx} +0 -0
  231. /package/src/components/QuickSelect/{QuickSelect.js → QuickSelect.tsx} +0 -0
  232. /package/src/components/QuickSelect/{index.js → index.ts} +0 -0
  233. /package/src/components/Recipe/{Recipe.test.js → Recipe.test.tsx} +0 -0
  234. /package/src/components/Recipe/{index.js → index.ts} +0 -0
  235. /package/src/components/RecipeList/{RecipeList.js → RecipeList.tsx} +0 -0
  236. /package/src/components/SearchBar/{SearchBar.test.js → SearchBar.test.tsx} +0 -0
  237. /package/src/components/SearchBar/{SearchBar.js → SearchBar.tsx} +0 -0
  238. /package/src/components/SearchBar/{index.js → index.ts} +0 -0
  239. /package/src/components/SettingsView/{RandomSeedInput.test.js → RandomSeedInput.test.tsx} +0 -0
  240. /package/src/components/SettingsView/{SettingsView.test.js → SettingsView.test.tsx} +0 -0
  241. /package/src/components/SettingsView/{SettingsView.js → SettingsView.tsx} +0 -0
  242. /package/src/components/SettingsView/{index.js → index.ts} +0 -0
  243. /package/src/components/Shop/{Shop.test.js → Shop.test.tsx} +0 -0
  244. /package/src/components/Shop/TabPanel/{index.js → index.tsx} +0 -0
  245. /package/src/components/Shop/{index.js → index.ts} +0 -0
  246. /package/src/components/Stage/{index.js → index.ts} +0 -0
  247. /package/src/components/StatsView/{StatsView.test.js → StatsView.test.tsx} +0 -0
  248. /package/src/components/StatsView/{StatsView.js → StatsView.tsx} +0 -0
  249. /package/src/components/StatsView/{index.js → index.ts} +0 -0
  250. /package/src/components/TierPurchase/{TierPurchase.test.js → TierPurchase.test.tsx} +0 -0
  251. /package/src/components/TierPurchase/{index.js → index.ts} +0 -0
  252. /package/src/components/Toolbelt/{Toolbelt.test.js → Toolbelt.test.tsx} +0 -0
  253. /package/src/components/Toolbelt/{index.js → index.ts} +0 -0
  254. /package/src/components/UpdateNotifier/{UpdateNotifier.js → UpdateNotifier.tsx} +0 -0
  255. /package/src/components/UpdateNotifier/{index.js → index.ts} +0 -0
  256. /package/src/components/UpgradePurchase/{UpgradePurchase.test.js → UpgradePurchase.test.tsx} +0 -0
  257. /package/src/components/UpgradePurchase/{index.js → index.ts} +0 -0
  258. /package/src/components/Workshop/{KitchenTabPanel.js → KitchenTabPanel.tsx} +0 -0
  259. /package/src/components/Workshop/{RecyclingTabPanel.js → RecyclingTabPanel.tsx} +0 -0
  260. /package/src/components/Workshop/TabPanel/{index.js → index.tsx} +0 -0
  261. /package/src/components/Workshop/{Workshop.js → Workshop.tsx} +0 -0
  262. /package/src/components/Workshop/{index.js → index.ts} +0 -0
  263. /package/src/{config.js → config.ts} +0 -0
  264. /package/src/data/__mocks__/{items.js → items.ts} +0 -0
  265. /package/src/data/__mocks__/{maps.js → maps.ts} +0 -0
  266. /package/src/data/__mocks__/{recipes.js → recipes.ts} +0 -0
  267. /package/src/data/__mocks__/{shop-inventory.js → shop-inventory.ts} +0 -0
  268. /package/src/data/crops/{index.js → index.ts} +0 -0
  269. /package/src/data/{fruit-names.js → fruit-names.ts} +0 -0
  270. /package/src/data/{items-map.js → items-map.ts} +0 -0
  271. /package/src/data/ores/{index.js → index.ts} +0 -0
  272. /package/src/data/{shop-inventory-cow.js → shop-inventory-cow.ts} +0 -0
  273. /package/src/data/{shop-inventory.js → shop-inventory.ts} +0 -0
  274. /package/src/data/{tools.js → tools.ts} +0 -0
  275. /package/src/factories/{CoalFactory.test.js → CoalFactory.test.ts} +0 -0
  276. /package/src/factories/{OreFactory.test.js → OreFactory.test.ts} +0 -0
  277. /package/src/factories/{StoneFactory.test.js → StoneFactory.test.ts} +0 -0
  278. /package/src/factories/{index.js → index.ts} +0 -0
  279. /package/src/game-logic/cows/{cow-selection.test.js → cow-selection.test.ts} +0 -0
  280. /package/src/game-logic/{item-purchase.test.js → item-purchase.test.ts} +0 -0
  281. /package/src/game-logic/{item-sell.test.js → item-sell.test.ts} +0 -0
  282. /package/src/game-logic/reducers/{addCowToInventory.js → addCowToInventory.ts} +0 -0
  283. /package/src/game-logic/reducers/{addExperience.test.js → addExperience.test.ts} +0 -0
  284. /package/src/game-logic/reducers/{addExperience.js → addExperience.ts} +0 -0
  285. /package/src/game-logic/reducers/{addItemToInventory.test.js → addItemToInventory.test.ts} +0 -0
  286. /package/src/game-logic/reducers/{addItemToInventory.js → addItemToInventory.ts} +0 -0
  287. /package/src/game-logic/reducers/{addKegToCellarInventory.js → addKegToCellarInventory.ts} +0 -0
  288. /package/src/game-logic/reducers/{addPeer.js → addPeer.ts} +0 -0
  289. /package/src/game-logic/reducers/{addRevenue.js → addRevenue.ts} +0 -0
  290. /package/src/game-logic/reducers/{adjustLoan.test.js → adjustLoan.test.ts} +0 -0
  291. /package/src/game-logic/reducers/{adjustLoan.js → adjustLoan.ts} +0 -0
  292. /package/src/game-logic/reducers/{applyCrows.test.js → applyCrows.test.ts} +0 -0
  293. /package/src/game-logic/reducers/{applyLoanInterest.test.js → applyLoanInterest.test.ts} +0 -0
  294. /package/src/game-logic/reducers/{applyPrecipitation.test.js → applyPrecipitation.test.ts} +0 -0
  295. /package/src/game-logic/reducers/{changeCowAutomaticHugState.test.js → changeCowAutomaticHugState.test.ts} +0 -0
  296. /package/src/game-logic/reducers/{changeCowBreedingPenResident.test.js → changeCowBreedingPenResident.test.ts} +0 -0
  297. /package/src/game-logic/reducers/{changeCowBreedingPenResident.js → changeCowBreedingPenResident.ts} +0 -0
  298. /package/src/game-logic/reducers/{changeCowName.test.js → changeCowName.test.ts} +0 -0
  299. /package/src/game-logic/reducers/{changeCowName.js → changeCowName.ts} +0 -0
  300. /package/src/game-logic/reducers/{clearPlot.test.js → clearPlot.test.ts} +0 -0
  301. /package/src/game-logic/reducers/{clearPlot.js → clearPlot.ts} +0 -0
  302. /package/src/game-logic/reducers/{computeCowInventoryForNextDay.test.js → computeCowInventoryForNextDay.test.ts} +0 -0
  303. /package/src/game-logic/reducers/{computeCowInventoryForNextDay.js → computeCowInventoryForNextDay.ts} +0 -0
  304. /package/src/game-logic/reducers/{computeStateForNextDay.test.js → computeStateForNextDay.test.ts} +0 -0
  305. /package/src/game-logic/reducers/{consumeIngredients.test.js → consumeIngredients.test.ts} +0 -0
  306. /package/src/game-logic/reducers/{createPriceEvent.test.js → createPriceEvent.test.ts} +0 -0
  307. /package/src/game-logic/reducers/{createPriceEvent.js → createPriceEvent.ts} +0 -0
  308. /package/src/game-logic/reducers/{decrementItemFromInventory.test.js → decrementItemFromInventory.test.ts} +0 -0
  309. /package/src/game-logic/reducers/{decrementItemFromInventory.js → decrementItemFromInventory.ts} +0 -0
  310. /package/src/game-logic/reducers/{fertilizePlot.test.js → fertilizePlot.test.ts} +0 -0
  311. /package/src/game-logic/reducers/{fertilizePlot.js → fertilizePlot.ts} +0 -0
  312. /package/src/game-logic/reducers/{forRange.test.js → forRange.test.ts} +0 -0
  313. /package/src/game-logic/reducers/{forRange.js → forRange.ts} +0 -0
  314. /package/src/game-logic/reducers/{generatePriceEvents.test.js → generatePriceEvents.test.ts} +0 -0
  315. /package/src/game-logic/reducers/{generatePriceEvents.js → generatePriceEvents.ts} +0 -0
  316. /package/src/game-logic/reducers/{harvestPlot.test.js → harvestPlot.test.ts} +0 -0
  317. /package/src/game-logic/reducers/{helpers.js → helpers.tsx} +0 -0
  318. /package/src/game-logic/reducers/{hugCow.test.js → hugCow.test.ts} +0 -0
  319. /package/src/game-logic/reducers/{hugCow.js → hugCow.ts} +0 -0
  320. /package/src/game-logic/reducers/{incrementPlotContentAge.test.js → incrementPlotContentAge.test.ts} +0 -0
  321. /package/src/game-logic/reducers/{incrementPlotContentAge.js → incrementPlotContentAge.ts} +0 -0
  322. /package/src/game-logic/reducers/{index.js → index.ts} +0 -0
  323. /package/src/game-logic/reducers/{makeFermentationRecipe.test.js → makeFermentationRecipe.test.ts} +0 -0
  324. /package/src/game-logic/reducers/{makeRecipe.js → makeRecipe.ts} +0 -0
  325. /package/src/game-logic/reducers/{minePlot.test.js → minePlot.test.ts} +0 -0
  326. /package/src/game-logic/reducers/{modifyCow.js → modifyCow.ts} +0 -0
  327. /package/src/game-logic/reducers/{modifyFieldPlotAt.js → modifyFieldPlotAt.ts} +0 -0
  328. /package/src/game-logic/reducers/{offerCow.test.js → offerCow.test.ts} +0 -0
  329. /package/src/game-logic/reducers/{offerCow.js → offerCow.ts} +0 -0
  330. /package/src/game-logic/reducers/{plantInPlot.test.js → plantInPlot.test.ts} +0 -0
  331. /package/src/game-logic/reducers/{plantInPlot.js → plantInPlot.ts} +0 -0
  332. /package/src/game-logic/reducers/{prependPendingPeerMessage.test.js → prependPendingPeerMessage.test.ts} +0 -0
  333. /package/src/game-logic/reducers/{prependPendingPeerMessage.js → prependPendingPeerMessage.ts} +0 -0
  334. /package/src/game-logic/reducers/{processCellar.test.js → processCellar.test.ts} +0 -0
  335. /package/src/game-logic/reducers/{processCellar.js → processCellar.ts} +0 -0
  336. /package/src/game-logic/reducers/{processCowAttrition.test.js → processCowAttrition.test.ts} +0 -0
  337. /package/src/game-logic/reducers/{processCowAttrition.js → processCowAttrition.ts} +0 -0
  338. /package/src/game-logic/reducers/{processCowBreeding.test.js → processCowBreeding.test.ts} +0 -0
  339. /package/src/game-logic/reducers/{processCowBreeding.js → processCowBreeding.ts} +0 -0
  340. /package/src/game-logic/reducers/{processCowFertilizerProduction.test.js → processCowFertilizerProduction.test.ts} +0 -0
  341. /package/src/game-logic/reducers/{processFeedingCows.test.js → processFeedingCows.test.ts} +0 -0
  342. /package/src/game-logic/reducers/{processFeedingCows.js → processFeedingCows.ts} +0 -0
  343. /package/src/game-logic/reducers/{processField.js → processField.ts} +0 -0
  344. /package/src/game-logic/reducers/{processLevelUp.test.js → processLevelUp.test.ts} +0 -0
  345. /package/src/game-logic/reducers/{processMilkingCows.test.js → processMilkingCows.test.ts} +0 -0
  346. /package/src/game-logic/reducers/{processMilkingCows.js → processMilkingCows.ts} +0 -0
  347. /package/src/game-logic/reducers/{processNerfs.test.js → processNerfs.test.ts} +0 -0
  348. /package/src/game-logic/reducers/{processNerfs.js → processNerfs.ts} +0 -0
  349. /package/src/game-logic/reducers/{processSprinklers.test.js → processSprinklers.test.ts} +0 -0
  350. /package/src/game-logic/reducers/{processSprinklers.js → processSprinklers.ts} +0 -0
  351. /package/src/game-logic/reducers/{processWeather.test.js → processWeather.test.ts} +0 -0
  352. /package/src/game-logic/reducers/{processWeather.js → processWeather.ts} +0 -0
  353. /package/src/game-logic/reducers/{purchaseCellar.test.js → purchaseCellar.test.ts} +0 -0
  354. /package/src/game-logic/reducers/{purchaseCellar.js → purchaseCellar.ts} +0 -0
  355. /package/src/game-logic/reducers/{purchaseCombine.test.js → purchaseCombine.test.ts} +0 -0
  356. /package/src/game-logic/reducers/{purchaseCombine.js → purchaseCombine.ts} +0 -0
  357. /package/src/game-logic/reducers/{purchaseComposter.test.js → purchaseComposter.test.ts} +0 -0
  358. /package/src/game-logic/reducers/{purchaseComposter.js → purchaseComposter.ts} +0 -0
  359. /package/src/game-logic/reducers/{purchaseCow.test.js → purchaseCow.test.ts} +0 -0
  360. /package/src/game-logic/reducers/{purchaseCow.js → purchaseCow.ts} +0 -0
  361. /package/src/game-logic/reducers/{purchaseCowPen.test.js → purchaseCowPen.test.ts} +0 -0
  362. /package/src/game-logic/reducers/{purchaseCowPen.js → purchaseCowPen.ts} +0 -0
  363. /package/src/game-logic/reducers/{purchaseItem.test.js → purchaseItem.test.ts} +0 -0
  364. /package/src/game-logic/reducers/{purchaseItem.js → purchaseItem.ts} +0 -0
  365. /package/src/game-logic/reducers/{purchaseSmelter.test.js → purchaseSmelter.test.ts} +0 -0
  366. /package/src/game-logic/reducers/{purchaseSmelter.js → purchaseSmelter.ts} +0 -0
  367. /package/src/game-logic/reducers/{purchaseStorageExpansion.test.js → purchaseStorageExpansion.test.ts} +0 -0
  368. /package/src/game-logic/reducers/{purchaseStorageExpansion.js → purchaseStorageExpansion.ts} +0 -0
  369. /package/src/game-logic/reducers/{removeCowFromInventory.js → removeCowFromInventory.ts} +0 -0
  370. /package/src/game-logic/reducers/{removeFieldPlotAt.js → removeFieldPlotAt.ts} +0 -0
  371. /package/src/game-logic/reducers/{removeKegFromCellar.js → removeKegFromCellar.ts} +0 -0
  372. /package/src/game-logic/reducers/{removePeer.js → removePeer.ts} +0 -0
  373. /package/src/game-logic/reducers/{rotateNotificationLogs.test.js → rotateNotificationLogs.test.ts} +0 -0
  374. /package/src/game-logic/reducers/{selectCow.test.js → selectCow.test.ts} +0 -0
  375. /package/src/game-logic/reducers/{selectCow.js → selectCow.ts} +0 -0
  376. /package/src/game-logic/reducers/{sellCow.js → sellCow.ts} +0 -0
  377. /package/src/game-logic/reducers/{sellItem.js → sellItem.ts} +0 -0
  378. /package/src/game-logic/reducers/{sellKeg.test.js → sellKeg.test.ts} +0 -0
  379. /package/src/game-logic/reducers/{setScarecrow.test.js → setScarecrow.test.ts} +0 -0
  380. /package/src/game-logic/reducers/{setScarecrow.js → setScarecrow.ts} +0 -0
  381. /package/src/game-logic/reducers/{setSprinkler.test.js → setSprinkler.test.ts} +0 -0
  382. /package/src/game-logic/reducers/{setSprinkler.js → setSprinkler.ts} +0 -0
  383. /package/src/game-logic/reducers/{showNotification.test.js → showNotification.test.ts} +0 -0
  384. /package/src/game-logic/reducers/{showNotification.js → showNotification.ts} +0 -0
  385. /package/src/game-logic/reducers/{spawnWeeds.test.js → spawnWeeds.test.ts} +0 -0
  386. /package/src/game-logic/reducers/{unlockTool.test.js → unlockTool.test.ts} +0 -0
  387. /package/src/game-logic/reducers/{unlockTool.js → unlockTool.ts} +0 -0
  388. /package/src/game-logic/reducers/{updateAchievements.test.js → updateAchievements.test.ts} +0 -0
  389. /package/src/game-logic/reducers/{updateFinancialRecords.test.js → updateFinancialRecords.test.ts} +0 -0
  390. /package/src/game-logic/reducers/{updateFinancialRecords.js → updateFinancialRecords.ts} +0 -0
  391. /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.test.js → updateInventoryRecordsForNextDay.test.ts} +0 -0
  392. /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.js → updateInventoryRecordsForNextDay.ts} +0 -0
  393. /package/src/game-logic/reducers/{updateLearnedRecipes.test.js → updateLearnedRecipes.test.ts} +0 -0
  394. /package/src/game-logic/reducers/{updateLearnedRecipes.js → updateLearnedRecipes.ts} +0 -0
  395. /package/src/game-logic/reducers/{updatePlotShoveledState.js → updatePlotShoveledState.ts} +0 -0
  396. /package/src/game-logic/reducers/{updatePriceEvents.test.js → updatePriceEvents.test.ts} +0 -0
  397. /package/src/game-logic/reducers/{updatePriceEvents.js → updatePriceEvents.tsx} +0 -0
  398. /package/src/game-logic/reducers/{upgradeTool.test.js → upgradeTool.test.ts} +0 -0
  399. /package/src/game-logic/reducers/{upgradeTool.js → upgradeTool.ts} +0 -0
  400. /package/src/game-logic/reducers/{waterAllPlots.test.js → waterAllPlots.test.ts} +0 -0
  401. /package/src/game-logic/reducers/{waterAllPlots.js → waterAllPlots.ts} +0 -0
  402. /package/src/game-logic/reducers/{waterField.js → waterField.ts} +0 -0
  403. /package/src/game-logic/reducers/{waterPlot.test.js → waterPlot.test.ts} +0 -0
  404. /package/src/game-logic/reducers/{waterPlot.js → waterPlot.ts} +0 -0
  405. /package/src/game-logic/reducers/{withdrawCow.test.js → withdrawCow.test.ts} +0 -0
  406. /package/src/game-logic/reducers/{withdrawCow.js → withdrawCow.ts} +0 -0
  407. /package/src/img/__mocks__/{index.js → index.ts} +0 -0
  408. /package/src/img/{index.js → index.ts} +0 -0
  409. /package/src/interfaces/{Factory.js → Factory.ts} +0 -0
  410. /package/src/{mui-theme.js → mui-theme.ts} +0 -0
  411. /package/src/{polyfills.js → polyfills.ts} +0 -0
  412. /package/src/services/{cellar.js → cellar.ts} +0 -0
  413. /package/src/services/{wine.test.js → wine.test.ts} +0 -0
  414. /package/src/{setupTests.js → setupTests.ts} +0 -0
  415. /package/src/shell/{bootup.test.js → bootup.test.ts} +0 -0
  416. /package/src/shell/{field.test.js → field.test.ts} +0 -0
  417. /package/src/shell/{game-saving.test.js → game-saving.test.ts} +0 -0
  418. /package/src/shell/{navigation.test.js → navigation.test.ts} +0 -0
  419. /package/src/shell/{pending-notifications.test.js → pending-notifications.test.ts} +0 -0
  420. /package/src/{strings.js → strings.ts} +0 -0
  421. /package/src/test-utils/stubs/{cowStub.js → cowStub.ts} +0 -0
  422. /package/src/test-utils/stubs/{farmhandStub.js → farmhandStub.tsx} +0 -0
  423. /package/src/test-utils/stubs/{itemStub.js → itemStub.ts} +0 -0
  424. /package/src/test-utils/stubs/{peerMetadataStub.js → peerMetadataStub.ts} +0 -0
  425. /package/src/test-utils/stubs/{saveDataStubFactory.js → saveDataStubFactory.ts} +0 -0
  426. /package/src/test-utils/{ui.js → ui.ts} +0 -0
  427. /package/src/utils/__snapshots__/{index.test.js.snap → index.test.ts.snap} +0 -0
  428. /package/src/utils/{findInField.test.js → findInField.test.ts} +0 -0
  429. /package/src/utils/{findInField.js → findInField.ts} +0 -0
  430. /package/src/utils/{getCropLifecycleDuration.test.js → getCropLifecycleDuration.test.ts} +0 -0
  431. /package/src/utils/{getCropsAvailableToFerment.test.js → getCropsAvailableToFerment.test.ts} +0 -0
  432. /package/src/utils/{getItemBaseValue.js → getItemBaseValue.ts} +0 -0
  433. /package/src/utils/{getKegSpoilageRate.test.js → getKegSpoilageRate.test.ts} +0 -0
  434. /package/src/utils/{getKegSpoilageRate.js → getKegSpoilageRate.ts} +0 -0
  435. /package/src/utils/{getKegValue.test.js → getKegValue.test.ts} +0 -0
  436. /package/src/utils/{getKegValue.js → getKegValue.ts} +0 -0
  437. /package/src/utils/{getLevelEntitlements.test.js → getLevelEntitlements.test.ts} +0 -0
  438. /package/src/utils/{getMaxYieldOfFermentationRecipe.test.js → getMaxYieldOfFermentationRecipe.test.ts} +0 -0
  439. /package/src/utils/{getSaltRequirementsForFermentationRecipe.js → getSaltRequirementsForFermentationRecipe.ts} +0 -0
  440. /package/src/utils/{getWineVarietiesAvailableToMake.test.js → getWineVarietiesAvailableToMake.test.ts} +0 -0
  441. /package/src/utils/{getYeastRequiredForWine.js → getYeastRequiredForWine.ts} +0 -0
  442. /package/src/utils/{isItemAGrownCrop.js → isItemAGrownCrop.ts} +0 -0
  443. /package/src/utils/{levelAchieved.js → levelAchieved.ts} +0 -0
  444. /package/src/utils/{moneyString.test.js → moneyString.test.ts} +0 -0
  445. /package/src/utils/{moneyString.js → moneyString.ts} +0 -0
  446. /package/src/utils/{noop.js → noop.ts} +0 -0
  447. /package/src/utils/{totalIngredientsInRecipe.test.js → totalIngredientsInRecipe.test.ts} +0 -0
@@ -200,6 +200,7 @@ export const LEVEL_GAINED_NOTIFICATION = (_, newLevel, randomCropSeed) => {
200
200
  itemsMap[itemUnlockLevels[newLevel]].name
201
201
  }**.`
202
202
  )
203
+ // @ts-expect-error
203
204
  } else if (levelObject && levelObject.increasesSprinklerRange) {
204
205
  chunks.push(`Sprinkler range has increased.`)
205
206
  } else if (randomCropSeed) {
@@ -208,11 +209,15 @@ export const LEVEL_GAINED_NOTIFICATION = (_, newLevel, randomCropSeed) => {
208
209
  randomCropSeed.name
209
210
  }** as a reward!`
210
211
  )
212
+ // @ts-expect-error
211
213
  } else if (levelObject && levelObject.unlocksTool) {
214
+ // @ts-expect-error
212
215
  if (levelObject.unlocksTool === toolType.SHOVEL) {
213
216
  chunks.push(SHOVEL_UNLOCKED)
214
217
  }
218
+ // @ts-expect-error
215
219
  } else if (levelObject && levelObject.unlocksStageFocusType) {
220
+ // @ts-expect-error
216
221
  if (levelObject.unlocksStageFocusType === stageFocusType.FOREST) {
217
222
  chunks.push(FOREST_AVAILABLE_NOTIFICATION)
218
223
  }
@@ -240,6 +245,7 @@ export const POSITIONS_POSTED_NOTIFICATION = (_, who, positions) => {
240
245
  const positionKeys = Object.keys(positions)
241
246
 
242
247
  positionKeys.forEach(itemId =>
248
+ // @ts-expect-error
243
249
  (positions[itemId] > 0 ? positivePositions : negativePositions).push(itemId)
244
250
  )
245
251
 
@@ -248,6 +254,7 @@ export const POSITIONS_POSTED_NOTIFICATION = (_, who, positions) => {
248
254
  if (positivePositions.length) {
249
255
  chunks.push('Values raised:')
250
256
  positivePositions.forEach(itemId =>
257
+ // @ts-expect-error
251
258
  chunks.push(` - ${itemsMap[itemId].name}`)
252
259
  )
253
260
  }
@@ -259,6 +266,7 @@ export const POSITIONS_POSTED_NOTIFICATION = (_, who, positions) => {
259
266
 
260
267
  chunks.push('Values lowered:')
261
268
  negativePositions.forEach(itemId =>
269
+ // @ts-expect-error
262
270
  chunks.push(` - ${itemsMap[itemId].name}`)
263
271
  )
264
272
  }
@@ -40,7 +40,7 @@ export const testShoveledPlot = plotProps => ({
40
40
  export const testItem = (item = {}) => ({
41
41
  id: '',
42
42
  name: '',
43
- type: /** @type {farmhand.itemType} */ ('CRAFTED_ITEM'),
43
+ type: /** @type {farmhand.itemType} */ 'CRAFTED_ITEM',
44
44
  value: 0,
45
45
  description: '',
46
46
  doesPriceFluctuate: false,
@@ -62,8 +62,8 @@ export const testRecipe = (overrides = {}) => ({
62
62
  'sample-item-1': 1,
63
63
  },
64
64
  condition: () => true,
65
- recipeType: /** @type {farmhand.recipeType} */ ('KITCHEN'),
66
- type: /** @type {farmhand.itemType} */ ('CRAFTED_ITEM'),
65
+ recipeType: /** @type {farmhand.recipeType} */ 'KITCHEN',
66
+ type: /** @type {farmhand.itemType} */ 'CRAFTED_ITEM',
67
67
  value: 100,
68
68
  ...overrides,
69
69
  })
@@ -12,6 +12,7 @@ export const getKegStub = (overrides = {}) => {
12
12
  return {
13
13
  id: uuid(),
14
14
  itemId: carrot.id,
15
+ // @ts-expect-error
15
16
  daysUntilMature: carrot.daysToFerment ?? 0,
16
17
  ...overrides,
17
18
  }
@@ -3,6 +3,7 @@ import { itemsMap } from '../data/maps.js'
3
3
  import { memoize } from './memoize.js'
4
4
  import { isItemAFarmProduct } from './isItemAFarmProduct.js'
5
5
 
6
+ // @ts-expect-error
6
7
  export const farmProductsSold = memoize(
7
8
  /**
8
9
  * @param {Partial<Record<string, number>>} itemsSold
@@ -11,6 +12,7 @@ export const farmProductsSold = memoize(
11
12
  itemsSold =>
12
13
  Object.entries(itemsSold).reduce(
13
14
  (sum, [itemId, numberSold]) =>
15
+ // @ts-expect-error
14
16
  sum + (isItemAFarmProduct(itemsMap[itemId]) ? numberSold || 0 : 0),
15
17
  0
16
18
  )
@@ -4,6 +4,7 @@ import { memoize } from './memoize.js'
4
4
  * @param {{ cropTimeline: number[] }} crop
5
5
  * @returns {number}
6
6
  */
7
+ // @ts-expect-error
7
8
  export const getCropLifecycleDuration = memoize(({ cropTimeline }) => {
8
9
  return cropTimeline.reduce((acc, value) => {
9
10
  return acc + value
@@ -25,6 +25,7 @@ export function getCropsAvailableToFerment(levelEntitlements) {
25
25
  finalCropItemFromSeedItem &&
26
26
  Number.isFinite(finalCropItemFromSeedItem.daysToFerment)
27
27
  ) {
28
+ // @ts-expect-error
28
29
  acc.push(finalCropItemFromSeedItem)
29
30
  }
30
31
 
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { memoize } from './memoize.js'
5
5
 
6
+ // @ts-expect-error
6
7
  export const getInventoryQuantityMap = memoize(
7
8
  /**
8
9
  * @param {{ id: item['id'], quantity: number }[]} inventory
@@ -9,6 +9,7 @@ import { memoize } from './memoize.js'
9
9
  * @returns {levelEntitlements} Contains `sprinklerRange` and keys that correspond to
10
10
  * unlocked items.
11
11
  */
12
+ // @ts-expect-error
12
13
  export const getLevelEntitlements = memoize(
13
14
  /**
14
15
  * @param {number} levelNumber
@@ -37,14 +38,17 @@ export const getLevelEntitlements = memoize(
37
38
  }
38
39
 
39
40
  if (unlocksShopItem) {
41
+ // @ts-expect-error
40
42
  acc.items[unlocksShopItem] = true
41
43
  }
42
44
 
43
45
  if (unlocksTool) {
46
+ // @ts-expect-error
44
47
  acc.tools[unlocksTool] = true
45
48
  }
46
49
 
47
50
  if (unlocksStageFocusType) {
51
+ // @ts-expect-error
48
52
  acc.stageFocusType[unlocksStageFocusType] = true
49
53
  }
50
54
 
@@ -22,6 +22,7 @@ export const getMaxYieldOfFermentationRecipe = (
22
22
  ) => {
23
23
  const {
24
24
  [fermentationRecipe.id]: itemQuantityInInventory = 0,
25
+ // @ts-expect-error
25
26
  [itemsMap.salt.id]: saltQuantityInInventory = 0,
26
27
  } = getInventoryQuantityMap(inventory)
27
28
 
@@ -18,7 +18,9 @@ const getGrapesSold = itemsSold => {
18
18
  ) => {
19
19
  const item = itemsMap[itemId]
20
20
 
21
+ // @ts-expect-error
21
22
  if ((quantity || 0) > 0 && isGrape(item)) {
23
+ // @ts-expect-error
22
24
  acc.push(item)
23
25
  }
24
26
 
@@ -729,7 +729,6 @@ describe('canMakeRecipe', () => {
729
729
  test('evaluates inventory correctly', () => {
730
730
  expect(
731
731
  canMakeRecipe(
732
- // @ts-expect-error
733
732
  { ingredients: { 'sample-item-1': 2 } },
734
733
  [{ id: 'sample-item-1', quantity: 1 }],
735
734
  1
@@ -742,7 +741,6 @@ describe('canMakeRecipe', () => {
742
741
  test('evaluates inventory correctly', () => {
743
742
  expect(
744
743
  canMakeRecipe(
745
- // @ts-expect-error
746
744
  { ingredients: { 'sample-item-1': 2 } },
747
745
  [{ id: 'sample-item-1', quantity: 2 }],
748
746
  1
@@ -289,6 +289,7 @@ export const getPlotContentType = ({ itemId }) =>
289
289
  export const doesPlotContainCrop = plot =>
290
290
  plot !== null && getPlotContentType(plot) === itemType.CROP
291
291
 
292
+ // @ts-expect-error
292
293
  export const getLifeStageRange = memoize((
293
294
  /** @type {number[]} */ cropTimeline
294
295
  ) => {
@@ -330,7 +331,9 @@ export const getGrowingPhase = memoize(
330
331
  },
331
332
  {
332
333
  cacheSize:
334
+ // @ts-expect-error
333
335
  LARGEST_PURCHASABLE_FIELD_SIZE.columns *
336
+ // @ts-expect-error
334
337
  LARGEST_PURCHASABLE_FIELD_SIZE.rows,
335
338
  }
336
339
  )
@@ -386,7 +389,7 @@ export const getPlotImage = (plotContents, x, y) => {
386
389
  }
387
390
 
388
391
  // Handle other plot content (non-crop, non-weed)
389
- return itemImages[/** @type {farmhand.plotContent} */ (plotContents).itemId]
392
+ return itemImages[/** @type {farmhand.plotContent} */ plotContents.itemId]
390
393
  }
391
394
 
392
395
  if (isShoveledPlot(plotContents)) {
@@ -409,13 +412,12 @@ export const getRangeCoords = (rangeSize, centerX, centerY) => {
409
412
  const rangeStartX = centerX - rangeSize
410
413
  const rangeStartY = centerY - rangeSize
411
414
 
412
- return new Array(squareSize)
413
- .fill(null)
414
- .map((_, y) =>
415
- new Array(squareSize)
416
- .fill(null)
417
- .map((_, x) => ({ x: rangeStartX + x, y: rangeStartY + y }))
418
- )
415
+ return new Array(squareSize).fill(null).map((_, yIndex) =>
416
+ new Array(squareSize).fill(null).map((__, xIndex) => ({
417
+ x: rangeStartX + xIndex,
418
+ y: rangeStartY + yIndex,
419
+ }))
420
+ )
419
421
  }
420
422
 
421
423
  /**
@@ -449,12 +451,14 @@ export const getFinalCropItemIdFromSeedItemId = (
449
451
 
450
452
  export const getSeedItemIdFromFinalStageCropItemId = memoize(
451
453
  /** @type {string} */ cropItemId => {
454
+ // @ts-expect-error
452
455
  const seedItemId = Object.values(itemsMap).find(({ growsInto }) => {
453
456
  if (Array.isArray(growsInto)) {
454
457
  return growsInto.includes(cropItemId)
455
458
  } else {
456
459
  return growsInto === cropItemId
457
460
  }
461
+ // @ts-expect-error
458
462
  })?.id
459
463
 
460
464
  if (!seedItemId)
@@ -494,8 +498,11 @@ export const getCowDisplayName = (cow, playerId, allowCustomPeerCowNames) => {
494
498
  * @returns {farmhand.cow}
495
499
  */
496
500
  export const generateCow = (options = {}) => {
501
+ // @ts-expect-error
497
502
  const gender = options.gender || chooseRandom(Object.values(genders))
503
+ // @ts-expect-error
498
504
  const color = options.color || chooseRandom(Object.values(standardCowColors))
505
+ // @ts-expect-error
499
506
  const id = options.id || uuid()
500
507
 
501
508
  const baseWeight = Math.round(
@@ -560,7 +567,7 @@ export const generateOffspringCow = (cow1, cow2, ownerId, customProps = {}) => {
560
567
  }
561
568
 
562
569
  delete colorsInBloodline[
563
- /** @type {keyof typeof colorsInBloodline} */ (cowColors.RAINBOW)
570
+ /** @type {keyof typeof colorsInBloodline} */ cowColors.RAINBOW
564
571
  ]
565
572
 
566
573
  const isRainbowCow =
@@ -675,6 +682,7 @@ export const getCowSellValue = cow => getCowValue(cow, true)
675
682
  * @param {{id: string, quantity: number}[]} inventory
676
683
  * @returns {number}
677
684
  */
685
+ // @ts-expect-error
678
686
  export const maxYieldOfRecipe = memoize(({ ingredients }, inventory) => {
679
687
  const inventoryQuantityMap = getInventoryQuantityMap(inventory)
680
688
 
@@ -742,6 +750,7 @@ export const doesMenuObstructStage = () => window.innerWidth < BREAKPOINTS.MD
742
750
  /** @type {Set<farmhand.itemType>} */
743
751
  const itemTypesToShowInReverse = new Set([itemType.MILK])
744
752
 
753
+ // @ts-expect-error
745
754
  const sortItemIdsByTypeAndValue = memoize(itemIds =>
746
755
  sortBy(itemIds, [
747
756
  id => Number(itemsMap[id].type !== itemType.CROP),
@@ -763,6 +772,7 @@ export const sortItems = items => {
763
772
  return sortItemIdsByTypeAndValue(items.map(({ id }) => id)).map(id => map[id])
764
773
  }
765
774
 
775
+ // @ts-expect-error
766
776
  export const inventorySpaceConsumed = memoize(
767
777
  /**
768
778
  * @param {farmhand.state['inventory']} inventory
@@ -787,6 +797,7 @@ export const inventorySpaceRemaining = ({ inventory, inventoryLimit }) =>
787
797
  export const doesInventorySpaceRemain = state =>
788
798
  inventorySpaceRemaining(state) > 0
789
799
 
800
+ // @ts-expect-error
790
801
  export const areHuggingMachinesInInventory = memoize(
791
802
  /**
792
803
  * @param {farmhand.state['inventory']} inventory
@@ -806,6 +817,7 @@ export const nullArray = memoize(
806
817
  }
807
818
  )
808
819
 
820
+ // @ts-expect-error
809
821
  export const findCowById = memoize(
810
822
  /**
811
823
  * @param {Array.<farmhand.cow>} cowInventory
@@ -822,6 +834,7 @@ export const findCowById = memoize(
822
834
  export const experienceNeededForLevel = targetLevel =>
823
835
  ((targetLevel - 1) * 10) ** 2
824
836
 
837
+ // @ts-expect-error
825
838
  export const getAvailableShopInventory = memoize((
826
839
  /** @type {farmhand.levelEntitlements} */ levelEntitlements
827
840
  ) =>
@@ -866,7 +879,7 @@ export const getPeerMetadata = state => {
866
879
 
867
880
  return acc
868
881
  },
869
- /** @type {Partial<farmhand.peerMetadata>} */ ({})
882
+ /** @type {Partial<farmhand.peerMetadata>} */ {}
870
883
  )
871
884
 
872
885
  Object.assign(reducedState, {
@@ -875,7 +888,7 @@ export const getPeerMetadata = state => {
875
888
  ),
876
889
  })
877
890
 
878
- return /** @type {farmhand.peerMetadata} */ (reducedState)
891
+ return /** @type {farmhand.peerMetadata} */ reducedState
879
892
  }
880
893
 
881
894
  /**
@@ -884,7 +897,7 @@ export const getPeerMetadata = state => {
884
897
  * farmhand.state data that should be persisted.
885
898
  */
886
899
  export const reduceByPersistedKeys = state =>
887
- /** @type {farmhand.state} */ (PERSISTED_STATE_KEYS.reduce((
900
+ /** @type {farmhand.state} */ PERSISTED_STATE_KEYS.reduce((
888
901
  /** @type {Partial<farmhand.state>} */ acc,
889
902
  key
890
903
  ) => {
@@ -895,7 +908,7 @@ export const reduceByPersistedKeys = state =>
895
908
  }
896
909
 
897
910
  return acc
898
- }, {}))
911
+ }, {})
899
912
 
900
913
  /**
901
914
  * @param {Array.<number>} historicalData Must be no longer than 7 numbers long.
@@ -993,8 +1006,7 @@ export const transformStateDataForImport = /** @type {(state: any) => farmhand.s
993
1006
  ) {
994
1007
  sanitizedState = {
995
1008
  ...sanitizedState,
996
- stageFocus:
997
- /** @type {farmhand.stageFocusType} */ (STANDARD_VIEW_LIST[0]),
1009
+ stageFocus: /** @type {farmhand.stageFocusType} */ STANDARD_VIEW_LIST[0],
998
1010
  }
999
1011
  }
1000
1012
 
@@ -1036,17 +1048,15 @@ export const transformStateDataForImport = /** @type {(state: any) => farmhand.s
1036
1048
  }
1037
1049
 
1038
1050
  // NOTE: Legacy data trasformation for https://github.com/jeremyckahn/farmhand/issues/387
1039
- // @ts-expect-error
1040
1051
  if (sanitizedState.id) {
1041
- // @ts-expect-error
1042
1052
  sanitizedState.playerId = sanitizedState.id
1043
- // @ts-expect-error
1044
1053
  delete sanitizedState.id
1045
1054
  }
1046
1055
 
1047
1056
  return sanitizedState
1048
1057
  }
1049
1058
 
1059
+ // @ts-expect-error
1050
1060
  export const getPlayerName = memoize(
1051
1061
  /**
1052
1062
  * @param {string} playerId
@@ -1114,9 +1124,11 @@ export function randomChoice(weightedOptions) {
1114
1124
 
1115
1125
  for (let option of weightedOptions) {
1116
1126
  totalWeight += option.weight
1127
+ // @ts-expect-error
1117
1128
  sortedOptions.push(option)
1118
1129
  }
1119
1130
 
1131
+ // @ts-expect-error
1120
1132
  sortedOptions.sort(o => o.weight)
1121
1133
 
1122
1134
  let diceRoll = random() * totalWeight
@@ -1147,6 +1159,7 @@ const colorizeCowTemplate = (() => {
1147
1159
  const cachedCowImages = {}
1148
1160
 
1149
1161
  // https://stackoverflow.com/a/5624139
1162
+ // @ts-expect-error
1150
1163
  const hexToRgb = memoize(hex => {
1151
1164
  const [, r, g, b] = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(
1152
1165
  hex
@@ -17,5 +17,5 @@ const FARM_PRODUCT_TYPES = [
17
17
  export const isItemAFarmProduct = item =>
18
18
  Boolean(
19
19
  isItemAGrownCrop(item) ||
20
- FARM_PRODUCT_TYPES.includes(/** @type {any} */ (item.type))
20
+ FARM_PRODUCT_TYPES.includes(/** @type {any} */ item.type)
21
21
  )
@@ -21,6 +21,7 @@ export class MemoizeCache {
21
21
  * @see https://github.com/caiogondim/fast-memoize.js
22
22
  */
23
23
  constructor({ cacheSize = MEMOIZE_CACHE_CLEAR_THRESHOLD } = {}) {
24
+ // @ts-expect-error
24
25
  this.cacheSize = cacheSize
25
26
  }
26
27
 
@@ -33,6 +34,7 @@ export class MemoizeCache {
33
34
  }
34
35
 
35
36
  set(key, value) {
37
+ // @ts-expect-error
36
38
  if (Object.keys(this.cache).length > this.cacheSize) {
37
39
  this.cache = {}
38
40
  }
@@ -1,7 +1,9 @@
1
1
  export function totalIngredientsInRecipe(recipe, amount = 1) {
2
2
  return (
3
3
  amount *
4
+ // @ts-expect-error
4
5
  Object.values(recipe.ingredients).reduce(
6
+ // @ts-expect-error
5
7
  (acc, quantity) => acc + quantity,
6
8
  0
7
9
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes