From cb0c41770b85dbf2bb79e17adc4d9ea3e093a552 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Sat, 18 May 2024 22:52:23 +0530 Subject: [PATCH 1/2] build: enable consistent type imports rule --- .eslintrc.cjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 0185bc50..1eaf5e40 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -48,6 +48,14 @@ module.exports = { plugins: ['@deities'], rules: { '@typescript-eslint/array-type': [2, { default: 'generic' }], + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + disallowTypeAnnotations: false, + fixStyle: 'separate-type-imports', + prefer: 'type-imports', + }, + ], '@typescript-eslint/no-restricted-imports': [ 2, { From 5cf2c33d585e82c5596917ed5e7dcc714d684024 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Sat, 18 May 2024 22:53:11 +0530 Subject: [PATCH 2/2] auto fix type imports --- apollo/Action.tsx | 26 +++++------ apollo/ActionResponse.tsx | 23 +++++----- apollo/CharacterMessage.tsx | 5 ++- apollo/Condition.tsx | 6 +-- apollo/Effects.tsx | 31 ++++++------- apollo/GameOver.tsx | 15 +++---- apollo/HiddenAction.tsx | 15 ++++--- apollo/MapMetadata.tsx | 2 +- apollo/Types.tsx | 20 +++++---- apollo/action-mutators/ActionMutators.tsx | 6 +-- apollo/actions/applyActionResponse.tsx | 6 +-- apollo/actions/applyEndTurnActionResponse.tsx | 4 +- apollo/actions/encodeGameActionResponse.tsx | 18 ++++---- apollo/actions/executeGameAction.tsx | 13 +++--- apollo/actions/validateAction.tsx | 2 +- .../attack-direction/getAttackDirection.tsx | 2 +- apollo/lib/applyConditions.tsx | 11 ++--- apollo/lib/checkWinCondition.tsx | 15 ++++--- apollo/lib/computeVisibleActions.tsx | 14 +++--- apollo/lib/decodeGameActionResponse.tsx | 2 +- apollo/lib/dropLabelsFromActionResponse.tsx | 4 +- apollo/lib/dropLabelsFromGameState.tsx | 4 +- apollo/lib/gameHasEnded.tsx | 2 +- apollo/lib/getActionResponseVectors.tsx | 8 ++-- apollo/lib/getColorName.tsx | 2 +- apollo/lib/getMessageKey.tsx | 4 +- apollo/lib/getVisibleEntities.tsx | 14 +++--- apollo/lib/getWinningTeam.tsx | 6 +-- apollo/lib/hasTimer.tsx | 2 +- apollo/lib/mapWithAIPlayers.tsx | 2 +- apollo/lib/maybeDecodeActionResponse.tsx | 6 +-- apollo/lib/processRewards.tsx | 6 +-- apollo/lib/timeoutActionResponseMutator.tsx | 2 +- apollo/lib/transformEffectValue.tsx | 10 ++--- apollo/lib/updateVisibleEntities.tsx | 12 ++--- apollo/push/Types.tsx | 2 +- apollo/routes/getCampaignRoute.tsx | 2 +- apollo/routes/getMapRoute.tsx | 2 +- apollo/routes/getUserRoute.tsx | 2 +- apollo/socket/Types.tsx | 4 +- art/BiomeVariants.tsx | 5 ++- art/Sprites.tsx | 12 ++--- art/VariantConfiguration.tsx | 12 +++-- art/Variants.tsx | 10 ++--- athena/MapData.tsx | 43 ++++++++---------- athena/Radius.tsx | 11 ++--- athena/Vision.tsx | 6 +-- athena/WinConditions.tsx | 16 +++---- athena/generator/MapGenerator.tsx | 11 ++--- athena/info/Building.tsx | 17 ++++--- athena/info/Decorator.tsx | 10 ++--- athena/info/MovementType.tsx | 2 +- athena/info/Skill.tsx | 15 ++++--- athena/info/Tile.tsx | 5 ++- athena/info/Unit.tsx | 19 ++++---- athena/info/UnitNames.tsx | 8 ++-- athena/lib/__tests__/assignUnitNames.test.tsx | 3 +- .../__tests__/determineUnitsToCreate.test.tsx | 3 +- athena/lib/__tests__/validateTeams.test.tsx | 3 +- athena/lib/assignUnitNames.tsx | 5 ++- athena/lib/calculateClusters.tsx | 4 +- athena/lib/calculateDamage.tsx | 7 +-- athena/lib/calculateEmptyClusters.tsx | 2 +- athena/lib/calculateFunds.tsx | 5 ++- athena/lib/calculateLikelyDamage.tsx | 8 ++-- athena/lib/canBuild.tsx | 7 +-- athena/lib/canDeploy.tsx | 6 +-- athena/lib/canLoad.tsx | 6 +-- athena/lib/canPlaceDecorator.tsx | 4 +- athena/lib/canPlaceLightning.tsx | 4 +- athena/lib/canPlaceRailTrack.tsx | 4 +- athena/lib/canPlaceTile.tsx | 7 ++- athena/lib/convertBiome.tsx | 6 +-- athena/lib/determineUnitsToCreate.tsx | 12 ++--- athena/lib/dropInactivePlayers.tsx | 2 +- athena/lib/dropLabels.tsx | 2 +- .../encodedMapDataHasHiddenWinCondition.tsx | 2 +- athena/lib/filterNullables.tsx | 2 +- athena/lib/followMovementPath.tsx | 6 +-- athena/lib/formatText.tsx | 3 +- athena/lib/getActivePlayers.tsx | 4 +- athena/lib/getAllUnitsToRefill.tsx | 8 ++-- athena/lib/getAttackStatusEffect.tsx | 6 +-- athena/lib/getAttackableEntitiesInRange.tsx | 6 +-- athena/lib/getAvailableUnitActions.tsx | 10 ++--- athena/lib/getBiomeStyle.tsx | 2 +- athena/lib/getBuildableUnits.tsx | 6 +-- athena/lib/getChargeValue.tsx | 5 ++- athena/lib/getDecoratorIndex.tsx | 4 +- athena/lib/getDecoratorsAtField.tsx | 7 +-- athena/lib/getDefenseStatusEffect.tsx | 7 +-- athena/lib/getDeployableVectors.tsx | 8 ++-- athena/lib/getFirstHumanPlayer.tsx | 2 +- athena/lib/getFloatingEdgeModifier.tsx | 8 ++-- athena/lib/getHealCost.tsx | 4 +- athena/lib/getHealableVectors.tsx | 4 +- athena/lib/getLeaders.tsx | 7 +-- athena/lib/getModifier.tsx | 8 ++-- athena/lib/getMovementPath.tsx | 8 ++-- athena/lib/getParentToMoveTo.tsx | 8 ++-- athena/lib/getPathFields.tsx | 4 +- athena/lib/getRescuableVectors.tsx | 4 +- athena/lib/getSabotageableVectors.tsx | 4 +- athena/lib/getUnitValue.tsx | 4 +- athena/lib/getUnitsByPositions.tsx | 6 +-- athena/lib/getUnitsToHealOnBuildings.tsx | 5 ++- athena/lib/getUnitsToRefill.tsx | 11 ++--- athena/lib/getVectorRadius.tsx | 4 +- athena/lib/hasLeader.tsx | 9 ++-- athena/lib/hasLowAmmoSupply.tsx | 2 +- athena/lib/indexToVector.tsx | 2 +- athena/lib/isAmphibiousOnLand.tsx | 6 ++- athena/lib/isFuelConsumingUnit.tsx | 5 ++- athena/lib/isPvP.tsx | 2 +- athena/lib/matchesActiveType.tsx | 6 +-- athena/lib/matchesPlayerList.tsx | 2 +- athena/lib/maybeConvertPlayer.tsx | 2 +- athena/lib/mergeTeams.tsx | 4 +- athena/lib/refillUnits.tsx | 4 +- athena/lib/removeLeader.tsx | 9 ++-- athena/lib/resizeMap.tsx | 9 ++-- athena/lib/shouldRemoveUnit.tsx | 8 ++-- athena/lib/singleTilesToModifiers.tsx | 2 +- athena/lib/startGame.tsx | 2 +- athena/lib/updateActivePlayers.tsx | 6 ++- athena/lib/updatePlayer.tsx | 4 +- athena/lib/updatePlayers.tsx | 4 +- athena/lib/validateMap.tsx | 23 +++++----- athena/lib/validateSkills.tsx | 5 ++- athena/lib/validateTeams.tsx | 5 ++- athena/lib/verifyTiles.tsx | 7 +-- athena/lib/withModifiers.tsx | 2 +- athena/map/Building.tsx | 14 +++--- athena/map/Configuration.tsx | 2 +- athena/map/Entity.tsx | 10 ++--- athena/map/PlainMap.tsx | 14 +++--- athena/map/Player.tsx | 7 ++- athena/map/Reward.tsx | 3 +- athena/map/Serialization.tsx | 31 +++++++------ athena/map/Team.tsx | 5 ++- athena/map/Unit.tsx | 20 ++++----- athena/map/isPlayable.tsx | 6 ++- athena/mutation/toggleLightningTile.tsx | 4 +- athena/mutation/writeTile.tsx | 11 ++--- codegen/generate-actions.tsx | 4 +- codegen/generate-routes.tsx | 4 +- codegen/generate-translations.tsx | 2 +- codegen/lib/traverse.tsx | 8 +--- dionysus/AIRegistry.tsx | 2 +- dionysus/BaseAI.tsx | 13 +++--- dionysus/DionysusAlpha.tsx | 14 +++--- dionysus/lib/estimateClosestTarget.tsx | 14 +++--- dionysus/lib/findPathToTarget.tsx | 9 ++-- dionysus/lib/getAttackableArea.tsx | 4 +- .../lib/getAttackableUnitsWithinRadius.tsx | 6 +-- dionysus/lib/getBuildingWeight.tsx | 8 +--- dionysus/lib/getInterestingVectors.tsx | 6 +-- .../lib/getInterestingVectorsByAbilities.tsx | 9 ++-- dionysus/lib/getPossibleAttacks.tsx | 17 ++++--- dionysus/lib/getPossibleUnitAbilities.tsx | 7 +-- dionysus/lib/getUnitInfosWithMaxVision.tsx | 2 +- dionysus/lib/getWinConditionVectors.tsx | 6 +-- dionysus/lib/needsSupply.tsx | 2 +- dionysus/lib/shouldAttack.tsx | 8 ++-- dionysus/lib/shouldCaptureBuilding.tsx | 8 ++-- dionysus/lib/sortByDamage.tsx | 10 ++--- dionysus/lib/sortPossibleAttacks.tsx | 2 +- docs/content/examples/map-editor.tsx | 2 +- docs/content/playground/PlaygroundGame.tsx | 4 +- hera/Building.tsx | 12 ++--- hera/Cursor.tsx | 2 +- hera/Decorators.tsx | 8 ++-- hera/Fog.tsx | 8 ++-- hera/GameMap.tsx | 32 +++++++------- hera/Label.tsx | 3 +- hera/Map.tsx | 30 ++++++------- hera/MapAnimations.tsx | 34 ++++++++------ hera/Mask.tsx | 25 +++++------ hera/MaskWithSubtiles.tsx | 6 +-- hera/Radius.tsx | 14 +++--- hera/Tick.tsx | 3 +- hera/TileDecorator.tsx | 6 +-- hera/TileDecorators.tsx | 10 ++--- hera/Tiles.tsx | 10 ++--- hera/Types.tsx | 44 ++++++++++--------- hera/Unit.tsx | 21 ++++----- hera/action-response/ActionResponseError.tsx | 4 +- .../action-response/processActionResponse.tsx | 17 ++++--- hera/animations/Animation.tsx | 14 +++--- hera/animations/AttackAnimation.tsx | 16 ++++--- hera/animations/BuildingCreate.tsx | 7 +-- hera/animations/Explosion.tsx | 16 ++++--- hera/animations/Fireworks.tsx | 5 ++- hera/animations/Heal.tsx | 5 ++- hera/animations/HealthAnimation.tsx | 6 +-- hera/animations/Rescue.tsx | 7 +-- hera/animations/Sabotage.tsx | 5 ++- hera/animations/Shake.tsx | 4 +- hera/animations/Spawn.tsx | 7 +-- hera/animations/UpgradeAnimation.tsx | 7 +-- hera/animations/addExplosionAnimation.tsx | 14 +++--- hera/animations/attackActionAnimation.tsx | 10 ++--- hera/animations/attackFlashAnimation.tsx | 6 +-- hera/animations/explosionAnimation.tsx | 11 ++--- hera/animations/generateFrames.tsx | 2 +- hera/animations/secretDiscoveredAnimation.tsx | 4 +- hera/audio/LoggedOutVolumeControl.tsx | 2 +- hera/audio/Music.tsx | 5 ++- hera/audio/VolumeControl.tsx | 6 ++- hera/behavior/AbstractSelectBehavior.tsx | 10 ++--- hera/behavior/Attack.tsx | 6 +-- hera/behavior/AttackRadius.tsx | 4 +- hera/behavior/Base.tsx | 11 ++--- hera/behavior/Behavior.tsx | 4 +- hera/behavior/BuySkills.tsx | 2 +- hera/behavior/CreateBuilding.tsx | 9 ++-- hera/behavior/CreateUnit.tsx | 16 +++---- hera/behavior/DropUnit.tsx | 6 +-- hera/behavior/Heal.tsx | 4 +- hera/behavior/Menu.tsx | 12 ++--- hera/behavior/Move.tsx | 10 ++--- hera/behavior/Radar.tsx | 4 +- hera/behavior/Rescue.tsx | 4 +- hera/behavior/Sabotage.tsx | 4 +- hera/behavior/Transport.tsx | 8 ++-- .../activatePower/activatePowerAction.tsx | 11 ++--- hera/behavior/attack/AttackSelector.tsx | 15 ++++--- hera/behavior/attack/attackAction.tsx | 9 ++-- hera/behavior/attack/clientAttackAction.tsx | 15 ++++--- .../behavior/attack/getAttackableEntities.tsx | 8 ++-- hera/behavior/attack/getDamageColor.tsx | 2 +- hera/behavior/attack/hiddenAttackActions.tsx | 6 +-- hera/behavior/buySkill/buySkillAction.tsx | 4 +- hera/behavior/capture/captureAction.tsx | 10 ++--- hera/behavior/confirm/ConfirmAction.tsx | 10 ++--- .../createBuilding/createBuildingAction.tsx | 13 ++++-- .../createTracks/createTracksAction.tsx | 4 +- hera/behavior/createUnit/createUnitAction.tsx | 4 +- hera/behavior/drop/dropUnitAction.tsx | 6 +-- hera/behavior/endTurn/canEndTurn.tsx | 2 +- hera/behavior/endTurn/endTurnAction.tsx | 2 +- hera/behavior/heal/healAction.tsx | 8 ++-- hera/behavior/move/clientMoveAction.tsx | 12 ++--- hera/behavior/move/hiddenMoveAction.tsx | 15 ++++--- hera/behavior/move/moveAction.tsx | 8 ++-- hera/behavior/move/syncMoveAction.tsx | 12 ++--- hera/behavior/radar/toggleLightningAction.tsx | 6 +-- hera/behavior/rescue/rescueAction.tsx | 10 ++--- hera/behavior/sabotage/sabotageAction.tsx | 8 ++-- hera/behavior/unfold/unfoldAction.tsx | 8 ++-- hera/bottom-drawer/BottomDrawer.tsx | 2 +- hera/campaign/CampaignEditor.tsx | 30 ++++++------- hera/campaign/EffectDialogue.tsx | 8 ++-- hera/campaign/Level.tsx | 17 ++++--- hera/campaign/LevelDialogue.tsx | 4 +- hera/campaign/Types.tsx | 10 ++--- hera/campaign/hooks/useEffectCharacters.tsx | 2 +- hera/campaign/lib/getAllEffectCharacters.tsx | 4 +- hera/campaign/lib/sortByDepth.tsx | 2 +- .../panels/CampaignEditorControlPanel.tsx | 13 +++--- .../panels/CampaignEditorSettingsPanel.tsx | 14 +++--- hera/card/AttributeGrid.tsx | 2 +- hera/card/BuildingCard.tsx | 14 +++--- hera/card/CardTitle.tsx | 4 +- hera/card/InlineTileList.tsx | 27 ++++-------- hera/card/LeaderCard.tsx | 4 +- hera/card/LeaderTitle.tsx | 2 +- hera/card/MovementBox.tsx | 6 +-- hera/card/Range.tsx | 2 +- hera/card/TileBox.tsx | 2 +- hera/card/TileCard.tsx | 14 +++--- hera/card/TilePreview.tsx | 6 +-- hera/card/UnitCard.tsx | 39 +++++++--------- hera/card/lib/tileFieldHasDecorator.tsx | 5 ++- hera/character/MiniPortrait.tsx | 9 ++-- hera/character/Portrait.tsx | 8 ++-- hera/editor/MapEditor.tsx | 33 +++++++------- hera/editor/ResizeHandle.tsx | 11 ++--- hera/editor/Types.tsx | 16 +++---- hera/editor/behavior/DesignBehavior.tsx | 20 ++++----- hera/editor/behavior/EntityBehavior.tsx | 13 +++--- hera/editor/behavior/VectorBehavior.tsx | 6 +-- hera/editor/lib/AIBehaviorLink.tsx | 7 +-- hera/editor/lib/ActionCard.tsx | 15 ++++--- hera/editor/lib/BiomeIcon.tsx | 2 +- hera/editor/lib/EffectTitle.tsx | 10 +++-- hera/editor/lib/WinConditionCard.tsx | 4 +- hera/editor/lib/ZoomButton.tsx | 2 +- hera/editor/lib/canFillTile.tsx | 3 +- hera/editor/lib/changePlayer.tsx | 9 ++-- hera/editor/lib/getMapValidationErrorText.tsx | 2 +- hera/editor/lib/hasGameEndCondition.tsx | 2 +- hera/editor/lib/navigate.tsx | 2 +- hera/editor/lib/selectWinConditionEffect.tsx | 7 +-- hera/editor/lib/tileFieldHasAnimation.tsx | 3 +- hera/editor/lib/updateUndoStack.tsx | 6 ++- hera/editor/panels/DecoratorPanel.tsx | 10 ++--- hera/editor/panels/DesignPanel.tsx | 21 ++++----- hera/editor/panels/EffectsPanel.tsx | 13 +++--- hera/editor/panels/EntityPanel.tsx | 15 ++++--- hera/editor/panels/EvaluationPanel.tsx | 8 ++-- hera/editor/panels/MapEditorControlPanel.tsx | 16 ++++--- hera/editor/panels/MapEditorSettingsPanel.tsx | 6 +-- hera/editor/panels/RestrictionsPanel.tsx | 15 ++++--- hera/editor/panels/SetupPanel.tsx | 10 +++-- hera/editor/panels/WinConditionPanel.tsx | 6 +-- hera/editor/selectors/BiomeSelector.tsx | 4 +- .../editor/selectors/EditorPlayerSelector.tsx | 7 +-- hera/editor/selectors/EffectSelector.tsx | 4 +- hera/editor/selectors/LabelSelector.tsx | 9 ++-- hera/hooks/useClientGame.tsx | 8 ++-- hera/hooks/useClientGameAction.tsx | 18 ++++---- hera/hooks/useEffects.tsx | 3 +- hera/hooks/useHide.tsx | 9 +--- hera/hooks/useUserMap.tsx | 6 +-- hera/i18n/getCampaignMessage.tsx | 2 +- hera/i18n/getLocale.tsx | 2 +- hera/i18n/injectTranslation.tsx | 2 +- hera/i18n/intlList.tsx | 3 +- hera/lib/addEndTurnAnimations.tsx | 14 +++--- hera/lib/addFlashAnimation.tsx | 10 ++--- hera/lib/addMoveAnimation.tsx | 4 +- hera/lib/addPlayerLoseAnimation.tsx | 8 ++-- hera/lib/animateHeal.tsx | 8 ++-- hera/lib/animateSupply.tsx | 8 ++-- hera/lib/attackSpriteHasVariants.tsx | 4 +- hera/lib/botToUser.tsx | 6 +-- hera/lib/explodeUnits.tsx | 4 +- hera/lib/getAnyBuildingTileField.tsx | 5 ++- hera/lib/getAnyUnitTile.tsx | 2 +- hera/lib/getBuildingSpritePosition.tsx | 5 ++- hera/lib/getFlashDelay.tsx | 4 +- hera/lib/getPlayerDefeatedMessage.tsx | 4 +- hera/lib/getSkillConfigForDisplay.tsx | 6 +-- hera/lib/getTranslatedColorName.tsx | 2 +- hera/lib/getTranslatedEntityName.tsx | 3 +- hera/lib/getTranslatedFactionName.tsx | 4 +- hera/lib/getTranslatedTileTypeName.tsx | 3 +- hera/lib/getTranslatedTimerName.tsx | 2 +- hera/lib/getUnitDirection.tsx | 4 +- hera/lib/isFakeEndTurn.tsx | 2 +- hera/lib/maskClassName.tsx | 2 +- hera/lib/sleep.tsx | 4 +- hera/lib/spawn.tsx | 8 ++-- hera/lib/sprite.tsx | 4 +- hera/lib/startGameAnimation.tsx | 4 +- hera/lib/throwActionError.tsx | 2 +- hera/lib/tick.tsx | 2 +- hera/lib/toTransformOrigin.tsx | 4 +- hera/lib/upgradeUnits.tsx | 4 +- hera/render/Images.tsx | 2 +- hera/render/renderFloatingTile.tsx | 10 +++-- hera/render/renderTile.tsx | 12 ++--- hera/ui/AISelector.tsx | 2 +- hera/ui/ActionBar.tsx | 2 +- hera/ui/ActionWheel.tsx | 24 +++++----- hera/ui/AdminActions.tsx | 5 ++- hera/ui/Banner.tsx | 13 +++--- hera/ui/CharacterMessage.tsx | 10 +++-- hera/ui/CurrentGameCard.tsx | 10 ++--- hera/ui/EntityPickerFlyout.tsx | 13 +++--- hera/ui/ErrorOverlay.tsx | 2 +- hera/ui/FlashFlyout.tsx | 11 ++--- hera/ui/Flyout.tsx | 10 +++-- hera/ui/GameActions.tsx | 17 +++---- hera/ui/GameDialog.tsx | 17 +++---- hera/ui/MapDetails.tsx | 4 +- hera/ui/MapInfo.tsx | 27 +++++------- hera/ui/Message.tsx | 4 +- hera/ui/MiniPlayerIcon.tsx | 2 +- hera/ui/ModeSelectButton.tsx | 10 +++-- hera/ui/Notice.tsx | 7 +-- hera/ui/Notification.tsx | 3 +- hera/ui/PlayerCard.tsx | 12 ++--- hera/ui/PlayerIcon.tsx | 2 +- hera/ui/PlayerPosition.tsx | 3 +- hera/ui/PlayerSelector.tsx | 15 ++++--- hera/ui/ReplayBar.tsx | 5 ++- hera/ui/SelectEntity.tsx | 8 ++-- hera/ui/SkillDescription.tsx | 20 +++++---- hera/ui/SkillDialog.tsx | 14 +++--- hera/ui/TeamSelector.tsx | 18 +++----- hera/ui/UILabel.tsx | 2 +- hera/ui/demo/UnitPreviews.tsx | 7 +-- hera/ui/lib/formatCharacterText.tsx | 8 ++-- hera/ui/lib/getClientCoordinates.tsx | 2 +- hera/ui/lib/useSkipAnimation.tsx | 4 +- .../WinConditionDescription.tsx | 4 +- hera/win-conditions/WinConditionTitle.tsx | 3 +- hermes/Types.tsx | 6 +-- hermes/game/onGameEnd.tsx | 7 +-- hermes/game/toClientGame.tsx | 8 ++-- hermes/getCampaignLevelDepths.tsx | 2 +- hermes/map-fixtures/demo-1.tsx | 2 +- hermes/map-fixtures/demo-2.tsx | 2 +- hermes/map-fixtures/demo-3.tsx | 2 +- hermes/map-fixtures/shrine.tsx | 2 +- .../map-fixtures/they-are-close-to-home.tsx | 2 +- hermes/toCampaign.tsx | 2 +- hermes/toLevelMap.tsx | 2 +- hermes/toPlainCampaign.tsx | 2 +- hermes/toPlainLevelList.tsx | 2 +- hermes/unrollCampaign.tsx | 2 +- hermes/validateCampaign.tsx | 2 +- infra/startServer.tsx | 3 +- tests/__tests__/Effects.test.tsx | 2 +- tests/__tests__/HaltingProblem.test.tsx | 7 +-- tests/__tests__/Reward.test.tsx | 2 +- tests/__tests__/Spawn.test.tsx | 2 +- tests/__tests__/Unit.test.tsx | 4 +- tests/executeGameActions.tsx | 13 +++--- tests/printGameState.tsx | 2 +- tests/screenshot.tsx | 9 ++-- tests/snapshotEncodedActionResponse.tsx | 2 +- tests/snapshotGameState.tsx | 2 +- ui/ActiveLink.tsx | 5 ++- ui/App.tsx | 2 +- ui/AudioPlayer.tsx | 2 +- ui/Box.tsx | 6 ++- ui/Button.tsx | 8 ++-- ui/ClearableInput.tsx | 9 +--- ui/Container.tsx | 6 ++- ui/Dialog.tsx | 3 +- ui/ErrorText.tsx | 3 +- ui/ExpandableMenuButton.tsx | 9 +--- ui/Form.tsx | 9 +--- ui/Icon.tsx | 3 +- ui/InlineLink.tsx | 9 ++-- ui/Link.tsx | 4 +- ui/Menu.tsx | 2 +- ui/MenuButton.tsx | 3 +- ui/Navigate.tsx | 4 +- ui/PageTransition.tsx | 3 +- ui/Portal.tsx | 2 +- ui/PrimaryExpandableMenuButton.tsx | 2 +- ui/ScrollContainer.tsx | 2 +- ui/Select.tsx | 2 +- ui/Slider.tsx | 3 +- ui/Stack.tsx | 2 +- ui/Tag.tsx | 2 +- ui/TagInput.tsx | 3 +- ui/Typeahead.tsx | 8 +--- ui/controls/dynamicThrottle.tsx | 2 +- ui/controls/setupGamePad.tsx | 11 ++--- ui/controls/setupKeyboard.tsx | 3 +- ui/controls/useAcceptNavigation.tsx | 2 +- ui/controls/useActive.tsx | 2 +- ui/controls/useBack.tsx | 2 +- ui/controls/useBlockInput.tsx | 3 +- ui/controls/useDirectionalNavigation.tsx | 2 +- ui/controls/useHorizontalMenuNavigation.tsx | 2 +- ui/controls/useHorizontalNavigation.tsx | 2 +- ui/controls/useInput.tsx | 3 +- ui/controls/useMenuNavigation.tsx | 2 +- ui/getColor.tsx | 2 +- ui/gradient.tsx | 3 +- ui/hooks/useAlert.tsx | 4 +- ui/hooks/useNavigate.tsx | 5 ++- ui/hooks/usePress.tsx | 7 +-- ui/hooks/useScale.tsx | 9 +--- ui/hooks/useScrollIntoView.tsx | 3 +- ui/hooks/useScrollRestore.tsx | 10 +---- ui/lib/getGameRoute.tsx | 2 +- ui/lib/getTagColor.tsx | 3 +- ui/lib/lazy.tsx | 3 +- 465 files changed, 1742 insertions(+), 1673 deletions(-) diff --git a/apollo/Action.tsx b/apollo/Action.tsx index 4f86e79b..28a0d58f 100644 --- a/apollo/Action.tsx +++ b/apollo/Action.tsx @@ -5,7 +5,8 @@ import { Skill, } from '@deities/athena/info/Skill.tsx'; import { Lightning } from '@deities/athena/info/Tile.tsx'; -import { Ability, getUnitInfo, Weapon } from '@deities/athena/info/Unit.tsx'; +import type { Weapon } from '@deities/athena/info/Unit.tsx'; +import { Ability, getUnitInfo } from '@deities/athena/info/Unit.tsx'; import { getDeterministicUnitName } from '@deities/athena/info/UnitNames.tsx'; import calculateDamage from '@deities/athena/lib/calculateDamage.tsx'; import calculateFunds from '@deities/athena/lib/calculateFunds.tsx'; @@ -25,7 +26,7 @@ import getRescuableVectors from '@deities/athena/lib/getRescuableVectors.tsx'; import getSabotageableVectors from '@deities/athena/lib/getSabotageableVectors.tsx'; import getUnitsToRefill from '@deities/athena/lib/getUnitsToRefill.tsx'; import { AIBehavior } from '@deities/athena/map/AIBehavior.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import { BuildingCover, Charge, @@ -34,19 +35,16 @@ import { MinDamage, RaisedCounterAttack, } from '@deities/athena/map/Configuration.tsx'; -import { - DynamicPlayerID, - PlayerID, - resolveDynamicPlayerID, -} from '@deities/athena/map/Player.tsx'; -import { Teams } from '@deities/athena/map/Team.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { DynamicPlayerID, PlayerID } from '@deities/athena/map/Player.tsx'; +import { resolveDynamicPlayerID } from '@deities/athena/map/Player.tsx'; +import type { Teams } from '@deities/athena/map/Team.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { getPathCost, moveable } from '@deities/athena/Radius.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; -import ImmutableMap from '@nkzw/immutable-map'; -import { ActionResponse } from './ActionResponse.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; +import type ImmutableMap from '@nkzw/immutable-map'; +import type { ActionResponse } from './ActionResponse.tsx'; import applyActionResponse from './actions/applyActionResponse.tsx'; export type MutateActionResponseFn = (action: ActionResponse) => ActionResponse; diff --git a/apollo/ActionResponse.tsx b/apollo/ActionResponse.tsx index edb354c1..4214ab7e 100644 --- a/apollo/ActionResponse.tsx +++ b/apollo/ActionResponse.tsx @@ -1,14 +1,15 @@ -import { Skill } from '@deities/athena/info/Skill.tsx'; -import Building from '@deities/athena/map/Building.tsx'; -import { DynamicPlayerID, PlayerID } from '@deities/athena/map/Player.tsx'; -import { Reward } from '@deities/athena/map/Reward.tsx'; -import { Teams } from '@deities/athena/map/Team.tsx'; -import Unit, { DryUnit } from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import { WinCondition } from '@deities/athena/WinConditions.tsx'; -import ImmutableMap from '@nkzw/immutable-map'; -import { GameOverActionResponses } from './GameOver.tsx'; -import { HiddenActionResponse } from './HiddenAction.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type { DynamicPlayerID, PlayerID } from '@deities/athena/map/Player.tsx'; +import type { Reward } from '@deities/athena/map/Reward.tsx'; +import type { Teams } from '@deities/athena/map/Team.tsx'; +import type { DryUnit } from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { WinCondition } from '@deities/athena/WinConditions.tsx'; +import type ImmutableMap from '@nkzw/immutable-map'; +import type { GameOverActionResponses } from './GameOver.tsx'; +import type { HiddenActionResponse } from './HiddenAction.tsx'; export type MoveActionResponse = Readonly<{ completed?: boolean; diff --git a/apollo/CharacterMessage.tsx b/apollo/CharacterMessage.tsx index e5918cea..71cd6ffa 100644 --- a/apollo/CharacterMessage.tsx +++ b/apollo/CharacterMessage.tsx @@ -1,5 +1,6 @@ -import { getUnitInfoOrThrow, UnitInfo } from '@deities/athena/info/Unit.tsx'; -import { DynamicPlayerID } from '@deities/athena/map/Player.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import { getUnitInfoOrThrow } from '@deities/athena/info/Unit.tsx'; +import type { DynamicPlayerID } from '@deities/athena/map/Player.tsx'; export default function CharacterMessage( unit: UnitInfo | number, diff --git a/apollo/Condition.tsx b/apollo/Condition.tsx index 3e4fa54c..133216f5 100644 --- a/apollo/Condition.tsx +++ b/apollo/Condition.tsx @@ -1,9 +1,9 @@ import { getUnitInfo } from '@deities/athena/info/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { WinCriteria } from '@deities/athena/WinConditions.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { ActionResponse } from './ActionResponse.tsx'; +import type { ActionResponse } from './ActionResponse.tsx'; import transformEffectValue from './lib/transformEffectValue.tsx'; export type WinConditionID = 'win' | 'lose' | 'draw' | number; diff --git a/apollo/Effects.tsx b/apollo/Effects.tsx index 6e1fb2bc..3bdaca8a 100644 --- a/apollo/Effects.tsx +++ b/apollo/Effects.tsx @@ -1,17 +1,17 @@ -import { - PlayerIDs, - PlayerIDSet, - toPlayerIDs, -} from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { Actions, executeEffect } from './Action.tsx'; -import { ActionResponse, ActionResponseType } from './ActionResponse.tsx'; +import type { PlayerIDs, PlayerIDSet } from '@deities/athena/map/Player.tsx'; +import { toPlayerIDs } from '@deities/athena/map/Player.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { Actions } from './Action.tsx'; +import { executeEffect } from './Action.tsx'; +import type { ActionResponse, ActionResponseType } from './ActionResponse.tsx'; import validateAction from './actions/validateAction.tsx'; -import { - Conditions, - evaluateCondition, - validateCondition, -} from './Condition.tsx'; +import type { Conditions } from './Condition.tsx'; +import { evaluateCondition, validateCondition } from './Condition.tsx'; +import type { + EncodedActionResponseType, + EncodedActions, + EncodedConditions, +} from './EncodedActions.tsx'; import { decodeActionID, decodeActions, @@ -19,12 +19,9 @@ import { encodeActionID, encodeActions, encodeCondition, - EncodedActionResponseType, - EncodedActions, - EncodedConditions, } from './EncodedActions.tsx'; import transformEffectValue from './lib/transformEffectValue.tsx'; -import { GameStateWithEffects } from './Types.tsx'; +import type { GameStateWithEffects } from './Types.tsx'; export type Effect = Readonly<{ actions: Actions; diff --git a/apollo/GameOver.tsx b/apollo/GameOver.tsx index bea10e61..4c2a7494 100644 --- a/apollo/GameOver.tsx +++ b/apollo/GameOver.tsx @@ -1,17 +1,16 @@ import matchesPlayerList from '@deities/athena/lib/matchesPlayerList.tsx'; import { AllowedMisses } from '@deities/athena/map/Configuration.tsx'; import type Player from '@deities/athena/map/Player.tsx'; -import { - PlayerID, - resolveDynamicPlayerID, -} from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { resolveDynamicPlayerID } from '@deities/athena/map/Player.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import Vision from '@deities/athena/Vision.tsx'; -import { WinCondition, WinCriteria } from '@deities/athena/WinConditions.tsx'; +import type { WinCondition } from '@deities/athena/WinConditions.tsx'; +import { WinCriteria } from '@deities/athena/WinConditions.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import { EndTurnAction } from './action-mutators/ActionMutators.tsx'; import { execute } from './Action.tsx'; -import { +import type { ActionResponse, AttackBuildingActionResponse, AttackUnitActionResponse, @@ -22,7 +21,7 @@ import checkWinConditions, { shouldCheckDefaultWinConditions, } from './lib/checkWinCondition.tsx'; import { processRewards } from './lib/processRewards.tsx'; -import { GameState, MutableGameState } from './Types.tsx'; +import type { GameState, MutableGameState } from './Types.tsx'; export type AttackUnitGameOverActionResponse = Readonly<{ fromPlayer: PlayerID; diff --git a/apollo/HiddenAction.tsx b/apollo/HiddenAction.tsx index 129e5292..3abaa28b 100644 --- a/apollo/HiddenAction.tsx +++ b/apollo/HiddenAction.tsx @@ -1,11 +1,12 @@ import updatePlayer from '@deities/athena/lib/updatePlayer.tsx'; -import Building from '@deities/athena/map/Building.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Unit, { DryUnit } from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; -import { AttackDirection } from './attack-direction/getAttackDirection.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { DryUnit } from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; +import type { AttackDirection } from './attack-direction/getAttackDirection.tsx'; export type HiddenMoveActionResponse = Readonly<{ completed?: boolean; diff --git a/apollo/MapMetadata.tsx b/apollo/MapMetadata.tsx index 3a684a0e..5d44d5df 100644 --- a/apollo/MapMetadata.tsx +++ b/apollo/MapMetadata.tsx @@ -1,4 +1,4 @@ -import { Effects } from './Effects.tsx'; +import type { Effects } from './Effects.tsx'; export type MapMetadata = Readonly<{ effects?: Effects; diff --git a/apollo/Types.tsx b/apollo/Types.tsx index 90e70a86..9e929171 100644 --- a/apollo/Types.tsx +++ b/apollo/Types.tsx @@ -1,12 +1,14 @@ -import Building, { PlainBuilding } from '@deities/athena/map/Building.tsx'; -import { PlainEntitiesList } from '@deities/athena/map/PlainMap.tsx'; -import Unit, { PlainUnit } from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import ImmutableMap from '@nkzw/immutable-map'; -import { ActionResponse } from './ActionResponse.tsx'; -import { Effects } from './Effects.tsx'; -import { EncodedActionResponse } from './EncodedActions.tsx'; +import type { PlainBuilding } from '@deities/athena/map/Building.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type { PlainEntitiesList } from '@deities/athena/map/PlainMap.tsx'; +import type { PlainUnit } from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type ImmutableMap from '@nkzw/immutable-map'; +import type { ActionResponse } from './ActionResponse.tsx'; +import type { Effects } from './Effects.tsx'; +import type { EncodedActionResponse } from './EncodedActions.tsx'; export type GameStateEntry = readonly [ActionResponse, MapData]; export type GameState = ReadonlyArray; diff --git a/apollo/action-mutators/ActionMutators.tsx b/apollo/action-mutators/ActionMutators.tsx index 84a66ae9..ab3ab7fb 100644 --- a/apollo/action-mutators/ActionMutators.tsx +++ b/apollo/action-mutators/ActionMutators.tsx @@ -1,6 +1,6 @@ -import { Skill } from '@deities/athena/info/Skill.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; export const MoveAction = ( from: Vector, diff --git a/apollo/actions/applyActionResponse.tsx b/apollo/actions/applyActionResponse.tsx index 0614f0c5..62d392ef 100644 --- a/apollo/actions/applyActionResponse.tsx +++ b/apollo/actions/applyActionResponse.tsx @@ -15,12 +15,12 @@ import { HealAmount, MaxHealth, } from '@deities/athena/map/Configuration.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import toggleLightningTile from '@deities/athena/mutation/toggleLightningTile.tsx'; import writeTile from '@deities/athena/mutation/writeTile.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { ActionResponse } from '../ActionResponse.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; import { applyGameOverActionResponse } from '../GameOver.tsx'; import { applyHiddenActionResponse } from '../HiddenAction.tsx'; import applyEndTurnActionResponse from './applyEndTurnActionResponse.tsx'; diff --git a/apollo/actions/applyEndTurnActionResponse.tsx b/apollo/actions/applyEndTurnActionResponse.tsx index 682a3261..67858fd6 100644 --- a/apollo/actions/applyEndTurnActionResponse.tsx +++ b/apollo/actions/applyEndTurnActionResponse.tsx @@ -9,8 +9,8 @@ import { isHumanPlayer, resolveDynamicPlayerID, } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { EndTurnActionResponse } from '../ActionResponse.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { EndTurnActionResponse } from '../ActionResponse.tsx'; import getColorName from '../lib/getColorName.tsx'; import nameGenerator from '../lib/nameGenerator.tsx'; diff --git a/apollo/actions/encodeGameActionResponse.tsx b/apollo/actions/encodeGameActionResponse.tsx index 8b616ba1..4bc1188b 100644 --- a/apollo/actions/encodeGameActionResponse.tsx +++ b/apollo/actions/encodeGameActionResponse.tsx @@ -1,16 +1,18 @@ -import Building, { PlainBuilding } from '@deities/athena/map/Building.tsx'; -import { PlainEntitiesList } from '@deities/athena/map/PlainMap.tsx'; +import type { PlainBuilding } from '@deities/athena/map/Building.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type { PlainEntitiesList } from '@deities/athena/map/PlainMap.tsx'; import { encodeEntities } from '@deities/athena/map/Serialization.tsx'; -import Unit, { PlainUnit } from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type { PlainUnit } from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import ImmutableMap from '@nkzw/immutable-map'; -import { ActionResponse } from '../ActionResponse.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; import { encodeActionResponse } from '../EncodedActions.tsx'; import computeVisibleActions from '../lib/computeVisibleActions.tsx'; import getVisibleEntities from '../lib/getVisibleEntities.tsx'; -import { +import type { EncodedGameActionResponse, EncodedGameActionResponseItem, GameState, diff --git a/apollo/actions/executeGameAction.tsx b/apollo/actions/executeGameAction.tsx index c844677c..8e602f08 100644 --- a/apollo/actions/executeGameAction.tsx +++ b/apollo/actions/executeGameAction.tsx @@ -1,11 +1,12 @@ -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; -import { Action, execute, MutateActionResponseFn } from '../Action.tsx'; -import { ActionResponse } from '../ActionResponse.tsx'; -import { Effects } from '../Effects.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; +import type { Action, MutateActionResponseFn } from '../Action.tsx'; +import { execute } from '../Action.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; +import type { Effects } from '../Effects.tsx'; import applyConditions from '../lib/applyConditions.tsx'; import gameHasEnded from '../lib/gameHasEnded.tsx'; -import { GameState } from '../Types.tsx'; +import type { GameState } from '../Types.tsx'; type AIType = { act(map: MapData): MapData | null; diff --git a/apollo/actions/validateAction.tsx b/apollo/actions/validateAction.tsx index 2505e7dd..f6046de0 100644 --- a/apollo/actions/validateAction.tsx +++ b/apollo/actions/validateAction.tsx @@ -2,7 +2,7 @@ import { getUnitInfo } from '@deities/athena/info/Unit.tsx'; import { MaxMessageLength } from '@deities/athena/map/Configuration.tsx'; import { toDynamicPlayerID } from '@deities/athena/map/Player.tsx'; import sanitizeText from '@deities/hephaestus/sanitizeText.tsx'; -import { Action } from '../Action.tsx'; +import type { Action } from '../Action.tsx'; export default function validateAction(action: Action) { if (action.type !== 'CharacterMessageEffect') { diff --git a/apollo/attack-direction/getAttackDirection.tsx b/apollo/attack-direction/getAttackDirection.tsx index 10e3d5a7..eba0d0a0 100644 --- a/apollo/attack-direction/getAttackDirection.tsx +++ b/apollo/attack-direction/getAttackDirection.tsx @@ -1,5 +1,5 @@ import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; export type PlainAttackDirection = 0 | 1 | 2 | 3; diff --git a/apollo/lib/applyConditions.tsx b/apollo/lib/applyConditions.tsx index ce976d4f..de915d6a 100644 --- a/apollo/lib/applyConditions.tsx +++ b/apollo/lib/applyConditions.tsx @@ -1,9 +1,10 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { ActionResponse } from '../ActionResponse.tsx'; -import { applyEffects, Effects } from '../Effects.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; +import type { Effects } from '../Effects.tsx'; +import { applyEffects } from '../Effects.tsx'; import { checkGameOverConditions } from '../GameOver.tsx'; -import { GameState, GameStateWithEffects } from '../Types.tsx'; +import type { GameState, GameStateWithEffects } from '../Types.tsx'; const getLosingPlayer = (gameState: GameState): PlayerID | null => { for (const [actionResponse, map] of gameState) { diff --git a/apollo/lib/checkWinCondition.tsx b/apollo/lib/checkWinCondition.tsx index 9c276c63..c99f0bed 100644 --- a/apollo/lib/checkWinCondition.tsx +++ b/apollo/lib/checkWinCondition.tsx @@ -1,16 +1,17 @@ import matchesPlayerList from '@deities/athena/lib/matchesPlayerList.tsx'; -import Entity from '@deities/athena/map/Entity.tsx'; -import { PlayerID, PlayerIDSet } from '@deities/athena/map/Player.tsx'; -import Unit, { TransportedUnit } from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import type { PlayerID, PlayerIDSet } from '@deities/athena/map/Player.tsx'; +import type { TransportedUnit } from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { WinCondition } from '@deities/athena/WinConditions.tsx'; import { onlyHasDefaultWinCondition, - WinCondition, WinCriteria, } from '@deities/athena/WinConditions.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; -import { ActionResponse } from '../ActionResponse.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; const destructiveActions = new Set([ 'AttackUnit', diff --git a/apollo/lib/computeVisibleActions.tsx b/apollo/lib/computeVisibleActions.tsx index 0cfa7f79..de117767 100644 --- a/apollo/lib/computeVisibleActions.tsx +++ b/apollo/lib/computeVisibleActions.tsx @@ -1,13 +1,13 @@ import getAllUnitsToRefill from '@deities/athena/lib/getAllUnitsToRefill.tsx'; import getMovementPath from '@deities/athena/lib/getMovementPath.tsx'; import getUnitsToRefill from '@deities/athena/lib/getUnitsToRefill.tsx'; -import Entity from '@deities/athena/map/Entity.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { moveable } from '@deities/athena/Radius.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; -import { +import type { VisionT } from '@deities/athena/Vision.tsx'; +import type { ActionResponse, ActionResponses, AttackBuildingActionResponse, @@ -27,7 +27,7 @@ import { ToggleLightningActionResponse, } from '../ActionResponse.tsx'; import getAttackDirection from '../attack-direction/getAttackDirection.tsx'; -import { +import type { HiddenDestroyedBuildingActionResponse, HiddenMoveActionResponse, HiddenSourceAttackBuildingActionResponse, @@ -35,7 +35,7 @@ import { HiddenTargetAttackBuildingActionResponse, HiddenTargetAttackUnitActionResponse, } from '../HiddenAction.tsx'; -import { GameState } from '../Types.tsx'; +import type { GameState } from '../Types.tsx'; const completeUnit = ({ from }: { from: Vector }) => ({ diff --git a/apollo/lib/decodeGameActionResponse.tsx b/apollo/lib/decodeGameActionResponse.tsx index 0a5f6157..2b2b8a47 100644 --- a/apollo/lib/decodeGameActionResponse.tsx +++ b/apollo/lib/decodeGameActionResponse.tsx @@ -3,7 +3,7 @@ import { decodeUnits, } from '@deities/athena/map/Serialization.tsx'; import { decodeActionResponse } from '../EncodedActions.tsx'; -import { +import type { EncodedGameActionResponseWithError, GameActionResponse, } from '../Types.tsx'; diff --git a/apollo/lib/dropLabelsFromActionResponse.tsx b/apollo/lib/dropLabelsFromActionResponse.tsx index dce83c52..a519351d 100644 --- a/apollo/lib/dropLabelsFromActionResponse.tsx +++ b/apollo/lib/dropLabelsFromActionResponse.tsx @@ -1,6 +1,6 @@ -import { PlayerIDSet } from '@deities/athena/map/Player.tsx'; +import type { PlayerIDSet } from '@deities/athena/map/Player.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { ActionResponse } from '../ActionResponse.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; export default function dropLabelsFromActionResponse( actionResponse: ActionResponse, diff --git a/apollo/lib/dropLabelsFromGameState.tsx b/apollo/lib/dropLabelsFromGameState.tsx index d32f169f..3ef9501c 100644 --- a/apollo/lib/dropLabelsFromGameState.tsx +++ b/apollo/lib/dropLabelsFromGameState.tsx @@ -1,5 +1,5 @@ -import { PlayerIDSet } from '@deities/athena/map/Player.tsx'; -import { GameState } from '../Types.tsx'; +import type { PlayerIDSet } from '@deities/athena/map/Player.tsx'; +import type { GameState } from '../Types.tsx'; import dropLabelsFromActionResponse from './dropLabelsFromActionResponse.tsx'; export default function dropLabelsFromGameState( diff --git a/apollo/lib/gameHasEnded.tsx b/apollo/lib/gameHasEnded.tsx index aabc31ff..eb90cc0a 100644 --- a/apollo/lib/gameHasEnded.tsx +++ b/apollo/lib/gameHasEnded.tsx @@ -1,4 +1,4 @@ -import { ActionResponse } from '../ActionResponse.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; export default function gameHasEnded( gameState: ReadonlyArray]> | null, diff --git a/apollo/lib/getActionResponseVectors.tsx b/apollo/lib/getActionResponseVectors.tsx index 6fc47dba..2d0717ae 100644 --- a/apollo/lib/getActionResponseVectors.tsx +++ b/apollo/lib/getActionResponseVectors.tsx @@ -1,10 +1,10 @@ import getAverageVector from '@deities/athena/lib/getAverageVector.tsx'; -import Entity from '@deities/athena/map/Entity.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; import { resolveDynamicPlayerID } from '@deities/athena/map/Player.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { ActionResponse } from '../ActionResponse.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; export default function getActionResponseVectors( map: MapData, diff --git a/apollo/lib/getColorName.tsx b/apollo/lib/getColorName.tsx index 612d755e..b748c66d 100644 --- a/apollo/lib/getColorName.tsx +++ b/apollo/lib/getColorName.tsx @@ -1,4 +1,4 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; const NAMES: Record = { 0: 'Neutral', diff --git a/apollo/lib/getMessageKey.tsx b/apollo/lib/getMessageKey.tsx index 680bd69c..38b29333 100644 --- a/apollo/lib/getMessageKey.tsx +++ b/apollo/lib/getMessageKey.tsx @@ -1,6 +1,6 @@ import jenkinsHash from '@deities/hephaestus/jenkinsHash.tsx'; -import { CharacterMessageEffectAction } from '../Action.tsx'; -import { CharacterMessageActionResponse } from '../ActionResponse.tsx'; +import type { CharacterMessageEffectAction } from '../Action.tsx'; +import type { CharacterMessageActionResponse } from '../ActionResponse.tsx'; export default function getMessageKey( action: CharacterMessageEffectAction | CharacterMessageActionResponse, diff --git a/apollo/lib/getVisibleEntities.tsx b/apollo/lib/getVisibleEntities.tsx index d77f313e..43c360d1 100644 --- a/apollo/lib/getVisibleEntities.tsx +++ b/apollo/lib/getVisibleEntities.tsx @@ -1,10 +1,10 @@ -import Building from '@deities/athena/map/Building.tsx'; -import Entity from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; -import ImmutableMap from '@nkzw/immutable-map'; +import type Building from '@deities/athena/map/Building.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; +import type ImmutableMap from '@nkzw/immutable-map'; const equals = (a: Entity | undefined, b: Entity) => { return ( diff --git a/apollo/lib/getWinningTeam.tsx b/apollo/lib/getWinningTeam.tsx index 2c7750d7..5bddb5f0 100644 --- a/apollo/lib/getWinningTeam.tsx +++ b/apollo/lib/getWinningTeam.tsx @@ -1,6 +1,6 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { GameEndActionResponse } from '../GameOver.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { GameEndActionResponse } from '../GameOver.tsx'; export default function getWinningTeam( map: MapData, diff --git a/apollo/lib/hasTimer.tsx b/apollo/lib/hasTimer.tsx index de431c84..bd91473c 100644 --- a/apollo/lib/hasTimer.tsx +++ b/apollo/lib/hasTimer.tsx @@ -1,5 +1,5 @@ import isPvP from '@deities/athena/lib/isPvP.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; export default function hasTimer( game: T & { diff --git a/apollo/lib/mapWithAIPlayers.tsx b/apollo/lib/mapWithAIPlayers.tsx index d5ad298e..bfbd33f2 100644 --- a/apollo/lib/mapWithAIPlayers.tsx +++ b/apollo/lib/mapWithAIPlayers.tsx @@ -1,6 +1,6 @@ import updatePlayers from '@deities/athena/lib/updatePlayers.tsx'; import { Bot } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import getColorName from './getColorName.tsx'; import nameGenerator from './nameGenerator.tsx'; diff --git a/apollo/lib/maybeDecodeActionResponse.tsx b/apollo/lib/maybeDecodeActionResponse.tsx index 662b83e2..6260dd0d 100644 --- a/apollo/lib/maybeDecodeActionResponse.tsx +++ b/apollo/lib/maybeDecodeActionResponse.tsx @@ -1,7 +1,5 @@ -import { - decodeActionResponse, - EncodedActionResponse, -} from '../EncodedActions.tsx'; +import type { EncodedActionResponse } from '../EncodedActions.tsx'; +import { decodeActionResponse } from '../EncodedActions.tsx'; export default function maybeDecodeActionResponse( lastAction: string | EncodedActionResponse | null | undefined, diff --git a/apollo/lib/processRewards.tsx b/apollo/lib/processRewards.tsx index ffa7fef3..0279f475 100644 --- a/apollo/lib/processRewards.tsx +++ b/apollo/lib/processRewards.tsx @@ -1,9 +1,9 @@ -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { WinCriteria } from '@deities/athena/WinConditions.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import applyActionResponse from '../actions/applyActionResponse.tsx'; -import { GameEndActionResponse } from '../GameOver.tsx'; -import { GameState, MutableGameState } from '../Types.tsx'; +import type { GameEndActionResponse } from '../GameOver.tsx'; +import type { GameState, MutableGameState } from '../Types.tsx'; import getWinningTeam from './getWinningTeam.tsx'; export function processRewards( diff --git a/apollo/lib/timeoutActionResponseMutator.tsx b/apollo/lib/timeoutActionResponseMutator.tsx index a546a072..cde82154 100644 --- a/apollo/lib/timeoutActionResponseMutator.tsx +++ b/apollo/lib/timeoutActionResponseMutator.tsx @@ -1,4 +1,4 @@ -import { ActionResponse } from '../ActionResponse.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; export default function (actionResponse: ActionResponse) { return actionResponse.type === 'EndTurn' diff --git a/apollo/lib/transformEffectValue.tsx b/apollo/lib/transformEffectValue.tsx index d9b0595d..e9529e27 100644 --- a/apollo/lib/transformEffectValue.tsx +++ b/apollo/lib/transformEffectValue.tsx @@ -1,12 +1,12 @@ import { getUnitInfoOrThrow } from '@deities/athena/info/Unit.tsx'; import getDeployableVectors from '@deities/athena/lib/getDeployableVectors.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import randomEntry from '@deities/hephaestus/randomEntry.tsx'; -import { Action } from '../Action.tsx'; -import { ActionResponse } from '../ActionResponse.tsx'; -import { Condition } from '../Condition.tsx'; +import type { Action } from '../Action.tsx'; +import type { ActionResponse } from '../ActionResponse.tsx'; +import type { Condition } from '../Condition.tsx'; type Mutable = { -readonly [Key in keyof T]: T[Key]; diff --git a/apollo/lib/updateVisibleEntities.tsx b/apollo/lib/updateVisibleEntities.tsx index 9e243659..e15ce644 100644 --- a/apollo/lib/updateVisibleEntities.tsx +++ b/apollo/lib/updateVisibleEntities.tsx @@ -1,9 +1,9 @@ -import Building from '@deities/athena/map/Building.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; -import ImmutableMap from '@nkzw/immutable-map'; +import type Building from '@deities/athena/map/Building.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; +import type ImmutableMap from '@nkzw/immutable-map'; export default function updateVisibleEntities( currentMap: MapData, diff --git a/apollo/push/Types.tsx b/apollo/push/Types.tsx index 64604466..354b297a 100644 --- a/apollo/push/Types.tsx +++ b/apollo/push/Types.tsx @@ -1,4 +1,4 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; type BaseNotification = Readonly<{ body: string; diff --git a/apollo/routes/getCampaignRoute.tsx b/apollo/routes/getCampaignRoute.tsx index 3be7650c..0d1a6511 100644 --- a/apollo/routes/getCampaignRoute.tsx +++ b/apollo/routes/getCampaignRoute.tsx @@ -1,4 +1,4 @@ -import { Route, UserCampaignRoute } from '../Routes.tsx'; +import type { Route, UserCampaignRoute } from '../Routes.tsx'; export default function getCampaignRoute( slug: string, diff --git a/apollo/routes/getMapRoute.tsx b/apollo/routes/getMapRoute.tsx index 0364cb47..dfbf50fb 100644 --- a/apollo/routes/getMapRoute.tsx +++ b/apollo/routes/getMapRoute.tsx @@ -1,4 +1,4 @@ -import { Route, UserMapRoute } from '../Routes.tsx'; +import type { Route, UserMapRoute } from '../Routes.tsx'; export default function getMapRoute(slug: string, route?: UserMapRoute): Route { return `/${slug}${route ? '/' + route : ''}` as Route; diff --git a/apollo/routes/getUserRoute.tsx b/apollo/routes/getUserRoute.tsx index 74868f68..db02c98c 100644 --- a/apollo/routes/getUserRoute.tsx +++ b/apollo/routes/getUserRoute.tsx @@ -1,4 +1,4 @@ -import { Route, UserRoute } from '../Routes.tsx'; +import type { Route, UserRoute } from '../Routes.tsx'; export default function getUserRoute( username: string, diff --git a/apollo/socket/Types.tsx b/apollo/socket/Types.tsx index b6b05812..3828f685 100644 --- a/apollo/socket/Types.tsx +++ b/apollo/socket/Types.tsx @@ -1,5 +1,5 @@ -import { EncodedAction } from '../EncodedActions.tsx'; -import { EncodedGameActionResponseWithError } from '../Types.tsx'; +import type { EncodedAction } from '../EncodedActions.tsx'; +import type { EncodedGameActionResponseWithError } from '../Types.tsx'; export type ClientToServerEvents = { '/campaign-state/reset': (campaignStateID: string) => void; diff --git a/art/BiomeVariants.tsx b/art/BiomeVariants.tsx index 4119aad6..0f547331 100644 --- a/art/BiomeVariants.tsx +++ b/art/BiomeVariants.tsx @@ -1,6 +1,7 @@ import getBiomeStyle from '@deities/athena/lib/getBiomeStyle.tsx'; -import { Biome, Biomes } from '@deities/athena/map/Biome.tsx'; -import { HEX } from '@nkzw/palette-swap'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import { Biomes } from '@deities/athena/map/Biome.tsx'; +import type { HEX } from '@nkzw/palette-swap'; export default new Map>( Biomes.map((biome) => { diff --git a/art/Sprites.tsx b/art/Sprites.tsx index 1437671b..995e67a3 100644 --- a/art/Sprites.tsx +++ b/art/Sprites.tsx @@ -1,12 +1,12 @@ -import { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; import { injectGlobal } from '@emotion/css'; -import paletteSwap, { HEX } from '@nkzw/palette-swap'; +import type { HEX } from '@nkzw/palette-swap'; +import paletteSwap from '@nkzw/palette-swap'; import Variants from 'athena-crisis:asset-variants'; import BiomeVariants from './BiomeVariants.tsx'; -import VariantConfiguration, { - SpriteVariantConfiguration, -} from './VariantConfiguration.tsx'; +import type { SpriteVariantConfiguration } from './VariantConfiguration.tsx'; +import VariantConfiguration from './VariantConfiguration.tsx'; type Resource = Readonly<[name: string, url: string]>; type Resources = ReadonlyArray; diff --git a/art/VariantConfiguration.tsx b/art/VariantConfiguration.tsx index 1b447cbb..afa31755 100644 --- a/art/VariantConfiguration.tsx +++ b/art/VariantConfiguration.tsx @@ -1,10 +1,8 @@ -import { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import { - PlainDynamicPlayerID, - PlayerIDs, -} from '@deities/athena/map/Player.tsx'; -import { HEX } from '@nkzw/palette-swap'; +import type { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type { PlainDynamicPlayerID } from '@deities/athena/map/Player.tsx'; +import { PlayerIDs } from '@deities/athena/map/Player.tsx'; +import type { HEX } from '@nkzw/palette-swap'; import BiomeVariants from './BiomeVariants.tsx'; const variantNames = new Set(PlayerIDs); diff --git a/art/Variants.tsx b/art/Variants.tsx index 04ea9082..68bfc2df 100644 --- a/art/Variants.tsx +++ b/art/Variants.tsx @@ -1,8 +1,8 @@ -import { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import { PlainDynamicPlayerID } from '@deities/athena/map/Player.tsx'; -import { HEX } from '@nkzw/palette-swap'; -import { Palette } from './VariantConfiguration.tsx'; +import type { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type { PlainDynamicPlayerID } from '@deities/athena/map/Player.tsx'; +import type { HEX } from '@nkzw/palette-swap'; +import type { Palette } from './VariantConfiguration.tsx'; export type SpriteVariantDetail = Readonly<{ source: string; diff --git a/athena/MapData.tsx b/athena/MapData.tsx index 7289a99f..e01f7036 100644 --- a/athena/MapData.tsx +++ b/athena/MapData.tsx @@ -1,34 +1,27 @@ import sortBy from '@deities/hephaestus/sortBy.tsx'; import ImmutableMap from '@nkzw/immutable-map'; -import { Decorator, DecoratorInfo, getDecorator } from './info/Decorator.tsx'; -import { ActiveUnitTypes, getActiveUnitTypes, Skill } from './info/Skill.tsx'; -import { - getTile, - getTileInfo, - TileField, - TileInfo, - TileLayer, -} from './info/Tile.tsx'; +import type { Decorator, DecoratorInfo } from './info/Decorator.tsx'; +import { getDecorator } from './info/Decorator.tsx'; +import type { ActiveUnitTypes, Skill } from './info/Skill.tsx'; +import { getActiveUnitTypes } from './info/Skill.tsx'; +import type { TileField, TileInfo, TileLayer } from './info/Tile.tsx'; +import { getTile, getTileInfo } from './info/Tile.tsx'; import getAllUnitsToRefill from './lib/getAllUnitsToRefill.tsx'; import getUnitsByPositions from './lib/getUnitsByPositions.tsx'; import indexToSpriteVector from './lib/indexToSpriteVector.tsx'; import indexToVector from './lib/indexToVector.tsx'; import isFuelConsumingUnit from './lib/isFuelConsumingUnit.tsx'; -import { Modifier } from './lib/Modifier.tsx'; +import type { Modifier } from './lib/Modifier.tsx'; import refillUnits from './lib/refillUnits.tsx'; import shouldRemoveUnit from './lib/shouldRemoveUnit.tsx'; import { Biome } from './map/Biome.tsx'; -import Building from './map/Building.tsx'; +import type Building from './map/Building.tsx'; import { DecoratorsPerSide } from './map/Configuration.tsx'; -import Entity from './map/Entity.tsx'; +import type Entity from './map/Entity.tsx'; import type { PlainMap, PlainMapConfig } from './map/PlainMap.tsx'; -import Player, { - HumanPlayer, - PlayerID, - PlayerIDs, - toPlayerID, - toPlayerIDs, -} from './map/Player.tsx'; +import type { PlayerID, PlayerIDs } from './map/Player.tsx'; +import type Player from './map/Player.tsx'; +import { HumanPlayer, toPlayerID, toPlayerIDs } from './map/Player.tsx'; import { decodeBuildings, decodeDecorators, @@ -38,14 +31,16 @@ import { encodeEntities, encodeTeams, } from './map/Serialization.tsx'; -import Team, { Teams } from './map/Team.tsx'; -import Unit from './map/Unit.tsx'; -import Vector from './map/Vector.tsx'; -import Vision, { Fog, VisionT } from './Vision.tsx'; +import type { Teams } from './map/Team.tsx'; +import Team from './map/Team.tsx'; +import type Unit from './map/Unit.tsx'; +import type Vector from './map/Vector.tsx'; +import type { VisionT } from './Vision.tsx'; +import Vision, { Fog } from './Vision.tsx'; +import type { WinConditions } from './WinConditions.tsx'; import { decodeWinConditions, encodeWinConditions, - WinConditions, WinCriteria, } from './WinConditions.tsx'; diff --git a/athena/Radius.tsx b/athena/Radius.tsx index 23917175..8570487c 100644 --- a/athena/Radius.tsx +++ b/athena/Radius.tsx @@ -1,14 +1,15 @@ import FastPriorityQueue from 'fastpriorityqueue'; import { Skill } from './info/Skill.tsx'; -import { TileInfo, TileTypes } from './info/Tile.tsx'; -import { UnitInfo } from './info/Unit.tsx'; +import type { TileInfo } from './info/Tile.tsx'; +import { TileTypes } from './info/Tile.tsx'; +import type { UnitInfo } from './info/Unit.tsx'; import canLoad from './lib/canLoad.tsx'; import getVectorRadius from './lib/getVectorRadius.tsx'; import { EntityType } from './map/Entity.tsx'; -import Unit from './map/Unit.tsx'; +import type Unit from './map/Unit.tsx'; import vec from './map/vec.tsx'; -import Vector from './map/Vector.tsx'; -import MapData from './MapData.tsx'; +import type Vector from './map/Vector.tsx'; +import type MapData from './MapData.tsx'; type RadiusConfiguration = { getCost(map: MapData, unit: Unit, vector: Vector): number; diff --git a/athena/Vision.tsx b/athena/Vision.tsx index 198d5bda..5d166342 100644 --- a/athena/Vision.tsx +++ b/athena/Vision.tsx @@ -1,8 +1,8 @@ import updatePlayers from './lib/updatePlayers.tsx'; -import { PlayerID } from './map/Player.tsx'; +import type { PlayerID } from './map/Player.tsx'; import vec from './map/vec.tsx'; -import Vector from './map/Vector.tsx'; -import MapData from './MapData.tsx'; +import type Vector from './map/Vector.tsx'; +import type MapData from './MapData.tsx'; import { visible } from './Radius.tsx'; export type VisionT = { diff --git a/athena/WinConditions.tsx b/athena/WinConditions.tsx index c5ee99cd..1f3431eb 100644 --- a/athena/WinConditions.tsx +++ b/athena/WinConditions.tsx @@ -1,20 +1,16 @@ import isPositiveInteger from '@deities/hephaestus/isPositiveInteger.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; +import type { PlayerID, PlayerIDs, PlayerIDSet } from './map/Player.tsx'; +import { toPlayerIDs } from './map/Player.tsx'; +import type { EncodedReward, Reward } from './map/Reward.tsx'; import { - PlayerID, - PlayerIDs, - PlayerIDSet, - toPlayerIDs, -} from './map/Player.tsx'; -import { - EncodedReward, maybeDecodeReward, maybeEncodeReward, - Reward, validateReward, } from './map/Reward.tsx'; -import Vector, { decodeVectorArray, encodeVectorArray } from './map/Vector.tsx'; -import MapData from './MapData.tsx'; +import type Vector from './map/Vector.tsx'; +import { decodeVectorArray, encodeVectorArray } from './map/Vector.tsx'; +import type MapData from './MapData.tsx'; export enum WinCriteria { Default = 0, diff --git a/athena/generator/MapGenerator.tsx b/athena/generator/MapGenerator.tsx index 3b343192..57a9d8bd 100644 --- a/athena/generator/MapGenerator.tsx +++ b/athena/generator/MapGenerator.tsx @@ -12,6 +12,7 @@ import { HQ, VerticalBarrier, } from '../info/Building.tsx'; +import type { TileInfo } from '../info/Tile.tsx'; import { Beach, Bridge, @@ -27,7 +28,6 @@ import { Ruins, Sea, Street, - TileInfo, TileTypes, } from '../info/Tile.tsx'; import { Pioneer } from '../info/Unit.tsx'; @@ -39,11 +39,12 @@ import getMovementPath from '../lib/getMovementPath.tsx'; import indexToVector from '../lib/indexToVector.tsx'; import withModifiers from '../lib/withModifiers.tsx'; import { Biome, Biomes } from '../map/Biome.tsx'; -import Building from '../map/Building.tsx'; +import type Building from '../map/Building.tsx'; import { toPlayerID } from '../map/Player.tsx'; -import Unit from '../map/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData, { SizeVector, TileMap } from '../MapData.tsx'; +import type Unit from '../map/Unit.tsx'; +import type Vector from '../map/Vector.tsx'; +import type { SizeVector, TileMap } from '../MapData.tsx'; +import MapData from '../MapData.tsx'; import { moveable, MoveConfiguration } from '../Radius.tsx'; import vec from './../map/vec.tsx'; diff --git a/athena/info/Building.tsx b/athena/info/Building.tsx index ded24c50..a17ed127 100644 --- a/athena/info/Building.tsx +++ b/athena/info/Building.tsx @@ -1,15 +1,18 @@ import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { AIBehavior } from '../map/AIBehavior.tsx'; +import type { AIBehavior } from '../map/AIBehavior.tsx'; import { Biome } from '../map/Biome.tsx'; -import Building from '../map/Building.tsx'; +import type Building from '../map/Building.tsx'; import { MaxHealth } from '../map/Configuration.tsx'; import { EntityType } from '../map/Entity.tsx'; -import Player, { PlayerID } from '../map/Player.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Player from '../map/Player.tsx'; import SpriteVector from '../map/SpriteVector.tsx'; import type { ID } from '../MapData.tsx'; import { BarID } from './BuildingIDs.tsx'; -import { hasUnlockedBuilding, Skill } from './Skill.tsx'; -import { SpriteVariant } from './SpriteVariants.tsx'; +import type { Skill } from './Skill.tsx'; +import { hasUnlockedBuilding } from './Skill.tsx'; +import type { SpriteVariant } from './SpriteVariants.tsx'; +import type { TileInfo } from './Tile.tsx'; import { Airfield, Bridge, @@ -23,9 +26,9 @@ import { ShipyardConstructionSite, SpaceBridge, Street, - TileInfo, } from './Tile.tsx'; -import { Ability, filterUnits, SpecialUnits, UnitInfo } from './Unit.tsx'; +import type { UnitInfo } from './Unit.tsx'; +import { Ability, filterUnits, SpecialUnits } from './Unit.tsx'; let _buildingClass: typeof Building; diff --git a/athena/info/Decorator.tsx b/athena/info/Decorator.tsx index 42dc2722..bc0b6b6c 100644 --- a/athena/info/Decorator.tsx +++ b/athena/info/Decorator.tsx @@ -1,13 +1,9 @@ import sortBy from '@deities/hephaestus/sortBy.tsx'; import { Biome } from '../map/Biome.tsx'; import SpriteVector from '../map/SpriteVector.tsx'; -import { ID } from '../MapData.tsx'; -import { - PlainTileGroup, - SeaTileGroup, - TileAnimation, - TileInfo, -} from './Tile.tsx'; +import type { ID } from '../MapData.tsx'; +import type { TileAnimation, TileInfo } from './Tile.tsx'; +import { PlainTileGroup, SeaTileGroup } from './Tile.tsx'; const sprite = (x: number, y: number) => new SpriteVector(x, y); diff --git a/athena/info/MovementType.tsx b/athena/info/MovementType.tsx index 416e6351..ccb14582 100644 --- a/athena/info/MovementType.tsx +++ b/athena/info/MovementType.tsx @@ -1,4 +1,4 @@ -import { SoundName } from './Music.tsx'; +import type { SoundName } from './Music.tsx'; export class MovementType { constructor( diff --git a/athena/info/Skill.tsx b/athena/info/Skill.tsx index ed57558b..cf092cb8 100644 --- a/athena/info/Skill.tsx +++ b/athena/info/Skill.tsx @@ -1,14 +1,17 @@ import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import matchesActiveType from '../lib/matchesActiveType.tsx'; import { HealAmount } from '../map/Configuration.tsx'; -import { EntityType, isUnitInfo } from '../map/Entity.tsx'; -import Player from '../map/Player.tsx'; -import Vector from '../map/Vector.tsx'; +import type { EntityType } from '../map/Entity.tsx'; +import { isUnitInfo } from '../map/Entity.tsx'; +import type Player from '../map/Player.tsx'; +import type Vector from '../map/Vector.tsx'; import type MapData from '../MapData.tsx'; -import { BuildingInfo } from './Building.tsx'; +import type { BuildingInfo } from './Building.tsx'; import { BarID } from './BuildingIDs.tsx'; -import { MovementType, MovementTypes } from './MovementType.tsx'; -import { TileInfo, TileType, TileTypes } from './Tile.tsx'; +import type { MovementType } from './MovementType.tsx'; +import { MovementTypes } from './MovementType.tsx'; +import type { TileInfo, TileType } from './Tile.tsx'; +import { TileTypes } from './Tile.tsx'; import type { UnitInfo } from './Unit.tsx'; import UnitID from './UnitID.tsx'; diff --git a/athena/info/Tile.tsx b/athena/info/Tile.tsx index 15012162..aa0dcd07 100644 --- a/athena/info/Tile.tsx +++ b/athena/info/Tile.tsx @@ -3,8 +3,9 @@ import { Modifier } from '../lib/Modifier.tsx'; import { Biome } from '../map/Biome.tsx'; import SpriteVector from '../map/SpriteVector.tsx'; import { isVector } from '../map/Vector.tsx'; -import { ID, TileMap } from '../MapData.tsx'; -import { MovementType, MovementTypes } from './MovementType.tsx'; +import type { ID, TileMap } from '../MapData.tsx'; +import type { MovementType } from './MovementType.tsx'; +import { MovementTypes } from './MovementType.tsx'; export enum RenderType { Composite = 0, diff --git a/athena/info/Unit.tsx b/athena/info/Unit.tsx index fea6573c..91516528 100644 --- a/athena/info/Unit.tsx +++ b/athena/info/Unit.tsx @@ -1,15 +1,18 @@ import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import formatText from '../lib/formatText.tsx'; -import { AIBehavior } from '../map/AIBehavior.tsx'; +import type { AIBehavior } from '../map/AIBehavior.tsx'; import { MaxHealth } from '../map/Configuration.tsx'; -import Entity, { EntityType } from '../map/Entity.tsx'; -import Player, { PlayerID } from '../map/Player.tsx'; +import type Entity from '../map/Entity.tsx'; +import { EntityType } from '../map/Entity.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Player from '../map/Player.tsx'; import SpriteVector from '../map/SpriteVector.tsx'; import type Unit from '../map/Unit.tsx'; -import { ID } from '../MapData.tsx'; -import { AttackSprite } from './AttackSprite.tsx'; -import { MovementType, MovementTypes } from './MovementType.tsx'; -import { SoundName } from './Music.tsx'; +import type { ID } from '../MapData.tsx'; +import type { AttackSprite } from './AttackSprite.tsx'; +import type { MovementType } from './MovementType.tsx'; +import { MovementTypes } from './MovementType.tsx'; +import type { SoundName } from './Music.tsx'; import { getUnitCost, getUnitRadius, @@ -17,7 +20,7 @@ import { hasUnlockedUnit, Skill, } from './Skill.tsx'; -import { SpriteVariant } from './SpriteVariants.tsx'; +import type { SpriteVariant } from './SpriteVariants.tsx'; import type { TileInfo } from './Tile.tsx'; import UnitID from './UnitID.tsx'; diff --git a/athena/info/UnitNames.tsx b/athena/info/UnitNames.tsx index 9e3bf9a9..8109d112 100644 --- a/athena/info/UnitNames.tsx +++ b/athena/info/UnitNames.tsx @@ -1,9 +1,9 @@ import random from '@deities/hephaestus/random.tsx'; import _hasLeader from '../lib/hasLeader.tsx'; -import { PlayerID } from '../map/Player.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; -import { Gender, UnitInfo } from './Unit.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; +import type { Gender, UnitInfo } from './Unit.tsx'; const names = { female: [ diff --git a/athena/lib/__tests__/assignUnitNames.test.tsx b/athena/lib/__tests__/assignUnitNames.test.tsx index e6697fc3..3c515ea7 100644 --- a/athena/lib/__tests__/assignUnitNames.test.tsx +++ b/athena/lib/__tests__/assignUnitNames.test.tsx @@ -10,7 +10,8 @@ import { Sniper, Truck, } from '../../info/Unit.tsx'; -import Unit, { TransportedUnit } from '../../map/Unit.tsx'; +import type { TransportedUnit } from '../../map/Unit.tsx'; +import type Unit from '../../map/Unit.tsx'; import vec from '../../map/vec.tsx'; import MapData from '../../MapData.tsx'; import assignUnitNames from '../assignUnitNames.tsx'; diff --git a/athena/lib/__tests__/determineUnitsToCreate.test.tsx b/athena/lib/__tests__/determineUnitsToCreate.test.tsx index 10a79052..9118aecd 100644 --- a/athena/lib/__tests__/determineUnitsToCreate.test.tsx +++ b/athena/lib/__tests__/determineUnitsToCreate.test.tsx @@ -1,7 +1,8 @@ import { expect, test } from 'vitest'; import { Barracks, Factory, House } from '../../info/Building.tsx'; import { ConstructionSite } from '../../info/Tile.tsx'; -import { Infantry, Jeep, SmallTank, UnitInfo } from '../../info/Unit.tsx'; +import type { UnitInfo } from '../../info/Unit.tsx'; +import { Infantry, Jeep, SmallTank } from '../../info/Unit.tsx'; import vec from '../../map/vec.tsx'; import MapData from '../../MapData.tsx'; import determineUnitsToCreate from '../determineUnitsToCreate.tsx'; diff --git a/athena/lib/__tests__/validateTeams.test.tsx b/athena/lib/__tests__/validateTeams.test.tsx index e3490bee..8b29c58f 100644 --- a/athena/lib/__tests__/validateTeams.test.tsx +++ b/athena/lib/__tests__/validateTeams.test.tsx @@ -1,6 +1,7 @@ import { expect, test } from 'vitest'; import { toPlayerID } from '../../map/Player.tsx'; -import { PlainTeams, toTeamArray } from '../../map/Team.tsx'; +import type { PlainTeams } from '../../map/Team.tsx'; +import { toTeamArray } from '../../map/Team.tsx'; import MapData from '../../MapData.tsx'; import validateTeams from '../validateTeams.tsx'; import withModifiers from '../withModifiers.tsx'; diff --git a/athena/lib/assignUnitNames.tsx b/athena/lib/assignUnitNames.tsx index f6c9c081..75f88f80 100644 --- a/athena/lib/assignUnitNames.tsx +++ b/athena/lib/assignUnitNames.tsx @@ -1,6 +1,7 @@ import { generateUnitName } from '../info/UnitNames.tsx'; -import Unit, { TransportedUnit } from '../map/Unit.tsx'; -import MapData from '../MapData.tsx'; +import type { TransportedUnit } from '../map/Unit.tsx'; +import type Unit from '../map/Unit.tsx'; +import type MapData from '../MapData.tsx'; import getLeaders from './getLeaders.tsx'; export default function assignUnitNames(map: MapData): MapData { diff --git a/athena/lib/calculateClusters.tsx b/athena/lib/calculateClusters.tsx index cd03b507..bb847902 100644 --- a/athena/lib/calculateClusters.tsx +++ b/athena/lib/calculateClusters.tsx @@ -1,6 +1,6 @@ import skmeans from 'skmeans'; -import Vector from '../map/Vector.tsx'; -import { SizeVector } from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type { SizeVector } from '../MapData.tsx'; import vec from './../map/vec.tsx'; const getClusterCount = (size: SizeVector, max: number) => diff --git a/athena/lib/calculateDamage.tsx b/athena/lib/calculateDamage.tsx index 2a6bac00..3c836205 100644 --- a/athena/lib/calculateDamage.tsx +++ b/athena/lib/calculateDamage.tsx @@ -1,7 +1,8 @@ -import { Weapon } from '../info/Unit.tsx'; +import type { Weapon } from '../info/Unit.tsx'; import { MaxHealth, MinDamage } from '../map/Configuration.tsx'; -import Entity, { isEntityWithoutCover } from '../map/Entity.tsx'; -import Unit from '../map/Unit.tsx'; +import type Entity from '../map/Entity.tsx'; +import { isEntityWithoutCover } from '../map/Entity.tsx'; +import type Unit from '../map/Unit.tsx'; export default function calculateDamage( unitA: Unit, diff --git a/athena/lib/calculateEmptyClusters.tsx b/athena/lib/calculateEmptyClusters.tsx index f585d30e..160c4c06 100644 --- a/athena/lib/calculateEmptyClusters.tsx +++ b/athena/lib/calculateEmptyClusters.tsx @@ -1,4 +1,4 @@ -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import calculateClusters from './calculateClusters.tsx'; export default function calculateEmptyClusters(map: MapData) { diff --git a/athena/lib/calculateFunds.tsx b/athena/lib/calculateFunds.tsx index dcc90105..f78d63c5 100644 --- a/athena/lib/calculateFunds.tsx +++ b/athena/lib/calculateFunds.tsx @@ -1,5 +1,6 @@ -import Player, { PlayerID } from '../map/Player.tsx'; -import MapData from '../MapData.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Player from '../map/Player.tsx'; +import type MapData from '../MapData.tsx'; export default function calculateFunds( map: MapData, diff --git a/athena/lib/calculateLikelyDamage.tsx b/athena/lib/calculateLikelyDamage.tsx index 2096b5a5..936ecd6e 100644 --- a/athena/lib/calculateLikelyDamage.tsx +++ b/athena/lib/calculateLikelyDamage.tsx @@ -1,8 +1,8 @@ import { BuildingCover, MinDamage } from '../map/Configuration.tsx'; -import Entity from '../map/Entity.tsx'; -import Unit from '../map/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Entity from '../map/Entity.tsx'; +import type Unit from '../map/Unit.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import calculateDamage from './calculateDamage.tsx'; export default function calculateLikelyDamage( diff --git a/athena/lib/canBuild.tsx b/athena/lib/canBuild.tsx index 832c405f..4cbf5925 100644 --- a/athena/lib/canBuild.tsx +++ b/athena/lib/canBuild.tsx @@ -1,6 +1,7 @@ -import { BuildingInfo } from '../info/Building.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData, { PlayerOrPlayerID } from '../MapData.tsx'; +import type { BuildingInfo } from '../info/Building.tsx'; +import type Vector from '../map/Vector.tsx'; +import type { PlayerOrPlayerID } from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; export default function canBuild( map: MapData, diff --git a/athena/lib/canDeploy.tsx b/athena/lib/canDeploy.tsx index 2b489044..da965522 100644 --- a/athena/lib/canDeploy.tsx +++ b/athena/lib/canDeploy.tsx @@ -1,6 +1,6 @@ -import { UnitInfo } from '../info/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type { UnitInfo } from '../info/Unit.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; export default function canDeploy( map: MapData, diff --git a/athena/lib/canLoad.tsx b/athena/lib/canLoad.tsx index ee0c0616..17c071be 100644 --- a/athena/lib/canLoad.tsx +++ b/athena/lib/canLoad.tsx @@ -1,6 +1,6 @@ -import Unit from '../map/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Unit from '../map/Unit.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; export default function canLoad( map: MapData, diff --git a/athena/lib/canPlaceDecorator.tsx b/athena/lib/canPlaceDecorator.tsx index 6652a242..cc25e4b5 100644 --- a/athena/lib/canPlaceDecorator.tsx +++ b/athena/lib/canPlaceDecorator.tsx @@ -1,7 +1,7 @@ import { getDecorator } from '../info/Decorator.tsx'; import { getDecoratorLimit } from '../map/Configuration.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; export default function canPlaceDecorator( map: MapData, diff --git a/athena/lib/canPlaceLightning.tsx b/athena/lib/canPlaceLightning.tsx index c005722c..93bdcddf 100644 --- a/athena/lib/canPlaceLightning.tsx +++ b/athena/lib/canPlaceLightning.tsx @@ -1,6 +1,6 @@ import { Lightning, StormCloud } from '../info/Tile.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import canPlaceTile from './canPlaceTile.tsx'; export default function canPlaceLightning(map: MapData, vector: Vector) { diff --git a/athena/lib/canPlaceRailTrack.tsx b/athena/lib/canPlaceRailTrack.tsx index 053b18d8..08f7fc1a 100644 --- a/athena/lib/canPlaceRailTrack.tsx +++ b/athena/lib/canPlaceRailTrack.tsx @@ -1,6 +1,6 @@ import { Plain, RailBridge, RailTrack, River } from '../info/Tile.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import canPlaceTile from './canPlaceTile.tsx'; export default function canPlaceRailTrack(map: MapData, vector: Vector) { diff --git a/athena/lib/canPlaceTile.tsx b/athena/lib/canPlaceTile.tsx index a8fd9226..0fe8d1c5 100644 --- a/athena/lib/canPlaceTile.tsx +++ b/athena/lib/canPlaceTile.tsx @@ -1,3 +1,4 @@ +import type { MaybeTileID, TileInfo } from '../info/Tile.tsx'; import { Beach, DeepSea, @@ -6,7 +7,6 @@ import { Island, isSea, Lightning, - MaybeTileID, Pier, Pipe, PoisonSwamp, @@ -15,13 +15,12 @@ import { Sea, ShipyardConstructionSite, StormCloud, - TileInfo, TileTypes, Trench, Weeds, } from '../info/Tile.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import getBiomeStyle from './getBiomeStyle.tsx'; import getModifier, { getWaterfallModifier } from './getModifier.tsx'; import { Modifier } from './Modifier.tsx'; diff --git a/athena/lib/convertBiome.tsx b/athena/lib/convertBiome.tsx index be88e497..f35d330f 100644 --- a/athena/lib/convertBiome.tsx +++ b/athena/lib/convertBiome.tsx @@ -1,6 +1,6 @@ -import { TileInfo } from '../info/Tile.tsx'; -import { Biome } from '../map/Biome.tsx'; -import MapData from '../MapData.tsx'; +import type { TileInfo } from '../info/Tile.tsx'; +import type { Biome } from '../map/Biome.tsx'; +import type MapData from '../MapData.tsx'; import writeTile from '../mutation/writeTile.tsx'; import getBiomeStyle from './getBiomeStyle.tsx'; import { verifyMap } from './verifyTiles.tsx'; diff --git a/athena/lib/determineUnitsToCreate.tsx b/athena/lib/determineUnitsToCreate.tsx index 070b8ae9..c96257f8 100644 --- a/athena/lib/determineUnitsToCreate.tsx +++ b/athena/lib/determineUnitsToCreate.tsx @@ -1,11 +1,13 @@ -import { PotentialUnitAbilities } from '../../dionysus/lib/getPossibleUnitAbilities.tsx'; +import type { PotentialUnitAbilities } from '../../dionysus/lib/getPossibleUnitAbilities.tsx'; import needsSupply from '../../dionysus/lib/needsSupply.tsx'; import { filterBuildings, MinFunds } from '../info/Building.tsx'; -import { Ability, UnitInfo } from '../info/Unit.tsx'; +import type { UnitInfo } from '../info/Unit.tsx'; +import { Ability } from '../info/Unit.tsx'; import { getEntityInfoGroup } from '../map/Entity.tsx'; -import Player, { PlayerID } from '../map/Player.tsx'; -import Unit from '../map/Unit.tsx'; -import MapData from '../MapData.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Player from '../map/Player.tsx'; +import type Unit from '../map/Unit.tsx'; +import type MapData from '../MapData.tsx'; import calculateFunds, { calculateTotalPossibleFunds, } from './calculateFunds.tsx'; diff --git a/athena/lib/dropInactivePlayers.tsx b/athena/lib/dropInactivePlayers.tsx index 103e6908..4d6ac6c9 100644 --- a/athena/lib/dropInactivePlayers.tsx +++ b/athena/lib/dropInactivePlayers.tsx @@ -1,4 +1,4 @@ -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import getActivePlayers from './getActivePlayers.tsx'; export default function dropInactivePlayers(map: MapData) { diff --git a/athena/lib/dropLabels.tsx b/athena/lib/dropLabels.tsx index 4cff4911..cd59e9f9 100644 --- a/athena/lib/dropLabels.tsx +++ b/athena/lib/dropLabels.tsx @@ -1,4 +1,4 @@ -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import { getHiddenLabels } from '../WinConditions.tsx'; export default function dropLabels(map: MapData) { diff --git a/athena/lib/encodedMapDataHasHiddenWinCondition.tsx b/athena/lib/encodedMapDataHasHiddenWinCondition.tsx index 7f34a3cc..0848b0f5 100644 --- a/athena/lib/encodedMapDataHasHiddenWinCondition.tsx +++ b/athena/lib/encodedMapDataHasHiddenWinCondition.tsx @@ -1,4 +1,4 @@ -import { PlainMap } from '../map/PlainMap.tsx'; +import type { PlainMap } from '../map/PlainMap.tsx'; export default function encodedMapDataHasHiddenWinCondition(state: PlainMap) { return state.config.winConditions?.some(([, hidden]) => hidden); diff --git a/athena/lib/filterNullables.tsx b/athena/lib/filterNullables.tsx index 50d6b910..e20b9106 100644 --- a/athena/lib/filterNullables.tsx +++ b/athena/lib/filterNullables.tsx @@ -1,4 +1,4 @@ -import { PlainEntity } from '../map/Entity.tsx'; +import type { PlainEntity } from '../map/Entity.tsx'; export default function filterNullables< T extends PlainEntity | Record, diff --git a/athena/lib/followMovementPath.tsx b/athena/lib/followMovementPath.tsx index c903bd15..a7cdd44f 100644 --- a/athena/lib/followMovementPath.tsx +++ b/athena/lib/followMovementPath.tsx @@ -1,6 +1,6 @@ -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; -import { VisionT } from '../Vision.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; +import type { VisionT } from '../Vision.tsx'; export default function followMovementPath( map: MapData, diff --git a/athena/lib/formatText.tsx b/athena/lib/formatText.tsx index 2e358208..971f2a09 100644 --- a/athena/lib/formatText.tsx +++ b/athena/lib/formatText.tsx @@ -1,5 +1,6 @@ import parseInteger from '@deities/hephaestus/parseInteger.tsx'; -import { getUnitInfo, UnitInfo } from '../info/Unit.tsx'; +import type { UnitInfo } from '../info/Unit.tsx'; +import { getUnitInfo } from '../info/Unit.tsx'; export default function formatText( text: string, diff --git a/athena/lib/getActivePlayers.tsx b/athena/lib/getActivePlayers.tsx index 660e86ef..6a7d2485 100644 --- a/athena/lib/getActivePlayers.tsx +++ b/athena/lib/getActivePlayers.tsx @@ -1,5 +1,5 @@ -import { PlayerIDs } from '../map/Player.tsx'; -import MapData from '../MapData.tsx'; +import type { PlayerIDs } from '../map/Player.tsx'; +import type MapData from '../MapData.tsx'; export default function getActivePlayers(map: MapData): PlayerIDs { return [ diff --git a/athena/lib/getAllUnitsToRefill.tsx b/athena/lib/getAllUnitsToRefill.tsx index 0de42cc8..19affd47 100644 --- a/athena/lib/getAllUnitsToRefill.tsx +++ b/athena/lib/getAllUnitsToRefill.tsx @@ -1,8 +1,8 @@ import { Ability } from '../info/Unit.tsx'; -import Player from '../map/Player.tsx'; -import MapData from '../MapData.tsx'; -import { VisionT } from '../Vision.tsx'; -import { UnitsWithPosition } from './getUnitsByPositions.tsx'; +import type Player from '../map/Player.tsx'; +import type MapData from '../MapData.tsx'; +import type { VisionT } from '../Vision.tsx'; +import type { UnitsWithPosition } from './getUnitsByPositions.tsx'; import getUnitsToRefill from './getUnitsToRefill.tsx'; export default function getAllUnitsToRefill( diff --git a/athena/lib/getAttackStatusEffect.tsx b/athena/lib/getAttackStatusEffect.tsx index 041434c0..699e38ea 100644 --- a/athena/lib/getAttackStatusEffect.tsx +++ b/athena/lib/getAttackStatusEffect.tsx @@ -1,8 +1,8 @@ import { getSkillAttackStatusEffects } from '../info/Skill.tsx'; -import { TileInfo } from '../info/Tile.tsx'; +import type { TileInfo } from '../info/Tile.tsx'; import { LeaderStatusEffect } from '../map/Configuration.tsx'; -import Unit from '../map/Unit.tsx'; -import MapData from '../MapData.tsx'; +import type Unit from '../map/Unit.tsx'; +import type MapData from '../MapData.tsx'; export default function getAttackStatusEffect( map: MapData, diff --git a/athena/lib/getAttackableEntitiesInRange.tsx b/athena/lib/getAttackableEntitiesInRange.tsx index 865eca4c..64afc9d2 100644 --- a/athena/lib/getAttackableEntitiesInRange.tsx +++ b/athena/lib/getAttackableEntitiesInRange.tsx @@ -1,8 +1,8 @@ import { EntityType } from '../map/Entity.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import { attackable } from '../Radius.tsx'; -import { VisionT } from '../Vision.tsx'; +import type { VisionT } from '../Vision.tsx'; export default function getAttackableEntitiesInRange( map: MapData, diff --git a/athena/lib/getAvailableUnitActions.tsx b/athena/lib/getAvailableUnitActions.tsx index 39a8845e..3a1053ff 100644 --- a/athena/lib/getAvailableUnitActions.tsx +++ b/athena/lib/getAvailableUnitActions.tsx @@ -1,10 +1,10 @@ import { filterBuildings } from '../info/Building.tsx'; import { Ability } from '../info/Unit.tsx'; -import Unit from '../map/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; -import { RadiusItem } from '../Radius.tsx'; -import { VisionT } from '../Vision.tsx'; +import type Unit from '../map/Unit.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; +import type { RadiusItem } from '../Radius.tsx'; +import type { VisionT } from '../Vision.tsx'; import canBuild from './canBuild.tsx'; import canPlaceRailTrack from './canPlaceRailTrack.tsx'; import getAttackableEntitiesInRange from './getAttackableEntitiesInRange.tsx'; diff --git a/athena/lib/getBiomeStyle.tsx b/athena/lib/getBiomeStyle.tsx index dc32cad5..53596ef3 100644 --- a/athena/lib/getBiomeStyle.tsx +++ b/athena/lib/getBiomeStyle.tsx @@ -1,3 +1,4 @@ +import type { TileInfo } from '../info/Tile.tsx'; import { Beach, Box, @@ -23,7 +24,6 @@ import { StormCloud, Street, SwampBiome, - TileInfo, Weeds, } from '../info/Tile.tsx'; import { Biome } from '../map/Biome.tsx'; diff --git a/athena/lib/getBuildableUnits.tsx b/athena/lib/getBuildableUnits.tsx index ef6912e9..4b660631 100644 --- a/athena/lib/getBuildableUnits.tsx +++ b/athena/lib/getBuildableUnits.tsx @@ -1,8 +1,8 @@ import { MovementTypes } from '../info/MovementType.tsx'; import { Skill } from '../info/Skill.tsx'; -import Building from '../map/Building.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Building from '../map/Building.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import getDeployableVectors from './getDeployableVectors.tsx'; export default function getBuildableUnits( diff --git a/athena/lib/getChargeValue.tsx b/athena/lib/getChargeValue.tsx index 2d321d05..9222e41a 100644 --- a/athena/lib/getChargeValue.tsx +++ b/athena/lib/getChargeValue.tsx @@ -1,7 +1,8 @@ import { MinFunds } from '../info/Building.tsx'; import { Charge, MaxHealth } from '../map/Configuration.tsx'; -import Entity, { isBuilding, isUnit } from '../map/Entity.tsx'; -import Player from '../map/Player.tsx'; +import type Entity from '../map/Entity.tsx'; +import { isBuilding, isUnit } from '../map/Entity.tsx'; +import type Player from '../map/Player.tsx'; import getUnitValue from './getUnitValue.tsx'; export default function getChargeValue( diff --git a/athena/lib/getDecoratorIndex.tsx b/athena/lib/getDecoratorIndex.tsx index 46112cb4..3235ce21 100644 --- a/athena/lib/getDecoratorIndex.tsx +++ b/athena/lib/getDecoratorIndex.tsx @@ -1,5 +1,5 @@ -import Vector from '../map/Vector.tsx'; -import { SizeVector } from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type { SizeVector } from '../MapData.tsx'; export default function getDecoratorIndex( vector: Vector, diff --git a/athena/lib/getDecoratorsAtField.tsx b/athena/lib/getDecoratorsAtField.tsx index a67f0793..0995162c 100644 --- a/athena/lib/getDecoratorsAtField.tsx +++ b/athena/lib/getDecoratorsAtField.tsx @@ -1,8 +1,9 @@ -import { DecoratorInfo, getDecorator } from '../info/Decorator.tsx'; +import type { DecoratorInfo } from '../info/Decorator.tsx'; +import { getDecorator } from '../info/Decorator.tsx'; import { DecoratorsPerSide } from '../map/Configuration.tsx'; import vec from '../map/vec.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import getDecoratorIndex from './getDecoratorIndex.tsx'; export default function getDecoratorsAtField( diff --git a/athena/lib/getDefenseStatusEffect.tsx b/athena/lib/getDefenseStatusEffect.tsx index cab30308..552ac677 100644 --- a/athena/lib/getDefenseStatusEffect.tsx +++ b/athena/lib/getDefenseStatusEffect.tsx @@ -1,8 +1,9 @@ import { getSkillDefenseStatusEffects } from '../info/Skill.tsx'; -import { TileInfo } from '../info/Tile.tsx'; +import type { TileInfo } from '../info/Tile.tsx'; import { LeaderStatusEffect } from '../map/Configuration.tsx'; -import Entity, { isUnit } from '../map/Entity.tsx'; -import MapData from '../MapData.tsx'; +import type Entity from '../map/Entity.tsx'; +import { isUnit } from '../map/Entity.tsx'; +import type MapData from '../MapData.tsx'; export default function getDefenseStatusEffect( map: MapData, diff --git a/athena/lib/getDeployableVectors.tsx b/athena/lib/getDeployableVectors.tsx index 4634ac58..e2dbd96b 100644 --- a/athena/lib/getDeployableVectors.tsx +++ b/athena/lib/getDeployableVectors.tsx @@ -1,8 +1,8 @@ import { Skill } from '../info/Skill.tsx'; -import { UnitInfo } from '../info/Unit.tsx'; -import { PlayerID } from '../map/Player.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type { UnitInfo } from '../info/Unit.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import canDeploy from './canDeploy.tsx'; export default function getDeployableVectors( diff --git a/athena/lib/getFirstHumanPlayer.tsx b/athena/lib/getFirstHumanPlayer.tsx index 88cd2f16..21d798ed 100644 --- a/athena/lib/getFirstHumanPlayer.tsx +++ b/athena/lib/getFirstHumanPlayer.tsx @@ -1,4 +1,4 @@ -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; export default function getFirstHumanPlayer(map: MapData) { return map.getPlayers().find((player) => player.isHumanPlayer()); diff --git a/athena/lib/getFloatingEdgeModifier.tsx b/athena/lib/getFloatingEdgeModifier.tsx index 5d8661e8..ab66f644 100644 --- a/athena/lib/getFloatingEdgeModifier.tsx +++ b/athena/lib/getFloatingEdgeModifier.tsx @@ -1,7 +1,9 @@ -import { DeepSea, isSea, MaybeTileID, River } from '../info/Tile.tsx'; +import type { MaybeTileID } from '../info/Tile.tsx'; +import { DeepSea, isSea, River } from '../info/Tile.tsx'; import vec from '../map/vec.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData, { ModifierField } from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type { ModifierField } from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import { Modifier } from './Modifier.tsx'; const isSingleSea = (tile: MaybeTileID, modifier: number | null) => diff --git a/athena/lib/getHealCost.tsx b/athena/lib/getHealCost.tsx index 73ae75f6..acf7085e 100644 --- a/athena/lib/getHealCost.tsx +++ b/athena/lib/getHealCost.tsx @@ -1,6 +1,6 @@ import { HealAmount, MaxHealth } from '../map/Configuration.tsx'; -import Player from '../map/Player.tsx'; -import Unit from '../map/Unit.tsx'; +import type Player from '../map/Player.tsx'; +import type Unit from '../map/Unit.tsx'; import getUnitValue from './getUnitValue.tsx'; export default function getHealCost(unit: Unit, player: Player) { diff --git a/athena/lib/getHealableVectors.tsx b/athena/lib/getHealableVectors.tsx index c539be74..5cddee21 100644 --- a/athena/lib/getHealableVectors.tsx +++ b/athena/lib/getHealableVectors.tsx @@ -1,7 +1,7 @@ import { Ability } from '../info/Unit.tsx'; import { MaxHealth } from '../map/Configuration.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; export default function getHealableVectors(map: MapData, position: Vector) { const unitA = map.units.get(position); diff --git a/athena/lib/getLeaders.tsx b/athena/lib/getLeaders.tsx index 674e912d..b892395d 100644 --- a/athena/lib/getLeaders.tsx +++ b/athena/lib/getLeaders.tsx @@ -1,6 +1,7 @@ -import { PlayerID } from '../map/Player.tsx'; -import Unit, { TransportedUnit } from '../map/Unit.tsx'; -import MapData from '../MapData.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type { TransportedUnit } from '../map/Unit.tsx'; +import type Unit from '../map/Unit.tsx'; +import type MapData from '../MapData.tsx'; export default function getLeaders( map: MapData, diff --git a/athena/lib/getModifier.tsx b/athena/lib/getModifier.tsx index ae66234c..5847f3cb 100644 --- a/athena/lib/getModifier.tsx +++ b/athena/lib/getModifier.tsx @@ -1,3 +1,4 @@ +import type { TileInfo, TileLayer } from '../info/Tile.tsx'; import { Box, Box2, @@ -12,16 +13,15 @@ import { River, Sea, StormCloud, - TileInfo, - TileLayer, TileTypes, Trench, Wall, Weeds, Window, } from '../info/Tile.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData, { ModifierMap } from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type { ModifierMap } from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import { Modifier } from './Modifier.tsx'; type AnyTileInfo = TileInfo | null | undefined; diff --git a/athena/lib/getMovementPath.tsx b/athena/lib/getMovementPath.tsx index 674b0690..a5fefe0c 100644 --- a/athena/lib/getMovementPath.tsx +++ b/athena/lib/getMovementPath.tsx @@ -1,7 +1,7 @@ -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; -import { RadiusItem } from '../Radius.tsx'; -import { VisionT } from '../Vision.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; +import type { RadiusItem } from '../Radius.tsx'; +import type { VisionT } from '../Vision.tsx'; export default function getMovementPath( map: MapData, diff --git a/athena/lib/getParentToMoveTo.tsx b/athena/lib/getParentToMoveTo.tsx index 72e24352..aec991b4 100644 --- a/athena/lib/getParentToMoveTo.tsx +++ b/athena/lib/getParentToMoveTo.tsx @@ -1,7 +1,7 @@ -import Unit from '../map/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; -import { RadiusItem } from '../Radius.tsx'; +import type Unit from '../map/Unit.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; +import type { RadiusItem } from '../Radius.tsx'; export default function getParentToMoveTo( map: MapData, diff --git a/athena/lib/getPathFields.tsx b/athena/lib/getPathFields.tsx index f1ef0d43..fd238932 100644 --- a/athena/lib/getPathFields.tsx +++ b/athena/lib/getPathFields.tsx @@ -1,5 +1,5 @@ -import Vector from '../map/Vector.tsx'; -import { RadiusItem } from '../Radius.tsx'; +import type Vector from '../map/Vector.tsx'; +import type { RadiusItem } from '../Radius.tsx'; export default function getPathFields( path: ReadonlyArray, diff --git a/athena/lib/getRescuableVectors.tsx b/athena/lib/getRescuableVectors.tsx index fcf63f2e..8f373f13 100644 --- a/athena/lib/getRescuableVectors.tsx +++ b/athena/lib/getRescuableVectors.tsx @@ -1,6 +1,6 @@ import { Ability } from '../info/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; export default function getRescuableVectors(map: MapData, position: Vector) { const unitA = map.units.get(position); diff --git a/athena/lib/getSabotageableVectors.tsx b/athena/lib/getSabotageableVectors.tsx index 25973cc7..7555f004 100644 --- a/athena/lib/getSabotageableVectors.tsx +++ b/athena/lib/getSabotageableVectors.tsx @@ -1,6 +1,6 @@ import { Ability } from '../info/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; export default function getSabotageableVectors( map: MapData, diff --git a/athena/lib/getUnitValue.tsx b/athena/lib/getUnitValue.tsx index d618385b..87bed985 100644 --- a/athena/lib/getUnitValue.tsx +++ b/athena/lib/getUnitValue.tsx @@ -1,5 +1,5 @@ -import Player from '../map/Player.tsx'; -import Unit from '../map/Unit.tsx'; +import type Player from '../map/Player.tsx'; +import type Unit from '../map/Unit.tsx'; export default function getUnitValue(unit: Unit, player: Player) { const cost = unit.info.getCostFor(player); diff --git a/athena/lib/getUnitsByPositions.tsx b/athena/lib/getUnitsByPositions.tsx index ae497948..f20fca79 100644 --- a/athena/lib/getUnitsByPositions.tsx +++ b/athena/lib/getUnitsByPositions.tsx @@ -1,6 +1,6 @@ -import Unit from '../map/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Unit from '../map/Unit.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; export type UnitsWithPosition = ReadonlyMap; diff --git a/athena/lib/getUnitsToHealOnBuildings.tsx b/athena/lib/getUnitsToHealOnBuildings.tsx index 2fd72d6a..8f2f272d 100644 --- a/athena/lib/getUnitsToHealOnBuildings.tsx +++ b/athena/lib/getUnitsToHealOnBuildings.tsx @@ -1,5 +1,6 @@ -import Player, { PlayerID } from '../map/Player.tsx'; -import MapData from '../MapData.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Player from '../map/Player.tsx'; +import type MapData from '../MapData.tsx'; export default function getUnitsToHealOnBuildings( map: MapData, diff --git a/athena/lib/getUnitsToRefill.tsx b/athena/lib/getUnitsToRefill.tsx index 24bc6f0e..18038818 100644 --- a/athena/lib/getUnitsToRefill.tsx +++ b/athena/lib/getUnitsToRefill.tsx @@ -1,9 +1,10 @@ import { Ability } from '../info/Unit.tsx'; -import Player from '../map/Player.tsx'; -import Vector, { isVector } from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; -import { VisionT } from '../Vision.tsx'; -import { UnitsWithPosition } from './getUnitsByPositions.tsx'; +import type Player from '../map/Player.tsx'; +import type Vector from '../map/Vector.tsx'; +import { isVector } from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; +import type { VisionT } from '../Vision.tsx'; +import type { UnitsWithPosition } from './getUnitsByPositions.tsx'; export default function getUnitsToRefill( map: MapData, diff --git a/athena/lib/getVectorRadius.tsx b/athena/lib/getVectorRadius.tsx index bdff4e9f..00d8d457 100644 --- a/athena/lib/getVectorRadius.tsx +++ b/athena/lib/getVectorRadius.tsx @@ -1,6 +1,6 @@ import vec from '../map/vec.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; export default function getVectorRadius( map: MapData, diff --git a/athena/lib/hasLeader.tsx b/athena/lib/hasLeader.tsx index 16099520..3f65d858 100644 --- a/athena/lib/hasLeader.tsx +++ b/athena/lib/hasLeader.tsx @@ -1,7 +1,8 @@ -import { UnitInfo } from '../info/Unit.tsx'; -import { PlayerID } from '../map/Player.tsx'; -import Unit, { TransportedUnit } from '../map/Unit.tsx'; -import MapData from '../MapData.tsx'; +import type { UnitInfo } from '../info/Unit.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type { TransportedUnit } from '../map/Unit.tsx'; +import type Unit from '../map/Unit.tsx'; +import type MapData from '../MapData.tsx'; export default function hasLeader( map: MapData, diff --git a/athena/lib/hasLowAmmoSupply.tsx b/athena/lib/hasLowAmmoSupply.tsx index e69b11ad..cc174dba 100644 --- a/athena/lib/hasLowAmmoSupply.tsx +++ b/athena/lib/hasLowAmmoSupply.tsx @@ -1,4 +1,4 @@ -import Unit from '../map/Unit.tsx'; +import type Unit from '../map/Unit.tsx'; export default function hasLowAmmoSupply( unit: Unit, diff --git a/athena/lib/indexToVector.tsx b/athena/lib/indexToVector.tsx index 0929ee39..a2b5029f 100644 --- a/athena/lib/indexToVector.tsx +++ b/athena/lib/indexToVector.tsx @@ -1,4 +1,4 @@ -import Vector from '../map/Vector.tsx'; +import type Vector from '../map/Vector.tsx'; import vec from './../map/vec.tsx'; export default function indexToVector(index: number, width: number): Vector { diff --git a/athena/lib/isAmphibiousOnLand.tsx b/athena/lib/isAmphibiousOnLand.tsx index 372cadf5..50f993f1 100644 --- a/athena/lib/isAmphibiousOnLand.tsx +++ b/athena/lib/isAmphibiousOnLand.tsx @@ -1,5 +1,7 @@ -import { isSea, TileInfo } from '../info/Tile.tsx'; -import Entity, { EntityType } from '../map/Entity.tsx'; +import type { TileInfo } from '../info/Tile.tsx'; +import { isSea } from '../info/Tile.tsx'; +import type Entity from '../map/Entity.tsx'; +import { EntityType } from '../map/Entity.tsx'; export default function isAmphibiousOnLand(entity: Entity, tileInfo: TileInfo) { return entity.info.type === EntityType.Amphibious && !isSea(tileInfo.id); diff --git a/athena/lib/isFuelConsumingUnit.tsx b/athena/lib/isFuelConsumingUnit.tsx index 9316a823..06c5cc9d 100644 --- a/athena/lib/isFuelConsumingUnit.tsx +++ b/athena/lib/isFuelConsumingUnit.tsx @@ -1,5 +1,6 @@ -import { TileInfo } from '../info/Tile.tsx'; -import Entity, { getEntityGroup } from '../map/Entity.tsx'; +import type { TileInfo } from '../info/Tile.tsx'; +import type Entity from '../map/Entity.tsx'; +import { getEntityGroup } from '../map/Entity.tsx'; import isAmphibiousOnLand from './isAmphibiousOnLand.tsx'; export default function isFuelConsumingUnit( diff --git a/athena/lib/isPvP.tsx b/athena/lib/isPvP.tsx index a930e3b3..0317d04c 100644 --- a/athena/lib/isPvP.tsx +++ b/athena/lib/isPvP.tsx @@ -1,5 +1,5 @@ import { isHumanPlayer } from '../map/Player.tsx'; -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; export default function isPvP(map: MapData) { return map.getPlayers().filter(isHumanPlayer).length > 1; diff --git a/athena/lib/matchesActiveType.tsx b/athena/lib/matchesActiveType.tsx index 67502772..f0a6b8e3 100644 --- a/athena/lib/matchesActiveType.tsx +++ b/athena/lib/matchesActiveType.tsx @@ -1,6 +1,6 @@ -import { ActiveUnitTypes } from '../info/Skill.tsx'; -import Unit from '../map/Unit.tsx'; -import Vector from '../map/Vector.tsx'; +import type { ActiveUnitTypes } from '../info/Skill.tsx'; +import type Unit from '../map/Unit.tsx'; +import type Vector from '../map/Vector.tsx'; export default function matchesActiveType( types: ActiveUnitTypes | undefined, diff --git a/athena/lib/matchesPlayerList.tsx b/athena/lib/matchesPlayerList.tsx index c256730a..9fac1b2c 100644 --- a/athena/lib/matchesPlayerList.tsx +++ b/athena/lib/matchesPlayerList.tsx @@ -1,4 +1,4 @@ -import { PlayerID, PlayerIDs } from '../map/Player.tsx'; +import type { PlayerID, PlayerIDs } from '../map/Player.tsx'; export default function matchesPlayerList( players: PlayerIDs | undefined, diff --git a/athena/lib/maybeConvertPlayer.tsx b/athena/lib/maybeConvertPlayer.tsx index 2944f0e1..6cf0ae51 100644 --- a/athena/lib/maybeConvertPlayer.tsx +++ b/athena/lib/maybeConvertPlayer.tsx @@ -1,5 +1,5 @@ import { Zombie } from '../info/Unit.tsx'; -import Unit from '../map/Unit.tsx'; +import type Unit from '../map/Unit.tsx'; export default function maybeConvertPlayer( unit: Unit, diff --git a/athena/lib/mergeTeams.tsx b/athena/lib/mergeTeams.tsx index 743a613b..fb8620d3 100644 --- a/athena/lib/mergeTeams.tsx +++ b/athena/lib/mergeTeams.tsx @@ -1,5 +1,5 @@ -import { Teams } from '../map/Team.tsx'; -import MapData from '../MapData.tsx'; +import type { Teams } from '../map/Team.tsx'; +import type MapData from '../MapData.tsx'; export default function mergeTeams(map: MapData, newTeams: Teams | undefined) { let { teams } = map; diff --git a/athena/lib/refillUnits.tsx b/athena/lib/refillUnits.tsx index 186b4cdb..26fe1c05 100644 --- a/athena/lib/refillUnits.tsx +++ b/athena/lib/refillUnits.tsx @@ -1,5 +1,5 @@ -import MapData from '../MapData.tsx'; -import { UnitsWithPosition } from './getUnitsByPositions.tsx'; +import type MapData from '../MapData.tsx'; +import type { UnitsWithPosition } from './getUnitsByPositions.tsx'; export default function refillUnits( map: MapData, diff --git a/athena/lib/removeLeader.tsx b/athena/lib/removeLeader.tsx index 88a504e5..5a80dcfd 100644 --- a/athena/lib/removeLeader.tsx +++ b/athena/lib/removeLeader.tsx @@ -1,7 +1,8 @@ -import { UnitInfo } from '../info/Unit.tsx'; -import { PlayerID } from '../map/Player.tsx'; -import Unit, { TransportedUnit } from '../map/Unit.tsx'; -import MapData from '../MapData.tsx'; +import type { UnitInfo } from '../info/Unit.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type { TransportedUnit } from '../map/Unit.tsx'; +import type Unit from '../map/Unit.tsx'; +import type MapData from '../MapData.tsx'; export default function removeLeader( map: MapData, diff --git a/athena/lib/resizeMap.tsx b/athena/lib/resizeMap.tsx index ad70aab8..607e34cd 100644 --- a/athena/lib/resizeMap.tsx +++ b/athena/lib/resizeMap.tsx @@ -1,13 +1,14 @@ import { generateRandomMap } from '../generator/MapGenerator.tsx'; -import { Decorator } from '../info/Decorator.tsx'; +import type { Decorator } from '../info/Decorator.tsx'; import { getTileInfo, TileTypes } from '../info/Tile.tsx'; import { DecoratorsPerSide } from '../map/Configuration.tsx'; -import { PlainEntitiesList } from '../map/PlainMap.tsx'; +import type { PlainEntitiesList } from '../map/PlainMap.tsx'; import { decodeDecorators } from '../map/Serialization.tsx'; import SpriteVector from '../map/SpriteVector.tsx'; import vec from '../map/vec.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData, { SizeVector } from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type { SizeVector } from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import { winConditionHasVectors } from '../WinConditions.tsx'; import { verifyMap } from './verifyTiles.tsx'; import withModifiers from './withModifiers.tsx'; diff --git a/athena/lib/shouldRemoveUnit.tsx b/athena/lib/shouldRemoveUnit.tsx index 769cca96..7eabae47 100644 --- a/athena/lib/shouldRemoveUnit.tsx +++ b/athena/lib/shouldRemoveUnit.tsx @@ -1,7 +1,7 @@ -import { PlayerID } from '../map/Player.tsx'; -import Unit from '../map/Unit.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Unit from '../map/Unit.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import isFuelConsumingUnit from './isFuelConsumingUnit.tsx'; export default function shouldRemoveUnit( diff --git a/athena/lib/singleTilesToModifiers.tsx b/athena/lib/singleTilesToModifiers.tsx index 797f8835..48b6fc03 100644 --- a/athena/lib/singleTilesToModifiers.tsx +++ b/athena/lib/singleTilesToModifiers.tsx @@ -1,5 +1,5 @@ import { Bridge, getTile, RailBridge } from '../info/Tile.tsx'; -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import { Modifier } from './Modifier.tsx'; export function singleTilesToModifiers(map: MapData) { diff --git a/athena/lib/startGame.tsx b/athena/lib/startGame.tsx index 1ec5ec69..56666788 100644 --- a/athena/lib/startGame.tsx +++ b/athena/lib/startGame.tsx @@ -1,4 +1,4 @@ -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import assignUnitNames from './assignUnitNames.tsx'; import calculateFunds from './calculateFunds.tsx'; import updatePlayer from './updatePlayer.tsx'; diff --git a/athena/lib/updateActivePlayers.tsx b/athena/lib/updateActivePlayers.tsx index 501ecbd2..3db7b7fa 100644 --- a/athena/lib/updateActivePlayers.tsx +++ b/athena/lib/updateActivePlayers.tsx @@ -1,5 +1,7 @@ -import Player, { Bot, HumanPlayer, PlayerID } from '../map/Player.tsx'; -import MapData from '../MapData.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Player from '../map/Player.tsx'; +import { Bot, HumanPlayer } from '../map/Player.tsx'; +import type MapData from '../MapData.tsx'; import updatePlayers from './updatePlayers.tsx'; export default function updateActivePlayers( diff --git a/athena/lib/updatePlayer.tsx b/athena/lib/updatePlayer.tsx index 68f9f359..8e95d8a0 100644 --- a/athena/lib/updatePlayer.tsx +++ b/athena/lib/updatePlayer.tsx @@ -1,5 +1,5 @@ -import Player from '../map/Player.tsx'; -import { Teams } from '../map/Team.tsx'; +import type Player from '../map/Player.tsx'; +import type { Teams } from '../map/Team.tsx'; export default function updatePlayer(teams: Teams, player: Player): Teams { const team = teams.get(player.teamId); diff --git a/athena/lib/updatePlayers.tsx b/athena/lib/updatePlayers.tsx index c13ea4ff..3c226a3b 100644 --- a/athena/lib/updatePlayers.tsx +++ b/athena/lib/updatePlayers.tsx @@ -1,5 +1,5 @@ -import Player from '../map/Player.tsx'; -import { Teams } from '../map/Team.tsx'; +import type Player from '../map/Player.tsx'; +import type { Teams } from '../map/Team.tsx'; import updatePlayer from './updatePlayer.tsx'; export default function updatePlayers( diff --git a/athena/lib/validateMap.tsx b/athena/lib/validateMap.tsx index fda430fc..f7bc699a 100644 --- a/athena/lib/validateMap.tsx +++ b/athena/lib/validateMap.tsx @@ -9,7 +9,8 @@ import { mapBuildingsWithContentRestriction, MaxSkills, } from '../info/Building.tsx'; -import { Skill, Skills } from '../info/Skill.tsx'; +import type { Skill } from '../info/Skill.tsx'; +import { Skills } from '../info/Skill.tsx'; import { getTileInfo } from '../info/Tile.tsx'; import { getUnitInfo, @@ -18,22 +19,21 @@ import { Pioneer, } from '../info/Unit.tsx'; import { Biomes } from '../map/Biome.tsx'; -import Building from '../map/Building.tsx'; +import type Building from '../map/Building.tsx'; import { DecoratorsPerSide, MaxHealth, MaxSize, } from '../map/Configuration.tsx'; -import Entity from '../map/Entity.tsx'; -import Player, { - PlaceholderPlayer, - PlayerID, - toPlayerID, -} from '../map/Player.tsx'; +import type Entity from '../map/Entity.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import type Player from '../map/Player.tsx'; +import { PlaceholderPlayer, toPlayerID } from '../map/Player.tsx'; import Team, { toTeamArray } from '../map/Team.tsx'; -import Unit, { TransportedUnit } from '../map/Unit.tsx'; +import type { TransportedUnit } from '../map/Unit.tsx'; +import type Unit from '../map/Unit.tsx'; import vec from '../map/vec.tsx'; -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import { dropInactivePlayersFromWinConditions, validateWinConditions, @@ -44,7 +44,8 @@ import canPlaceDecorator from './canPlaceDecorator.tsx'; import canPlaceTile from './canPlaceTile.tsx'; import getActivePlayers from './getActivePlayers.tsx'; import indexToVector from './indexToVector.tsx'; -import validateTeams, { TeamsList } from './validateTeams.tsx'; +import type { TeamsList } from './validateTeams.tsx'; +import validateTeams from './validateTeams.tsx'; import withModifiers from './withModifiers.tsx'; export type ErrorReason = diff --git a/athena/lib/validateSkills.tsx b/athena/lib/validateSkills.tsx index 545452b6..6fe8c83d 100644 --- a/athena/lib/validateSkills.tsx +++ b/athena/lib/validateSkills.tsx @@ -1,5 +1,6 @@ -import { Skill, Skills } from '../info/Skill.tsx'; -import MapData from '../MapData.tsx'; +import type { Skill } from '../info/Skill.tsx'; +import { Skills } from '../info/Skill.tsx'; +import type MapData from '../MapData.tsx'; export default function validateSkills( { skillSlots, skills }: { skillSlots: number; skills: Iterable }, diff --git a/athena/lib/validateTeams.tsx b/athena/lib/validateTeams.tsx index 42d65f16..46561693 100644 --- a/athena/lib/validateTeams.tsx +++ b/athena/lib/validateTeams.tsx @@ -1,9 +1,10 @@ import ImmutableMap from '@nkzw/immutable-map'; import { Skills } from '../info/Skill.tsx'; import { DefaultMapSkillSlots } from '../map/Configuration.tsx'; -import { PlaceholderPlayer, PlayerID, toPlayerID } from '../map/Player.tsx'; +import type { PlayerID } from '../map/Player.tsx'; +import { PlaceholderPlayer, toPlayerID } from '../map/Player.tsx'; import Team from '../map/Team.tsx'; -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import validateSkills from './validateSkills.tsx'; export type TeamsList = ReadonlyArray< diff --git a/athena/lib/verifyTiles.tsx b/athena/lib/verifyTiles.tsx index 646c2c55..ef938821 100644 --- a/athena/lib/verifyTiles.tsx +++ b/athena/lib/verifyTiles.tsx @@ -1,8 +1,9 @@ -import { getTileInfo, Plain, TileLayer } from '../info/Tile.tsx'; +import type { TileLayer } from '../info/Tile.tsx'; +import { getTileInfo, Plain } from '../info/Tile.tsx'; import { DecoratorsPerSide } from '../map/Configuration.tsx'; import vec from '../map/vec.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import writeTile from '../mutation/writeTile.tsx'; import canBuild from './canBuild.tsx'; import canPlaceDecorator from './canPlaceDecorator.tsx'; diff --git a/athena/lib/withModifiers.tsx b/athena/lib/withModifiers.tsx index 2556be8f..8a855ccc 100644 --- a/athena/lib/withModifiers.tsx +++ b/athena/lib/withModifiers.tsx @@ -1,4 +1,4 @@ -import MapData from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; import { getAllModifiers } from './getModifier.tsx'; export default function withModifiers(map: MapData) { diff --git a/athena/map/Building.tsx b/athena/map/Building.tsx index 16afa432..7aeaad55 100644 --- a/athena/map/Building.tsx +++ b/athena/map/Building.tsx @@ -1,13 +1,17 @@ import getFirst from '@deities/hephaestus/getFirst.tsx'; import { Barracks, BuildingInfo, getBuildingInfo } from '../info/Building.tsx'; -import { Skill } from '../info/Skill.tsx'; +import type { Skill } from '../info/Skill.tsx'; import filterNullables from '../lib/filterNullables.tsx'; -import { ID } from '../MapData.tsx'; -import { AIBehavior, AIBehaviors } from './AIBehavior.tsx'; +import type { ID } from '../MapData.tsx'; +import type { AIBehavior } from './AIBehavior.tsx'; +import { AIBehaviors } from './AIBehavior.tsx'; import { Biome } from './Biome.tsx'; import { MaxHealth } from './Configuration.tsx'; -import Entity, { PlainEntity } from './Entity.tsx'; -import Player, { PlayerID, toPlayerID } from './Player.tsx'; +import type { PlainEntity } from './Entity.tsx'; +import Entity from './Entity.tsx'; +import type { PlayerID } from './Player.tsx'; +import type Player from './Player.tsx'; +import { toPlayerID } from './Player.tsx'; export type PlainBuilding = PlainEntity & { readonly b?: ReadonlyArray | AIBehavior; diff --git a/athena/map/Configuration.tsx b/athena/map/Configuration.tsx index a2efd2b7..33cb02e5 100644 --- a/athena/map/Configuration.tsx +++ b/athena/map/Configuration.tsx @@ -1,4 +1,4 @@ -import { SizeVector } from '../MapData.tsx'; +import type { SizeVector } from '../MapData.tsx'; export const AnimationSpeed = 180; diff --git a/athena/map/Entity.tsx b/athena/map/Entity.tsx index f02e2e77..0ee3b4b8 100644 --- a/athena/map/Entity.tsx +++ b/athena/map/Entity.tsx @@ -1,10 +1,10 @@ import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { UnitInfo } from '../info/Unit.tsx'; -import { ID } from '../MapData.tsx'; -import Building from './Building.tsx'; +import type { UnitInfo } from '../info/Unit.tsx'; +import type { ID } from '../MapData.tsx'; +import type Building from './Building.tsx'; import { MaxHealth } from './Configuration.tsx'; -import { PlayerID, PlayerIDSet } from './Player.tsx'; -import Unit from './Unit.tsx'; +import type { PlayerID, PlayerIDSet } from './Player.tsx'; +import type Unit from './Unit.tsx'; export type PlainEntity = Readonly<{ f?: 1 | null; diff --git a/athena/map/PlainMap.tsx b/athena/map/PlainMap.tsx index 1fcf1a96..5ab22d17 100644 --- a/athena/map/PlainMap.tsx +++ b/athena/map/PlainMap.tsx @@ -1,10 +1,10 @@ -import { Decorator } from '../info/Decorator.tsx'; -import { ModifierMap, TileMap } from '../MapData.tsx'; -import { PlainWinConditions } from '../WinConditions.tsx'; -import { Biome } from './Biome.tsx'; -import { PlainBuilding } from './Building.tsx'; -import { PlainTeams } from './Team.tsx'; -import { PlainUnit } from './Unit.tsx'; +import type { Decorator } from '../info/Decorator.tsx'; +import type { ModifierMap, TileMap } from '../MapData.tsx'; +import type { PlainWinConditions } from '../WinConditions.tsx'; +import type { Biome } from './Biome.tsx'; +import type { PlainBuilding } from './Building.tsx'; +import type { PlainTeams } from './Team.tsx'; +import type { PlainUnit } from './Unit.tsx'; export type PlainEntitiesList = ReadonlyArray< readonly [x: number, y: number, entity: T] diff --git a/athena/map/Player.tsx b/athena/map/Player.tsx index fd2f58b4..c9d17e05 100644 --- a/athena/map/Player.tsx +++ b/athena/map/Player.tsx @@ -1,11 +1,10 @@ -import { Skill } from '../info/Skill.tsx'; -import MapData from '../MapData.tsx'; +import type { Skill } from '../info/Skill.tsx'; +import type MapData from '../MapData.tsx'; import { Charge, MaxCharges } from './Configuration.tsx'; +import type { PlainPlayerStatistics, PlayerStatistics } from './Statistics.tsx'; import { encodePlayerStatistics, InitialPlayerStatistics, - PlainPlayerStatistics, - PlayerStatistics, } from './Statistics.tsx'; export type PlainPlayerID = number; diff --git a/athena/map/Reward.tsx b/athena/map/Reward.tsx index b993ac0c..602ba72b 100644 --- a/athena/map/Reward.tsx +++ b/athena/map/Reward.tsx @@ -1,5 +1,6 @@ import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { Skill, Skills } from '../info/Skill.tsx'; +import type { Skill } from '../info/Skill.tsx'; +import { Skills } from '../info/Skill.tsx'; type SkillReward = Readonly<{ skill: Skill; diff --git a/athena/map/Serialization.tsx b/athena/map/Serialization.tsx index 15c43c8d..98dc8373 100644 --- a/athena/map/Serialization.tsx +++ b/athena/map/Serialization.tsx @@ -1,25 +1,24 @@ import ImmutableMap from '@nkzw/immutable-map'; -import { Decorator } from '../info/Decorator.tsx'; +import type { Decorator } from '../info/Decorator.tsx'; import getDecoratorIndex from '../lib/getDecoratorIndex.tsx'; -import MapData, { DecoratorMap, SizeVector } from '../MapData.tsx'; -import Building, { PlainBuilding } from './Building.tsx'; +import type { DecoratorMap, SizeVector } from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; +import type { PlainBuilding } from './Building.tsx'; +import Building from './Building.tsx'; import { DecoratorsPerSide } from './Configuration.tsx'; -import Entity from './Entity.tsx'; -import { PlainEntitiesList } from './PlainMap.tsx'; -import Player, { - Bot, - HumanPlayer, - PlaceholderPlayer, - PlainPlayer, - PlayerID, - toPlayerID, -} from './Player.tsx'; +import type Entity from './Entity.tsx'; +import type { PlainEntitiesList } from './PlainMap.tsx'; +import type { PlainPlayer, PlayerID } from './Player.tsx'; +import type Player from './Player.tsx'; +import { Bot, HumanPlayer, PlaceholderPlayer, toPlayerID } from './Player.tsx'; import SpriteVector from './SpriteVector.tsx'; import { decodePlayerStatistics } from './Statistics.tsx'; -import Team, { PlainTeam, Teams } from './Team.tsx'; -import Unit, { PlainUnit } from './Unit.tsx'; +import type { PlainTeam, Teams } from './Team.tsx'; +import Team from './Team.tsx'; +import type { PlainUnit } from './Unit.tsx'; +import Unit from './Unit.tsx'; import vec from './vec.tsx'; -import Vector from './Vector.tsx'; +import type Vector from './Vector.tsx'; export function decodeDecorators( size: SizeVector, diff --git a/athena/map/Team.tsx b/athena/map/Team.tsx index eaa0a53f..74f953ca 100644 --- a/athena/map/Team.tsx +++ b/athena/map/Team.tsx @@ -1,5 +1,6 @@ -import ImmutableMap from '@nkzw/immutable-map'; -import Player, { PlainPlayer, PlayerID } from './Player.tsx'; +import type ImmutableMap from '@nkzw/immutable-map'; +import type { PlainPlayer, PlayerID } from './Player.tsx'; +import type Player from './Player.tsx'; export type PlainTeam = Readonly<{ id: PlayerID; diff --git a/athena/map/Unit.tsx b/athena/map/Unit.tsx index c0829175..68df3e4d 100644 --- a/athena/map/Unit.tsx +++ b/athena/map/Unit.tsx @@ -1,20 +1,16 @@ import sortBy from '@deities/hephaestus/sortBy.tsx'; import { Skill } from '../info/Skill.tsx'; -import { - Ability, - getUnitInfo, - Sniper, - Supply, - UnitInfo, - Weapon, - WeaponID, -} from '../info/Unit.tsx'; +import type { Supply, Weapon, WeaponID } from '../info/Unit.tsx'; +import { Ability, getUnitInfo, Sniper, UnitInfo } from '../info/Unit.tsx'; import getUnitName from '../info/UnitNames.tsx'; import filterNullables from '../lib/filterNullables.tsx'; -import { ID } from '../MapData.tsx'; +import type { ID } from '../MapData.tsx'; import { AIBehavior, AIBehaviors } from './AIBehavior.tsx'; -import Entity, { PlainEntity } from './Entity.tsx'; -import Player, { PlayerID, PlayerIDSet, toPlayerID } from './Player.tsx'; +import type { PlainEntity } from './Entity.tsx'; +import Entity from './Entity.tsx'; +import type { PlayerID, PlayerIDSet } from './Player.tsx'; +import type Player from './Player.tsx'; +import { toPlayerID } from './Player.tsx'; type PlainAmmo = ReadonlyArray<[number, number]>; diff --git a/athena/map/isPlayable.tsx b/athena/map/isPlayable.tsx index 2a1b184a..771db223 100644 --- a/athena/map/isPlayable.tsx +++ b/athena/map/isPlayable.tsx @@ -1,5 +1,7 @@ -import MapData, { AnyEntity } from '../MapData.tsx'; -import Player, { PlayerID } from './Player.tsx'; +import type { AnyEntity } from '../MapData.tsx'; +import type MapData from '../MapData.tsx'; +import type { PlayerID } from './Player.tsx'; +import type Player from './Player.tsx'; export default function isPlayable( map: MapData, diff --git a/athena/mutation/toggleLightningTile.tsx b/athena/mutation/toggleLightningTile.tsx index 0eb0f79f..36477799 100644 --- a/athena/mutation/toggleLightningTile.tsx +++ b/athena/mutation/toggleLightningTile.tsx @@ -1,7 +1,7 @@ import { Lightning } from '../info/Tile.tsx'; import getModifier from '../lib/getModifier.tsx'; -import Vector from '../map/Vector.tsx'; -import MapData from '../MapData.tsx'; +import type Vector from '../map/Vector.tsx'; +import type MapData from '../MapData.tsx'; import writeTile from './writeTile.tsx'; export default function toggleLightningTile(map: MapData, vector: Vector) { diff --git a/athena/mutation/writeTile.tsx b/athena/mutation/writeTile.tsx index 0e09f56f..d157dca6 100644 --- a/athena/mutation/writeTile.tsx +++ b/athena/mutation/writeTile.tsx @@ -1,11 +1,6 @@ -import { - getTile, - getTileInfo, - TileField, - TileInfo, - TileLayer, -} from '../info/Tile.tsx'; -import { ModifierField } from '../MapData.tsx'; +import type { TileField, TileInfo, TileLayer } from '../info/Tile.tsx'; +import { getTile, getTileInfo } from '../info/Tile.tsx'; +import type { ModifierField } from '../MapData.tsx'; const getModifier = (modifier: ModifierField, layer: TileLayer): number => { const isNumber = typeof modifier === 'number'; diff --git a/codegen/generate-actions.tsx b/codegen/generate-actions.tsx index bf887d61..e5ec6033 100755 --- a/codegen/generate-actions.tsx +++ b/codegen/generate-actions.tsx @@ -3,8 +3,8 @@ import { readFileSync, writeFileSync } from 'node:fs'; import { join, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import { parse } from '@babel/parser'; -import { NodePath } from '@babel/traverse'; -import { +import type { NodePath } from '@babel/traverse'; +import type { TSType, TSTypeAliasDeclaration, TSTypeElement, diff --git a/codegen/generate-routes.tsx b/codegen/generate-routes.tsx index 54964f40..7cba7f15 100755 --- a/codegen/generate-routes.tsx +++ b/codegen/generate-routes.tsx @@ -2,8 +2,8 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { parse } from '@babel/parser'; -import { NodePath } from '@babel/traverse'; -import { JSXIdentifier } from '@babel/types'; +import type { NodePath } from '@babel/traverse'; +import type { JSXIdentifier } from '@babel/types'; import chalk from 'chalk'; import { format } from 'prettier'; import isOpenSource from '../infra/isOpenSource.tsx'; diff --git a/codegen/generate-translations.tsx b/codegen/generate-translations.tsx index e6c5b29b..e20a7e61 100755 --- a/codegen/generate-translations.tsx +++ b/codegen/generate-translations.tsx @@ -16,7 +16,7 @@ import { import isPresent from '@deities/hephaestus/isPresent.tsx'; import parseInteger from '@deities/hephaestus/parseInteger.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; -import { CampaignModule, MapModule } from '@deities/hermes/Types.tsx'; +import type { CampaignModule, MapModule } from '@deities/hermes/Types.tsx'; import unrollCampaign from '@deities/hermes/unrollCampaign.tsx'; import chalk from 'chalk'; import { globSync } from 'glob'; diff --git a/codegen/lib/traverse.tsx b/codegen/lib/traverse.tsx index 759d50da..30509064 100644 --- a/codegen/lib/traverse.tsx +++ b/codegen/lib/traverse.tsx @@ -1,9 +1,5 @@ -import traverse, { - Node, - NodePath, - Scope, - TraverseOptions, -} from '@babel/traverse'; +import type { Node, NodePath, Scope, TraverseOptions } from '@babel/traverse'; +import traverse from '@babel/traverse'; type TraverseFn = ( parent: Node, diff --git a/dionysus/AIRegistry.tsx b/dionysus/AIRegistry.tsx index 62c4d5d3..6130b2a4 100644 --- a/dionysus/AIRegistry.tsx +++ b/dionysus/AIRegistry.tsx @@ -1,4 +1,4 @@ -import { AIRegistryT } from '@deities/apollo/actions/executeGameAction.tsx'; +import type { AIRegistryT } from '@deities/apollo/actions/executeGameAction.tsx'; import DionysusAlpha from './DionysusAlpha.tsx'; const AIRegistry: AIRegistryT = new Map([ diff --git a/dionysus/BaseAI.tsx b/dionysus/BaseAI.tsx index 9104d8a1..65d77dc3 100644 --- a/dionysus/BaseAI.tsx +++ b/dionysus/BaseAI.tsx @@ -1,12 +1,13 @@ import { EndTurnAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; -import { Action, execute, MoveAction } from '@deities/apollo/Action.tsx'; -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; -import { Effects } from '@deities/apollo/Effects.tsx'; +import type { Action, MoveAction } from '@deities/apollo/Action.tsx'; +import { execute } from '@deities/apollo/Action.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { Effects } from '@deities/apollo/Effects.tsx'; import applyConditions from '@deities/apollo/lib/applyConditions.tsx'; import gameHasEnded from '@deities/apollo/lib/gameHasEnded.tsx'; -import { GameState } from '@deities/apollo/Types.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type { GameState } from '@deities/apollo/Types.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; class AIInterruptException { public readonly name = 'AIInterruptException'; diff --git a/dionysus/DionysusAlpha.tsx b/dionysus/DionysusAlpha.tsx index 417fb3fb..f144e7eb 100644 --- a/dionysus/DionysusAlpha.tsx +++ b/dionysus/DionysusAlpha.tsx @@ -20,7 +20,8 @@ import { import { Behavior, filterBuildings } from '@deities/athena/info/Building.tsx'; import { getSkillConfig, Skill } from '@deities/athena/info/Skill.tsx'; import { Lightning } from '@deities/athena/info/Tile.tsx'; -import { Ability, UnitInfo } from '@deities/athena/info/Unit.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import { Ability } from '@deities/athena/info/Unit.tsx'; import calculateClusters from '@deities/athena/lib/calculateClusters.tsx'; import calculateFunds from '@deities/athena/lib/calculateFunds.tsx'; import canBuild from '@deities/athena/lib/canBuild.tsx'; @@ -30,17 +31,18 @@ import getDeployableVectors from '@deities/athena/lib/getDeployableVectors.tsx'; import getRescuableVectors from '@deities/athena/lib/getRescuableVectors.tsx'; import getUnitsToRefill from '@deities/athena/lib/getUnitsToRefill.tsx'; import { AIBehavior } from '@deities/athena/map/AIBehavior.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import { Charge } from '@deities/athena/map/Configuration.tsx'; import { EntityType, getEntityGroup, getEntityInfoGroup, } from '@deities/athena/map/Entity.tsx'; -import Player, { PlayerID } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { moveable } from '@deities/athena/Radius.tsx'; import { getOpponentPriorityLabels } from '@deities/athena/WinConditions.tsx'; import groupBy from '@deities/hephaestus/groupBy.tsx'; diff --git a/dionysus/lib/estimateClosestTarget.tsx b/dionysus/lib/estimateClosestTarget.tsx index 2ae19538..737517e7 100644 --- a/dionysus/lib/estimateClosestTarget.tsx +++ b/dionysus/lib/estimateClosestTarget.tsx @@ -2,15 +2,13 @@ import { Lightning } from '@deities/athena/info/Tile.tsx'; import { Ability } from '@deities/athena/info/Unit.tsx'; import getVectorRadius from '@deities/athena/lib/getVectorRadius.tsx'; import { getEntityGroup } from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector, { isVector } from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { - moveable, - MoveConfiguration, - RadiusItem, -} from '@deities/athena/Radius.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import { isVector } from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; +import { moveable, MoveConfiguration } from '@deities/athena/Radius.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import maxBy from '@deities/hephaestus/maxBy.tsx'; import minBy from '@deities/hephaestus/minBy.tsx'; diff --git a/dionysus/lib/findPathToTarget.tsx b/dionysus/lib/findPathToTarget.tsx index 11783f7a..54a5f008 100644 --- a/dionysus/lib/findPathToTarget.tsx +++ b/dionysus/lib/findPathToTarget.tsx @@ -1,9 +1,10 @@ import { AIBehavior } from '@deities/athena/map/AIBehavior.tsx'; import { getEntityGroup } from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { MoveConfiguration, RadiusItem } from '@deities/athena/Radius.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; +import { MoveConfiguration } from '@deities/athena/Radius.tsx'; import minBy from '@deities/hephaestus/minBy.tsx'; import getAttackableArea from './getAttackableArea.tsx'; import getWinConditionVectors from './getWinConditionVectors.tsx'; diff --git a/dionysus/lib/getAttackableArea.tsx b/dionysus/lib/getAttackableArea.tsx index d8a8d710..88ce1a5a 100644 --- a/dionysus/lib/getAttackableArea.tsx +++ b/dionysus/lib/getAttackableArea.tsx @@ -1,5 +1,5 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { attackable } from '@deities/athena/Radius.tsx'; export default function getAttackableArea( diff --git a/dionysus/lib/getAttackableUnitsWithinRadius.tsx b/dionysus/lib/getAttackableUnitsWithinRadius.tsx index 71a1ac7a..9b18668e 100644 --- a/dionysus/lib/getAttackableUnitsWithinRadius.tsx +++ b/dionysus/lib/getAttackableUnitsWithinRadius.tsx @@ -1,7 +1,7 @@ -import Unit from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; export default function getAttackableUnitsWithinRadius( map: MapData, diff --git a/dionysus/lib/getBuildingWeight.tsx b/dionysus/lib/getBuildingWeight.tsx index 52e06947..3d99e299 100644 --- a/dionysus/lib/getBuildingWeight.tsx +++ b/dionysus/lib/getBuildingWeight.tsx @@ -1,9 +1,5 @@ -import { - BuildingInfo, - House, - MinFunds, - RepairShop, -} from '@deities/athena/info/Building.tsx'; +import type { BuildingInfo } from '@deities/athena/info/Building.tsx'; +import { House, MinFunds, RepairShop } from '@deities/athena/info/Building.tsx'; const averageBuildingWeight = ((House.configuration.funds + RepairShop.configuration.funds) / diff --git a/dionysus/lib/getInterestingVectors.tsx b/dionysus/lib/getInterestingVectors.tsx index d76daf0e..9e077a53 100644 --- a/dionysus/lib/getInterestingVectors.tsx +++ b/dionysus/lib/getInterestingVectors.tsx @@ -3,9 +3,9 @@ import { Beach, isSeaTile } from '@deities/athena/info/Tile.tsx'; import { Ability } from '@deities/athena/info/Unit.tsx'; import { AIBehavior } from '@deities/athena/map/AIBehavior.tsx'; import { EntityType, getEntityGroup } from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import getWinConditionVectors from './getWinConditionVectors.tsx'; import needsSupply from './needsSupply.tsx'; import shouldCaptureBuilding from './shouldCaptureBuilding.tsx'; diff --git a/dionysus/lib/getInterestingVectorsByAbilities.tsx b/dionysus/lib/getInterestingVectorsByAbilities.tsx index 5926d432..ff64ad55 100644 --- a/dionysus/lib/getInterestingVectorsByAbilities.tsx +++ b/dionysus/lib/getInterestingVectorsByAbilities.tsx @@ -1,12 +1,13 @@ -import Player, { PlayerID } from '@deities/athena/map/Player.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { winConditionHasVectors, WinCriteria, } from '@deities/athena/WinConditions.tsx'; import { BuildableTiles } from './getInterestingVectors.tsx'; -import { PotentialUnitAbilities } from './getPossibleUnitAbilities.tsx'; +import type { PotentialUnitAbilities } from './getPossibleUnitAbilities.tsx'; import needsSupply from './needsSupply.tsx'; import shouldCaptureBuilding from './shouldCaptureBuilding.tsx'; diff --git a/dionysus/lib/getPossibleAttacks.tsx b/dionysus/lib/getPossibleAttacks.tsx index 1018c898..b737e0ad 100644 --- a/dionysus/lib/getPossibleAttacks.tsx +++ b/dionysus/lib/getPossibleAttacks.tsx @@ -10,13 +10,16 @@ import { MaxHealth, MinDamage, } from '@deities/athena/map/Configuration.tsx'; -import Entity, { isBuilding } from '@deities/athena/map/Entity.tsx'; -import Player, { PlayerID } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { attackable, RadiusItem } from '@deities/athena/Radius.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { isBuilding } from '@deities/athena/map/Entity.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; +import { attackable } from '@deities/athena/Radius.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import shouldAttack from './shouldAttack.tsx'; export type PossibleAttack = Readonly<{ diff --git a/dionysus/lib/getPossibleUnitAbilities.tsx b/dionysus/lib/getPossibleUnitAbilities.tsx index c7b33d66..dcee72e3 100644 --- a/dionysus/lib/getPossibleUnitAbilities.tsx +++ b/dionysus/lib/getPossibleUnitAbilities.tsx @@ -1,6 +1,7 @@ -import { Ability, UnitInfo } from '@deities/athena/info/Unit.tsx'; -import Building from '@deities/athena/map/Building.tsx'; -import Player from '@deities/athena/map/Player.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import { Ability } from '@deities/athena/info/Unit.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; export type PotentialUnitAbilities = Readonly<{ canCreateBuildUnits: boolean; diff --git a/dionysus/lib/getUnitInfosWithMaxVision.tsx b/dionysus/lib/getUnitInfosWithMaxVision.tsx index af7ea02b..eed8f8d7 100644 --- a/dionysus/lib/getUnitInfosWithMaxVision.tsx +++ b/dionysus/lib/getUnitInfosWithMaxVision.tsx @@ -1,4 +1,4 @@ -import { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; export default function getUnitInfosWithMaxVision( diff --git a/dionysus/lib/getWinConditionVectors.tsx b/dionysus/lib/getWinConditionVectors.tsx index 1fb078aa..bdbc94ca 100644 --- a/dionysus/lib/getWinConditionVectors.tsx +++ b/dionysus/lib/getWinConditionVectors.tsx @@ -1,6 +1,6 @@ -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { winConditionHasVectors } from '@deities/athena/WinConditions.tsx'; export default function getWinConditionVectors(map: MapData, unit: Unit) { diff --git a/dionysus/lib/needsSupply.tsx b/dionysus/lib/needsSupply.tsx index 284dcc9c..74aeb05a 100644 --- a/dionysus/lib/needsSupply.tsx +++ b/dionysus/lib/needsSupply.tsx @@ -1,5 +1,5 @@ import hasLowAmmoSupply from '@deities/athena/lib/hasLowAmmoSupply.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; const needsFuel = (unit: Unit) => unit.fuel <= unit.info.configuration.fuel * 0.3; diff --git a/dionysus/lib/shouldAttack.tsx b/dionysus/lib/shouldAttack.tsx index aec7f63d..b0877e48 100644 --- a/dionysus/lib/shouldAttack.tsx +++ b/dionysus/lib/shouldAttack.tsx @@ -1,9 +1,9 @@ import { Ability } from '@deities/athena/info/Unit.tsx'; import { EntityType } from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; export default function shouldAttack( map: MapData, diff --git a/dionysus/lib/shouldCaptureBuilding.tsx b/dionysus/lib/shouldCaptureBuilding.tsx index 63aa36e4..fcbb76da 100644 --- a/dionysus/lib/shouldCaptureBuilding.tsx +++ b/dionysus/lib/shouldCaptureBuilding.tsx @@ -1,8 +1,8 @@ import { Ability } from '@deities/athena/info/Unit.tsx'; -import Building from '@deities/athena/map/Building.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; export default function shouldCaptureBuilding( map: MapData, diff --git a/dionysus/lib/sortByDamage.tsx b/dionysus/lib/sortByDamage.tsx index fc78fdf7..7823e794 100644 --- a/dionysus/lib/sortByDamage.tsx +++ b/dionysus/lib/sortByDamage.tsx @@ -1,11 +1,11 @@ -import { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; import calculateLikelyDamage from '@deities/athena/lib/calculateLikelyDamage.tsx'; import getAttackStatusEffect from '@deities/athena/lib/getAttackStatusEffect.tsx'; import getDefenseStatusEffect from '@deities/athena/lib/getDefenseStatusEffect.tsx'; -import Player from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; export default function sortByDamage( diff --git a/dionysus/lib/sortPossibleAttacks.tsx b/dionysus/lib/sortPossibleAttacks.tsx index 2301fc78..3054c445 100644 --- a/dionysus/lib/sortPossibleAttacks.tsx +++ b/dionysus/lib/sortPossibleAttacks.tsx @@ -1,4 +1,4 @@ -import { PossibleAttack } from './getPossibleAttacks.tsx'; +import type { PossibleAttack } from './getPossibleAttacks.tsx'; export default function sortPossibleAttacks( itemA: PossibleAttack, diff --git a/docs/content/examples/map-editor.tsx b/docs/content/examples/map-editor.tsx index 7eb890b9..52f8c830 100644 --- a/docs/content/examples/map-editor.tsx +++ b/docs/content/examples/map-editor.tsx @@ -2,7 +2,7 @@ import { encodeEffects } from '@deities/apollo/Effects.tsx'; import { Sniper } from '@deities/athena/info/Unit.tsx'; import toSlug from '@deities/hephaestus/toSlug.tsx'; import MapEditor from '@deities/hera/editor/MapEditor.tsx'; -import { +import type { MapCreateVariables, MapObject, MapUpdateVariables, diff --git a/docs/content/playground/PlaygroundGame.tsx b/docs/content/playground/PlaygroundGame.tsx index 77dbe4ba..8bcf587c 100644 --- a/docs/content/playground/PlaygroundGame.tsx +++ b/docs/content/playground/PlaygroundGame.tsx @@ -1,6 +1,6 @@ -import { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; +import type { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; import { prepareSprites } from '@deities/art/Sprites.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import GameMap from '@deities/hera/GameMap.tsx'; import useClientGame from '@deities/hera/hooks/useClientGame.tsx'; import useClientGameAction from '@deities/hera/hooks/useClientGameAction.tsx'; diff --git a/hera/Building.tsx b/hera/Building.tsx index 3f5e9cea..ac6315a6 100644 --- a/hera/Building.tsx +++ b/hera/Building.tsx @@ -1,9 +1,9 @@ import { OilRig, Shipyard } from '@deities/athena/info/Building.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import Building from '@deities/athena/map/Building.tsx'; -import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { applyVar, CSSVariables } from '@deities/ui/cssVar.tsx'; import { css, cx, keyframes } from '@emotion/css'; import { Sprites } from 'athena-crisis:images'; @@ -12,9 +12,9 @@ import Label from './Label.tsx'; import getBuildingSpritePosition from './lib/getBuildingSpritePosition.tsx'; import getFlashDelay from './lib/getFlashDelay.tsx'; import sprite from './lib/sprite.tsx'; -import { BuildingAnimation } from './MapAnimations.tsx'; +import type { BuildingAnimation } from './MapAnimations.tsx'; import Tick from './Tick.tsx'; -import { RequestFrameFunction, TimerFunction } from './Types.tsx'; +import type { RequestFrameFunction, TimerFunction } from './Types.tsx'; const defaultPosition = vec(1, 1); diff --git a/hera/Cursor.tsx b/hera/Cursor.tsx index 38e9cfea..35bd7bca 100644 --- a/hera/Cursor.tsx +++ b/hera/Cursor.tsx @@ -1,4 +1,4 @@ -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { CSSVariables } from '@deities/ui/cssVar.tsx'; import { css, cx } from '@emotion/css'; import { Sprites } from 'athena-crisis:images'; diff --git a/hera/Decorators.tsx b/hera/Decorators.tsx index 970504db..91a91d52 100644 --- a/hera/Decorators.tsx +++ b/hera/Decorators.tsx @@ -1,9 +1,9 @@ import { spriteImage } from '@deities/art/Sprites.tsx'; -import { DecoratorInfo } from '@deities/athena/info/Decorator.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { DecoratorInfo } from '@deities/athena/info/Decorator.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; import { DecoratorsPerSide } from '@deities/athena/map/Configuration.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { CSSVariables } from '@deities/ui/cssVar.tsx'; import useVisibilityState from '@deities/ui/hooks/useVisibilityState.tsx'; import { css, cx } from '@emotion/css'; diff --git a/hera/Fog.tsx b/hera/Fog.tsx index b71d9f34..765653ee 100644 --- a/hera/Fog.tsx +++ b/hera/Fog.tsx @@ -1,10 +1,10 @@ -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import { isSafari } from '@deities/ui/Browser.tsx'; import { css, cx } from '@emotion/css'; import { memo, useLayoutEffect, useRef } from 'react'; -import { TileStyle } from './Tiles.tsx'; +import type { TileStyle } from './Tiles.tsx'; export default memo(function CanvasFog({ fogStyle, diff --git a/hera/GameMap.tsx b/hera/GameMap.tsx index 68642b73..b9b6ef01 100644 --- a/hera/GameMap.tsx +++ b/hera/GameMap.tsx @@ -1,8 +1,9 @@ -import { Action, execute } from '@deities/apollo/Action.tsx'; -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { Action } from '@deities/apollo/Action.tsx'; +import { execute } from '@deities/apollo/Action.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; import getActionResponseVectors from '@deities/apollo/lib/getActionResponseVectors.tsx'; import updateVisibleEntities from '@deities/apollo/lib/updateVisibleEntities.tsx'; -import { +import type { GameActionResponse, GameActionResponses, } from '@deities/apollo/Types.tsx'; @@ -22,12 +23,12 @@ import { SlowAnimationConfig, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID, toPlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { toPlayerID } from '@deities/athena/map/Player.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector, { - sortByVectorKey, - VectorLike, -} from '@deities/athena/map/Vector.tsx'; +import type { VectorLike } from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import { sortByVectorKey } from '@deities/athena/map/Vector.tsx'; import type MapData from '@deities/athena/MapData.tsx'; import { RadiusItem } from '@deities/athena/Radius.tsx'; import { winConditionHasVectors } from '@deities/athena/WinConditions.tsx'; @@ -35,7 +36,8 @@ import dateNow from '@deities/hephaestus/dateNow.tsx'; import parseInteger from '@deities/hephaestus/parseInteger.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import { isIOS } from '@deities/ui/Browser.tsx'; -import Input, { NavigationDirection } from '@deities/ui/controls/Input.tsx'; +import type { NavigationDirection } from '@deities/ui/controls/Input.tsx'; +import Input from '@deities/ui/controls/Input.tsx'; import { rumbleEffect } from '@deities/ui/controls/setupGamePad.tsx'; import throttle from '@deities/ui/controls/throttle.tsx'; import cssVar, { applyVar, CSSVariables } from '@deities/ui/cssVar.tsx'; @@ -49,12 +51,11 @@ import Stack from '@deities/ui/Stack.tsx'; import { css, cx, keyframes } from '@emotion/css'; import ImmutableMap from '@nkzw/immutable-map'; import { AnimatePresence } from 'framer-motion'; -import React, { - Component, - createRef, +import type { MutableRefObject, PointerEvent as ReactPointerEvent, } from 'react'; +import React, { Component, createRef } from 'react'; import processActionResponses from './action-response/processActionResponse.tsx'; import getHealthColor from './behavior/attack/getHealthColor.tsx'; import BaseBehavior from './behavior/Base.tsx'; @@ -62,7 +63,7 @@ import { resetBehavior, setBaseClass } from './behavior/Behavior.tsx'; import MenuBehavior from './behavior/Menu.tsx'; import NullBehavior from './behavior/NullBehavior.tsx'; import Cursor from './Cursor.tsx'; -import { EditorState } from './editor/Types.tsx'; +import type { EditorState } from './editor/Types.tsx'; import addEndTurnAnimations from './lib/addEndTurnAnimations.tsx'; import animateSupply from './lib/animateSupply.tsx'; import isInView from './lib/isInView.tsx'; @@ -70,11 +71,12 @@ import maskClassName, { MaskPointerClassName } from './lib/maskClassName.tsx'; import sleep from './lib/sleep.tsx'; import throwActionError from './lib/throwActionError.tsx'; import MapComponent from './Map.tsx'; -import { Animation, Animations, MapAnimations } from './MapAnimations.tsx'; +import type { Animation, Animations } from './MapAnimations.tsx'; +import { MapAnimations } from './MapAnimations.tsx'; import Mask from './Mask.tsx'; import MaskWithSubtiles from './MaskWithSubtiles.tsx'; import Radius, { RadiusType } from './Radius.tsx'; -import { +import type { Actions, ActionsProcessedEventDetail, AnimationConfigs, diff --git a/hera/Label.tsx b/hera/Label.tsx index b16e2c3f..6de0e7fe 100644 --- a/hera/Label.tsx +++ b/hera/Label.tsx @@ -1,5 +1,6 @@ import { TileSize } from '@deities/athena/map/Configuration.tsx'; -import Entity, { isBuilding } from '@deities/athena/map/Entity.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { isBuilding } from '@deities/athena/map/Entity.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import { css, cx } from '@emotion/css'; import sprite from './lib/sprite.tsx'; diff --git a/hera/Map.tsx b/hera/Map.tsx index 700d3e59..447b7336 100644 --- a/hera/Map.tsx +++ b/hera/Map.tsx @@ -5,14 +5,14 @@ import { MovementType } from '@deities/athena/info/MovementType.tsx'; import { TileInfo } from '@deities/athena/info/Tile.tsx'; import { UnitInfo, Weapon } from '@deities/athena/info/Unit.tsx'; import matchesActiveType from '@deities/athena/lib/matchesActiveType.tsx'; -import BuildingT from '@deities/athena/map/Building.tsx'; +import type BuildingT from '@deities/athena/map/Building.tsx'; import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import Entity from '@deities/athena/map/Entity.tsx'; -import UnitT from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { RadiusItem } from '@deities/athena/Radius.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import type UnitT from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import { css, cx } from '@emotion/css'; import Images from 'athena-crisis:images'; // eslint-disable-next-line @deities/no-lazy-import @@ -33,17 +33,15 @@ import { WeaponMap, } from './i18n/EntityMap.tsx'; import injectTranslation from './i18n/injectTranslation.tsx'; -import { - Animation, - Animations, - isBuildingAnimation, - isUnitAnimation, -} from './MapAnimations.tsx'; -import { RadiusInfo, RadiusType } from './Radius.tsx'; +import type { Animation, Animations } from './MapAnimations.tsx'; +import { isBuildingAnimation, isUnitAnimation } from './MapAnimations.tsx'; +import type { RadiusInfo } from './Radius.tsx'; +import { RadiusType } from './Radius.tsx'; import Tick from './Tick.tsx'; import TileDecorators from './TileDecorators.tsx'; -import Tiles, { TileStyle } from './Tiles.tsx'; -import { +import type { TileStyle } from './Tiles.tsx'; +import Tiles from './Tiles.tsx'; +import type { GetLayerFunction, MapBehavior, RequestFrameFunction, diff --git a/hera/MapAnimations.tsx b/hera/MapAnimations.tsx index 06a3c3f9..caf8e5e7 100644 --- a/hera/MapAnimations.tsx +++ b/hera/MapAnimations.tsx @@ -1,23 +1,28 @@ -import { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; -import { SoundName } from '@deities/athena/info/Music.tsx'; -import { TileInfo } from '@deities/athena/info/Tile.tsx'; -import { UnitAnimationSprite, Weapon } from '@deities/athena/info/Unit.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; +import type { SoundName } from '@deities/athena/info/Music.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; +import type { + UnitAnimationSprite, + Weapon, +} from '@deities/athena/info/Unit.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; import { AnimationConfig, InstantAnimationConfig, } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { BaseColor } from '@deities/ui/getColor.tsx'; -import ImmutableMap from '@nkzw/immutable-map'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; +import type ImmutableMap from '@nkzw/immutable-map'; import { AnimatePresence } from 'framer-motion'; -import { ReactNode, useEffect, useMemo, useState } from 'react'; +import type { ReactNode } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import AttackAnimation from './animations/AttackAnimation.tsx'; import BuildingCreate from './animations/BuildingCreate.tsx'; -import Explosion, { ExplosionStyle } from './animations/Explosion.tsx'; +import type { ExplosionStyle } from './animations/Explosion.tsx'; +import Explosion from './animations/Explosion.tsx'; import Fireworks from './animations/Fireworks.tsx'; import Heal from './animations/Heal.tsx'; import HealthAnimation from './animations/HealthAnimation.tsx'; @@ -26,7 +31,7 @@ import Sabotage from './animations/Sabotage.tsx'; import Shake from './animations/Shake.tsx'; import Spawn from './animations/Spawn.tsx'; import UpgradeAnimation from './animations/UpgradeAnimation.tsx'; -import { +import type { Actions, FactionNames, GetLayerFunction, @@ -36,7 +41,8 @@ import { import Banner from './ui/Banner.tsx'; import CharacterMessage from './ui/CharacterMessage.tsx'; import FlashFlyout from './ui/FlashFlyout.tsx'; -import { FlyoutColor, FlyoutItem } from './ui/Flyout.tsx'; +import type { FlyoutColor } from './ui/Flyout.tsx'; +import { FlyoutItem } from './ui/Flyout.tsx'; import Message from './ui/Message.tsx'; import Notice from './ui/Notice.tsx'; diff --git a/hera/Mask.tsx b/hera/Mask.tsx index 6cc1e1af..95ede54e 100644 --- a/hera/Mask.tsx +++ b/hera/Mask.tsx @@ -1,22 +1,19 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { RadiusItem } from '@deities/athena/Radius.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; import parseInteger from '@deities/hephaestus/parseInteger.tsx'; -import usePress, { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; +import type { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; +import usePress from '@deities/ui/hooks/usePress.tsx'; import { css, cx } from '@emotion/css'; -import React, { - memo, - MutableRefObject, - RefObject, - useCallback, - useMemo, -} from 'react'; +import type { MutableRefObject, RefObject } from 'react'; +import React, { memo, useCallback, useMemo } from 'react'; import maskClassName, { MaskPointerClassName } from './lib/maskClassName.tsx'; import toTransformOrigin from './lib/toTransformOrigin.tsx'; -import { RadiusInfo, RadiusType } from './Radius.tsx'; -import { MapEnterType } from './Types.tsx'; +import type { RadiusInfo } from './Radius.tsx'; +import { RadiusType } from './Radius.tsx'; +import type { MapEnterType } from './Types.tsx'; enum Priority { High = 2, diff --git a/hera/MaskWithSubtiles.tsx b/hera/MaskWithSubtiles.tsx index 83280dbb..271d99be 100644 --- a/hera/MaskWithSubtiles.tsx +++ b/hera/MaskWithSubtiles.tsx @@ -1,11 +1,11 @@ import { DecoratorsPerSide } from '@deities/athena/map/Configuration.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { css, cx } from '@emotion/css'; import React, { memo, useMemo } from 'react'; import maskClassName, { MaskPointerClassName } from './lib/maskClassName.tsx'; -import { BaseMaskProps } from './Mask.tsx'; -import { MapEnterType } from './Types.tsx'; +import type { BaseMaskProps } from './Mask.tsx'; +import type { MapEnterType } from './Types.tsx'; export default memo(function MaskWithSubtiles({ enter, diff --git a/hera/Radius.tsx b/hera/Radius.tsx index 3d6ac639..46896258 100644 --- a/hera/Radius.tsx +++ b/hera/Radius.tsx @@ -1,18 +1,18 @@ import { Ability } from '@deities/athena/info/Unit.tsx'; import { Biome } from '@deities/athena/map/Biome.tsx'; import isPlayable from '@deities/athena/map/isPlayable.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { RadiusItem } from '@deities/athena/Radius.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import { CSSVariables } from '@deities/ui/cssVar.tsx'; import { css, cx, keyframes } from '@emotion/css'; import { motion } from 'framer-motion'; import React, { memo } from 'react'; -import { GetLayerFunction } from './Types.tsx'; +import type { GetLayerFunction } from './Types.tsx'; export enum RadiusType { Attack, diff --git a/hera/Tick.tsx b/hera/Tick.tsx index 9847fdc9..ccf9b29c 100644 --- a/hera/Tick.tsx +++ b/hera/Tick.tsx @@ -4,7 +4,8 @@ import { } from '@deities/athena/info/Tile.tsx'; import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; import cssVar, { applyVar, CSSVariables } from '@deities/ui/cssVar.tsx'; -import React, { ReactNode, useCallback, useRef } from 'react'; +import type { ReactNode } from 'react'; +import React, { useCallback, useRef } from 'react'; import { getIdleFrame, useTick } from './lib/tick.tsx'; const UnitAnimation = { diff --git a/hera/TileDecorator.tsx b/hera/TileDecorator.tsx index a8c31e8b..b80fac1b 100644 --- a/hera/TileDecorator.tsx +++ b/hera/TileDecorator.tsx @@ -1,8 +1,8 @@ -import { TileInfo } from '@deities/athena/info/Tile.tsx'; -import { Modifier } from '@deities/athena/lib/Modifier.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; +import type { Modifier } from '@deities/athena/lib/Modifier.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { isSafari } from '@deities/ui/Browser.tsx'; import { css, cx } from '@emotion/css'; import { Sprites } from 'athena-crisis:images'; diff --git a/hera/TileDecorators.tsx b/hera/TileDecorators.tsx index 7b4499dd..26be04dd 100644 --- a/hera/TileDecorators.tsx +++ b/hera/TileDecorators.tsx @@ -1,10 +1,10 @@ import { getTileInfo, StormCloud } from '@deities/athena/info/Tile.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; -import { RadiusInfo } from './Radius.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; +import type { RadiusInfo } from './Radius.tsx'; import TileDecorator from './TileDecorator.tsx'; -import { GetLayerFunction } from './Types.tsx'; +import type { GetLayerFunction } from './Types.tsx'; export default function TileDecorators({ getLayer, diff --git a/hera/Tiles.tsx b/hera/Tiles.tsx index 6e4ecb32..831e267b 100644 --- a/hera/Tiles.tsx +++ b/hera/Tiles.tsx @@ -1,19 +1,19 @@ import { spriteImage } from '@deities/art/Sprites.tsx'; import { Shelter } from '@deities/athena/info/Building.tsx'; +import type { TileInfo, TileLayer } from '@deities/athena/info/Tile.tsx'; import { Campsite, getFloatingEdgeAnimation, getTileInfo, - TileInfo, - TileLayer, } from '@deities/athena/info/Tile.tsx'; import getBiomeStyle from '@deities/athena/lib/getBiomeStyle.tsx'; import getFloatingEdgeModifier from '@deities/athena/lib/getFloatingEdgeModifier.tsx'; import { Biome } from '@deities/athena/map/Biome.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData, { ModifierField } from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { ModifierField } from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import useVisibilityState from '@deities/ui/hooks/useVisibilityState.tsx'; import { Tiles0, diff --git a/hera/Types.tsx b/hera/Types.tsx index e46769d2..34b4d778 100644 --- a/hera/Types.tsx +++ b/hera/Types.tsx @@ -1,28 +1,32 @@ -import { Action, MutateActionResponseFn } from '@deities/apollo/Action.tsx'; -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; -import { +import type { + Action, + MutateActionResponseFn, +} from '@deities/apollo/Action.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { GameActionResponse, GameActionResponses, } from '@deities/apollo/Types.tsx'; -import { DecoratorInfo } from '@deities/athena/info/Decorator.tsx'; -import { Skill } from '@deities/athena/info/Skill.tsx'; -import { TileInfo } from '@deities/athena/info/Tile.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type { DecoratorInfo } from '@deities/athena/info/Decorator.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData, { ModifierField } from '@deities/athena/MapData.tsx'; -import { RadiusItem } from '@deities/athena/Radius.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; -import { NavigationDirection } from '@deities/ui/controls/Input.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { ModifierField } from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; +import type { NavigationDirection } from '@deities/ui/controls/Input.tsx'; import type { ReactElement, ReactNode } from 'react'; -import { ConfirmProps } from './behavior/confirm/ConfirmAction.tsx'; -import { EditorState, SetEditorStateFunction } from './editor/Types.tsx'; -import { Animations } from './MapAnimations.tsx'; -import { RadiusInfo } from './Radius.tsx'; -import { TileStyle } from './Tiles.tsx'; +import type { ConfirmProps } from './behavior/confirm/ConfirmAction.tsx'; +import type { EditorState, SetEditorStateFunction } from './editor/Types.tsx'; +import type { Animations } from './MapAnimations.tsx'; +import type { RadiusInfo } from './Radius.tsx'; +import type { TileStyle } from './Tiles.tsx'; export type Size = Readonly<{ height: number; diff --git a/hera/Unit.tsx b/hera/Unit.tsx index 5779c04d..d90bbadd 100644 --- a/hera/Unit.tsx +++ b/hera/Unit.tsx @@ -1,7 +1,8 @@ -import { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; -import { MovementType } from '@deities/athena/info/MovementType.tsx'; -import { isSea, TileInfo } from '@deities/athena/info/Tile.tsx'; -import { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import type { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; +import type { MovementType } from '@deities/athena/info/MovementType.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; +import { isSea } from '@deities/athena/info/Tile.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; import hasLowAmmoSupply from '@deities/athena/lib/hasLowAmmoSupply.tsx'; import isFuelConsumingUnit from '@deities/athena/lib/isFuelConsumingUnit.tsx'; import { Biome } from '@deities/athena/map/Biome.tsx'; @@ -9,23 +10,23 @@ import { AnimationConfig, MaxHealth, } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import { applyVar, CSSVariables } from '@deities/ui/cssVar.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; import { css, cx, keyframes } from '@emotion/css'; import { ShadowImages, Sprites } from 'athena-crisis:images'; import { useEffect, useRef } from 'react'; -import { AnimationDirection } from './animations/Animation.tsx'; +import type { AnimationDirection } from './animations/Animation.tsx'; import Label from './Label.tsx'; import getFlashDelay from './lib/getFlashDelay.tsx'; import getUnitDirection from './lib/getUnitDirection.tsx'; import sprite from './lib/sprite.tsx'; -import { +import type { AttackAnimation, MoveAnimation, UnfoldAnimation, @@ -34,7 +35,7 @@ import { UnitHealAnimation, } from './MapAnimations.tsx'; import Tick from './Tick.tsx'; -import { +import type { GetLayerFunction, RequestFrameFunction, TimerFunction, diff --git a/hera/action-response/ActionResponseError.tsx b/hera/action-response/ActionResponseError.tsx index 86f3ad17..ca4a32a8 100644 --- a/hera/action-response/ActionResponseError.tsx +++ b/hera/action-response/ActionResponseError.tsx @@ -1,5 +1,5 @@ -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; export default class ActionResponseError extends Error { constructor( diff --git a/hera/action-response/processActionResponse.tsx b/hera/action-response/processActionResponse.tsx index 399a65c0..49f596c8 100644 --- a/hera/action-response/processActionResponse.tsx +++ b/hera/action-response/processActionResponse.tsx @@ -2,20 +2,19 @@ import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; import getActionResponseVectors from '@deities/apollo/lib/getActionResponseVectors.tsx'; import updateVisibleEntities from '@deities/apollo/lib/updateVisibleEntities.tsx'; -import { +import type { GameActionResponse, GameActionResponses, } from '@deities/apollo/Types.tsx'; import getUnitsToRefill from '@deities/athena/lib/getUnitsToRefill.tsx'; import refillUnits from '@deities/athena/lib/refillUnits.tsx'; -import { - PlayerID, - resolveDynamicPlayerID, -} from '@deities/athena/map/Player.tsx'; -import Vector, { sortByVectorKey } from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { resolveDynamicPlayerID } from '@deities/athena/map/Player.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import { sortByVectorKey } from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { moveable, RadiusItem } from '@deities/athena/Radius.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import dateNow from '@deities/hephaestus/dateNow.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import arrayShuffle from 'array-shuffle'; @@ -58,7 +57,7 @@ import sleep from '../lib/sleep.tsx'; import spawn from '../lib/spawn.tsx'; import startGameAnimation from '../lib/startGameAnimation.tsx'; import { RadiusType } from '../Radius.tsx'; -import { +import type { Actions, AnimationConfigs, State, diff --git a/hera/animations/Animation.tsx b/hera/animations/Animation.tsx index 01953306..97389e63 100644 --- a/hera/animations/Animation.tsx +++ b/hera/animations/Animation.tsx @@ -1,11 +1,13 @@ -import { SoundName } from '@deities/athena/info/Music.tsx'; -import { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type { SoundName } from '@deities/athena/info/Music.tsx'; +import type { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; -import { Rumble, rumbleEffect } from '@deities/ui/controls/setupGamePad.tsx'; -import { CSSProperties, useCallback, useEffect } from 'react'; +import type { Rumble } from '@deities/ui/controls/setupGamePad.tsx'; +import { rumbleEffect } from '@deities/ui/controls/setupGamePad.tsx'; +import type { CSSProperties } from 'react'; +import { useCallback, useEffect } from 'react'; import sprite from '../lib/sprite.tsx'; -import { RequestFrameFunction, TimerFunction } from '../Types.tsx'; +import type { RequestFrameFunction, TimerFunction } from '../Types.tsx'; export type AnimationDirection = 'left' | 'right' | 'up' | 'down'; diff --git a/hera/animations/AttackAnimation.tsx b/hera/animations/AttackAnimation.tsx index 933ba78c..05412054 100644 --- a/hera/animations/AttackAnimation.tsx +++ b/hera/animations/AttackAnimation.tsx @@ -1,16 +1,18 @@ -import { AttackSprite } from '@deities/athena/info/AttackSprite.tsx'; -import { SoundName } from '@deities/athena/info/Music.tsx'; -import { +import type { AttackSprite } from '@deities/athena/info/AttackSprite.tsx'; +import type { SoundName } from '@deities/athena/info/Music.tsx'; +import type { AttackSpriteWithVariants, WeaponAnimation, } from '@deities/athena/info/Unit.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { AttackSprites } from 'athena-crisis:images'; -import React, { CSSProperties } from 'react'; +import type { CSSProperties } from 'react'; +import React from 'react'; import attackSpriteHasVariants from '../lib/attackSpriteHasVariants.tsx'; -import Animation, { AnimationDirection, AnimationProps } from './Animation.tsx'; +import type { AnimationDirection, AnimationProps } from './Animation.tsx'; +import Animation from './Animation.tsx'; import generateFrames from './generateFrames.tsx'; const actualDirections: Record = { diff --git a/hera/animations/BuildingCreate.tsx b/hera/animations/BuildingCreate.tsx index 104b1cf2..3c8133d1 100644 --- a/hera/animations/BuildingCreate.tsx +++ b/hera/animations/BuildingCreate.tsx @@ -1,8 +1,9 @@ import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import React, { useCallback } from 'react'; -import { StateToStateLike, UpdateFunction } from '../Types.tsx'; -import Animation, { AnimationProps } from './Animation.tsx'; +import type { StateToStateLike, UpdateFunction } from '../Types.tsx'; +import type { AnimationProps } from './Animation.tsx'; +import Animation from './Animation.tsx'; import generateFrames from './generateFrames.tsx'; const spriteSize = 48; diff --git a/hera/animations/Explosion.tsx b/hera/animations/Explosion.tsx index 25ecbd6b..820c1f23 100644 --- a/hera/animations/Explosion.tsx +++ b/hera/animations/Explosion.tsx @@ -1,12 +1,14 @@ -import { SoundName } from '@deities/athena/info/Music.tsx'; -import { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { SoundName } from '@deities/athena/info/Music.tsx'; +import type { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { Sprites } from 'athena-crisis:images'; -import React, { CSSProperties, useCallback } from 'react'; -import { StateToStateLike, UpdateFunction } from '../Types.tsx'; -import Animation, { AnimationProps } from './Animation.tsx'; +import type { CSSProperties } from 'react'; +import React, { useCallback } from 'react'; +import type { StateToStateLike, UpdateFunction } from '../Types.tsx'; +import type { AnimationProps } from './Animation.tsx'; +import Animation from './Animation.tsx'; import generateFrames from './generateFrames.tsx'; export type ExplosionStyle = diff --git a/hera/animations/Fireworks.tsx b/hera/animations/Fireworks.tsx index 38d7e826..370913ad 100644 --- a/hera/animations/Fireworks.tsx +++ b/hera/animations/Fireworks.tsx @@ -1,8 +1,9 @@ import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { Sprites } from 'athena-crisis:images'; import React, { useMemo } from 'react'; -import Animation, { AnimationProps } from './Animation.tsx'; +import type { AnimationProps } from './Animation.tsx'; +import Animation from './Animation.tsx'; import generateFrames from './generateFrames.tsx'; const spriteSize = 64; diff --git a/hera/animations/Heal.tsx b/hera/animations/Heal.tsx index fa8e28bb..85fe5379 100644 --- a/hera/animations/Heal.tsx +++ b/hera/animations/Heal.tsx @@ -1,7 +1,8 @@ import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { Sprites } from 'athena-crisis:images'; -import Animation, { AnimationProps } from './Animation.tsx'; +import type { AnimationProps } from './Animation.tsx'; +import Animation from './Animation.tsx'; import generateFrames from './generateFrames.tsx'; const spriteSize = 36; diff --git a/hera/animations/HealthAnimation.tsx b/hera/animations/HealthAnimation.tsx index 50569576..49b74db4 100644 --- a/hera/animations/HealthAnimation.tsx +++ b/hera/animations/HealthAnimation.tsx @@ -1,5 +1,5 @@ -import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { isIOS, isSafari } from '@deities/ui/Browser.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import getColor from '@deities/ui/getColor.tsx'; @@ -8,7 +8,7 @@ import { css } from '@emotion/css'; import { motion } from 'framer-motion'; import React, { useEffect } from 'react'; import getDamageColor from '../behavior/attack/getDamageColor.tsx'; -import { ClearTimerFunction, TimerFunction } from '../Types.tsx'; +import type { ClearTimerFunction, TimerFunction } from '../Types.tsx'; export default function HealthAnimation({ animationConfig, diff --git a/hera/animations/Rescue.tsx b/hera/animations/Rescue.tsx index 5a27aec1..ecbed9c8 100644 --- a/hera/animations/Rescue.tsx +++ b/hera/animations/Rescue.tsx @@ -1,8 +1,9 @@ import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { useCallback } from 'react'; -import { StateToStateLike, UpdateFunction } from '../Types.tsx'; -import Animation, { AnimationProps } from './Animation.tsx'; +import type { StateToStateLike, UpdateFunction } from '../Types.tsx'; +import type { AnimationProps } from './Animation.tsx'; +import Animation from './Animation.tsx'; import generateFrames from './generateFrames.tsx'; const spriteSize = 48; diff --git a/hera/animations/Sabotage.tsx b/hera/animations/Sabotage.tsx index 1565caff..df47044d 100644 --- a/hera/animations/Sabotage.tsx +++ b/hera/animations/Sabotage.tsx @@ -1,7 +1,8 @@ import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { Sprites } from 'athena-crisis:images'; -import Animation, { AnimationProps } from './Animation.tsx'; +import type { AnimationProps } from './Animation.tsx'; +import Animation from './Animation.tsx'; import generateFrames from './generateFrames.tsx'; const spriteSize = 42; diff --git a/hera/animations/Shake.tsx b/hera/animations/Shake.tsx index e05d03e2..ff422c34 100644 --- a/hera/animations/Shake.tsx +++ b/hera/animations/Shake.tsx @@ -1,6 +1,6 @@ -import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; import { useEffect } from 'react'; -import { ClearTimerFunction, TimerFunction } from '../Types.tsx'; +import type { ClearTimerFunction, TimerFunction } from '../Types.tsx'; export default function Shake({ animationConfig, diff --git a/hera/animations/Spawn.tsx b/hera/animations/Spawn.tsx index 861adb75..4c1b8384 100644 --- a/hera/animations/Spawn.tsx +++ b/hera/animations/Spawn.tsx @@ -1,8 +1,9 @@ import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import React, { useCallback } from 'react'; -import { StateToStateLike, UpdateFunction } from '../Types.tsx'; -import Animation, { AnimationProps } from './Animation.tsx'; +import type { StateToStateLike, UpdateFunction } from '../Types.tsx'; +import type { AnimationProps } from './Animation.tsx'; +import Animation from './Animation.tsx'; import generateFrames from './generateFrames.tsx'; const spriteSize = 48; diff --git a/hera/animations/UpgradeAnimation.tsx b/hera/animations/UpgradeAnimation.tsx index e9d7966e..89a1a665 100644 --- a/hera/animations/UpgradeAnimation.tsx +++ b/hera/animations/UpgradeAnimation.tsx @@ -1,9 +1,10 @@ import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { Sprites } from 'athena-crisis:images'; import React, { useCallback } from 'react'; -import { StateToStateLike, UpdateFunction } from '../Types.tsx'; -import Animation, { AnimationProps } from './Animation.tsx'; +import type { StateToStateLike, UpdateFunction } from '../Types.tsx'; +import type { AnimationProps } from './Animation.tsx'; +import Animation from './Animation.tsx'; import generateFrames from './generateFrames.tsx'; const spriteSize = 80; diff --git a/hera/animations/addExplosionAnimation.tsx b/hera/animations/addExplosionAnimation.tsx index 2910ae1a..6ea36049 100644 --- a/hera/animations/addExplosionAnimation.tsx +++ b/hera/animations/addExplosionAnimation.tsx @@ -1,11 +1,13 @@ -import { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; -import { Beach, isSea, MaybeTileID } from '@deities/athena/info/Tile.tsx'; +import type { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; +import type { MaybeTileID } from '@deities/athena/info/Tile.tsx'; +import { Beach, isSea } from '@deities/athena/info/Tile.tsx'; import isAmphibiousOnLand from '@deities/athena/lib/isAmphibiousOnLand.tsx'; -import Entity, { getEntityGroup, isUnit } from '@deities/athena/map/Entity.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { getEntityGroup, isUnit } from '@deities/athena/map/Entity.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import AnimationKey from '../lib/AnimationKey.tsx'; -import { Animations } from '../MapAnimations.tsx'; -import { State, StateToStateLike } from '../Types.tsx'; +import type { Animations } from '../MapAnimations.tsx'; +import type { State, StateToStateLike } from '../Types.tsx'; const isSeaExceptBeach = (id: MaybeTileID | null) => !id || (isSea(id) && id !== Beach.id); diff --git a/hera/animations/attackActionAnimation.tsx b/hera/animations/attackActionAnimation.tsx index 16aae031..e2d68b98 100644 --- a/hera/animations/attackActionAnimation.tsx +++ b/hera/animations/attackActionAnimation.tsx @@ -1,9 +1,9 @@ -import { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; -import { AttackStance, Weapon } from '@deities/athena/info/Unit.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; +import type { AttackStance, Weapon } from '@deities/athena/info/Unit.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import AnimationKey from '../lib/AnimationKey.tsx'; -import { Actions, State } from '../Types.tsx'; +import type { Actions, State } from '../Types.tsx'; export default function attackActionAnimation( { update }: Actions, diff --git a/hera/animations/attackFlashAnimation.tsx b/hera/animations/attackFlashAnimation.tsx index cf710821..80a12ea7 100644 --- a/hera/animations/attackFlashAnimation.tsx +++ b/hera/animations/attackFlashAnimation.tsx @@ -1,6 +1,6 @@ -import { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import { Actions, State } from '../Types.tsx'; +import type { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { Actions, State } from '../Types.tsx'; type Options = Readonly<{ direction: AttackDirection; diff --git a/hera/animations/explosionAnimation.tsx b/hera/animations/explosionAnimation.tsx index 5b77f8f9..d9095e55 100644 --- a/hera/animations/explosionAnimation.tsx +++ b/hera/animations/explosionAnimation.tsx @@ -1,8 +1,9 @@ -import { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; -import Entity, { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { Actions, State } from '../Types.tsx'; +import type { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { Actions, State } from '../Types.tsx'; import addExplosionAnimation from './addExplosionAnimation.tsx'; export default function explosionAnimation( diff --git a/hera/animations/generateFrames.tsx b/hera/animations/generateFrames.tsx index c8b53891..49931d60 100644 --- a/hera/animations/generateFrames.tsx +++ b/hera/animations/generateFrames.tsx @@ -1,4 +1,4 @@ -import { CSSProperties } from 'react'; +import type { CSSProperties } from 'react'; export default function generateFrames( spriteSize: number, diff --git a/hera/animations/secretDiscoveredAnimation.tsx b/hera/animations/secretDiscoveredAnimation.tsx index eaa6de8a..ef94f782 100644 --- a/hera/animations/secretDiscoveredAnimation.tsx +++ b/hera/animations/secretDiscoveredAnimation.tsx @@ -1,10 +1,10 @@ -import { SecretDiscoveredActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { SecretDiscoveredActionResponse } from '@deities/apollo/ActionResponse.tsx'; import { fbt } from 'fbt'; import { resetBehavior } from '../behavior/Behavior.tsx'; import NullBehavior from '../behavior/NullBehavior.tsx'; import AnimationKey from '../lib/AnimationKey.tsx'; import getWinCriteriaName from '../lib/getWinCriteriaName.tsx'; -import { Actions, State } from '../Types.tsx'; +import type { Actions, State } from '../Types.tsx'; export default async function secretDiscoveredAnimation( actions: Actions, diff --git a/hera/audio/LoggedOutVolumeControl.tsx b/hera/audio/LoggedOutVolumeControl.tsx index 1d5472d9..24695487 100644 --- a/hera/audio/LoggedOutVolumeControl.tsx +++ b/hera/audio/LoggedOutVolumeControl.tsx @@ -1,7 +1,7 @@ import { DoubleSize } from '@deities/athena/map/Configuration.tsx'; import MenuButton from '@deities/ui/MenuButton.tsx'; import { css, cx } from '@emotion/css'; -import { ComponentProps } from 'react'; +import type { ComponentProps } from 'react'; import VolumeControl from './VolumeControl.tsx'; export default function LoggedOutVolumeControl({ diff --git a/hera/audio/Music.tsx b/hera/audio/Music.tsx index ddcbed96..19bce3dd 100644 --- a/hera/audio/Music.tsx +++ b/hera/audio/Music.tsx @@ -1,9 +1,10 @@ -import { SongName } from '@deities/athena/info/Music.tsx'; +import type { SongName } from '@deities/athena/info/Music.tsx'; import { Biome } from '@deities/athena/map/Biome.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import useLocation from '@deities/ui/hooks/useLocation.tsx'; -import { createContext, ReactNode, useContext, useEffect } from 'react'; +import type { ReactNode } from 'react'; +import { createContext, useContext, useEffect } from 'react'; type MusicContext = { songByRoute: Map; diff --git a/hera/audio/VolumeControl.tsx b/hera/audio/VolumeControl.tsx index 66a01452..e41c4208 100644 --- a/hera/audio/VolumeControl.tsx +++ b/hera/audio/VolumeControl.tsx @@ -1,5 +1,6 @@ import parseInteger from '@deities/hephaestus/parseInteger.tsx'; -import AudioPlayer, { AudioVolumeType } from '@deities/ui/AudioPlayer.tsx'; +import type { AudioVolumeType } from '@deities/ui/AudioPlayer.tsx'; +import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import useInput from '@deities/ui/controls/useInput.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import Icon from '@deities/ui/Icon.tsx'; @@ -9,7 +10,8 @@ import VolumeXIcon from '@deities/ui/icons/VolumeX.tsx'; import Slider from '@deities/ui/Slider.tsx'; import { css } from '@emotion/css'; import Volume3Icon from '@iconify-icons/pixelarticons/volume-3.js'; -import { ChangeEvent, useCallback, useRef, useState } from 'react'; +import type { ChangeEvent } from 'react'; +import { useCallback, useRef, useState } from 'react'; export default function VolumeControl({ canPause = true, diff --git a/hera/behavior/AbstractSelectBehavior.tsx b/hera/behavior/AbstractSelectBehavior.tsx index cf97fbad..837d63b9 100644 --- a/hera/behavior/AbstractSelectBehavior.tsx +++ b/hera/behavior/AbstractSelectBehavior.tsx @@ -1,9 +1,9 @@ -import Building from '@deities/athena/map/Building.tsx'; -import Entity from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { useCallback } from 'react'; -import { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; +import type { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; import SelectEntity from '../ui/SelectEntity.tsx'; import { resetBehavior, selectFallback } from './Behavior.tsx'; diff --git a/hera/behavior/Attack.tsx b/hera/behavior/Attack.tsx index 84379596..a2ffebe7 100644 --- a/hera/behavior/Attack.tsx +++ b/hera/behavior/Attack.tsx @@ -1,9 +1,9 @@ -import Entity from '@deities/athena/map/Entity.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import getFirst from '@deities/hephaestus/getFirst.tsx'; import { useCallback } from 'react'; import { RadiusType } from '../Radius.tsx'; -import { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; +import type { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; import attackAction from './attack/attackAction.tsx'; import AttackSelector from './attack/AttackSelector.tsx'; import getAttackableEntities from './attack/getAttackableEntities.tsx'; diff --git a/hera/behavior/AttackRadius.tsx b/hera/behavior/AttackRadius.tsx index 1420ecff..74885df2 100644 --- a/hera/behavior/AttackRadius.tsx +++ b/hera/behavior/AttackRadius.tsx @@ -1,5 +1,5 @@ -import Vector from '@deities/athena/map/Vector.tsx'; -import { RadiusItem } from '@deities/athena/Radius.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; import { RadiusType } from '../Radius.tsx'; import { resetBehavior, selectFallback } from './Behavior.tsx'; diff --git a/hera/behavior/Base.tsx b/hera/behavior/Base.tsx index 494d875e..b92d5693 100644 --- a/hera/behavior/Base.tsx +++ b/hera/behavior/Base.tsx @@ -1,14 +1,15 @@ import { Behavior } from '@deities/athena/info/Building.tsx'; import getAttackableEntitiesInRange from '@deities/athena/lib/getAttackableEntitiesInRange.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import Entity, { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; import isPlayable from '@deities/athena/map/isPlayable.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { attackable, moveable } from '@deities/athena/Radius.tsx'; import { RadiusType } from '../Radius.tsx'; -import { Actions, State, StateLike } from '../Types.tsx'; +import type { Actions, State, StateLike } from '../Types.tsx'; import AbstractSelectBehavior from './AbstractSelectBehavior.tsx'; import BuySkills from './BuySkills.tsx'; import CreateUnit from './CreateUnit.tsx'; diff --git a/hera/behavior/Behavior.tsx b/hera/behavior/Behavior.tsx index bdd1bd2e..4f320526 100644 --- a/hera/behavior/Behavior.tsx +++ b/hera/behavior/Behavior.tsx @@ -1,5 +1,5 @@ -import Vector from '@deities/athena/map/Vector.tsx'; -import { +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { Actions, MapBehavior, MapBehaviorConstructor, diff --git a/hera/behavior/BuySkills.tsx b/hera/behavior/BuySkills.tsx index 68224940..20ff9083 100644 --- a/hera/behavior/BuySkills.tsx +++ b/hera/behavior/BuySkills.tsx @@ -9,7 +9,7 @@ import { fbt } from 'fbt'; import { useState } from 'react'; import addFlashAnimation from '../lib/addFlashAnimation.tsx'; import toTransformOrigin from '../lib/toTransformOrigin.tsx'; -import { State, StateLike, StateWithActions } from '../Types.tsx'; +import type { State, StateLike, StateWithActions } from '../Types.tsx'; import ActionWheel, { ActionWheelFunds, LargeActionButton, diff --git a/hera/behavior/CreateBuilding.tsx b/hera/behavior/CreateBuilding.tsx index 4a68b657..ad4c46d1 100644 --- a/hera/behavior/CreateBuilding.tsx +++ b/hera/behavior/CreateBuilding.tsx @@ -3,15 +3,14 @@ import canBuild from '@deities/athena/lib/canBuild.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; -import { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; +import type { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; import Icon from '@deities/ui/Icon.tsx'; import Info from '@deities/ui/icons/Info.tsx'; import { css } from '@emotion/css'; import BuildingTile from '../Building.tsx'; -import toTransformOrigin, { - ClientCoordinates, -} from '../lib/toTransformOrigin.tsx'; -import { StateWithActions } from '../Types.tsx'; +import type { ClientCoordinates } from '../lib/toTransformOrigin.tsx'; +import toTransformOrigin from '../lib/toTransformOrigin.tsx'; +import type { StateWithActions } from '../Types.tsx'; import ActionWheel, { ActionWheelFunds, LargeActionButton, diff --git a/hera/behavior/CreateUnit.tsx b/hera/behavior/CreateUnit.tsx index 9d0116da..a7cd383d 100644 --- a/hera/behavior/CreateUnit.tsx +++ b/hera/behavior/CreateUnit.tsx @@ -1,31 +1,31 @@ import { CreateUnitAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; import { Plain } from '@deities/athena/info/Tile.tsx'; -import { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; import { getDeterministicUnitName } from '@deities/athena/info/UnitNames.tsx'; import getBuildableUnits from '@deities/athena/lib/getBuildableUnits.tsx'; import getDeployableVectors from '@deities/athena/lib/getDeployableVectors.tsx'; import getLeaders from '@deities/athena/lib/getLeaders.tsx'; import getMovementPath from '@deities/athena/lib/getMovementPath.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { RadiusItem } from '@deities/athena/Radius.tsx'; import getFirst from '@deities/hephaestus/getFirst.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import getColor from '@deities/ui/getColor.tsx'; -import { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; +import type { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; import Icon from '@deities/ui/Icon.tsx'; import Info from '@deities/ui/icons/Info.tsx'; import Magic from '@deities/ui/icons/Magic.tsx'; import { css } from '@emotion/css'; import More from '@iconify-icons/pixelarticons/more-horizontal.js'; import { fbt } from 'fbt'; -import { MouseEvent, useState } from 'react'; +import type { MouseEvent } from 'react'; +import { useState } from 'react'; import addFlashAnimation from '../lib/addFlashAnimation.tsx'; -import toTransformOrigin, { - ClientCoordinates, -} from '../lib/toTransformOrigin.tsx'; +import type { ClientCoordinates } from '../lib/toTransformOrigin.tsx'; +import toTransformOrigin from '../lib/toTransformOrigin.tsx'; import { RadiusType } from '../Radius.tsx'; -import { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; +import type { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; import ActionWheel, { ActionWheelFunds, LargeActionButton, diff --git a/hera/behavior/DropUnit.tsx b/hera/behavior/DropUnit.tsx index de44c4f0..da328faf 100644 --- a/hera/behavior/DropUnit.tsx +++ b/hera/behavior/DropUnit.tsx @@ -3,8 +3,8 @@ import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx import { Plain } from '@deities/athena/info/Tile.tsx'; import canDeploy from '@deities/athena/lib/canDeploy.tsx'; import getMovementPath from '@deities/athena/lib/getMovementPath.tsx'; -import { TransportedUnit } from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type { TransportedUnit } from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { RadiusItem } from '@deities/athena/Radius.tsx'; import getFirst from '@deities/hephaestus/getFirst.tsx'; import useInput from '@deities/ui/controls/useInput.tsx'; @@ -16,7 +16,7 @@ import { useCallback, useState } from 'react'; import addFlashAnimation from '../lib/addFlashAnimation.tsx'; import { RadiusType } from '../Radius.tsx'; import Tick from '../Tick.tsx'; -import { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; +import type { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; import Flyout, { FlyoutItemWithHighlight } from '../ui/Flyout.tsx'; import UnitTile from '../Unit.tsx'; import { resetBehavior, selectFallback } from './Behavior.tsx'; diff --git a/hera/behavior/Heal.tsx b/hera/behavior/Heal.tsx index e343d9c7..e8d5d141 100644 --- a/hera/behavior/Heal.tsx +++ b/hera/behavior/Heal.tsx @@ -2,7 +2,7 @@ import { HealAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; import getHealableVectors from '@deities/athena/lib/getHealableVectors.tsx'; import getHealCost from '@deities/athena/lib/getHealCost.tsx'; import { HealAmount, MaxHealth } from '@deities/athena/map/Configuration.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { RadiusItem } from '@deities/athena/Radius.tsx'; import getFirst from '@deities/hephaestus/getFirst.tsx'; import Icon from '@deities/ui/Icon.tsx'; @@ -10,7 +10,7 @@ import Heart from '@deities/ui/icons/Heart.tsx'; import { css } from '@emotion/css'; import Coin from '@iconify-icons/pixelarticons/coin.js'; import { RadiusType } from '../Radius.tsx'; -import { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; +import type { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; import FlashFlyout from '../ui/FlashFlyout.tsx'; import { FlyoutItem } from '../ui/Flyout.tsx'; import { resetBehavior, selectFallback } from './Behavior.tsx'; diff --git a/hera/behavior/Menu.tsx b/hera/behavior/Menu.tsx index 0d45793c..03707a45 100644 --- a/hera/behavior/Menu.tsx +++ b/hera/behavior/Menu.tsx @@ -8,20 +8,20 @@ import { } from '@deities/apollo/action-mutators/ActionMutators.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; import getAttackableEntitiesInRange from '@deities/athena/lib/getAttackableEntitiesInRange.tsx'; -import getAvailableUnitActions, { - UnitActionTypes, -} from '@deities/athena/lib/getAvailableUnitActions.tsx'; -import { UnitsWithPosition } from '@deities/athena/lib/getUnitsByPositions.tsx'; +import type { UnitActionTypes } from '@deities/athena/lib/getAvailableUnitActions.tsx'; +import getAvailableUnitActions from '@deities/athena/lib/getAvailableUnitActions.tsx'; +import type { UnitsWithPosition } from '@deities/athena/lib/getUnitsByPositions.tsx'; import getUnitsToRefill from '@deities/athena/lib/getUnitsToRefill.tsx'; import { CreateTracksCost } from '@deities/athena/map/Configuration.tsx'; -import Vector, { sortByVectorKey } from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import { sortByVectorKey } from '@deities/athena/map/Vector.tsx'; import { moveable } from '@deities/athena/Radius.tsx'; import useInput from '@deities/ui/controls/useInput.tsx'; import { fbt } from 'fbt'; import addFlashAnimation from '../lib/addFlashAnimation.tsx'; import animateSupply from '../lib/animateSupply.tsx'; import { RadiusType } from '../Radius.tsx'; -import { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; +import type { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; import ActionWheel, { ActionButton } from '../ui/ActionWheel.tsx'; import AttackBehavior from './Attack.tsx'; import { resetBehavior, selectFallback } from './Behavior.tsx'; diff --git a/hera/behavior/Move.tsx b/hera/behavior/Move.tsx index 398be6d2..b25d2300 100644 --- a/hera/behavior/Move.tsx +++ b/hera/behavior/Move.tsx @@ -4,15 +4,15 @@ import getParentToMoveTo from '@deities/athena/lib/getParentToMoveTo.tsx'; import getPathFields from '@deities/athena/lib/getPathFields.tsx'; import type Entity from '@deities/athena/map/Entity.tsx'; import isPlayable from '@deities/athena/map/isPlayable.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { getPathCost, RadiusItem } from '@deities/athena/Radius.tsx'; import { useCallback } from 'react'; import addFlashAnimation from '../lib/addFlashAnimation.tsx'; import sleep from '../lib/sleep.tsx'; -import { RadiusInfo } from '../Radius.tsx'; -import { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; +import type { RadiusInfo } from '../Radius.tsx'; +import type { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; import attackAction from './attack/attackAction.tsx'; import AttackSelector from './attack/AttackSelector.tsx'; import getAttackableEntities from './attack/getAttackableEntities.tsx'; diff --git a/hera/behavior/Radar.tsx b/hera/behavior/Radar.tsx index 6cdd89a2..e18a5bdf 100644 --- a/hera/behavior/Radar.tsx +++ b/hera/behavior/Radar.tsx @@ -1,14 +1,14 @@ import { Lightning } from '@deities/athena/info/Tile.tsx'; import canPlaceLightning from '@deities/athena/lib/canPlaceLightning.tsx'; import { Charge } from '@deities/athena/map/Configuration.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { RadiusItem } from '@deities/athena/Radius.tsx'; import Icon from '@deities/ui/Icon.tsx'; import ZapOn from '@deities/ui/icons/ZapOn.tsx'; import Zap from '@iconify-icons/pixelarticons/zap.js'; import { fbt } from 'fbt'; import { RadiusType } from '../Radius.tsx'; -import { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; +import type { Actions, State, StateLike, StateWithActions } from '../Types.tsx'; import ActionWheel, { ActionWheelCharge, LargeActionButton, diff --git a/hera/behavior/Rescue.tsx b/hera/behavior/Rescue.tsx index aa1ca565..9c813d93 100644 --- a/hera/behavior/Rescue.tsx +++ b/hera/behavior/Rescue.tsx @@ -1,10 +1,10 @@ import { RescueAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; import getRescuableVectors from '@deities/athena/lib/getRescuableVectors.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { RadiusItem } from '@deities/athena/Radius.tsx'; import getFirst from '@deities/hephaestus/getFirst.tsx'; import { RadiusType } from '../Radius.tsx'; -import { Actions, State, StateLike } from '../Types.tsx'; +import type { Actions, State, StateLike } from '../Types.tsx'; import { resetBehavior, selectFallback } from './Behavior.tsx'; import rescueAction from './rescue/rescueAction.tsx'; diff --git a/hera/behavior/Sabotage.tsx b/hera/behavior/Sabotage.tsx index 3e33b8e6..1fd0c558 100644 --- a/hera/behavior/Sabotage.tsx +++ b/hera/behavior/Sabotage.tsx @@ -1,10 +1,10 @@ import { SabotageAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; import getSabotageableVectors from '@deities/athena/lib/getSabotageableVectors.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { RadiusItem } from '@deities/athena/Radius.tsx'; import getFirst from '@deities/hephaestus/getFirst.tsx'; import { RadiusType } from '../Radius.tsx'; -import { Actions, State, StateLike } from '../Types.tsx'; +import type { Actions, State, StateLike } from '../Types.tsx'; import { resetBehavior, selectFallback } from './Behavior.tsx'; import sabotageAction from './sabotage/sabotageAction.tsx'; diff --git a/hera/behavior/Transport.tsx b/hera/behavior/Transport.tsx index 828070e1..ee40e9de 100644 --- a/hera/behavior/Transport.tsx +++ b/hera/behavior/Transport.tsx @@ -2,12 +2,12 @@ import { MoveAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; import getMovementPath from '@deities/athena/lib/getMovementPath.tsx'; import getPathFields from '@deities/athena/lib/getPathFields.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import { RadiusItem } from '@deities/athena/Radius.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; import addMoveAnimation from '../lib/addMoveAnimation.tsx'; import { RadiusType } from '../Radius.tsx'; -import { Actions, State, StateWithActions } from '../Types.tsx'; +import type { Actions, State, StateWithActions } from '../Types.tsx'; import ActionWheel, { ActionButton, CancelActionButton, diff --git a/hera/behavior/activatePower/activatePowerAction.tsx b/hera/behavior/activatePower/activatePowerAction.tsx index 490d460f..36178164 100644 --- a/hera/behavior/activatePower/activatePowerAction.tsx +++ b/hera/behavior/activatePower/activatePowerAction.tsx @@ -1,17 +1,18 @@ -import { ActivatePowerActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { ActivatePowerActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import { getHealUnitTypes, Skill } from '@deities/athena/info/Skill.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import { getHealUnitTypes } from '@deities/athena/info/Skill.tsx'; import matchesActiveType from '@deities/athena/lib/matchesActiveType.tsx'; import updatePlayer from '@deities/athena/lib/updatePlayer.tsx'; import { MaxHealth } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import { sortByVectorKey, sortVectors } from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import animateHeal from '../../lib/animateHeal.tsx'; import AnimationKey from '../../lib/AnimationKey.tsx'; import getSkillConfigForDisplay from '../../lib/getSkillConfigForDisplay.tsx'; import upgradeUnits from '../../lib/upgradeUnits.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type { Actions, State } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/attack/AttackSelector.tsx b/hera/behavior/attack/AttackSelector.tsx index 80fd588a..6d2a9f3e 100644 --- a/hera/behavior/attack/AttackSelector.tsx +++ b/hera/behavior/attack/AttackSelector.tsx @@ -7,11 +7,11 @@ import { MaxHealth, RaisedCounterAttack, } from '@deities/athena/map/Configuration.tsx'; -import Entity from '@deities/athena/map/Entity.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import Icon from '@deities/ui/Icon.tsx'; import Heart from '@deities/ui/icons/Heart.tsx'; import { css } from '@emotion/css'; @@ -19,11 +19,12 @@ import { fbt } from 'fbt'; import { useCallback, useMemo } from 'react'; import BuildingTile from '../../Building.tsx'; import Tick from '../../Tick.tsx'; -import { Actions, State } from '../../Types.tsx'; -import { Fbt } from '../../types/Fbt.tsx'; +import type { Actions, State } from '../../Types.tsx'; +import type { Fbt } from '../../types/Fbt.tsx'; import EntityPickerFlyout from '../../ui/EntityPickerFlyout.tsx'; import FlashFlyout from '../../ui/FlashFlyout.tsx'; -import { FlyoutColor, FlyoutItem } from '../../ui/Flyout.tsx'; +import type { FlyoutColor } from '../../ui/Flyout.tsx'; +import { FlyoutItem } from '../../ui/Flyout.tsx'; import UnitTile from '../../Unit.tsx'; import getAttackableEntities from './getAttackableEntities.tsx'; import getDamageColor from './getDamageColor.tsx'; diff --git a/hera/behavior/attack/attackAction.tsx b/hera/behavior/attack/attackAction.tsx index f0099fa9..f885749b 100644 --- a/hera/behavior/attack/attackAction.tsx +++ b/hera/behavior/attack/attackAction.tsx @@ -2,10 +2,11 @@ import { AttackBuildingAction, AttackUnitAction, } from '@deities/apollo/action-mutators/ActionMutators.tsx'; -import Entity, { isBuilding } from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { isBuilding } from '@deities/athena/map/Entity.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { Actions, State } from '../../Types.tsx'; import clientAttackAction from './clientAttackAction.tsx'; export default async function attackAction( diff --git a/hera/behavior/attack/clientAttackAction.tsx b/hera/behavior/attack/clientAttackAction.tsx index 74b8d1ed..35cbdafa 100644 --- a/hera/behavior/attack/clientAttackAction.tsx +++ b/hera/behavior/attack/clientAttackAction.tsx @@ -1,13 +1,14 @@ -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; import getAttackDirection from '@deities/apollo/attack-direction/getAttackDirection.tsx'; -import { GameActionResponse } from '@deities/apollo/Types.tsx'; -import Entity, { isBuilding } from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { GameActionResponse } from '@deities/apollo/Types.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { isBuilding } from '@deities/athena/map/Entity.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import attackActionAnimation from '../../animations/attackActionAnimation.tsx'; import explosionAnimation from '../../animations/explosionAnimation.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type { Actions, State } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/attack/getAttackableEntities.tsx b/hera/behavior/attack/getAttackableEntities.tsx index 578d6f55..63097f79 100644 --- a/hera/behavior/attack/getAttackableEntities.tsx +++ b/hera/behavior/attack/getAttackableEntities.tsx @@ -1,7 +1,7 @@ -import Building from '@deities/athena/map/Building.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import { State } from '../../Types.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { State } from '../../Types.tsx'; type AttackableEntities = { building: Building | null; diff --git a/hera/behavior/attack/getDamageColor.tsx b/hera/behavior/attack/getDamageColor.tsx index 4c6e9f8a..5a23761d 100644 --- a/hera/behavior/attack/getDamageColor.tsx +++ b/hera/behavior/attack/getDamageColor.tsx @@ -1,5 +1,5 @@ import { MaxHealth } from '@deities/athena/map/Configuration.tsx'; -import { FlyoutColor } from '../../ui/Flyout.tsx'; +import type { FlyoutColor } from '../../ui/Flyout.tsx'; export default function getDamageColor( damage: number | null, diff --git a/hera/behavior/attack/hiddenAttackActions.tsx b/hera/behavior/attack/hiddenAttackActions.tsx index 8a11006b..7ec88490 100644 --- a/hera/behavior/attack/hiddenAttackActions.tsx +++ b/hera/behavior/attack/hiddenAttackActions.tsx @@ -1,19 +1,19 @@ import getAttackDirection, { AttackDirection, } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; -import { - applyHiddenActionResponse, +import type { HiddenDestroyedBuildingActionResponse, HiddenSourceAttackBuildingActionResponse, HiddenSourceAttackUnitActionResponse, HiddenTargetAttackBuildingActionResponse, HiddenTargetAttackUnitActionResponse, } from '@deities/apollo/HiddenAction.tsx'; +import { applyHiddenActionResponse } from '@deities/apollo/HiddenAction.tsx'; import attackActionAnimation from '../../animations/attackActionAnimation.tsx'; import attackFlashAnimation from '../../animations/attackFlashAnimation.tsx'; import explosionAnimation from '../../animations/explosionAnimation.tsx'; import AnimationKey from '../../lib/AnimationKey.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type { Actions, State } from '../../Types.tsx'; export async function hiddenSourceAttackAction( actions: Actions, diff --git a/hera/behavior/buySkill/buySkillAction.tsx b/hera/behavior/buySkill/buySkillAction.tsx index f4d90ca6..6fd03f5a 100644 --- a/hera/behavior/buySkill/buySkillAction.tsx +++ b/hera/behavior/buySkill/buySkillAction.tsx @@ -1,4 +1,4 @@ -import { +import type { BuySkillActionResponse, ReceiveRewardActionResponse, } from '@deities/apollo/ActionResponse.tsx'; @@ -7,7 +7,7 @@ import { fbt } from 'fbt'; import AnimationKey from '../../lib/AnimationKey.tsx'; import getSkillConfigForDisplay from '../../lib/getSkillConfigForDisplay.tsx'; import getTranslatedFactionName from '../../lib/getTranslatedFactionName.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type { Actions, State } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/capture/captureAction.tsx b/hera/behavior/capture/captureAction.tsx index ec9af10c..5ae18927 100644 --- a/hera/behavior/capture/captureAction.tsx +++ b/hera/behavior/capture/captureAction.tsx @@ -1,11 +1,11 @@ -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; import { UpAttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; -import { GameActionResponse } from '@deities/apollo/Types.tsx'; +import type { GameActionResponse } from '@deities/apollo/Types.tsx'; import { CapturedWeapon, CaptureWeapon } from '@deities/athena/info/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { Actions, State } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/confirm/ConfirmAction.tsx b/hera/behavior/confirm/ConfirmAction.tsx index f7a99453..cbcb3cd3 100644 --- a/hera/behavior/confirm/ConfirmAction.tsx +++ b/hera/behavior/confirm/ConfirmAction.tsx @@ -1,9 +1,7 @@ -import Vector from '@deities/athena/map/Vector.tsx'; -import { State, StateLike, StateWithActions } from '../../Types.tsx'; -import ActionWheel, { - ActionButton, - ActionButtonType, -} from '../../ui/ActionWheel.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { State, StateLike, StateWithActions } from '../../Types.tsx'; +import type { ActionButtonType } from '../../ui/ActionWheel.tsx'; +import ActionWheel, { ActionButton } from '../../ui/ActionWheel.tsx'; import { resetBehavior } from '../Behavior.tsx'; export type ConfirmProps = Readonly<{ diff --git a/hera/behavior/createBuilding/createBuildingAction.tsx b/hera/behavior/createBuilding/createBuildingAction.tsx index 0c74d536..742dfa12 100644 --- a/hera/behavior/createBuilding/createBuildingAction.tsx +++ b/hera/behavior/createBuilding/createBuildingAction.tsx @@ -1,9 +1,14 @@ import { CreateBuildingAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; -import { CreateBuildingActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { CreateBuildingActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import { BuildingInfo } from '@deities/athena/info/Building.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import { Actions, State, StateLike, StateToStateLike } from '../../Types.tsx'; +import type { BuildingInfo } from '@deities/athena/info/Building.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { + Actions, + State, + StateLike, + StateToStateLike, +} from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/createTracks/createTracksAction.tsx b/hera/behavior/createTracks/createTracksAction.tsx index 5c52a4a0..f8668e10 100644 --- a/hera/behavior/createTracks/createTracksAction.tsx +++ b/hera/behavior/createTracks/createTracksAction.tsx @@ -1,6 +1,6 @@ -import { CreateTracksActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { CreateTracksActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type { Actions, State } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/createUnit/createUnitAction.tsx b/hera/behavior/createUnit/createUnitAction.tsx index 446714a5..e4cb230f 100644 --- a/hera/behavior/createUnit/createUnitAction.tsx +++ b/hera/behavior/createUnit/createUnitAction.tsx @@ -1,8 +1,8 @@ -import { CreateUnitActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { CreateUnitActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; import addMoveAnimation from '../../lib/addMoveAnimation.tsx'; -import { Actions, State, StateLike } from '../../Types.tsx'; +import type { Actions, State, StateLike } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/drop/dropUnitAction.tsx b/hera/behavior/drop/dropUnitAction.tsx index c6931aa8..09cf24a9 100644 --- a/hera/behavior/drop/dropUnitAction.tsx +++ b/hera/behavior/drop/dropUnitAction.tsx @@ -1,8 +1,8 @@ -import { DropUnitActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { DropUnitActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import addMoveAnimation from '../../lib/addMoveAnimation.tsx'; -import { State, StateLike, StateToStateLike } from '../../Types.tsx'; +import type { State, StateLike, StateToStateLike } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/endTurn/canEndTurn.tsx b/hera/behavior/endTurn/canEndTurn.tsx index b925ff65..e0c37e31 100644 --- a/hera/behavior/endTurn/canEndTurn.tsx +++ b/hera/behavior/endTurn/canEndTurn.tsx @@ -1,4 +1,4 @@ -import { State } from '../../Types.tsx'; +import type { State } from '../../Types.tsx'; export default function canEndTurn(state: State) { const { behavior, currentViewer, lastActionResponse, map, replayState } = diff --git a/hera/behavior/endTurn/endTurnAction.tsx b/hera/behavior/endTurn/endTurnAction.tsx index 231495fc..3a726112 100644 --- a/hera/behavior/endTurn/endTurnAction.tsx +++ b/hera/behavior/endTurn/endTurnAction.tsx @@ -3,7 +3,7 @@ import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx import getActionResponseVectors from '@deities/apollo/lib/getActionResponseVectors.tsx'; import dateNow from '@deities/hephaestus/dateNow.tsx'; import addEndTurnAnimations from '../../lib/addEndTurnAnimations.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type { Actions, State } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/heal/healAction.tsx b/hera/behavior/heal/healAction.tsx index 1670db75..9c9fae6d 100644 --- a/hera/behavior/heal/healAction.tsx +++ b/hera/behavior/heal/healAction.tsx @@ -1,10 +1,10 @@ -import { HealActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { HealActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import AnimationKey from '../../lib/AnimationKey.tsx'; import getUnitDirection from '../../lib/getUnitDirection.tsx'; -import { State, StateLike, StateToStateLike } from '../../Types.tsx'; +import type { State, StateLike, StateToStateLike } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/move/clientMoveAction.tsx b/hera/behavior/move/clientMoveAction.tsx index f3f933c9..fe170243 100644 --- a/hera/behavior/move/clientMoveAction.tsx +++ b/hera/behavior/move/clientMoveAction.tsx @@ -1,11 +1,11 @@ -import { MoveActionResponse } from '@deities/apollo/ActionResponse.tsx'; -import { GameActionResponse } from '@deities/apollo/Types.tsx'; +import type { MoveActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { GameActionResponse } from '@deities/apollo/Types.tsx'; import getMovementPath from '@deities/athena/lib/getMovementPath.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { RadiusItem } from '@deities/athena/Radius.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; import addMoveAnimation from '../../lib/addMoveAnimation.tsx'; -import { Actions, State, StateLike } from '../../Types.tsx'; +import type { Actions, State, StateLike } from '../../Types.tsx'; import NullBehavior from '../NullBehavior.tsx'; export default function clientMoveAction( diff --git a/hera/behavior/move/hiddenMoveAction.tsx b/hera/behavior/move/hiddenMoveAction.tsx index 9dc63270..33fcc036 100644 --- a/hera/behavior/move/hiddenMoveAction.tsx +++ b/hera/behavior/move/hiddenMoveAction.tsx @@ -1,10 +1,13 @@ -import { - applyHiddenActionResponse, - HiddenMoveActionResponse, -} from '@deities/apollo/HiddenAction.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type { HiddenMoveActionResponse } from '@deities/apollo/HiddenAction.tsx'; +import { applyHiddenActionResponse } from '@deities/apollo/HiddenAction.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import addMoveAnimation from '../../lib/addMoveAnimation.tsx'; -import { Actions, State, StateLike, StateToStateLike } from '../../Types.tsx'; +import type { + Actions, + State, + StateLike, + StateToStateLike, +} from '../../Types.tsx'; import NullBehavior from '../NullBehavior.tsx'; export default function hiddenMoveAction( diff --git a/hera/behavior/move/moveAction.tsx b/hera/behavior/move/moveAction.tsx index 31c3fa63..fbb3bb3d 100644 --- a/hera/behavior/move/moveAction.tsx +++ b/hera/behavior/move/moveAction.tsx @@ -1,8 +1,8 @@ import { MoveAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; -import { MoveActionResponse } from '@deities/apollo/ActionResponse.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import { RadiusItem } from '@deities/athena/Radius.tsx'; -import { Actions, State, StateLike } from '../../Types.tsx'; +import type { MoveActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; +import type { Actions, State, StateLike } from '../../Types.tsx'; import clientMoveAction from './clientMoveAction.tsx'; export default function moveAction( diff --git a/hera/behavior/move/syncMoveAction.tsx b/hera/behavior/move/syncMoveAction.tsx index a73214ff..77c45453 100644 --- a/hera/behavior/move/syncMoveAction.tsx +++ b/hera/behavior/move/syncMoveAction.tsx @@ -1,14 +1,14 @@ import { MoveAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; -import { MoveActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { MoveActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; import getMovementPath from '@deities/athena/lib/getMovementPath.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { RadiusItem } from '@deities/athena/Radius.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { RadiusItem } from '@deities/athena/Radius.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import addFlashAnimation from '../../lib/addFlashAnimation.tsx'; import addMoveAnimation from '../../lib/addMoveAnimation.tsx'; -import { Actions, State, StateLike } from '../../Types.tsx'; +import type { Actions, State, StateLike } from '../../Types.tsx'; import NullBehavior from '../NullBehavior.tsx'; import clientMoveAction from './clientMoveAction.tsx'; import moveAction from './moveAction.tsx'; diff --git a/hera/behavior/radar/toggleLightningAction.tsx b/hera/behavior/radar/toggleLightningAction.tsx index e96e0eeb..5454c145 100644 --- a/hera/behavior/radar/toggleLightningAction.tsx +++ b/hera/behavior/radar/toggleLightningAction.tsx @@ -1,9 +1,9 @@ import { ToggleLightningAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import explosionAnimation from '../../animations/explosionAnimation.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type { Actions, State } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/rescue/rescueAction.tsx b/hera/behavior/rescue/rescueAction.tsx index 761dc646..f6b0749d 100644 --- a/hera/behavior/rescue/rescueAction.tsx +++ b/hera/behavior/rescue/rescueAction.tsx @@ -1,10 +1,10 @@ -import { RescueActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { RescueActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import getUnitDirection from '../../lib/getUnitDirection.tsx'; -import { State, StateLike, StateToStateLike } from '../../Types.tsx'; +import type { State, StateLike, StateToStateLike } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/sabotage/sabotageAction.tsx b/hera/behavior/sabotage/sabotageAction.tsx index 1549811c..00edf98b 100644 --- a/hera/behavior/sabotage/sabotageAction.tsx +++ b/hera/behavior/sabotage/sabotageAction.tsx @@ -1,9 +1,9 @@ -import { SabotageActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { SabotageActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import getUnitDirection from '../../lib/getUnitDirection.tsx'; -import { State, StateLike, StateToStateLike } from '../../Types.tsx'; +import type { State, StateLike, StateToStateLike } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/behavior/unfold/unfoldAction.tsx b/hera/behavior/unfold/unfoldAction.tsx index ede02cf5..37c05aa0 100644 --- a/hera/behavior/unfold/unfoldAction.tsx +++ b/hera/behavior/unfold/unfoldAction.tsx @@ -1,8 +1,8 @@ -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import { Actions, State } from '../../Types.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { Actions, State } from '../../Types.tsx'; import { resetBehavior } from '../Behavior.tsx'; import NullBehavior from '../NullBehavior.tsx'; diff --git a/hera/bottom-drawer/BottomDrawer.tsx b/hera/bottom-drawer/BottomDrawer.tsx index 0814c85f..ea6882f5 100644 --- a/hera/bottom-drawer/BottomDrawer.tsx +++ b/hera/bottom-drawer/BottomDrawer.tsx @@ -7,7 +7,7 @@ import Portal from '@deities/ui/Portal.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { css, cx } from '@emotion/css'; import { motion } from 'framer-motion'; -import { HTMLAttributes, ReactNode, RefObject } from 'react'; +import type { HTMLAttributes, ReactNode, RefObject } from 'react'; export default function BottomDrawer({ children, diff --git a/hera/campaign/CampaignEditor.tsx b/hera/campaign/CampaignEditor.tsx index a0362621..2f4b0f6c 100644 --- a/hera/campaign/CampaignEditor.tsx +++ b/hera/campaign/CampaignEditor.tsx @@ -1,14 +1,16 @@ -import { Scenario } from '@deities/apollo/Effects.tsx'; -import { - AttributeRangeWithZero, - validateAttributeRange, -} from '@deities/athena/lib/getAttributeRange.tsx'; +import type { Scenario } from '@deities/apollo/Effects.tsx'; +import type { AttributeRangeWithZero } from '@deities/athena/lib/getAttributeRange.tsx'; +import { validateAttributeRange } from '@deities/athena/lib/getAttributeRange.tsx'; import { DoubleSize, TileSize } from '@deities/athena/map/Configuration.tsx'; import getCampaignLevelDepths from '@deities/hermes/getCampaignLevelDepths.tsx'; import toCampaign from '@deities/hermes/toCampaign.tsx'; import toLevelMap from '@deities/hermes/toLevelMap.tsx'; import toPlainCampaign from '@deities/hermes/toPlainCampaign.tsx'; -import { Campaign, ClientLevelID, PlainLevel } from '@deities/hermes/Types.tsx'; +import type { + Campaign, + ClientLevelID, + PlainLevel, +} from '@deities/hermes/Types.tsx'; import unrollCampaign from '@deities/hermes/unrollCampaign.tsx'; import validateCampaign from '@deities/hermes/validateCampaign.tsx'; import Breakpoints, { sm } from '@deities/ui/Breakpoints.tsx'; @@ -28,17 +30,15 @@ import Portal from '@deities/ui/Portal.tsx'; import PrimaryExpandableMenuButton from '@deities/ui/PrimaryExpandableMenuButton.tsx'; import ScrollContainer from '@deities/ui/ScrollContainer.tsx'; import Stack from '@deities/ui/Stack.tsx'; -import { - TypeaheadDataSource, - TypeaheadDataSourceEntry, -} from '@deities/ui/Typeahead.tsx'; +import type { TypeaheadDataSource } from '@deities/ui/Typeahead.tsx'; +import { TypeaheadDataSourceEntry } from '@deities/ui/Typeahead.tsx'; import { css, cx } from '@emotion/css'; import Close from '@iconify-icons/pixelarticons/close.js'; import DialogueIcon from '@iconify-icons/pixelarticons/message-text.js'; import { fbt } from 'fbt'; import { AnimatePresence, motion } from 'framer-motion'; +import type { ComponentType } from 'react'; import { - ComponentType, useCallback, useEffect, useMemo, @@ -49,16 +49,16 @@ import { import useMusic, { usePlayMusic } from '../audio/Music.tsx'; import useSetTags from '../editor/hooks/useSetTags.tsx'; import ZoomButton from '../editor/lib/ZoomButton.tsx'; -import { EditorMode } from '../editor/Types.tsx'; +import type { EditorMode } from '../editor/Types.tsx'; import useHide from '../hooks/useHide.tsx'; import toTransformOrigin from '../lib/toTransformOrigin.tsx'; import Notification from '../ui/Notification.tsx'; import Level from './Level.tsx'; import LevelDialogue from './LevelDialogue.tsx'; -import { PlayStyleType } from './lib/PlayStyle.tsx'; +import type { PlayStyleType } from './lib/PlayStyle.tsx'; import CampaignEditorPanel from './panels/CampaignEditorControlPanel.tsx'; -import { UserNode } from './panels/CampaignEditorSettingsPanel.tsx'; -import { +import type { UserNode } from './panels/CampaignEditorSettingsPanel.tsx'; +import type { CampaignEditorSaveState, CampaignEditorState, CampaignObject, diff --git a/hera/campaign/EffectDialogue.tsx b/hera/campaign/EffectDialogue.tsx index cac8d4aa..7b339b98 100644 --- a/hera/campaign/EffectDialogue.tsx +++ b/hera/campaign/EffectDialogue.tsx @@ -1,10 +1,10 @@ -import { Effect } from '@deities/apollo/Effects.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { Effect } from '@deities/apollo/Effects.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { memo } from 'react'; import ActionCard from '../editor/lib/ActionCard.tsx'; -import { FactionNames } from '../Types.tsx'; +import type { FactionNames } from '../Types.tsx'; export default memo(function StartDialogue({ currentPlayer, diff --git a/hera/campaign/Level.tsx b/hera/campaign/Level.tsx index 9da9dae3..225701cc 100644 --- a/hera/campaign/Level.tsx +++ b/hera/campaign/Level.tsx @@ -1,16 +1,17 @@ -import { Scenario } from '@deities/apollo/Effects.tsx'; +import type { Scenario } from '@deities/apollo/Effects.tsx'; import getMapRoute from '@deities/apollo/routes/getMapRoute.tsx'; import { getUnitInfoOrThrow } from '@deities/athena/info/Unit.tsx'; import { AnimationConfig, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { WinCondition, WinCriteria } from '@deities/athena/WinConditions.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { WinCondition } from '@deities/athena/WinConditions.tsx'; +import { WinCriteria } from '@deities/athena/WinConditions.tsx'; import getFirst from '@deities/hephaestus/getFirst.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import toPlainLevelList from '@deities/hermes/toPlainLevelList.tsx'; -import { +import type { ClientLevelID, Level as LevelT, PlainLevel, @@ -25,7 +26,8 @@ import Link from '@deities/ui/Link.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; import Stack from '@deities/ui/Stack.tsx'; import TagList from '@deities/ui/TagList.tsx'; -import Typeahead, { TypeaheadDataSource } from '@deities/ui/Typeahead.tsx'; +import type { TypeaheadDataSource } from '@deities/ui/Typeahead.tsx'; +import Typeahead from '@deities/ui/Typeahead.tsx'; import { css, cx } from '@emotion/css'; import ArrowLeftBox from '@iconify-icons/pixelarticons/arrow-left-box.js'; import Close from '@iconify-icons/pixelarticons/close.js'; @@ -34,7 +36,8 @@ import DialogueIcon from '@iconify-icons/pixelarticons/message-text.js'; import EmptyDialogueIcon from '@iconify-icons/pixelarticons/message.js'; import { fbt } from 'fbt'; import { useInView } from 'framer-motion'; -import { memo, MouseEvent, useCallback, useRef, useState } from 'react'; +import type { MouseEvent } from 'react'; +import { memo, useCallback, useRef, useState } from 'react'; import Portrait from '../character/Portrait.tsx'; import ActionCard from '../editor/lib/ActionCard.tsx'; import EffectSelector from '../editor/selectors/EffectSelector.tsx'; @@ -44,7 +47,7 @@ import MapComponent from '../Map.tsx'; import WinConditionTitle from '../win-conditions/WinConditionTitle.tsx'; import useEffectCharacters from './hooks/useEffectCharacters.tsx'; import sortByDepth from './lib/sortByDepth.tsx'; -import { +import type { CampaignEditorSaveState, CampaignEditorSetMapFunction, MapNode, diff --git a/hera/campaign/LevelDialogue.tsx b/hera/campaign/LevelDialogue.tsx index 96fce1d0..5db445ab 100644 --- a/hera/campaign/LevelDialogue.tsx +++ b/hera/campaign/LevelDialogue.tsx @@ -1,5 +1,5 @@ import sortBy from '@deities/hephaestus/sortBy.tsx'; -import { ClientLevelID, Level as LevelT } from '@deities/hermes/Types.tsx'; +import type { ClientLevelID, Level as LevelT } from '@deities/hermes/Types.tsx'; import { SquareButtonStyle } from '@deities/ui/Button.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import getColor from '@deities/ui/getColor.tsx'; @@ -15,7 +15,7 @@ import useEffects from '../hooks/useEffects.tsx'; import useMapData from '../hooks/useMapData.tsx'; import getMapName from '../i18n/getMapName.tsx'; import sortByDepth from './lib/sortByDepth.tsx'; -import { CampaignEditorSetMapFunction, MapNode } from './Types.tsx'; +import type { CampaignEditorSetMapFunction, MapNode } from './Types.tsx'; export default memo(function LevelDialogue({ depth = 0, diff --git a/hera/campaign/Types.tsx b/hera/campaign/Types.tsx index 3ca3da3c..a4dbb29f 100644 --- a/hera/campaign/Types.tsx +++ b/hera/campaign/Types.tsx @@ -1,8 +1,8 @@ -import { Scenario } from '@deities/apollo/Effects.tsx'; -import { ClientLevelID } from '@deities/hermes/Types.tsx'; -import { BaseMapEditorProps } from '../editor/MapEditor.tsx'; -import { EditorMode } from '../editor/Types.tsx'; -import { PlayStyleType } from './lib/PlayStyle.tsx'; +import type { Scenario } from '@deities/apollo/Effects.tsx'; +import type { ClientLevelID } from '@deities/hermes/Types.tsx'; +import type { BaseMapEditorProps } from '../editor/MapEditor.tsx'; +import type { EditorMode } from '../editor/Types.tsx'; +import type { PlayStyleType } from './lib/PlayStyle.tsx'; type CampaignEditorMode = 'settings'; diff --git a/hera/campaign/hooks/useEffectCharacters.tsx b/hera/campaign/hooks/useEffectCharacters.tsx index 3e6e4f71..322179a9 100644 --- a/hera/campaign/hooks/useEffectCharacters.tsx +++ b/hera/campaign/hooks/useEffectCharacters.tsx @@ -1,4 +1,4 @@ -import { Effects, EffectTrigger } from '@deities/apollo/Effects.tsx'; +import type { Effects, EffectTrigger } from '@deities/apollo/Effects.tsx'; import { useMemo } from 'react'; import getAllEffectCharacters from '../lib/getAllEffectCharacters.tsx'; diff --git a/hera/campaign/lib/getAllEffectCharacters.tsx b/hera/campaign/lib/getAllEffectCharacters.tsx index 3c465dd6..3ebde795 100644 --- a/hera/campaign/lib/getAllEffectCharacters.tsx +++ b/hera/campaign/lib/getAllEffectCharacters.tsx @@ -1,5 +1,5 @@ -import { CharacterMessageEffectAction } from '@deities/apollo/Action.tsx'; -import { Effects, EffectTrigger } from '@deities/apollo/Effects.tsx'; +import type { CharacterMessageEffectAction } from '@deities/apollo/Action.tsx'; +import type { Effects, EffectTrigger } from '@deities/apollo/Effects.tsx'; export default function getAllEffectCharacters( effects: Effects | null, diff --git a/hera/campaign/lib/sortByDepth.tsx b/hera/campaign/lib/sortByDepth.tsx index b11772f7..7348c04a 100644 --- a/hera/campaign/lib/sortByDepth.tsx +++ b/hera/campaign/lib/sortByDepth.tsx @@ -1,5 +1,5 @@ import sortBy from '@deities/hephaestus/sortBy.tsx'; -import { Level } from '@deities/hermes/Types.tsx'; +import type { Level } from '@deities/hermes/Types.tsx'; export default function sortByDepth( next: Array | [number, Level]>, diff --git a/hera/campaign/panels/CampaignEditorControlPanel.tsx b/hera/campaign/panels/CampaignEditorControlPanel.tsx index 4c56b0cc..90fb1c93 100644 --- a/hera/campaign/panels/CampaignEditorControlPanel.tsx +++ b/hera/campaign/panels/CampaignEditorControlPanel.tsx @@ -1,15 +1,14 @@ -import { +import type { AttributeRange, AttributeRangeWithZero, } from '@deities/athena/lib/getAttributeRange.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { TypeaheadDataSource } from '@deities/ui/Typeahead.tsx'; +import type { TypeaheadDataSource } from '@deities/ui/Typeahead.tsx'; import BottomDrawer from '../../bottom-drawer/BottomDrawer.tsx'; -import { PlayStyleType } from '../lib/PlayStyle.tsx'; -import { CampaignEditorState } from '../Types.tsx'; -import CampaignEditorSettingsPanel, { - UserNode, -} from './CampaignEditorSettingsPanel.tsx'; +import type { PlayStyleType } from '../lib/PlayStyle.tsx'; +import type { CampaignEditorState } from '../Types.tsx'; +import type { UserNode } from './CampaignEditorSettingsPanel.tsx'; +import CampaignEditorSettingsPanel from './CampaignEditorSettingsPanel.tsx'; export default function CampaignEditorControlPanel({ campaignEditorState, diff --git a/hera/campaign/panels/CampaignEditorSettingsPanel.tsx b/hera/campaign/panels/CampaignEditorSettingsPanel.tsx index 369bd1ac..b590b264 100644 --- a/hera/campaign/panels/CampaignEditorSettingsPanel.tsx +++ b/hera/campaign/panels/CampaignEditorSettingsPanel.tsx @@ -1,4 +1,4 @@ -import { +import type { AttributeRange, AttributeRangeWithZero, } from '@deities/athena/lib/getAttributeRange.tsx'; @@ -8,18 +8,14 @@ import InlineLink from '@deities/ui/InlineLink.tsx'; import Stack from '@deities/ui/Stack.tsx'; import Tag from '@deities/ui/Tag.tsx'; import TagInput from '@deities/ui/TagInput.tsx'; -import { - TypeaheadDataSource, - TypeaheadDataSourceEntry, -} from '@deities/ui/Typeahead.tsx'; +import type { TypeaheadDataSource } from '@deities/ui/Typeahead.tsx'; +import { TypeaheadDataSourceEntry } from '@deities/ui/Typeahead.tsx'; import { css } from '@emotion/css'; import { fbt } from 'fbt'; import { RangeSelector } from '../../card/Range.tsx'; import useTagDataSource from '../../hooks/useTagDataSource.tsx'; -import PlayStyle, { - getTranslatedPlayStyleName, - PlayStyleType, -} from '../lib/PlayStyle.tsx'; +import type { PlayStyleType } from '../lib/PlayStyle.tsx'; +import PlayStyle, { getTranslatedPlayStyleName } from '../lib/PlayStyle.tsx'; export type UserNode = Readonly<{ displayName: string; diff --git a/hera/card/AttributeGrid.tsx b/hera/card/AttributeGrid.tsx index 46633617..9b9b5e3e 100644 --- a/hera/card/AttributeGrid.tsx +++ b/hera/card/AttributeGrid.tsx @@ -3,7 +3,7 @@ import Breakpoints from '@deities/ui/Breakpoints.tsx'; import clipBorder from '@deities/ui/clipBorder.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import { css, cx } from '@emotion/css'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; export default function AttributeGrid({ children, diff --git a/hera/card/BuildingCard.tsx b/hera/card/BuildingCard.tsx index 6f9f6483..764e2739 100644 --- a/hera/card/BuildingCard.tsx +++ b/hera/card/BuildingCard.tsx @@ -1,22 +1,22 @@ +import type { BuildingInfo } from '@deities/athena/info/Building.tsx'; import { - BuildingInfo, getAllBuildings, ResearchLab, } from '@deities/athena/info/Building.tsx'; -import { Skill } from '@deities/athena/info/Skill.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; import { Plain } from '@deities/athena/info/Tile.tsx'; import getAttributeRange, { getAttributeRangeValue, } from '@deities/athena/lib/getAttributeRange.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import { AnimationConfig, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; import MapData from '@deities/athena/MapData.tsx'; import minBy from '@deities/hephaestus/minBy.tsx'; @@ -42,7 +42,7 @@ import getAnyUnitTile from '../lib/getAnyUnitTile.tsx'; import getTranslatedEntityName from '../lib/getTranslatedEntityName.tsx'; import getTranslatedFactionName from '../lib/getTranslatedFactionName.tsx'; import Tick from '../Tick.tsx'; -import { FactionNames } from '../Types.tsx'; +import type { FactionNames } from '../Types.tsx'; import MiniPlayerIcon from '../ui/MiniPlayerIcon.tsx'; import { SkillIcon } from '../ui/SkillDialog.tsx'; import UILabel from '../ui/UILabel.tsx'; diff --git a/hera/card/CardTitle.tsx b/hera/card/CardTitle.tsx index 473c06c3..f512e6eb 100644 --- a/hera/card/CardTitle.tsx +++ b/hera/card/CardTitle.tsx @@ -1,9 +1,9 @@ import { TileSize } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import Breakpoints from '@deities/ui/Breakpoints.tsx'; import getColor from '@deities/ui/getColor.tsx'; import { css, cx } from '@emotion/css'; -import { HTMLAttributes } from 'react'; +import type { HTMLAttributes } from 'react'; export default function CardTitle({ className, diff --git a/hera/card/InlineTileList.tsx b/hera/card/InlineTileList.tsx index 97e9e013..21652fea 100644 --- a/hera/card/InlineTileList.tsx +++ b/hera/card/InlineTileList.tsx @@ -1,19 +1,16 @@ -import { DecoratorInfo } from '@deities/athena/info/Decorator.tsx'; -import { - TileField, - TileInfo, - tilesToTileMap, -} from '@deities/athena/info/Tile.tsx'; +import type { DecoratorInfo } from '@deities/athena/info/Decorator.tsx'; +import type { TileField, TileInfo } from '@deities/athena/info/Tile.tsx'; +import { tilesToTileMap } from '@deities/athena/info/Tile.tsx'; import { singleTilesToModifiers } from '@deities/athena/lib/singleTilesToModifiers.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import { AnimationConfig, DecoratorsPerSide, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; import MapData from '@deities/athena/MapData.tsx'; import Vision from '@deities/athena/Vision.tsx'; @@ -24,14 +21,8 @@ import useScrollIntoView from '@deities/ui/hooks/useScrollIntoView.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { css, cx } from '@emotion/css'; import { useInView } from 'framer-motion'; -import { - ReactNode, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from 'react'; +import type { ReactNode } from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import BuildingTile from '../Building.tsx'; import Cursor from '../Cursor.tsx'; import Decorators from '../Decorators.tsx'; @@ -39,7 +30,7 @@ import tileFieldHasAnimation from '../editor/lib/tileFieldHasAnimation.tsx'; import { useSprites } from '../hooks/useSprites.tsx'; import TileDecorators from '../TileDecorators.tsx'; import Tiles from '../Tiles.tsx'; -import { TimerFunction } from '../Types.tsx'; +import type { TimerFunction } from '../Types.tsx'; import UnitTile from '../Unit.tsx'; export type SelectTileFn = (selection: { diff --git a/hera/card/LeaderCard.tsx b/hera/card/LeaderCard.tsx index 0c90c464..3526fc41 100644 --- a/hera/card/LeaderCard.tsx +++ b/hera/card/LeaderCard.tsx @@ -4,8 +4,8 @@ import { LeaderStatusEffect, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import Breakpoints from '@deities/ui/Breakpoints.tsx'; import Icon from '@deities/ui/Icon.tsx'; import Magic from '@deities/ui/icons/Magic.tsx'; diff --git a/hera/card/LeaderTitle.tsx b/hera/card/LeaderTitle.tsx index 005d1765..9137a350 100644 --- a/hera/card/LeaderTitle.tsx +++ b/hera/card/LeaderTitle.tsx @@ -1,4 +1,4 @@ -import { Gender } from '@deities/athena/info/Unit.tsx'; +import type { Gender } from '@deities/athena/info/Unit.tsx'; export default function LeaderTitle({ gender }: { gender: Gender }) { return gender === 'male' ? ( diff --git a/hera/card/MovementBox.tsx b/hera/card/MovementBox.tsx index 9e372418..029d4239 100644 --- a/hera/card/MovementBox.tsx +++ b/hera/card/MovementBox.tsx @@ -1,6 +1,6 @@ -import { TileInfo } from '@deities/athena/info/Tile.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import InlineTileList from './InlineTileList.tsx'; import TileBox from './TileBox.tsx'; diff --git a/hera/card/Range.tsx b/hera/card/Range.tsx index 542cadde..9a696c27 100644 --- a/hera/card/Range.tsx +++ b/hera/card/Range.tsx @@ -1,4 +1,4 @@ -import { +import type { AttributeRange, AttributeRangeWithZero, LargeAttributeRangeWithZero, diff --git a/hera/card/TileBox.tsx b/hera/card/TileBox.tsx index 5cbaab16..d1820423 100644 --- a/hera/card/TileBox.tsx +++ b/hera/card/TileBox.tsx @@ -2,7 +2,7 @@ import clipBorder from '@deities/ui/clipBorder.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { css } from '@emotion/css'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; export default function TileBox({ children }: { children: ReactNode }) { return ( diff --git a/hera/card/TileCard.tsx b/hera/card/TileCard.tsx index 187656d5..95f67f8e 100644 --- a/hera/card/TileCard.tsx +++ b/hera/card/TileCard.tsx @@ -1,9 +1,9 @@ -import { DecoratorInfo } from '@deities/athena/info/Decorator.tsx'; +import type { DecoratorInfo } from '@deities/athena/info/Decorator.tsx'; import { MovementTypes } from '@deities/athena/info/MovementType.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; import { getAllTiles, Plain, - TileInfo, tilesToTileMap, } from '@deities/athena/info/Tile.tsx'; import { mapUnitsWithContentRestriction } from '@deities/athena/info/Unit.tsx'; @@ -11,16 +11,18 @@ import getAttributeRange, { getAttributeRangeValue, } from '@deities/athena/lib/getAttributeRange.tsx'; import { singleTilesToModifiers } from '@deities/athena/lib/singleTilesToModifiers.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; import { AnimationConfig, DecoratorsPerSide, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import { numberToPlayerID, PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { numberToPlayerID } from '@deities/athena/map/Player.tsx'; import { decodeDecorators } from '@deities/athena/map/Serialization.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData, { ModifierField } from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { ModifierField } from '@deities/athena/MapData.tsx'; +import MapData from '@deities/athena/MapData.tsx'; import groupBy from '@deities/hephaestus/groupBy.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; diff --git a/hera/card/TilePreview.tsx b/hera/card/TilePreview.tsx index f099f9df..4be88508 100644 --- a/hera/card/TilePreview.tsx +++ b/hera/card/TilePreview.tsx @@ -1,14 +1,14 @@ -import { BuildingHeight } from '@deities/athena/info/Building.tsx'; +import type { BuildingHeight } from '@deities/athena/info/Building.tsx'; import { AnimationConfig, TileSize, } from '@deities/athena/map/Configuration.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import Vision from '@deities/athena/Vision.tsx'; import Breakpoints from '@deities/ui/Breakpoints.tsx'; import { css, cx } from '@emotion/css'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import Decorators from '../Decorators.tsx'; import Tick from '../Tick.tsx'; import TileDecorators from '../TileDecorators.tsx'; diff --git a/hera/card/UnitCard.tsx b/hera/card/UnitCard.tsx index 59ed623d..32cded16 100644 --- a/hera/card/UnitCard.tsx +++ b/hera/card/UnitCard.tsx @@ -1,15 +1,17 @@ import { AttackDirection } from '@deities/apollo/attack-direction/getAttackDirection.tsx'; import { House, VerticalBarrier } from '@deities/athena/info/Building.tsx'; -import { MovementType } from '@deities/athena/info/MovementType.tsx'; +import type { MovementType } from '@deities/athena/info/MovementType.tsx'; import { getAllTiles, getTileInfo, Plain } from '@deities/athena/info/Tile.tsx'; +import type { + UnitInfo, + Weapon as WeaponT, +} from '@deities/athena/info/Unit.tsx'; import { Abilities, Ability, AttackType, getAllUnits, mapUnitsWithContentRestriction, - UnitInfo, - Weapon as WeaponT, } from '@deities/athena/info/Unit.tsx'; import calculateLikelyDamage from '@deities/athena/lib/calculateLikelyDamage.tsx'; import getAttackStatusEffect from '@deities/athena/lib/getAttackStatusEffect.tsx'; @@ -19,24 +21,22 @@ import getAttributeRange, { import getBiomeStyle from '@deities/athena/lib/getBiomeStyle.tsx'; import getDefenseStatusEffect from '@deities/athena/lib/getDefenseStatusEffect.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; import { AnimationConfig, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import Entity, { - EntityType, - getEntityGroup, -} from '@deities/athena/map/Entity.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { EntityType, getEntityGroup } from '@deities/athena/map/Entity.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import { numberToPlayerID, - PlayerID, resolveDynamicPlayerID, } from '@deities/athena/map/Player.tsx'; -import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type SpriteVector from '@deities/athena/map/SpriteVector.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import MapData from '@deities/athena/MapData.tsx'; import groupBy from '@deities/hephaestus/groupBy.tsx'; import minBy from '@deities/hephaestus/minBy.tsx'; @@ -46,7 +46,8 @@ import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import clipBorder from '@deities/ui/clipBorder.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import getColor from '@deities/ui/getColor.tsx'; -import Icon, { SVGIcon } from '@deities/ui/Icon.tsx'; +import type { SVGIcon } from '@deities/ui/Icon.tsx'; +import Icon from '@deities/ui/Icon.tsx'; import Ammo from '@deities/ui/icons/Ammo.tsx'; import DropUnit from '@deities/ui/icons/DropUnit.tsx'; import Heart from '@deities/ui/icons/Heart.tsx'; @@ -69,14 +70,8 @@ import Visible from '@iconify-icons/pixelarticons/visible.js'; import WarningBox from '@iconify-icons/pixelarticons/warning-box.js'; import ImmutableMap from '@nkzw/immutable-map'; import { fbt } from 'fbt'; -import { - ComponentProps, - memo, - ReactNode, - useEffect, - useMemo, - useState, -} from 'react'; +import type { ComponentProps, ReactNode } from 'react'; +import { memo, useEffect, useMemo, useState } from 'react'; import getHealthColor from '../behavior/attack/getHealthColor.tsx'; import intlList, { Conjunctions, Delimiters } from '../i18n/intlList.tsx'; import getAnyBuildingTileField from '../lib/getAnyBuildingTileField.tsx'; @@ -86,7 +81,7 @@ import getTranslatedEntityName, { } from '../lib/getTranslatedEntityName.tsx'; import getTranslatedFactionName from '../lib/getTranslatedFactionName.tsx'; import Tick from '../Tick.tsx'; -import { FactionNames } from '../Types.tsx'; +import type { FactionNames } from '../Types.tsx'; import MiniPlayerIcon from '../ui/MiniPlayerIcon.tsx'; import UILabel from '../ui/UILabel.tsx'; import UnitTile from '../Unit.tsx'; diff --git a/hera/card/lib/tileFieldHasDecorator.tsx b/hera/card/lib/tileFieldHasDecorator.tsx index 7c8fb6e3..470cb721 100644 --- a/hera/card/lib/tileFieldHasDecorator.tsx +++ b/hera/card/lib/tileFieldHasDecorator.tsx @@ -1,5 +1,6 @@ -import { getTile, getTileInfo, TileField } from '@deities/athena/info/Tile.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { TileField } from '@deities/athena/info/Tile.tsx'; +import { getTile, getTileInfo } from '@deities/athena/info/Tile.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; export default function tileFieldHasDecorator(field: TileField, biome: Biome) { const tile0 = getTile(field, 0); diff --git a/hera/character/MiniPortrait.tsx b/hera/character/MiniPortrait.tsx index 90fa6509..a7631904 100644 --- a/hera/character/MiniPortrait.tsx +++ b/hera/character/MiniPortrait.tsx @@ -1,15 +1,14 @@ import getUserRoute from '@deities/apollo/routes/getUserRoute.tsx'; import { getUnitInfo } from '@deities/athena/info/Unit.tsx'; -import Player, { - isHumanPlayer, - PlayerID, -} from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; +import { isHumanPlayer } from '@deities/athena/map/Player.tsx'; import cssVar, { applyVar } from '@deities/ui/cssVar.tsx'; import getColor from '@deities/ui/getColor.tsx'; import Link from '@deities/ui/Link.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; import { css } from '@emotion/css'; -import { UserLike } from '../hooks/useUserMap.tsx'; +import type { UserLike } from '../hooks/useUserMap.tsx'; import Portrait from './Portrait.tsx'; export default function MiniPortrait({ diff --git a/hera/character/Portrait.tsx b/hera/character/Portrait.tsx index 5795a378..efd911e6 100644 --- a/hera/character/Portrait.tsx +++ b/hera/character/Portrait.tsx @@ -1,9 +1,7 @@ import { spriteURL } from '@deities/art/Sprites.tsx'; -import { UnitInfo } from '@deities/athena/info/Unit.tsx'; -import { - DynamicPlayerID, - encodeDynamicPlayerID, -} from '@deities/athena/map/Player.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import type { DynamicPlayerID } from '@deities/athena/map/Player.tsx'; +import { encodeDynamicPlayerID } from '@deities/athena/map/Player.tsx'; import clipBorder from '@deities/ui/clipBorder.tsx'; import { CSSVariables } from '@deities/ui/cssVar.tsx'; import { css, cx, keyframes } from '@emotion/css'; diff --git a/hera/editor/MapEditor.tsx b/hera/editor/MapEditor.tsx index 70447499..7f6b1d58 100644 --- a/hera/editor/MapEditor.tsx +++ b/hera/editor/MapEditor.tsx @@ -1,13 +1,9 @@ -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; -import { - decodeEffects, - Effects, - encodeEffects, - Scenario, -} from '@deities/apollo/Effects.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { Effects, Scenario } from '@deities/apollo/Effects.tsx'; +import { decodeEffects, encodeEffects } from '@deities/apollo/Effects.tsx'; import getColorName from '@deities/apollo/lib/getColorName.tsx'; import nameGenerator from '@deities/apollo/lib/nameGenerator.tsx'; -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import getCampaignRoute from '@deities/apollo/routes/getCampaignRoute.tsx'; import { generateBuildings, @@ -18,7 +14,8 @@ import { import { Bush } from '@deities/athena/info/Decorator.tsx'; import { getTileInfo, Plain } from '@deities/athena/info/Tile.tsx'; import dropInactivePlayers from '@deities/athena/lib/dropInactivePlayers.tsx'; -import resizeMap, { ResizeOrigin } from '@deities/athena/lib/resizeMap.tsx'; +import type { ResizeOrigin } from '@deities/athena/lib/resizeMap.tsx'; +import resizeMap from '@deities/athena/lib/resizeMap.tsx'; import startGame from '@deities/athena/lib/startGame.tsx'; import updateActivePlayers from '@deities/athena/lib/updateActivePlayers.tsx'; import updatePlayer from '@deities/athena/lib/updatePlayer.tsx'; @@ -26,13 +23,14 @@ import validateMap from '@deities/athena/lib/validateMap.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; import { Biome, Biomes } from '@deities/athena/map/Biome.tsx'; import { DoubleSize, TileSize } from '@deities/athena/map/Configuration.tsx'; -import { Bot, HumanPlayer, PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { Bot, HumanPlayer } from '@deities/athena/map/Player.tsx'; import { toTeamArray } from '@deities/athena/map/Team.tsx'; import MapData, { SizeVector } from '@deities/athena/MapData.tsx'; import getFirstOrThrow from '@deities/hephaestus/getFirstOrThrow.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import random from '@deities/hephaestus/random.tsx'; -import { ClientGame } from '@deities/hermes/game/toClientGame.tsx'; +import type { ClientGame } from '@deities/hermes/game/toClientGame.tsx'; import { isIOS } from '@deities/ui/Browser.tsx'; import isControlElement from '@deities/ui/controls/isControlElement.tsx'; import useInput from '@deities/ui/controls/useInput.tsx'; @@ -53,8 +51,8 @@ import { css, cx } from '@emotion/css'; import ChevronLeft from '@iconify-icons/pixelarticons/chevron-left.js'; import { fbt } from 'fbt'; import { AnimatePresence } from 'framer-motion'; +import type { ReactNode } from 'react'; import React, { - ReactNode, useCallback, useEffect, useMemo, @@ -65,15 +63,14 @@ import { useBiomeMusic, usePlayMusic } from '../audio/Music.tsx'; import NullBehavior from '../behavior/NullBehavior.tsx'; import { getDrawerPaddingStyle } from '../bottom-drawer/BottomDrawer.tsx'; import GameMap from '../GameMap.tsx'; -import useAnimationSpeed, { - AnimationSpeed, -} from '../hooks/useAnimationSpeed.tsx'; +import type { AnimationSpeed } from '../hooks/useAnimationSpeed.tsx'; +import useAnimationSpeed from '../hooks/useAnimationSpeed.tsx'; import useClientGameAction from '../hooks/useClientGameAction.tsx'; import useHide from '../hooks/useHide.tsx'; -import { UserWithFactionNameAndSkills } from '../hooks/useUserMap.tsx'; +import type { UserWithFactionNameAndSkills } from '../hooks/useUserMap.tsx'; import botToUser from '../lib/botToUser.tsx'; import { hasNotableAnimation } from '../MapAnimations.tsx'; -import { Actions, State, StateLike } from '../Types.tsx'; +import type { Actions, State, StateLike } from '../Types.tsx'; import CurrentGameCard from '../ui/CurrentGameCard.tsx'; import GameActions from '../ui/GameActions.tsx'; import maybeFade from '../ui/lib/maybeFade.tsx'; @@ -93,7 +90,7 @@ import updateUndoStack from './lib/updateUndoStack.tsx'; import ZoomButton from './lib/ZoomButton.tsx'; import MapEditorControlPanel from './panels/MapEditorControlPanel.tsx'; import ResizeHandle from './ResizeHandle.tsx'; -import { +import type { EditorMode, EditorState, MapCreateFunction, diff --git a/hera/editor/ResizeHandle.tsx b/hera/editor/ResizeHandle.tsx index ca58a96b..d753b383 100644 --- a/hera/editor/ResizeHandle.tsx +++ b/hera/editor/ResizeHandle.tsx @@ -1,4 +1,4 @@ -import { ResizeOrigin } from '@deities/athena/lib/resizeMap.tsx'; +import type { ResizeOrigin } from '@deities/athena/lib/resizeMap.tsx'; import { MaxSize, MinSize, @@ -8,13 +8,8 @@ import { SizeVector } from '@deities/athena/MapData.tsx'; import parseInteger from '@deities/hephaestus/parseInteger.tsx'; import cssVar, { applyVar } from '@deities/ui/cssVar.tsx'; import { css, cx } from '@emotion/css'; -import { - MouseEvent as ReactMouseEvent, - useCallback, - useEffect, - useRef, - useState, -} from 'react'; +import type { MouseEvent as ReactMouseEvent } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; type Size = Readonly<{ x: number; y: number }>; diff --git a/hera/editor/Types.tsx b/hera/editor/Types.tsx index 161b3f55..b29c3573 100644 --- a/hera/editor/Types.tsx +++ b/hera/editor/Types.tsx @@ -1,11 +1,11 @@ -import { Effects, Scenario } from '@deities/apollo/Effects.tsx'; -import { Decorator } from '@deities/athena/info/Decorator.tsx'; -import Building from '@deities/athena/map/Building.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { WinConditionsWithVectors } from '@deities/athena/WinConditions.tsx'; -import { Edges } from '../lib/Edges.tsx'; -import { MapCreator } from '../ui/MapDetails.tsx'; +import type { Effects, Scenario } from '@deities/apollo/Effects.tsx'; +import type { Decorator } from '@deities/athena/info/Decorator.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { WinConditionsWithVectors } from '@deities/athena/WinConditions.tsx'; +import type { Edges } from '../lib/Edges.tsx'; +import type { MapCreator } from '../ui/MapDetails.tsx'; export type EditorMode = | 'conditions' diff --git a/hera/editor/behavior/DesignBehavior.tsx b/hera/editor/behavior/DesignBehavior.tsx index 1263f131..218e013c 100644 --- a/hera/editor/behavior/DesignBehavior.tsx +++ b/hera/editor/behavior/DesignBehavior.tsx @@ -1,4 +1,5 @@ -import { Decorator } from '@deities/athena/info/Decorator.tsx'; +import type { Decorator } from '@deities/athena/info/Decorator.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; import { CrossOverTiles, DeepSea, @@ -9,7 +10,6 @@ import { River, Sea, ShipyardConstructionSite, - TileInfo, TileTypes, Trench, } from '@deities/athena/info/Tile.tsx'; @@ -20,18 +20,18 @@ import canPlaceTile from '@deities/athena/lib/canPlaceTile.tsx'; import getActivePlayers from '@deities/athena/lib/getActivePlayers.tsx'; import getDecoratorIndex from '@deities/athena/lib/getDecoratorIndex.tsx'; import verifyTiles from '@deities/athena/lib/verifyTiles.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import { getDecoratorLimit } from '@deities/athena/map/Configuration.tsx'; -import Entity from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import writeTile from '@deities/athena/mutation/writeTile.tsx'; import { RadiusItem } from '@deities/athena/Radius.tsx'; import getFirstOrThrow from '@deities/hephaestus/getFirstOrThrow.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import throttle from '@deities/ui/controls/throttle.tsx'; -import ImmutableMap from '@nkzw/immutable-map'; +import type ImmutableMap from '@nkzw/immutable-map'; import { fbt } from 'fbt'; import addExplosionAnimation from '../../animations/addExplosionAnimation.tsx'; import Decorators from '../../Decorators.tsx'; @@ -39,7 +39,7 @@ import addFlashAnimation from '../../lib/addFlashAnimation.tsx'; import explodeUnits from '../../lib/explodeUnits.tsx'; import spawn from '../../lib/spawn.tsx'; import { RadiusType } from '../../Radius.tsx'; -import { +import type { Actions, MapBehavior, State, @@ -49,7 +49,7 @@ import { import FlashFlyout from '../../ui/FlashFlyout.tsx'; import { FlyoutItem } from '../../ui/Flyout.tsx'; import updateUndoStack from '../lib/updateUndoStack.tsx'; -import { EditorState } from '../Types.tsx'; +import type { EditorState } from '../Types.tsx'; const playPutSound = throttle(() => AudioPlayer.playSound('UI/Put'), 300); diff --git a/hera/editor/behavior/EntityBehavior.tsx b/hera/editor/behavior/EntityBehavior.tsx index fc6ffc88..dc38beb8 100644 --- a/hera/editor/behavior/EntityBehavior.tsx +++ b/hera/editor/behavior/EntityBehavior.tsx @@ -1,13 +1,14 @@ import getAvailableUnitActions from '@deities/athena/lib/getAvailableUnitActions.tsx'; -import Building from '@deities/athena/map/Building.tsx'; -import Entity, { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { useCallback } from 'react'; import AbstractSelectBehavior from '../../behavior/AbstractSelectBehavior.tsx'; -import { MenuItemProps } from '../../behavior/Menu.tsx'; +import type { MenuItemProps } from '../../behavior/Menu.tsx'; import Cursor from '../../Cursor.tsx'; -import { State, StateLike, StateWithActions } from '../../Types.tsx'; +import type { State, StateLike, StateWithActions } from '../../Types.tsx'; import ActionWheel, { ActionButton } from '../../ui/ActionWheel.tsx'; import SelectEntity from '../../ui/SelectEntity.tsx'; diff --git a/hera/editor/behavior/VectorBehavior.tsx b/hera/editor/behavior/VectorBehavior.tsx index 86f26b44..851423ce 100644 --- a/hera/editor/behavior/VectorBehavior.tsx +++ b/hera/editor/behavior/VectorBehavior.tsx @@ -1,6 +1,6 @@ -import Vector from '@deities/athena/map/Vector.tsx'; -import { Actions, State, StateLike } from '../../Types.tsx'; -import { EditorState } from '../Types.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { Actions, State, StateLike } from '../../Types.tsx'; +import type { EditorState } from '../Types.tsx'; export default class VectorBehavior { public readonly type = 'vector' as const; diff --git a/hera/editor/lib/AIBehaviorLink.tsx b/hera/editor/lib/AIBehaviorLink.tsx index 5e4385b2..cb1a17c9 100644 --- a/hera/editor/lib/AIBehaviorLink.tsx +++ b/hera/editor/lib/AIBehaviorLink.tsx @@ -1,10 +1,11 @@ import { AIBehavior } from '@deities/athena/map/AIBehavior.tsx'; -import Entity, { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import InlineLink from '@deities/ui/InlineLink.tsx'; import { css } from '@emotion/css'; -import { State } from '../../Types.tsx'; -import { EntityUndoKey } from '../Types.tsx'; +import type { State } from '../../Types.tsx'; +import type { EntityUndoKey } from '../Types.tsx'; const getAIBehaviorText = (behavior: AIBehavior) => { switch (behavior) { diff --git a/hera/editor/lib/ActionCard.tsx b/hera/editor/lib/ActionCard.tsx index 7eba27de..6b553280 100644 --- a/hera/editor/lib/ActionCard.tsx +++ b/hera/editor/lib/ActionCard.tsx @@ -1,23 +1,23 @@ -import { Action } from '@deities/apollo/Action.tsx'; +import type { Action } from '@deities/apollo/Action.tsx'; import { Plain } from '@deities/athena/info/Tile.tsx'; import { getUnitInfoOrThrow, mapUnits, mapUnitsWithContentRestriction, } from '@deities/athena/info/Unit.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; import { AnimationConfig, MaxMessageLength, TileSize, } from '@deities/athena/map/Configuration.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import { DynamicPlayerIDs, encodeDynamicPlayerID, - PlayerID, resolveDynamicPlayerID, } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; import Box from '@deities/ui/Box.tsx'; import Breakpoints from '@deities/ui/Breakpoints.tsx'; @@ -33,11 +33,12 @@ import ChevronUp from '@iconify-icons/pixelarticons/chevron-up.js'; import Close from '@iconify-icons/pixelarticons/close.js'; import { fbt } from 'fbt'; import { useInView } from 'framer-motion'; -import { memo, RefObject, useRef, useState } from 'react'; +import type { RefObject } from 'react'; +import { memo, useRef, useState } from 'react'; import Portrait from '../../character/Portrait.tsx'; import { useSprites } from '../../hooks/useSprites.tsx'; -import { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; -import { FactionNames } from '../../Types.tsx'; +import type { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; +import type { FactionNames } from '../../Types.tsx'; import formatCharacterText from '../../ui/lib/formatCharacterText.tsx'; import PlayerIcon from '../../ui/PlayerIcon.tsx'; import UnitTile from '../../Unit.tsx'; diff --git a/hera/editor/lib/BiomeIcon.tsx b/hera/editor/lib/BiomeIcon.tsx index dc9c393b..d57da344 100644 --- a/hera/editor/lib/BiomeIcon.tsx +++ b/hera/editor/lib/BiomeIcon.tsx @@ -1,5 +1,5 @@ import { Plain } from '@deities/athena/info/Tile.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; import { TileSize } from '@deities/athena/map/Configuration.tsx'; import MapData from '@deities/athena/MapData.tsx'; import Vision from '@deities/athena/Vision.tsx'; diff --git a/hera/editor/lib/EffectTitle.tsx b/hera/editor/lib/EffectTitle.tsx index 941d638c..879b32bc 100644 --- a/hera/editor/lib/EffectTitle.tsx +++ b/hera/editor/lib/EffectTitle.tsx @@ -1,9 +1,13 @@ -import { +import type { GameEndCondition, WinConditionID, } from '@deities/apollo/Condition.tsx'; -import { Effect, Effects, EffectTrigger } from '@deities/apollo/Effects.tsx'; -import { WinConditions } from '@deities/athena/WinConditions.tsx'; +import type { + Effect, + Effects, + EffectTrigger, +} from '@deities/apollo/Effects.tsx'; +import type { WinConditions } from '@deities/athena/WinConditions.tsx'; import ellipsis from '@deities/ui/ellipsis.tsx'; import { css, cx } from '@emotion/css'; import { memo } from 'react'; diff --git a/hera/editor/lib/WinConditionCard.tsx b/hera/editor/lib/WinConditionCard.tsx index 46ddeca6..bb73aab8 100644 --- a/hera/editor/lib/WinConditionCard.tsx +++ b/hera/editor/lib/WinConditionCard.tsx @@ -1,11 +1,11 @@ import { Skills } from '@deities/athena/info/Skill.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { WinCondition } from '@deities/athena/WinConditions.tsx'; import { MAX_AMOUNT, MAX_ROUNDS, MIN_AMOUNT, MIN_ROUNDS, - WinCondition, winConditionHasAmounts, winConditionHasLabel, winConditionHasRounds, diff --git a/hera/editor/lib/ZoomButton.tsx b/hera/editor/lib/ZoomButton.tsx index 782bc117..85c088fe 100644 --- a/hera/editor/lib/ZoomButton.tsx +++ b/hera/editor/lib/ZoomButton.tsx @@ -5,7 +5,7 @@ import MenuButton from '@deities/ui/MenuButton.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; import { css, cx } from '@emotion/css'; import { useCallback } from 'react'; -import { SetZoomFn } from '../hooks/useZoom.tsx'; +import type { SetZoomFn } from '../hooks/useZoom.tsx'; export default function ZoomButton({ className, diff --git a/hera/editor/lib/canFillTile.tsx b/hera/editor/lib/canFillTile.tsx index 5e532fa0..69a30b8a 100644 --- a/hera/editor/lib/canFillTile.tsx +++ b/hera/editor/lib/canFillTile.tsx @@ -1,4 +1,5 @@ -import { Beach, TileInfo } from '@deities/athena/info/Tile.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; +import { Beach } from '@deities/athena/info/Tile.tsx'; export default function canFillTile(tile?: TileInfo | null): tile is TileInfo { return !!(tile && tile.style.layer === 0 && tile !== Beach); diff --git a/hera/editor/lib/changePlayer.tsx b/hera/editor/lib/changePlayer.tsx index 0e3dde13..3049f721 100644 --- a/hera/editor/lib/changePlayer.tsx +++ b/hera/editor/lib/changePlayer.tsx @@ -1,12 +1,9 @@ import updatePlayers from '@deities/athena/lib/updatePlayers.tsx'; -import { - HumanPlayer, - PlaceholderPlayer, - PlayerID, -} from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { HumanPlayer, PlaceholderPlayer } from '@deities/athena/map/Player.tsx'; import Team from '@deities/athena/map/Team.tsx'; import ImmutableMap from '@nkzw/immutable-map'; -import { Actions, State } from '../../Types.tsx'; +import type { Actions, State } from '../../Types.tsx'; export default async function changePlayer( state: State, diff --git a/hera/editor/lib/getMapValidationErrorText.tsx b/hera/editor/lib/getMapValidationErrorText.tsx index 6d35f23f..18090f6c 100644 --- a/hera/editor/lib/getMapValidationErrorText.tsx +++ b/hera/editor/lib/getMapValidationErrorText.tsx @@ -1,4 +1,4 @@ -import { ErrorReason } from '@deities/athena/lib/validateMap.tsx'; +import type { ErrorReason } from '@deities/athena/lib/validateMap.tsx'; import { fbt } from 'fbt'; export default function getValidationErrorText(error?: ErrorReason) { diff --git a/hera/editor/lib/hasGameEndCondition.tsx b/hera/editor/lib/hasGameEndCondition.tsx index 8be90d39..74701e4a 100644 --- a/hera/editor/lib/hasGameEndCondition.tsx +++ b/hera/editor/lib/hasGameEndCondition.tsx @@ -1,4 +1,4 @@ -import { Conditions, WinConditionID } from '@deities/apollo/Condition.tsx'; +import type { Conditions, WinConditionID } from '@deities/apollo/Condition.tsx'; export default function hasGameEndCondition( id: WinConditionID, diff --git a/hera/editor/lib/navigate.tsx b/hera/editor/lib/navigate.tsx index 9461a73f..8501dc2c 100644 --- a/hera/editor/lib/navigate.tsx +++ b/hera/editor/lib/navigate.tsx @@ -1,4 +1,4 @@ -import { Direction } from './useGridNavigation.tsx'; +import type { Direction } from './useGridNavigation.tsx'; export default function navigate( direction: Direction, diff --git a/hera/editor/lib/selectWinConditionEffect.tsx b/hera/editor/lib/selectWinConditionEffect.tsx index 5bb5f8ed..da4b5607 100644 --- a/hera/editor/lib/selectWinConditionEffect.tsx +++ b/hera/editor/lib/selectWinConditionEffect.tsx @@ -1,6 +1,7 @@ -import { WinConditionID } from '@deities/apollo/Condition.tsx'; -import { WinCondition, WinCriteria } from '@deities/athena/WinConditions.tsx'; -import { EditorState } from '../Types.tsx'; +import type { WinConditionID } from '@deities/apollo/Condition.tsx'; +import type { WinCondition } from '@deities/athena/WinConditions.tsx'; +import { WinCriteria } from '@deities/athena/WinConditions.tsx'; +import type { EditorState } from '../Types.tsx'; import hasGameEndCondition from './hasGameEndCondition.tsx'; export default function selectWinConditionEffect( diff --git a/hera/editor/lib/tileFieldHasAnimation.tsx b/hera/editor/lib/tileFieldHasAnimation.tsx index 9fee5463..056b235f 100644 --- a/hera/editor/lib/tileFieldHasAnimation.tsx +++ b/hera/editor/lib/tileFieldHasAnimation.tsx @@ -1,4 +1,5 @@ -import { getTile, getTileInfo, TileField } from '@deities/athena/info/Tile.tsx'; +import type { TileField } from '@deities/athena/info/Tile.tsx'; +import { getTile, getTileInfo } from '@deities/athena/info/Tile.tsx'; export default function tileFieldHasAnimation(field: TileField) { const tile0 = getTile(field, 0); diff --git a/hera/editor/lib/updateUndoStack.tsx b/hera/editor/lib/updateUndoStack.tsx index a0905aab..41ce8767 100644 --- a/hera/editor/lib/updateUndoStack.tsx +++ b/hera/editor/lib/updateUndoStack.tsx @@ -1,4 +1,8 @@ -import { EditorState, SetEditorStateFunction, UndoEntry } from '../Types.tsx'; +import type { + EditorState, + SetEditorStateFunction, + UndoEntry, +} from '../Types.tsx'; export default function updateUndoStack( { setEditorState }: { setEditorState: SetEditorStateFunction }, diff --git a/hera/editor/panels/DecoratorPanel.tsx b/hera/editor/panels/DecoratorPanel.tsx index e99c6d8d..af7bad60 100644 --- a/hera/editor/panels/DecoratorPanel.tsx +++ b/hera/editor/panels/DecoratorPanel.tsx @@ -1,7 +1,5 @@ -import { - DecoratorInfo, - getAllDecorators, -} from '@deities/athena/info/Decorator.tsx'; +import type { DecoratorInfo } from '@deities/athena/info/Decorator.tsx'; +import { getAllDecorators } from '@deities/athena/info/Decorator.tsx'; import getBiomeStyle from '@deities/athena/lib/getBiomeStyle.tsx'; import { TileSize } from '@deities/athena/map/Configuration.tsx'; import getFirstOrThrow from '@deities/hephaestus/getFirstOrThrow.tsx'; @@ -9,12 +7,12 @@ import Box from '@deities/ui/Box.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { useCallback, useMemo } from 'react'; import InlineTileList from '../../card/InlineTileList.tsx'; -import { StateWithActions } from '../../Types.tsx'; +import type { StateWithActions } from '../../Types.tsx'; import useColumns from '../hooks/useColumns.tsx'; import DeleteTile from '../lib/DeleteTile.tsx'; import navigate from '../lib/navigate.tsx'; import useGridNavigation from '../lib/useGridNavigation.tsx'; -import { EditorState } from '../Types.tsx'; +import type { EditorState } from '../Types.tsx'; const decorators = getAllDecorators(); diff --git a/hera/editor/panels/DesignPanel.tsx b/hera/editor/panels/DesignPanel.tsx index 43bdea82..ac085601 100644 --- a/hera/editor/panels/DesignPanel.tsx +++ b/hera/editor/panels/DesignPanel.tsx @@ -2,24 +2,20 @@ import { mapBuildings, mapBuildingsWithContentRestriction, } from '@deities/athena/info/Building.tsx'; -import { - getAllTiles, - getTileInfo, - Plain, - TileInfo, -} from '@deities/athena/info/Tile.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; +import { getAllTiles, getTileInfo, Plain } from '@deities/athena/info/Tile.tsx'; import { mapUnits, mapUnitsWithContentRestriction, } from '@deities/athena/info/Unit.tsx'; import getBiomeStyle from '@deities/athena/lib/getBiomeStyle.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import { AnimationConfig, DoubleSize, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; import Box from '@deities/ui/Box.tsx'; import ellipsis from '@deities/ui/ellipsis.tsx'; @@ -31,19 +27,20 @@ import { css, cx } from '@emotion/css'; import Fill from '@iconify-icons/pixelarticons/fill-half.js'; import { fbt } from 'fbt'; import { useCallback, useMemo } from 'react'; -import InlineTileList, { SelectTileFn } from '../../card/InlineTileList.tsx'; -import { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; +import type { SelectTileFn } from '../../card/InlineTileList.tsx'; +import InlineTileList from '../../card/InlineTileList.tsx'; +import type { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; import getAnyBuildingTileField from '../../lib/getAnyBuildingTileField.tsx'; import getAnyUnitTile from '../../lib/getAnyUnitTile.tsx'; import Tick from '../../Tick.tsx'; -import { StateWithActions } from '../../Types.tsx'; +import type { StateWithActions } from '../../Types.tsx'; import useColumns from '../hooks/useColumns.tsx'; import canFillTile from '../lib/canFillTile.tsx'; import DeleteTile from '../lib/DeleteTile.tsx'; import navigate from '../lib/navigate.tsx'; import useGridNavigation from '../lib/useGridNavigation.tsx'; import EditorPlayerSelector from '../selectors/EditorPlayerSelector.tsx'; -import { EditorState } from '../Types.tsx'; +import type { EditorState } from '../Types.tsx'; export default function DesignPanel({ actions, diff --git a/hera/editor/panels/EffectsPanel.tsx b/hera/editor/panels/EffectsPanel.tsx index aae9269a..b1731d6c 100644 --- a/hera/editor/panels/EffectsPanel.tsx +++ b/hera/editor/panels/EffectsPanel.tsx @@ -1,6 +1,6 @@ -import { Action } from '@deities/apollo/Action.tsx'; -import { Effect, Scenario } from '@deities/apollo/Effects.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { Action } from '@deities/apollo/Action.tsx'; +import type { Effect, Scenario } from '@deities/apollo/Effects.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { WinCriteria } from '@deities/athena/WinConditions.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import Box from '@deities/ui/Box.tsx'; @@ -14,13 +14,14 @@ import InlineLink from '@deities/ui/InlineLink.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { css, cx } from '@emotion/css'; import Plus from '@iconify-icons/pixelarticons/plus.js'; -import { RefObject, useCallback, useMemo, useState } from 'react'; -import { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; +import type { RefObject } from 'react'; +import { useCallback, useMemo, useState } from 'react'; +import type { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; import ActionCard from '../lib/ActionCard.tsx'; import EffectTitle, { EffectWinConditionTitle } from '../lib/EffectTitle.tsx'; import selectWinConditionEffect from '../lib/selectWinConditionEffect.tsx'; import EffectSelector from '../selectors/EffectSelector.tsx'; -import { EditorState, SetEditorStateFunction } from '../Types.tsx'; +import type { EditorState, SetEditorStateFunction } from '../Types.tsx'; export default function EffectsPanel({ editor, diff --git a/hera/editor/panels/EntityPanel.tsx b/hera/editor/panels/EntityPanel.tsx index a2642993..ce5e4117 100644 --- a/hera/editor/panels/EntityPanel.tsx +++ b/hera/editor/panels/EntityPanel.tsx @@ -1,5 +1,6 @@ import { Behavior, MaxSkills } from '@deities/athena/info/Building.tsx'; -import { getSkillConfig, Skill, Skills } from '@deities/athena/info/Skill.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import { getSkillConfig, Skills } from '@deities/athena/info/Skill.tsx'; import { Plain } from '@deities/athena/info/Tile.tsx'; import { generateUnitName } from '@deities/athena/info/UnitNames.tsx'; import hasLeader from '@deities/athena/lib/hasLeader.tsx'; @@ -10,9 +11,11 @@ import { MaxHealth, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import Entity, { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; -import { PlayerID, PlayerIDs } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type Entity from '@deities/athena/map/Entity.tsx'; +import { isBuilding, isUnit } from '@deities/athena/map/Entity.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { PlayerIDs } from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import parseInteger from '@deities/hephaestus/parseInteger.tsx'; import Box from '@deities/ui/Box.tsx'; @@ -31,7 +34,7 @@ import { fbt } from 'fbt'; import { Fragment, useCallback, useEffect, useState } from 'react'; import AttributeGrid from '../../card/AttributeGrid.tsx'; import { useSprites } from '../../hooks/useSprites.tsx'; -import { StateWithActions } from '../../Types.tsx'; +import type { StateWithActions } from '../../Types.tsx'; import PlayerIcon from '../../ui/PlayerIcon.tsx'; import { SkillSelector } from '../../ui/SkillDialog.tsx'; import UnitTile from '../../Unit.tsx'; @@ -39,7 +42,7 @@ import AIBehaviorLink from '../lib/AIBehaviorLink.tsx'; import changePlayer from '../lib/changePlayer.tsx'; import updateUndoStack from '../lib/updateUndoStack.tsx'; import LabelSelector from '../selectors/LabelSelector.tsx'; -import { EntityUndoKey } from '../Types.tsx'; +import type { EntityUndoKey } from '../Types.tsx'; const SkillsWithoutCosts = new Set( [...Skills].filter((skill) => getSkillConfig(skill).cost != null), diff --git a/hera/editor/panels/EvaluationPanel.tsx b/hera/editor/panels/EvaluationPanel.tsx index 9d22a378..215eda26 100644 --- a/hera/editor/panels/EvaluationPanel.tsx +++ b/hera/editor/panels/EvaluationPanel.tsx @@ -1,4 +1,4 @@ -import { GameEndActionResponse } from '@deities/apollo/GameOver.tsx'; +import type { GameEndActionResponse } from '@deities/apollo/GameOver.tsx'; import getColorName from '@deities/apollo/lib/getColorName.tsx'; import nameGenerator from '@deities/apollo/lib/nameGenerator.tsx'; import dropInactivePlayers from '@deities/athena/lib/dropInactivePlayers.tsx'; @@ -9,7 +9,7 @@ import { Bot } from '@deities/athena/map/Player.tsx'; import { toTeamArray } from '@deities/athena/map/Team.tsx'; import groupBy from '@deities/hephaestus/groupBy.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; -import { ClientGame } from '@deities/hermes/game/toClientGame.tsx'; +import type { ClientGame } from '@deities/hermes/game/toClientGame.tsx'; import Box from '@deities/ui/Box.tsx'; import ErrorText from '@deities/ui/ErrorText.tsx'; import Spinner from '@deities/ui/Spinner.tsx'; @@ -19,9 +19,9 @@ import { Fragment, useCallback, useEffect, useMemo, useState } from 'react'; import useClientGameAction from '../../hooks/useClientGameAction.tsx'; import intlList, { Conjunctions, Delimiters } from '../../i18n/intlList.tsx'; import getTranslatedFactionName from '../../lib/getTranslatedFactionName.tsx'; -import { StateWithActions } from '../../Types.tsx'; +import type { StateWithActions } from '../../Types.tsx'; import MiniPlayerIcon from '../../ui/MiniPlayerIcon.tsx'; -import { EditorState } from '../Types.tsx'; +import type { EditorState } from '../Types.tsx'; type Result = Readonly<{ actionResponse: GameEndActionResponse; diff --git a/hera/editor/panels/MapEditorControlPanel.tsx b/hera/editor/panels/MapEditorControlPanel.tsx index f52772e4..b214706a 100644 --- a/hera/editor/panels/MapEditorControlPanel.tsx +++ b/hera/editor/panels/MapEditorControlPanel.tsx @@ -1,6 +1,7 @@ -import { Effect, Scenario } from '@deities/apollo/Effects.tsx'; -import { ResizeOrigin } from '@deities/athena/lib/resizeMap.tsx'; -import MapData, { SizeVector } from '@deities/athena/MapData.tsx'; +import type { Effect, Scenario } from '@deities/apollo/Effects.tsx'; +import type { ResizeOrigin } from '@deities/athena/lib/resizeMap.tsx'; +import type { SizeVector } from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import Box from '@deities/ui/Box.tsx'; @@ -9,7 +10,8 @@ import Button from '@deities/ui/Button.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import useAlert from '@deities/ui/hooks/useAlert.tsx'; import useMedia from '@deities/ui/hooks/useMedia.tsx'; -import usePress, { UsePressProps } from '@deities/ui/hooks/usePress.tsx'; +import type { UsePressProps } from '@deities/ui/hooks/usePress.tsx'; +import usePress from '@deities/ui/hooks/usePress.tsx'; import Icon from '@deities/ui/Icon.tsx'; import InlineLink, { KeyboardShortcut } from '@deities/ui/InlineLink.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; @@ -19,9 +21,9 @@ import More from '@iconify-icons/pixelarticons/more-vertical.js'; import { fbt } from 'fbt'; import { useCallback, useRef } from 'react'; import BottomDrawer from '../../bottom-drawer/BottomDrawer.tsx'; -import { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; -import { StateWithActions } from '../../Types.tsx'; -import { +import type { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; +import type { StateWithActions } from '../../Types.tsx'; +import type { EditorState, MapObject, PreviousMapEditorState, diff --git a/hera/editor/panels/MapEditorSettingsPanel.tsx b/hera/editor/panels/MapEditorSettingsPanel.tsx index cedf2558..a3d18d22 100644 --- a/hera/editor/panels/MapEditorSettingsPanel.tsx +++ b/hera/editor/panels/MapEditorSettingsPanel.tsx @@ -1,4 +1,4 @@ -import { ResizeOrigin } from '@deities/athena/lib/resizeMap.tsx'; +import type { ResizeOrigin } from '@deities/athena/lib/resizeMap.tsx'; import { DoubleSize, MaxSize, @@ -17,9 +17,9 @@ import { useState } from 'react'; import useTagDataSource, { DEFAULT_TAGS, } from '../../hooks/useTagDataSource.tsx'; -import { StateWithActions } from '../../Types.tsx'; +import type { StateWithActions } from '../../Types.tsx'; import BiomeSelector from '../selectors/BiomeSelector.tsx'; -import { MapObject, SaveMapFunction, SetMapFunction } from '../Types.tsx'; +import type { MapObject, SaveMapFunction, SetMapFunction } from '../Types.tsx'; export default function MapEditorSettingsPanel({ actions, diff --git a/hera/editor/panels/RestrictionsPanel.tsx b/hera/editor/panels/RestrictionsPanel.tsx index 04d8b67b..e6175ed6 100644 --- a/hera/editor/panels/RestrictionsPanel.tsx +++ b/hera/editor/panels/RestrictionsPanel.tsx @@ -2,29 +2,30 @@ import { mapBuildings, mapBuildingsWithContentRestriction, } from '@deities/athena/info/Building.tsx'; -import { Skill, Skills } from '@deities/athena/info/Skill.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import { Skills } from '@deities/athena/info/Skill.tsx'; import { getTileInfo, Plain } from '@deities/athena/info/Tile.tsx'; import { mapUnits, mapUnitsWithContentRestriction, } from '@deities/athena/info/Unit.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import { ID } from '@deities/athena/MapData.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type { ID } from '@deities/athena/MapData.tsx'; import Box from '@deities/ui/Box.tsx'; import InlineLink from '@deities/ui/InlineLink.tsx'; import Portal from '@deities/ui/Portal.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { useCallback, useMemo, useState } from 'react'; import InlineTileList from '../../card/InlineTileList.tsx'; -import { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; +import type { UserWithFactionNameAndSkills } from '../../hooks/useUserMap.tsx'; import getAnyBuildingTileField from '../../lib/getAnyBuildingTileField.tsx'; import getAnyUnitTile from '../../lib/getAnyUnitTile.tsx'; import Tick from '../../Tick.tsx'; -import { StateWithActions } from '../../Types.tsx'; +import type { StateWithActions } from '../../Types.tsx'; import SkillDialog from '../../ui/SkillDialog.tsx'; -import { EditorState } from '../Types.tsx'; +import type { EditorState } from '../Types.tsx'; const mutate = (list: ReadonlySet, id: ID) => { const newList = new Set(list); diff --git a/hera/editor/panels/SetupPanel.tsx b/hera/editor/panels/SetupPanel.tsx index 855c33d7..16e8e849 100644 --- a/hera/editor/panels/SetupPanel.tsx +++ b/hera/editor/panels/SetupPanel.tsx @@ -1,18 +1,20 @@ -import { Skill, Skills } from '@deities/athena/info/Skill.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import { Skills } from '@deities/athena/info/Skill.tsx'; import updatePlayer from '@deities/athena/lib/updatePlayer.tsx'; import updatePlayers from '@deities/athena/lib/updatePlayers.tsx'; import { DefaultMapSkillSlots } from '@deities/athena/map/Configuration.tsx'; -import { HumanPlayer, PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { HumanPlayer } from '@deities/athena/map/Player.tsx'; import AIRegistry from '@deities/dionysus/AIRegistry.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { useCallback, useMemo } from 'react'; import getTranslatedFactionName from '../../lib/getTranslatedFactionName.tsx'; -import { State } from '../../Types.tsx'; +import type { State } from '../../Types.tsx'; import PlayerSelector from '../../ui/PlayerSelector.tsx'; import TeamSelector from '../../ui/TeamSelector.tsx'; -import { SetMapFunction } from '../Types.tsx'; +import type { SetMapFunction } from '../Types.tsx'; const aiRegistry = process.env.NODE_ENV === 'development' diff --git a/hera/editor/panels/WinConditionPanel.tsx b/hera/editor/panels/WinConditionPanel.tsx index 0ffe036a..9a6f68d4 100644 --- a/hera/editor/panels/WinConditionPanel.tsx +++ b/hera/editor/panels/WinConditionPanel.tsx @@ -1,8 +1,8 @@ import dropInactivePlayers from '@deities/athena/lib/dropInactivePlayers.tsx'; +import type { WinCondition } from '@deities/athena/WinConditions.tsx'; import { getInitialWinCondition, validateWinCondition, - WinCondition, winConditionHasVectors, WinCriteria, WinCriteriaList, @@ -13,11 +13,11 @@ import Stack from '@deities/ui/Stack.tsx'; import { css } from '@emotion/css'; import { useCallback, useState } from 'react'; import getWinCriteriaName from '../../lib/getWinCriteriaName.tsx'; -import { StateWithActions } from '../../Types.tsx'; +import type { StateWithActions } from '../../Types.tsx'; import hasGameEndCondition from '../lib/hasGameEndCondition.tsx'; import selectWinConditionEffect from '../lib/selectWinConditionEffect.tsx'; import WinConditionCard from '../lib/WinConditionCard.tsx'; -import { EditorState, SetEditorStateFunction } from '../Types.tsx'; +import type { EditorState, SetEditorStateFunction } from '../Types.tsx'; export default function WinConditionPanel({ actions, diff --git a/hera/editor/selectors/BiomeSelector.tsx b/hera/editor/selectors/BiomeSelector.tsx index 1adf5c9c..57f4dd5f 100644 --- a/hera/editor/selectors/BiomeSelector.tsx +++ b/hera/editor/selectors/BiomeSelector.tsx @@ -1,13 +1,13 @@ import { Plain } from '@deities/athena/info/Tile.tsx'; import convertBiome from '@deities/athena/lib/convertBiome.tsx'; import { Biome, Biomes } from '@deities/athena/map/Biome.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import Box from '@deities/ui/Box.tsx'; import useAlert from '@deities/ui/hooks/useAlert.tsx'; import { fbt } from 'fbt'; import React, { useCallback, useMemo } from 'react'; import InlineTileList from '../../card/InlineTileList.tsx'; -import { State } from '../../Types.tsx'; +import type { State } from '../../Types.tsx'; import useGridNavigation from '../lib/useGridNavigation.tsx'; const biomes = new Set(Biomes); diff --git a/hera/editor/selectors/EditorPlayerSelector.tsx b/hera/editor/selectors/EditorPlayerSelector.tsx index c2baf5fa..a0b1075e 100644 --- a/hera/editor/selectors/EditorPlayerSelector.tsx +++ b/hera/editor/selectors/EditorPlayerSelector.tsx @@ -1,12 +1,13 @@ -import { PlayerID, PlayerIDs } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { PlayerIDs } from '@deities/athena/map/Player.tsx'; import parseInteger from '@deities/hephaestus/parseInteger.tsx'; import isControlElement from '@deities/ui/controls/isControlElement.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { useEffect } from 'react'; -import { Actions, State } from '../../Types.tsx'; +import type { Actions, State } from '../../Types.tsx'; import PlayerIcon from '../../ui/PlayerIcon.tsx'; import changePlayer from '../lib/changePlayer.tsx'; -import { EditorState, SetEditorStateFunction } from '../Types.tsx'; +import type { EditorState, SetEditorStateFunction } from '../Types.tsx'; export default function EditorPlayerSelector({ actions, diff --git a/hera/editor/selectors/EffectSelector.tsx b/hera/editor/selectors/EffectSelector.tsx index 65187f99..abd44544 100644 --- a/hera/editor/selectors/EffectSelector.tsx +++ b/hera/editor/selectors/EffectSelector.tsx @@ -1,5 +1,5 @@ -import { Effects, Scenario } from '@deities/apollo/Effects.tsx'; -import { WinConditions } from '@deities/athena/WinConditions.tsx'; +import type { Effects, Scenario } from '@deities/apollo/Effects.tsx'; +import type { WinConditions } from '@deities/athena/WinConditions.tsx'; import InlineLink from '@deities/ui/InlineLink.tsx'; import Select from '@deities/ui/Select.tsx'; import EffectTitle from '../lib/EffectTitle.tsx'; diff --git a/hera/editor/selectors/LabelSelector.tsx b/hera/editor/selectors/LabelSelector.tsx index 1f3c1623..55c9f1f0 100644 --- a/hera/editor/selectors/LabelSelector.tsx +++ b/hera/editor/selectors/LabelSelector.tsx @@ -1,12 +1,9 @@ -import { - PlayerID, - PlayerIDs, - PlayerIDSet, -} from '@deities/athena/map/Player.tsx'; +import type { PlayerID, PlayerIDSet } from '@deities/athena/map/Player.tsx'; +import { PlayerIDs } from '@deities/athena/map/Player.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; import { css, cx } from '@emotion/css'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import UILabel from '../../ui/UILabel.tsx'; export default function LabelSelector({ diff --git a/hera/hooks/useClientGame.tsx b/hera/hooks/useClientGame.tsx index 65f27069..7cd9156a 100644 --- a/hera/hooks/useClientGame.tsx +++ b/hera/hooks/useClientGame.tsx @@ -1,11 +1,11 @@ -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; -import { Effects } from '@deities/apollo/Effects.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { Effects } from '@deities/apollo/Effects.tsx'; import mapWithAIPlayers from '@deities/apollo/lib/mapWithAIPlayers.tsx'; import startGame from '@deities/athena/lib/startGame.tsx'; import updatePlayer from '@deities/athena/lib/updatePlayer.tsx'; import { HumanPlayer } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { ClientGame } from '@deities/hermes/game/toClientGame.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { ClientGame } from '@deities/hermes/game/toClientGame.tsx'; import { useCallback, useState } from 'react'; const prepareMap = (map: MapData, userId: string) => diff --git a/hera/hooks/useClientGameAction.tsx b/hera/hooks/useClientGameAction.tsx index 5ebc21c9..14512011 100644 --- a/hera/hooks/useClientGameAction.tsx +++ b/hera/hooks/useClientGameAction.tsx @@ -1,20 +1,22 @@ -import { Action, MutateActionResponseFn } from '@deities/apollo/Action.tsx'; -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { + Action, + MutateActionResponseFn, +} from '@deities/apollo/Action.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; import encodeGameActionResponse from '@deities/apollo/actions/encodeGameActionResponse.tsx'; import executeGameAction from '@deities/apollo/actions/executeGameAction.tsx'; -import { Effects } from '@deities/apollo/Effects.tsx'; +import type { Effects } from '@deities/apollo/Effects.tsx'; import { computeVisibleEndTurnActionResponse } from '@deities/apollo/lib/computeVisibleActions.tsx'; import decodeGameActionResponse from '@deities/apollo/lib/decodeGameActionResponse.tsx'; import dropLabelsFromActionResponse from '@deities/apollo/lib/dropLabelsFromActionResponse.tsx'; import dropLabelsFromGameState from '@deities/apollo/lib/dropLabelsFromGameState.tsx'; -import { GameActionResponse, GameState } from '@deities/apollo/Types.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { GameActionResponse, GameState } from '@deities/apollo/Types.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { getHiddenLabels } from '@deities/athena/WinConditions.tsx'; import AIRegistry from '@deities/dionysus/AIRegistry.tsx'; import onGameEnd from '@deities/hermes/game/onGameEnd.tsx'; -import toClientGame, { - ClientGame, -} from '@deities/hermes/game/toClientGame.tsx'; +import type { ClientGame } from '@deities/hermes/game/toClientGame.tsx'; +import toClientGame from '@deities/hermes/game/toClientGame.tsx'; import { useCallback } from 'react'; const ActionError = (action: Action) => diff --git a/hera/hooks/useEffects.tsx b/hera/hooks/useEffects.tsx index edc95435..a97976d3 100644 --- a/hera/hooks/useEffects.tsx +++ b/hera/hooks/useEffects.tsx @@ -1,4 +1,5 @@ -import { decodeEffects, Effects } from '@deities/apollo/Effects.tsx'; +import type { Effects } from '@deities/apollo/Effects.tsx'; +import { decodeEffects } from '@deities/apollo/Effects.tsx'; import { useMemo } from 'react'; export default function useEffects(effects: string | undefined): Effects { diff --git a/hera/hooks/useHide.tsx b/hera/hooks/useHide.tsx index f7db4f0e..67ce1854 100644 --- a/hera/hooks/useHide.tsx +++ b/hera/hooks/useHide.tsx @@ -1,10 +1,5 @@ -import { - createContext, - ReactNode, - useContext, - useEffect, - useState, -} from 'react'; +import type { ReactNode } from 'react'; +import { createContext, useContext, useEffect, useState } from 'react'; export const Context = createContext(false); diff --git a/hera/hooks/useUserMap.tsx b/hera/hooks/useUserMap.tsx index 9bd738cc..af20aa85 100644 --- a/hera/hooks/useUserMap.tsx +++ b/hera/hooks/useUserMap.tsx @@ -1,7 +1,7 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { useMemo } from 'react'; -import { CharacterImage } from '../character/PortraitPicker.tsx'; +import type { CharacterImage } from '../character/PortraitPicker.tsx'; import botToUser from '../lib/botToUser.tsx'; export type UserLike = Readonly<{ diff --git a/hera/i18n/getCampaignMessage.tsx b/hera/i18n/getCampaignMessage.tsx index 5bc6ce1c..de9c4411 100644 --- a/hera/i18n/getCampaignMessage.tsx +++ b/hera/i18n/getCampaignMessage.tsx @@ -1,4 +1,4 @@ -import { CharacterMessageActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { CharacterMessageActionResponse } from '@deities/apollo/ActionResponse.tsx'; import getMessageKey from '@deities/apollo/lib/getMessageKey.tsx'; import CampaignMap from './CampaignMap.tsx'; diff --git a/hera/i18n/getLocale.tsx b/hera/i18n/getLocale.tsx index e2ccd507..924ce8c6 100644 --- a/hera/i18n/getLocale.tsx +++ b/hera/i18n/getLocale.tsx @@ -1,7 +1,7 @@ import isPresent from '@deities/hephaestus/isPresent.tsx'; import AvailableLanguages from '@deities/i18n/AvailableLanguages.tsx'; import Storage from '@deities/ui/Storage.tsx'; -import { TranslationDict } from 'fbt'; +import type { TranslationDict } from 'fbt'; type LocaleLoaderFn = ( locale: string, diff --git a/hera/i18n/injectTranslation.tsx b/hera/i18n/injectTranslation.tsx index 2d2a7620..2b231a2e 100644 --- a/hera/i18n/injectTranslation.tsx +++ b/hera/i18n/injectTranslation.tsx @@ -1,4 +1,4 @@ -import { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; type FieldMap = Readonly<{ characterDescription: string; diff --git a/hera/i18n/intlList.tsx b/hera/i18n/intlList.tsx index 87b262ea..489ca0d2 100644 --- a/hera/i18n/intlList.tsx +++ b/hera/i18n/intlList.tsx @@ -1,5 +1,6 @@ /* eslint-disable @deities/require-fbt-description */ -import { isValidElement, ReactElement, ReactNode } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import { isValidElement } from 'react'; export const Conjunctions = { AND: 'AND', diff --git a/hera/lib/addEndTurnAnimations.tsx b/hera/lib/addEndTurnAnimations.tsx index cde4b6f2..417d4fde 100644 --- a/hera/lib/addEndTurnAnimations.tsx +++ b/hera/lib/addEndTurnAnimations.tsx @@ -1,18 +1,16 @@ -import { EndTurnActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { EndTurnActionResponse } from '@deities/apollo/ActionResponse.tsx'; import getAllUnitsToRefill from '@deities/athena/lib/getAllUnitsToRefill.tsx'; import getUnitsByPositions from '@deities/athena/lib/getUnitsByPositions.tsx'; import getUnitsToHealOnBuildings from '@deities/athena/lib/getUnitsToHealOnBuildings.tsx'; import shouldRemoveUnit from '@deities/athena/lib/shouldRemoveUnit.tsx'; import { MaxHealth } from '@deities/athena/map/Configuration.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector, { - sortByVectorKey, - sortVectors, -} from '@deities/athena/map/Vector.tsx'; -import ImmutableMap from '@nkzw/immutable-map'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import { sortByVectorKey, sortVectors } from '@deities/athena/map/Vector.tsx'; +import type ImmutableMap from '@nkzw/immutable-map'; import { fbt } from 'fbt'; import NullBehavior from '../behavior/NullBehavior.tsx'; -import { Actions, State, StateToStateLike } from '../Types.tsx'; +import type { Actions, State, StateToStateLike } from '../Types.tsx'; import animateHeal from './animateHeal.tsx'; import animateSupply from './animateSupply.tsx'; import AnimationKey from './AnimationKey.tsx'; diff --git a/hera/lib/addFlashAnimation.tsx b/hera/lib/addFlashAnimation.tsx index 0cd2351f..307db0d0 100644 --- a/hera/lib/addFlashAnimation.tsx +++ b/hera/lib/addFlashAnimation.tsx @@ -1,9 +1,9 @@ -import { SoundName } from '@deities/athena/info/Music.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type { SoundName } from '@deities/athena/info/Music.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import type { ReactNode } from 'react'; -import { Animations } from '../MapAnimations.tsx'; -import { StateToStateLike } from '../Types.tsx'; -import { FlyoutColor } from '../ui/Flyout.tsx'; +import type { Animations } from '../MapAnimations.tsx'; +import type { StateToStateLike } from '../Types.tsx'; +import type { FlyoutColor } from '../ui/Flyout.tsx'; import AnimationKey from './AnimationKey.tsx'; export default function addFlashAnimation( diff --git a/hera/lib/addMoveAnimation.tsx b/hera/lib/addMoveAnimation.tsx index 76d36bc8..2b9a0e93 100644 --- a/hera/lib/addMoveAnimation.tsx +++ b/hera/lib/addMoveAnimation.tsx @@ -1,5 +1,5 @@ -import Vector from '@deities/athena/map/Vector.tsx'; -import { Animations, MoveAnimation } from '../MapAnimations.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { Animations, MoveAnimation } from '../MapAnimations.tsx'; export default function addMoveAnimation( animations: Animations, diff --git a/hera/lib/addPlayerLoseAnimation.tsx b/hera/lib/addPlayerLoseAnimation.tsx index f6066124..95e94c99 100644 --- a/hera/lib/addPlayerLoseAnimation.tsx +++ b/hera/lib/addPlayerLoseAnimation.tsx @@ -1,9 +1,9 @@ -import { CaptureGameOverActionResponse } from '@deities/apollo/GameOver.tsx'; -import Player from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type { CaptureGameOverActionResponse } from '@deities/apollo/GameOver.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import { sortVectors } from '@deities/athena/map/Vector.tsx'; import NullBehavior from '../behavior/NullBehavior.tsx'; -import { Actions, State, StateToStateLike } from '../Types.tsx'; +import type { Actions, State, StateToStateLike } from '../Types.tsx'; import AnimationKey from './AnimationKey.tsx'; import explodeUnits from './explodeUnits.tsx'; import getPlayerDefeatedMessage from './getPlayerDefeatedMessage.tsx'; diff --git a/hera/lib/animateHeal.tsx b/hera/lib/animateHeal.tsx index 1e8580ae..a3ef703c 100644 --- a/hera/lib/animateHeal.tsx +++ b/hera/lib/animateHeal.tsx @@ -1,9 +1,9 @@ import { HealAmount, MaxHealth } from '@deities/athena/map/Configuration.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { resetBehavior } from '../behavior/Behavior.tsx'; -import { State, StateLike, StateToStateLike } from '../Types.tsx'; +import type { State, StateLike, StateToStateLike } from '../Types.tsx'; import AnimationKey from './AnimationKey.tsx'; import getUnitDirection from './getUnitDirection.tsx'; diff --git a/hera/lib/animateSupply.tsx b/hera/lib/animateSupply.tsx index 68795161..fc0897ac 100644 --- a/hera/lib/animateSupply.tsx +++ b/hera/lib/animateSupply.tsx @@ -1,10 +1,10 @@ -import { UnitsWithPosition } from '@deities/athena/lib/getUnitsByPositions.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type { UnitsWithPosition } from '@deities/athena/lib/getUnitsByPositions.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { fbt } from 'fbt'; import { resetBehavior } from '../behavior/Behavior.tsx'; import NullBehavior from '../behavior/NullBehavior.tsx'; -import { State, StateLike, StateToStateLike } from '../Types.tsx'; +import type { State, StateLike, StateToStateLike } from '../Types.tsx'; import addFlashAnimation from './addFlashAnimation.tsx'; import AnimationKey from './AnimationKey.tsx'; diff --git a/hera/lib/attackSpriteHasVariants.tsx b/hera/lib/attackSpriteHasVariants.tsx index aad8ae85..fd5c8594 100644 --- a/hera/lib/attackSpriteHasVariants.tsx +++ b/hera/lib/attackSpriteHasVariants.tsx @@ -1,5 +1,5 @@ -import { AttackSprite } from '@deities/athena/info/AttackSprite.tsx'; -import { AttackSpriteWithVariants } from '@deities/athena/info/Unit.tsx'; +import type { AttackSprite } from '@deities/athena/info/AttackSprite.tsx'; +import type { AttackSpriteWithVariants } from '@deities/athena/info/Unit.tsx'; export default function attackSpriteHasVariants( sprite: AttackSprite | AttackSpriteWithVariants, diff --git a/hera/lib/botToUser.tsx b/hera/lib/botToUser.tsx index cd7c4e4e..c2ae0971 100644 --- a/hera/lib/botToUser.tsx +++ b/hera/lib/botToUser.tsx @@ -1,11 +1,11 @@ +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; import { getAllUnits, getUnitInfo, Pioneer, - UnitInfo, } from '@deities/athena/info/Unit.tsx'; -import { Bot } from '@deities/athena/map/Player.tsx'; -import { UserLike } from '../hooks/useUserMap.tsx'; +import type { Bot } from '@deities/athena/map/Player.tsx'; +import type { UserLike } from '../hooks/useUserMap.tsx'; const getUnit = (name: string): UnitInfo => getUnitInfo( diff --git a/hera/lib/explodeUnits.tsx b/hera/lib/explodeUnits.tsx index 85718391..0f8c4f78 100644 --- a/hera/lib/explodeUnits.tsx +++ b/hera/lib/explodeUnits.tsx @@ -1,6 +1,6 @@ -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import addExplosionAnimation from '../animations/addExplosionAnimation.tsx'; -import { Actions, State, StateLike, StateToStateLike } from '../Types.tsx'; +import type { Actions, State, StateLike, StateToStateLike } from '../Types.tsx'; import AnimationKey from './AnimationKey.tsx'; export default function explodeUnits( diff --git a/hera/lib/getAnyBuildingTileField.tsx b/hera/lib/getAnyBuildingTileField.tsx index 023abea6..89d5805c 100644 --- a/hera/lib/getAnyBuildingTileField.tsx +++ b/hera/lib/getAnyBuildingTileField.tsx @@ -1,5 +1,6 @@ -import { BuildingInfo } from '@deities/athena/info/Building.tsx'; -import { Plain, TileField, TileInfo } from '@deities/athena/info/Tile.tsx'; +import type { BuildingInfo } from '@deities/athena/info/Building.tsx'; +import type { TileField, TileInfo } from '@deities/athena/info/Tile.tsx'; +import { Plain } from '@deities/athena/info/Tile.tsx'; export default function getAnyBuildingTileField( building: BuildingInfo, diff --git a/hera/lib/getAnyUnitTile.tsx b/hera/lib/getAnyUnitTile.tsx index 55e154fe..6e5e1be4 100644 --- a/hera/lib/getAnyUnitTile.tsx +++ b/hera/lib/getAnyUnitTile.tsx @@ -1,6 +1,6 @@ import { MovementTypes } from '@deities/athena/info/MovementType.tsx'; import { findTile, Sea } from '@deities/athena/info/Tile.tsx'; -import { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; export default function getAnyUnitTile(info: UnitInfo) { if ( diff --git a/hera/lib/getBuildingSpritePosition.tsx b/hera/lib/getBuildingSpritePosition.tsx index ec7cff3a..243ee3f6 100644 --- a/hera/lib/getBuildingSpritePosition.tsx +++ b/hera/lib/getBuildingSpritePosition.tsx @@ -1,6 +1,7 @@ -import { Barracks, BuildingInfo } from '@deities/athena/info/Building.tsx'; +import type { BuildingInfo } from '@deities/athena/info/Building.tsx'; +import { Barracks } from '@deities/athena/info/Building.tsx'; import { Biome } from '@deities/athena/map/Biome.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; const hqOffset = 9; diff --git a/hera/lib/getFlashDelay.tsx b/hera/lib/getFlashDelay.tsx index 6b281154..2d0a63cf 100644 --- a/hera/lib/getFlashDelay.tsx +++ b/hera/lib/getFlashDelay.tsx @@ -1,5 +1,5 @@ -import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import { Animation } from '../MapAnimations.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import type { Animation } from '../MapAnimations.tsx'; export default function getFlashDelay( animation: Animation | undefined, diff --git a/hera/lib/getPlayerDefeatedMessage.tsx b/hera/lib/getPlayerDefeatedMessage.tsx index df8f62c1..68183ab5 100644 --- a/hera/lib/getPlayerDefeatedMessage.tsx +++ b/hera/lib/getPlayerDefeatedMessage.tsx @@ -1,6 +1,6 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import { fbt } from 'fbt'; -import { FactionNames } from '../Types.tsx'; +import type { FactionNames } from '../Types.tsx'; import getTranslatedFactionName from './getTranslatedFactionName.tsx'; export default function getPlayerDefeatedMessage( diff --git a/hera/lib/getSkillConfigForDisplay.tsx b/hera/lib/getSkillConfigForDisplay.tsx index 0b45824e..efa1178d 100644 --- a/hera/lib/getSkillConfigForDisplay.tsx +++ b/hera/lib/getSkillConfigForDisplay.tsx @@ -1,11 +1,11 @@ import { Skill } from '@deities/athena/info/Skill.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; -import { BaseColor } from '@deities/ui/getColor.tsx'; -import { SVGIcon } from '@deities/ui/Icon.tsx'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; +import type { SVGIcon } from '@deities/ui/Icon.tsx'; import Crosshair from '@deities/ui/icons/Crosshair.tsx'; import Heart from '@deities/ui/icons/Heart.tsx'; import Paw from '@deities/ui/icons/Paw.tsx'; -import { SkillIconBorderStyle } from '@deities/ui/icons/SkillBorder.tsx'; +import type { SkillIconBorderStyle } from '@deities/ui/icons/SkillBorder.tsx'; import Skull from '@deities/ui/icons/Skull.tsx'; import Track from '@deities/ui/icons/Track.tsx'; import Tree from '@deities/ui/icons/Tree.tsx'; diff --git a/hera/lib/getTranslatedColorName.tsx b/hera/lib/getTranslatedColorName.tsx index 493783da..4d7a6c82 100644 --- a/hera/lib/getTranslatedColorName.tsx +++ b/hera/lib/getTranslatedColorName.tsx @@ -1,4 +1,4 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import { playerToColor } from '@deities/ui/getColor.tsx'; import { fbt } from 'fbt'; diff --git a/hera/lib/getTranslatedEntityName.tsx b/hera/lib/getTranslatedEntityName.tsx index a7e0eb40..893bac27 100644 --- a/hera/lib/getTranslatedEntityName.tsx +++ b/hera/lib/getTranslatedEntityName.tsx @@ -1,4 +1,5 @@ -import { EntityGroup, EntityType } from '@deities/athena/map/Entity.tsx'; +import type { EntityGroup } from '@deities/athena/map/Entity.tsx'; +import { EntityType } from '@deities/athena/map/Entity.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import { fbt } from 'fbt'; diff --git a/hera/lib/getTranslatedFactionName.tsx b/hera/lib/getTranslatedFactionName.tsx index a9937fe7..16020d6d 100644 --- a/hera/lib/getTranslatedFactionName.tsx +++ b/hera/lib/getTranslatedFactionName.tsx @@ -1,6 +1,6 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import { fbt } from 'fbt'; -import { FactionNames } from '../Types.tsx'; +import type { FactionNames } from '../Types.tsx'; import getTranslatedColorName from './getTranslatedColorName.tsx'; const toFactionName = (player: PlayerID) => { diff --git a/hera/lib/getTranslatedTileTypeName.tsx b/hera/lib/getTranslatedTileTypeName.tsx index a5b7b0e4..4ff65ca3 100644 --- a/hera/lib/getTranslatedTileTypeName.tsx +++ b/hera/lib/getTranslatedTileTypeName.tsx @@ -1,4 +1,5 @@ -import { TileType, TileTypes } from '@deities/athena/info/Tile.tsx'; +import type { TileType } from '@deities/athena/info/Tile.tsx'; +import { TileTypes } from '@deities/athena/info/Tile.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import { fbt } from 'fbt'; diff --git a/hera/lib/getTranslatedTimerName.tsx b/hera/lib/getTranslatedTimerName.tsx index 887a302b..fade0db3 100644 --- a/hera/lib/getTranslatedTimerName.tsx +++ b/hera/lib/getTranslatedTimerName.tsx @@ -1,4 +1,4 @@ -import { GameTimerValue } from '@deities/apollo/lib/GameTimerValue.tsx'; +import type { GameTimerValue } from '@deities/apollo/lib/GameTimerValue.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; export default function getTranslatedTimerName(timer: GameTimerValue) { diff --git a/hera/lib/getUnitDirection.tsx b/hera/lib/getUnitDirection.tsx index c4bfa8bd..4bca6947 100644 --- a/hera/lib/getUnitDirection.tsx +++ b/hera/lib/getUnitDirection.tsx @@ -1,5 +1,5 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; export default function getUnitDirection(firstPlayer: PlayerID, unit: Unit) { return (unit.player === 0 || (firstPlayer + unit.player - 1) % 2 ? -1 : 1) * diff --git a/hera/lib/isFakeEndTurn.tsx b/hera/lib/isFakeEndTurn.tsx index 6810cb63..66b74452 100644 --- a/hera/lib/isFakeEndTurn.tsx +++ b/hera/lib/isFakeEndTurn.tsx @@ -1,4 +1,4 @@ -import { EndTurnActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { EndTurnActionResponse } from '@deities/apollo/ActionResponse.tsx'; export default function isFakeEndTurn({ current, diff --git a/hera/lib/maskClassName.tsx b/hera/lib/maskClassName.tsx index c51ed8bb..f067deb5 100644 --- a/hera/lib/maskClassName.tsx +++ b/hera/lib/maskClassName.tsx @@ -1,4 +1,4 @@ -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; export default function maskClassName(vector: Vector) { return `mask-${vector.x}-${vector.y}`; diff --git a/hera/lib/sleep.tsx b/hera/lib/sleep.tsx index 0b0f6d0e..222da2e6 100644 --- a/hera/lib/sleep.tsx +++ b/hera/lib/sleep.tsx @@ -1,5 +1,5 @@ -import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import { TimerFunction } from '../Types.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import type { TimerFunction } from '../Types.tsx'; export default async function sleep( scheduleTimer: TimerFunction, diff --git a/hera/lib/spawn.tsx b/hera/lib/spawn.tsx index 997e6827..4bcd5797 100644 --- a/hera/lib/spawn.tsx +++ b/hera/lib/spawn.tsx @@ -1,10 +1,10 @@ import mergeTeams from '@deities/athena/lib/mergeTeams.tsx'; -import { Teams } from '@deities/athena/map/Team.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type { Teams } from '@deities/athena/map/Team.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import ImmutableMap from '@nkzw/immutable-map'; import { fbt } from 'fbt'; -import { Actions, State, StateLike, StateToStateLike } from '../Types.tsx'; +import type { Actions, State, StateLike, StateToStateLike } from '../Types.tsx'; import AnimationKey from './AnimationKey.tsx'; import getUnitDirection from './getUnitDirection.tsx'; diff --git a/hera/lib/sprite.tsx b/hera/lib/sprite.tsx index b268b7ed..d3aa2f67 100644 --- a/hera/lib/sprite.tsx +++ b/hera/lib/sprite.tsx @@ -1,7 +1,7 @@ import { hasSpriteURL } from '@deities/art/Sprites.tsx'; -import { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; +import type { SpriteVariant } from '@deities/athena/info/SpriteVariants.tsx'; import getBiomeStyle from '@deities/athena/lib/getBiomeStyle.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; export default function sprite( sprite: SpriteVariant, diff --git a/hera/lib/startGameAnimation.tsx b/hera/lib/startGameAnimation.tsx index 64851818..5122c9f6 100644 --- a/hera/lib/startGameAnimation.tsx +++ b/hera/lib/startGameAnimation.tsx @@ -1,6 +1,6 @@ import getMapName from '../i18n/getMapName.tsx'; -import { Animations } from '../MapAnimations.tsx'; -import { Actions, State } from '../Types.tsx'; +import type { Animations } from '../MapAnimations.tsx'; +import type { Actions, State } from '../Types.tsx'; import AnimationKey from './AnimationKey.tsx'; export default function startGameAnimation( diff --git a/hera/lib/throwActionError.tsx b/hera/lib/throwActionError.tsx index 5765611e..3335f3ee 100644 --- a/hera/lib/throwActionError.tsx +++ b/hera/lib/throwActionError.tsx @@ -1,4 +1,4 @@ -import { Action } from '@deities/apollo/Action.tsx'; +import type { Action } from '@deities/apollo/Action.tsx'; export default function throwActionError(action: Action): never { throw new Error( diff --git a/hera/lib/tick.tsx b/hera/lib/tick.tsx index aeb64e12..19571f1a 100644 --- a/hera/lib/tick.tsx +++ b/hera/lib/tick.tsx @@ -1,5 +1,5 @@ +import type { TileAnimation } from '@deities/athena/info/Tile.tsx'; import { - TileAnimation, WaterfallAnimation, WaterfallModifiers, } from '@deities/athena/info/Tile.tsx'; diff --git a/hera/lib/toTransformOrigin.tsx b/hera/lib/toTransformOrigin.tsx index 80470f56..641eecb6 100644 --- a/hera/lib/toTransformOrigin.tsx +++ b/hera/lib/toTransformOrigin.tsx @@ -1,5 +1,5 @@ -import { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; -import { SyntheticEvent, TouchEvent } from 'react'; +import type { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; +import type { SyntheticEvent, TouchEvent } from 'react'; export type ClientCoordinates = { clientX: number | string; diff --git a/hera/lib/upgradeUnits.tsx b/hera/lib/upgradeUnits.tsx index 99c0754a..b6f1d106 100644 --- a/hera/lib/upgradeUnits.tsx +++ b/hera/lib/upgradeUnits.tsx @@ -1,5 +1,5 @@ -import Vector from '@deities/athena/map/Vector.tsx'; -import { Actions, State, StateLike, StateToStateLike } from '../Types.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { Actions, State, StateLike, StateToStateLike } from '../Types.tsx'; import AnimationKey from './AnimationKey.tsx'; export default function upgradeUnits( diff --git a/hera/render/Images.tsx b/hera/render/Images.tsx index 0d424fbd..82772462 100644 --- a/hera/render/Images.tsx +++ b/hera/render/Images.tsx @@ -1,4 +1,4 @@ -import { AttackSprite } from '@deities/athena/info/AttackSprite.tsx'; +import type { AttackSprite } from '@deities/athena/info/AttackSprite.tsx'; const AttackAmphibiousSprite = 'https://art.athenacrisis.com/v10/assets/AttackAmphibious.png'; diff --git a/hera/render/renderFloatingTile.tsx b/hera/render/renderFloatingTile.tsx index 4d0caaaf..c1680501 100644 --- a/hera/render/renderFloatingTile.tsx +++ b/hera/render/renderFloatingTile.tsx @@ -4,11 +4,13 @@ import { getFloatingEdgeAnimation, } from '@deities/athena/info/Tile.tsx'; import { Biome } from '@deities/athena/map/Biome.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData, { ModifierField } from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { ModifierField } from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import { getFrame } from '../lib/tick.tsx'; -import renderTile, { TileSet } from './renderTile.tsx'; +import type { TileSet } from './renderTile.tsx'; +import renderTile from './renderTile.tsx'; export default function renderFloatingTile( context: CanvasRenderingContext2D, diff --git a/hera/render/renderTile.tsx b/hera/render/renderTile.tsx index 80c4602b..3dbd5259 100644 --- a/hera/render/renderTile.tsx +++ b/hera/render/renderTile.tsx @@ -1,4 +1,5 @@ import { Airbase, Shelter } from '@deities/athena/info/Building.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; import { Airfield, Campsite, @@ -7,15 +8,14 @@ import { RenderType, StormCloud, StormCloudLightningConnectors, - TileInfo, TileTypes, } from '@deities/athena/info/Tile.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import getBuildingSpritePosition from '../lib/getBuildingSpritePosition.tsx'; export type TileSet = { diff --git a/hera/ui/AISelector.tsx b/hera/ui/AISelector.tsx index d8f6d8ce..8e249232 100644 --- a/hera/ui/AISelector.tsx +++ b/hera/ui/AISelector.tsx @@ -1,4 +1,4 @@ -import { AIRegistryT } from '@deities/apollo/actions/executeGameAction.tsx'; +import type { AIRegistryT } from '@deities/apollo/actions/executeGameAction.tsx'; import InlineLink from '@deities/ui/InlineLink.tsx'; import Select from '@deities/ui/Select.tsx'; import Stack from '@deities/ui/Stack.tsx'; diff --git a/hera/ui/ActionBar.tsx b/hera/ui/ActionBar.tsx index f6ec004a..252c95d6 100644 --- a/hera/ui/ActionBar.tsx +++ b/hera/ui/ActionBar.tsx @@ -2,7 +2,7 @@ import { DoubleSize } from '@deities/athena/map/Configuration.tsx'; import Box from '@deities/ui/Box.tsx'; import { CSSVariables } from '@deities/ui/cssVar.tsx'; import { css, cx } from '@emotion/css'; -import { ComponentProps } from 'react'; +import type { ComponentProps } from 'react'; export default function ActionBar({ visible = true, diff --git a/hera/ui/ActionWheel.tsx b/hera/ui/ActionWheel.tsx index b4299cb8..5e9a9886 100644 --- a/hera/ui/ActionWheel.tsx +++ b/hera/ui/ActionWheel.tsx @@ -1,19 +1,18 @@ -import { - AnimationConfig, - Charge, - TileSize, -} from '@deities/athena/map/Configuration.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import { Charge, TileSize } from '@deities/athena/map/Configuration.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import { BoxStyle } from '@deities/ui/Box.tsx'; import { isIPhone } from '@deities/ui/Browser.tsx'; -import { NavigationDirection } from '@deities/ui/controls/Input.tsx'; +import type { NavigationDirection } from '@deities/ui/controls/Input.tsx'; import useInput from '@deities/ui/controls/useInput.tsx'; import cssVar, { applyVar, CSSVariables } from '@deities/ui/cssVar.tsx'; import ellipsis from '@deities/ui/ellipsis.tsx'; -import getColor, { BaseColor } from '@deities/ui/getColor.tsx'; -import usePress, { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; +import getColor from '@deities/ui/getColor.tsx'; +import type { LongPressReactEvents } from '@deities/ui/hooks/usePress.tsx'; +import usePress from '@deities/ui/hooks/usePress.tsx'; import Icon from '@deities/ui/Icon.tsx'; import Crosshair from '@deities/ui/icons/Crosshair.tsx'; import DropUnit from '@deities/ui/icons/DropUnit.tsx'; @@ -36,11 +35,12 @@ import Flag from '@iconify-icons/pixelarticons/flag.js'; import Unfold from '@iconify-icons/pixelarticons/flatten.js'; import Load from '@iconify-icons/pixelarticons/login.js'; import { motion } from 'framer-motion'; -import { ReactNode, useCallback, useEffect, useRef, useState } from 'react'; +import type { ReactNode } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; import { resetBehavior } from '../behavior/Behavior.tsx'; -import { ClientCoordinates } from '../lib/toTransformOrigin.tsx'; +import type { ClientCoordinates } from '../lib/toTransformOrigin.tsx'; import Tick from '../Tick.tsx'; -import { Actions } from '../Types.tsx'; +import type { Actions } from '../Types.tsx'; import getClientCoordinates from './lib/getClientCoordinates.tsx'; export default function ActionWheel({ diff --git a/hera/ui/AdminActions.tsx b/hera/ui/AdminActions.tsx index aa97239f..b63df98d 100644 --- a/hera/ui/AdminActions.tsx +++ b/hera/ui/AdminActions.tsx @@ -2,8 +2,9 @@ import Box from '@deities/ui/Box.tsx'; import InlineLink from '@deities/ui/InlineLink.tsx'; import Portal from '@deities/ui/Portal.tsx'; import { css, cx } from '@emotion/css'; -import React, { ReactNode, useEffect, useState } from 'react'; -import { StateWithActions } from '../Types.tsx'; +import type { ReactNode } from 'react'; +import React, { useEffect, useState } from 'react'; +import type { StateWithActions } from '../Types.tsx'; import maybeFade from './lib/maybeFade.tsx'; export default function AdminActions({ diff --git a/hera/ui/Banner.tsx b/hera/ui/Banner.tsx index a743cb20..cd03ae48 100644 --- a/hera/ui/Banner.tsx +++ b/hera/ui/Banner.tsx @@ -1,18 +1,19 @@ -import { SoundName } from '@deities/athena/info/Music.tsx'; -import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { SoundName } from '@deities/athena/info/Music.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import Breakpoints from '@deities/ui/Breakpoints.tsx'; import { isSafari } from '@deities/ui/Browser.tsx'; import { CSSVariables } from '@deities/ui/cssVar.tsx'; -import { BaseColor } from '@deities/ui/getColor.tsx'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; import gradient from '@deities/ui/gradient.tsx'; import Portal from '@deities/ui/Portal.tsx'; import { css, cx, keyframes } from '@emotion/css'; import { Sprites } from 'athena-crisis:images'; -import { motion, Variants } from 'framer-motion'; +import type { Variants } from 'framer-motion'; +import { motion } from 'framer-motion'; import { useEffect } from 'react'; -import { ClearTimerFunction, TimerFunction } from '../Types.tsx'; +import type { ClearTimerFunction, TimerFunction } from '../Types.tsx'; import useSkipAnimation from './lib/useSkipAnimation.tsx'; const multiplier = process.env.NODE_ENV === 'development' ? 3 : 1.5; diff --git a/hera/ui/CharacterMessage.tsx b/hera/ui/CharacterMessage.tsx index 6f0c35bb..9a00e8b4 100644 --- a/hera/ui/CharacterMessage.tsx +++ b/hera/ui/CharacterMessage.tsx @@ -3,8 +3,8 @@ import { AnimationConfig, DoubleSize, } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import Breakpoints, { lg, sm } from '@deities/ui/Breakpoints.tsx'; import throttle from '@deities/ui/controls/throttle.tsx'; @@ -20,7 +20,11 @@ import { Sprites } from 'athena-crisis:images'; import { motion } from 'framer-motion'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import Portrait, { PortraitWidth } from '../character/Portrait.tsx'; -import { ClearTimerFunction, FactionNames, TimerFunction } from '../Types.tsx'; +import type { + ClearTimerFunction, + FactionNames, + TimerFunction, +} from '../Types.tsx'; import formatCharacterText from './lib/formatCharacterText.tsx'; import measureText from './lib/measureText.tsx'; import useSkipAnimation from './lib/useSkipAnimation.tsx'; diff --git a/hera/ui/CurrentGameCard.tsx b/hera/ui/CurrentGameCard.tsx index e0032131..a7ff1eac 100644 --- a/hera/ui/CurrentGameCard.tsx +++ b/hera/ui/CurrentGameCard.tsx @@ -1,17 +1,17 @@ import type Player from '@deities/athena/map/Player.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import type Team from '@deities/athena/map/Team.tsx'; import type MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; import Portal from '@deities/ui/Portal.tsx'; import PrimaryExpandableMenuButton from '@deities/ui/PrimaryExpandableMenuButton.tsx'; import { css } from '@emotion/css'; -import ImmutableMap from '@nkzw/immutable-map'; +import type ImmutableMap from '@nkzw/immutable-map'; import React, { memo, useCallback, useState } from 'react'; -import { UserLike } from '../hooks/useUserMap.tsx'; -import { Actions } from '../Types.tsx'; +import type { UserLike } from '../hooks/useUserMap.tsx'; +import type { Actions } from '../Types.tsx'; import maybeFade from './lib/maybeFade.tsx'; import PlayerCard from './PlayerCard.tsx'; import Vs from './Vs.tsx'; diff --git a/hera/ui/EntityPickerFlyout.tsx b/hera/ui/EntityPickerFlyout.tsx index 9a76d7b8..994934cb 100644 --- a/hera/ui/EntityPickerFlyout.tsx +++ b/hera/ui/EntityPickerFlyout.tsx @@ -1,16 +1,17 @@ import { Plain } from '@deities/athena/info/Tile.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector, { VectorLike } from '@deities/athena/map/Vector.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type { VectorLike } from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import useInput from '@deities/ui/controls/useInput.tsx'; import { useCallback, useState } from 'react'; import BuildingTile from '../Building.tsx'; import Tick from '../Tick.tsx'; -import { Actions } from '../Types.tsx'; +import type { Actions } from '../Types.tsx'; import UnitTile from '../Unit.tsx'; import Flyout, { FlyoutItemWithHighlight, diff --git a/hera/ui/ErrorOverlay.tsx b/hera/ui/ErrorOverlay.tsx index e8e45e71..b3542fd1 100644 --- a/hera/ui/ErrorOverlay.tsx +++ b/hera/ui/ErrorOverlay.tsx @@ -1,4 +1,4 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import useAlert from '@deities/ui/hooks/useAlert.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { css } from '@emotion/css'; diff --git a/hera/ui/FlashFlyout.tsx b/hera/ui/FlashFlyout.tsx index ae4876de..c3117b4f 100644 --- a/hera/ui/FlashFlyout.tsx +++ b/hera/ui/FlashFlyout.tsx @@ -1,11 +1,12 @@ -import { SoundName } from '@deities/athena/info/Music.tsx'; -import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type { SoundName } from '@deities/athena/info/Music.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import { css } from '@emotion/css'; import { motion } from 'framer-motion'; -import React, { ReactNode, useEffect } from 'react'; -import { ClearTimerFunction, TimerFunction } from '../Types.tsx'; +import type { ReactNode } from 'react'; +import React, { useEffect } from 'react'; +import type { ClearTimerFunction, TimerFunction } from '../Types.tsx'; import Flyout from './Flyout.tsx'; export default function FlashFlyout({ diff --git a/hera/ui/Flyout.tsx b/hera/ui/Flyout.tsx index ec0a8188..af4781d1 100644 --- a/hera/ui/Flyout.tsx +++ b/hera/ui/Flyout.tsx @@ -1,13 +1,15 @@ import { TileSize } from '@deities/athena/map/Configuration.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import { isIPhone } from '@deities/ui/Browser.tsx'; import { applyVar, CSSVariables } from '@deities/ui/cssVar.tsx'; -import getColor, { BaseColor } from '@deities/ui/getColor.tsx'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; +import getColor from '@deities/ui/getColor.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; import { css, cx } from '@emotion/css'; -import React, { Fragment, ReactNode, useState } from 'react'; -import { Actions } from '../Types.tsx'; +import type { ReactNode } from 'react'; +import React, { Fragment, useState } from 'react'; +import type { Actions } from '../Types.tsx'; export type FlyoutColor = BaseColor | null | 'error'; diff --git a/hera/ui/GameActions.tsx b/hera/ui/GameActions.tsx index 1eb2646d..5cd9c10c 100644 --- a/hera/ui/GameActions.tsx +++ b/hera/ui/GameActions.tsx @@ -1,11 +1,13 @@ import { Ability } from '@deities/athena/info/Unit.tsx'; import getAvailableUnitActions from '@deities/athena/lib/getAvailableUnitActions.tsx'; import { DoubleSize } from '@deities/athena/map/Configuration.tsx'; -import Player, { PlayerID } from '@deities/athena/map/Player.tsx'; -import Vector, { sortVectors } from '@deities/athena/map/Vector.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import { sortVectors } from '@deities/athena/map/Vector.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import { attackable, RadiusItem } from '@deities/athena/Radius.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import Breakpoints from '@deities/ui/Breakpoints.tsx'; import useInput from '@deities/ui/controls/useInput.tsx'; @@ -22,9 +24,8 @@ import Close from '@iconify-icons/pixelarticons/close.js'; import Forward from '@iconify-icons/pixelarticons/forward.js'; import EndTurn from '@iconify-icons/pixelarticons/reply-all.js'; import Next from '@iconify-icons/pixelarticons/reply.js'; +import type { MouseEvent, ReactNode } from 'react'; import React, { - MouseEvent, - ReactNode, useCallback, useEffect, useMemo, @@ -36,11 +37,11 @@ import Base from '../behavior/Base.tsx'; import { resetBehavior } from '../behavior/Behavior.tsx'; import canEndTurn from '../behavior/endTurn/canEndTurn.tsx'; import endTurnAction from '../behavior/endTurn/endTurnAction.tsx'; -import { SetZoomFn } from '../editor/hooks/useZoom.tsx'; +import type { SetZoomFn } from '../editor/hooks/useZoom.tsx'; import ZoomButton from '../editor/lib/ZoomButton.tsx'; import toTransformOrigin from '../lib/toTransformOrigin.tsx'; import { RadiusType } from '../Radius.tsx'; -import { StateWithActions } from '../Types.tsx'; +import type { StateWithActions } from '../Types.tsx'; import maybeFade from './lib/maybeFade.tsx'; import ReplayBar from './ReplayBar.tsx'; diff --git a/hera/ui/GameDialog.tsx b/hera/ui/GameDialog.tsx index e483c102..925916fa 100644 --- a/hera/ui/GameDialog.tsx +++ b/hera/ui/GameDialog.tsx @@ -1,9 +1,9 @@ -import { Skill } from '@deities/athena/info/Skill.tsx'; -import { TileInfo } from '@deities/athena/info/Tile.tsx'; -import Building from '@deities/athena/map/Building.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import type { TileInfo } from '@deities/athena/info/Tile.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import useBlockInput from '@deities/ui/controls/useBlockInput.tsx'; @@ -18,13 +18,14 @@ import useAlert from '@deities/ui/hooks/useAlert.tsx'; import Portal from '@deities/ui/Portal.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { fbt } from 'fbt'; -import { memo, ReactNode, useCallback, useMemo, useState } from 'react'; +import type { ReactNode } from 'react'; +import { memo, useCallback, useMemo, useState } from 'react'; import BuildingCard from '../card/BuildingCard.tsx'; import LeaderCard from '../card/LeaderCard.tsx'; import LeaderTitle from '../card/LeaderTitle.tsx'; import TileCard from '../card/TileCard.tsx'; import UnitCard from '../card/UnitCard.tsx'; -import { +import type { CurrentGameInfoState, FactionNames, MapInfoState, diff --git a/hera/ui/MapDetails.tsx b/hera/ui/MapDetails.tsx index 89519af7..95cd2538 100644 --- a/hera/ui/MapDetails.tsx +++ b/hera/ui/MapDetails.tsx @@ -1,7 +1,7 @@ import { isValidTimer } from '@deities/apollo/lib/GameTimerValue.tsx'; import getUserRoute from '@deities/apollo/routes/getUserRoute.tsx'; import getMapSize from '@deities/athena/lib/getMapSize.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import clipBorder from '@deities/ui/clipBorder.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import Icon from '@deities/ui/Icon.tsx'; @@ -20,7 +20,7 @@ import Timeline from '@iconify-icons/pixelarticons/timeline.js'; import Tournament from '@iconify-icons/pixelarticons/tournament.js'; import User from '@iconify-icons/pixelarticons/user.js'; import Users from '@iconify-icons/pixelarticons/users.js'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import getMapSizeName from '../lib/getMapSizeName.tsx'; import getTranslatedBiomeName from '../lib/getTranslatedBiomeName.tsx'; import getTranslatedTimerName from '../lib/getTranslatedTimerName.tsx'; diff --git a/hera/ui/MapInfo.tsx b/hera/ui/MapInfo.tsx index adc73b7c..fc6e30e1 100644 --- a/hera/ui/MapInfo.tsx +++ b/hera/ui/MapInfo.tsx @@ -1,26 +1,21 @@ -import { - getTileInfo, - TileField, - TileInfo, -} from '@deities/athena/info/Tile.tsx'; +import type { TileField, TileInfo } from '@deities/athena/info/Tile.tsx'; +import { getTileInfo } from '@deities/athena/info/Tile.tsx'; import { getLargeAttributeRangeValue } from '@deities/athena/lib/getAttributeRange.tsx'; -import { Biome } from '@deities/athena/map/Biome.tsx'; -import Building from '@deities/athena/map/Building.tsx'; +import type { Biome } from '@deities/athena/map/Biome.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; import { AnimationConfig, DoubleSize, MaxHealth, TileSize, } from '@deities/athena/map/Configuration.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; -import MapData, { - ModifierField, - SizeVector, -} from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import type { ModifierField } from '@deities/athena/MapData.tsx'; +import MapData, { SizeVector } from '@deities/athena/MapData.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import Box from '@deities/ui/Box.tsx'; import Breakpoints, { lg } from '@deities/ui/Breakpoints.tsx'; import cssVar, { @@ -41,7 +36,7 @@ import CoverRange from '../card/lib/CoverRange.tsx'; import { LargeRange } from '../card/Range.tsx'; import Map from '../Map.tsx'; import Tick from '../Tick.tsx'; -import { State } from '../Types.tsx'; +import type { State } from '../Types.tsx'; import UnitTile from '../Unit.tsx'; import maybeFade from './lib/maybeFade.tsx'; diff --git a/hera/ui/Message.tsx b/hera/ui/Message.tsx index 140aeffe..e7d7471d 100644 --- a/hera/ui/Message.tsx +++ b/hera/ui/Message.tsx @@ -3,7 +3,7 @@ import Breakpoints, { sm } from '@deities/ui/Breakpoints.tsx'; import throttle from '@deities/ui/controls/throttle.tsx'; import useInput from '@deities/ui/controls/useInput.tsx'; import { CSSVariables } from '@deities/ui/cssVar.tsx'; -import { BaseColor } from '@deities/ui/getColor.tsx'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; import gradient from '@deities/ui/gradient.tsx'; import Icon from '@deities/ui/Icon.tsx'; import Portal from '@deities/ui/Portal.tsx'; @@ -12,7 +12,7 @@ import Forward from '@iconify-icons/pixelarticons/reply.js'; import { Sprites } from 'athena-crisis:images'; import { motion } from 'framer-motion'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { ClearTimerFunction, TimerFunction } from '../Types.tsx'; +import type { ClearTimerFunction, TimerFunction } from '../Types.tsx'; import measureText from './lib/measureText.tsx'; import useSkipAnimation from './lib/useSkipAnimation.tsx'; diff --git a/hera/ui/MiniPlayerIcon.tsx b/hera/ui/MiniPlayerIcon.tsx index 47e05e7e..d4bb6413 100644 --- a/hera/ui/MiniPlayerIcon.tsx +++ b/hera/ui/MiniPlayerIcon.tsx @@ -1,4 +1,4 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import cssVar, { applyVar } from '@deities/ui/cssVar.tsx'; import getColor from '@deities/ui/getColor.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; diff --git a/hera/ui/ModeSelectButton.tsx b/hera/ui/ModeSelectButton.tsx index 7de84bf4..dfc66309 100644 --- a/hera/ui/ModeSelectButton.tsx +++ b/hera/ui/ModeSelectButton.tsx @@ -1,13 +1,15 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; import { BoxStyle } from '@deities/ui/Box.tsx'; import Breakpoints from '@deities/ui/Breakpoints.tsx'; import useActive from '@deities/ui/controls/useActive.tsx'; import cssVar, { applyVar } from '@deities/ui/cssVar.tsx'; -import getColor, { BaseColor } from '@deities/ui/getColor.tsx'; -import { UsePressProps } from '@deities/ui/hooks/usePress.tsx'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; +import getColor from '@deities/ui/getColor.tsx'; +import type { UsePressProps } from '@deities/ui/hooks/usePress.tsx'; import useScrollIntoView from '@deities/ui/hooks/useScrollIntoView.tsx'; -import Link, { LinkProps } from '@deities/ui/Link.tsx'; +import type { LinkProps } from '@deities/ui/Link.tsx'; +import Link from '@deities/ui/Link.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; import { css, cx } from '@emotion/css'; import { Sprites } from 'athena-crisis:images'; diff --git a/hera/ui/Notice.tsx b/hera/ui/Notice.tsx index 0f0d44a0..f2e67f0c 100644 --- a/hera/ui/Notice.tsx +++ b/hera/ui/Notice.tsx @@ -1,11 +1,12 @@ -import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; import cssVar, { applyVar } from '@deities/ui/cssVar.tsx'; -import getColor, { BaseColor } from '@deities/ui/getColor.tsx'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; +import getColor from '@deities/ui/getColor.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; import Portal from '@deities/ui/Portal.tsx'; import { css } from '@emotion/css'; import { motion } from 'framer-motion'; -import { TimerFunction } from '../Types.tsx'; +import type { TimerFunction } from '../Types.tsx'; import useSkipAnimation from './lib/useSkipAnimation.tsx'; export default function Notice(props: { diff --git a/hera/ui/Notification.tsx b/hera/ui/Notification.tsx index ac0e4bc3..78a1c882 100644 --- a/hera/ui/Notification.tsx +++ b/hera/ui/Notification.tsx @@ -4,7 +4,8 @@ import { applyVar, insetStyle } from '@deities/ui/cssVar.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { css, cx } from '@emotion/css'; import { motion } from 'framer-motion'; -import React, { ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import React from 'react'; export default function Notification({ center, diff --git a/hera/ui/PlayerCard.tsx b/hera/ui/PlayerCard.tsx index 51d60e63..392127c5 100644 --- a/hera/ui/PlayerCard.tsx +++ b/hera/ui/PlayerCard.tsx @@ -4,13 +4,15 @@ import { destroyedBuildingsByPlayer, escortedByPlayer, } from '@deities/apollo/lib/checkWinCondition.tsx'; -import { getSkillConfig, Skill } from '@deities/athena/info/Skill.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import { getSkillConfig } from '@deities/athena/info/Skill.tsx'; import matchesPlayerList from '@deities/athena/lib/matchesPlayerList.tsx'; import { Charge, TileSize } from '@deities/athena/map/Configuration.tsx'; import type Player from '@deities/athena/map/Player.tsx'; -import { isBot, PlayerID, PlayerIDs } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { isBot, PlayerIDs } from '@deities/athena/map/Player.tsx'; import type MapData from '@deities/athena/MapData.tsx'; -import { VisionT } from '@deities/athena/Vision.tsx'; +import type { VisionT } from '@deities/athena/Vision.tsx'; import { winConditionHasAmounts, WinCriteria, @@ -35,9 +37,9 @@ import activatePowerAction from '../behavior/activatePower/activatePowerAction.t import { resetBehavior } from '../behavior/Behavior.tsx'; import MiniPortrait from '../character/MiniPortrait.tsx'; import { PortraitWidth } from '../character/Portrait.tsx'; -import { UserLike } from '../hooks/useUserMap.tsx'; +import type { UserLike } from '../hooks/useUserMap.tsx'; import toTransformOrigin from '../lib/toTransformOrigin.tsx'; -import { Actions } from '../Types.tsx'; +import type { Actions } from '../Types.tsx'; import Funds from './Funds.tsx'; import { SkillIcon } from './SkillDialog.tsx'; diff --git a/hera/ui/PlayerIcon.tsx b/hera/ui/PlayerIcon.tsx index 4dfce05d..f0be0757 100644 --- a/hera/ui/PlayerIcon.tsx +++ b/hera/ui/PlayerIcon.tsx @@ -1,5 +1,5 @@ import { TileSize } from '@deities/athena/map/Configuration.tsx'; -import { DynamicPlayerID } from '@deities/athena/map/Player.tsx'; +import type { DynamicPlayerID } from '@deities/athena/map/Player.tsx'; import cssVar, { applyVar } from '@deities/ui/cssVar.tsx'; import getColor from '@deities/ui/getColor.tsx'; import pixelBorder from '@deities/ui/pixelBorder.tsx'; diff --git a/hera/ui/PlayerPosition.tsx b/hera/ui/PlayerPosition.tsx index 2fb2bd64..d098b2e9 100644 --- a/hera/ui/PlayerPosition.tsx +++ b/hera/ui/PlayerPosition.tsx @@ -1,4 +1,5 @@ -import getColor, { Color } from '@deities/ui/getColor.tsx'; +import type { Color } from '@deities/ui/getColor.tsx'; +import getColor from '@deities/ui/getColor.tsx'; import { InlineLinkColor } from '@deities/ui/InlineLink.tsx'; export default function PlayerPosition({ diff --git a/hera/ui/PlayerSelector.tsx b/hera/ui/PlayerSelector.tsx index a54b846d..d162f7ce 100644 --- a/hera/ui/PlayerSelector.tsx +++ b/hera/ui/PlayerSelector.tsx @@ -1,7 +1,9 @@ -import { AIRegistryT } from '@deities/apollo/actions/executeGameAction.tsx'; -import { Skill } from '@deities/athena/info/Skill.tsx'; -import Player, { isBot, PlayerID } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { AIRegistryT } from '@deities/apollo/actions/executeGameAction.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; +import { isBot } from '@deities/athena/map/Player.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import Box from '@deities/ui/Box.tsx'; import useHorizontalNavigation from '@deities/ui/controls/useHorizontalNavigation.tsx'; import useInput from '@deities/ui/controls/useInput.tsx'; @@ -12,9 +14,10 @@ import InlineLink, { InlineLinkColor } from '@deities/ui/InlineLink.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { css, cx } from '@emotion/css'; import Android from '@iconify-icons/pixelarticons/android.js'; -import { ReactNode, useCallback, useState } from 'react'; +import type { ReactNode } from 'react'; +import { useCallback, useState } from 'react'; import MiniPortrait from '../character/MiniPortrait.tsx'; -import { CharacterImage } from '../character/PortraitPicker.tsx'; +import type { CharacterImage } from '../character/PortraitPicker.tsx'; import AISelector from './AISelector.tsx'; import PlayerIcon from './PlayerIcon.tsx'; import PlayerPosition from './PlayerPosition.tsx'; diff --git a/hera/ui/ReplayBar.tsx b/hera/ui/ReplayBar.tsx index 6a7553b5..527cbfaa 100644 --- a/hera/ui/ReplayBar.tsx +++ b/hera/ui/ReplayBar.tsx @@ -1,4 +1,5 @@ -import Player, { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import type Player from '@deities/athena/map/Player.tsx'; import dateNow from '@deities/hephaestus/dateNow.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; import getColor from '@deities/ui/getColor.tsx'; @@ -12,7 +13,7 @@ import Pause from '@iconify-icons/pixelarticons/pause.js'; import Play from '@iconify-icons/pixelarticons/play.js'; import useRelativeTime from '@nkzw/use-relative-time'; import { getShortLocale } from '../i18n/getLocale.tsx'; -import { Actions, ReplayState } from '../Types.tsx'; +import type { Actions, ReplayState } from '../Types.tsx'; import ActionBar from './ActionBar.tsx'; const TurnTimer = ({ timeout }: { timeout: number }) => { diff --git a/hera/ui/SelectEntity.tsx b/hera/ui/SelectEntity.tsx index 22e1769e..b3bbec71 100644 --- a/hera/ui/SelectEntity.tsx +++ b/hera/ui/SelectEntity.tsx @@ -1,8 +1,8 @@ -import Building from '@deities/athena/map/Building.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Building from '@deities/athena/map/Building.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import { useCallback } from 'react'; -import { Actions, State } from '../Types.tsx'; +import type { Actions, State } from '../Types.tsx'; import EntityPickerFlyout from './EntityPickerFlyout.tsx'; export default function SelectEntity({ diff --git a/hera/ui/SkillDescription.tsx b/hera/ui/SkillDescription.tsx index 619cc700..fadc64f2 100644 --- a/hera/ui/SkillDescription.tsx +++ b/hera/ui/SkillDescription.tsx @@ -1,7 +1,8 @@ -import { Bar, BuildingInfo } from '@deities/athena/info/Building.tsx'; -import { MovementType } from '@deities/athena/info/MovementType.tsx'; +import type { BuildingInfo } from '@deities/athena/info/Building.tsx'; +import { Bar } from '@deities/athena/info/Building.tsx'; +import type { MovementType } from '@deities/athena/info/MovementType.tsx'; +import type { ActiveUnitTypes } from '@deities/athena/info/Skill.tsx'; import { - ActiveUnitTypes, getBlockedUnits, getHealUnitTypes, getSkillAttackMovementTypeStatusEffect, @@ -15,13 +16,14 @@ import { getUnitRangeForSkill, Skill, } from '@deities/athena/info/Skill.tsx'; -import { Plain, TileType, TileTypes } from '@deities/athena/info/Tile.tsx'; +import type { TileType } from '@deities/athena/info/Tile.tsx'; +import { Plain, TileTypes } from '@deities/athena/info/Tile.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; import { Battleship, getUnitInfoOrThrow, Sniper, SpecialUnits, - UnitInfo, } from '@deities/athena/info/Unit.tsx'; import { Biome } from '@deities/athena/map/Biome.tsx'; import { @@ -32,13 +34,15 @@ import { TileSize, } from '@deities/athena/map/Configuration.tsx'; import SpriteVector from '@deities/athena/map/SpriteVector.tsx'; -import Vector, { isVector } from '@deities/athena/map/Vector.tsx'; -import { ID } from '@deities/athena/MapData.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; +import { isVector } from '@deities/athena/map/Vector.tsx'; +import type { ID } from '@deities/athena/MapData.tsx'; import groupBy from '@deities/hephaestus/groupBy.tsx'; import isPresent from '@deities/hephaestus/isPresent.tsx'; import clipBorder from '@deities/ui/clipBorder.tsx'; import { applyVar } from '@deities/ui/cssVar.tsx'; -import getColor, { BaseColor } from '@deities/ui/getColor.tsx'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; +import getColor from '@deities/ui/getColor.tsx'; import Icon from '@deities/ui/Icon.tsx'; import { css, cx } from '@emotion/css'; import Coin from '@iconify-icons/pixelarticons/coin.js'; diff --git a/hera/ui/SkillDialog.tsx b/hera/ui/SkillDialog.tsx index fd31d7a4..6518e13b 100644 --- a/hera/ui/SkillDialog.tsx +++ b/hera/ui/SkillDialog.tsx @@ -1,4 +1,5 @@ -import { getSkillConfig, Skill } from '@deities/athena/info/Skill.tsx'; +import type { Skill } from '@deities/athena/info/Skill.tsx'; +import { getSkillConfig } from '@deities/athena/info/Skill.tsx'; import { TileSize } from '@deities/athena/map/Configuration.tsx'; import groupBy from '@deities/hephaestus/groupBy.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; @@ -15,13 +16,15 @@ import Dialog, { DialogTab, DialogTabBar, } from '@deities/ui/Dialog.tsx'; -import getColor, { BaseColor } from '@deities/ui/getColor.tsx'; +import type { BaseColor } from '@deities/ui/getColor.tsx'; +import getColor from '@deities/ui/getColor.tsx'; import gradient from '@deities/ui/gradient.tsx'; import useScrollIntoView from '@deities/ui/hooks/useScrollIntoView.tsx'; -import Icon, { SVGIcon } from '@deities/ui/Icon.tsx'; +import type { SVGIcon } from '@deities/ui/Icon.tsx'; +import Icon from '@deities/ui/Icon.tsx'; +import type { SkillIconBorderStyle } from '@deities/ui/icons/SkillBorder.tsx'; import SkillBorder, { SkillBorderIcons, - SkillIconBorderStyle, } from '@deities/ui/icons/SkillBorder.tsx'; import Skills from '@deities/ui/icons/Skills.tsx'; import InlineLink from '@deities/ui/InlineLink.tsx'; @@ -35,7 +38,8 @@ import { css, cx } from '@emotion/css'; import Charge from '@iconify-icons/pixelarticons/ac.js'; import Coin from '@iconify-icons/pixelarticons/coin.js'; import { Sprites } from 'athena-crisis:images'; -import { ReactElement, ReactNode, useCallback, useRef, useState } from 'react'; +import type { ReactElement, ReactNode } from 'react'; +import { useCallback, useRef, useState } from 'react'; import getSkillConfigForDisplay from '../lib/getSkillConfigForDisplay.tsx'; import SkillDescription from './SkillDescription.tsx'; diff --git a/hera/ui/TeamSelector.tsx b/hera/ui/TeamSelector.tsx index 22dad174..bbe0e558 100644 --- a/hera/ui/TeamSelector.tsx +++ b/hera/ui/TeamSelector.tsx @@ -1,7 +1,9 @@ import updatePlayer from '@deities/athena/lib/updatePlayer.tsx'; -import { PlayerID, toPlayerID } from '@deities/athena/map/Player.tsx'; -import Team, { Teams } from '@deities/athena/map/Team.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { toPlayerID } from '@deities/athena/map/Player.tsx'; +import type { Teams } from '@deities/athena/map/Team.tsx'; +import Team from '@deities/athena/map/Team.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import parseInteger from '@deities/hephaestus/parseInteger.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; import AudioPlayer from '@deities/ui/AudioPlayer.tsx'; @@ -19,14 +21,8 @@ import Stack from '@deities/ui/Stack.tsx'; import { css, cx } from '@emotion/css'; import ImmutableMap from '@nkzw/immutable-map'; import { motion } from 'framer-motion'; -import { - RefObject, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from 'react'; +import type { RefObject } from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import PlayerIcon from './PlayerIcon.tsx'; export default function TeamSelector({ diff --git a/hera/ui/UILabel.tsx b/hera/ui/UILabel.tsx index 13393988..ff028a9f 100644 --- a/hera/ui/UILabel.tsx +++ b/hera/ui/UILabel.tsx @@ -1,4 +1,4 @@ -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import { css, cx } from '@emotion/css'; import sprite from '../lib/sprite.tsx'; diff --git a/hera/ui/demo/UnitPreviews.tsx b/hera/ui/demo/UnitPreviews.tsx index 47c5aef2..c6c8fdfc 100644 --- a/hera/ui/demo/UnitPreviews.tsx +++ b/hera/ui/demo/UnitPreviews.tsx @@ -6,7 +6,7 @@ import { TileSize, } from '@deities/athena/map/Configuration.tsx'; import { PlayerIDs } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; import MapData from '@deities/athena/MapData.tsx'; import randomEntry from '@deities/hephaestus/randomEntry.tsx'; @@ -15,11 +15,12 @@ import useInput from '@deities/ui/controls/useInput.tsx'; import Stack from '@deities/ui/Stack.tsx'; import { css, cx } from '@emotion/css'; import arrayShuffle from 'array-shuffle'; -import { MouseEvent, useCallback, useMemo, useState } from 'react'; +import type { MouseEvent } from 'react'; +import { useCallback, useMemo, useState } from 'react'; import { useSprites } from '../../hooks/useSprites.tsx'; import toTransformOrigin from '../../lib/toTransformOrigin.tsx'; import Tick from '../../Tick.tsx'; -import { MapInfoState } from '../../Types.tsx'; +import type { MapInfoState } from '../../Types.tsx'; import UnitTile from '../../Unit.tsx'; import GameDialog from '../GameDialog.tsx'; diff --git a/hera/ui/lib/formatCharacterText.tsx b/hera/ui/lib/formatCharacterText.tsx index ec5da5bf..02dba0b7 100644 --- a/hera/ui/lib/formatCharacterText.tsx +++ b/hera/ui/lib/formatCharacterText.tsx @@ -1,14 +1,14 @@ -import { UnitInfo } from '@deities/athena/info/Unit.tsx'; +import type { UnitInfo } from '@deities/athena/info/Unit.tsx'; import formatText from '@deities/athena/lib/formatText.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import { isDynamicPlayerID, - PlayerID, resolveDynamicPlayerID, } from '@deities/athena/map/Player.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import parseInteger from '@deities/hephaestus/parseInteger.tsx'; import getTranslatedFactionName from '../../lib/getTranslatedFactionName.tsx'; -import { FactionNames } from '../../Types.tsx'; +import type { FactionNames } from '../../Types.tsx'; export default function formatCharacterText( text: string, diff --git a/hera/ui/lib/getClientCoordinates.tsx b/hera/ui/lib/getClientCoordinates.tsx index 07749c74..40b7898c 100644 --- a/hera/ui/lib/getClientCoordinates.tsx +++ b/hera/ui/lib/getClientCoordinates.tsx @@ -1,6 +1,6 @@ import parseInteger from '@deities/hephaestus/parseInteger.tsx'; import cssVar from '@deities/ui/cssVar.tsx'; -import { ClientCoordinates } from '../../lib/toTransformOrigin.tsx'; +import type { ClientCoordinates } from '../../lib/toTransformOrigin.tsx'; export default function getClientCoordinates( element?: Element | null, diff --git a/hera/ui/lib/useSkipAnimation.tsx b/hera/ui/lib/useSkipAnimation.tsx index 6659b4db..6f449269 100644 --- a/hera/ui/lib/useSkipAnimation.tsx +++ b/hera/ui/lib/useSkipAnimation.tsx @@ -1,6 +1,6 @@ -import { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; +import type { AnimationConfig } from '@deities/athena/map/Configuration.tsx'; import { useEffect } from 'react'; -import { TimerFunction } from '../../Types.tsx'; +import type { TimerFunction } from '../../Types.tsx'; export default function useSkipAnimation({ animationConfig, diff --git a/hera/win-conditions/WinConditionDescription.tsx b/hera/win-conditions/WinConditionDescription.tsx index 3ebafcbc..e2e9357f 100644 --- a/hera/win-conditions/WinConditionDescription.tsx +++ b/hera/win-conditions/WinConditionDescription.tsx @@ -1,5 +1,5 @@ +import type { WinCondition } from '@deities/athena/WinConditions.tsx'; import { - WinCondition, winConditionHasLabel, WinCriteria, } from '@deities/athena/WinConditions.tsx'; @@ -13,7 +13,7 @@ import { css } from '@emotion/css'; import { Fragment } from 'react'; import intlList, { Conjunctions, Delimiters } from '../i18n/intlList.tsx'; import getTranslatedFactionName from '../lib/getTranslatedFactionName.tsx'; -import { FactionNames } from '../Types.tsx'; +import type { FactionNames } from '../Types.tsx'; import UILabel from '../ui/UILabel.tsx'; import WinConditionTitle from '../win-conditions/WinConditionTitle.tsx'; diff --git a/hera/win-conditions/WinConditionTitle.tsx b/hera/win-conditions/WinConditionTitle.tsx index d14642ad..1cdce59f 100644 --- a/hera/win-conditions/WinConditionTitle.tsx +++ b/hera/win-conditions/WinConditionTitle.tsx @@ -1,4 +1,5 @@ -import { WinCondition, WinCriteria } from '@deities/athena/WinConditions.tsx'; +import type { WinCondition } from '@deities/athena/WinConditions.tsx'; +import { WinCriteria } from '@deities/athena/WinConditions.tsx'; import { css, cx } from '@emotion/css'; import getWinCriteriaName from '../lib/getWinCriteriaName.tsx'; import MiniPlayerIcon from '../ui/MiniPlayerIcon.tsx'; diff --git a/hermes/Types.tsx b/hermes/Types.tsx index 768c48fb..7993142b 100644 --- a/hermes/Types.tsx +++ b/hermes/Types.tsx @@ -1,6 +1,6 @@ -import { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import { CampaignMapName } from './CampaignMapName.tsx'; +import type { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { CampaignMapName } from './CampaignMapName.tsx'; export type LevelResult = Readonly< Partial<{ diff --git a/hermes/game/onGameEnd.tsx b/hermes/game/onGameEnd.tsx index 07dd0725..d231f0ab 100644 --- a/hermes/game/onGameEnd.tsx +++ b/hermes/game/onGameEnd.tsx @@ -1,7 +1,8 @@ import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import { applyEffects, Effects } from '@deities/apollo/Effects.tsx'; -import { GameState, MutableGameState } from '@deities/apollo/Types.tsx'; -import { PlayerID } from '@deities/athena/map/Player.tsx'; +import type { Effects } from '@deities/apollo/Effects.tsx'; +import { applyEffects } from '@deities/apollo/Effects.tsx'; +import type { GameState, MutableGameState } from '@deities/apollo/Types.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; import Vision from '@deities/athena/Vision.tsx'; export default function onGameEnd( diff --git a/hermes/game/toClientGame.tsx b/hermes/game/toClientGame.tsx index cef7735b..1cafc8bb 100644 --- a/hermes/game/toClientGame.tsx +++ b/hermes/game/toClientGame.tsx @@ -1,7 +1,7 @@ -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; -import { Effects } from '@deities/apollo/Effects.tsx'; -import { GameState } from '@deities/apollo/Types.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { Effects } from '@deities/apollo/Effects.tsx'; +import type { GameState } from '@deities/apollo/Types.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; export type ClientGame = Readonly<{ effects: Effects; diff --git a/hermes/getCampaignLevelDepths.tsx b/hermes/getCampaignLevelDepths.tsx index e49faefc..38f65362 100644 --- a/hermes/getCampaignLevelDepths.tsx +++ b/hermes/getCampaignLevelDepths.tsx @@ -1,4 +1,4 @@ -import { Campaign, Level } from './Types.tsx'; +import type { Campaign, Level } from './Types.tsx'; function unrollLevel( level: Level, diff --git a/hermes/map-fixtures/demo-1.tsx b/hermes/map-fixtures/demo-1.tsx index 70cebc3d..2b1616dd 100644 --- a/hermes/map-fixtures/demo-1.tsx +++ b/hermes/map-fixtures/demo-1.tsx @@ -1,5 +1,5 @@ import CharacterMessage from '@deities/apollo/CharacterMessage.tsx'; -import { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; +import type { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; import MapData from '@deities/athena/MapData.tsx'; diff --git a/hermes/map-fixtures/demo-2.tsx b/hermes/map-fixtures/demo-2.tsx index 6b3c149f..8de0d086 100644 --- a/hermes/map-fixtures/demo-2.tsx +++ b/hermes/map-fixtures/demo-2.tsx @@ -1,5 +1,5 @@ import CharacterMessage from '@deities/apollo/CharacterMessage.tsx'; -import { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; +import type { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; import MapData from '@deities/athena/MapData.tsx'; diff --git a/hermes/map-fixtures/demo-3.tsx b/hermes/map-fixtures/demo-3.tsx index beaf5c8a..2f6bc130 100644 --- a/hermes/map-fixtures/demo-3.tsx +++ b/hermes/map-fixtures/demo-3.tsx @@ -1,4 +1,4 @@ -import { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; +import type { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; import MapData from '@deities/athena/MapData.tsx'; diff --git a/hermes/map-fixtures/shrine.tsx b/hermes/map-fixtures/shrine.tsx index aa8439eb..fdfc3fe1 100644 --- a/hermes/map-fixtures/shrine.tsx +++ b/hermes/map-fixtures/shrine.tsx @@ -1,5 +1,5 @@ import CharacterMessage from '@deities/apollo/CharacterMessage.tsx'; -import { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; +import type { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; import MapData from '@deities/athena/MapData.tsx'; diff --git a/hermes/map-fixtures/they-are-close-to-home.tsx b/hermes/map-fixtures/they-are-close-to-home.tsx index 7d42012b..1ff4a131 100644 --- a/hermes/map-fixtures/they-are-close-to-home.tsx +++ b/hermes/map-fixtures/they-are-close-to-home.tsx @@ -1,5 +1,5 @@ import CharacterMessage from '@deities/apollo/CharacterMessage.tsx'; -import { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; +import type { MapMetadata } from '@deities/apollo/MapMetadata.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; import MapData from '@deities/athena/MapData.tsx'; diff --git a/hermes/toCampaign.tsx b/hermes/toCampaign.tsx index 7083dbcd..9c8751c0 100644 --- a/hermes/toCampaign.tsx +++ b/hermes/toCampaign.tsx @@ -1,5 +1,5 @@ import getOrThrow from '@deities/hephaestus/getOrThrow.tsx'; -import { Campaign, Level, LevelID, PlainCampaign } from './Types.tsx'; +import type { Campaign, Level, LevelID, PlainCampaign } from './Types.tsx'; type MutableLevel = Omit, 'next'> & { next?: Array | [number, MutableLevel]>; diff --git a/hermes/toLevelMap.tsx b/hermes/toLevelMap.tsx index d6c07a81..2f1feb39 100644 --- a/hermes/toLevelMap.tsx +++ b/hermes/toLevelMap.tsx @@ -1,4 +1,4 @@ -import { LevelEntry, PlainLevel } from './Types.tsx'; +import type { LevelEntry, PlainLevel } from './Types.tsx'; export default function toLevelMap(levels?: ReadonlyArray>) { if (!levels) { diff --git a/hermes/toPlainCampaign.tsx b/hermes/toPlainCampaign.tsx index 240dd09d..3461bd12 100644 --- a/hermes/toPlainCampaign.tsx +++ b/hermes/toPlainCampaign.tsx @@ -1,4 +1,4 @@ -import { Campaign, PlainCampaign, PlainLevel } from './Types.tsx'; +import type { Campaign, PlainCampaign, PlainLevel } from './Types.tsx'; import unrollCampaign from './unrollCampaign.tsx'; export default function toPlainCampaign( diff --git a/hermes/toPlainLevelList.tsx b/hermes/toPlainLevelList.tsx index dd2a6c7c..cc5e2cb6 100644 --- a/hermes/toPlainLevelList.tsx +++ b/hermes/toPlainLevelList.tsx @@ -1,4 +1,4 @@ -import { Level } from './Types.tsx'; +import type { Level } from './Types.tsx'; export default function toPlainLevelList( list?: ReadonlyArray | [number, Level]>, diff --git a/hermes/unrollCampaign.tsx b/hermes/unrollCampaign.tsx index 7282b61f..d5df2e59 100644 --- a/hermes/unrollCampaign.tsx +++ b/hermes/unrollCampaign.tsx @@ -1,4 +1,4 @@ -import { Campaign, Level, LevelMap } from './Types.tsx'; +import type { Campaign, Level, LevelMap } from './Types.tsx'; function unrollLevel( level: Level, diff --git a/hermes/validateCampaign.tsx b/hermes/validateCampaign.tsx index b08f2769..09b03a05 100644 --- a/hermes/validateCampaign.tsx +++ b/hermes/validateCampaign.tsx @@ -1,4 +1,4 @@ -import { Campaign, Level, LevelMap } from './Types.tsx'; +import type { Campaign, Level, LevelMap } from './Types.tsx'; import unrollCampaign from './unrollCampaign.tsx'; function detectCycle( diff --git a/infra/startServer.tsx b/infra/startServer.tsx index bce509a4..e1970423 100644 --- a/infra/startServer.tsx +++ b/infra/startServer.tsx @@ -1,6 +1,7 @@ import { join } from 'node:path'; import chalk from 'chalk'; -import { ViteDevServer as _ViteDevServer, createServer } from 'vite'; +import type { ViteDevServer as _ViteDevServer } from 'vite'; +import { createServer } from 'vite'; export default async function startServer({ name, diff --git a/tests/__tests__/Effects.test.tsx b/tests/__tests__/Effects.test.tsx index f34d219c..f81108c5 100644 --- a/tests/__tests__/Effects.test.tsx +++ b/tests/__tests__/Effects.test.tsx @@ -6,7 +6,7 @@ import { MoveAction, StartAction, } from '@deities/apollo/action-mutators/ActionMutators.tsx'; -import { Effect, Effects } from '@deities/apollo/Effects.tsx'; +import type { Effect, Effects } from '@deities/apollo/Effects.tsx'; import { RelativeVectors } from '@deities/apollo/lib/transformEffectValue.tsx'; import { Barracks } from '@deities/athena/info/Building.tsx'; import { diff --git a/tests/__tests__/HaltingProblem.test.tsx b/tests/__tests__/HaltingProblem.test.tsx index 319da41e..9ef8906c 100644 --- a/tests/__tests__/HaltingProblem.test.tsx +++ b/tests/__tests__/HaltingProblem.test.tsx @@ -1,6 +1,6 @@ import { writeFileSync } from 'node:fs'; import { EndTurnAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; import encodeGameActionResponse from '@deities/apollo/actions/encodeGameActionResponse.tsx'; import executeGameAction from '@deities/apollo/actions/executeGameAction.tsx'; @@ -8,7 +8,7 @@ import { encodeActionResponse } from '@deities/apollo/EncodedActions.tsx'; import { computeVisibleEndTurnActionResponse } from '@deities/apollo/lib/computeVisibleActions.tsx'; import decodeGameActionResponse from '@deities/apollo/lib/decodeGameActionResponse.tsx'; import updateVisibleEntities from '@deities/apollo/lib/updateVisibleEntities.tsx'; -import { GameState } from '@deities/apollo/Types.tsx'; +import type { GameState } from '@deities/apollo/Types.tsx'; import { generateBuildings, generateRandomMap, @@ -20,7 +20,8 @@ import updatePlayers from '@deities/athena/lib/updatePlayers.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; import { Biome, Biomes } from '@deities/athena/map/Biome.tsx'; import { Bot, HumanPlayer } from '@deities/athena/map/Player.tsx'; -import MapData, { SizeVector } from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; +import { SizeVector } from '@deities/athena/MapData.tsx'; import AIRegistry from '@deities/dionysus/AIRegistry.tsx'; import chalk from 'chalk'; import { expect, test } from 'vitest'; diff --git a/tests/__tests__/Reward.test.tsx b/tests/__tests__/Reward.test.tsx index 6a8c5bed..640cbe70 100644 --- a/tests/__tests__/Reward.test.tsx +++ b/tests/__tests__/Reward.test.tsx @@ -1,6 +1,6 @@ import { CaptureAction } from '@deities/apollo/action-mutators/ActionMutators.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; -import { Effect, Effects } from '@deities/apollo/Effects.tsx'; +import type { Effect, Effects } from '@deities/apollo/Effects.tsx'; import { Barracks } from '@deities/athena/info/Building.tsx'; import { Skill } from '@deities/athena/info/Skill.tsx'; import { Pioneer, SmallTank } from '@deities/athena/info/Unit.tsx'; diff --git a/tests/__tests__/Spawn.test.tsx b/tests/__tests__/Spawn.test.tsx index a73a3fc2..554ba99b 100644 --- a/tests/__tests__/Spawn.test.tsx +++ b/tests/__tests__/Spawn.test.tsx @@ -1,7 +1,7 @@ import { executeEffect } from '@deities/apollo/Action.tsx'; import applyActionResponse from '@deities/apollo/actions/applyActionResponse.tsx'; import encodeGameActionResponse from '@deities/apollo/actions/encodeGameActionResponse.tsx'; -import { GameState } from '@deities/apollo/Types.tsx'; +import type { GameState } from '@deities/apollo/Types.tsx'; import { Bomber, FighterJet, Helicopter } from '@deities/athena/info/Unit.tsx'; import withModifiers from '@deities/athena/lib/withModifiers.tsx'; import { Bot, HumanPlayer } from '@deities/athena/map/Player.tsx'; diff --git a/tests/__tests__/Unit.test.tsx b/tests/__tests__/Unit.test.tsx index bf8d61c0..b17a7f9d 100644 --- a/tests/__tests__/Unit.test.tsx +++ b/tests/__tests__/Unit.test.tsx @@ -17,9 +17,9 @@ import { import withModifiers from '@deities/athena/lib/withModifiers.tsx'; import { Biome } from '@deities/athena/map/Biome.tsx'; import { HumanPlayer } from '@deities/athena/map/Player.tsx'; -import Unit from '@deities/athena/map/Unit.tsx'; +import type Unit from '@deities/athena/map/Unit.tsx'; import vec from '@deities/athena/map/vec.tsx'; -import Vector from '@deities/athena/map/Vector.tsx'; +import type Vector from '@deities/athena/map/Vector.tsx'; import MapData from '@deities/athena/MapData.tsx'; import { WinCriteria } from '@deities/athena/WinConditions.tsx'; import sortBy from '@deities/hephaestus/sortBy.tsx'; diff --git a/tests/executeGameActions.tsx b/tests/executeGameActions.tsx index 41822631..c3c104d6 100644 --- a/tests/executeGameActions.tsx +++ b/tests/executeGameActions.tsx @@ -1,14 +1,17 @@ -import { Actions, MutateActionResponseFn } from '@deities/apollo/Action.tsx'; -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { + Actions, + MutateActionResponseFn, +} from '@deities/apollo/Action.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; import encodeGameActionResponse from '@deities/apollo/actions/encodeGameActionResponse.tsx'; import executeGameAction from '@deities/apollo/actions/executeGameAction.tsx'; -import { Effects } from '@deities/apollo/Effects.tsx'; +import type { Effects } from '@deities/apollo/Effects.tsx'; import { formatAction } from '@deities/apollo/FormatActions.tsx'; -import { +import type { EncodedGameActionResponse, GameState, } from '@deities/apollo/Types.tsx'; -import MapData from '@deities/athena/MapData.tsx'; +import type MapData from '@deities/athena/MapData.tsx'; import AIRegistry from '@deities/dionysus/AIRegistry.tsx'; import onGameEnd from '@deities/hermes/game/onGameEnd.tsx'; diff --git a/tests/printGameState.tsx b/tests/printGameState.tsx index 773d982c..6c5afd45 100644 --- a/tests/printGameState.tsx +++ b/tests/printGameState.tsx @@ -1,4 +1,4 @@ -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; import { formatActionResponse } from '@deities/apollo/FormatActions.tsx'; import chalk from 'chalk'; import terminalImage from 'term-img'; diff --git a/tests/screenshot.tsx b/tests/screenshot.tsx index 2d42c510..7faa328f 100644 --- a/tests/screenshot.tsx +++ b/tests/screenshot.tsx @@ -1,13 +1,14 @@ import { readFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; -import { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; -import { +import type { ActionResponse } from '@deities/apollo/ActionResponse.tsx'; +import type { EncodedGameActionResponse, GameState, } from '@deities/apollo/Types.tsx'; -import MapData from '@deities/athena/MapData.tsx'; -import playwright, { Browser, Page } from 'playwright'; +import type MapData from '@deities/athena/MapData.tsx'; +import type { Browser, Page } from 'playwright'; +import playwright from 'playwright'; const APP_PORT = 3001; const BASE_URL = `http://localhost:${APP_PORT}/display.html`; diff --git a/tests/snapshotEncodedActionResponse.tsx b/tests/snapshotEncodedActionResponse.tsx index 78ea805e..0952b7d1 100644 --- a/tests/snapshotEncodedActionResponse.tsx +++ b/tests/snapshotEncodedActionResponse.tsx @@ -1,6 +1,6 @@ import { decodeActionResponses } from '@deities/apollo/EncodedActions.tsx'; import { formatActionResponses } from '@deities/apollo/FormatActions.tsx'; -import { EncodedGameActionResponse } from '@deities/apollo/Types.tsx'; +import type { EncodedGameActionResponse } from '@deities/apollo/Types.tsx'; export default function snapshotEncodedActionResponse( encodedGameActionResponse: EncodedGameActionResponse, diff --git a/tests/snapshotGameState.tsx b/tests/snapshotGameState.tsx index e479d8c8..320beb91 100644 --- a/tests/snapshotGameState.tsx +++ b/tests/snapshotGameState.tsx @@ -1,5 +1,5 @@ import { formatActionResponses } from '@deities/apollo/FormatActions.tsx'; -import { GameState } from '@deities/apollo/Types.tsx'; +import type { GameState } from '@deities/apollo/Types.tsx'; export default function snapshotGameState(gameState: GameState | null) { return formatActionResponses( diff --git a/ui/ActiveLink.tsx b/ui/ActiveLink.tsx index 8af37eea..05628d94 100644 --- a/ui/ActiveLink.tsx +++ b/ui/ActiveLink.tsx @@ -1,9 +1,10 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import { css, cx } from '@emotion/css'; import React, { memo } from 'react'; import { useMatch, useResolvedPath } from 'react-router-dom'; import { applyVar } from './cssVar.tsx'; -import Link, { LinkProps } from './Link.tsx'; +import type { LinkProps } from './Link.tsx'; +import Link from './Link.tsx'; export default memo(function ActiveLink({ className, diff --git a/ui/App.tsx b/ui/App.tsx index 2375380c..5594f890 100644 --- a/ui/App.tsx +++ b/ui/App.tsx @@ -1,4 +1,4 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; export type NativeApp = Readonly<{ canToggleFullScreen: () => boolean; diff --git a/ui/AudioPlayer.tsx b/ui/AudioPlayer.tsx index be9501db..2bdecdda 100644 --- a/ui/AudioPlayer.tsx +++ b/ui/AudioPlayer.tsx @@ -1,4 +1,4 @@ -import { SongName, SoundName } from '@deities/athena/info/Music.tsx'; +import type { SongName, SoundName } from '@deities/athena/info/Music.tsx'; import parseInteger from '@deities/hephaestus/parseInteger.tsx'; import { Music, Sounds } from 'athena-crisis:audio'; import { Howl, Howler } from 'howler'; diff --git a/ui/Box.tsx b/ui/Box.tsx index 805a9bb4..a3034aeb 100644 --- a/ui/Box.tsx +++ b/ui/Box.tsx @@ -1,8 +1,10 @@ import { css, cx } from '@emotion/css'; -import { HTMLAttributes, memo } from 'react'; +import type { HTMLAttributes } from 'react'; +import { memo } from 'react'; import { applyVar } from './cssVar.tsx'; import pixelBorder from './pixelBorder.tsx'; -import Stack, { StackProps } from './Stack.tsx'; +import type { StackProps } from './Stack.tsx'; +import Stack from './Stack.tsx'; export default memo(function Box({ blur, diff --git a/ui/Button.tsx b/ui/Button.tsx index 8ee2295b..4923f92d 100644 --- a/ui/Button.tsx +++ b/ui/Button.tsx @@ -1,14 +1,12 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import { css, cx } from '@emotion/css'; -import { +import type { AnchorHTMLAttributes, - memo, MutableRefObject, ReactNode, RefCallback, - useCallback, - useRef, } from 'react'; +import { memo, useCallback, useRef } from 'react'; import AudioPlayer from './AudioPlayer.tsx'; import clipBorder from './clipBorder.tsx'; import useActive from './controls/useActive.tsx'; diff --git a/ui/ClearableInput.tsx b/ui/ClearableInput.tsx index b1915b94..7963f673 100644 --- a/ui/ClearableInput.tsx +++ b/ui/ClearableInput.tsx @@ -1,11 +1,6 @@ import { css, cx } from '@emotion/css'; -import { - DetailedHTMLProps, - InputHTMLAttributes, - memo, - MouseEvent, - useRef, -} from 'react'; +import type { DetailedHTMLProps, InputHTMLAttributes, MouseEvent } from 'react'; +import { memo, useRef } from 'react'; export default memo(function ClearableInput({ className, diff --git a/ui/Container.tsx b/ui/Container.tsx index 6f6841d1..9499f35b 100644 --- a/ui/Container.tsx +++ b/ui/Container.tsx @@ -1,7 +1,9 @@ import { DoubleSize } from '@deities/athena/map/Configuration.tsx'; import { css, cx } from '@emotion/css'; -import { HTMLAttributes, memo } from 'react'; -import Stack, { StackProps } from './Stack.tsx'; +import type { HTMLAttributes } from 'react'; +import { memo } from 'react'; +import type { StackProps } from './Stack.tsx'; +import Stack from './Stack.tsx'; export default memo(function Container({ className, diff --git a/ui/Dialog.tsx b/ui/Dialog.tsx index 900631e6..a103c2a0 100644 --- a/ui/Dialog.tsx +++ b/ui/Dialog.tsx @@ -2,7 +2,8 @@ import { DoubleSize } from '@deities/athena/map/Configuration.tsx'; import { css, cx } from '@emotion/css'; import Close from '@iconify-icons/pixelarticons/close.js'; import { motion } from 'framer-motion'; -import { ReactNode, useCallback } from 'react'; +import type { ReactNode } from 'react'; +import { useCallback } from 'react'; import AudioPlayer from './AudioPlayer.tsx'; import Breakpoints from './Breakpoints.tsx'; import { isSafari } from './Browser.tsx'; diff --git a/ui/ErrorText.tsx b/ui/ErrorText.tsx index da46a75b..4f82d007 100644 --- a/ui/ErrorText.tsx +++ b/ui/ErrorText.tsx @@ -1,4 +1,5 @@ -import { memo, ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import { memo } from 'react'; import { applyVar } from './cssVar.tsx'; export default memo(function ErrorText({ children }: { children: ReactNode }) { diff --git a/ui/ExpandableMenuButton.tsx b/ui/ExpandableMenuButton.tsx index 97b157e8..e66d0871 100644 --- a/ui/ExpandableMenuButton.tsx +++ b/ui/ExpandableMenuButton.tsx @@ -1,13 +1,8 @@ import { DoubleSize } from '@deities/athena/map/Configuration.tsx'; import { css, cx } from '@emotion/css'; import Close from '@iconify-icons/pixelarticons/close.js'; -import { - ComponentProps, - ReactNode, - useLayoutEffect, - useRef, - useState, -} from 'react'; +import type { ComponentProps, ReactNode } from 'react'; +import { useLayoutEffect, useRef, useState } from 'react'; import Icon from './Icon.tsx'; import MenuButton from './MenuButton.tsx'; import Stack from './Stack.tsx'; diff --git a/ui/Form.tsx b/ui/Form.tsx index 462ecc8e..40300bc2 100644 --- a/ui/Form.tsx +++ b/ui/Form.tsx @@ -1,10 +1,5 @@ -import { - DetailedHTMLProps, - FormHTMLAttributes, - memo, - useEffect, - useRef, -} from 'react'; +import type { DetailedHTMLProps, FormHTMLAttributes } from 'react'; +import { memo, useEffect, useRef } from 'react'; export default memo(function Form( props: DetailedHTMLProps< diff --git a/ui/Icon.tsx b/ui/Icon.tsx index 825d0b3e..3c1c95c9 100644 --- a/ui/Icon.tsx +++ b/ui/Icon.tsx @@ -1,5 +1,6 @@ import { cx } from '@emotion/css'; -import { memo, SVGAttributes } from 'react'; +import type { SVGAttributes } from 'react'; +import { memo } from 'react'; import { SquareButtonStyle } from './Button.tsx'; export type SVGIcon = Readonly<{ diff --git a/ui/InlineLink.tsx b/ui/InlineLink.tsx index 8b904753..e9e13dba 100644 --- a/ui/InlineLink.tsx +++ b/ui/InlineLink.tsx @@ -1,14 +1,13 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import { css, cx } from '@emotion/css'; -import React, { +import type { AnchorHTMLAttributes, CSSProperties, MouseEvent, MutableRefObject, RefCallback, - useCallback, - useRef, } from 'react'; +import React, { useCallback, useRef } from 'react'; import AudioPlayer from './AudioPlayer.tsx'; import Breakpoints from './Breakpoints.tsx'; import useActive from './controls/useActive.tsx'; @@ -16,7 +15,7 @@ import { applyVar, CSSVariables } from './cssVar.tsx'; import useScrollIntoView from './hooks/useScrollIntoView.tsx'; import Link from './Link.tsx'; import pixelBorder from './pixelBorder.tsx'; -import { Gap } from './Stack.tsx'; +import type { Gap } from './Stack.tsx'; export const InlineLinkColor = 'InlineLink-color'; diff --git a/ui/Link.tsx b/ui/Link.tsx index 8ccf6b23..77da0aa0 100644 --- a/ui/Link.tsx +++ b/ui/Link.tsx @@ -1,5 +1,5 @@ -import { Route } from '@deities/apollo/Routes.tsx'; -import { ComponentProps, FC, Ref } from 'react'; +import type { Route } from '@deities/apollo/Routes.tsx'; +import type { ComponentProps, FC, Ref } from 'react'; import { Link } from 'react-router-dom'; export type LinkProps = Omit, 'to'> & { diff --git a/ui/Menu.tsx b/ui/Menu.tsx index adef170d..04c63278 100644 --- a/ui/Menu.tsx +++ b/ui/Menu.tsx @@ -8,8 +8,8 @@ import Map from '@iconify-icons/pixelarticons/map.js'; import MenuIcon from '@iconify-icons/pixelarticons/menu.js'; import User from '@iconify-icons/pixelarticons/user.js'; import { motion } from 'framer-motion'; +import type { ReactNode } from 'react'; import { - ReactNode, useCallback, useEffect, useLayoutEffect, diff --git a/ui/MenuButton.tsx b/ui/MenuButton.tsx index 3f65eb54..96b4adf1 100644 --- a/ui/MenuButton.tsx +++ b/ui/MenuButton.tsx @@ -1,7 +1,8 @@ import { DoubleSize } from '@deities/athena/map/Configuration.tsx'; import { css, cx } from '@emotion/css'; import { motion } from 'framer-motion'; -import { CSSProperties, memo, MouseEvent, ReactNode, RefObject } from 'react'; +import type { CSSProperties, MouseEvent, ReactNode, RefObject } from 'react'; +import { memo } from 'react'; import { BoxStyle } from './Box.tsx'; export default memo(function MenuButton({ diff --git a/ui/Navigate.tsx b/ui/Navigate.tsx index 370e03d2..591779e2 100644 --- a/ui/Navigate.tsx +++ b/ui/Navigate.tsx @@ -1,5 +1,5 @@ -import { Route } from '@deities/apollo/Routes.tsx'; -import { ComponentProps, FC } from 'react'; +import type { Route } from '@deities/apollo/Routes.tsx'; +import type { ComponentProps, FC } from 'react'; import { Navigate } from 'react-router-dom'; export type NavigateProps = Omit, 'to'> & { diff --git a/ui/PageTransition.tsx b/ui/PageTransition.tsx index 5d230108..c3e23f7f 100644 --- a/ui/PageTransition.tsx +++ b/ui/PageTransition.tsx @@ -1,5 +1,6 @@ import { motion } from 'framer-motion'; -import React, { memo, ReactNode } from 'react'; +import type { ReactNode } from 'react'; +import React, { memo } from 'react'; export const PageTransitionDuration = 0.15; diff --git a/ui/Portal.tsx b/ui/Portal.tsx index 75ed98a4..4bbba442 100644 --- a/ui/Portal.tsx +++ b/ui/Portal.tsx @@ -1,4 +1,4 @@ -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import { createPortal } from 'react-dom'; let defaultContainer = document.body; diff --git a/ui/PrimaryExpandableMenuButton.tsx b/ui/PrimaryExpandableMenuButton.tsx index 4b5fcbe3..d1116dbb 100644 --- a/ui/PrimaryExpandableMenuButton.tsx +++ b/ui/PrimaryExpandableMenuButton.tsx @@ -1,6 +1,6 @@ import { DoubleSize } from '@deities/athena/map/Configuration.tsx'; import { css, cx } from '@emotion/css'; -import { ComponentProps } from 'react'; +import type { ComponentProps } from 'react'; import Breakpoints from './Breakpoints.tsx'; import { applyVar, insetStyle } from './cssVar.tsx'; import ExpandableMenuButton from './ExpandableMenuButton.tsx'; diff --git a/ui/ScrollContainer.tsx b/ui/ScrollContainer.tsx index 94983026..4a4193b8 100644 --- a/ui/ScrollContainer.tsx +++ b/ui/ScrollContainer.tsx @@ -1,5 +1,5 @@ import { cx } from '@emotion/css'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; let currentScrollContainer: HTMLElement | null = null; diff --git a/ui/Select.tsx b/ui/Select.tsx index 7eb1af66..7ff3ecfb 100644 --- a/ui/Select.tsx +++ b/ui/Select.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; import ChevronDown from '@iconify-icons/pixelarticons/chevron-down.js'; -import { ReactNode } from 'react'; +import type { ReactNode } from 'react'; import Box from './Box.tsx'; import { applyVar } from './cssVar.tsx'; import Icon from './Icon.tsx'; diff --git a/ui/Slider.tsx b/ui/Slider.tsx index ab482c20..570a865f 100644 --- a/ui/Slider.tsx +++ b/ui/Slider.tsx @@ -1,5 +1,6 @@ import { css, cx } from '@emotion/css'; -import { InputHTMLAttributes, memo } from 'react'; +import type { InputHTMLAttributes } from 'react'; +import { memo } from 'react'; import { applyVar } from './cssVar.tsx'; import pixelBorder from './pixelBorder.tsx'; diff --git a/ui/Stack.tsx b/ui/Stack.tsx index ff6a4483..a9316901 100644 --- a/ui/Stack.tsx +++ b/ui/Stack.tsx @@ -1,5 +1,5 @@ import { css, cx } from '@emotion/css'; -import { CSSProperties, HTMLAttributes, ReactNode, Ref } from 'react'; +import type { CSSProperties, HTMLAttributes, ReactNode, Ref } from 'react'; import Breakpoints from './Breakpoints.tsx'; export type Gap = 1 | 2 | 4 | 16 | 24 | 32 | true; diff --git a/ui/Tag.tsx b/ui/Tag.tsx index c15468db..d9b2da5c 100644 --- a/ui/Tag.tsx +++ b/ui/Tag.tsx @@ -1,4 +1,4 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import { css, cx } from '@emotion/css'; import Close from '@iconify-icons/pixelarticons/close.js'; import { ButtonStyle } from './Button.tsx'; diff --git a/ui/TagInput.tsx b/ui/TagInput.tsx index ddff1897..5ab22d3c 100644 --- a/ui/TagInput.tsx +++ b/ui/TagInput.tsx @@ -2,10 +2,11 @@ import { css, cx } from '@emotion/css'; import { useMemo, useRef } from 'react'; import Stack from './Stack.tsx'; import { TagListInternal } from './TagList.tsx'; -import Typeahead, { +import type { TypeaheadDataSource, TypeaheadDataSourceEntry, } from './Typeahead.tsx'; +import Typeahead from './Typeahead.tsx'; export default function TagInput({ dataSource, diff --git a/ui/Typeahead.tsx b/ui/Typeahead.tsx index ec5c2c77..a0313b70 100644 --- a/ui/Typeahead.tsx +++ b/ui/Typeahead.tsx @@ -1,17 +1,13 @@ // Thanks Tomo import { css, cx } from '@emotion/css'; -import { +import type { ChangeEvent, FocusEvent, KeyboardEvent, MutableRefObject, ReactNode, - useCallback, - useEffect, - useMemo, - useRef, - useState, } from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { BoxStyle } from './Box.tsx'; import clipBorder from './clipBorder.tsx'; import useDirectionalNavigation from './controls/useDirectionalNavigation.tsx'; diff --git a/ui/controls/dynamicThrottle.tsx b/ui/controls/dynamicThrottle.tsx index 7f480ce1..bd4977fa 100644 --- a/ui/controls/dynamicThrottle.tsx +++ b/ui/controls/dynamicThrottle.tsx @@ -1,4 +1,4 @@ -import { NativeTimeout, ThrottleFn } from './throttle.tsx'; +import type { NativeTimeout, ThrottleFn } from './throttle.tsx'; export default function dynamicThrottle( fn: T, diff --git a/ui/controls/setupGamePad.tsx b/ui/controls/setupGamePad.tsx index 7aa35466..82bc1a67 100644 --- a/ui/controls/setupGamePad.tsx +++ b/ui/controls/setupGamePad.tsx @@ -1,12 +1,9 @@ -import { - ButtonResult, - createJoymap, - createQueryModule, - Joymap, -} from '@nkzw/joymap'; +import type { ButtonResult, Joymap } from '@nkzw/joymap'; +import { createJoymap, createQueryModule } from '@nkzw/joymap'; import { getCurrentScrollContainer } from '../ScrollContainer.tsx'; import dynamicThrottle from './dynamicThrottle.tsx'; -import Input, { NavigationDirection } from './Input.tsx'; +import type { NavigationDirection } from './Input.tsx'; +import Input from './Input.tsx'; import throttle from './throttle.tsx'; const singlePress = (button?: ButtonResult) => diff --git a/ui/controls/setupKeyboard.tsx b/ui/controls/setupKeyboard.tsx index 30c30a2c..5c05fc86 100644 --- a/ui/controls/setupKeyboard.tsx +++ b/ui/controls/setupKeyboard.tsx @@ -1,5 +1,6 @@ import dynamicThrottle from './dynamicThrottle.tsx'; -import Input, { NavigationDirection } from './Input.tsx'; +import type { NavigationDirection } from './Input.tsx'; +import Input from './Input.tsx'; import isControlElement from './isControlElement.tsx'; import throttle from './throttle.tsx'; diff --git a/ui/controls/useAcceptNavigation.tsx b/ui/controls/useAcceptNavigation.tsx index 6be5ea5f..ead66a58 100644 --- a/ui/controls/useAcceptNavigation.tsx +++ b/ui/controls/useAcceptNavigation.tsx @@ -1,5 +1,5 @@ import { useCallback, useRef, useState } from 'react'; -import { InputLayer } from './Input.tsx'; +import type { InputLayer } from './Input.tsx'; import useInput from './useInput.tsx'; export default function useAcceptNavigation( diff --git a/ui/controls/useActive.tsx b/ui/controls/useActive.tsx index 8100ed89..ad8c3493 100644 --- a/ui/controls/useActive.tsx +++ b/ui/controls/useActive.tsx @@ -1,4 +1,4 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import { useEffect, useRef } from 'react'; import useNavigate from '../hooks/useNavigate.tsx'; diff --git a/ui/controls/useBack.tsx b/ui/controls/useBack.tsx index 19d48524..4ca71985 100644 --- a/ui/controls/useBack.tsx +++ b/ui/controls/useBack.tsx @@ -1,4 +1,4 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import { useCallback } from 'react'; import useNavigate from '../hooks/useNavigate.tsx'; import useInput from './useInput.tsx'; diff --git a/ui/controls/useBlockInput.tsx b/ui/controls/useBlockInput.tsx index cdc6822e..e6dbb3db 100644 --- a/ui/controls/useBlockInput.tsx +++ b/ui/controls/useBlockInput.tsx @@ -1,5 +1,6 @@ import { useEffect } from 'react'; -import Input, { InputLayer } from './Input.tsx'; +import type { InputLayer } from './Input.tsx'; +import Input from './Input.tsx'; export default function useBlockInput( block: InputLayer, diff --git a/ui/controls/useDirectionalNavigation.tsx b/ui/controls/useDirectionalNavigation.tsx index 7af6615e..d008dc73 100644 --- a/ui/controls/useDirectionalNavigation.tsx +++ b/ui/controls/useDirectionalNavigation.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react'; import AudioPlayer from '../AudioPlayer.tsx'; -import { InputLayer } from './Input.tsx'; +import type { InputLayer } from './Input.tsx'; import useInput from './useInput.tsx'; export default function useDirectionalNavigation( diff --git a/ui/controls/useHorizontalMenuNavigation.tsx b/ui/controls/useHorizontalMenuNavigation.tsx index 3f5a1ef2..ce9d06f7 100644 --- a/ui/controls/useHorizontalMenuNavigation.tsx +++ b/ui/controls/useHorizontalMenuNavigation.tsx @@ -1,5 +1,5 @@ import { useCallback, useState } from 'react'; -import { InputLayer } from './Input.tsx'; +import type { InputLayer } from './Input.tsx'; import useAcceptNavigation from './useAcceptNavigation.tsx'; import useHorizontalNavigation from './useHorizontalNavigation.tsx'; diff --git a/ui/controls/useHorizontalNavigation.tsx b/ui/controls/useHorizontalNavigation.tsx index 6e7fb452..4b810c6d 100644 --- a/ui/controls/useHorizontalNavigation.tsx +++ b/ui/controls/useHorizontalNavigation.tsx @@ -1,6 +1,6 @@ import { useCallback } from 'react'; import AudioPlayer from '../AudioPlayer.tsx'; -import { InputLayer } from './Input.tsx'; +import type { InputLayer } from './Input.tsx'; import useInput from './useInput.tsx'; export default function useHorizontalNavigation( diff --git a/ui/controls/useInput.tsx b/ui/controls/useInput.tsx index 56339abb..0d280322 100644 --- a/ui/controls/useInput.tsx +++ b/ui/controls/useInput.tsx @@ -1,5 +1,6 @@ import { useEffect } from 'react'; -import Input, { EventName, Events, InputLayer } from './Input.tsx'; +import type { EventName, Events, InputLayer } from './Input.tsx'; +import Input from './Input.tsx'; export default function useInput( type: T, diff --git a/ui/controls/useMenuNavigation.tsx b/ui/controls/useMenuNavigation.tsx index 747f1025..d4328f2b 100644 --- a/ui/controls/useMenuNavigation.tsx +++ b/ui/controls/useMenuNavigation.tsx @@ -1,5 +1,5 @@ import { useCallback, useState } from 'react'; -import { InputLayer } from './Input.tsx'; +import type { InputLayer } from './Input.tsx'; import useAcceptNavigation from './useAcceptNavigation.tsx'; import useDirectionalNavigation from './useDirectionalNavigation.tsx'; diff --git a/ui/getColor.tsx b/ui/getColor.tsx index f78b9a19..fd5ace9c 100644 --- a/ui/getColor.tsx +++ b/ui/getColor.tsx @@ -1,4 +1,4 @@ -import { DynamicPlayerID, PlayerID } from '@deities/athena/map/Player.tsx'; +import type { DynamicPlayerID, PlayerID } from '@deities/athena/map/Player.tsx'; import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx'; import { applyVar } from './cssVar.tsx'; diff --git a/ui/gradient.tsx b/ui/gradient.tsx index 44b1e4ef..4e249e95 100644 --- a/ui/gradient.tsx +++ b/ui/gradient.tsx @@ -1,4 +1,5 @@ -import getColor, { BaseColor } from './getColor.tsx'; +import type { BaseColor } from './getColor.tsx'; +import getColor from './getColor.tsx'; export default function gradient( color: BaseColor | ReadonlyArray | undefined, diff --git a/ui/hooks/useAlert.tsx b/ui/hooks/useAlert.tsx index 1c9dd22f..0fe8adca 100644 --- a/ui/hooks/useAlert.tsx +++ b/ui/hooks/useAlert.tsx @@ -1,10 +1,8 @@ import { css, cx } from '@emotion/css'; import { motion } from 'framer-motion'; +import type { ComponentProps, MouseEvent, ReactNode } from 'react'; import React, { - ComponentProps, createContext, - MouseEvent, - ReactNode, useCallback, useContext, useMemo, diff --git a/ui/hooks/useNavigate.tsx b/ui/hooks/useNavigate.tsx index 5fa9bfd6..b889cd2e 100644 --- a/ui/hooks/useNavigate.tsx +++ b/ui/hooks/useNavigate.tsx @@ -1,6 +1,7 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; import { useCallback } from 'react'; -import { NavigateOptions, useNavigate } from 'react-router-dom'; +import type { NavigateOptions } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; export default (process.env.IS_LANDING_PAGE ? () => { diff --git a/ui/hooks/usePress.tsx b/ui/hooks/usePress.tsx index 453b6993..417dd7e0 100644 --- a/ui/hooks/usePress.tsx +++ b/ui/hooks/usePress.tsx @@ -1,10 +1,11 @@ -import { MouseEvent, useCallback, useRef } from 'react'; -import { +import type { MouseEvent } from 'react'; +import { useCallback, useRef } from 'react'; +import type { LongPressReactEvents as _LongPressReactEvents, LongPressCallbackMeta, LongPressOptions, - useLongPress, } from 'use-long-press'; +import { useLongPress } from 'use-long-press'; export type LongPressReactEvents = _LongPressReactEvents; diff --git a/ui/hooks/useScale.tsx b/ui/hooks/useScale.tsx index 6ff87daf..7e47de1a 100644 --- a/ui/hooks/useScale.tsx +++ b/ui/hooks/useScale.tsx @@ -1,11 +1,6 @@ import { TileSize } from '@deities/athena/map/Configuration.tsx'; -import { - createContext, - ReactNode, - useContext, - useEffect, - useState, -} from 'react'; +import type { ReactNode } from 'react'; +import { createContext, useContext, useEffect, useState } from 'react'; import { isIOS } from '../Browser.tsx'; import cssVar, { applyVar } from '../cssVar.tsx'; diff --git a/ui/hooks/useScrollIntoView.tsx b/ui/hooks/useScrollIntoView.tsx index a559c2ae..e28dabc9 100644 --- a/ui/hooks/useScrollIntoView.tsx +++ b/ui/hooks/useScrollIntoView.tsx @@ -1,4 +1,5 @@ -import { RefObject, useEffect } from 'react'; +import type { RefObject } from 'react'; +import { useEffect } from 'react'; export default function useScrollIntoView( element: RefObject, diff --git a/ui/hooks/useScrollRestore.tsx b/ui/hooks/useScrollRestore.tsx index 49e51ac3..866e88b9 100644 --- a/ui/hooks/useScrollRestore.tsx +++ b/ui/hooks/useScrollRestore.tsx @@ -1,11 +1,5 @@ -import { - createContext, - MutableRefObject, - ReactNode, - useContext, - useEffect, - useRef, -} from 'react'; +import type { MutableRefObject, ReactNode } from 'react'; +import { createContext, useContext, useEffect, useRef } from 'react'; import { useLocation } from 'react-router-dom'; import { PageTransitionDuration } from '../PageTransition.tsx'; diff --git a/ui/lib/getGameRoute.tsx b/ui/lib/getGameRoute.tsx index ab049a2e..b122e6c9 100644 --- a/ui/lib/getGameRoute.tsx +++ b/ui/lib/getGameRoute.tsx @@ -1,4 +1,4 @@ -import { Route } from '@deities/apollo/Routes.tsx'; +import type { Route } from '@deities/apollo/Routes.tsx'; export default function getGameRoute({ campaignStateId, diff --git a/ui/lib/getTagColor.tsx b/ui/lib/getTagColor.tsx index b0aea1c6..d2e57307 100644 --- a/ui/lib/getTagColor.tsx +++ b/ui/lib/getTagColor.tsx @@ -1,4 +1,5 @@ -import { PlayerID, PlayerIDs } from '@deities/athena/map/Player.tsx'; +import type { PlayerID } from '@deities/athena/map/Player.tsx'; +import { PlayerIDs } from '@deities/athena/map/Player.tsx'; export default function getTagColor(tag: string) { return ((Array.from(tag) diff --git a/ui/lib/lazy.tsx b/ui/lib/lazy.tsx index 63bb55f3..d37d8d2f 100644 --- a/ui/lib/lazy.tsx +++ b/ui/lib/lazy.tsx @@ -2,8 +2,9 @@ import { DoubleSize } from '@deities/athena/map/Configuration.tsx'; import dateNow from '@deities/hephaestus/dateNow.tsx'; import { css } from '@emotion/css'; import { AnimatePresence } from 'framer-motion'; +import type { ComponentType } from 'react'; // eslint-disable-next-line @deities/no-lazy-import -import { lazy as _lazy, ComponentType } from 'react'; +import { lazy as _lazy } from 'react'; import Box from '../Box.tsx'; import PageTransition from '../PageTransition.tsx'; import Portal from '../Portal.tsx';