warscript 0.0.1-dev.404878c
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 +23 -0
- package/binaryreader.d.ts +20 -0
- package/binaryreader.lua +50 -0
- package/binarywriter.d.ts +21 -0
- package/binarywriter.lua +90 -0
- package/core/dummy.d.ts +22 -0
- package/core/dummy.lua +133 -0
- package/core/game.d.ts +3 -0
- package/core/game.lua +24 -0
- package/core/mapbounds.d.ts +8 -0
- package/core/mapbounds.lua +12 -0
- package/core/thread.d.ts +8 -0
- package/core/thread.lua +40 -0
- package/core/types/ability.d.ts +4 -0
- package/core/types/ability.lua +10 -0
- package/core/types/async.d.ts +3 -0
- package/core/types/async.lua +2 -0
- package/core/types/camera.d.ts +4 -0
- package/core/types/camera.lua +21 -0
- package/core/types/cameraField.d.ts +15 -0
- package/core/types/cameraField.lua +38 -0
- package/core/types/color.d.ts +16 -0
- package/core/types/color.lua +93 -0
- package/core/types/destructable.d.ts +31 -0
- package/core/types/destructable.lua +245 -0
- package/core/types/effect.d.ts +31 -0
- package/core/types/effect.lua +209 -0
- package/core/types/frame.d.ts +140 -0
- package/core/types/frame.lua +882 -0
- package/core/types/game.d.ts +8 -0
- package/core/types/game.lua +41 -0
- package/core/types/group.d.ts +22 -0
- package/core/types/group.lua +94 -0
- package/core/types/handle.d.ts +48 -0
- package/core/types/handle.lua +169 -0
- package/core/types/image.d.ts +30 -0
- package/core/types/image.lua +121 -0
- package/core/types/internal/ability+cooldownRemaining.d.ts +1 -0
- package/core/types/internal/ability+cooldownRemaining.lua +0 -0
- package/core/types/item.d.ts +4 -0
- package/core/types/item.lua +6 -0
- package/core/types/missile.d.ts +22 -0
- package/core/types/missile.lua +233 -0
- package/core/types/order.d.ts +25 -0
- package/core/types/order.lua +55 -0
- package/core/types/player.d.ts +71 -0
- package/core/types/player.lua +448 -0
- package/core/types/playerCamera.d.ts +32 -0
- package/core/types/playerCamera.lua +162 -0
- package/core/types/playerColor.d.ts +40 -0
- package/core/types/playerColor.lua +203 -0
- package/core/types/rect.d.ts +39 -0
- package/core/types/rect.lua +152 -0
- package/core/types/region.d.ts +14 -0
- package/core/types/region.lua +84 -0
- package/core/types/sound.d.ts +69 -0
- package/core/types/sound.lua +247 -0
- package/core/types/tileCell.d.ts +13 -0
- package/core/types/tileCell.lua +100 -0
- package/core/types/timer.d.ts +36 -0
- package/core/types/timer.lua +230 -0
- package/core/types/timerDialog.d.ts +19 -0
- package/core/types/timerDialog.lua +95 -0
- package/core/types/unit.d.ts +10 -0
- package/core/types/unit.lua +24 -0
- package/core/types/widget.d.ts +5 -0
- package/core/types/widget.lua +2 -0
- package/core/util.d.ts +62 -0
- package/core/util.lua +464 -0
- package/core/vecmath/common.d.ts +18 -0
- package/core/vecmath/common.lua +29 -0
- package/core/vecmath/mat2.d.ts +73 -0
- package/core/vecmath/mat2.lua +261 -0
- package/core/vecmath/vec3.d.ts +47 -0
- package/core/vecmath/vec3.lua +350 -0
- package/core/vecmath/vec4.d.ts +54 -0
- package/core/vecmath/vec4.lua +400 -0
- package/crypto/ecc.d.ts +6 -0
- package/crypto/ecc.lua +1734 -0
- package/decl/index.d.ts +116 -0
- package/decl/native.d.ts +8198 -0
- package/destroyable.d.ts +20 -0
- package/destroyable.lua +31 -0
- package/engine/ability.d.ts +5 -0
- package/engine/ability.lua +7 -0
- package/engine/behavior.d.ts +28 -0
- package/engine/behavior.lua +181 -0
- package/engine/behaviour/ability/apply-buff.d.ts +38 -0
- package/engine/behaviour/ability/apply-buff.lua +126 -0
- package/engine/behaviour/ability/apply-unit-behavior.d.ts +12 -0
- package/engine/behaviour/ability/apply-unit-behavior.lua +36 -0
- package/engine/behaviour/ability/damage.d.ts +25 -0
- package/engine/behaviour/ability/damage.lua +75 -0
- package/engine/behaviour/ability/heal.d.ts +16 -0
- package/engine/behaviour/ability/heal.lua +35 -0
- package/engine/behaviour/ability/instant-impact.d.ts +6 -0
- package/engine/behaviour/ability/instant-impact.lua +25 -0
- package/engine/behaviour/ability.d.ts +40 -0
- package/engine/behaviour/ability.lua +175 -0
- package/engine/behaviour/unit/stun-immunity.d.ts +19 -0
- package/engine/behaviour/unit/stun-immunity.lua +67 -0
- package/engine/behaviour/unit.d.ts +20 -0
- package/engine/behaviour/unit.lua +75 -0
- package/engine/buff.d.ts +221 -0
- package/engine/buff.lua +1093 -0
- package/engine/constants.d.ts +7 -0
- package/engine/constants.lua +8 -0
- package/engine/index.d.ts +5 -0
- package/engine/index.lua +2 -0
- package/engine/internal/ability.d.ts +91 -0
- package/engine/internal/ability.lua +531 -0
- package/engine/internal/item/ability.d.ts +2 -0
- package/engine/internal/item/ability.lua +48 -0
- package/engine/internal/item+owner.d.ts +7 -0
- package/engine/internal/item+owner.lua +22 -0
- package/engine/internal/item.d.ts +86 -0
- package/engine/internal/item.lua +580 -0
- package/engine/internal/mechanics/ability-duration.d.ts +4 -0
- package/engine/internal/mechanics/ability-duration.lua +11 -0
- package/engine/internal/mechanics/area-damage.d.ts +2 -0
- package/engine/internal/mechanics/area-damage.lua +33 -0
- package/engine/internal/misc/dummy-units.d.ts +2 -0
- package/engine/internal/misc/dummy-units.lua +14 -0
- package/engine/internal/object-data/armor-increase.d.ts +2 -0
- package/engine/internal/object-data/armor-increase.lua +19 -0
- package/engine/internal/object-data/attribute-bonus.d.ts +2 -0
- package/engine/internal/object-data/attribute-bonus.lua +15 -0
- package/engine/internal/object-data/auto-attack-damage-increase.d.ts +2 -0
- package/engine/internal/object-data/auto-attack-damage-increase.lua +17 -0
- package/engine/internal/object-data/auto-attack-speed-increase.d.ts +2 -0
- package/engine/internal/object-data/auto-attack-speed-increase.lua +14 -0
- package/engine/internal/object-data/dummy-inventory.d.ts +2 -0
- package/engine/internal/object-data/dummy-inventory.lua +16 -0
- package/engine/internal/object-data/dummy-item.d.ts +2 -0
- package/engine/internal/object-data/dummy-item.lua +10 -0
- package/engine/internal/object-data/ghost-visible.d.ts +2 -0
- package/engine/internal/object-data/ghost-visible.lua +15 -0
- package/engine/internal/object-data/invulnerable.d.ts +2 -0
- package/engine/internal/object-data/invulnerable.lua +11 -0
- package/engine/internal/object-data/movement-speed-increase-factor.d.ts +2 -0
- package/engine/internal/object-data/movement-speed-increase-factor.lua +18 -0
- package/engine/internal/unit/ability.d.ts +143 -0
- package/engine/internal/unit/ability.lua +369 -0
- package/engine/internal/unit/allowed-targets.d.ts +17 -0
- package/engine/internal/unit/allowed-targets.lua +19 -0
- package/engine/internal/unit/band-aids/ancestral-spirit-cannibalize.d.ts +2 -0
- package/engine/internal/unit/band-aids/ancestral-spirit-cannibalize.lua +21 -0
- package/engine/internal/unit/bonus.d.ts +41 -0
- package/engine/internal/unit/bonus.lua +188 -0
- package/engine/internal/unit/buff.d.ts +38 -0
- package/engine/internal/unit/buff.lua +81 -0
- package/engine/internal/unit/expiration-timer.d.ts +22 -0
- package/engine/internal/unit/expiration-timer.lua +44 -0
- package/engine/internal/unit/ghost-counter.d.ts +12 -0
- package/engine/internal/unit/ghost-counter.lua +26 -0
- package/engine/internal/unit/invulnerability-counter.d.ts +12 -0
- package/engine/internal/unit/invulnerability-counter.lua +26 -0
- package/engine/internal/unit/missile.d.ts +42 -0
- package/engine/internal/unit/missile.lua +70 -0
- package/engine/internal/unit/movement-speed.d.ts +18 -0
- package/engine/internal/unit/movement-speed.lua +42 -0
- package/engine/internal/unit/summon-event.d.ts +12 -0
- package/engine/internal/unit/summon-event.lua +50 -0
- package/engine/internal/unit+ability.d.ts +9 -0
- package/engine/internal/unit+ability.lua +59 -0
- package/engine/internal/unit+bonus.d.ts +8 -0
- package/engine/internal/unit+bonus.lua +40 -0
- package/engine/internal/unit+damage.d.ts +69 -0
- package/engine/internal/unit+damage.lua +123 -0
- package/engine/internal/unit+rally.d.ts +10 -0
- package/engine/internal/unit+rally.lua +159 -0
- package/engine/internal/unit+spellSteal.d.ts +7 -0
- package/engine/internal/unit+spellSteal.lua +64 -0
- package/engine/internal/unit+transport.d.ts +12 -0
- package/engine/internal/unit+transport.lua +102 -0
- package/engine/internal/unit-missile-data.d.ts +2 -0
- package/engine/internal/unit-missile-data.lua +107 -0
- package/engine/internal/unit-missile-launch.d.ts +7 -0
- package/engine/internal/unit-missile-launch.lua +32 -0
- package/engine/internal/unit.d.ts +312 -0
- package/engine/internal/unit.lua +2430 -0
- package/engine/internal/utility.d.ts +2 -0
- package/engine/internal/utility.lua +13 -0
- package/engine/lightning.d.ts +51 -0
- package/engine/lightning.lua +303 -0
- package/engine/local-client.d.ts +16 -0
- package/engine/local-client.lua +86 -0
- package/engine/object-data/auxiliary/animation-name.d.ts +14 -0
- package/engine/object-data/auxiliary/animation-name.lua +2 -0
- package/engine/object-data/auxiliary/animation-qualifier.d.ts +53 -0
- package/engine/object-data/auxiliary/animation-qualifier.lua +2 -0
- package/engine/object-data/auxiliary/armor-sound-type.d.ts +8 -0
- package/engine/object-data/auxiliary/armor-sound-type.lua +2 -0
- package/engine/object-data/auxiliary/attachment-preset.d.ts +15 -0
- package/engine/object-data/auxiliary/attachment-preset.lua +29 -0
- package/engine/object-data/auxiliary/attack-type.d.ts +11 -0
- package/engine/object-data/auxiliary/attack-type.lua +2 -0
- package/engine/object-data/auxiliary/buff-polarity.d.ts +6 -0
- package/engine/object-data/auxiliary/buff-polarity.lua +2 -0
- package/engine/object-data/auxiliary/buff-resistance-type.d.ts +6 -0
- package/engine/object-data/auxiliary/buff-resistance-type.lua +2 -0
- package/engine/object-data/auxiliary/combat-classification.d.ts +46 -0
- package/engine/object-data/auxiliary/combat-classification.lua +206 -0
- package/engine/object-data/auxiliary/detection-type.d.ts +7 -0
- package/engine/object-data/auxiliary/detection-type.lua +2 -0
- package/engine/object-data/auxiliary/model-node-name.d.ts +12 -0
- package/engine/object-data/auxiliary/model-node-name.lua +2 -0
- package/engine/object-data/auxiliary/model-node-qualifier.d.ts +21 -0
- package/engine/object-data/auxiliary/model-node-qualifier.lua +2 -0
- package/engine/object-data/auxiliary/movement-type.d.ts +10 -0
- package/engine/object-data/auxiliary/movement-type.lua +2 -0
- package/engine/object-data/auxiliary/race.d.ts +14 -0
- package/engine/object-data/auxiliary/race.lua +2 -0
- package/engine/object-data/auxiliary/sound-preset-name.d.ts +8 -0
- package/engine/object-data/auxiliary/sound-preset-name.lua +2 -0
- package/engine/object-data/auxiliary/sound-set-name.d.ts +35 -0
- package/engine/object-data/auxiliary/sound-set-name.lua +2 -0
- package/engine/object-data/auxiliary/targeting-type.d.ts +8 -0
- package/engine/object-data/auxiliary/targeting-type.lua +2 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.d.ts +16 -0
- package/engine/object-data/auxiliary/tech-tree-dependency.lua +8 -0
- package/engine/object-data/auxiliary/unit-classification.d.ts +19 -0
- package/engine/object-data/auxiliary/unit-classification.lua +50 -0
- package/engine/object-data/auxiliary/weapon-sound-type.d.ts +17 -0
- package/engine/object-data/auxiliary/weapon-sound-type.lua +2 -0
- package/engine/object-data/entry/ability-type/armor-increase.d.ts +8 -0
- package/engine/object-data/entry/ability-type/armor-increase.lua +26 -0
- package/engine/object-data/entry/ability-type/attribute-increase.d.ts +12 -0
- package/engine/object-data/entry/ability-type/attribute-increase.lua +52 -0
- package/engine/object-data/entry/ability-type/auto-attack-damage-increase.d.ts +8 -0
- package/engine/object-data/entry/ability-type/auto-attack-damage-increase.lua +26 -0
- package/engine/object-data/entry/ability-type/auto-attack-heal-reduction-effect.d.ts +12 -0
- package/engine/object-data/entry/ability-type/auto-attack-heal-reduction-effect.lua +52 -0
- package/engine/object-data/entry/ability-type/auto-attack-speed-increase.d.ts +8 -0
- package/engine/object-data/entry/ability-type/auto-attack-speed-increase.lua +26 -0
- package/engine/object-data/entry/ability-type/bash.d.ts +16 -0
- package/engine/object-data/entry/ability-type/bash.lua +78 -0
- package/engine/object-data/entry/ability-type/berserk.d.ts +10 -0
- package/engine/object-data/entry/ability-type/berserk.lua +39 -0
- package/engine/object-data/entry/ability-type/blank-configurable.d.ts +21 -0
- package/engine/object-data/entry/ability-type/blank-configurable.lua +249 -0
- package/engine/object-data/entry/ability-type/blank-passive.d.ts +7 -0
- package/engine/object-data/entry/ability-type/blank-passive.lua +28 -0
- package/engine/object-data/entry/ability-type/blizzard.d.ts +16 -0
- package/engine/object-data/entry/ability-type/blizzard.lua +78 -0
- package/engine/object-data/entry/ability-type/blood-lust.d.ts +12 -0
- package/engine/object-data/entry/ability-type/blood-lust.lua +52 -0
- package/engine/object-data/entry/ability-type/chain-lightning.d.ts +12 -0
- package/engine/object-data/entry/ability-type/chain-lightning.lua +52 -0
- package/engine/object-data/entry/ability-type/channel.d.ts +48 -0
- package/engine/object-data/entry/ability-type/channel.lua +140 -0
- package/engine/object-data/entry/ability-type/charge-gold-and-lumber.d.ts +14 -0
- package/engine/object-data/entry/ability-type/charge-gold-and-lumber.lua +65 -0
- package/engine/object-data/entry/ability-type/cleaving-attack.d.ts +8 -0
- package/engine/object-data/entry/ability-type/cleaving-attack.lua +26 -0
- package/engine/object-data/entry/ability-type/cluster-rockets.d.ts +18 -0
- package/engine/object-data/entry/ability-type/cluster-rockets.lua +91 -0
- package/engine/object-data/entry/ability-type/cripple.d.ts +12 -0
- package/engine/object-data/entry/ability-type/cripple.lua +52 -0
- package/engine/object-data/entry/ability-type/critical-strike.d.ts +18 -0
- package/engine/object-data/entry/ability-type/critical-strike.lua +91 -0
- package/engine/object-data/entry/ability-type/curse.d.ts +8 -0
- package/engine/object-data/entry/ability-type/curse.lua +26 -0
- package/engine/object-data/entry/ability-type/dark-summoning.d.ts +10 -0
- package/engine/object-data/entry/ability-type/dark-summoning.lua +39 -0
- package/engine/object-data/entry/ability-type/death-coil.d.ts +8 -0
- package/engine/object-data/entry/ability-type/death-coil.lua +26 -0
- package/engine/object-data/entry/ability-type/disease-cloud.d.ts +15 -0
- package/engine/object-data/entry/ability-type/disease-cloud.lua +65 -0
- package/engine/object-data/entry/ability-type/divine-shield.d.ts +5 -0
- package/engine/object-data/entry/ability-type/divine-shield.lua +12 -0
- package/engine/object-data/entry/ability-type/endurance-aura.d.ts +10 -0
- package/engine/object-data/entry/ability-type/endurance-aura.lua +39 -0
- package/engine/object-data/entry/ability-type/engineering-upgrade.d.ts +13 -0
- package/engine/object-data/entry/ability-type/engineering-upgrade.lua +88 -0
- package/engine/object-data/entry/ability-type/evasion.d.ts +8 -0
- package/engine/object-data/entry/ability-type/evasion.lua +26 -0
- package/engine/object-data/entry/ability-type/faerie-fire.d.ts +10 -0
- package/engine/object-data/entry/ability-type/faerie-fire.lua +39 -0
- package/engine/object-data/entry/ability-type/far-sight.d.ts +9 -0
- package/engine/object-data/entry/ability-type/far-sight.lua +26 -0
- package/engine/object-data/entry/ability-type/feral-spirit.d.ts +11 -0
- package/engine/object-data/entry/ability-type/feral-spirit.lua +39 -0
- package/engine/object-data/entry/ability-type/frenzy.d.ts +12 -0
- package/engine/object-data/entry/ability-type/frenzy.lua +52 -0
- package/engine/object-data/entry/ability-type/frost-nova.d.ts +12 -0
- package/engine/object-data/entry/ability-type/frost-nova.lua +52 -0
- package/engine/object-data/entry/ability-type/ghost-visible.d.ts +10 -0
- package/engine/object-data/entry/ability-type/ghost-visible.lua +39 -0
- package/engine/object-data/entry/ability-type/gold-mine.d.ts +12 -0
- package/engine/object-data/entry/ability-type/gold-mine.lua +52 -0
- package/engine/object-data/entry/ability-type/heal.d.ts +8 -0
- package/engine/object-data/entry/ability-type/heal.lua +26 -0
- package/engine/object-data/entry/ability-type/healing-salve.d.ts +22 -0
- package/engine/object-data/entry/ability-type/healing-salve.lua +78 -0
- package/engine/object-data/entry/ability-type/healing-spray.d.ts +18 -0
- package/engine/object-data/entry/ability-type/healing-spray.lua +91 -0
- package/engine/object-data/entry/ability-type/healing-wave.d.ts +12 -0
- package/engine/object-data/entry/ability-type/healing-wave.lua +52 -0
- package/engine/object-data/entry/ability-type/holy-light.d.ts +8 -0
- package/engine/object-data/entry/ability-type/holy-light.lua +26 -0
- package/engine/object-data/entry/ability-type/incinerate.d.ts +18 -0
- package/engine/object-data/entry/ability-type/incinerate.lua +91 -0
- package/engine/object-data/entry/ability-type/inner-fire.d.ts +14 -0
- package/engine/object-data/entry/ability-type/inner-fire.lua +65 -0
- package/engine/object-data/entry/ability-type/inventory.d.ts +16 -0
- package/engine/object-data/entry/ability-type/inventory.lua +78 -0
- package/engine/object-data/entry/ability-type/invulnerable.d.ts +5 -0
- package/engine/object-data/entry/ability-type/invulnerable.lua +12 -0
- package/engine/object-data/entry/ability-type/lightning-shield.d.ts +8 -0
- package/engine/object-data/entry/ability-type/lightning-shield.lua +26 -0
- package/engine/object-data/entry/ability-type/movement-speed-increase.d.ts +8 -0
- package/engine/object-data/entry/ability-type/movement-speed-increase.lua +26 -0
- package/engine/object-data/entry/ability-type/permanent-immolation.d.ts +8 -0
- package/engine/object-data/entry/ability-type/permanent-immolation.lua +26 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.d.ts +25 -0
- package/engine/object-data/entry/ability-type/phoenix-morph.lua +130 -0
- package/engine/object-data/entry/ability-type/recall.d.ts +10 -0
- package/engine/object-data/entry/ability-type/recall.lua +39 -0
- package/engine/object-data/entry/ability-type/rejuvenation.d.ts +20 -0
- package/engine/object-data/entry/ability-type/rejuvenation.lua +65 -0
- package/engine/object-data/entry/ability-type/searing-arrows.d.ts +8 -0
- package/engine/object-data/entry/ability-type/searing-arrows.lua +26 -0
- package/engine/object-data/entry/ability-type/shock-wave.d.ts +10 -0
- package/engine/object-data/entry/ability-type/shock-wave.lua +39 -0
- package/engine/object-data/entry/ability-type/slow-poison.d.ts +12 -0
- package/engine/object-data/entry/ability-type/slow-poison.lua +52 -0
- package/engine/object-data/entry/ability-type/slow.d.ts +12 -0
- package/engine/object-data/entry/ability-type/slow.lua +52 -0
- package/engine/object-data/entry/ability-type/spell-damage-reduction.d.ts +10 -0
- package/engine/object-data/entry/ability-type/spell-damage-reduction.lua +39 -0
- package/engine/object-data/entry/ability-type/spiked-carapace.d.ts +12 -0
- package/engine/object-data/entry/ability-type/spiked-carapace.lua +52 -0
- package/engine/object-data/entry/ability-type/spirit-touch.d.ts +14 -0
- package/engine/object-data/entry/ability-type/spirit-touch.lua +65 -0
- package/engine/object-data/entry/ability-type/storm-bolt.d.ts +8 -0
- package/engine/object-data/entry/ability-type/storm-bolt.lua +26 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.d.ts +11 -0
- package/engine/object-data/entry/ability-type/summon-quilbeast.lua +39 -0
- package/engine/object-data/entry/ability-type/summon-water-elemental.d.ts +11 -0
- package/engine/object-data/entry/ability-type/summon-water-elemental.lua +39 -0
- package/engine/object-data/entry/ability-type.d.ts +148 -0
- package/engine/object-data/entry/ability-type.lua +1058 -0
- package/engine/object-data/entry/buff-type/applicable.d.ts +16 -0
- package/engine/object-data/entry/buff-type/applicable.lua +377 -0
- package/engine/object-data/entry/buff-type/blank.d.ts +8 -0
- package/engine/object-data/entry/buff-type/blank.lua +17 -0
- package/engine/object-data/entry/buff-type.d.ts +64 -0
- package/engine/object-data/entry/buff-type.lua +316 -0
- package/engine/object-data/entry/destructible-type.d.ts +21 -0
- package/engine/object-data/entry/destructible-type.lua +83 -0
- package/engine/object-data/entry/item-type/blank.d.ts +8 -0
- package/engine/object-data/entry/item-type/blank.lua +21 -0
- package/engine/object-data/entry/item-type.d.ts +49 -0
- package/engine/object-data/entry/item-type.lua +259 -0
- package/engine/object-data/entry/lightning-type.d.ts +37 -0
- package/engine/object-data/entry/lightning-type.lua +191 -0
- package/engine/object-data/entry/unit-type/blank.d.ts +6 -0
- package/engine/object-data/entry/unit-type/blank.lua +13 -0
- package/engine/object-data/entry/unit-type.d.ts +218 -0
- package/engine/object-data/entry/unit-type.lua +1306 -0
- package/engine/object-data/entry/upgrade/blank.d.ts +8 -0
- package/engine/object-data/entry/upgrade/blank.lua +22 -0
- package/engine/object-data/entry/upgrade.d.ts +59 -0
- package/engine/object-data/entry/upgrade.lua +238 -0
- package/engine/object-data/entry.d.ts +80 -0
- package/engine/object-data/entry.lua +634 -0
- package/engine/object-data/utility/object-data-entry-id-generator.d.ts +6 -0
- package/engine/object-data/utility/object-data-entry-id-generator.lua +63 -0
- package/engine/object-data/utility/order-type-string-id-factory.d.ts +9 -0
- package/engine/object-data/utility/order-type-string-id-factory.lua +368 -0
- package/engine/object-field/ability.d.ts +115 -0
- package/engine/object-field/ability.lua +471 -0
- package/engine/object-field/unit.d.ts +15 -0
- package/engine/object-field/unit.lua +49 -0
- package/engine/object-field.d.ts +84 -0
- package/engine/object-field.lua +444 -0
- package/engine/random.d.ts +10 -0
- package/engine/random.lua +9 -0
- package/engine/standard/entries/ability-type.d.ts +8 -0
- package/engine/standard/entries/ability-type.lua +8 -0
- package/engine/standard/entries/lightning-type.d.ts +16 -0
- package/engine/standard/entries/lightning-type.lua +16 -0
- package/engine/standard/entries/unit-type.d.ts +63 -0
- package/engine/standard/entries/unit-type.lua +63 -0
- package/engine/standard/entries/upgrade.d.ts +92 -0
- package/engine/standard/entries/upgrade.lua +92 -0
- package/engine/standard/fields/ability.d.ts +737 -0
- package/engine/standard/fields/ability.lua +749 -0
- package/engine/standard/pathing-textures.d.ts +6 -0
- package/engine/standard/pathing-textures.lua +7 -0
- package/engine/text-tag.d.ts +25 -0
- package/engine/text-tag.lua +109 -0
- package/engine/unit.d.ts +20 -0
- package/engine/unit.lua +31 -0
- package/event.d.ts +53 -0
- package/event.lua +269 -0
- package/exception.d.ts +17 -0
- package/exception.lua +53 -0
- package/file.d.ts +4 -0
- package/file.lua +42 -0
- package/global/math.d.ts +21 -0
- package/global/math.lua +72 -0
- package/global/vec2.d.ts +66 -0
- package/global/vec2.lua +159 -0
- package/index.d.ts +8 -0
- package/index.lua +9 -0
- package/lualib_bundle.lua +2629 -0
- package/math/vec2.d.ts +18 -0
- package/math/vec2.lua +42 -0
- package/math.d.ts +39 -0
- package/math.lua +91 -0
- package/net/signal.d.ts +11 -0
- package/net/signal.lua +56 -0
- package/net/socket.d.ts +9 -0
- package/net/socket.lua +26 -0
- package/network.d.ts +31 -0
- package/network.lua +194 -0
- package/objutil/ability.d.ts +710 -0
- package/objutil/ability.lua +3781 -0
- package/objutil/buff.d.ts +110 -0
- package/objutil/buff.lua +769 -0
- package/objutil/dummy.d.ts +2 -0
- package/objutil/dummy.lua +49 -0
- package/objutil/idgen.d.ts +9 -0
- package/objutil/idgen.lua +92 -0
- package/objutil/item.d.ts +38 -0
- package/objutil/item.lua +254 -0
- package/objutil/object.d.ts +43 -0
- package/objutil/object.lua +213 -0
- package/objutil/unit.d.ts +134 -0
- package/objutil/unit.lua +913 -0
- package/objutil/upgrade.d.ts +22 -0
- package/objutil/upgrade.lua +127 -0
- package/operation.d.ts +35 -0
- package/operation.lua +179 -0
- package/package.json +47 -0
- package/patch-lualib.d.ts +2 -0
- package/patch-lualib.lua +67 -0
- package/patch-natives.d.ts +11 -0
- package/patch-natives.lua +14 -0
- package/string.d.ts +106 -0
- package/string.lua +34 -0
- package/time/dayOfWeek.d.ts +97 -0
- package/time/dayOfWeek.lua +53 -0
- package/time/localDate.d.ts +145 -0
- package/time/localDate.lua +236 -0
- package/time/localDateTime.d.ts +133 -0
- package/time/localDateTime.lua +154 -0
- package/time/localTime.d.ts +87 -0
- package/time/localTime.lua +91 -0
- package/time/month.d.ts +146 -0
- package/time/month.lua +129 -0
- package/time/year.d.ts +117 -0
- package/time/year.lua +81 -0
- package/types.d.ts +13 -0
- package/types.lua +0 -0
- package/util/objectPool.d.ts +6 -0
- package/util/objectPool.lua +28 -0
- package/util/stream.d.ts +29 -0
- package/util/stream.lua +453 -0
- package/util/stringBuilder.d.ts +8 -0
- package/util/stringBuilder.lua +25 -0
- package/utility/arrays.d.ts +57 -0
- package/utility/arrays.lua +369 -0
- package/utility/base64.d.ts +23 -0
- package/utility/base64.lua +177 -0
- package/utility/bit-set.d.ts +18 -0
- package/utility/bit-set.lua +12 -0
- package/utility/functions.d.ts +5 -0
- package/utility/functions.lua +90 -0
- package/utility/json.d.ts +2 -0
- package/utility/json.lua +400 -0
- package/utility/linked-set.d.ts +49 -0
- package/utility/linked-set.lua +181 -0
- package/utility/lua-maps.d.ts +6 -0
- package/utility/lua-maps.lua +25 -0
- package/utility/lua-sets.d.ts +6 -0
- package/utility/lua-sets.lua +37 -0
- package/utility/lzw.d.ts +2 -0
- package/utility/lzw.lua +161 -0
- package/utility/observable-array.d.ts +17 -0
- package/utility/observable-array.lua +30 -0
- package/utility/preconditions.d.ts +23 -0
- package/utility/preconditions.lua +58 -0
- package/utility/records.d.ts +3 -0
- package/utility/records.lua +9 -0
- package/utility/reflection.d.ts +4 -0
- package/utility/reflection.lua +31 -0
- package/utility/strings.d.ts +2 -0
- package/utility/strings.lua +44 -0
- package/utility/types.d.ts +39 -0
- package/utility/types.lua +2 -0
package/util/stream.lua
ADDED
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__New = ____lualib.__TS__New
|
|
3
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
4
|
+
local Set = ____lualib.Set
|
|
5
|
+
local Map = ____lualib.Map
|
|
6
|
+
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
7
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
8
|
+
local ____exports = {}
|
|
9
|
+
local StreamImpl, EntryStreamImpl
|
|
10
|
+
local ____exception = require("exception")
|
|
11
|
+
local IllegalStateException = ____exception.IllegalStateException
|
|
12
|
+
local ____tostring = _G.tostring
|
|
13
|
+
local concat = table.concat
|
|
14
|
+
local sort = table.sort
|
|
15
|
+
local DONE = {}
|
|
16
|
+
____exports.Stream = {}
|
|
17
|
+
local Stream = ____exports.Stream
|
|
18
|
+
do
|
|
19
|
+
function Stream.of(array)
|
|
20
|
+
local length = #array
|
|
21
|
+
local i = 0
|
|
22
|
+
return __TS__New(
|
|
23
|
+
StreamImpl,
|
|
24
|
+
function()
|
|
25
|
+
if i >= length then
|
|
26
|
+
return DONE
|
|
27
|
+
end
|
|
28
|
+
i = i + 1
|
|
29
|
+
return array[i]
|
|
30
|
+
end
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
function Stream.ofReversed(array)
|
|
34
|
+
local i = #array + 1
|
|
35
|
+
return __TS__New(
|
|
36
|
+
StreamImpl,
|
|
37
|
+
function()
|
|
38
|
+
if i <= 1 then
|
|
39
|
+
return DONE
|
|
40
|
+
end
|
|
41
|
+
i = i - 1
|
|
42
|
+
return array[i]
|
|
43
|
+
end
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
function Stream.ofNullable(element)
|
|
47
|
+
if element then
|
|
48
|
+
local next = true
|
|
49
|
+
return __TS__New(
|
|
50
|
+
StreamImpl,
|
|
51
|
+
function()
|
|
52
|
+
if next then
|
|
53
|
+
next = false
|
|
54
|
+
return element
|
|
55
|
+
end
|
|
56
|
+
return DONE
|
|
57
|
+
end
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
return __TS__New(
|
|
61
|
+
StreamImpl,
|
|
62
|
+
function() return DONE end
|
|
63
|
+
)
|
|
64
|
+
end
|
|
65
|
+
function Stream.range(startInclusive, endExclusive, step)
|
|
66
|
+
if step == nil then
|
|
67
|
+
step = 1
|
|
68
|
+
end
|
|
69
|
+
local i = startInclusive
|
|
70
|
+
return __TS__New(
|
|
71
|
+
StreamImpl,
|
|
72
|
+
function()
|
|
73
|
+
if i >= endExclusive then
|
|
74
|
+
return DONE
|
|
75
|
+
end
|
|
76
|
+
local element = i
|
|
77
|
+
i = i + step
|
|
78
|
+
return element
|
|
79
|
+
end
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
function Stream.rangeClosed(startInclusive, endInclusive, step)
|
|
83
|
+
if step == nil then
|
|
84
|
+
step = 1
|
|
85
|
+
end
|
|
86
|
+
local i = startInclusive
|
|
87
|
+
return __TS__New(
|
|
88
|
+
StreamImpl,
|
|
89
|
+
function()
|
|
90
|
+
if i > endInclusive then
|
|
91
|
+
return DONE
|
|
92
|
+
end
|
|
93
|
+
local element = i
|
|
94
|
+
i = i + step
|
|
95
|
+
return element
|
|
96
|
+
end
|
|
97
|
+
)
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
StreamImpl = __TS__Class()
|
|
101
|
+
StreamImpl.name = "StreamImpl"
|
|
102
|
+
function StreamImpl.prototype.____constructor(self, next)
|
|
103
|
+
self.next = next
|
|
104
|
+
end
|
|
105
|
+
function StreamImpl.prototype.toArray(self)
|
|
106
|
+
local next = self.next
|
|
107
|
+
local array = {}
|
|
108
|
+
local i = 1
|
|
109
|
+
do
|
|
110
|
+
local element = next()
|
|
111
|
+
while element ~= DONE do
|
|
112
|
+
array[i] = element
|
|
113
|
+
i = i + 1
|
|
114
|
+
element = next()
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
return array
|
|
118
|
+
end
|
|
119
|
+
function StreamImpl.prototype.toSet(self)
|
|
120
|
+
local next = self.next
|
|
121
|
+
local set = __TS__New(Set)
|
|
122
|
+
do
|
|
123
|
+
local element = next()
|
|
124
|
+
while element ~= DONE do
|
|
125
|
+
set:add(element)
|
|
126
|
+
element = next()
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
return set
|
|
130
|
+
end
|
|
131
|
+
function StreamImpl.prototype.groupingBy(self, f)
|
|
132
|
+
local next = self.next
|
|
133
|
+
local map = __TS__New(Map)
|
|
134
|
+
do
|
|
135
|
+
local element = next()
|
|
136
|
+
while element ~= DONE do
|
|
137
|
+
local key = f(element)
|
|
138
|
+
local array = map:get(key)
|
|
139
|
+
if array then
|
|
140
|
+
array[#array + 1] = element
|
|
141
|
+
else
|
|
142
|
+
map:set(key, {element})
|
|
143
|
+
end
|
|
144
|
+
element = next()
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
return map
|
|
148
|
+
end
|
|
149
|
+
function StreamImpl.prototype.joining(self, sep)
|
|
150
|
+
local next = self.next
|
|
151
|
+
local array = {}
|
|
152
|
+
do
|
|
153
|
+
local element = next()
|
|
154
|
+
while element ~= DONE do
|
|
155
|
+
array[#array + 1] = ____tostring(element)
|
|
156
|
+
element = next()
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
return concat(array, sep)
|
|
160
|
+
end
|
|
161
|
+
function StreamImpl.prototype.forEach(self, f)
|
|
162
|
+
local next = self.next
|
|
163
|
+
do
|
|
164
|
+
local element = next()
|
|
165
|
+
while element ~= DONE do
|
|
166
|
+
f(element)
|
|
167
|
+
element = next()
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
function StreamImpl.prototype.count(self)
|
|
172
|
+
local next = self.next
|
|
173
|
+
local i = 0
|
|
174
|
+
do
|
|
175
|
+
local element = next()
|
|
176
|
+
while element ~= DONE do
|
|
177
|
+
i = i + 1
|
|
178
|
+
element = next()
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
return i
|
|
182
|
+
end
|
|
183
|
+
function StreamImpl.prototype.findFirst(self)
|
|
184
|
+
local element = self.next()
|
|
185
|
+
local ____temp_0
|
|
186
|
+
if element ~= DONE then
|
|
187
|
+
____temp_0 = element
|
|
188
|
+
else
|
|
189
|
+
____temp_0 = nil
|
|
190
|
+
end
|
|
191
|
+
return ____temp_0
|
|
192
|
+
end
|
|
193
|
+
function StreamImpl.prototype.reduce(self, identity, accumulator)
|
|
194
|
+
local next = self.next
|
|
195
|
+
local result = identity
|
|
196
|
+
do
|
|
197
|
+
local element = next()
|
|
198
|
+
while element ~= DONE do
|
|
199
|
+
result = accumulator(result, element)
|
|
200
|
+
element = next()
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
return result
|
|
204
|
+
end
|
|
205
|
+
function StreamImpl.prototype.peek(self, f)
|
|
206
|
+
local next = self.next
|
|
207
|
+
return __TS__New(
|
|
208
|
+
StreamImpl,
|
|
209
|
+
function()
|
|
210
|
+
local element = next()
|
|
211
|
+
f(element)
|
|
212
|
+
return element
|
|
213
|
+
end
|
|
214
|
+
)
|
|
215
|
+
end
|
|
216
|
+
function StreamImpl.prototype.map(self, f)
|
|
217
|
+
local next = self.next
|
|
218
|
+
return __TS__New(
|
|
219
|
+
StreamImpl,
|
|
220
|
+
function()
|
|
221
|
+
local element = next()
|
|
222
|
+
local ____temp_1
|
|
223
|
+
if element == DONE then
|
|
224
|
+
____temp_1 = DONE
|
|
225
|
+
else
|
|
226
|
+
____temp_1 = f(element)
|
|
227
|
+
end
|
|
228
|
+
return ____temp_1
|
|
229
|
+
end
|
|
230
|
+
)
|
|
231
|
+
end
|
|
232
|
+
function StreamImpl.prototype.filter(self, predicate)
|
|
233
|
+
local next = self.next
|
|
234
|
+
return __TS__New(
|
|
235
|
+
StreamImpl,
|
|
236
|
+
function()
|
|
237
|
+
do
|
|
238
|
+
local element = next()
|
|
239
|
+
while element ~= DONE do
|
|
240
|
+
if predicate(element) then
|
|
241
|
+
return element
|
|
242
|
+
end
|
|
243
|
+
element = next()
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
return DONE
|
|
247
|
+
end
|
|
248
|
+
)
|
|
249
|
+
end
|
|
250
|
+
function StreamImpl.prototype.without(self, value)
|
|
251
|
+
local next = self.next
|
|
252
|
+
return __TS__New(
|
|
253
|
+
StreamImpl,
|
|
254
|
+
function()
|
|
255
|
+
do
|
|
256
|
+
local element = next()
|
|
257
|
+
while element ~= DONE do
|
|
258
|
+
if element ~= value then
|
|
259
|
+
return element
|
|
260
|
+
end
|
|
261
|
+
element = next()
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
return DONE
|
|
265
|
+
end
|
|
266
|
+
)
|
|
267
|
+
end
|
|
268
|
+
function StreamImpl.prototype.nonNull(self)
|
|
269
|
+
local next = self.next
|
|
270
|
+
return __TS__New(
|
|
271
|
+
StreamImpl,
|
|
272
|
+
function()
|
|
273
|
+
do
|
|
274
|
+
local element = next()
|
|
275
|
+
while element ~= DONE do
|
|
276
|
+
if element ~= nil then
|
|
277
|
+
return element
|
|
278
|
+
end
|
|
279
|
+
element = next()
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
return DONE
|
|
283
|
+
end
|
|
284
|
+
)
|
|
285
|
+
end
|
|
286
|
+
function StreamImpl.prototype.distinct(self)
|
|
287
|
+
local next = self.next
|
|
288
|
+
local ____table = {}
|
|
289
|
+
local hasNull = false
|
|
290
|
+
return __TS__New(
|
|
291
|
+
StreamImpl,
|
|
292
|
+
function()
|
|
293
|
+
do
|
|
294
|
+
local element = next()
|
|
295
|
+
while element ~= DONE do
|
|
296
|
+
if element == nil then
|
|
297
|
+
if not hasNull then
|
|
298
|
+
hasNull = true
|
|
299
|
+
return nil
|
|
300
|
+
end
|
|
301
|
+
else
|
|
302
|
+
if not ____table[element] then
|
|
303
|
+
____table[element] = true
|
|
304
|
+
return element
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
element = next()
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
return DONE
|
|
311
|
+
end
|
|
312
|
+
)
|
|
313
|
+
end
|
|
314
|
+
function StreamImpl.prototype.sorted(self)
|
|
315
|
+
local next = self.next
|
|
316
|
+
local list = {}
|
|
317
|
+
local length = -1
|
|
318
|
+
local i = 0
|
|
319
|
+
return __TS__New(
|
|
320
|
+
StreamImpl,
|
|
321
|
+
function()
|
|
322
|
+
if length == -1 then
|
|
323
|
+
length = 1
|
|
324
|
+
do
|
|
325
|
+
local element = next()
|
|
326
|
+
while element ~= DONE do
|
|
327
|
+
list[length] = element
|
|
328
|
+
length = length + 1
|
|
329
|
+
element = next()
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
length = length - 1
|
|
333
|
+
sort(list)
|
|
334
|
+
end
|
|
335
|
+
if i >= length then
|
|
336
|
+
return DONE
|
|
337
|
+
end
|
|
338
|
+
i = i + 1
|
|
339
|
+
return list[i]
|
|
340
|
+
end
|
|
341
|
+
)
|
|
342
|
+
end
|
|
343
|
+
function StreamImpl.prototype.limit(self, n)
|
|
344
|
+
local next = self.next
|
|
345
|
+
return __TS__New(
|
|
346
|
+
StreamImpl,
|
|
347
|
+
function()
|
|
348
|
+
if n > 0 then
|
|
349
|
+
n = n - 1
|
|
350
|
+
return next()
|
|
351
|
+
end
|
|
352
|
+
return DONE
|
|
353
|
+
end
|
|
354
|
+
)
|
|
355
|
+
end
|
|
356
|
+
function StreamImpl.prototype.skip(self, n)
|
|
357
|
+
local next = self.next
|
|
358
|
+
return __TS__New(
|
|
359
|
+
StreamImpl,
|
|
360
|
+
function()
|
|
361
|
+
while n > 0 do
|
|
362
|
+
if next() == DONE then
|
|
363
|
+
return DONE
|
|
364
|
+
end
|
|
365
|
+
n = n - 1
|
|
366
|
+
end
|
|
367
|
+
return next()
|
|
368
|
+
end
|
|
369
|
+
)
|
|
370
|
+
end
|
|
371
|
+
function StreamImpl.prototype.flatMap(self, f)
|
|
372
|
+
local next = self.next
|
|
373
|
+
local subnext
|
|
374
|
+
return __TS__New(
|
|
375
|
+
StreamImpl,
|
|
376
|
+
function()
|
|
377
|
+
do
|
|
378
|
+
while true do
|
|
379
|
+
if not subnext then
|
|
380
|
+
local element = next()
|
|
381
|
+
if element == DONE then
|
|
382
|
+
return DONE
|
|
383
|
+
end
|
|
384
|
+
subnext = f(element).next
|
|
385
|
+
end
|
|
386
|
+
local element = subnext()
|
|
387
|
+
if element ~= DONE then
|
|
388
|
+
return element
|
|
389
|
+
end
|
|
390
|
+
subnext = nil
|
|
391
|
+
end
|
|
392
|
+
end
|
|
393
|
+
end
|
|
394
|
+
)
|
|
395
|
+
end
|
|
396
|
+
____exports.EntryStream = {}
|
|
397
|
+
local EntryStream = ____exports.EntryStream
|
|
398
|
+
do
|
|
399
|
+
function EntryStream.of(map)
|
|
400
|
+
if __TS__InstanceOf(map, Map) then
|
|
401
|
+
local iterator = map:entries()
|
|
402
|
+
return __TS__New(
|
|
403
|
+
EntryStreamImpl,
|
|
404
|
+
function()
|
|
405
|
+
local result = iterator:next()
|
|
406
|
+
if result.done then
|
|
407
|
+
return DONE
|
|
408
|
+
end
|
|
409
|
+
return result.value
|
|
410
|
+
end
|
|
411
|
+
)
|
|
412
|
+
end
|
|
413
|
+
return __TS__New(
|
|
414
|
+
EntryStreamImpl,
|
|
415
|
+
pairs(map)
|
|
416
|
+
)
|
|
417
|
+
end
|
|
418
|
+
end
|
|
419
|
+
EntryStreamImpl = __TS__Class()
|
|
420
|
+
EntryStreamImpl.name = "EntryStreamImpl"
|
|
421
|
+
__TS__ClassExtends(EntryStreamImpl, StreamImpl)
|
|
422
|
+
function EntryStreamImpl.prototype.____constructor(self, next)
|
|
423
|
+
StreamImpl.prototype.____constructor(self, next)
|
|
424
|
+
end
|
|
425
|
+
function EntryStreamImpl.prototype.invert(self)
|
|
426
|
+
local next = self.next
|
|
427
|
+
return __TS__New(
|
|
428
|
+
EntryStreamImpl,
|
|
429
|
+
function()
|
|
430
|
+
local element = next()
|
|
431
|
+
return element == DONE and DONE or ({element[2], element[1]})
|
|
432
|
+
end
|
|
433
|
+
)
|
|
434
|
+
end
|
|
435
|
+
function EntryStreamImpl.prototype.toMap(self)
|
|
436
|
+
local next = self.next
|
|
437
|
+
local map = __TS__New(Map)
|
|
438
|
+
do
|
|
439
|
+
local element = next()
|
|
440
|
+
while element ~= DONE do
|
|
441
|
+
if map:has(element[1]) then
|
|
442
|
+
error(
|
|
443
|
+
__TS__New(IllegalStateException),
|
|
444
|
+
0
|
|
445
|
+
)
|
|
446
|
+
end
|
|
447
|
+
map:set(element[1], element[2])
|
|
448
|
+
element = next()
|
|
449
|
+
end
|
|
450
|
+
end
|
|
451
|
+
return map
|
|
452
|
+
end
|
|
453
|
+
return ____exports
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local ____tostring = _G.tostring
|
|
5
|
+
local concat = table.concat
|
|
6
|
+
____exports.StringBuilder = __TS__Class()
|
|
7
|
+
local StringBuilder = ____exports.StringBuilder
|
|
8
|
+
StringBuilder.name = "StringBuilder"
|
|
9
|
+
function StringBuilder.prototype.____constructor(self)
|
|
10
|
+
self.s = {}
|
|
11
|
+
self.i = 0
|
|
12
|
+
end
|
|
13
|
+
function StringBuilder.prototype.append(self, v)
|
|
14
|
+
local i = self.i + 1
|
|
15
|
+
self.s[i] = ____tostring(v)
|
|
16
|
+
self.i = i
|
|
17
|
+
return self
|
|
18
|
+
end
|
|
19
|
+
function StringBuilder.prototype.clear(self)
|
|
20
|
+
self.i = 0
|
|
21
|
+
end
|
|
22
|
+
function StringBuilder.prototype.__tostring(self)
|
|
23
|
+
return concat(self.s, "", 1, self.i)
|
|
24
|
+
end
|
|
25
|
+
return ____exports
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
2
|
+
/** @noSelfInFile */
|
|
3
|
+
import { TupleOf } from "./types";
|
|
4
|
+
export declare const EMPTY_ARRAY: readonly any[];
|
|
5
|
+
export declare const joinToString: <T>(array: readonly T[], separator: string, transform?: (element: T) => string) => string;
|
|
6
|
+
export declare const arrayOfNotNull: <T>(...elements: readonly (T | null | undefined)[]) => T[];
|
|
7
|
+
export declare const array: <T, N extends number>(length: N, initialize: (index: number) => T) => TupleOf<T, N>;
|
|
8
|
+
export declare const toLuaSet: <T extends AnyNotNil>(array: readonly T[]) => LuaSet<T>;
|
|
9
|
+
export declare const forEach: <T, Args extends any[]>(array: readonly T[], consumerOrKey: KeysOfType<T, (this: T, ...args: Args) => void> | ((value: T, ...args: Args) => void), ...args: Args) => void;
|
|
10
|
+
export declare const all: {
|
|
11
|
+
<T>(array: readonly T[], transform: (value: T) => boolean): boolean;
|
|
12
|
+
<T>(array: readonly T[], key: KeysOfType<T, boolean>): boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const map: {
|
|
15
|
+
<T, R>(array: readonly T[], transform: (value: T) => R): R[];
|
|
16
|
+
<T, K extends keyof T>(array: readonly T[], key: K): T[K][];
|
|
17
|
+
};
|
|
18
|
+
export declare const mapNotNull: {
|
|
19
|
+
<T, R>(array: readonly T[], transform: (value: T) => R | null | undefined): NonNullable<R>[];
|
|
20
|
+
<T, K extends keyof T>(array: readonly T[], key: K): NonNullable<T[K]>[];
|
|
21
|
+
};
|
|
22
|
+
export declare const mapToLuaSet: {
|
|
23
|
+
<T, R extends AnyNotNil>(array: readonly T[], transform: (value: T) => R): LuaSet<R>;
|
|
24
|
+
<T, K extends KeysOfType<T, AnyNotNil>>(array: readonly T[], key: K): LuaSet<T[K] extends AnyNotNil ? T[K] : never>;
|
|
25
|
+
};
|
|
26
|
+
export declare const flatMap: {
|
|
27
|
+
<T, R>(array: readonly T[], transform: (value: T) => readonly R[]): R[];
|
|
28
|
+
<T, K extends KeysOfType<T, readonly any[]>>(array: readonly T[], key: K): (T[K] extends readonly (infer R)[] ? R : never)[];
|
|
29
|
+
};
|
|
30
|
+
export declare const flatMapToLuaSet: {
|
|
31
|
+
<T, R extends AnyNotNil>(array: readonly T[], transform: (value: T) => readonly R[]): LuaSet<R>;
|
|
32
|
+
<T, K extends KeysOfType<T, readonly AnyNotNil[]>>(array: readonly T[], key: K): LuaSet<T[K] extends readonly (infer R extends AnyNotNil)[] ? R : never>;
|
|
33
|
+
};
|
|
34
|
+
export declare const mapIndexed: <T, R>(array: readonly T[], transform: (index: number, value: T) => R) => R[];
|
|
35
|
+
export declare const associate: <T, K extends AnyNotNil, V>(array: readonly T[], keySelector: (value: T) => K, valueSelector: (value: T) => V) => LuaMap<K, V>;
|
|
36
|
+
export declare const associateBy: <K extends AnyNotNil, V>(array: readonly V[], keySelector: (value: V) => K) => LuaMap<K, V>;
|
|
37
|
+
export declare const associateByIndexed: <K extends AnyNotNil, V>(array: readonly V[], keySelector: (index: number, value: V) => K) => LuaMap<K, V>;
|
|
38
|
+
export declare const associateWith: <K extends AnyNotNil, V>(array: readonly K[], valueSelector: (value: K) => V) => LuaMap<K, V>;
|
|
39
|
+
export declare const associateWithIndexed: <K extends AnyNotNil, V>(array: readonly K[], valueSelector: (index: number, value: K) => V) => LuaMap<K, V>;
|
|
40
|
+
export declare const filter: <T>(array: readonly T[], predicate: (value: T) => boolean) => T[];
|
|
41
|
+
export declare const average: (array: readonly number[]) => number;
|
|
42
|
+
export declare const sum: (array: readonly number[]) => number;
|
|
43
|
+
export declare const product: (array: readonly number[]) => number;
|
|
44
|
+
export declare const max: (array: readonly number[]) => number;
|
|
45
|
+
export declare const intersperse: <T>(array: readonly T[], delimiter: T) => T[];
|
|
46
|
+
export declare const zip: <T, R, V>(array: readonly T[], otherArray: readonly R[], transform: (value: T, otherValue: R) => V) => V[];
|
|
47
|
+
export declare const chunked: <T>(array: readonly T[], size: number) => T[][];
|
|
48
|
+
export declare const sortBy: <T, R>(array: T[], selector: KeysOfType<T, R> | ((value: T) => R)) => void;
|
|
49
|
+
export declare const sortedBy: {
|
|
50
|
+
<T, R>(array: readonly T[], selector: (value: T) => R): T[];
|
|
51
|
+
<T, K extends keyof T>(array: readonly T[], key: K): T[];
|
|
52
|
+
};
|
|
53
|
+
export declare const partition: {
|
|
54
|
+
<T>(array: readonly T[], predicate: (value: T) => boolean): LuaMultiReturn<[T[], T[]]>;
|
|
55
|
+
<T, K extends KeysOfType<T, boolean>>(array: readonly T[], key: K): LuaMultiReturn<[T[], T[]]>;
|
|
56
|
+
};
|
|
57
|
+
export declare const distinct: <T extends AnyNotNil>(array: readonly T[]) => T[];
|