playlist-data-engine 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +352 -0
- package/dist/__vite-browser-external-DYxpcVy9.js +4 -0
- package/dist/constants/DefaultClasses.d.ts +46 -0
- package/dist/constants/DefaultClasses.d.ts.map +1 -0
- package/dist/constants/DefaultEnchantments.d.ts +337 -0
- package/dist/constants/DefaultEnchantments.d.ts.map +1 -0
- package/dist/constants/DefaultEnemies.d.ts +83 -0
- package/dist/constants/DefaultEnemies.d.ts.map +1 -0
- package/dist/constants/DefaultEquipment.d.ts +23 -0
- package/dist/constants/DefaultEquipment.d.ts.map +1 -0
- package/dist/constants/DefaultFeatures.d.ts +22 -0
- package/dist/constants/DefaultFeatures.d.ts.map +1 -0
- package/dist/constants/DefaultRaces.d.ts +102 -0
- package/dist/constants/DefaultRaces.d.ts.map +1 -0
- package/dist/constants/DefaultSkills.d.ts +26 -0
- package/dist/constants/DefaultSkills.d.ts.map +1 -0
- package/dist/constants/DefaultSpells.d.ts +41 -0
- package/dist/constants/DefaultSpells.d.ts.map +1 -0
- package/dist/constants/EncounterBalance.d.ts +208 -0
- package/dist/constants/EncounterBalance.d.ts.map +1 -0
- package/dist/constants/EnemyEquipment.d.ts +71 -0
- package/dist/constants/EnemyEquipment.d.ts.map +1 -0
- package/dist/constants/EnemyRarity.d.ts +79 -0
- package/dist/constants/EnemyRarity.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Construct.d.ts +63 -0
- package/dist/constants/EnemyTemplates/Construct.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Dragon.d.ts +68 -0
- package/dist/constants/EnemyTemplates/Dragon.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Elemental.d.ts +64 -0
- package/dist/constants/EnemyTemplates/Elemental.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Fiend.d.ts +62 -0
- package/dist/constants/EnemyTemplates/Fiend.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Monstrosity.d.ts +63 -0
- package/dist/constants/EnemyTemplates/Monstrosity.d.ts.map +1 -0
- package/dist/constants/EnemyTemplates/Undead.d.ts +61 -0
- package/dist/constants/EnemyTemplates/Undead.d.ts.map +1 -0
- package/dist/constants/ItemTemplates.d.ts +40 -0
- package/dist/constants/ItemTemplates.d.ts.map +1 -0
- package/dist/constants/MagicItems.d.ts +30 -0
- package/dist/constants/MagicItems.d.ts.map +1 -0
- package/dist/constants/SpellSlots.d.ts +30 -0
- package/dist/constants/SpellSlots.d.ts.map +1 -0
- package/dist/constants/StatScaling.d.ts +113 -0
- package/dist/constants/StatScaling.d.ts.map +1 -0
- package/dist/core/analysis/AudioAnalyzer.d.ts +599 -0
- package/dist/core/analysis/AudioAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/ColorExtractor.d.ts +64 -0
- package/dist/core/analysis/ColorExtractor.d.ts.map +1 -0
- package/dist/core/analysis/EssentiaPitchDetector.d.ts +282 -0
- package/dist/core/analysis/EssentiaPitchDetector.d.ts.map +1 -0
- package/dist/core/analysis/LevelSerializer.d.ts +265 -0
- package/dist/core/analysis/LevelSerializer.d.ts.map +1 -0
- package/dist/core/analysis/MelodyContourAnalyzer.d.ts +283 -0
- package/dist/core/analysis/MelodyContourAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/MultiBandAnalyzer.d.ts +214 -0
- package/dist/core/analysis/MultiBandAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/MusicClassifier.d.ts +524 -0
- package/dist/core/analysis/MusicClassifier.d.ts.map +1 -0
- package/dist/core/analysis/PitchAnalyzer.d.ts +266 -0
- package/dist/core/analysis/PitchAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/PitchDetector.d.ts +251 -0
- package/dist/core/analysis/PitchDetector.d.ts.map +1 -0
- package/dist/core/analysis/SpectrumScanner.d.ts +52 -0
- package/dist/core/analysis/SpectrumScanner.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatInterpolator.d.ts +477 -0
- package/dist/core/analysis/beat/BeatInterpolator.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatMapGenerator.d.ts +170 -0
- package/dist/core/analysis/beat/BeatMapGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatStream.d.ts +316 -0
- package/dist/core/analysis/beat/BeatStream.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatSubdivider.d.ts +205 -0
- package/dist/core/analysis/beat/BeatSubdivider.d.ts.map +1 -0
- package/dist/core/analysis/beat/BeatTracker.d.ts +137 -0
- package/dist/core/analysis/beat/BeatTracker.d.ts.map +1 -0
- package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts +180 -0
- package/dist/core/analysis/beat/CompositeStreamGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/DensityAnalyzer.d.ts +246 -0
- package/dist/core/analysis/beat/DensityAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts +1082 -0
- package/dist/core/analysis/beat/DifficultyVariantGenerator.d.ts.map +1 -0
- package/dist/core/analysis/beat/GrooveAnalyzer.d.ts +192 -0
- package/dist/core/analysis/beat/GrooveAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts +133 -0
- package/dist/core/analysis/beat/OnsetStrengthEnvelope.d.ts.map +1 -0
- package/dist/core/analysis/beat/PhraseAnalyzer.d.ts +230 -0
- package/dist/core/analysis/beat/PhraseAnalyzer.d.ts.map +1 -0
- package/dist/core/analysis/beat/RhythmQuantizer.d.ts +399 -0
- package/dist/core/analysis/beat/RhythmQuantizer.d.ts.map +1 -0
- package/dist/core/analysis/beat/RhythmicBalancer.d.ts +262 -0
- package/dist/core/analysis/beat/RhythmicBalancer.d.ts.map +1 -0
- package/dist/core/analysis/beat/StreamScorer.d.ts +275 -0
- package/dist/core/analysis/beat/StreamScorer.d.ts.map +1 -0
- package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts +256 -0
- package/dist/core/analysis/beat/TempoAwareQuantizer.d.ts.map +1 -0
- package/dist/core/analysis/beat/TempoDetector.d.ts +220 -0
- package/dist/core/analysis/beat/TempoDetector.d.ts.map +1 -0
- package/dist/core/analysis/beat/TransientDetector.d.ts +303 -0
- package/dist/core/analysis/beat/TransientDetector.d.ts.map +1 -0
- package/dist/core/analysis/beat/beatKeyHelpers.d.ts +180 -0
- package/dist/core/analysis/beat/beatKeyHelpers.d.ts.map +1 -0
- package/dist/core/analysis/beat/index.d.ts +41 -0
- package/dist/core/analysis/beat/index.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/audioUtils.d.ts +204 -0
- package/dist/core/analysis/beat/utils/audioUtils.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts +404 -0
- package/dist/core/analysis/beat/utils/beatInterpolationDebug.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts +61 -0
- package/dist/core/analysis/beat/utils/subdivideBeatMap.d.ts.map +1 -0
- package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts +33 -0
- package/dist/core/analysis/beat/utils/unifyBeatMap.d.ts.map +1 -0
- package/dist/core/analysis/index.d.ts +18 -0
- package/dist/core/analysis/index.d.ts.map +1 -0
- package/dist/core/combat/AI/AICombatRunner.d.ts +108 -0
- package/dist/core/combat/AI/AICombatRunner.d.ts.map +1 -0
- package/dist/core/combat/AI/CombatAI.d.ts +179 -0
- package/dist/core/combat/AI/CombatAI.d.ts.map +1 -0
- package/dist/core/combat/AI/CombatMetricsTracker.d.ts +30 -0
- package/dist/core/combat/AI/CombatMetricsTracker.d.ts.map +1 -0
- package/dist/core/combat/Analysis/BalanceValidator.d.ts +170 -0
- package/dist/core/combat/Analysis/BalanceValidator.d.ts.map +1 -0
- package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts +231 -0
- package/dist/core/combat/Analysis/ComparativeAnalyzer.d.ts.map +1 -0
- package/dist/core/combat/Analysis/DifficultyCalculator.d.ts +203 -0
- package/dist/core/combat/Analysis/DifficultyCalculator.d.ts.map +1 -0
- package/dist/core/combat/Analysis/ParameterSweep.d.ts +201 -0
- package/dist/core/combat/Analysis/ParameterSweep.d.ts.map +1 -0
- package/dist/core/combat/AttackResolver.d.ts +220 -0
- package/dist/core/combat/AttackResolver.d.ts.map +1 -0
- package/dist/core/combat/CombatEngine.d.ts +388 -0
- package/dist/core/combat/CombatEngine.d.ts.map +1 -0
- package/dist/core/combat/DiceRoller.d.ts +115 -0
- package/dist/core/combat/DiceRoller.d.ts.map +1 -0
- package/dist/core/combat/InitiativeRoller.d.ts +62 -0
- package/dist/core/combat/InitiativeRoller.d.ts.map +1 -0
- package/dist/core/combat/PartyAnalyzer.d.ts +215 -0
- package/dist/core/combat/PartyAnalyzer.d.ts.map +1 -0
- package/dist/core/combat/SeededDiceRoller.d.ts +120 -0
- package/dist/core/combat/SeededDiceRoller.d.ts.map +1 -0
- package/dist/core/combat/Simulation/CombatSimulator.d.ts +366 -0
- package/dist/core/combat/Simulation/CombatSimulator.d.ts.map +1 -0
- package/dist/core/combat/SpellCaster.d.ts +113 -0
- package/dist/core/combat/SpellCaster.d.ts.map +1 -0
- package/dist/core/config/index.d.ts +24 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/progressionConfig.d.ts +73 -0
- package/dist/core/config/progressionConfig.d.ts.map +1 -0
- package/dist/core/config/sensorConfig.d.ts +134 -0
- package/dist/core/config/sensorConfig.d.ts.map +1 -0
- package/dist/core/equipment/BoxOpener.d.ts +175 -0
- package/dist/core/equipment/BoxOpener.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentEffectApplier.d.ts +189 -0
- package/dist/core/equipment/EquipmentEffectApplier.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentModifier.d.ts +327 -0
- package/dist/core/equipment/EquipmentModifier.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentSpawnHelper.d.ts +246 -0
- package/dist/core/equipment/EquipmentSpawnHelper.d.ts.map +1 -0
- package/dist/core/equipment/EquipmentValidator.d.ts +173 -0
- package/dist/core/equipment/EquipmentValidator.d.ts.map +1 -0
- package/dist/core/extensions/ExtensionManager.d.ts +517 -0
- package/dist/core/extensions/ExtensionManager.d.ts.map +1 -0
- package/dist/core/extensions/WeightedSelector.d.ts +156 -0
- package/dist/core/extensions/WeightedSelector.d.ts.map +1 -0
- package/dist/core/extensions/index.d.ts +11 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/initializeDefaults.d.ts +170 -0
- package/dist/core/extensions/initializeDefaults.d.ts.map +1 -0
- package/dist/core/features/FeatureEffectApplier.d.ts +102 -0
- package/dist/core/features/FeatureEffectApplier.d.ts.map +1 -0
- package/dist/core/features/FeatureQuery.d.ts +368 -0
- package/dist/core/features/FeatureQuery.d.ts.map +1 -0
- package/dist/core/features/FeatureTypes.d.ts +199 -0
- package/dist/core/features/FeatureTypes.d.ts.map +1 -0
- package/dist/core/features/FeatureValidator.d.ts +149 -0
- package/dist/core/features/FeatureValidator.d.ts.map +1 -0
- package/dist/core/features/index.d.ts +12 -0
- package/dist/core/features/index.d.ts.map +1 -0
- package/dist/core/generation/AbilityScoreCalculator.d.ts +83 -0
- package/dist/core/generation/AbilityScoreCalculator.d.ts.map +1 -0
- package/dist/core/generation/AppearanceGenerator.d.ts +32 -0
- package/dist/core/generation/AppearanceGenerator.d.ts.map +1 -0
- package/dist/core/generation/BeatConverter.d.ts +127 -0
- package/dist/core/generation/BeatConverter.d.ts.map +1 -0
- package/dist/core/generation/ButtonMapper.d.ts +346 -0
- package/dist/core/generation/ButtonMapper.d.ts.map +1 -0
- package/dist/core/generation/ButtonPatternLibrary.d.ts +92 -0
- package/dist/core/generation/ButtonPatternLibrary.d.ts.map +1 -0
- package/dist/core/generation/CRLevelConverter.d.ts +242 -0
- package/dist/core/generation/CRLevelConverter.d.ts.map +1 -0
- package/dist/core/generation/CharacterGenerator.d.ts +194 -0
- package/dist/core/generation/CharacterGenerator.d.ts.map +1 -0
- package/dist/core/generation/ClassSuggester.d.ts +184 -0
- package/dist/core/generation/ClassSuggester.d.ts.map +1 -0
- package/dist/core/generation/EnemyEquipmentGenerator.d.ts +151 -0
- package/dist/core/generation/EnemyEquipmentGenerator.d.ts.map +1 -0
- package/dist/core/generation/EnemyGenerator.d.ts +595 -0
- package/dist/core/generation/EnemyGenerator.d.ts.map +1 -0
- package/dist/core/generation/EquipmentGenerator.d.ts +204 -0
- package/dist/core/generation/EquipmentGenerator.d.ts.map +1 -0
- package/dist/core/generation/LegendaryGenerator.d.ts +213 -0
- package/dist/core/generation/LegendaryGenerator.d.ts.map +1 -0
- package/dist/core/generation/LevelGenerator.d.ts +390 -0
- package/dist/core/generation/LevelGenerator.d.ts.map +1 -0
- package/dist/core/generation/NamingEngine.d.ts +136 -0
- package/dist/core/generation/NamingEngine.d.ts.map +1 -0
- package/dist/core/generation/PitchBeatLinker.d.ts +150 -0
- package/dist/core/generation/PitchBeatLinker.d.ts.map +1 -0
- package/dist/core/generation/RaceSelector.d.ts +58 -0
- package/dist/core/generation/RaceSelector.d.ts.map +1 -0
- package/dist/core/generation/RhythmGenerator.d.ts +597 -0
- package/dist/core/generation/RhythmGenerator.d.ts.map +1 -0
- package/dist/core/generation/SkillAssigner.d.ts +78 -0
- package/dist/core/generation/SkillAssigner.d.ts.map +1 -0
- package/dist/core/generation/SpellManager.d.ts +132 -0
- package/dist/core/generation/SpellManager.d.ts.map +1 -0
- package/dist/core/generation/SpellcastingGenerator.d.ts +255 -0
- package/dist/core/generation/SpellcastingGenerator.d.ts.map +1 -0
- package/dist/core/generation/index.d.ts +41 -0
- package/dist/core/generation/index.d.ts.map +1 -0
- package/dist/core/parser/MetadataExtractor.d.ts +66 -0
- package/dist/core/parser/MetadataExtractor.d.ts.map +1 -0
- package/dist/core/parser/PlaylistParser.d.ts +45 -0
- package/dist/core/parser/PlaylistParser.d.ts.map +1 -0
- package/dist/core/playback/SubdivisionPlaybackController.d.ts +333 -0
- package/dist/core/playback/SubdivisionPlaybackController.d.ts.map +1 -0
- package/dist/core/playback/index.d.ts +5 -0
- package/dist/core/playback/index.d.ts.map +1 -0
- package/dist/core/progression/CharacterUpdater.d.ts +203 -0
- package/dist/core/progression/CharacterUpdater.d.ts.map +1 -0
- package/dist/core/progression/LevelUpProcessor.d.ts +234 -0
- package/dist/core/progression/LevelUpProcessor.d.ts.map +1 -0
- package/dist/core/progression/PrestigeSystem.d.ts +217 -0
- package/dist/core/progression/PrestigeSystem.d.ts.map +1 -0
- package/dist/core/progression/RhythmXPCalculator.d.ts +182 -0
- package/dist/core/progression/RhythmXPCalculator.d.ts.map +1 -0
- package/dist/core/progression/SessionTracker.d.ts +169 -0
- package/dist/core/progression/SessionTracker.d.ts.map +1 -0
- package/dist/core/progression/XPCalculator.d.ts +128 -0
- package/dist/core/progression/XPCalculator.d.ts.map +1 -0
- package/dist/core/progression/stat/StatIncreaseStrategy.d.ts +97 -0
- package/dist/core/progression/stat/StatIncreaseStrategy.d.ts.map +1 -0
- package/dist/core/progression/stat/StatManager.d.ts +179 -0
- package/dist/core/progression/stat/StatManager.d.ts.map +1 -0
- package/dist/core/sensors/EnvironmentalSensors.d.ts +301 -0
- package/dist/core/sensors/EnvironmentalSensors.d.ts.map +1 -0
- package/dist/core/sensors/GamingPlatformSensors.d.ts +162 -0
- package/dist/core/sensors/GamingPlatformSensors.d.ts.map +1 -0
- package/dist/core/sensors/GeolocationProvider.d.ts +156 -0
- package/dist/core/sensors/GeolocationProvider.d.ts.map +1 -0
- package/dist/core/sensors/MotionDetector.d.ts +58 -0
- package/dist/core/sensors/MotionDetector.d.ts.map +1 -0
- package/dist/core/sensors/SteamAPIClient.d.ts +108 -0
- package/dist/core/sensors/SteamAPIClient.d.ts.map +1 -0
- package/dist/core/sensors/WeatherAPIClient.d.ts +360 -0
- package/dist/core/sensors/WeatherAPIClient.d.ts.map +1 -0
- package/dist/core/sensors/schemas/weather.schema.d.ts +144 -0
- package/dist/core/sensors/schemas/weather.schema.d.ts.map +1 -0
- package/dist/core/skills/SkillQuery.d.ts +159 -0
- package/dist/core/skills/SkillQuery.d.ts.map +1 -0
- package/dist/core/skills/SkillTypes.d.ts +233 -0
- package/dist/core/skills/SkillTypes.d.ts.map +1 -0
- package/dist/core/skills/SkillValidator.d.ts +146 -0
- package/dist/core/skills/SkillValidator.d.ts.map +1 -0
- package/dist/core/skills/index.d.ts +11 -0
- package/dist/core/skills/index.d.ts.map +1 -0
- package/dist/core/spells/SpellQuery.d.ts +194 -0
- package/dist/core/spells/SpellQuery.d.ts.map +1 -0
- package/dist/core/spells/SpellTypes.d.ts +71 -0
- package/dist/core/spells/SpellTypes.d.ts.map +1 -0
- package/dist/core/spells/SpellValidator.d.ts +129 -0
- package/dist/core/spells/SpellValidator.d.ts.map +1 -0
- package/dist/core/spells/index.d.ts +11 -0
- package/dist/core/spells/index.d.ts.map +1 -0
- package/dist/core/types/AudioProfile.d.ts +143 -0
- package/dist/core/types/AudioProfile.d.ts.map +1 -0
- package/dist/core/types/BeatMap.d.ts +1825 -0
- package/dist/core/types/BeatMap.d.ts.map +1 -0
- package/dist/core/types/ButtonMapping.d.ts +345 -0
- package/dist/core/types/ButtonMapping.d.ts.map +1 -0
- package/dist/core/types/Character.d.ts +397 -0
- package/dist/core/types/Character.d.ts.map +1 -0
- package/dist/core/types/ChartedBeatMap.d.ts +169 -0
- package/dist/core/types/ChartedBeatMap.d.ts.map +1 -0
- package/dist/core/types/Combat.d.ts +268 -0
- package/dist/core/types/Combat.d.ts.map +1 -0
- package/dist/core/types/CombatAI.d.ts +143 -0
- package/dist/core/types/CombatAI.d.ts.map +1 -0
- package/dist/core/types/Enemy.d.ts +447 -0
- package/dist/core/types/Enemy.d.ts.map +1 -0
- package/dist/core/types/Environmental.d.ts +213 -0
- package/dist/core/types/Environmental.d.ts.map +1 -0
- package/dist/core/types/Equipment.d.ts +309 -0
- package/dist/core/types/Equipment.d.ts.map +1 -0
- package/dist/core/types/ISessionTracker.d.ts +48 -0
- package/dist/core/types/ISessionTracker.d.ts.map +1 -0
- package/dist/core/types/LevelExport.d.ts +366 -0
- package/dist/core/types/LevelExport.d.ts.map +1 -0
- package/dist/core/types/Playlist.d.ts +70 -0
- package/dist/core/types/Playlist.d.ts.map +1 -0
- package/dist/core/types/Prestige.d.ts +94 -0
- package/dist/core/types/Prestige.d.ts.map +1 -0
- package/dist/core/types/Progression.d.ts +214 -0
- package/dist/core/types/Progression.d.ts.map +1 -0
- package/dist/core/types/RhythmXP.d.ts +398 -0
- package/dist/core/types/RhythmXP.d.ts.map +1 -0
- package/dist/core/utils/AbilityConstants.d.ts +31 -0
- package/dist/core/utils/AbilityConstants.d.ts.map +1 -0
- package/dist/core/utils/EffectApplierUtils.d.ts +56 -0
- package/dist/core/utils/EffectApplierUtils.d.ts.map +1 -0
- package/dist/core/utils/ImageValidator.d.ts +66 -0
- package/dist/core/utils/ImageValidator.d.ts.map +1 -0
- package/dist/core/utils/PrerequisiteValidator.d.ts +88 -0
- package/dist/core/utils/PrerequisiteValidator.d.ts.map +1 -0
- package/dist/essentia-wasm.es-BUEnKUts.js +2990 -0
- package/dist/essentia.js-model.es-CGA0xotH.js +306 -0
- package/dist/index.d.ts +176 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/playlist-data-engine.js +124 -0
- package/dist/playlist-data-engine.mjs +49251 -0
- package/dist/utils/EnchantmentLibrary.d.ts +378 -0
- package/dist/utils/EnchantmentLibrary.d.ts.map +1 -0
- package/dist/utils/arweaveGatewayManager.d.ts +485 -0
- package/dist/utils/arweaveGatewayManager.d.ts.map +1 -0
- package/dist/utils/arweaveUtils.d.ts +118 -0
- package/dist/utils/arweaveUtils.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +439 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/equipmentConstants.d.ts +60 -0
- package/dist/utils/equipmentConstants.d.ts.map +1 -0
- package/dist/utils/hash.d.ts +33 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +192 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/magicItemExamples.d.ts +46 -0
- package/dist/utils/magicItemExamples.d.ts.map +1 -0
- package/dist/utils/playlistUtils.d.ts +149 -0
- package/dist/utils/playlistUtils.d.ts.map +1 -0
- package/dist/utils/random.d.ts +34 -0
- package/dist/utils/random.d.ts.map +1 -0
- package/dist/utils/sensorDashboard.d.ts +60 -0
- package/dist/utils/sensorDashboard.d.ts.map +1 -0
- package/dist/utils/validators.d.ts +189 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Equipment Validator
|
|
3
|
+
*
|
|
4
|
+
* Validates equipment data structures for the Advanced Equipment System.
|
|
5
|
+
* Checks equipment properties, feature/skill references, damage info,
|
|
6
|
+
* spawn weights, and modification structures.
|
|
7
|
+
*/
|
|
8
|
+
import type { EnhancedEquipment, EquipmentProperty, EquipmentCondition, EquipmentModification, EquipmentMiniFeature, EquipmentValidationResult, BoxContents, BoxOpenRequirement } from '../types/Equipment.js';
|
|
9
|
+
/**
|
|
10
|
+
* EquipmentValidator - Validates equipment data structures
|
|
11
|
+
*
|
|
12
|
+
* This class provides static methods for validating:
|
|
13
|
+
* - Complete equipment objects
|
|
14
|
+
* - Individual equipment properties
|
|
15
|
+
* - Feature references (checks FeatureQuery)
|
|
16
|
+
* - Skill references (checks SkillQuery)
|
|
17
|
+
* - Damage information
|
|
18
|
+
* - Spawn weights
|
|
19
|
+
* - Equipment modifications
|
|
20
|
+
*/
|
|
21
|
+
export declare class EquipmentValidator {
|
|
22
|
+
/**
|
|
23
|
+
* Validate a complete equipment object
|
|
24
|
+
*
|
|
25
|
+
* Supports both legacy Equipment format and EnhancedEquipment format.
|
|
26
|
+
* Legacy format may have: damage as string, armor_class instead of acBonus, no source field
|
|
27
|
+
* Enhanced format has: damage as object, acBonus, source field
|
|
28
|
+
*
|
|
29
|
+
* @param equipment - Equipment to validate (any format)
|
|
30
|
+
* @returns Validation result with any errors
|
|
31
|
+
*/
|
|
32
|
+
static validateEquipment(equipment: any): EquipmentValidationResult;
|
|
33
|
+
/**
|
|
34
|
+
* Validate a single equipment property
|
|
35
|
+
*
|
|
36
|
+
* @param property - Property to validate
|
|
37
|
+
* @returns Validation result with any errors
|
|
38
|
+
*/
|
|
39
|
+
static validateProperty(property: EquipmentProperty): EquipmentValidationResult;
|
|
40
|
+
/**
|
|
41
|
+
* Validate a property value based on its type
|
|
42
|
+
*/
|
|
43
|
+
private static validatePropertyValue;
|
|
44
|
+
/**
|
|
45
|
+
* Validate an equipment condition
|
|
46
|
+
*
|
|
47
|
+
* @param condition - Condition to validate
|
|
48
|
+
* @returns Validation result with any errors
|
|
49
|
+
*/
|
|
50
|
+
static validateCondition(condition: EquipmentCondition): EquipmentValidationResult;
|
|
51
|
+
/**
|
|
52
|
+
* Validate an equipment feature reference
|
|
53
|
+
*
|
|
54
|
+
* Checks if string references exist in FeatureQuery or if inline
|
|
55
|
+
* mini-features are properly structured.
|
|
56
|
+
*
|
|
57
|
+
* @param featureRef - Feature reference (string ID or mini-feature object)
|
|
58
|
+
* @param index - Index in the grantsFeatures array (for error messages)
|
|
59
|
+
* @returns Validation result with any errors
|
|
60
|
+
*/
|
|
61
|
+
static validateFeatureReference(featureRef: string | EquipmentMiniFeature, index: number): EquipmentValidationResult;
|
|
62
|
+
/**
|
|
63
|
+
* Validate if a feature ID exists in the FeatureQuery
|
|
64
|
+
*
|
|
65
|
+
* Convenience method for checking single feature references.
|
|
66
|
+
*
|
|
67
|
+
* @param featureId - Feature ID to validate
|
|
68
|
+
* @returns True if feature exists in registry
|
|
69
|
+
*/
|
|
70
|
+
static validateEquipmentFeatureReference(featureId: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Validate an equipment skill reference
|
|
73
|
+
*
|
|
74
|
+
* Checks if the skill ID exists in SkillQuery.
|
|
75
|
+
*
|
|
76
|
+
* @param skillId - Skill ID to validate
|
|
77
|
+
* @param index - Index in the grantsSkills array (for error messages)
|
|
78
|
+
* @returns Validation result with any errors
|
|
79
|
+
*/
|
|
80
|
+
static validateSkillReference(skillId: string, index?: number): EquipmentValidationResult;
|
|
81
|
+
/**
|
|
82
|
+
* Validate if a skill ID exists in the SkillQuery
|
|
83
|
+
*
|
|
84
|
+
* Convenience method for checking single skill references.
|
|
85
|
+
*
|
|
86
|
+
* @param skillId - Skill ID to validate
|
|
87
|
+
* @returns True if skill exists in registry
|
|
88
|
+
*/
|
|
89
|
+
static validateEquipmentSkillReference(skillId: string): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Validate damage information
|
|
92
|
+
*
|
|
93
|
+
* Supports both string format (legacy) and object format (EnhancedEquipment).
|
|
94
|
+
* String format: "1d8 slashing"
|
|
95
|
+
* Object format: { dice: "1d8", damageType: "slashing", versatile?: "1d10" }
|
|
96
|
+
*
|
|
97
|
+
* @param damage - Damage object or string to validate
|
|
98
|
+
* @returns Validation result with any errors
|
|
99
|
+
*/
|
|
100
|
+
static validateDamageInfo(damage: EnhancedEquipment['damage'] | string): EquipmentValidationResult;
|
|
101
|
+
/**
|
|
102
|
+
* Validate spawn weight
|
|
103
|
+
*
|
|
104
|
+
* Spawn weights must be non-negative numbers. A weight of 0 means
|
|
105
|
+
* the item will never be randomly generated but can still be used
|
|
106
|
+
* by game logic.
|
|
107
|
+
*
|
|
108
|
+
* @param weight - Spawn weight to validate
|
|
109
|
+
* @returns Validation result with any errors
|
|
110
|
+
*/
|
|
111
|
+
static validateSpawnWeight(weight: number): EquipmentValidationResult;
|
|
112
|
+
/**
|
|
113
|
+
* Validate box contents configuration
|
|
114
|
+
*
|
|
115
|
+
* Validates the boxContents property for box-type equipment:
|
|
116
|
+
* - drops must be an array
|
|
117
|
+
* - each drop must have a non-empty pool array
|
|
118
|
+
* - each pool entry must have a valid weight
|
|
119
|
+
* - each pool entry must have either itemName or gold (not both)
|
|
120
|
+
* - pool weights should sum to 100 (warns but does not fail)
|
|
121
|
+
* - itemName references must exist in the equipment registry
|
|
122
|
+
*
|
|
123
|
+
* @param boxContents - BoxContents object to validate
|
|
124
|
+
* @returns Validation result with any errors
|
|
125
|
+
*/
|
|
126
|
+
static validateBoxContents(boxContents: BoxContents): EquipmentValidationResult;
|
|
127
|
+
/**
|
|
128
|
+
* Validate a box open requirement
|
|
129
|
+
*
|
|
130
|
+
* Validates individual requirements for opening a box:
|
|
131
|
+
* - itemName must be a non-empty string (required)
|
|
132
|
+
* - itemName must exist in the equipment registry
|
|
133
|
+
* - quantity must be a positive integer if present (default: 1)
|
|
134
|
+
*
|
|
135
|
+
* @param requirement - BoxOpenRequirement object to validate
|
|
136
|
+
* @returns Validation result with any errors
|
|
137
|
+
*/
|
|
138
|
+
static validateBoxOpenRequirement(requirement: BoxOpenRequirement): EquipmentValidationResult;
|
|
139
|
+
/**
|
|
140
|
+
* Validate an equipment modification
|
|
141
|
+
*
|
|
142
|
+
* Modifications are applied to equipment at runtime for enchanting,
|
|
143
|
+
* cursing, or upgrading items.
|
|
144
|
+
*
|
|
145
|
+
* @param modification - Modification to validate
|
|
146
|
+
* @returns Validation result with any errors
|
|
147
|
+
*/
|
|
148
|
+
static validateModification(modification: EquipmentModification): EquipmentValidationResult;
|
|
149
|
+
/**
|
|
150
|
+
* Validate an equipment mini-feature
|
|
151
|
+
*
|
|
152
|
+
* Mini-features are inline feature definitions for equipment-specific abilities.
|
|
153
|
+
*
|
|
154
|
+
* @param miniFeature - Mini-feature to validate
|
|
155
|
+
* @returns Validation result with any errors
|
|
156
|
+
*/
|
|
157
|
+
static validateMiniFeature(miniFeature: EquipmentMiniFeature): EquipmentValidationResult;
|
|
158
|
+
/**
|
|
159
|
+
* Validate AC bonus value
|
|
160
|
+
*
|
|
161
|
+
* @param acBonus - AC bonus to validate
|
|
162
|
+
* @returns Validation result with any errors
|
|
163
|
+
*/
|
|
164
|
+
static validateACBonus(acBonus: number): EquipmentValidationResult;
|
|
165
|
+
/**
|
|
166
|
+
* Validate weapon properties array
|
|
167
|
+
*
|
|
168
|
+
* @param weaponProperties - Weapon properties to validate
|
|
169
|
+
* @returns Validation result with any errors
|
|
170
|
+
*/
|
|
171
|
+
static validateWeaponProperties(weaponProperties: string[]): EquipmentValidationResult;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=EquipmentValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EquipmentValidator.d.ts","sourceRoot":"","sources":["../../../src/core/equipment/EquipmentValidator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACR,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,WAAW,EACX,kBAAkB,EACrB,MAAM,uBAAuB,CAAC;AA2E/B;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;IAC3B;;;;;;;;;OASG;IACH,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,GAAG,GAAG,yBAAyB;IAkKnE;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,yBAAyB;IAqD/E;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAuGpC;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,GAAG,yBAAyB;IAyDlF;;;;;;;;;OASG;IACH,MAAM,CAAC,wBAAwB,CAC3B,UAAU,EAAE,MAAM,GAAG,oBAAoB,EACzC,KAAK,EAAE,MAAM,GACd,yBAAyB;IAyD5B;;;;;;;OAOG;IACH,MAAM,CAAC,iCAAiC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAOpE;;;;;;;;OAQG;IACH,MAAM,CAAC,sBAAsB,CACzB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,GACf,yBAAyB;IAsB5B;;;;;;;OAOG;IACH,MAAM,CAAC,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIhE;;;;;;;;;OASG;IACH,MAAM,CAAC,kBAAkB,CACrB,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GAAG,MAAM,GAC7C,yBAAyB;IAmD5B;;;;;;;;;OASG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,yBAAyB;IAiBrE;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,yBAAyB;IA6G/E;;;;;;;;;;OAUG;IACH,MAAM,CAAC,0BAA0B,CAAC,WAAW,EAAE,kBAAkB,GAAG,yBAAyB;IAkC7F;;;;;;;;OAQG;IACH,MAAM,CAAC,oBAAoB,CAAC,YAAY,EAAE,qBAAqB,GAAG,yBAAyB;IAoF3F;;;;;;;OAOG;IACH,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,oBAAoB,GAAG,yBAAyB;IAsCxF;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB;IAiBlE;;;;;OAKG;IACH,MAAM,CAAC,wBAAwB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,yBAAyB;CAuCzF"}
|
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ExtensionManager - Core extensibility system for the Playlist Data Engine
|
|
3
|
+
*
|
|
4
|
+
* Provides runtime customization of ALL procedural generation lists with spawn rate control.
|
|
5
|
+
*
|
|
6
|
+
* Design Principles:
|
|
7
|
+
* - Hybrid spawn rates: Support both relative weights (added to pool) and absolute weights (replace distribution)
|
|
8
|
+
* - Runtime only: Custom data provided each session; characters save with custom items already included
|
|
9
|
+
* - Strict validation: Reject invalid data with clear errors
|
|
10
|
+
* - Consistent API: Same function pattern across all categories
|
|
11
|
+
* - Per-category spawn rates: Each expansion pack includes its own spawn rate weights for its content
|
|
12
|
+
*
|
|
13
|
+
* @module extensions/ExtensionManager
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Spawn modes for custom content
|
|
17
|
+
* - 'relative': Add custom weights to default weights (default)
|
|
18
|
+
* - 'absolute': Replace default weights entirely
|
|
19
|
+
* - 'default': Use default weights (1.0 for all items)
|
|
20
|
+
* - 'replace': Replace default items with custom items only
|
|
21
|
+
*/
|
|
22
|
+
export type SpawnMode = 'relative' | 'absolute' | 'default' | 'replace';
|
|
23
|
+
/**
|
|
24
|
+
* All extensible categories in the system
|
|
25
|
+
*/
|
|
26
|
+
export type ExtensionCategory = 'equipment' | 'equipment.templates' | 'appearance.bodyTypes' | 'appearance.skinTones' | 'appearance.hairColors' | 'appearance.hairStyles' | 'appearance.eyeColors' | 'appearance.facialFeatures' | 'spells' | 'races' | 'races.data' | 'classes' | 'classes.data' | `spells.${string}` | 'classFeatures' | 'classFeatures.Barbarian' | 'classFeatures.Bard' | 'classFeatures.Cleric' | 'classFeatures.Druid' | 'classFeatures.Fighter' | 'classFeatures.Monk' | 'classFeatures.Paladin' | 'classFeatures.Ranger' | 'classFeatures.Rogue' | 'classFeatures.Sorcerer' | 'classFeatures.Warlock' | 'classFeatures.Wizard' | `classFeatures.${string}` | 'racialTraits' | 'racialTraits.Human' | 'racialTraits.Elf' | 'racialTraits.Dwarf' | 'racialTraits.Halfling' | 'racialTraits.Dragonborn' | 'racialTraits.Gnome' | 'racialTraits.Half-Elf' | 'racialTraits.Half-Orc' | 'racialTraits.Tiefling' | `racialTraits.${string}` | 'skills' | 'skills.STR' | 'skills.DEX' | 'skills.CON' | 'skills.INT' | 'skills.WIS' | 'skills.CHA' | 'skillLists' | 'skillLists.Barbarian' | 'skillLists.Bard' | 'skillLists.Cleric' | 'skillLists.Druid' | 'skillLists.Fighter' | 'skillLists.Monk' | 'skillLists.Paladin' | 'skillLists.Ranger' | 'skillLists.Rogue' | 'skillLists.Sorcerer' | 'skillLists.Warlock' | 'skillLists.Wizard' | `skillLists.${string}` | 'classSpellLists' | `classSpellLists.${string}` | 'classSpellSlots' | 'classStartingEquipment' | `classStartingEquipment.${string}`;
|
|
27
|
+
/**
|
|
28
|
+
* Categories that support icon and image fields
|
|
29
|
+
* These entity types have optional icon and image URL properties
|
|
30
|
+
*/
|
|
31
|
+
export type ImageSupportedCategory = 'spells' | 'skills' | 'classFeatures' | 'racialTraits' | 'equipment' | 'races.data' | 'classes.data';
|
|
32
|
+
/**
|
|
33
|
+
* Options for registering custom data
|
|
34
|
+
*/
|
|
35
|
+
export interface ExtensionOptions {
|
|
36
|
+
/**
|
|
37
|
+
* Spawn mode for this extension
|
|
38
|
+
* - 'relative': Add custom weights to default weights (default)
|
|
39
|
+
* - 'absolute': Replace default weights entirely
|
|
40
|
+
* - 'default': Use default weights (1.0 for all items)
|
|
41
|
+
* - 'replace': Replace default items with custom items only
|
|
42
|
+
*/
|
|
43
|
+
mode?: SpawnMode;
|
|
44
|
+
/**
|
|
45
|
+
* Custom spawn weights for individual items
|
|
46
|
+
* Item name -> weight multiplier (1.0 = default, 2.0 = twice as likely, 0 = never spawns)
|
|
47
|
+
*/
|
|
48
|
+
weights?: Record<string, number>;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to validate items before registration
|
|
51
|
+
* @default true
|
|
52
|
+
*/
|
|
53
|
+
validate?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Entry for registering multiple extensions at once
|
|
57
|
+
*/
|
|
58
|
+
export interface RegistrationEntry {
|
|
59
|
+
/**
|
|
60
|
+
* The category to register items for
|
|
61
|
+
*/
|
|
62
|
+
category: ExtensionCategory;
|
|
63
|
+
/**
|
|
64
|
+
* Custom items to add
|
|
65
|
+
*/
|
|
66
|
+
items: any[];
|
|
67
|
+
/**
|
|
68
|
+
* Registration options
|
|
69
|
+
*/
|
|
70
|
+
options?: ExtensionOptions;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Image override for a single item
|
|
74
|
+
* Stores only the icon/image fields to be patched onto default items
|
|
75
|
+
*/
|
|
76
|
+
export interface ImageOverride {
|
|
77
|
+
/** Item identifier (id for spells, name for others) */
|
|
78
|
+
identifier: string;
|
|
79
|
+
/** Icon URL */
|
|
80
|
+
icon?: string;
|
|
81
|
+
/** Image URL */
|
|
82
|
+
image?: string;
|
|
83
|
+
/** When this override was applied */
|
|
84
|
+
appliedAt: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Result of validation
|
|
88
|
+
*/
|
|
89
|
+
export interface ValidationResult {
|
|
90
|
+
/**
|
|
91
|
+
* Whether validation passed
|
|
92
|
+
*/
|
|
93
|
+
valid: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Error messages (undefined if valid)
|
|
96
|
+
*/
|
|
97
|
+
errors?: string[];
|
|
98
|
+
/**
|
|
99
|
+
* Warning messages for non-critical issues
|
|
100
|
+
*/
|
|
101
|
+
warnings?: string[];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Content pack data exported from ExtensionManager
|
|
105
|
+
*
|
|
106
|
+
* This type represents the structure of data returned by `exportCustomData()`.
|
|
107
|
+
* It can be used to save, load, and share custom content packs.
|
|
108
|
+
*/
|
|
109
|
+
export interface ContentPackData {
|
|
110
|
+
/**
|
|
111
|
+
* All registered extensions by category
|
|
112
|
+
* Each category contains items, options, and registration timestamp
|
|
113
|
+
*/
|
|
114
|
+
extensions: Record<string, {
|
|
115
|
+
items: any[];
|
|
116
|
+
options: ExtensionOptions;
|
|
117
|
+
registeredAt: number;
|
|
118
|
+
}>;
|
|
119
|
+
/**
|
|
120
|
+
* Custom spawn weights for each category
|
|
121
|
+
* Item name -> weight multiplier
|
|
122
|
+
*/
|
|
123
|
+
weights: Record<string, Record<string, number>>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* ExtensionManager - Singleton class for managing runtime extensions
|
|
127
|
+
*
|
|
128
|
+
* Manages custom data for all procedural generation categories with:
|
|
129
|
+
* - Default data initialization
|
|
130
|
+
* - Custom data registration
|
|
131
|
+
* - Weight management
|
|
132
|
+
* - Merged data retrieval
|
|
133
|
+
* - Reset functionality
|
|
134
|
+
*/
|
|
135
|
+
export declare class ExtensionManager {
|
|
136
|
+
private static instance;
|
|
137
|
+
private defaultData;
|
|
138
|
+
private extensions;
|
|
139
|
+
private customWeights;
|
|
140
|
+
/**
|
|
141
|
+
* Image overrides per category - stores patches for icon/image fields only
|
|
142
|
+
* Key: category, Value: Map of identifier -> ImageOverride
|
|
143
|
+
*/
|
|
144
|
+
private imageOverrides;
|
|
145
|
+
private constructor();
|
|
146
|
+
/**
|
|
147
|
+
* Get the singleton instance
|
|
148
|
+
*/
|
|
149
|
+
static getInstance(): ExtensionManager;
|
|
150
|
+
/**
|
|
151
|
+
* Initialize default data for a category
|
|
152
|
+
* @param category - The category to initialize
|
|
153
|
+
* @param data - The default data array
|
|
154
|
+
*/
|
|
155
|
+
initializeDefaults(category: ExtensionCategory, data: any[]): void;
|
|
156
|
+
/**
|
|
157
|
+
* Initialize all default data from constants
|
|
158
|
+
*/
|
|
159
|
+
initializeAllDefaults(data: Record<string, any[]>): void;
|
|
160
|
+
/**
|
|
161
|
+
* Register custom data for a category
|
|
162
|
+
* @param category - The category to extend
|
|
163
|
+
* @param items - Custom items to add
|
|
164
|
+
* @param options - Registration options
|
|
165
|
+
*/
|
|
166
|
+
register(category: ExtensionCategory, items: any[], options?: ExtensionOptions): void;
|
|
167
|
+
/**
|
|
168
|
+
* Register multiple categories in a single call
|
|
169
|
+
* @param registrations - Array of registration entries
|
|
170
|
+
*/
|
|
171
|
+
registerMultiple(registrations: RegistrationEntry[]): void;
|
|
172
|
+
/**
|
|
173
|
+
* Get merged data (defaults + custom) for a category
|
|
174
|
+
* @param category - The category to get data for
|
|
175
|
+
* @returns Merged array of default and custom items
|
|
176
|
+
*/
|
|
177
|
+
get(category: ExtensionCategory): any[];
|
|
178
|
+
/**
|
|
179
|
+
* Check if a category supports image fields
|
|
180
|
+
*/
|
|
181
|
+
private isImageSupportedCategory;
|
|
182
|
+
/**
|
|
183
|
+
* Apply image overrides to items
|
|
184
|
+
* Patches icon/image fields onto items based on stored overrides
|
|
185
|
+
*/
|
|
186
|
+
private applyImageOverrides;
|
|
187
|
+
/**
|
|
188
|
+
* Get default data only (no custom items)
|
|
189
|
+
* @param category - The category to get defaults for
|
|
190
|
+
* @returns Default items only
|
|
191
|
+
*/
|
|
192
|
+
getDefaults(category: ExtensionCategory): any[];
|
|
193
|
+
/**
|
|
194
|
+
* Get custom items only (no defaults)
|
|
195
|
+
* @param category - The category to get custom items for
|
|
196
|
+
* @returns Custom items only
|
|
197
|
+
*/
|
|
198
|
+
getCustom(category: ExtensionCategory): any[];
|
|
199
|
+
/**
|
|
200
|
+
* Set spawn weights for a category
|
|
201
|
+
* @param category - The category to set weights for
|
|
202
|
+
* @param weights - Record of item name to weight multiplier
|
|
203
|
+
*/
|
|
204
|
+
setWeights(category: ExtensionCategory, weights: Record<string, number>): void;
|
|
205
|
+
/**
|
|
206
|
+
* Get spawn weights for a category
|
|
207
|
+
* @param category - The category to get weights for
|
|
208
|
+
* @returns Combined default and custom weights (all items have weights)
|
|
209
|
+
*/
|
|
210
|
+
getWeights(category: ExtensionCategory): Record<string, number>;
|
|
211
|
+
/**
|
|
212
|
+
* Get default weights for a category (all 1.0)
|
|
213
|
+
* @param category - The category to get default weights for
|
|
214
|
+
* @returns Default weights (all items have weight 1.0)
|
|
215
|
+
*/
|
|
216
|
+
getDefaultWeights(category: ExtensionCategory): Record<string, number>;
|
|
217
|
+
/**
|
|
218
|
+
* Check if a category has custom data registered
|
|
219
|
+
* @param category - The category to check
|
|
220
|
+
* @returns true if custom data is registered
|
|
221
|
+
*/
|
|
222
|
+
hasCustomData(category: ExtensionCategory): boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Set the registration mode for a category
|
|
225
|
+
* @param category - The category to set mode for
|
|
226
|
+
* @param mode - The spawn mode to set
|
|
227
|
+
*/
|
|
228
|
+
setMode(category: ExtensionCategory, mode: SpawnMode): void;
|
|
229
|
+
/**
|
|
230
|
+
* Get the registration mode for a category
|
|
231
|
+
* @param category - The category to check
|
|
232
|
+
* @returns The mode ('relative', 'absolute', 'default', 'replace', or undefined if no custom data)
|
|
233
|
+
*/
|
|
234
|
+
getMode(category: ExtensionCategory): 'relative' | 'absolute' | 'default' | 'replace' | undefined;
|
|
235
|
+
/**
|
|
236
|
+
* Get the registration options for a category
|
|
237
|
+
* @param category - The category to get options for
|
|
238
|
+
* @returns The options object or undefined if no custom data
|
|
239
|
+
*/
|
|
240
|
+
getCurrentOptions(category: ExtensionCategory): ExtensionOptions | undefined;
|
|
241
|
+
/**
|
|
242
|
+
* Validate items for a category
|
|
243
|
+
* @param category - The category to validate against
|
|
244
|
+
* @param items - Items to validate
|
|
245
|
+
* @returns Validation result with any errors
|
|
246
|
+
*/
|
|
247
|
+
validate(category: ExtensionCategory, items: any[]): ValidationResult;
|
|
248
|
+
/**
|
|
249
|
+
* Validate a single item
|
|
250
|
+
* @param category - The category to validate against
|
|
251
|
+
* @param item - The item to validate
|
|
252
|
+
* @param index - Index of the item in the array (for error messages)
|
|
253
|
+
* @returns Array of error messages (empty if valid)
|
|
254
|
+
*/
|
|
255
|
+
private validateItem;
|
|
256
|
+
/**
|
|
257
|
+
* Reset a category to defaults (removes all custom data)
|
|
258
|
+
* @param category - The category to reset
|
|
259
|
+
*/
|
|
260
|
+
reset(category: ExtensionCategory): void;
|
|
261
|
+
/**
|
|
262
|
+
* Reset all categories to defaults
|
|
263
|
+
*/
|
|
264
|
+
resetAll(): void;
|
|
265
|
+
/**
|
|
266
|
+
* Get the registry type for a given category
|
|
267
|
+
*
|
|
268
|
+
* Maps extension categories to their corresponding registries for automatic cache invalidation.
|
|
269
|
+
*
|
|
270
|
+
* @param category - The extension category
|
|
271
|
+
* @returns Registry type ('spell', 'skill', 'feature') or null if no registry caching
|
|
272
|
+
* @private
|
|
273
|
+
*/
|
|
274
|
+
private getRegistryForCategory;
|
|
275
|
+
/**
|
|
276
|
+
* Invalidate the appropriate registry cache for a category
|
|
277
|
+
*
|
|
278
|
+
* Automatically invalidates the registry cache based on the category being registered.
|
|
279
|
+
* This ensures that query methods return fresh data after registration.
|
|
280
|
+
*
|
|
281
|
+
* @param category - The extension category to invalidate cache for
|
|
282
|
+
* @private
|
|
283
|
+
*/
|
|
284
|
+
private invalidateRegistryCache;
|
|
285
|
+
/**
|
|
286
|
+
* Get information about registered extensions
|
|
287
|
+
* @param category - Optional category to get info for (if omitted, returns all)
|
|
288
|
+
* @returns Object with extension information
|
|
289
|
+
*/
|
|
290
|
+
getInfo(category?: ExtensionCategory): Record<string, any>;
|
|
291
|
+
/**
|
|
292
|
+
* Export all custom data (for debugging/saving)
|
|
293
|
+
* @returns Object with all custom extensions
|
|
294
|
+
*/
|
|
295
|
+
exportCustomData(): Record<string, any>;
|
|
296
|
+
/**
|
|
297
|
+
* Export custom data for a single category
|
|
298
|
+
* @param category - The category to export
|
|
299
|
+
* @returns Array of custom items, or empty array if no custom data
|
|
300
|
+
*/
|
|
301
|
+
exportCustomDataForCategory(category: ExtensionCategory): any[];
|
|
302
|
+
/**
|
|
303
|
+
* Get all registered categories
|
|
304
|
+
* @returns Array of all categories with default data
|
|
305
|
+
*/
|
|
306
|
+
getRegisteredCategories(): ExtensionCategory[];
|
|
307
|
+
/**
|
|
308
|
+
* Get all data from categories matching a prefix pattern
|
|
309
|
+
*
|
|
310
|
+
* Aggregates data from all categories that start with the given prefix.
|
|
311
|
+
* Useful for getting all items from race-specific or class-specific categories.
|
|
312
|
+
*
|
|
313
|
+
* For example, prefix 'racialTraits' will match:
|
|
314
|
+
* - 'racialTraits' (general category)
|
|
315
|
+
* - 'racialTraits.Elf' (race-specific category)
|
|
316
|
+
* - 'racialTraits.Dragonkin' (custom race-specific category)
|
|
317
|
+
*
|
|
318
|
+
* @param prefix - Category prefix to match (e.g., 'racialTraits', 'classFeatures')
|
|
319
|
+
* @returns Array of all items from matching categories
|
|
320
|
+
*/
|
|
321
|
+
getAllFromPrefix(prefix: string): any[];
|
|
322
|
+
/**
|
|
323
|
+
* Batch add icons to items in a category
|
|
324
|
+
*
|
|
325
|
+
* Updates the `icon` field for multiple items identified by name or custom key.
|
|
326
|
+
* Validates all URLs before applying any changes.
|
|
327
|
+
*
|
|
328
|
+
* @param category - The category to update (must support image fields)
|
|
329
|
+
* @param iconMap - Map of item identifier to icon URL
|
|
330
|
+
* @param identifierKey - Property to match items by (default: 'name' or 'id' for spells)
|
|
331
|
+
* @returns Number of items updated
|
|
332
|
+
* @throws Error if any URL is invalid or category doesn't support images
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* // Add icons to specific spells
|
|
336
|
+
* manager.batchAddIcons('spells', {
|
|
337
|
+
* 'fireball': '/assets/spells/fireball.png',
|
|
338
|
+
* 'magic_missile': '/assets/spells/magic-missile.png'
|
|
339
|
+
* });
|
|
340
|
+
*
|
|
341
|
+
* // Add icons to equipment
|
|
342
|
+
* manager.batchAddIcons('equipment', {
|
|
343
|
+
* 'Longsword': '/assets/equipment/longsword.png'
|
|
344
|
+
* });
|
|
345
|
+
*/
|
|
346
|
+
batchAddIcons(category: ImageSupportedCategory, iconMap: Record<string, string>, identifierKey?: string): number;
|
|
347
|
+
/**
|
|
348
|
+
* Batch add images to items in a category by identifier
|
|
349
|
+
*
|
|
350
|
+
* Adds or updates the `image` field on items that match the provided identifiers.
|
|
351
|
+
* All items not in the imageMap are preserved unchanged.
|
|
352
|
+
*
|
|
353
|
+
* @param category - The category to update (must support images)
|
|
354
|
+
* @param imageMap - Object mapping item identifiers to image URLs
|
|
355
|
+
* @param identifierKey - Optional property to use as identifier (defaults to 'id' for spells, 'name' for others)
|
|
356
|
+
* @returns Number of items updated
|
|
357
|
+
* @throws Error if any image URL is invalid
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* // Add images to specific spells
|
|
361
|
+
* manager.batchAddImages('spells', {
|
|
362
|
+
* 'fireball': '/assets/spells/fireball-full.png',
|
|
363
|
+
* 'magic_missile': '/assets/spells/magic-missile-full.png'
|
|
364
|
+
* });
|
|
365
|
+
*
|
|
366
|
+
* // Add images to equipment
|
|
367
|
+
* manager.batchAddImages('equipment', {
|
|
368
|
+
* 'Longsword': '/assets/equipment/longsword-full.png'
|
|
369
|
+
* });
|
|
370
|
+
*/
|
|
371
|
+
batchAddImages(category: ImageSupportedCategory, imageMap: Record<string, string>, identifierKey?: string): number;
|
|
372
|
+
/**
|
|
373
|
+
* Batch update icons and/or images for items matching a predicate
|
|
374
|
+
*
|
|
375
|
+
* Updates all items in a category that match the given predicate function
|
|
376
|
+
* with the specified icon and/or image URLs. Useful for bulk operations
|
|
377
|
+
* based on item properties (e.g., all cantrips, all rare equipment).
|
|
378
|
+
*
|
|
379
|
+
* @param category - The category to update (must support images)
|
|
380
|
+
* @param predicate - Function that returns true for items to update
|
|
381
|
+
* @param updates - Object containing icon and/or image URLs to apply
|
|
382
|
+
* @returns Number of items updated
|
|
383
|
+
* @throws Error if any URL is invalid
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
* // Add same icon to all cantrips
|
|
387
|
+
* manager.batchUpdateImages('spells',
|
|
388
|
+
* spell => spell.level === 0,
|
|
389
|
+
* { icon: '/assets/spells/cantrip-icon.png' }
|
|
390
|
+
* );
|
|
391
|
+
*
|
|
392
|
+
* // Add images to all rare equipment
|
|
393
|
+
* manager.batchUpdateImages('equipment',
|
|
394
|
+
* item => item.rarity === 'rare',
|
|
395
|
+
* { icon: '/assets/icons/rare.png', image: '/assets/images/rare-bg.png' }
|
|
396
|
+
* );
|
|
397
|
+
*
|
|
398
|
+
* // Update all evocation spells
|
|
399
|
+
* manager.batchUpdateImages('spells',
|
|
400
|
+
* spell => spell.school === 'Evocation',
|
|
401
|
+
* { icon: '/assets/icons/fire.png' }
|
|
402
|
+
* );
|
|
403
|
+
*/
|
|
404
|
+
batchUpdateImages<T = any>(category: ImageSupportedCategory, predicate: (item: T) => boolean, updates: {
|
|
405
|
+
icon?: string;
|
|
406
|
+
image?: string;
|
|
407
|
+
}): number;
|
|
408
|
+
/**
|
|
409
|
+
* Batch update icons/images for items based on a property value mapping
|
|
410
|
+
*
|
|
411
|
+
* Updates items in a category where the specified property matches a key in the valueMap.
|
|
412
|
+
* Useful for bulk operations based on categories like spell school, equipment rarity, etc.
|
|
413
|
+
*
|
|
414
|
+
* @param category - The category to update (must support images)
|
|
415
|
+
* @param property - The property name to match against (e.g., 'school', 'rarity')
|
|
416
|
+
* @param valueMap - Map of property values to icon/image URLs. Values can be:
|
|
417
|
+
* - A string URL (will be applied as the icon)
|
|
418
|
+
* - An object with icon and/or image properties
|
|
419
|
+
* @returns Number of items updated
|
|
420
|
+
* @throws Error if any URL is invalid
|
|
421
|
+
*
|
|
422
|
+
* @example
|
|
423
|
+
* // Add icons by spell school
|
|
424
|
+
* manager.batchByCategory('spells', 'school', {
|
|
425
|
+
* 'Evocation': '/assets/icons/fire.png',
|
|
426
|
+
* 'Necromancy': '/assets/icons/skull.png',
|
|
427
|
+
* 'Abjuration': '/assets/icons/shield.png'
|
|
428
|
+
* });
|
|
429
|
+
*
|
|
430
|
+
* // Add icons by equipment rarity
|
|
431
|
+
* manager.batchByCategory('equipment', 'rarity', {
|
|
432
|
+
* 'legendary': '/assets/icons/star-gold.png',
|
|
433
|
+
* 'very_rare': '/assets/icons/star-purple.png',
|
|
434
|
+
* 'rare': '/assets/icons/star-blue.png'
|
|
435
|
+
* });
|
|
436
|
+
*
|
|
437
|
+
* // Add both icon and image by rarity
|
|
438
|
+
* manager.batchByCategory('equipment', 'rarity', {
|
|
439
|
+
* 'legendary': { icon: '/assets/icons/legendary.png', image: '/assets/images/legendary-bg.png' }
|
|
440
|
+
* });
|
|
441
|
+
*/
|
|
442
|
+
batchByCategory<T = any>(category: ImageSupportedCategory, property: keyof T, valueMap: Record<string, string | {
|
|
443
|
+
icon?: string;
|
|
444
|
+
image?: string;
|
|
445
|
+
}>): number;
|
|
446
|
+
/**
|
|
447
|
+
* Get all image overrides for all categories
|
|
448
|
+
*
|
|
449
|
+
* Used by persistence layer to save overrides to localStorage.
|
|
450
|
+
*
|
|
451
|
+
* @returns Map of category to array of image overrides
|
|
452
|
+
*/
|
|
453
|
+
getImageOverrides(): Map<ImageSupportedCategory, ImageOverride[]>;
|
|
454
|
+
/**
|
|
455
|
+
* Get image overrides for a specific category
|
|
456
|
+
*
|
|
457
|
+
* @param category - The category to get overrides for
|
|
458
|
+
* @returns Array of image overrides, or empty array if none
|
|
459
|
+
*/
|
|
460
|
+
getImageOverridesForCategory(category: ImageSupportedCategory): ImageOverride[];
|
|
461
|
+
/**
|
|
462
|
+
* Restore image overrides from saved data
|
|
463
|
+
*
|
|
464
|
+
* Used by persistence layer to restore overrides from localStorage.
|
|
465
|
+
* Merges with existing overrides - new values override existing for same identifier.
|
|
466
|
+
*
|
|
467
|
+
* @param category - The category to restore overrides for
|
|
468
|
+
* @param overrides - Array of image overrides to restore
|
|
469
|
+
*/
|
|
470
|
+
restoreImageOverrides(category: ImageSupportedCategory, overrides: ImageOverride[]): void;
|
|
471
|
+
/**
|
|
472
|
+
* Clear all image overrides for a category
|
|
473
|
+
*
|
|
474
|
+
* @param category - The category to clear overrides for
|
|
475
|
+
*/
|
|
476
|
+
clearImageOverrides(category: ImageSupportedCategory): void;
|
|
477
|
+
/**
|
|
478
|
+
* Clear all image overrides for all categories
|
|
479
|
+
*/
|
|
480
|
+
clearAllImageOverrides(): void;
|
|
481
|
+
/**
|
|
482
|
+
* Get the default identifier key for a category
|
|
483
|
+
*
|
|
484
|
+
* Different categories use different identifier properties:
|
|
485
|
+
* - Spells use 'id' (e.g., 'fireball', 'magic_missile')
|
|
486
|
+
* - Most other categories use 'name'
|
|
487
|
+
*
|
|
488
|
+
* @param category - The category to get the identifier key for
|
|
489
|
+
* @returns The default identifier property name
|
|
490
|
+
* @private
|
|
491
|
+
*/
|
|
492
|
+
private getDefaultIdentifierKey;
|
|
493
|
+
/**
|
|
494
|
+
* Validate an image URL field
|
|
495
|
+
*
|
|
496
|
+
* Checks if a URL is valid for use as an icon or image field.
|
|
497
|
+
* Returns null if valid, or an error message string if invalid.
|
|
498
|
+
*
|
|
499
|
+
* @param url - The URL string to validate
|
|
500
|
+
* @param fieldName - Descriptive name for error messages (e.g., 'icon', 'image', 'Fireball.icon')
|
|
501
|
+
* @returns Error message if invalid, null if valid
|
|
502
|
+
* @private
|
|
503
|
+
*/
|
|
504
|
+
private validateImageField;
|
|
505
|
+
/**
|
|
506
|
+
* Validate multiple image URLs and collect errors
|
|
507
|
+
*
|
|
508
|
+
* Convenience method that validates multiple URLs and returns
|
|
509
|
+
* all validation errors as an array.
|
|
510
|
+
*
|
|
511
|
+
* @param validations - Array of [url, fieldName] tuples to validate
|
|
512
|
+
* @returns Array of error messages (empty if all valid)
|
|
513
|
+
* @private
|
|
514
|
+
*/
|
|
515
|
+
private validateImageFields;
|
|
516
|
+
}
|
|
517
|
+
//# sourceMappingURL=ExtensionManager.d.ts.map
|