isaacscript-common 2.3.0 → 3.0.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/cachedClasses.d.ts +37 -0
- package/cachedClasses.lua +30 -0
- package/callbacks/customRevive.d.ts +1 -0
- package/callbacks/customRevive.lua +147 -0
- package/callbacks/itemPickup.d.ts +1 -0
- package/callbacks/itemPickup.lua +66 -0
- package/callbacks/postBombInitLate.d.ts +1 -0
- package/callbacks/postBombInitLate.lua +33 -0
- package/callbacks/postBoneSwing.d.ts +1 -0
- package/callbacks/postBoneSwing.lua +50 -0
- package/callbacks/postCollectibleInitFirst.d.ts +1 -0
- package/callbacks/postCollectibleInitFirst.lua +34 -0
- package/callbacks/postCursedTeleport.d.ts +1 -0
- package/callbacks/postCursedTeleport.lua +121 -0
- package/callbacks/postCustomDoorEnter.d.ts +50 -0
- package/callbacks/postCustomDoorEnter.lua +247 -0
- package/callbacks/postDoorRender.d.ts +1 -0
- package/callbacks/postDoorRender.lua +26 -0
- package/callbacks/postDoorUpdate.d.ts +1 -0
- package/callbacks/postDoorUpdate.lua +26 -0
- package/callbacks/postEffectInitLate.d.ts +1 -0
- package/callbacks/postEffectInitLate.lua +33 -0
- package/callbacks/postEffectStateChanged.d.ts +1 -0
- package/callbacks/postEffectStateChanged.lua +39 -0
- package/callbacks/postEsauJr.d.ts +1 -0
- package/callbacks/postEsauJr.lua +69 -0
- package/callbacks/postFamiliarInitLate.d.ts +1 -0
- package/callbacks/postFamiliarInitLate.lua +33 -0
- package/callbacks/postFamiliarStateChanged.d.ts +1 -0
- package/callbacks/postFamiliarStateChanged.lua +39 -0
- package/callbacks/postFlip.d.ts +1 -0
- package/callbacks/postFlip.lua +63 -0
- package/callbacks/postGreedModeWave.d.ts +1 -0
- package/callbacks/postGreedModeWave.lua +34 -0
- package/callbacks/postGridEntity.d.ts +1 -0
- package/callbacks/postGridEntity.lua +107 -0
- package/callbacks/postGridEntityCollision.d.ts +1 -0
- package/callbacks/postGridEntityCollision.lua +67 -0
- package/callbacks/postGridEntityRender.d.ts +1 -0
- package/callbacks/postGridEntityRender.lua +26 -0
- package/callbacks/postHolyMantleRemoved.d.ts +1 -0
- package/callbacks/postHolyMantleRemoved.lua +41 -0
- package/callbacks/postItemDischarged.d.ts +2 -0
- package/callbacks/postItemDischarged.lua +104 -0
- package/callbacks/postKnifeInitLate.d.ts +1 -0
- package/callbacks/postKnifeInitLate.lua +33 -0
- package/callbacks/postLaserInitLate.d.ts +1 -0
- package/callbacks/postLaserInitLate.lua +33 -0
- package/callbacks/postNPCInitLate.d.ts +1 -0
- package/callbacks/postNPCInitLate.lua +33 -0
- package/callbacks/postNPCStateChanged.d.ts +1 -0
- package/callbacks/postNPCStateChanged.lua +39 -0
- package/callbacks/postNewRoomEarly.d.ts +1 -0
- package/callbacks/postNewRoomEarly.lua +67 -0
- package/callbacks/postPickupCollect.d.ts +1 -0
- package/callbacks/postPickupCollect.lua +41 -0
- package/callbacks/postPickupInitLate.d.ts +1 -0
- package/callbacks/postPickupInitLate.lua +33 -0
- package/callbacks/postPickupStateChanged.d.ts +1 -0
- package/callbacks/postPickupStateChanged.lua +39 -0
- package/callbacks/postPitRender.d.ts +1 -0
- package/callbacks/postPitRender.lua +26 -0
- package/callbacks/postPitUpdate.d.ts +1 -0
- package/callbacks/postPitUpdate.lua +26 -0
- package/callbacks/postPlayerChangeHealth.d.ts +1 -0
- package/callbacks/postPlayerChangeHealth.lua +52 -0
- package/callbacks/postPlayerChangeType.d.ts +1 -0
- package/callbacks/postPlayerChangeType.lua +41 -0
- package/callbacks/postPlayerFatalDamage.d.ts +1 -0
- package/callbacks/postPlayerFatalDamage.lua +73 -0
- package/callbacks/postPlayerInitLate.d.ts +1 -0
- package/callbacks/postPlayerInitLate.lua +35 -0
- package/callbacks/postPlayerReordered.d.ts +1 -0
- package/callbacks/postPlayerReordered.lua +114 -0
- package/callbacks/postPoopRender.d.ts +1 -0
- package/callbacks/postPoopRender.lua +26 -0
- package/callbacks/postPoopUpdate.d.ts +1 -0
- package/callbacks/postPoopUpdate.lua +26 -0
- package/callbacks/postPressurePlateRender.d.ts +1 -0
- package/callbacks/postPressurePlateRender.lua +26 -0
- package/callbacks/postPressurePlateUpdate.d.ts +1 -0
- package/callbacks/postPressurePlateUpdate.lua +26 -0
- package/callbacks/postProjectileInitLate.d.ts +1 -0
- package/callbacks/postProjectileInitLate.lua +33 -0
- package/callbacks/postPurchase.d.ts +1 -0
- package/callbacks/postPurchase.lua +51 -0
- package/callbacks/postRockRender.d.ts +1 -0
- package/callbacks/postRockRender.lua +26 -0
- package/callbacks/postRockUpdate.d.ts +1 -0
- package/callbacks/postRockUpdate.lua +26 -0
- package/callbacks/postRoomClearChanged.d.ts +1 -0
- package/callbacks/postRoomClearChanged.lua +42 -0
- package/callbacks/postSacrifice.d.ts +1 -0
- package/callbacks/postSacrifice.lua +44 -0
- package/callbacks/postSlotInitUpdate.d.ts +1 -0
- package/callbacks/postSlotInitUpdate.lua +53 -0
- package/callbacks/postSlotRender.d.ts +1 -0
- package/callbacks/postSlotRender.lua +76 -0
- package/callbacks/postSpikesRender.d.ts +1 -0
- package/callbacks/postSpikesRender.lua +26 -0
- package/callbacks/postSpikesUpdate.d.ts +1 -0
- package/callbacks/postSpikesUpdate.lua +26 -0
- package/callbacks/postTNTRender.d.ts +1 -0
- package/callbacks/postTNTRender.lua +26 -0
- package/callbacks/postTNTUpdate.d.ts +1 -0
- package/callbacks/postTNTUpdate.lua +26 -0
- package/callbacks/postTearInitLate.d.ts +1 -0
- package/callbacks/postTearInitLate.lua +33 -0
- package/callbacks/postTearInitVeryLate.d.ts +1 -0
- package/callbacks/postTearInitVeryLate.lua +36 -0
- package/callbacks/postTransformation.d.ts +1 -0
- package/callbacks/postTransformation.lua +48 -0
- package/callbacks/postTrinketBreak.d.ts +1 -0
- package/callbacks/postTrinketBreak.lua +72 -0
- package/callbacks/preBerserkDeath.d.ts +1 -0
- package/callbacks/preBerserkDeath.lua +38 -0
- package/callbacks/preNewLevel.d.ts +1 -0
- package/callbacks/preNewLevel.lua +45 -0
- package/callbacks/reorderedCallbacks.d.ts +20 -0
- package/callbacks/reorderedCallbacks.lua +108 -0
- package/callbacks/subscriptions/postBombInitLate.d.ts +5 -0
- package/callbacks/subscriptions/postBombInitLate.lua +29 -0
- package/callbacks/subscriptions/postBoneSwing.d.ts +4 -0
- package/callbacks/subscriptions/postBoneSwing.lua +22 -0
- package/callbacks/subscriptions/postCollectibleInitFirst.d.ts +5 -0
- package/callbacks/subscriptions/postCollectibleInitFirst.lua +29 -0
- package/callbacks/subscriptions/postCursedTeleport.d.ts +4 -0
- package/callbacks/subscriptions/postCursedTeleport.lua +22 -0
- package/callbacks/subscriptions/postCustomDoorEnter.d.ts +5 -0
- package/callbacks/subscriptions/postCustomDoorEnter.lua +35 -0
- package/callbacks/subscriptions/postCustomRevive.d.ts +5 -0
- package/callbacks/subscriptions/postCustomRevive.lua +29 -0
- package/callbacks/subscriptions/postDoorRender.d.ts +5 -0
- package/callbacks/subscriptions/postDoorRender.lua +30 -0
- package/callbacks/subscriptions/postDoorUpdate.d.ts +5 -0
- package/callbacks/subscriptions/postDoorUpdate.lua +30 -0
- package/callbacks/subscriptions/postEffectInitLate.d.ts +5 -0
- package/callbacks/subscriptions/postEffectInitLate.lua +29 -0
- package/callbacks/subscriptions/postEffectStateChanged.d.ts +5 -0
- package/callbacks/subscriptions/postEffectStateChanged.lua +29 -0
- package/callbacks/subscriptions/postEsauJr.d.ts +4 -0
- package/callbacks/subscriptions/postEsauJr.lua +22 -0
- package/callbacks/subscriptions/postFamiliarInitLate.d.ts +5 -0
- package/callbacks/subscriptions/postFamiliarInitLate.lua +29 -0
- package/callbacks/subscriptions/postFamiliarStateChanged.d.ts +5 -0
- package/callbacks/subscriptions/postFamiliarStateChanged.lua +29 -0
- package/callbacks/subscriptions/postFirstEsauJr.d.ts +4 -0
- package/callbacks/subscriptions/postFirstEsauJr.lua +22 -0
- package/callbacks/subscriptions/postFirstFlip.d.ts +4 -0
- package/callbacks/subscriptions/postFirstFlip.lua +22 -0
- package/callbacks/subscriptions/postFlip.d.ts +4 -0
- package/callbacks/subscriptions/postFlip.lua +22 -0
- package/callbacks/subscriptions/postGameStartedReordered.d.ts +3 -0
- package/callbacks/subscriptions/postGameStartedReordered.lua +22 -0
- package/callbacks/subscriptions/postGreedModeWave.d.ts +4 -0
- package/callbacks/subscriptions/postGreedModeWave.lua +22 -0
- package/callbacks/subscriptions/postGridEntityBroken.d.ts +6 -0
- package/callbacks/subscriptions/postGridEntityBroken.lua +35 -0
- package/callbacks/subscriptions/postGridEntityCollision.d.ts +6 -0
- package/callbacks/subscriptions/postGridEntityCollision.lua +35 -0
- package/callbacks/subscriptions/postGridEntityInit.d.ts +6 -0
- package/callbacks/subscriptions/postGridEntityInit.lua +35 -0
- package/callbacks/subscriptions/postGridEntityRemove.d.ts +6 -0
- package/callbacks/subscriptions/postGridEntityRemove.lua +33 -0
- package/callbacks/subscriptions/postGridEntityRender.d.ts +6 -0
- package/callbacks/subscriptions/postGridEntityRender.lua +35 -0
- package/callbacks/subscriptions/postGridEntityStateChanged.d.ts +6 -0
- package/callbacks/subscriptions/postGridEntityStateChanged.lua +35 -0
- package/callbacks/subscriptions/postGridEntityUpdate.d.ts +6 -0
- package/callbacks/subscriptions/postGridEntityUpdate.lua +35 -0
- package/callbacks/subscriptions/postHolyMantleRemoved.d.ts +6 -0
- package/callbacks/subscriptions/postHolyMantleRemoved.lua +34 -0
- package/callbacks/subscriptions/postItemDischarged.d.ts +5 -0
- package/callbacks/subscriptions/postItemDischarged.lua +29 -0
- package/callbacks/subscriptions/postItemPickup.d.ts +11 -0
- package/callbacks/subscriptions/postItemPickup.lua +33 -0
- package/callbacks/subscriptions/postKnifeInitLate.d.ts +5 -0
- package/callbacks/subscriptions/postKnifeInitLate.lua +29 -0
- package/callbacks/subscriptions/postLaserInitLate.d.ts +5 -0
- package/callbacks/subscriptions/postLaserInitLate.lua +29 -0
- package/callbacks/subscriptions/postNPCInitLate.d.ts +5 -0
- package/callbacks/subscriptions/postNPCInitLate.lua +29 -0
- package/callbacks/subscriptions/postNPCStateChanged.d.ts +6 -0
- package/callbacks/subscriptions/postNPCStateChanged.lua +33 -0
- package/callbacks/subscriptions/postNewLevelReordered.d.ts +1 -0
- package/callbacks/subscriptions/postNewLevelReordered.lua +22 -0
- package/callbacks/subscriptions/postNewRoomEarly.d.ts +1 -0
- package/callbacks/subscriptions/postNewRoomEarly.lua +22 -0
- package/callbacks/subscriptions/postNewRoomReordered.d.ts +1 -0
- package/callbacks/subscriptions/postNewRoomReordered.lua +22 -0
- package/callbacks/subscriptions/postPEffectUpdateReordered.d.ts +6 -0
- package/callbacks/subscriptions/postPEffectUpdateReordered.lua +34 -0
- package/callbacks/subscriptions/postPickupCollect.d.ts +4 -0
- package/callbacks/subscriptions/postPickupCollect.lua +29 -0
- package/callbacks/subscriptions/postPickupInitLate.d.ts +3 -0
- package/callbacks/subscriptions/postPickupInitLate.lua +29 -0
- package/callbacks/subscriptions/postPickupStateChanged.d.ts +5 -0
- package/callbacks/subscriptions/postPickupStateChanged.lua +29 -0
- package/callbacks/subscriptions/postPitRender.d.ts +5 -0
- package/callbacks/subscriptions/postPitRender.lua +30 -0
- package/callbacks/subscriptions/postPitUpdate.d.ts +5 -0
- package/callbacks/subscriptions/postPitUpdate.lua +30 -0
- package/callbacks/subscriptions/postPlayerChangeHealth.d.ts +7 -0
- package/callbacks/subscriptions/postPlayerChangeHealth.lua +34 -0
- package/callbacks/subscriptions/postPlayerChangeType.d.ts +5 -0
- package/callbacks/subscriptions/postPlayerChangeType.lua +29 -0
- package/callbacks/subscriptions/postPlayerFatalDamage.d.ts +6 -0
- package/callbacks/subscriptions/postPlayerFatalDamage.lua +45 -0
- package/callbacks/subscriptions/postPlayerInitLate.d.ts +6 -0
- package/callbacks/subscriptions/postPlayerInitLate.lua +34 -0
- package/callbacks/subscriptions/postPlayerInitReordered.d.ts +6 -0
- package/callbacks/subscriptions/postPlayerInitReordered.lua +34 -0
- package/callbacks/subscriptions/postPlayerRenderReordered.d.ts +6 -0
- package/callbacks/subscriptions/postPlayerRenderReordered.lua +34 -0
- package/callbacks/subscriptions/postPlayerUpdateReordered.d.ts +6 -0
- package/callbacks/subscriptions/postPlayerUpdateReordered.lua +34 -0
- package/callbacks/subscriptions/postPoopRender.d.ts +5 -0
- package/callbacks/subscriptions/postPoopRender.lua +30 -0
- package/callbacks/subscriptions/postPoopUpdate.d.ts +5 -0
- package/callbacks/subscriptions/postPoopUpdate.lua +30 -0
- package/callbacks/subscriptions/postPressurePlateRender.d.ts +5 -0
- package/callbacks/subscriptions/postPressurePlateRender.lua +30 -0
- package/callbacks/subscriptions/postPressurePlateUpdate.d.ts +5 -0
- package/callbacks/subscriptions/postPressurePlateUpdate.lua +30 -0
- package/callbacks/subscriptions/postProjectileInitLate.d.ts +5 -0
- package/callbacks/subscriptions/postProjectileInitLate.lua +29 -0
- package/callbacks/subscriptions/postPurchase.d.ts +6 -0
- package/callbacks/subscriptions/postPurchase.lua +22 -0
- package/callbacks/subscriptions/postRockRender.d.ts +5 -0
- package/callbacks/subscriptions/postRockRender.lua +30 -0
- package/callbacks/subscriptions/postRockUpdate.d.ts +5 -0
- package/callbacks/subscriptions/postRockUpdate.lua +30 -0
- package/callbacks/subscriptions/postRoomClearChanged.d.ts +3 -0
- package/callbacks/subscriptions/postRoomClearChanged.lua +22 -0
- package/callbacks/subscriptions/postSacrifice.d.ts +6 -0
- package/callbacks/subscriptions/postSacrifice.lua +34 -0
- package/callbacks/subscriptions/postSlotAnimationChanged.d.ts +5 -0
- package/callbacks/subscriptions/postSlotAnimationChanged.lua +29 -0
- package/callbacks/subscriptions/postSlotDestroyed.d.ts +5 -0
- package/callbacks/subscriptions/postSlotDestroyed.lua +29 -0
- package/callbacks/subscriptions/postSlotInit.d.ts +5 -0
- package/callbacks/subscriptions/postSlotInit.lua +29 -0
- package/callbacks/subscriptions/postSlotRender.d.ts +5 -0
- package/callbacks/subscriptions/postSlotRender.lua +29 -0
- package/callbacks/subscriptions/postSlotUpdate.d.ts +5 -0
- package/callbacks/subscriptions/postSlotUpdate.lua +29 -0
- package/callbacks/subscriptions/postSpikesRender.d.ts +5 -0
- package/callbacks/subscriptions/postSpikesRender.lua +30 -0
- package/callbacks/subscriptions/postSpikesUpdate.d.ts +5 -0
- package/callbacks/subscriptions/postSpikesUpdate.lua +30 -0
- package/callbacks/subscriptions/postTNTRender.d.ts +5 -0
- package/callbacks/subscriptions/postTNTRender.lua +30 -0
- package/callbacks/subscriptions/postTNTUpdate.d.ts +5 -0
- package/callbacks/subscriptions/postTNTUpdate.lua +30 -0
- package/callbacks/subscriptions/postTearInitLate.d.ts +5 -0
- package/callbacks/subscriptions/postTearInitLate.lua +29 -0
- package/callbacks/subscriptions/postTearInitVeryLate.d.ts +5 -0
- package/callbacks/subscriptions/postTearInitVeryLate.lua +29 -0
- package/callbacks/subscriptions/postTransformation.d.ts +5 -0
- package/callbacks/subscriptions/postTransformation.lua +29 -0
- package/callbacks/subscriptions/postTrinketBreak.d.ts +5 -0
- package/callbacks/subscriptions/postTrinketBreak.lua +29 -0
- package/callbacks/subscriptions/preBerserkDeath.d.ts +6 -0
- package/callbacks/subscriptions/preBerserkDeath.lua +35 -0
- package/callbacks/subscriptions/preCustomRevive.d.ts +6 -0
- package/callbacks/subscriptions/preCustomRevive.lua +38 -0
- package/callbacks/subscriptions/preItemPickup.d.ts +11 -0
- package/callbacks/subscriptions/preItemPickup.lua +33 -0
- package/callbacks/subscriptions/preNewLevel.d.ts +4 -0
- package/callbacks/subscriptions/preNewLevel.lua +22 -0
- package/classes/DefaultMap.d.ts +110 -0
- package/classes/DefaultMap.lua +135 -0
- package/classes/ModUpgraded.d.ts +23 -0
- package/classes/ModUpgraded.lua +43 -0
- package/constants.d.ts +104 -0
- package/constants.lua +86 -0
- package/constantsFirstLast.d.ts +130 -0
- package/constantsFirstLast.lua +113 -0
- package/enums/HealthType.d.ts +16 -0
- package/enums/HealthType.lua +24 -0
- package/enums/ModCallbackCustom.d.ts +860 -0
- package/enums/ModCallbackCustom.lua +159 -0
- package/enums/PocketItemType.d.ts +8 -0
- package/enums/PocketItemType.lua +15 -0
- package/enums/SerializationType.d.ts +5 -0
- package/enums/SerializationType.lua +9 -0
- package/enums/private/CopyableIsaacAPIClassType.d.ts +7 -0
- package/enums/private/CopyableIsaacAPIClassType.lua +8 -0
- package/enums/private/SaveDataKey.d.ts +7 -0
- package/enums/private/SaveDataKey.lua +11 -0
- package/enums/private/SerializationBrand.d.ts +37 -0
- package/enums/private/SerializationBrand.lua +17 -0
- package/features/characterHealthConversion.d.ts +9 -0
- package/features/characterHealthConversion.lua +91 -0
- package/features/characterStats.d.ts +19 -0
- package/features/characterStats.lua +54 -0
- package/features/debugDisplay/debugDisplay.d.ts +2 -0
- package/features/debugDisplay/debugDisplay.lua +181 -0
- package/features/debugDisplay/exports.d.ts +199 -0
- package/features/debugDisplay/exports.lua +223 -0
- package/features/debugDisplay/v.d.ts +44 -0
- package/features/debugDisplay/v.lua +54 -0
- package/features/deployJSONRoom.d.ts +65 -0
- package/features/deployJSONRoom.lua +519 -0
- package/features/disableInputs.d.ts +62 -0
- package/features/disableInputs.lua +134 -0
- package/features/disableSound.d.ts +18 -0
- package/features/disableSound.lua +62 -0
- package/features/extraConsoleCommands/commandsDisplay.d.ts +162 -0
- package/features/extraConsoleCommands/commandsDisplay.lua +219 -0
- package/features/extraConsoleCommands/commandsSubroutines.d.ts +9 -0
- package/features/extraConsoleCommands/commandsSubroutines.lua +129 -0
- package/features/extraConsoleCommands/init.d.ts +26 -0
- package/features/extraConsoleCommands/init.lua +265 -0
- package/features/extraConsoleCommands/listCommands.d.ts +349 -0
- package/features/extraConsoleCommands/listCommands.lua +1094 -0
- package/features/extraConsoleCommands/v.d.ts +13 -0
- package/features/extraConsoleCommands/v.lua +10 -0
- package/features/fadeInRemover.d.ts +14 -0
- package/features/fadeInRemover.lua +55 -0
- package/features/fastReset.d.ts +14 -0
- package/features/fastReset.lua +59 -0
- package/features/forgottenSwitch.d.ts +5 -0
- package/features/forgottenSwitch.lua +32 -0
- package/features/getCollectibleItemPoolType.d.ts +7 -0
- package/features/getCollectibleItemPoolType.lua +48 -0
- package/features/playerInventory.d.ts +23 -0
- package/features/playerInventory.lua +147 -0
- package/features/ponyDetection.d.ts +6 -0
- package/features/ponyDetection.lua +53 -0
- package/features/preventCollectibleRotation.d.ts +11 -0
- package/features/preventCollectibleRotation.lua +67 -0
- package/features/runInNFrames.d.ts +61 -0
- package/features/runInNFrames.lua +128 -0
- package/features/saveDataManager/constants.d.ts +3 -0
- package/features/saveDataManager/constants.lua +5 -0
- package/features/saveDataManager/exports.d.ts +131 -0
- package/features/saveDataManager/exports.lua +181 -0
- package/features/saveDataManager/load.d.ts +4 -0
- package/features/saveDataManager/load.lua +66 -0
- package/features/saveDataManager/main.d.ts +3 -0
- package/features/saveDataManager/main.lua +125 -0
- package/features/saveDataManager/maps.d.ts +10 -0
- package/features/saveDataManager/maps.lua +11 -0
- package/features/saveDataManager/merge.d.ts +24 -0
- package/features/saveDataManager/merge.lua +144 -0
- package/features/saveDataManager/save.d.ts +4 -0
- package/features/saveDataManager/save.lua +44 -0
- package/features/saveDataManager/serializationBrand.d.ts +1 -0
- package/features/saveDataManager/serializationBrand.lua +17 -0
- package/features/sirenHelpers.d.ts +18 -0
- package/features/sirenHelpers.lua +82 -0
- package/features/taintedLazarusPlayers.d.ts +13 -0
- package/features/taintedLazarusPlayers.lua +85 -0
- package/featuresInitialized.d.ts +1 -0
- package/featuresInitialized.lua +20 -0
- package/functions/array.d.ts +141 -0
- package/functions/array.lua +354 -0
- package/functions/benchmark.d.ts +10 -0
- package/functions/benchmark.lua +38 -0
- package/functions/bitwise.d.ts +4 -0
- package/functions/bitwise.lua +21 -0
- package/functions/boss.d.ts +56 -0
- package/functions/boss.lua +218 -0
- package/functions/cacheFlag.d.ts +8 -0
- package/functions/cacheFlag.lua +11 -0
- package/functions/cards.d.ts +95 -0
- package/functions/cards.lua +234 -0
- package/functions/challenges.d.ts +3 -0
- package/functions/challenges.lua +10 -0
- package/functions/character.d.ts +48 -0
- package/functions/character.lua +96 -0
- package/functions/charge.d.ts +54 -0
- package/functions/charge.lua +162 -0
- package/functions/chargeBar.d.ts +12 -0
- package/functions/chargeBar.lua +47 -0
- package/functions/collectibleCacheFlag.d.ts +23 -0
- package/functions/collectibleCacheFlag.lua +80 -0
- package/functions/collectibleSet.d.ts +9 -0
- package/functions/collectibleSet.lua +54 -0
- package/functions/collectibleTag.d.ts +16 -0
- package/functions/collectibleTag.lua +83 -0
- package/functions/collectibles.d.ts +211 -0
- package/functions/collectibles.lua +412 -0
- package/functions/color.d.ts +45 -0
- package/functions/color.lua +140 -0
- package/functions/debug.d.ts +27 -0
- package/functions/debug.lua +49 -0
- package/functions/deepCopy.d.ts +29 -0
- package/functions/deepCopy.lua +382 -0
- package/functions/deepCopyTests.d.ts +1 -0
- package/functions/deepCopyTests.lua +316 -0
- package/functions/direction.d.ts +4 -0
- package/functions/direction.lua +17 -0
- package/functions/doors.d.ts +117 -0
- package/functions/doors.lua +284 -0
- package/functions/easing.d.ts +30 -0
- package/functions/easing.lua +115 -0
- package/functions/eden.d.ts +3 -0
- package/functions/eden.lua +47 -0
- package/functions/entity.d.ts +131 -0
- package/functions/entity.lua +321 -0
- package/functions/entitySpecific.d.ts +264 -0
- package/functions/entitySpecific.lua +832 -0
- package/functions/entityTypes.d.ts +3 -0
- package/functions/entityTypes.lua +8 -0
- package/functions/enums.d.ts +80 -0
- package/functions/enums.lua +147 -0
- package/functions/familiars.d.ts +60 -0
- package/functions/familiars.lua +85 -0
- package/functions/flag.d.ts +99 -0
- package/functions/flag.lua +124 -0
- package/functions/flying.d.ts +19 -0
- package/functions/flying.lua +77 -0
- package/functions/globals.d.ts +14 -0
- package/functions/globals.lua +236 -0
- package/functions/gridEntity.d.ts +155 -0
- package/functions/gridEntity.lua +368 -0
- package/functions/gridEntitySpecific.d.ts +18 -0
- package/functions/gridEntitySpecific.lua +96 -0
- package/functions/input.d.ts +32 -0
- package/functions/input.lua +117 -0
- package/functions/isaacAPIClass.d.ts +23 -0
- package/functions/isaacAPIClass.lua +47 -0
- package/functions/jsonHelpers.d.ts +18 -0
- package/functions/jsonHelpers.lua +37 -0
- package/functions/jsonRoom.d.ts +12 -0
- package/functions/jsonRoom.lua +91 -0
- package/functions/kColor.d.ts +31 -0
- package/functions/kColor.lua +110 -0
- package/functions/language.d.ts +8 -0
- package/functions/language.lua +13 -0
- package/functions/level.d.ts +1 -0
- package/functions/level.lua +29 -0
- package/functions/log.d.ts +78 -0
- package/functions/log.lua +547 -0
- package/functions/map.d.ts +22 -0
- package/functions/map.lua +61 -0
- package/functions/math.d.ts +50 -0
- package/functions/math.lua +118 -0
- package/functions/mergeTests.d.ts +1 -0
- package/functions/mergeTests.lua +182 -0
- package/functions/npc.d.ts +40 -0
- package/functions/npc.lua +128 -0
- package/functions/pickupVariants.d.ts +23 -0
- package/functions/pickupVariants.lua +48 -0
- package/functions/pickups.d.ts +132 -0
- package/functions/pickups.lua +474 -0
- package/functions/pills.d.ts +69 -0
- package/functions/pills.lua +128 -0
- package/functions/player.d.ts +296 -0
- package/functions/player.lua +777 -0
- package/functions/playerDataStructures.d.ts +92 -0
- package/functions/playerDataStructures.lua +103 -0
- package/functions/playerHealth.d.ts +22 -0
- package/functions/playerHealth.lua +296 -0
- package/functions/playerIndex.d.ts +68 -0
- package/functions/playerIndex.lua +174 -0
- package/functions/pocketItems.d.ts +33 -0
- package/functions/pocketItems.lua +104 -0
- package/functions/positionVelocity.d.ts +64 -0
- package/functions/positionVelocity.lua +154 -0
- package/functions/random.d.ts +42 -0
- package/functions/random.lua +70 -0
- package/functions/revive.d.ts +31 -0
- package/functions/revive.lua +117 -0
- package/functions/rng.d.ts +53 -0
- package/functions/rng.lua +148 -0
- package/functions/roomData.d.ts +108 -0
- package/functions/roomData.lua +160 -0
- package/functions/roomGrid.d.ts +40 -0
- package/functions/roomGrid.lua +80 -0
- package/functions/roomShape.d.ts +43 -0
- package/functions/roomShape.lua +67 -0
- package/functions/rooms.d.ts +194 -0
- package/functions/rooms.lua +482 -0
- package/functions/run.d.ts +12 -0
- package/functions/run.lua +33 -0
- package/functions/seeds.d.ts +9 -0
- package/functions/seeds.lua +19 -0
- package/functions/serialization.d.ts +11 -0
- package/functions/serialization.lua +69 -0
- package/functions/set.d.ts +39 -0
- package/functions/set.lua +83 -0
- package/functions/sound.d.ts +1 -0
- package/functions/sound.lua +13 -0
- package/functions/spawnCollectible.d.ts +31 -0
- package/functions/spawnCollectible.lua +94 -0
- package/functions/sprite.d.ts +36 -0
- package/functions/sprite.lua +89 -0
- package/functions/stage.d.ts +35 -0
- package/functions/stage.lua +86 -0
- package/functions/string.d.ts +13 -0
- package/functions/string.lua +42 -0
- package/functions/table.d.ts +36 -0
- package/functions/table.lua +98 -0
- package/functions/tears.d.ts +22 -0
- package/functions/tears.lua +26 -0
- package/functions/transformations.d.ts +30 -0
- package/functions/transformations.lua +114 -0
- package/functions/trinketCacheFlag.d.ts +10 -0
- package/functions/trinketCacheFlag.lua +53 -0
- package/functions/trinketGive.d.ts +38 -0
- package/functions/trinketGive.lua +114 -0
- package/functions/trinkets.d.ts +73 -0
- package/functions/trinkets.lua +167 -0
- package/functions/tstlClass.d.ts +20 -0
- package/functions/tstlClass.lua +65 -0
- package/functions/ui.d.ts +34 -0
- package/functions/ui.lua +111 -0
- package/functions/utils.d.ts +113 -0
- package/functions/utils.lua +182 -0
- package/functions/vector.d.ts +32 -0
- package/functions/vector.lua +127 -0
- package/index.d.ts +129 -0
- package/index.lua +900 -0
- package/initCustomCallbacks.d.ts +2 -0
- package/initCustomCallbacks.lua +178 -0
- package/initFeatures.d.ts +3 -0
- package/initFeatures.lua +51 -0
- package/interfaces/AddCallbackParameterCustom.d.ts +153 -0
- package/interfaces/AddCallbackParameterCustom.lua +4 -0
- package/interfaces/ChargeBarSprites.d.ts +13 -0
- package/interfaces/ChargeBarSprites.lua +2 -0
- package/interfaces/JSONDoor.d.ts +11 -0
- package/interfaces/JSONDoor.lua +2 -0
- package/interfaces/JSONEntity.d.ts +13 -0
- package/interfaces/JSONEntity.lua +2 -0
- package/interfaces/JSONRoom.d.ts +26 -0
- package/interfaces/JSONRoom.lua +2 -0
- package/interfaces/JSONRooms.d.ts +11 -0
- package/interfaces/JSONRooms.lua +2 -0
- package/interfaces/JSONSpawn.d.ts +11 -0
- package/interfaces/JSONSpawn.lua +2 -0
- package/interfaces/PlayerHealth.d.ts +15 -0
- package/interfaces/PlayerHealth.lua +2 -0
- package/interfaces/PocketItemDescription.d.ts +8 -0
- package/interfaces/PocketItemDescription.lua +2 -0
- package/interfaces/SaveData.d.ts +29 -0
- package/interfaces/SaveData.lua +2 -0
- package/interfaces/TrinketSituation.d.ts +8 -0
- package/interfaces/TrinketSituation.lua +2 -0
- package/interfaces/private/TSTLClassMetatable.d.ts +10 -0
- package/interfaces/private/TSTLClassMetatable.lua +2 -0
- package/lualib_bundle.lua +2475 -0
- package/maps/cardMap.d.ts +3 -0
- package/maps/cardMap.lua +212 -0
- package/maps/characterMap.d.ts +3 -0
- package/maps/characterMap.lua +90 -0
- package/maps/collectibleDescriptionMap.d.ts +3 -0
- package/maps/collectibleDescriptionMap.lua +728 -0
- package/maps/collectibleNameMap.d.ts +3 -0
- package/maps/collectibleNameMap.lua +728 -0
- package/maps/defaultPlayerStatMap.d.ts +3 -0
- package/maps/defaultPlayerStatMap.lua +25 -0
- package/maps/gridEntityTypeToBrokenStateMap.d.ts +2 -0
- package/maps/gridEntityTypeToBrokenStateMap.lua +26 -0
- package/maps/gridEntityXMLMap.d.ts +9 -0
- package/maps/gridEntityXMLMap.lua +53 -0
- package/maps/pillEffectMap.d.ts +3 -0
- package/maps/pillEffectMap.lua +90 -0
- package/maps/roomShapeToTopLeftWallGridIndexMap.d.ts +7 -0
- package/maps/roomShapeToTopLeftWallGridIndexMap.lua +17 -0
- package/maps/roomTypeMap.d.ts +3 -0
- package/maps/roomTypeMap.lua +45 -0
- package/maps/trinketDescriptionMap.d.ts +3 -0
- package/maps/trinketDescriptionMap.lua +196 -0
- package/maps/trinketNameMap.d.ts +3 -0
- package/maps/trinketNameMap.lua +196 -0
- package/objects/LRoomShapeToRectangles.d.ts +13 -0
- package/objects/LRoomShapeToRectangles.lua +35 -0
- package/objects/callbackRegisterFunctions.d.ts +5 -0
- package/objects/callbackRegisterFunctions.lua +231 -0
- package/objects/cardDescriptions.d.ts +5 -0
- package/objects/cardDescriptions.lua +105 -0
- package/objects/cardNames.d.ts +5 -0
- package/objects/cardNames.lua +105 -0
- package/objects/cardTypes.d.ts +5 -0
- package/objects/cardTypes.lua +106 -0
- package/objects/challengeNames.d.ts +5 -0
- package/objects/challengeNames.lua +53 -0
- package/objects/characterNames.d.ts +5 -0
- package/objects/characterNames.lua +49 -0
- package/objects/coinSubTypeToValue.d.ts +5 -0
- package/objects/coinSubTypeToValue.lua +15 -0
- package/objects/colors.d.ts +17 -0
- package/objects/colors.lua +16 -0
- package/objects/directionNames.d.ts +4 -0
- package/objects/directionNames.lua +11 -0
- package/objects/directionToDegrees.d.ts +4 -0
- package/objects/directionToDegrees.lua +11 -0
- package/objects/directionToVector.d.ts +4 -0
- package/objects/directionToVector.lua +13 -0
- package/objects/doorSlotFlagToDoorSlot.d.ts +5 -0
- package/objects/doorSlotFlagToDoorSlot.lua +16 -0
- package/objects/doorSlotToDirection.d.ts +4 -0
- package/objects/doorSlotToDirection.lua +16 -0
- package/objects/isaacAPIClassTypeToBrand.d.ts +5 -0
- package/objects/isaacAPIClassTypeToBrand.lua +7 -0
- package/objects/isaacAPIClassTypeToCopyFunction.d.ts +5 -0
- package/objects/isaacAPIClassTypeToCopyFunction.lua +13 -0
- package/objects/languageNames.d.ts +4 -0
- package/objects/languageNames.lua +13 -0
- package/objects/pillEffectClasses.d.ts +5 -0
- package/objects/pillEffectClasses.lua +59 -0
- package/objects/pillEffectNames.d.ts +5 -0
- package/objects/pillEffectNames.lua +57 -0
- package/objects/pillEffectTypes.d.ts +5 -0
- package/objects/pillEffectTypes.lua +58 -0
- package/objects/roomShapeBounds.d.ts +8 -0
- package/objects/roomShapeBounds.lua +26 -0
- package/objects/roomShapeLayoutSizes.d.ts +10 -0
- package/objects/roomShapeLayoutSizes.lua +29 -0
- package/objects/roomShapeToBottomRightPosition.d.ts +8 -0
- package/objects/roomShapeToBottomRightPosition.lua +22 -0
- package/objects/roomShapeToDoorSlots.d.ts +4 -0
- package/objects/roomShapeToDoorSlots.lua +46 -0
- package/objects/roomShapeToDoorSlotsToGridIndexDelta.d.ts +8 -0
- package/objects/roomShapeToDoorSlotsToGridIndexDelta.lua +89 -0
- package/objects/roomShapeToGridWidth.d.ts +4 -0
- package/objects/roomShapeToGridWidth.lua +20 -0
- package/objects/roomShapeToTopLeftPosition.d.ts +8 -0
- package/objects/roomShapeToTopLeftPosition.lua +24 -0
- package/objects/roomShapeVolumes.d.ts +13 -0
- package/objects/roomShapeVolumes.lua +30 -0
- package/objects/roomTypeNames.d.ts +5 -0
- package/objects/roomTypeNames.lua +37 -0
- package/objects/serializedIsaacAPIClassTypeToIdentityFunction.d.ts +4 -0
- package/objects/serializedIsaacAPIClassTypeToIdentityFunction.lua +13 -0
- package/objects/stageTypeToLetter.d.ts +4 -0
- package/objects/stageTypeToLetter.lua +12 -0
- package/objects/transformationNames.d.ts +5 -0
- package/objects/transformationNames.lua +21 -0
- package/package.json +3 -4
- package/patchErrorFunctions.d.ts +1 -0
- package/patchErrorFunctions.lua +58 -0
- package/sets/LRoomShapesSet.d.ts +2 -0
- package/sets/LRoomShapesSet.lua +8 -0
- package/sets/bossSets.d.ts +4 -0
- package/sets/bossSets.lua +554 -0
- package/sets/charactersThatStartWithAnActiveItemSet.d.ts +2 -0
- package/sets/charactersThatStartWithAnActiveItemSet.lua +20 -0
- package/sets/charactersWithBlackHeartFromEternalHeartSet.d.ts +2 -0
- package/sets/charactersWithBlackHeartFromEternalHeartSet.lua +8 -0
- package/sets/charactersWithFreeDevilDealsSet.d.ts +2 -0
- package/sets/charactersWithFreeDevilDealsSet.lua +8 -0
- package/sets/charactersWithNoRedHeartsSet.d.ts +6 -0
- package/sets/charactersWithNoRedHeartsSet.lua +19 -0
- package/sets/charactersWithNoSoulHeartsSet.d.ts +6 -0
- package/sets/charactersWithNoSoulHeartsSet.lua +16 -0
- package/sets/chestPickupVariantsSet.d.ts +2 -0
- package/sets/chestPickupVariantsSet.lua +21 -0
- package/sets/familiarsThatShootPlayerTearsSet.d.ts +2 -0
- package/sets/familiarsThatShootPlayerTearsSet.lua +17 -0
- package/sets/lostStyleCharactersSet.d.ts +6 -0
- package/sets/lostStyleCharactersSet.lua +16 -0
- package/sets/mineShaftRoomSubTypesSet.d.ts +2 -0
- package/sets/mineShaftRoomSubTypesSet.lua +14 -0
- package/sets/redHeartSubTypesSet.d.ts +2 -0
- package/sets/redHeartSubTypesSet.lua +8 -0
- package/sets/sinEntityTypesSet.d.ts +2 -0
- package/sets/sinEntityTypesSet.lua +16 -0
- package/sets/singleUseActiveCollectibleTypesSet.d.ts +2 -0
- package/sets/singleUseActiveCollectibleTypesSet.lua +17 -0
- package/sets/storyBossesSet.d.ts +2 -0
- package/sets/storyBossesSet.lua +22 -0
- package/types/AnyEntity.d.ts +2 -0
- package/types/AnyEntity.lua +2 -0
- package/types/CollectibleIndex.d.ts +16 -0
- package/types/CollectibleIndex.lua +2 -0
- package/types/PickingUpItem.d.ts +34 -0
- package/types/PickingUpItem.lua +34 -0
- package/types/PlayerIndex.d.ts +16 -0
- package/types/PlayerIndex.lua +2 -0
- package/types/private/IsaacAPIClass.d.ts +4 -0
- package/types/private/IsaacAPIClass.lua +2 -0
- package/types/private/SerializedIsaacAPIClass.d.ts +4 -0
- package/types/private/SerializedIsaacAPIClass.lua +2 -0
- package/types/private/TSTLClass.d.ts +4 -0
- package/types/private/TSTLClass.lua +2 -0
- package/upgradeMod.d.ts +23 -0
- package/upgradeMod.lua +51 -0
- package/.eslintrc.js +0 -70
- package/build.sh +0 -27
- package/docs.sh +0 -21
- package/lint.sh +0 -34
- package/project.json +0 -37
- package/release.sh +0 -16
- package/scripts/.eslintrc.js +0 -21
- package/scripts/docsEntryPointLint.ts +0 -135
- package/scripts/tsconfig.json +0 -5
- package/src/cachedClasses.ts +0 -39
- package/src/callbacks/customRevive.ts +0 -206
- package/src/callbacks/itemPickup.ts +0 -101
- package/src/callbacks/postBombInitLate.ts +0 -36
- package/src/callbacks/postBoneSwing.ts +0 -64
- package/src/callbacks/postCollectibleInitFirst.ts +0 -39
- package/src/callbacks/postCursedTeleport.ts +0 -183
- package/src/callbacks/postCustomDoorEnter.ts +0 -297
- package/src/callbacks/postDoorRender.ts +0 -26
- package/src/callbacks/postDoorUpdate.ts +0 -26
- package/src/callbacks/postEffectInitLate.ts +0 -36
- package/src/callbacks/postEffectStateChanged.ts +0 -43
- package/src/callbacks/postEsauJr.ts +0 -107
- package/src/callbacks/postFamiliarInitLate.ts +0 -36
- package/src/callbacks/postFamiliarStateChanged.ts +0 -43
- package/src/callbacks/postFlip.ts +0 -88
- package/src/callbacks/postGreedModeWave.ts +0 -41
- package/src/callbacks/postGridEntity.ts +0 -159
- package/src/callbacks/postGridEntityCollision.ts +0 -69
- package/src/callbacks/postGridEntityRender.ts +0 -26
- package/src/callbacks/postHolyMantleRemoved.ts +0 -55
- package/src/callbacks/postItemDischarged.ts +0 -149
- package/src/callbacks/postKnifeInitLate.ts +0 -36
- package/src/callbacks/postLaserInitLate.ts +0 -36
- package/src/callbacks/postNPCInitLate.ts +0 -36
- package/src/callbacks/postNPCStateChanged.ts +0 -42
- package/src/callbacks/postNewRoomEarly.ts +0 -90
- package/src/callbacks/postPickupCollect.ts +0 -48
- package/src/callbacks/postPickupInitLate.ts +0 -36
- package/src/callbacks/postPickupStateChanged.ts +0 -43
- package/src/callbacks/postPitRender.ts +0 -26
- package/src/callbacks/postPitUpdate.ts +0 -26
- package/src/callbacks/postPlayerChangeHealth.ts +0 -62
- package/src/callbacks/postPlayerChangeType.ts +0 -56
- package/src/callbacks/postPlayerFatalDamage.ts +0 -98
- package/src/callbacks/postPlayerInitLate.ts +0 -37
- package/src/callbacks/postPlayerReordered.ts +0 -142
- package/src/callbacks/postPoopRender.ts +0 -26
- package/src/callbacks/postPoopUpdate.ts +0 -26
- package/src/callbacks/postPressurePlateRender.ts +0 -26
- package/src/callbacks/postPressurePlateUpdate.ts +0 -26
- package/src/callbacks/postProjectileInitLate.ts +0 -36
- package/src/callbacks/postPurchase.ts +0 -64
- package/src/callbacks/postRockRender.ts +0 -26
- package/src/callbacks/postRockUpdate.ts +0 -26
- package/src/callbacks/postRoomClearChanged.ts +0 -52
- package/src/callbacks/postSacrifice.ts +0 -62
- package/src/callbacks/postSlotInitUpdate.ts +0 -63
- package/src/callbacks/postSlotRender.ts +0 -96
- package/src/callbacks/postSpikesRender.ts +0 -26
- package/src/callbacks/postSpikesUpdate.ts +0 -26
- package/src/callbacks/postTNTRender.ts +0 -26
- package/src/callbacks/postTNTUpdate.ts +0 -26
- package/src/callbacks/postTearInitLate.ts +0 -36
- package/src/callbacks/postTearInitVeryLate.ts +0 -41
- package/src/callbacks/postTransformation.ts +0 -59
- package/src/callbacks/postTrinketBreak.ts +0 -110
- package/src/callbacks/preBerserkDeath.ts +0 -49
- package/src/callbacks/preNewLevel.ts +0 -55
- package/src/callbacks/reorderedCallbacks.ts +0 -166
- package/src/callbacks/subscriptions/postBombInitLate.ts +0 -32
- package/src/callbacks/subscriptions/postBoneSwing.ts +0 -24
- package/src/callbacks/subscriptions/postCollectibleInitFirst.ts +0 -37
- package/src/callbacks/subscriptions/postCursedTeleport.ts +0 -24
- package/src/callbacks/subscriptions/postCustomDoorEnter.ts +0 -45
- package/src/callbacks/subscriptions/postCustomRevive.ts +0 -36
- package/src/callbacks/subscriptions/postDoorRender.ts +0 -35
- package/src/callbacks/subscriptions/postDoorUpdate.ts +0 -35
- package/src/callbacks/subscriptions/postEffectInitLate.ts +0 -32
- package/src/callbacks/subscriptions/postEffectStateChanged.ts +0 -40
- package/src/callbacks/subscriptions/postEsauJr.ts +0 -24
- package/src/callbacks/subscriptions/postFamiliarInitLate.ts +0 -32
- package/src/callbacks/subscriptions/postFamiliarStateChanged.ts +0 -40
- package/src/callbacks/subscriptions/postFirstEsauJr.ts +0 -24
- package/src/callbacks/subscriptions/postFirstFlip.ts +0 -24
- package/src/callbacks/subscriptions/postFlip.ts +0 -22
- package/src/callbacks/subscriptions/postGameStartedReordered.ts +0 -24
- package/src/callbacks/subscriptions/postGreedModeWave.ts +0 -24
- package/src/callbacks/subscriptions/postGridEntityBroken.ts +0 -51
- package/src/callbacks/subscriptions/postGridEntityCollision.ts +0 -54
- package/src/callbacks/subscriptions/postGridEntityInit.ts +0 -51
- package/src/callbacks/subscriptions/postGridEntityRemove.ts +0 -52
- package/src/callbacks/subscriptions/postGridEntityRender.ts +0 -51
- package/src/callbacks/subscriptions/postGridEntityStateChanged.ts +0 -55
- package/src/callbacks/subscriptions/postGridEntityUpdate.ts +0 -51
- package/src/callbacks/subscriptions/postHolyMantleRemoved.ts +0 -48
- package/src/callbacks/subscriptions/postItemDischarged.ts +0 -43
- package/src/callbacks/subscriptions/postItemPickup.ts +0 -64
- package/src/callbacks/subscriptions/postKnifeInitLate.ts +0 -32
- package/src/callbacks/subscriptions/postLaserInitLate.ts +0 -32
- package/src/callbacks/subscriptions/postNPCInitLate.ts +0 -32
- package/src/callbacks/subscriptions/postNPCStateChanged.ts +0 -42
- package/src/callbacks/subscriptions/postNewLevelReordered.ts +0 -22
- package/src/callbacks/subscriptions/postNewRoomEarly.ts +0 -22
- package/src/callbacks/subscriptions/postNewRoomReordered.ts +0 -22
- package/src/callbacks/subscriptions/postPEffectUpdateReordered.ts +0 -40
- package/src/callbacks/subscriptions/postPickupCollect.ts +0 -34
- package/src/callbacks/subscriptions/postPickupInitLate.ts +0 -31
- package/src/callbacks/subscriptions/postPickupStateChanged.ts +0 -35
- package/src/callbacks/subscriptions/postPitRender.ts +0 -35
- package/src/callbacks/subscriptions/postPitUpdate.ts +0 -35
- package/src/callbacks/subscriptions/postPlayerChangeHealth.ts +0 -45
- package/src/callbacks/subscriptions/postPlayerChangeType.ts +0 -40
- package/src/callbacks/subscriptions/postPlayerFatalDamage.ts +0 -67
- package/src/callbacks/subscriptions/postPlayerInitLate.ts +0 -40
- package/src/callbacks/subscriptions/postPlayerInitReordered.ts +0 -40
- package/src/callbacks/subscriptions/postPlayerRenderReordered.ts +0 -40
- package/src/callbacks/subscriptions/postPlayerUpdateReordered.ts +0 -40
- package/src/callbacks/subscriptions/postPoopRender.ts +0 -35
- package/src/callbacks/subscriptions/postPoopUpdate.ts +0 -35
- package/src/callbacks/subscriptions/postPressurePlateRender.ts +0 -37
- package/src/callbacks/subscriptions/postPressurePlateUpdate.ts +0 -37
- package/src/callbacks/subscriptions/postProjectileInitLate.ts +0 -35
- package/src/callbacks/subscriptions/postPurchase.ts +0 -31
- package/src/callbacks/subscriptions/postRockRender.ts +0 -35
- package/src/callbacks/subscriptions/postRockUpdate.ts +0 -35
- package/src/callbacks/subscriptions/postRoomClearChanged.ts +0 -24
- package/src/callbacks/subscriptions/postSacrifice.ts +0 -43
- package/src/callbacks/subscriptions/postSlotAnimationChanged.ts +0 -40
- package/src/callbacks/subscriptions/postSlotDestroyed.ts +0 -32
- package/src/callbacks/subscriptions/postSlotInit.ts +0 -32
- package/src/callbacks/subscriptions/postSlotRender.ts +0 -32
- package/src/callbacks/subscriptions/postSlotUpdate.ts +0 -32
- package/src/callbacks/subscriptions/postSpikesRender.ts +0 -35
- package/src/callbacks/subscriptions/postSpikesUpdate.ts +0 -35
- package/src/callbacks/subscriptions/postTNTRender.ts +0 -35
- package/src/callbacks/subscriptions/postTNTUpdate.ts +0 -35
- package/src/callbacks/subscriptions/postTearInitLate.ts +0 -32
- package/src/callbacks/subscriptions/postTearInitVeryLate.ts +0 -32
- package/src/callbacks/subscriptions/postTransformation.ts +0 -40
- package/src/callbacks/subscriptions/postTrinketBreak.ts +0 -38
- package/src/callbacks/subscriptions/preBerserkDeath.ts +0 -42
- package/src/callbacks/subscriptions/preCustomRevive.ts +0 -45
- package/src/callbacks/subscriptions/preItemPickup.ts +0 -64
- package/src/callbacks/subscriptions/preNewLevel.ts +0 -24
- package/src/classes/DefaultMap.ts +0 -220
- package/src/classes/ModUpgraded.ts +0 -83
- package/src/constants.ts +0 -140
- package/src/constantsFirstLast.ts +0 -212
- package/src/enums/HealthType.ts +0 -16
- package/src/enums/ModCallbackCustom.ts +0 -943
- package/src/enums/PocketItemType.ts +0 -8
- package/src/enums/SerializationType.ts +0 -5
- package/src/enums/private/CopyableIsaacAPIClassType.ts +0 -7
- package/src/enums/private/SaveDataKey.ts +0 -14
- package/src/enums/private/SerializationBrand.ts +0 -42
- package/src/features/characterHealthConversion.ts +0 -116
- package/src/features/characterStats.ts +0 -61
- package/src/features/debugDisplay/debugDisplay.ts +0 -221
- package/src/features/debugDisplay/exports.ts +0 -368
- package/src/features/debugDisplay/v.ts +0 -65
- package/src/features/deployJSONRoom.ts +0 -672
- package/src/features/disableInputs.ts +0 -193
- package/src/features/disableSound.ts +0 -77
- package/src/features/extraConsoleCommands/commandsDisplay.ts +0 -290
- package/src/features/extraConsoleCommands/commandsSubroutines.ts +0 -139
- package/src/features/extraConsoleCommands/init.ts +0 -334
- package/src/features/extraConsoleCommands/listCommands.ts +0 -1298
- package/src/features/extraConsoleCommands/v.ts +0 -14
- package/src/features/fadeInRemover.ts +0 -60
- package/src/features/fastReset.ts +0 -75
- package/src/features/forgottenSwitch.ts +0 -50
- package/src/features/getCollectibleItemPoolType.ts +0 -66
- package/src/features/playerInventory.ts +0 -187
- package/src/features/ponyDetection.ts +0 -74
- package/src/features/preventCollectibleRotation.ts +0 -113
- package/src/features/runInNFrames.ts +0 -148
- package/src/features/saveDataManager/constants.ts +0 -4
- package/src/features/saveDataManager/exports.ts +0 -230
- package/src/features/saveDataManager/load.ts +0 -90
- package/src/features/saveDataManager/main.ts +0 -187
- package/src/features/saveDataManager/maps.ts +0 -13
- package/src/features/saveDataManager/merge.ts +0 -182
- package/src/features/saveDataManager/save.ts +0 -66
- package/src/features/saveDataManager/serializationBrand.ts +0 -15
- package/src/features/sirenHelpers.ts +0 -129
- package/src/features/taintedLazarusPlayers.ts +0 -113
- package/src/featuresInitialized.ts +0 -20
- package/src/functions/array.ts +0 -412
- package/src/functions/benchmark.ts +0 -36
- package/src/functions/bitwise.ts +0 -24
- package/src/functions/boss.ts +0 -227
- package/src/functions/cacheFlag.ts +0 -12
- package/src/functions/cards.ts +0 -267
- package/src/functions/challenges.ts +0 -11
- package/src/functions/character.ts +0 -124
- package/src/functions/charge.ts +0 -237
- package/src/functions/chargeBar.ts +0 -67
- package/src/functions/collectibleCacheFlag.ts +0 -90
- package/src/functions/collectibleSet.ts +0 -57
- package/src/functions/collectibleTag.ts +0 -89
- package/src/functions/collectibles.ts +0 -610
- package/src/functions/color.ts +0 -149
- package/src/functions/debug.ts +0 -65
- package/src/functions/deepCopy.ts +0 -508
- package/src/functions/deepCopyTests.ts +0 -390
- package/src/functions/direction.ts +0 -16
- package/src/functions/doors.ts +0 -343
- package/src/functions/easing.ts +0 -182
- package/src/functions/eden.ts +0 -47
- package/src/functions/entity.ts +0 -352
- package/src/functions/entitySpecific.ts +0 -889
- package/src/functions/entityTypes.ts +0 -6
- package/src/functions/enums.ts +0 -145
- package/src/functions/familiars.ts +0 -106
- package/src/functions/flag.ts +0 -165
- package/src/functions/flying.ts +0 -117
- package/src/functions/globals.ts +0 -249
- package/src/functions/gridEntity.ts +0 -511
- package/src/functions/gridEntitySpecific.ts +0 -112
- package/src/functions/input.ts +0 -139
- package/src/functions/isaacAPIClass.ts +0 -65
- package/src/functions/jsonHelpers.ts +0 -45
- package/src/functions/jsonRoom.ts +0 -100
- package/src/functions/kColor.ts +0 -130
- package/src/functions/language.ts +0 -13
- package/src/functions/level.ts +0 -31
- package/src/functions/log.ts +0 -660
- package/src/functions/map.ts +0 -56
- package/src/functions/math.ts +0 -149
- package/src/functions/mergeTests.ts +0 -288
- package/src/functions/npc.ts +0 -148
- package/src/functions/pickupVariants.ts +0 -60
- package/src/functions/pickups.ts +0 -449
- package/src/functions/pills.ts +0 -182
- package/src/functions/player.ts +0 -975
- package/src/functions/playerDataStructures.ts +0 -150
- package/src/functions/playerHealth.ts +0 -318
- package/src/functions/playerIndex.ts +0 -195
- package/src/functions/pocketItems.ts +0 -149
- package/src/functions/positionVelocity.ts +0 -188
- package/src/functions/random.ts +0 -77
- package/src/functions/revive.ts +0 -201
- package/src/functions/rng.ts +0 -177
- package/src/functions/roomData.ts +0 -199
- package/src/functions/roomGrid.ts +0 -109
- package/src/functions/roomShape.ts +0 -80
- package/src/functions/rooms.ts +0 -667
- package/src/functions/run.ts +0 -36
- package/src/functions/seeds.ts +0 -19
- package/src/functions/serialization.ts +0 -97
- package/src/functions/set.ts +0 -95
- package/src/functions/sound.ts +0 -9
- package/src/functions/spawnCollectible.ts +0 -104
- package/src/functions/sprite.ts +0 -107
- package/src/functions/stage.ts +0 -125
- package/src/functions/string.ts +0 -47
- package/src/functions/table.ts +0 -139
- package/src/functions/tears.ts +0 -32
- package/src/functions/transformations.ts +0 -137
- package/src/functions/trinketCacheFlag.ts +0 -60
- package/src/functions/trinketGive.ts +0 -157
- package/src/functions/trinkets.ts +0 -215
- package/src/functions/tstlClass.ts +0 -91
- package/src/functions/ui.ts +0 -138
- package/src/functions/utils.ts +0 -200
- package/src/functions/vector.ts +0 -145
- package/src/index.ts +0 -162
- package/src/initCustomCallbacks.ts +0 -120
- package/src/initFeatures.ts +0 -37
- package/src/interfaces/AddCallbackParameterCustom.ts +0 -174
- package/src/interfaces/ChargeBarSprites.ts +0 -12
- package/src/interfaces/JSONDoor.ts +0 -13
- package/src/interfaces/JSONEntity.ts +0 -16
- package/src/interfaces/JSONRoom.ts +0 -36
- package/src/interfaces/JSONRooms.ts +0 -12
- package/src/interfaces/JSONSpawn.ts +0 -14
- package/src/interfaces/PlayerHealth.ts +0 -16
- package/src/interfaces/PocketItemDescription.ts +0 -9
- package/src/interfaces/SaveData.ts +0 -29
- package/src/interfaces/TrinketSituation.ts +0 -9
- package/src/interfaces/private/TSTLClassMetatable.ts +0 -8
- package/src/maps/cardMap.ts +0 -209
- package/src/maps/characterMap.ts +0 -87
- package/src/maps/collectibleDescriptionMap.ts +0 -732
- package/src/maps/collectibleNameMap.ts +0 -731
- package/src/maps/defaultPlayerStatMap.ts +0 -17
- package/src/maps/gridEntityTypeToBrokenStateMap.ts +0 -50
- package/src/maps/gridEntityXMLMap.ts +0 -176
- package/src/maps/pillEffectMap.ts +0 -88
- package/src/maps/roomShapeToTopLeftWallGridIndexMap.ts +0 -18
- package/src/maps/roomTypeMap.ts +0 -40
- package/src/maps/trinketDescriptionMap.ts +0 -200
- package/src/maps/trinketNameMap.ts +0 -198
- package/src/objects/LRoomShapeToRectangles.ts +0 -44
- package/src/objects/callbackRegisterFunctions.ts +0 -171
- package/src/objects/cardDescriptions.ts +0 -105
- package/src/objects/cardNames.ts +0 -105
- package/src/objects/cardTypes.ts +0 -104
- package/src/objects/challengeNames.ts +0 -52
- package/src/objects/characterNames.ts +0 -48
- package/src/objects/coinSubTypeToValue.ts +0 -14
- package/src/objects/colors.ts +0 -16
- package/src/objects/directionNames.ts +0 -11
- package/src/objects/directionToDegrees.ts +0 -11
- package/src/objects/directionToVector.ts +0 -12
- package/src/objects/doorSlotFlagToDoorSlot.ts +0 -16
- package/src/objects/doorSlotToDirection.ts +0 -14
- package/src/objects/isaacAPIClassTypeToBrand.ts +0 -11
- package/src/objects/isaacAPIClassTypeToCopyFunction.ts +0 -18
- package/src/objects/languageNames.ts +0 -13
- package/src/objects/pillEffectClasses.ts +0 -63
- package/src/objects/pillEffectNames.ts +0 -57
- package/src/objects/pillEffectTypes.ts +0 -62
- package/src/objects/roomShapeBounds.ts +0 -71
- package/src/objects/roomShapeLayoutSizes.ts +0 -45
- package/src/objects/roomShapeToBottomRightPosition.ts +0 -25
- package/src/objects/roomShapeToDoorSlots.ts +0 -83
- package/src/objects/roomShapeToDoorSlotsToGridIndexDelta.ts +0 -127
- package/src/objects/roomShapeToGridWidth.ts +0 -21
- package/src/objects/roomShapeToTopLeftPosition.ts +0 -26
- package/src/objects/roomShapeVolumes.ts +0 -38
- package/src/objects/roomTypeNames.ts +0 -36
- package/src/objects/serializedIsaacAPIClassTypeToIdentityFunction.ts +0 -14
- package/src/objects/stageTypeToLetter.ts +0 -15
- package/src/objects/transformationNames.ts +0 -20
- package/src/patchErrorFunctions.ts +0 -92
- package/src/sets/LRoomShapesSet.ts +0 -8
- package/src/sets/bossSets.ts +0 -470
- package/src/sets/charactersThatStartWithAnActiveItemSet.ts +0 -16
- package/src/sets/charactersWithBlackHeartFromEternalHeartSet.ts +0 -7
- package/src/sets/charactersWithFreeDevilDealsSet.ts +0 -4
- package/src/sets/charactersWithNoRedHeartsSet.ts +0 -17
- package/src/sets/charactersWithNoSoulHeartsSet.ts +0 -14
- package/src/sets/chestPickupVariantsSet.ts +0 -16
- package/src/sets/familiarsThatShootPlayerTearsSet.ts +0 -13
- package/src/sets/lostStyleCharactersSet.ts +0 -13
- package/src/sets/mineShaftRoomSubTypesSet.ts +0 -10
- package/src/sets/redHeartSubTypesSet.ts +0 -7
- package/src/sets/sinEntityTypesSet.ts +0 -11
- package/src/sets/singleUseActiveCollectibleTypesSet.ts +0 -13
- package/src/sets/storyBossesSet.ts +0 -17
- package/src/types/AnyEntity.ts +0 -12
- package/src/types/AwaitingTextInput.d.ts +0 -2
- package/src/types/CollectibleIndex.ts +0 -14
- package/src/types/PickingUpItem.ts +0 -89
- package/src/types/PlayerIndex.ts +0 -13
- package/src/types/private/IsaacAPIClass.ts +0 -3
- package/src/types/private/SerializedIsaacAPIClass.ts +0 -3
- package/src/types/private/TSTLClass.ts +0 -3
- package/src/upgradeMod.ts +0 -55
- package/tsconfig.json +0 -42
- package/typedoc.json +0 -158
- package/website-root.md +0 -11
|
@@ -0,0 +1,2475 @@
|
|
|
1
|
+
local function __TS__ArrayIsArray(value)
|
|
2
|
+
return type(value) == "table" and (value[1] ~= nil or next(value) == nil)
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
local function __TS__ArrayConcat(self, ...)
|
|
6
|
+
local items = {...}
|
|
7
|
+
local result = {}
|
|
8
|
+
local len = 0
|
|
9
|
+
for i = 1, #self do
|
|
10
|
+
len = len + 1
|
|
11
|
+
result[len] = self[i]
|
|
12
|
+
end
|
|
13
|
+
for i = 1, #items do
|
|
14
|
+
local item = items[i]
|
|
15
|
+
if __TS__ArrayIsArray(item) then
|
|
16
|
+
for j = 1, #item do
|
|
17
|
+
len = len + 1
|
|
18
|
+
result[len] = item[j]
|
|
19
|
+
end
|
|
20
|
+
else
|
|
21
|
+
len = len + 1
|
|
22
|
+
result[len] = item
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
return result
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
local __TS__Symbol, Symbol
|
|
29
|
+
do
|
|
30
|
+
local symbolMetatable = {__tostring = function(self)
|
|
31
|
+
return ("Symbol(" .. (self.description or "")) .. ")"
|
|
32
|
+
end}
|
|
33
|
+
function __TS__Symbol(description)
|
|
34
|
+
return setmetatable({description = description}, symbolMetatable)
|
|
35
|
+
end
|
|
36
|
+
Symbol = {
|
|
37
|
+
iterator = __TS__Symbol("Symbol.iterator"),
|
|
38
|
+
hasInstance = __TS__Symbol("Symbol.hasInstance"),
|
|
39
|
+
species = __TS__Symbol("Symbol.species"),
|
|
40
|
+
toStringTag = __TS__Symbol("Symbol.toStringTag")
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
local function __TS__ArrayEntries(array)
|
|
45
|
+
local key = 0
|
|
46
|
+
return {
|
|
47
|
+
[Symbol.iterator] = function(self)
|
|
48
|
+
return self
|
|
49
|
+
end,
|
|
50
|
+
next = function(self)
|
|
51
|
+
local result = {done = array[key + 1] == nil, value = {key, array[key + 1]}}
|
|
52
|
+
key = key + 1
|
|
53
|
+
return result
|
|
54
|
+
end
|
|
55
|
+
}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
local function __TS__ArrayEvery(self, callbackfn, thisArg)
|
|
59
|
+
for i = 1, #self do
|
|
60
|
+
if not callbackfn(thisArg, self[i], i - 1, self) then
|
|
61
|
+
return false
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
return true
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
local function __TS__ArrayFilter(self, callbackfn, thisArg)
|
|
68
|
+
local result = {}
|
|
69
|
+
local len = 0
|
|
70
|
+
for i = 1, #self do
|
|
71
|
+
if callbackfn(thisArg, self[i], i - 1, self) then
|
|
72
|
+
len = len + 1
|
|
73
|
+
result[len] = self[i]
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
return result
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
local function __TS__ArrayForEach(self, callbackFn, thisArg)
|
|
80
|
+
for i = 1, #self do
|
|
81
|
+
callbackFn(thisArg, self[i], i - 1, self)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
local function __TS__ArrayFind(self, predicate, thisArg)
|
|
86
|
+
for i = 1, #self do
|
|
87
|
+
local elem = self[i]
|
|
88
|
+
if predicate(thisArg, elem, i - 1, self) then
|
|
89
|
+
return elem
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
return nil
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
local function __TS__ArrayFindIndex(self, callbackFn, thisArg)
|
|
96
|
+
for i = 1, #self do
|
|
97
|
+
if callbackFn(thisArg, self[i], i - 1, self) then
|
|
98
|
+
return i - 1
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
return -1
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
local __TS__Iterator
|
|
105
|
+
do
|
|
106
|
+
local function iteratorGeneratorStep(self)
|
|
107
|
+
local co = self.____coroutine
|
|
108
|
+
local status, value = coroutine.resume(co)
|
|
109
|
+
if not status then
|
|
110
|
+
error(value, 0)
|
|
111
|
+
end
|
|
112
|
+
if coroutine.status(co) == "dead" then
|
|
113
|
+
return
|
|
114
|
+
end
|
|
115
|
+
return true, value
|
|
116
|
+
end
|
|
117
|
+
local function iteratorIteratorStep(self)
|
|
118
|
+
local result = self:next()
|
|
119
|
+
if result.done then
|
|
120
|
+
return
|
|
121
|
+
end
|
|
122
|
+
return true, result.value
|
|
123
|
+
end
|
|
124
|
+
local function iteratorStringStep(self, index)
|
|
125
|
+
index = index + 1
|
|
126
|
+
if index > #self then
|
|
127
|
+
return
|
|
128
|
+
end
|
|
129
|
+
return index, string.sub(self, index, index)
|
|
130
|
+
end
|
|
131
|
+
function __TS__Iterator(iterable)
|
|
132
|
+
if type(iterable) == "string" then
|
|
133
|
+
return iteratorStringStep, iterable, 0
|
|
134
|
+
elseif iterable.____coroutine ~= nil then
|
|
135
|
+
return iteratorGeneratorStep, iterable
|
|
136
|
+
elseif iterable[Symbol.iterator] then
|
|
137
|
+
local iterator = iterable[Symbol.iterator](iterable)
|
|
138
|
+
return iteratorIteratorStep, iterator
|
|
139
|
+
else
|
|
140
|
+
return ipairs(iterable)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
local __TS__ArrayFrom
|
|
146
|
+
do
|
|
147
|
+
local function arrayLikeStep(self, index)
|
|
148
|
+
index = index + 1
|
|
149
|
+
if index > self.length then
|
|
150
|
+
return
|
|
151
|
+
end
|
|
152
|
+
return index, self[index]
|
|
153
|
+
end
|
|
154
|
+
local function arrayLikeIterator(arr)
|
|
155
|
+
if type(arr.length) == "number" then
|
|
156
|
+
return arrayLikeStep, arr, 0
|
|
157
|
+
end
|
|
158
|
+
return __TS__Iterator(arr)
|
|
159
|
+
end
|
|
160
|
+
function __TS__ArrayFrom(arrayLike, mapFn, thisArg)
|
|
161
|
+
local result = {}
|
|
162
|
+
if mapFn == nil then
|
|
163
|
+
for ____, v in arrayLikeIterator(arrayLike) do
|
|
164
|
+
result[#result + 1] = v
|
|
165
|
+
end
|
|
166
|
+
else
|
|
167
|
+
for i, v in arrayLikeIterator(arrayLike) do
|
|
168
|
+
result[#result + 1] = mapFn(thisArg, v, i - 1)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
return result
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
local function __TS__ArrayIncludes(self, searchElement, fromIndex)
|
|
176
|
+
if fromIndex == nil then
|
|
177
|
+
fromIndex = 0
|
|
178
|
+
end
|
|
179
|
+
local len = #self
|
|
180
|
+
local k = fromIndex
|
|
181
|
+
if fromIndex < 0 then
|
|
182
|
+
k = len + fromIndex
|
|
183
|
+
end
|
|
184
|
+
if k < 0 then
|
|
185
|
+
k = 0
|
|
186
|
+
end
|
|
187
|
+
for i = k + 1, len do
|
|
188
|
+
if self[i] == searchElement then
|
|
189
|
+
return true
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
return false
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
local function __TS__ArrayIndexOf(self, searchElement, fromIndex)
|
|
196
|
+
if fromIndex == nil then
|
|
197
|
+
fromIndex = 0
|
|
198
|
+
end
|
|
199
|
+
local len = #self
|
|
200
|
+
if len == 0 then
|
|
201
|
+
return -1
|
|
202
|
+
end
|
|
203
|
+
if fromIndex >= len then
|
|
204
|
+
return -1
|
|
205
|
+
end
|
|
206
|
+
if fromIndex < 0 then
|
|
207
|
+
fromIndex = len + fromIndex
|
|
208
|
+
if fromIndex < 0 then
|
|
209
|
+
fromIndex = 0
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
for i = fromIndex + 1, len do
|
|
213
|
+
if self[i] == searchElement then
|
|
214
|
+
return i - 1
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
return -1
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
local function __TS__ArrayJoin(self, separator)
|
|
221
|
+
if separator == nil then
|
|
222
|
+
separator = ","
|
|
223
|
+
end
|
|
224
|
+
local parts = {}
|
|
225
|
+
for i = 1, #self do
|
|
226
|
+
parts[i] = tostring(self[i])
|
|
227
|
+
end
|
|
228
|
+
return table.concat(parts, separator)
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
local function __TS__ArrayMap(self, callbackfn, thisArg)
|
|
232
|
+
local result = {}
|
|
233
|
+
for i = 1, #self do
|
|
234
|
+
result[i] = callbackfn(thisArg, self[i], i - 1, self)
|
|
235
|
+
end
|
|
236
|
+
return result
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
local function __TS__ArrayPush(self, ...)
|
|
240
|
+
local items = {...}
|
|
241
|
+
local len = #self
|
|
242
|
+
for i = 1, #items do
|
|
243
|
+
len = len + 1
|
|
244
|
+
self[len] = items[i]
|
|
245
|
+
end
|
|
246
|
+
return len
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
local function __TS__ArrayPushArray(self, items)
|
|
250
|
+
local len = #self
|
|
251
|
+
for i = 1, #items do
|
|
252
|
+
len = len + 1
|
|
253
|
+
self[len] = items[i]
|
|
254
|
+
end
|
|
255
|
+
return len
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
local function __TS__ArrayReduce(self, callbackFn, ...)
|
|
259
|
+
local len = #self
|
|
260
|
+
local k = 0
|
|
261
|
+
local accumulator = nil
|
|
262
|
+
if select("#", ...) ~= 0 then
|
|
263
|
+
accumulator = ...
|
|
264
|
+
elseif len > 0 then
|
|
265
|
+
accumulator = self[1]
|
|
266
|
+
k = 1
|
|
267
|
+
else
|
|
268
|
+
error("Reduce of empty array with no initial value", 0)
|
|
269
|
+
end
|
|
270
|
+
for i = k + 1, len do
|
|
271
|
+
accumulator = callbackFn(
|
|
272
|
+
nil,
|
|
273
|
+
accumulator,
|
|
274
|
+
self[i],
|
|
275
|
+
i - 1,
|
|
276
|
+
self
|
|
277
|
+
)
|
|
278
|
+
end
|
|
279
|
+
return accumulator
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
local function __TS__ArrayReduceRight(self, callbackFn, ...)
|
|
283
|
+
local len = #self
|
|
284
|
+
local k = len - 1
|
|
285
|
+
local accumulator = nil
|
|
286
|
+
if select("#", ...) ~= 0 then
|
|
287
|
+
accumulator = ...
|
|
288
|
+
elseif len > 0 then
|
|
289
|
+
accumulator = self[k + 1]
|
|
290
|
+
k = k - 1
|
|
291
|
+
else
|
|
292
|
+
error("Reduce of empty array with no initial value", 0)
|
|
293
|
+
end
|
|
294
|
+
for i = k + 1, 1, -1 do
|
|
295
|
+
accumulator = callbackFn(
|
|
296
|
+
nil,
|
|
297
|
+
accumulator,
|
|
298
|
+
self[i],
|
|
299
|
+
i - 1,
|
|
300
|
+
self
|
|
301
|
+
)
|
|
302
|
+
end
|
|
303
|
+
return accumulator
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
local function __TS__ArrayReverse(self)
|
|
307
|
+
local i = 1
|
|
308
|
+
local j = #self
|
|
309
|
+
while i < j do
|
|
310
|
+
local temp = self[j]
|
|
311
|
+
self[j] = self[i]
|
|
312
|
+
self[i] = temp
|
|
313
|
+
i = i + 1
|
|
314
|
+
j = j - 1
|
|
315
|
+
end
|
|
316
|
+
return self
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
local function __TS__ArrayUnshift(self, ...)
|
|
320
|
+
local items = {...}
|
|
321
|
+
local numItemsToInsert = #items
|
|
322
|
+
if numItemsToInsert == 0 then
|
|
323
|
+
return #self
|
|
324
|
+
end
|
|
325
|
+
for i = #self, 1, -1 do
|
|
326
|
+
self[i + numItemsToInsert] = self[i]
|
|
327
|
+
end
|
|
328
|
+
for i = 1, numItemsToInsert do
|
|
329
|
+
self[i] = items[i]
|
|
330
|
+
end
|
|
331
|
+
return #self
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
local function __TS__ArraySort(self, compareFn)
|
|
335
|
+
if compareFn ~= nil then
|
|
336
|
+
table.sort(
|
|
337
|
+
self,
|
|
338
|
+
function(a, b) return compareFn(nil, a, b) < 0 end
|
|
339
|
+
)
|
|
340
|
+
else
|
|
341
|
+
table.sort(self)
|
|
342
|
+
end
|
|
343
|
+
return self
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
local function __TS__ArraySlice(self, first, last)
|
|
347
|
+
local len = #self
|
|
348
|
+
first = first or 0
|
|
349
|
+
if first < 0 then
|
|
350
|
+
first = len + first
|
|
351
|
+
if first < 0 then
|
|
352
|
+
first = 0
|
|
353
|
+
end
|
|
354
|
+
else
|
|
355
|
+
if first > len then
|
|
356
|
+
first = len
|
|
357
|
+
end
|
|
358
|
+
end
|
|
359
|
+
last = last or len
|
|
360
|
+
if last < 0 then
|
|
361
|
+
last = len + last
|
|
362
|
+
if last < 0 then
|
|
363
|
+
last = 0
|
|
364
|
+
end
|
|
365
|
+
else
|
|
366
|
+
if last > len then
|
|
367
|
+
last = len
|
|
368
|
+
end
|
|
369
|
+
end
|
|
370
|
+
local out = {}
|
|
371
|
+
first = first + 1
|
|
372
|
+
last = last + 1
|
|
373
|
+
local n = 1
|
|
374
|
+
while first < last do
|
|
375
|
+
out[n] = self[first]
|
|
376
|
+
first = first + 1
|
|
377
|
+
n = n + 1
|
|
378
|
+
end
|
|
379
|
+
return out
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
local function __TS__ArraySome(self, callbackfn, thisArg)
|
|
383
|
+
for i = 1, #self do
|
|
384
|
+
if callbackfn(thisArg, self[i], i - 1, self) then
|
|
385
|
+
return true
|
|
386
|
+
end
|
|
387
|
+
end
|
|
388
|
+
return false
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
local function __TS__ArraySplice(self, ...)
|
|
392
|
+
local args = {...}
|
|
393
|
+
local len = #self
|
|
394
|
+
local actualArgumentCount = select("#", ...)
|
|
395
|
+
local start = args[1]
|
|
396
|
+
local deleteCount = args[2]
|
|
397
|
+
if start < 0 then
|
|
398
|
+
start = len + start
|
|
399
|
+
if start < 0 then
|
|
400
|
+
start = 0
|
|
401
|
+
end
|
|
402
|
+
elseif start > len then
|
|
403
|
+
start = len
|
|
404
|
+
end
|
|
405
|
+
local itemCount = actualArgumentCount - 2
|
|
406
|
+
if itemCount < 0 then
|
|
407
|
+
itemCount = 0
|
|
408
|
+
end
|
|
409
|
+
local actualDeleteCount
|
|
410
|
+
if actualArgumentCount == 0 then
|
|
411
|
+
actualDeleteCount = 0
|
|
412
|
+
elseif actualArgumentCount == 1 then
|
|
413
|
+
actualDeleteCount = len - start
|
|
414
|
+
else
|
|
415
|
+
actualDeleteCount = deleteCount or 0
|
|
416
|
+
if actualDeleteCount < 0 then
|
|
417
|
+
actualDeleteCount = 0
|
|
418
|
+
end
|
|
419
|
+
if actualDeleteCount > len - start then
|
|
420
|
+
actualDeleteCount = len - start
|
|
421
|
+
end
|
|
422
|
+
end
|
|
423
|
+
local out = {}
|
|
424
|
+
for k = 1, actualDeleteCount do
|
|
425
|
+
local from = start + k
|
|
426
|
+
if self[from] ~= nil then
|
|
427
|
+
out[k] = self[from]
|
|
428
|
+
end
|
|
429
|
+
end
|
|
430
|
+
if itemCount < actualDeleteCount then
|
|
431
|
+
for k = start + 1, len - actualDeleteCount do
|
|
432
|
+
local from = k + actualDeleteCount
|
|
433
|
+
local to = k + itemCount
|
|
434
|
+
if self[from] then
|
|
435
|
+
self[to] = self[from]
|
|
436
|
+
else
|
|
437
|
+
self[to] = nil
|
|
438
|
+
end
|
|
439
|
+
end
|
|
440
|
+
for k = len - actualDeleteCount + itemCount + 1, len do
|
|
441
|
+
self[k] = nil
|
|
442
|
+
end
|
|
443
|
+
elseif itemCount > actualDeleteCount then
|
|
444
|
+
for k = len - actualDeleteCount, start + 1, -1 do
|
|
445
|
+
local from = k + actualDeleteCount
|
|
446
|
+
local to = k + itemCount
|
|
447
|
+
if self[from] then
|
|
448
|
+
self[to] = self[from]
|
|
449
|
+
else
|
|
450
|
+
self[to] = nil
|
|
451
|
+
end
|
|
452
|
+
end
|
|
453
|
+
end
|
|
454
|
+
local j = start + 1
|
|
455
|
+
for i = 3, actualArgumentCount do
|
|
456
|
+
self[j] = args[i]
|
|
457
|
+
j = j + 1
|
|
458
|
+
end
|
|
459
|
+
for k = #self, len - actualDeleteCount + itemCount + 1, -1 do
|
|
460
|
+
self[k] = nil
|
|
461
|
+
end
|
|
462
|
+
return out
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
local function __TS__ArrayToObject(self)
|
|
466
|
+
local object = {}
|
|
467
|
+
for i = 1, #self do
|
|
468
|
+
object[i - 1] = self[i]
|
|
469
|
+
end
|
|
470
|
+
return object
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
local function __TS__ArrayFlat(self, depth)
|
|
474
|
+
if depth == nil then
|
|
475
|
+
depth = 1
|
|
476
|
+
end
|
|
477
|
+
local result = {}
|
|
478
|
+
local len = 0
|
|
479
|
+
for i = 1, #self do
|
|
480
|
+
local value = self[i]
|
|
481
|
+
if depth > 0 and __TS__ArrayIsArray(value) then
|
|
482
|
+
local toAdd
|
|
483
|
+
if depth == 1 then
|
|
484
|
+
toAdd = value
|
|
485
|
+
else
|
|
486
|
+
toAdd = __TS__ArrayFlat(value, depth - 1)
|
|
487
|
+
end
|
|
488
|
+
for j = 1, #toAdd do
|
|
489
|
+
local val = toAdd[j]
|
|
490
|
+
len = len + 1
|
|
491
|
+
result[len] = val
|
|
492
|
+
end
|
|
493
|
+
else
|
|
494
|
+
len = len + 1
|
|
495
|
+
result[len] = value
|
|
496
|
+
end
|
|
497
|
+
end
|
|
498
|
+
return result
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
local function __TS__ArrayFlatMap(self, callback, thisArg)
|
|
502
|
+
local result = {}
|
|
503
|
+
local len = 0
|
|
504
|
+
for i = 1, #self do
|
|
505
|
+
local value = callback(thisArg, self[i], i - 1, self)
|
|
506
|
+
if __TS__ArrayIsArray(value) then
|
|
507
|
+
for j = 1, #value do
|
|
508
|
+
len = len + 1
|
|
509
|
+
result[len] = value[j]
|
|
510
|
+
end
|
|
511
|
+
else
|
|
512
|
+
len = len + 1
|
|
513
|
+
result[len] = value
|
|
514
|
+
end
|
|
515
|
+
end
|
|
516
|
+
return result
|
|
517
|
+
end
|
|
518
|
+
|
|
519
|
+
local function __TS__ArraySetLength(self, length)
|
|
520
|
+
if length < 0 or length ~= length or length == math.huge or math.floor(length) ~= length then
|
|
521
|
+
error(
|
|
522
|
+
"invalid array length: " .. tostring(length),
|
|
523
|
+
0
|
|
524
|
+
)
|
|
525
|
+
end
|
|
526
|
+
for i = length + 1, #self do
|
|
527
|
+
self[i] = nil
|
|
528
|
+
end
|
|
529
|
+
return length
|
|
530
|
+
end
|
|
531
|
+
|
|
532
|
+
local function __TS__InstanceOf(obj, classTbl)
|
|
533
|
+
if type(classTbl) ~= "table" then
|
|
534
|
+
error("Right-hand side of 'instanceof' is not an object", 0)
|
|
535
|
+
end
|
|
536
|
+
if classTbl[Symbol.hasInstance] ~= nil then
|
|
537
|
+
return not not classTbl[Symbol.hasInstance](classTbl, obj)
|
|
538
|
+
end
|
|
539
|
+
if type(obj) == "table" then
|
|
540
|
+
local luaClass = obj.constructor
|
|
541
|
+
while luaClass ~= nil do
|
|
542
|
+
if luaClass == classTbl then
|
|
543
|
+
return true
|
|
544
|
+
end
|
|
545
|
+
luaClass = luaClass.____super
|
|
546
|
+
end
|
|
547
|
+
end
|
|
548
|
+
return false
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
local function __TS__New(target, ...)
|
|
552
|
+
local instance = setmetatable({}, target.prototype)
|
|
553
|
+
instance:____constructor(...)
|
|
554
|
+
return instance
|
|
555
|
+
end
|
|
556
|
+
|
|
557
|
+
local function __TS__Class(self)
|
|
558
|
+
local c = {prototype = {}}
|
|
559
|
+
c.prototype.__index = c.prototype
|
|
560
|
+
c.prototype.constructor = c
|
|
561
|
+
return c
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
local __TS__Unpack = table.unpack or unpack
|
|
565
|
+
|
|
566
|
+
local function __TS__FunctionBind(fn, ...)
|
|
567
|
+
local boundArgs = {...}
|
|
568
|
+
return function(____, ...)
|
|
569
|
+
local args = {...}
|
|
570
|
+
__TS__ArrayUnshift(
|
|
571
|
+
args,
|
|
572
|
+
__TS__Unpack(boundArgs)
|
|
573
|
+
)
|
|
574
|
+
return fn(__TS__Unpack(args))
|
|
575
|
+
end
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
local __TS__Promise
|
|
579
|
+
do
|
|
580
|
+
local function promiseDeferred(self)
|
|
581
|
+
local resolve
|
|
582
|
+
local reject
|
|
583
|
+
local promise = __TS__New(
|
|
584
|
+
__TS__Promise,
|
|
585
|
+
function(____, res, rej)
|
|
586
|
+
resolve = res
|
|
587
|
+
reject = rej
|
|
588
|
+
end
|
|
589
|
+
)
|
|
590
|
+
return {promise = promise, resolve = resolve, reject = reject}
|
|
591
|
+
end
|
|
592
|
+
local function isPromiseLike(self, thing)
|
|
593
|
+
return __TS__InstanceOf(thing, __TS__Promise)
|
|
594
|
+
end
|
|
595
|
+
__TS__Promise = __TS__Class()
|
|
596
|
+
__TS__Promise.name = "__TS__Promise"
|
|
597
|
+
function __TS__Promise.prototype.____constructor(self, executor)
|
|
598
|
+
self.state = 0
|
|
599
|
+
self.fulfilledCallbacks = {}
|
|
600
|
+
self.rejectedCallbacks = {}
|
|
601
|
+
self.finallyCallbacks = {}
|
|
602
|
+
do
|
|
603
|
+
local function ____catch(e)
|
|
604
|
+
self:reject(e)
|
|
605
|
+
end
|
|
606
|
+
local ____try, ____hasReturned = pcall(function()
|
|
607
|
+
executor(
|
|
608
|
+
nil,
|
|
609
|
+
__TS__FunctionBind(self.resolve, self),
|
|
610
|
+
__TS__FunctionBind(self.reject, self)
|
|
611
|
+
)
|
|
612
|
+
end)
|
|
613
|
+
if not ____try then
|
|
614
|
+
____catch(____hasReturned)
|
|
615
|
+
end
|
|
616
|
+
end
|
|
617
|
+
end
|
|
618
|
+
function __TS__Promise.resolve(data)
|
|
619
|
+
local promise = __TS__New(
|
|
620
|
+
__TS__Promise,
|
|
621
|
+
function()
|
|
622
|
+
end
|
|
623
|
+
)
|
|
624
|
+
promise.state = 1
|
|
625
|
+
promise.value = data
|
|
626
|
+
return promise
|
|
627
|
+
end
|
|
628
|
+
function __TS__Promise.reject(reason)
|
|
629
|
+
local promise = __TS__New(
|
|
630
|
+
__TS__Promise,
|
|
631
|
+
function()
|
|
632
|
+
end
|
|
633
|
+
)
|
|
634
|
+
promise.state = 2
|
|
635
|
+
promise.rejectionReason = reason
|
|
636
|
+
return promise
|
|
637
|
+
end
|
|
638
|
+
__TS__Promise.prototype["then"] = function(self, onFulfilled, onRejected)
|
|
639
|
+
local ____promiseDeferred_result_0 = promiseDeferred(nil)
|
|
640
|
+
local promise = ____promiseDeferred_result_0.promise
|
|
641
|
+
local resolve = ____promiseDeferred_result_0.resolve
|
|
642
|
+
local reject = ____promiseDeferred_result_0.reject
|
|
643
|
+
local isFulfilled = self.state == 1
|
|
644
|
+
local isRejected = self.state == 2
|
|
645
|
+
if onFulfilled then
|
|
646
|
+
local internalCallback = self:createPromiseResolvingCallback(onFulfilled, resolve, reject)
|
|
647
|
+
local ____self_fulfilledCallbacks_1 = self.fulfilledCallbacks
|
|
648
|
+
____self_fulfilledCallbacks_1[#____self_fulfilledCallbacks_1 + 1] = internalCallback
|
|
649
|
+
if isFulfilled then
|
|
650
|
+
internalCallback(nil, self.value)
|
|
651
|
+
end
|
|
652
|
+
else
|
|
653
|
+
local ____self_fulfilledCallbacks_2 = self.fulfilledCallbacks
|
|
654
|
+
____self_fulfilledCallbacks_2[#____self_fulfilledCallbacks_2 + 1] = function() return resolve(nil, nil) end
|
|
655
|
+
end
|
|
656
|
+
if onRejected then
|
|
657
|
+
local internalCallback = self:createPromiseResolvingCallback(onRejected, resolve, reject)
|
|
658
|
+
local ____self_rejectedCallbacks_3 = self.rejectedCallbacks
|
|
659
|
+
____self_rejectedCallbacks_3[#____self_rejectedCallbacks_3 + 1] = internalCallback
|
|
660
|
+
if isRejected then
|
|
661
|
+
internalCallback(nil, self.rejectionReason)
|
|
662
|
+
end
|
|
663
|
+
end
|
|
664
|
+
if isFulfilled then
|
|
665
|
+
resolve(nil, self.value)
|
|
666
|
+
end
|
|
667
|
+
if isRejected then
|
|
668
|
+
reject(nil, self.rejectionReason)
|
|
669
|
+
end
|
|
670
|
+
return promise
|
|
671
|
+
end
|
|
672
|
+
function __TS__Promise.prototype.catch(self, onRejected)
|
|
673
|
+
return self["then"](self, nil, onRejected)
|
|
674
|
+
end
|
|
675
|
+
function __TS__Promise.prototype.finally(self, onFinally)
|
|
676
|
+
if onFinally then
|
|
677
|
+
local ____self_finallyCallbacks_4 = self.finallyCallbacks
|
|
678
|
+
____self_finallyCallbacks_4[#____self_finallyCallbacks_4 + 1] = onFinally
|
|
679
|
+
if self.state ~= 0 then
|
|
680
|
+
onFinally(nil)
|
|
681
|
+
end
|
|
682
|
+
end
|
|
683
|
+
return self
|
|
684
|
+
end
|
|
685
|
+
function __TS__Promise.prototype.resolve(self, data)
|
|
686
|
+
if __TS__InstanceOf(data, __TS__Promise) then
|
|
687
|
+
data["then"](
|
|
688
|
+
data,
|
|
689
|
+
function(____, v) return self:resolve(v) end,
|
|
690
|
+
function(____, err) return self:reject(err) end
|
|
691
|
+
)
|
|
692
|
+
return
|
|
693
|
+
end
|
|
694
|
+
if self.state == 0 then
|
|
695
|
+
self.state = 1
|
|
696
|
+
self.value = data
|
|
697
|
+
for ____, callback in ipairs(self.fulfilledCallbacks) do
|
|
698
|
+
callback(nil, data)
|
|
699
|
+
end
|
|
700
|
+
for ____, callback in ipairs(self.finallyCallbacks) do
|
|
701
|
+
callback(nil)
|
|
702
|
+
end
|
|
703
|
+
end
|
|
704
|
+
end
|
|
705
|
+
function __TS__Promise.prototype.reject(self, reason)
|
|
706
|
+
if self.state == 0 then
|
|
707
|
+
self.state = 2
|
|
708
|
+
self.rejectionReason = reason
|
|
709
|
+
for ____, callback in ipairs(self.rejectedCallbacks) do
|
|
710
|
+
callback(nil, reason)
|
|
711
|
+
end
|
|
712
|
+
for ____, callback in ipairs(self.finallyCallbacks) do
|
|
713
|
+
callback(nil)
|
|
714
|
+
end
|
|
715
|
+
end
|
|
716
|
+
end
|
|
717
|
+
function __TS__Promise.prototype.createPromiseResolvingCallback(self, f, resolve, reject)
|
|
718
|
+
return function(____, value)
|
|
719
|
+
do
|
|
720
|
+
local function ____catch(e)
|
|
721
|
+
reject(nil, e)
|
|
722
|
+
end
|
|
723
|
+
local ____try, ____hasReturned = pcall(function()
|
|
724
|
+
self:handleCallbackData(
|
|
725
|
+
f(nil, value),
|
|
726
|
+
resolve,
|
|
727
|
+
reject
|
|
728
|
+
)
|
|
729
|
+
end)
|
|
730
|
+
if not ____try then
|
|
731
|
+
____catch(____hasReturned)
|
|
732
|
+
end
|
|
733
|
+
end
|
|
734
|
+
end
|
|
735
|
+
end
|
|
736
|
+
function __TS__Promise.prototype.handleCallbackData(self, data, resolve, reject)
|
|
737
|
+
if isPromiseLike(nil, data) then
|
|
738
|
+
local nextpromise = data
|
|
739
|
+
if nextpromise.state == 1 then
|
|
740
|
+
resolve(nil, nextpromise.value)
|
|
741
|
+
elseif nextpromise.state == 2 then
|
|
742
|
+
reject(nil, nextpromise.rejectionReason)
|
|
743
|
+
else
|
|
744
|
+
data["then"](data, resolve, reject)
|
|
745
|
+
end
|
|
746
|
+
else
|
|
747
|
+
resolve(nil, data)
|
|
748
|
+
end
|
|
749
|
+
end
|
|
750
|
+
end
|
|
751
|
+
|
|
752
|
+
local function __TS__AsyncAwaiter(generator)
|
|
753
|
+
return __TS__New(
|
|
754
|
+
__TS__Promise,
|
|
755
|
+
function(____, resolve, reject)
|
|
756
|
+
local adopt, fulfilled, step, resolved, asyncCoroutine
|
|
757
|
+
function adopt(self, value)
|
|
758
|
+
local ____temp_0
|
|
759
|
+
if __TS__InstanceOf(value, __TS__Promise) then
|
|
760
|
+
____temp_0 = value
|
|
761
|
+
else
|
|
762
|
+
____temp_0 = __TS__Promise.resolve(value)
|
|
763
|
+
end
|
|
764
|
+
return ____temp_0
|
|
765
|
+
end
|
|
766
|
+
function fulfilled(self, value)
|
|
767
|
+
local success, resultOrError = coroutine.resume(asyncCoroutine, value)
|
|
768
|
+
if success then
|
|
769
|
+
step(nil, resultOrError)
|
|
770
|
+
else
|
|
771
|
+
reject(nil, resultOrError)
|
|
772
|
+
end
|
|
773
|
+
end
|
|
774
|
+
function step(self, result)
|
|
775
|
+
if resolved then
|
|
776
|
+
return
|
|
777
|
+
end
|
|
778
|
+
if coroutine.status(asyncCoroutine) == "dead" then
|
|
779
|
+
resolve(nil, result)
|
|
780
|
+
else
|
|
781
|
+
local ____self_1 = adopt(nil, result)
|
|
782
|
+
____self_1["then"](____self_1, fulfilled, reject)
|
|
783
|
+
end
|
|
784
|
+
end
|
|
785
|
+
resolved = false
|
|
786
|
+
asyncCoroutine = coroutine.create(generator)
|
|
787
|
+
local success, resultOrError = coroutine.resume(
|
|
788
|
+
asyncCoroutine,
|
|
789
|
+
function(____, v)
|
|
790
|
+
resolved = true
|
|
791
|
+
local ____self_2 = adopt(nil, v)
|
|
792
|
+
____self_2["then"](____self_2, resolve, reject)
|
|
793
|
+
end
|
|
794
|
+
)
|
|
795
|
+
if success then
|
|
796
|
+
step(nil, resultOrError)
|
|
797
|
+
else
|
|
798
|
+
reject(nil, resultOrError)
|
|
799
|
+
end
|
|
800
|
+
end
|
|
801
|
+
)
|
|
802
|
+
end
|
|
803
|
+
local function __TS__Await(thing)
|
|
804
|
+
return coroutine.yield(thing)
|
|
805
|
+
end
|
|
806
|
+
|
|
807
|
+
local function __TS__ClassExtends(target, base)
|
|
808
|
+
target.____super = base
|
|
809
|
+
local staticMetatable = setmetatable({__index = base}, base)
|
|
810
|
+
setmetatable(target, staticMetatable)
|
|
811
|
+
local baseMetatable = getmetatable(base)
|
|
812
|
+
if baseMetatable then
|
|
813
|
+
if type(baseMetatable.__index) == "function" then
|
|
814
|
+
staticMetatable.__index = baseMetatable.__index
|
|
815
|
+
end
|
|
816
|
+
if type(baseMetatable.__newindex) == "function" then
|
|
817
|
+
staticMetatable.__newindex = baseMetatable.__newindex
|
|
818
|
+
end
|
|
819
|
+
end
|
|
820
|
+
setmetatable(target.prototype, base.prototype)
|
|
821
|
+
if type(base.prototype.__index) == "function" then
|
|
822
|
+
target.prototype.__index = base.prototype.__index
|
|
823
|
+
end
|
|
824
|
+
if type(base.prototype.__newindex) == "function" then
|
|
825
|
+
target.prototype.__newindex = base.prototype.__newindex
|
|
826
|
+
end
|
|
827
|
+
if type(base.prototype.__tostring) == "function" then
|
|
828
|
+
target.prototype.__tostring = base.prototype.__tostring
|
|
829
|
+
end
|
|
830
|
+
end
|
|
831
|
+
|
|
832
|
+
local function __TS__CloneDescriptor(____bindingPattern0)
|
|
833
|
+
local value
|
|
834
|
+
local writable
|
|
835
|
+
local set
|
|
836
|
+
local get
|
|
837
|
+
local configurable
|
|
838
|
+
local enumerable
|
|
839
|
+
enumerable = ____bindingPattern0.enumerable
|
|
840
|
+
configurable = ____bindingPattern0.configurable
|
|
841
|
+
get = ____bindingPattern0.get
|
|
842
|
+
set = ____bindingPattern0.set
|
|
843
|
+
writable = ____bindingPattern0.writable
|
|
844
|
+
value = ____bindingPattern0.value
|
|
845
|
+
local descriptor = {enumerable = enumerable == true, configurable = configurable == true}
|
|
846
|
+
local hasGetterOrSetter = get ~= nil or set ~= nil
|
|
847
|
+
local hasValueOrWritableAttribute = writable ~= nil or value ~= nil
|
|
848
|
+
if hasGetterOrSetter and hasValueOrWritableAttribute then
|
|
849
|
+
error("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute.", 0)
|
|
850
|
+
end
|
|
851
|
+
if get or set then
|
|
852
|
+
descriptor.get = get
|
|
853
|
+
descriptor.set = set
|
|
854
|
+
else
|
|
855
|
+
descriptor.value = value
|
|
856
|
+
descriptor.writable = writable == true
|
|
857
|
+
end
|
|
858
|
+
return descriptor
|
|
859
|
+
end
|
|
860
|
+
|
|
861
|
+
local function __TS__ObjectAssign(target, ...)
|
|
862
|
+
local sources = {...}
|
|
863
|
+
for i = 1, #sources do
|
|
864
|
+
local source = sources[i]
|
|
865
|
+
for key in pairs(source) do
|
|
866
|
+
target[key] = source[key]
|
|
867
|
+
end
|
|
868
|
+
end
|
|
869
|
+
return target
|
|
870
|
+
end
|
|
871
|
+
|
|
872
|
+
local function __TS__ObjectGetOwnPropertyDescriptor(object, key)
|
|
873
|
+
local metatable = getmetatable(object)
|
|
874
|
+
if not metatable then
|
|
875
|
+
return
|
|
876
|
+
end
|
|
877
|
+
if not rawget(metatable, "_descriptors") then
|
|
878
|
+
return
|
|
879
|
+
end
|
|
880
|
+
return rawget(metatable, "_descriptors")[key]
|
|
881
|
+
end
|
|
882
|
+
|
|
883
|
+
local __TS__SetDescriptor
|
|
884
|
+
do
|
|
885
|
+
local function descriptorIndex(self, key)
|
|
886
|
+
local value = rawget(self, key)
|
|
887
|
+
if value ~= nil then
|
|
888
|
+
return value
|
|
889
|
+
end
|
|
890
|
+
local metatable = getmetatable(self)
|
|
891
|
+
while metatable do
|
|
892
|
+
local rawResult = rawget(metatable, key)
|
|
893
|
+
if rawResult ~= nil then
|
|
894
|
+
return rawResult
|
|
895
|
+
end
|
|
896
|
+
local descriptors = rawget(metatable, "_descriptors")
|
|
897
|
+
if descriptors then
|
|
898
|
+
local descriptor = descriptors[key]
|
|
899
|
+
if descriptor then
|
|
900
|
+
if descriptor.get then
|
|
901
|
+
return descriptor.get(self)
|
|
902
|
+
end
|
|
903
|
+
return descriptor.value
|
|
904
|
+
end
|
|
905
|
+
end
|
|
906
|
+
metatable = getmetatable(metatable)
|
|
907
|
+
end
|
|
908
|
+
end
|
|
909
|
+
local function descriptorNewIndex(self, key, value)
|
|
910
|
+
local metatable = getmetatable(self)
|
|
911
|
+
while metatable do
|
|
912
|
+
local descriptors = rawget(metatable, "_descriptors")
|
|
913
|
+
if descriptors then
|
|
914
|
+
local descriptor = descriptors[key]
|
|
915
|
+
if descriptor then
|
|
916
|
+
if descriptor.set then
|
|
917
|
+
descriptor.set(self, value)
|
|
918
|
+
else
|
|
919
|
+
if descriptor.writable == false then
|
|
920
|
+
error(
|
|
921
|
+
((("Cannot assign to read only property '" .. key) .. "' of object '") .. tostring(self)) .. "'",
|
|
922
|
+
0
|
|
923
|
+
)
|
|
924
|
+
end
|
|
925
|
+
descriptor.value = value
|
|
926
|
+
end
|
|
927
|
+
return
|
|
928
|
+
end
|
|
929
|
+
end
|
|
930
|
+
metatable = getmetatable(metatable)
|
|
931
|
+
end
|
|
932
|
+
rawset(self, key, value)
|
|
933
|
+
end
|
|
934
|
+
function __TS__SetDescriptor(target, key, desc, isPrototype)
|
|
935
|
+
if isPrototype == nil then
|
|
936
|
+
isPrototype = false
|
|
937
|
+
end
|
|
938
|
+
local ____isPrototype_0
|
|
939
|
+
if isPrototype then
|
|
940
|
+
____isPrototype_0 = target
|
|
941
|
+
else
|
|
942
|
+
____isPrototype_0 = getmetatable(target)
|
|
943
|
+
end
|
|
944
|
+
local metatable = ____isPrototype_0
|
|
945
|
+
if not metatable then
|
|
946
|
+
metatable = {}
|
|
947
|
+
setmetatable(target, metatable)
|
|
948
|
+
end
|
|
949
|
+
local value = rawget(target, key)
|
|
950
|
+
if value ~= nil then
|
|
951
|
+
rawset(target, key, nil)
|
|
952
|
+
end
|
|
953
|
+
if not rawget(metatable, "_descriptors") then
|
|
954
|
+
metatable._descriptors = {}
|
|
955
|
+
end
|
|
956
|
+
local descriptor = __TS__CloneDescriptor(desc)
|
|
957
|
+
metatable._descriptors[key] = descriptor
|
|
958
|
+
metatable.__index = descriptorIndex
|
|
959
|
+
metatable.__newindex = descriptorNewIndex
|
|
960
|
+
end
|
|
961
|
+
end
|
|
962
|
+
|
|
963
|
+
local function __TS__Decorate(decorators, target, key, desc)
|
|
964
|
+
local result = target
|
|
965
|
+
do
|
|
966
|
+
local i = #decorators
|
|
967
|
+
while i >= 0 do
|
|
968
|
+
local decorator = decorators[i + 1]
|
|
969
|
+
if decorator then
|
|
970
|
+
local oldResult = result
|
|
971
|
+
if key == nil then
|
|
972
|
+
result = decorator(nil, result)
|
|
973
|
+
elseif desc == true then
|
|
974
|
+
local value = rawget(target, key)
|
|
975
|
+
local descriptor = __TS__ObjectGetOwnPropertyDescriptor(target, key) or ({configurable = true, writable = true, value = value})
|
|
976
|
+
local desc = decorator(nil, target, key, descriptor) or descriptor
|
|
977
|
+
local isSimpleValue = desc.configurable == true and desc.writable == true and not desc.get and not desc.set
|
|
978
|
+
if isSimpleValue then
|
|
979
|
+
rawset(target, key, desc.value)
|
|
980
|
+
else
|
|
981
|
+
__TS__SetDescriptor(
|
|
982
|
+
target,
|
|
983
|
+
key,
|
|
984
|
+
__TS__ObjectAssign({}, descriptor, desc)
|
|
985
|
+
)
|
|
986
|
+
end
|
|
987
|
+
elseif desc == false then
|
|
988
|
+
result = decorator(nil, target, key, desc)
|
|
989
|
+
else
|
|
990
|
+
result = decorator(nil, target, key)
|
|
991
|
+
end
|
|
992
|
+
result = result or oldResult
|
|
993
|
+
end
|
|
994
|
+
i = i - 1
|
|
995
|
+
end
|
|
996
|
+
end
|
|
997
|
+
return result
|
|
998
|
+
end
|
|
999
|
+
|
|
1000
|
+
local function __TS__DecorateParam(paramIndex, decorator)
|
|
1001
|
+
return function(____, target, key) return decorator(nil, target, key, paramIndex) end
|
|
1002
|
+
end
|
|
1003
|
+
|
|
1004
|
+
local Error, RangeError, ReferenceError, SyntaxError, TypeError, URIError
|
|
1005
|
+
do
|
|
1006
|
+
local function getErrorStack(self, constructor)
|
|
1007
|
+
local level = 1
|
|
1008
|
+
while true do
|
|
1009
|
+
local info = debug.getinfo(level, "f")
|
|
1010
|
+
level = level + 1
|
|
1011
|
+
if not info then
|
|
1012
|
+
level = 1
|
|
1013
|
+
break
|
|
1014
|
+
elseif info.func == constructor then
|
|
1015
|
+
break
|
|
1016
|
+
end
|
|
1017
|
+
end
|
|
1018
|
+
return debug.traceback(nil, level)
|
|
1019
|
+
end
|
|
1020
|
+
local function wrapErrorToString(self, getDescription)
|
|
1021
|
+
return function(self)
|
|
1022
|
+
local description = getDescription(self)
|
|
1023
|
+
local caller = debug.getinfo(3, "f")
|
|
1024
|
+
if _VERSION == "Lua 5.1" or caller and caller.func ~= error then
|
|
1025
|
+
return description
|
|
1026
|
+
else
|
|
1027
|
+
return (tostring(description) .. "\n") .. self.stack
|
|
1028
|
+
end
|
|
1029
|
+
end
|
|
1030
|
+
end
|
|
1031
|
+
local function initErrorClass(self, Type, name)
|
|
1032
|
+
Type.name = name
|
|
1033
|
+
return setmetatable(
|
|
1034
|
+
Type,
|
|
1035
|
+
{__call = function(____, _self, message) return __TS__New(Type, message) end}
|
|
1036
|
+
)
|
|
1037
|
+
end
|
|
1038
|
+
local ____initErrorClass_2 = initErrorClass
|
|
1039
|
+
local ____class_0 = __TS__Class()
|
|
1040
|
+
____class_0.name = ""
|
|
1041
|
+
function ____class_0.prototype.____constructor(self, message)
|
|
1042
|
+
if message == nil then
|
|
1043
|
+
message = ""
|
|
1044
|
+
end
|
|
1045
|
+
self.message = message
|
|
1046
|
+
self.name = "Error"
|
|
1047
|
+
self.stack = getErrorStack(nil, self.constructor.new)
|
|
1048
|
+
local metatable = getmetatable(self)
|
|
1049
|
+
if not metatable.__errorToStringPatched then
|
|
1050
|
+
metatable.__errorToStringPatched = true
|
|
1051
|
+
metatable.__tostring = wrapErrorToString(nil, metatable.__tostring)
|
|
1052
|
+
end
|
|
1053
|
+
end
|
|
1054
|
+
function ____class_0.prototype.__tostring(self)
|
|
1055
|
+
local ____temp_1
|
|
1056
|
+
if self.message ~= "" then
|
|
1057
|
+
____temp_1 = (self.name .. ": ") .. self.message
|
|
1058
|
+
else
|
|
1059
|
+
____temp_1 = self.name
|
|
1060
|
+
end
|
|
1061
|
+
return ____temp_1
|
|
1062
|
+
end
|
|
1063
|
+
Error = ____initErrorClass_2(nil, ____class_0, "Error")
|
|
1064
|
+
local function createErrorClass(self, name)
|
|
1065
|
+
local ____initErrorClass_4 = initErrorClass
|
|
1066
|
+
local ____class_3 = __TS__Class()
|
|
1067
|
+
____class_3.name = ____class_3.name
|
|
1068
|
+
__TS__ClassExtends(____class_3, Error)
|
|
1069
|
+
function ____class_3.prototype.____constructor(self, ...)
|
|
1070
|
+
____class_3.____super.prototype.____constructor(self, ...)
|
|
1071
|
+
self.name = name
|
|
1072
|
+
end
|
|
1073
|
+
return ____initErrorClass_4(nil, ____class_3, name)
|
|
1074
|
+
end
|
|
1075
|
+
RangeError = createErrorClass(nil, "RangeError")
|
|
1076
|
+
ReferenceError = createErrorClass(nil, "ReferenceError")
|
|
1077
|
+
SyntaxError = createErrorClass(nil, "SyntaxError")
|
|
1078
|
+
TypeError = createErrorClass(nil, "TypeError")
|
|
1079
|
+
URIError = createErrorClass(nil, "URIError")
|
|
1080
|
+
end
|
|
1081
|
+
|
|
1082
|
+
local function __TS__ObjectGetOwnPropertyDescriptors(object)
|
|
1083
|
+
local metatable = getmetatable(object)
|
|
1084
|
+
if not metatable then
|
|
1085
|
+
return {}
|
|
1086
|
+
end
|
|
1087
|
+
return rawget(metatable, "_descriptors") or ({})
|
|
1088
|
+
end
|
|
1089
|
+
|
|
1090
|
+
local function __TS__Delete(target, key)
|
|
1091
|
+
local descriptors = __TS__ObjectGetOwnPropertyDescriptors(target)
|
|
1092
|
+
local descriptor = descriptors[key]
|
|
1093
|
+
if descriptor then
|
|
1094
|
+
if not descriptor.configurable then
|
|
1095
|
+
error(
|
|
1096
|
+
__TS__New(
|
|
1097
|
+
TypeError,
|
|
1098
|
+
((("Cannot delete property " .. tostring(key)) .. " of ") .. tostring(target)) .. "."
|
|
1099
|
+
),
|
|
1100
|
+
0
|
|
1101
|
+
)
|
|
1102
|
+
end
|
|
1103
|
+
descriptors[key] = nil
|
|
1104
|
+
return true
|
|
1105
|
+
end
|
|
1106
|
+
target[key] = nil
|
|
1107
|
+
return true
|
|
1108
|
+
end
|
|
1109
|
+
|
|
1110
|
+
local function __TS__StringAccess(self, index)
|
|
1111
|
+
if index >= 0 and index < #self then
|
|
1112
|
+
return string.sub(self, index + 1, index + 1)
|
|
1113
|
+
end
|
|
1114
|
+
end
|
|
1115
|
+
|
|
1116
|
+
local function __TS__DelegatedYield(iterable)
|
|
1117
|
+
if type(iterable) == "string" then
|
|
1118
|
+
for index = 0, #iterable - 1 do
|
|
1119
|
+
coroutine.yield(__TS__StringAccess(iterable, index))
|
|
1120
|
+
end
|
|
1121
|
+
elseif iterable.____coroutine ~= nil then
|
|
1122
|
+
local co = iterable.____coroutine
|
|
1123
|
+
while true do
|
|
1124
|
+
local status, value = coroutine.resume(co)
|
|
1125
|
+
if not status then
|
|
1126
|
+
error(value, 0)
|
|
1127
|
+
end
|
|
1128
|
+
if coroutine.status(co) == "dead" then
|
|
1129
|
+
return value
|
|
1130
|
+
else
|
|
1131
|
+
coroutine.yield(value)
|
|
1132
|
+
end
|
|
1133
|
+
end
|
|
1134
|
+
elseif iterable[Symbol.iterator] then
|
|
1135
|
+
local iterator = iterable[Symbol.iterator](iterable)
|
|
1136
|
+
while true do
|
|
1137
|
+
local result = iterator:next()
|
|
1138
|
+
if result.done then
|
|
1139
|
+
return result.value
|
|
1140
|
+
else
|
|
1141
|
+
coroutine.yield(result.value)
|
|
1142
|
+
end
|
|
1143
|
+
end
|
|
1144
|
+
else
|
|
1145
|
+
for ____, value in ipairs(iterable) do
|
|
1146
|
+
coroutine.yield(value)
|
|
1147
|
+
end
|
|
1148
|
+
end
|
|
1149
|
+
end
|
|
1150
|
+
|
|
1151
|
+
local __TS__Generator
|
|
1152
|
+
do
|
|
1153
|
+
local function generatorIterator(self)
|
|
1154
|
+
return self
|
|
1155
|
+
end
|
|
1156
|
+
local function generatorNext(self, ...)
|
|
1157
|
+
local co = self.____coroutine
|
|
1158
|
+
if coroutine.status(co) == "dead" then
|
|
1159
|
+
return {done = true}
|
|
1160
|
+
end
|
|
1161
|
+
local status, value = coroutine.resume(co, ...)
|
|
1162
|
+
if not status then
|
|
1163
|
+
error(value, 0)
|
|
1164
|
+
end
|
|
1165
|
+
return {
|
|
1166
|
+
value = value,
|
|
1167
|
+
done = coroutine.status(co) == "dead"
|
|
1168
|
+
}
|
|
1169
|
+
end
|
|
1170
|
+
function __TS__Generator(fn)
|
|
1171
|
+
return function(...)
|
|
1172
|
+
local args = {...}
|
|
1173
|
+
local argsLength = select("#", ...)
|
|
1174
|
+
return {
|
|
1175
|
+
____coroutine = coroutine.create(function() return fn((unpack or table.unpack)(args, 1, argsLength)) end),
|
|
1176
|
+
[Symbol.iterator] = generatorIterator,
|
|
1177
|
+
next = generatorNext
|
|
1178
|
+
}
|
|
1179
|
+
end
|
|
1180
|
+
end
|
|
1181
|
+
end
|
|
1182
|
+
|
|
1183
|
+
local function __TS__InstanceOfObject(value)
|
|
1184
|
+
local valueType = type(value)
|
|
1185
|
+
return valueType == "table" or valueType == "function"
|
|
1186
|
+
end
|
|
1187
|
+
|
|
1188
|
+
local Map
|
|
1189
|
+
do
|
|
1190
|
+
Map = __TS__Class()
|
|
1191
|
+
Map.name = "Map"
|
|
1192
|
+
function Map.prototype.____constructor(self, entries)
|
|
1193
|
+
self[Symbol.toStringTag] = "Map"
|
|
1194
|
+
self.items = {}
|
|
1195
|
+
self.size = 0
|
|
1196
|
+
self.nextKey = {}
|
|
1197
|
+
self.previousKey = {}
|
|
1198
|
+
if entries == nil then
|
|
1199
|
+
return
|
|
1200
|
+
end
|
|
1201
|
+
local iterable = entries
|
|
1202
|
+
if iterable[Symbol.iterator] then
|
|
1203
|
+
local iterator = iterable[Symbol.iterator](iterable)
|
|
1204
|
+
while true do
|
|
1205
|
+
local result = iterator:next()
|
|
1206
|
+
if result.done then
|
|
1207
|
+
break
|
|
1208
|
+
end
|
|
1209
|
+
local value = result.value
|
|
1210
|
+
self:set(value[1], value[2])
|
|
1211
|
+
end
|
|
1212
|
+
else
|
|
1213
|
+
local array = entries
|
|
1214
|
+
for ____, kvp in ipairs(array) do
|
|
1215
|
+
self:set(kvp[1], kvp[2])
|
|
1216
|
+
end
|
|
1217
|
+
end
|
|
1218
|
+
end
|
|
1219
|
+
function Map.prototype.clear(self)
|
|
1220
|
+
self.items = {}
|
|
1221
|
+
self.nextKey = {}
|
|
1222
|
+
self.previousKey = {}
|
|
1223
|
+
self.firstKey = nil
|
|
1224
|
+
self.lastKey = nil
|
|
1225
|
+
self.size = 0
|
|
1226
|
+
end
|
|
1227
|
+
function Map.prototype.delete(self, key)
|
|
1228
|
+
local contains = self:has(key)
|
|
1229
|
+
if contains then
|
|
1230
|
+
self.size = self.size - 1
|
|
1231
|
+
local next = self.nextKey[key]
|
|
1232
|
+
local previous = self.previousKey[key]
|
|
1233
|
+
if next and previous then
|
|
1234
|
+
self.nextKey[previous] = next
|
|
1235
|
+
self.previousKey[next] = previous
|
|
1236
|
+
elseif next then
|
|
1237
|
+
self.firstKey = next
|
|
1238
|
+
self.previousKey[next] = nil
|
|
1239
|
+
elseif previous then
|
|
1240
|
+
self.lastKey = previous
|
|
1241
|
+
self.nextKey[previous] = nil
|
|
1242
|
+
else
|
|
1243
|
+
self.firstKey = nil
|
|
1244
|
+
self.lastKey = nil
|
|
1245
|
+
end
|
|
1246
|
+
self.nextKey[key] = nil
|
|
1247
|
+
self.previousKey[key] = nil
|
|
1248
|
+
end
|
|
1249
|
+
self.items[key] = nil
|
|
1250
|
+
return contains
|
|
1251
|
+
end
|
|
1252
|
+
function Map.prototype.forEach(self, callback)
|
|
1253
|
+
for ____, key in __TS__Iterator(self:keys()) do
|
|
1254
|
+
callback(nil, self.items[key], key, self)
|
|
1255
|
+
end
|
|
1256
|
+
end
|
|
1257
|
+
function Map.prototype.get(self, key)
|
|
1258
|
+
return self.items[key]
|
|
1259
|
+
end
|
|
1260
|
+
function Map.prototype.has(self, key)
|
|
1261
|
+
return self.nextKey[key] ~= nil or self.lastKey == key
|
|
1262
|
+
end
|
|
1263
|
+
function Map.prototype.set(self, key, value)
|
|
1264
|
+
local isNewValue = not self:has(key)
|
|
1265
|
+
if isNewValue then
|
|
1266
|
+
self.size = self.size + 1
|
|
1267
|
+
end
|
|
1268
|
+
self.items[key] = value
|
|
1269
|
+
if self.firstKey == nil then
|
|
1270
|
+
self.firstKey = key
|
|
1271
|
+
self.lastKey = key
|
|
1272
|
+
elseif isNewValue then
|
|
1273
|
+
self.nextKey[self.lastKey] = key
|
|
1274
|
+
self.previousKey[key] = self.lastKey
|
|
1275
|
+
self.lastKey = key
|
|
1276
|
+
end
|
|
1277
|
+
return self
|
|
1278
|
+
end
|
|
1279
|
+
Map.prototype[Symbol.iterator] = function(self)
|
|
1280
|
+
return self:entries()
|
|
1281
|
+
end
|
|
1282
|
+
function Map.prototype.entries(self)
|
|
1283
|
+
local ____temp_0 = self
|
|
1284
|
+
local items = ____temp_0.items
|
|
1285
|
+
local nextKey = ____temp_0.nextKey
|
|
1286
|
+
local key = self.firstKey
|
|
1287
|
+
return {
|
|
1288
|
+
[Symbol.iterator] = function(self)
|
|
1289
|
+
return self
|
|
1290
|
+
end,
|
|
1291
|
+
next = function(self)
|
|
1292
|
+
local result = {done = not key, value = {key, items[key]}}
|
|
1293
|
+
key = nextKey[key]
|
|
1294
|
+
return result
|
|
1295
|
+
end
|
|
1296
|
+
}
|
|
1297
|
+
end
|
|
1298
|
+
function Map.prototype.keys(self)
|
|
1299
|
+
local nextKey = self.nextKey
|
|
1300
|
+
local key = self.firstKey
|
|
1301
|
+
return {
|
|
1302
|
+
[Symbol.iterator] = function(self)
|
|
1303
|
+
return self
|
|
1304
|
+
end,
|
|
1305
|
+
next = function(self)
|
|
1306
|
+
local result = {done = not key, value = key}
|
|
1307
|
+
key = nextKey[key]
|
|
1308
|
+
return result
|
|
1309
|
+
end
|
|
1310
|
+
}
|
|
1311
|
+
end
|
|
1312
|
+
function Map.prototype.values(self)
|
|
1313
|
+
local ____temp_1 = self
|
|
1314
|
+
local items = ____temp_1.items
|
|
1315
|
+
local nextKey = ____temp_1.nextKey
|
|
1316
|
+
local key = self.firstKey
|
|
1317
|
+
return {
|
|
1318
|
+
[Symbol.iterator] = function(self)
|
|
1319
|
+
return self
|
|
1320
|
+
end,
|
|
1321
|
+
next = function(self)
|
|
1322
|
+
local result = {done = not key, value = items[key]}
|
|
1323
|
+
key = nextKey[key]
|
|
1324
|
+
return result
|
|
1325
|
+
end
|
|
1326
|
+
}
|
|
1327
|
+
end
|
|
1328
|
+
Map[Symbol.species] = Map
|
|
1329
|
+
end
|
|
1330
|
+
|
|
1331
|
+
local __TS__MathAtan2 = math.atan2 or math.atan
|
|
1332
|
+
|
|
1333
|
+
local function __TS__MathSign(val)
|
|
1334
|
+
if val > 0 then
|
|
1335
|
+
return 1
|
|
1336
|
+
elseif val < 0 then
|
|
1337
|
+
return -1
|
|
1338
|
+
end
|
|
1339
|
+
return 0
|
|
1340
|
+
end
|
|
1341
|
+
|
|
1342
|
+
local function __TS__Number(value)
|
|
1343
|
+
local valueType = type(value)
|
|
1344
|
+
if valueType == "number" then
|
|
1345
|
+
return value
|
|
1346
|
+
elseif valueType == "string" then
|
|
1347
|
+
local numberValue = tonumber(value)
|
|
1348
|
+
if numberValue then
|
|
1349
|
+
return numberValue
|
|
1350
|
+
end
|
|
1351
|
+
if value == "Infinity" then
|
|
1352
|
+
return math.huge
|
|
1353
|
+
end
|
|
1354
|
+
if value == "-Infinity" then
|
|
1355
|
+
return -math.huge
|
|
1356
|
+
end
|
|
1357
|
+
local stringWithoutSpaces = string.gsub(value, "%s", "")
|
|
1358
|
+
if stringWithoutSpaces == "" then
|
|
1359
|
+
return 0
|
|
1360
|
+
end
|
|
1361
|
+
return 0 / 0
|
|
1362
|
+
elseif valueType == "boolean" then
|
|
1363
|
+
return value and 1 or 0
|
|
1364
|
+
else
|
|
1365
|
+
return 0 / 0
|
|
1366
|
+
end
|
|
1367
|
+
end
|
|
1368
|
+
|
|
1369
|
+
local function __TS__NumberIsFinite(value)
|
|
1370
|
+
return type(value) == "number" and value == value and value ~= math.huge and value ~= -math.huge
|
|
1371
|
+
end
|
|
1372
|
+
|
|
1373
|
+
local function __TS__NumberIsNaN(value)
|
|
1374
|
+
return value ~= value
|
|
1375
|
+
end
|
|
1376
|
+
|
|
1377
|
+
local __TS__NumberToString
|
|
1378
|
+
do
|
|
1379
|
+
local radixChars = "0123456789abcdefghijklmnopqrstuvwxyz"
|
|
1380
|
+
function __TS__NumberToString(self, radix)
|
|
1381
|
+
if radix == nil or radix == 10 or self == math.huge or self == -math.huge or self ~= self then
|
|
1382
|
+
return tostring(self)
|
|
1383
|
+
end
|
|
1384
|
+
radix = math.floor(radix)
|
|
1385
|
+
if radix < 2 or radix > 36 then
|
|
1386
|
+
error("toString() radix argument must be between 2 and 36", 0)
|
|
1387
|
+
end
|
|
1388
|
+
local integer, fraction = math.modf(math.abs(self))
|
|
1389
|
+
local result = ""
|
|
1390
|
+
if radix == 8 then
|
|
1391
|
+
result = string.format("%o", integer)
|
|
1392
|
+
elseif radix == 16 then
|
|
1393
|
+
result = string.format("%x", integer)
|
|
1394
|
+
else
|
|
1395
|
+
repeat
|
|
1396
|
+
do
|
|
1397
|
+
result = __TS__StringAccess(radixChars, integer % radix) .. result
|
|
1398
|
+
integer = math.floor(integer / radix)
|
|
1399
|
+
end
|
|
1400
|
+
until not (integer ~= 0)
|
|
1401
|
+
end
|
|
1402
|
+
if fraction ~= 0 then
|
|
1403
|
+
result = result .. "."
|
|
1404
|
+
local delta = 1e-16
|
|
1405
|
+
repeat
|
|
1406
|
+
do
|
|
1407
|
+
fraction = fraction * radix
|
|
1408
|
+
delta = delta * radix
|
|
1409
|
+
local digit = math.floor(fraction)
|
|
1410
|
+
result = result .. __TS__StringAccess(radixChars, digit)
|
|
1411
|
+
fraction = fraction - digit
|
|
1412
|
+
end
|
|
1413
|
+
until not (fraction >= delta)
|
|
1414
|
+
end
|
|
1415
|
+
if self < 0 then
|
|
1416
|
+
result = "-" .. result
|
|
1417
|
+
end
|
|
1418
|
+
return result
|
|
1419
|
+
end
|
|
1420
|
+
end
|
|
1421
|
+
|
|
1422
|
+
local function __TS__ObjectDefineProperty(target, key, desc)
|
|
1423
|
+
local ____temp_0
|
|
1424
|
+
if type(key) == "number" then
|
|
1425
|
+
____temp_0 = key + 1
|
|
1426
|
+
else
|
|
1427
|
+
____temp_0 = key
|
|
1428
|
+
end
|
|
1429
|
+
local luaKey = ____temp_0
|
|
1430
|
+
local value = rawget(target, luaKey)
|
|
1431
|
+
local hasGetterOrSetter = desc.get ~= nil or desc.set ~= nil
|
|
1432
|
+
local descriptor
|
|
1433
|
+
if hasGetterOrSetter then
|
|
1434
|
+
if value ~= nil then
|
|
1435
|
+
error(
|
|
1436
|
+
"Cannot redefine property: " .. tostring(key),
|
|
1437
|
+
0
|
|
1438
|
+
)
|
|
1439
|
+
end
|
|
1440
|
+
descriptor = desc
|
|
1441
|
+
else
|
|
1442
|
+
local valueExists = value ~= nil
|
|
1443
|
+
local ____desc_set_5 = desc.set
|
|
1444
|
+
local ____desc_get_6 = desc.get
|
|
1445
|
+
local ____temp_1
|
|
1446
|
+
if desc.configurable ~= nil then
|
|
1447
|
+
____temp_1 = desc.configurable
|
|
1448
|
+
else
|
|
1449
|
+
____temp_1 = valueExists
|
|
1450
|
+
end
|
|
1451
|
+
local ____temp_2
|
|
1452
|
+
if desc.enumerable ~= nil then
|
|
1453
|
+
____temp_2 = desc.enumerable
|
|
1454
|
+
else
|
|
1455
|
+
____temp_2 = valueExists
|
|
1456
|
+
end
|
|
1457
|
+
local ____temp_3
|
|
1458
|
+
if desc.writable ~= nil then
|
|
1459
|
+
____temp_3 = desc.writable
|
|
1460
|
+
else
|
|
1461
|
+
____temp_3 = valueExists
|
|
1462
|
+
end
|
|
1463
|
+
local ____temp_4
|
|
1464
|
+
if desc.value ~= nil then
|
|
1465
|
+
____temp_4 = desc.value
|
|
1466
|
+
else
|
|
1467
|
+
____temp_4 = value
|
|
1468
|
+
end
|
|
1469
|
+
descriptor = {
|
|
1470
|
+
set = ____desc_set_5,
|
|
1471
|
+
get = ____desc_get_6,
|
|
1472
|
+
configurable = ____temp_1,
|
|
1473
|
+
enumerable = ____temp_2,
|
|
1474
|
+
writable = ____temp_3,
|
|
1475
|
+
value = ____temp_4
|
|
1476
|
+
}
|
|
1477
|
+
end
|
|
1478
|
+
__TS__SetDescriptor(target, luaKey, descriptor)
|
|
1479
|
+
return target
|
|
1480
|
+
end
|
|
1481
|
+
|
|
1482
|
+
local function __TS__ObjectEntries(obj)
|
|
1483
|
+
local result = {}
|
|
1484
|
+
local len = 0
|
|
1485
|
+
for key in pairs(obj) do
|
|
1486
|
+
len = len + 1
|
|
1487
|
+
result[len] = {key, obj[key]}
|
|
1488
|
+
end
|
|
1489
|
+
return result
|
|
1490
|
+
end
|
|
1491
|
+
|
|
1492
|
+
local function __TS__ObjectFromEntries(entries)
|
|
1493
|
+
local obj = {}
|
|
1494
|
+
local iterable = entries
|
|
1495
|
+
if iterable[Symbol.iterator] then
|
|
1496
|
+
local iterator = iterable[Symbol.iterator](iterable)
|
|
1497
|
+
while true do
|
|
1498
|
+
local result = iterator:next()
|
|
1499
|
+
if result.done then
|
|
1500
|
+
break
|
|
1501
|
+
end
|
|
1502
|
+
local value = result.value
|
|
1503
|
+
obj[value[1]] = value[2]
|
|
1504
|
+
end
|
|
1505
|
+
else
|
|
1506
|
+
for ____, entry in ipairs(entries) do
|
|
1507
|
+
obj[entry[1]] = entry[2]
|
|
1508
|
+
end
|
|
1509
|
+
end
|
|
1510
|
+
return obj
|
|
1511
|
+
end
|
|
1512
|
+
|
|
1513
|
+
local function __TS__ObjectKeys(obj)
|
|
1514
|
+
local result = {}
|
|
1515
|
+
local len = 0
|
|
1516
|
+
for key in pairs(obj) do
|
|
1517
|
+
len = len + 1
|
|
1518
|
+
result[len] = key
|
|
1519
|
+
end
|
|
1520
|
+
return result
|
|
1521
|
+
end
|
|
1522
|
+
|
|
1523
|
+
local function __TS__ObjectRest(target, usedProperties)
|
|
1524
|
+
local result = {}
|
|
1525
|
+
for property in pairs(target) do
|
|
1526
|
+
if not usedProperties[property] then
|
|
1527
|
+
result[property] = target[property]
|
|
1528
|
+
end
|
|
1529
|
+
end
|
|
1530
|
+
return result
|
|
1531
|
+
end
|
|
1532
|
+
|
|
1533
|
+
local function __TS__ObjectValues(obj)
|
|
1534
|
+
local result = {}
|
|
1535
|
+
local len = 0
|
|
1536
|
+
for key in pairs(obj) do
|
|
1537
|
+
len = len + 1
|
|
1538
|
+
result[len] = obj[key]
|
|
1539
|
+
end
|
|
1540
|
+
return result
|
|
1541
|
+
end
|
|
1542
|
+
|
|
1543
|
+
local function __TS__ParseFloat(numberString)
|
|
1544
|
+
local infinityMatch = string.match(numberString, "^%s*(-?Infinity)")
|
|
1545
|
+
if infinityMatch then
|
|
1546
|
+
local ____temp_0
|
|
1547
|
+
if __TS__StringAccess(infinityMatch, 0) == "-" then
|
|
1548
|
+
____temp_0 = -math.huge
|
|
1549
|
+
else
|
|
1550
|
+
____temp_0 = math.huge
|
|
1551
|
+
end
|
|
1552
|
+
return ____temp_0
|
|
1553
|
+
end
|
|
1554
|
+
local number = tonumber(string.match(numberString, "^%s*(-?%d+%.?%d*)"))
|
|
1555
|
+
return number or 0 / 0
|
|
1556
|
+
end
|
|
1557
|
+
|
|
1558
|
+
local function __TS__StringSubstr(self, from, length)
|
|
1559
|
+
if from ~= from then
|
|
1560
|
+
from = 0
|
|
1561
|
+
end
|
|
1562
|
+
if length ~= nil then
|
|
1563
|
+
if length ~= length or length <= 0 then
|
|
1564
|
+
return ""
|
|
1565
|
+
end
|
|
1566
|
+
length = length + from
|
|
1567
|
+
end
|
|
1568
|
+
if from >= 0 then
|
|
1569
|
+
from = from + 1
|
|
1570
|
+
end
|
|
1571
|
+
return string.sub(self, from, length)
|
|
1572
|
+
end
|
|
1573
|
+
|
|
1574
|
+
local function __TS__StringSubstring(self, start, ____end)
|
|
1575
|
+
if ____end ~= ____end then
|
|
1576
|
+
____end = 0
|
|
1577
|
+
end
|
|
1578
|
+
if ____end ~= nil and start > ____end then
|
|
1579
|
+
start, ____end = ____end, start
|
|
1580
|
+
end
|
|
1581
|
+
if start >= 0 then
|
|
1582
|
+
start = start + 1
|
|
1583
|
+
else
|
|
1584
|
+
start = 1
|
|
1585
|
+
end
|
|
1586
|
+
if ____end ~= nil and ____end < 0 then
|
|
1587
|
+
____end = 0
|
|
1588
|
+
end
|
|
1589
|
+
return string.sub(self, start, ____end)
|
|
1590
|
+
end
|
|
1591
|
+
|
|
1592
|
+
local __TS__ParseInt
|
|
1593
|
+
do
|
|
1594
|
+
local parseIntBasePattern = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTvVwWxXyYzZ"
|
|
1595
|
+
function __TS__ParseInt(numberString, base)
|
|
1596
|
+
if base == nil then
|
|
1597
|
+
base = 10
|
|
1598
|
+
local hexMatch = string.match(numberString, "^%s*-?0[xX]")
|
|
1599
|
+
if hexMatch then
|
|
1600
|
+
base = 16
|
|
1601
|
+
local ____string_match_result__0_0
|
|
1602
|
+
if string.match(hexMatch, "-") then
|
|
1603
|
+
____string_match_result__0_0 = "-" .. __TS__StringSubstr(numberString, #hexMatch)
|
|
1604
|
+
else
|
|
1605
|
+
____string_match_result__0_0 = __TS__StringSubstr(numberString, #hexMatch)
|
|
1606
|
+
end
|
|
1607
|
+
numberString = ____string_match_result__0_0
|
|
1608
|
+
end
|
|
1609
|
+
end
|
|
1610
|
+
if base < 2 or base > 36 then
|
|
1611
|
+
return 0 / 0
|
|
1612
|
+
end
|
|
1613
|
+
local ____temp_1
|
|
1614
|
+
if base <= 10 then
|
|
1615
|
+
____temp_1 = __TS__StringSubstring(parseIntBasePattern, 0, base)
|
|
1616
|
+
else
|
|
1617
|
+
____temp_1 = __TS__StringSubstr(parseIntBasePattern, 0, 10 + 2 * (base - 10))
|
|
1618
|
+
end
|
|
1619
|
+
local allowedDigits = ____temp_1
|
|
1620
|
+
local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
|
|
1621
|
+
local number = tonumber(
|
|
1622
|
+
string.match(numberString, pattern),
|
|
1623
|
+
base
|
|
1624
|
+
)
|
|
1625
|
+
if number == nil then
|
|
1626
|
+
return 0 / 0
|
|
1627
|
+
end
|
|
1628
|
+
if number >= 0 then
|
|
1629
|
+
return math.floor(number)
|
|
1630
|
+
else
|
|
1631
|
+
return math.ceil(number)
|
|
1632
|
+
end
|
|
1633
|
+
end
|
|
1634
|
+
end
|
|
1635
|
+
|
|
1636
|
+
local function __TS__PromiseAll(iterable)
|
|
1637
|
+
local results = {}
|
|
1638
|
+
local toResolve = {}
|
|
1639
|
+
local numToResolve = 0
|
|
1640
|
+
local i = 0
|
|
1641
|
+
for ____, item in __TS__Iterator(iterable) do
|
|
1642
|
+
if __TS__InstanceOf(item, __TS__Promise) then
|
|
1643
|
+
if item.state == 1 then
|
|
1644
|
+
results[i + 1] = item.value
|
|
1645
|
+
elseif item.state == 2 then
|
|
1646
|
+
return __TS__Promise.reject(item.rejectionReason)
|
|
1647
|
+
else
|
|
1648
|
+
numToResolve = numToResolve + 1
|
|
1649
|
+
toResolve[i] = item
|
|
1650
|
+
end
|
|
1651
|
+
else
|
|
1652
|
+
results[i + 1] = item
|
|
1653
|
+
end
|
|
1654
|
+
i = i + 1
|
|
1655
|
+
end
|
|
1656
|
+
if numToResolve == 0 then
|
|
1657
|
+
return __TS__Promise.resolve(results)
|
|
1658
|
+
end
|
|
1659
|
+
return __TS__New(
|
|
1660
|
+
__TS__Promise,
|
|
1661
|
+
function(____, resolve, reject)
|
|
1662
|
+
for index, promise in pairs(toResolve) do
|
|
1663
|
+
promise["then"](
|
|
1664
|
+
promise,
|
|
1665
|
+
function(____, data)
|
|
1666
|
+
results[index + 1] = data
|
|
1667
|
+
numToResolve = numToResolve - 1
|
|
1668
|
+
if numToResolve == 0 then
|
|
1669
|
+
resolve(nil, results)
|
|
1670
|
+
end
|
|
1671
|
+
end,
|
|
1672
|
+
function(____, reason)
|
|
1673
|
+
reject(nil, reason)
|
|
1674
|
+
end
|
|
1675
|
+
)
|
|
1676
|
+
end
|
|
1677
|
+
end
|
|
1678
|
+
)
|
|
1679
|
+
end
|
|
1680
|
+
|
|
1681
|
+
local function __TS__PromiseAllSettled(iterable)
|
|
1682
|
+
local results = {}
|
|
1683
|
+
local toResolve = {}
|
|
1684
|
+
local numToResolve = 0
|
|
1685
|
+
local i = 0
|
|
1686
|
+
for ____, item in __TS__Iterator(iterable) do
|
|
1687
|
+
if __TS__InstanceOf(item, __TS__Promise) then
|
|
1688
|
+
if item.state == 1 then
|
|
1689
|
+
results[i + 1] = {status = "fulfilled", value = item.value}
|
|
1690
|
+
elseif item.state == 2 then
|
|
1691
|
+
results[i + 1] = {status = "rejected", reason = item.rejectionReason}
|
|
1692
|
+
else
|
|
1693
|
+
numToResolve = numToResolve + 1
|
|
1694
|
+
toResolve[i] = item
|
|
1695
|
+
end
|
|
1696
|
+
else
|
|
1697
|
+
results[i + 1] = {status = "fulfilled", value = item}
|
|
1698
|
+
end
|
|
1699
|
+
i = i + 1
|
|
1700
|
+
end
|
|
1701
|
+
if numToResolve == 0 then
|
|
1702
|
+
return __TS__Promise.resolve(results)
|
|
1703
|
+
end
|
|
1704
|
+
return __TS__New(
|
|
1705
|
+
__TS__Promise,
|
|
1706
|
+
function(____, resolve)
|
|
1707
|
+
for index, promise in pairs(toResolve) do
|
|
1708
|
+
promise["then"](
|
|
1709
|
+
promise,
|
|
1710
|
+
function(____, data)
|
|
1711
|
+
results[index + 1] = {status = "fulfilled", value = data}
|
|
1712
|
+
numToResolve = numToResolve - 1
|
|
1713
|
+
if numToResolve == 0 then
|
|
1714
|
+
resolve(nil, results)
|
|
1715
|
+
end
|
|
1716
|
+
end,
|
|
1717
|
+
function(____, reason)
|
|
1718
|
+
results[index + 1] = {status = "rejected", reason = reason}
|
|
1719
|
+
numToResolve = numToResolve - 1
|
|
1720
|
+
if numToResolve == 0 then
|
|
1721
|
+
resolve(nil, results)
|
|
1722
|
+
end
|
|
1723
|
+
end
|
|
1724
|
+
)
|
|
1725
|
+
end
|
|
1726
|
+
end
|
|
1727
|
+
)
|
|
1728
|
+
end
|
|
1729
|
+
|
|
1730
|
+
local function __TS__PromiseAny(iterable)
|
|
1731
|
+
local rejections = {}
|
|
1732
|
+
local pending = {}
|
|
1733
|
+
for ____, item in __TS__Iterator(iterable) do
|
|
1734
|
+
if __TS__InstanceOf(item, __TS__Promise) then
|
|
1735
|
+
if item.state == 1 then
|
|
1736
|
+
return __TS__Promise.resolve(item.value)
|
|
1737
|
+
elseif item.state == 2 then
|
|
1738
|
+
rejections[#rejections + 1] = item.rejectionReason
|
|
1739
|
+
else
|
|
1740
|
+
pending[#pending + 1] = item
|
|
1741
|
+
end
|
|
1742
|
+
else
|
|
1743
|
+
return __TS__Promise.resolve(item)
|
|
1744
|
+
end
|
|
1745
|
+
end
|
|
1746
|
+
if #pending == 0 then
|
|
1747
|
+
return __TS__Promise.reject("No promises to resolve with .any()")
|
|
1748
|
+
end
|
|
1749
|
+
local numResolved = 0
|
|
1750
|
+
return __TS__New(
|
|
1751
|
+
__TS__Promise,
|
|
1752
|
+
function(____, resolve, reject)
|
|
1753
|
+
for ____, promise in ipairs(pending) do
|
|
1754
|
+
promise["then"](
|
|
1755
|
+
promise,
|
|
1756
|
+
function(____, data)
|
|
1757
|
+
resolve(nil, data)
|
|
1758
|
+
end,
|
|
1759
|
+
function(____, reason)
|
|
1760
|
+
rejections[#rejections + 1] = reason
|
|
1761
|
+
numResolved = numResolved + 1
|
|
1762
|
+
if numResolved == #pending then
|
|
1763
|
+
reject(nil, {name = "AggregateError", message = "All Promises rejected", errors = rejections})
|
|
1764
|
+
end
|
|
1765
|
+
end
|
|
1766
|
+
)
|
|
1767
|
+
end
|
|
1768
|
+
end
|
|
1769
|
+
)
|
|
1770
|
+
end
|
|
1771
|
+
|
|
1772
|
+
local function __TS__PromiseRace(iterable)
|
|
1773
|
+
local pending = {}
|
|
1774
|
+
for ____, item in __TS__Iterator(iterable) do
|
|
1775
|
+
if __TS__InstanceOf(item, __TS__Promise) then
|
|
1776
|
+
if item.state == 1 then
|
|
1777
|
+
return __TS__Promise.resolve(item.value)
|
|
1778
|
+
elseif item.state == 2 then
|
|
1779
|
+
return __TS__Promise.reject(item.rejectionReason)
|
|
1780
|
+
else
|
|
1781
|
+
pending[#pending + 1] = item
|
|
1782
|
+
end
|
|
1783
|
+
else
|
|
1784
|
+
return __TS__Promise.resolve(item)
|
|
1785
|
+
end
|
|
1786
|
+
end
|
|
1787
|
+
return __TS__New(
|
|
1788
|
+
__TS__Promise,
|
|
1789
|
+
function(____, resolve, reject)
|
|
1790
|
+
for ____, promise in ipairs(pending) do
|
|
1791
|
+
promise["then"](
|
|
1792
|
+
promise,
|
|
1793
|
+
function(____, value) return resolve(nil, value) end,
|
|
1794
|
+
function(____, reason) return reject(nil, reason) end
|
|
1795
|
+
)
|
|
1796
|
+
end
|
|
1797
|
+
end
|
|
1798
|
+
)
|
|
1799
|
+
end
|
|
1800
|
+
|
|
1801
|
+
local Set
|
|
1802
|
+
do
|
|
1803
|
+
Set = __TS__Class()
|
|
1804
|
+
Set.name = "Set"
|
|
1805
|
+
function Set.prototype.____constructor(self, values)
|
|
1806
|
+
self[Symbol.toStringTag] = "Set"
|
|
1807
|
+
self.size = 0
|
|
1808
|
+
self.nextKey = {}
|
|
1809
|
+
self.previousKey = {}
|
|
1810
|
+
if values == nil then
|
|
1811
|
+
return
|
|
1812
|
+
end
|
|
1813
|
+
local iterable = values
|
|
1814
|
+
if iterable[Symbol.iterator] then
|
|
1815
|
+
local iterator = iterable[Symbol.iterator](iterable)
|
|
1816
|
+
while true do
|
|
1817
|
+
local result = iterator:next()
|
|
1818
|
+
if result.done then
|
|
1819
|
+
break
|
|
1820
|
+
end
|
|
1821
|
+
self:add(result.value)
|
|
1822
|
+
end
|
|
1823
|
+
else
|
|
1824
|
+
local array = values
|
|
1825
|
+
for ____, value in ipairs(array) do
|
|
1826
|
+
self:add(value)
|
|
1827
|
+
end
|
|
1828
|
+
end
|
|
1829
|
+
end
|
|
1830
|
+
function Set.prototype.add(self, value)
|
|
1831
|
+
local isNewValue = not self:has(value)
|
|
1832
|
+
if isNewValue then
|
|
1833
|
+
self.size = self.size + 1
|
|
1834
|
+
end
|
|
1835
|
+
if self.firstKey == nil then
|
|
1836
|
+
self.firstKey = value
|
|
1837
|
+
self.lastKey = value
|
|
1838
|
+
elseif isNewValue then
|
|
1839
|
+
self.nextKey[self.lastKey] = value
|
|
1840
|
+
self.previousKey[value] = self.lastKey
|
|
1841
|
+
self.lastKey = value
|
|
1842
|
+
end
|
|
1843
|
+
return self
|
|
1844
|
+
end
|
|
1845
|
+
function Set.prototype.clear(self)
|
|
1846
|
+
self.nextKey = {}
|
|
1847
|
+
self.previousKey = {}
|
|
1848
|
+
self.firstKey = nil
|
|
1849
|
+
self.lastKey = nil
|
|
1850
|
+
self.size = 0
|
|
1851
|
+
end
|
|
1852
|
+
function Set.prototype.delete(self, value)
|
|
1853
|
+
local contains = self:has(value)
|
|
1854
|
+
if contains then
|
|
1855
|
+
self.size = self.size - 1
|
|
1856
|
+
local next = self.nextKey[value]
|
|
1857
|
+
local previous = self.previousKey[value]
|
|
1858
|
+
if next and previous then
|
|
1859
|
+
self.nextKey[previous] = next
|
|
1860
|
+
self.previousKey[next] = previous
|
|
1861
|
+
elseif next then
|
|
1862
|
+
self.firstKey = next
|
|
1863
|
+
self.previousKey[next] = nil
|
|
1864
|
+
elseif previous then
|
|
1865
|
+
self.lastKey = previous
|
|
1866
|
+
self.nextKey[previous] = nil
|
|
1867
|
+
else
|
|
1868
|
+
self.firstKey = nil
|
|
1869
|
+
self.lastKey = nil
|
|
1870
|
+
end
|
|
1871
|
+
self.nextKey[value] = nil
|
|
1872
|
+
self.previousKey[value] = nil
|
|
1873
|
+
end
|
|
1874
|
+
return contains
|
|
1875
|
+
end
|
|
1876
|
+
function Set.prototype.forEach(self, callback)
|
|
1877
|
+
for ____, key in __TS__Iterator(self:keys()) do
|
|
1878
|
+
callback(nil, key, key, self)
|
|
1879
|
+
end
|
|
1880
|
+
end
|
|
1881
|
+
function Set.prototype.has(self, value)
|
|
1882
|
+
return self.nextKey[value] ~= nil or self.lastKey == value
|
|
1883
|
+
end
|
|
1884
|
+
Set.prototype[Symbol.iterator] = function(self)
|
|
1885
|
+
return self:values()
|
|
1886
|
+
end
|
|
1887
|
+
function Set.prototype.entries(self)
|
|
1888
|
+
local nextKey = self.nextKey
|
|
1889
|
+
local key = self.firstKey
|
|
1890
|
+
return {
|
|
1891
|
+
[Symbol.iterator] = function(self)
|
|
1892
|
+
return self
|
|
1893
|
+
end,
|
|
1894
|
+
next = function(self)
|
|
1895
|
+
local result = {done = not key, value = {key, key}}
|
|
1896
|
+
key = nextKey[key]
|
|
1897
|
+
return result
|
|
1898
|
+
end
|
|
1899
|
+
}
|
|
1900
|
+
end
|
|
1901
|
+
function Set.prototype.keys(self)
|
|
1902
|
+
local nextKey = self.nextKey
|
|
1903
|
+
local key = self.firstKey
|
|
1904
|
+
return {
|
|
1905
|
+
[Symbol.iterator] = function(self)
|
|
1906
|
+
return self
|
|
1907
|
+
end,
|
|
1908
|
+
next = function(self)
|
|
1909
|
+
local result = {done = not key, value = key}
|
|
1910
|
+
key = nextKey[key]
|
|
1911
|
+
return result
|
|
1912
|
+
end
|
|
1913
|
+
}
|
|
1914
|
+
end
|
|
1915
|
+
function Set.prototype.values(self)
|
|
1916
|
+
local nextKey = self.nextKey
|
|
1917
|
+
local key = self.firstKey
|
|
1918
|
+
return {
|
|
1919
|
+
[Symbol.iterator] = function(self)
|
|
1920
|
+
return self
|
|
1921
|
+
end,
|
|
1922
|
+
next = function(self)
|
|
1923
|
+
local result = {done = not key, value = key}
|
|
1924
|
+
key = nextKey[key]
|
|
1925
|
+
return result
|
|
1926
|
+
end
|
|
1927
|
+
}
|
|
1928
|
+
end
|
|
1929
|
+
Set[Symbol.species] = Set
|
|
1930
|
+
end
|
|
1931
|
+
|
|
1932
|
+
local function __TS__SparseArrayNew(...)
|
|
1933
|
+
local sparseArray = {...}
|
|
1934
|
+
sparseArray.sparseLength = select("#", ...)
|
|
1935
|
+
return sparseArray
|
|
1936
|
+
end
|
|
1937
|
+
|
|
1938
|
+
local function __TS__SparseArrayPush(sparseArray, ...)
|
|
1939
|
+
local args = {...}
|
|
1940
|
+
local argsLen = select("#", ...)
|
|
1941
|
+
local listLen = sparseArray.sparseLength
|
|
1942
|
+
for i = 1, argsLen do
|
|
1943
|
+
sparseArray[listLen + i] = args[i]
|
|
1944
|
+
end
|
|
1945
|
+
sparseArray.sparseLength = listLen + argsLen
|
|
1946
|
+
end
|
|
1947
|
+
|
|
1948
|
+
local function __TS__SparseArraySpread(sparseArray)
|
|
1949
|
+
local _unpack = unpack or table.unpack
|
|
1950
|
+
return _unpack(sparseArray, 1, sparseArray.sparseLength)
|
|
1951
|
+
end
|
|
1952
|
+
|
|
1953
|
+
local WeakMap
|
|
1954
|
+
do
|
|
1955
|
+
WeakMap = __TS__Class()
|
|
1956
|
+
WeakMap.name = "WeakMap"
|
|
1957
|
+
function WeakMap.prototype.____constructor(self, entries)
|
|
1958
|
+
self[Symbol.toStringTag] = "WeakMap"
|
|
1959
|
+
self.items = {}
|
|
1960
|
+
setmetatable(self.items, {__mode = "k"})
|
|
1961
|
+
if entries == nil then
|
|
1962
|
+
return
|
|
1963
|
+
end
|
|
1964
|
+
local iterable = entries
|
|
1965
|
+
if iterable[Symbol.iterator] then
|
|
1966
|
+
local iterator = iterable[Symbol.iterator](iterable)
|
|
1967
|
+
while true do
|
|
1968
|
+
local result = iterator:next()
|
|
1969
|
+
if result.done then
|
|
1970
|
+
break
|
|
1971
|
+
end
|
|
1972
|
+
local value = result.value
|
|
1973
|
+
self.items[value[1]] = value[2]
|
|
1974
|
+
end
|
|
1975
|
+
else
|
|
1976
|
+
for ____, kvp in ipairs(entries) do
|
|
1977
|
+
self.items[kvp[1]] = kvp[2]
|
|
1978
|
+
end
|
|
1979
|
+
end
|
|
1980
|
+
end
|
|
1981
|
+
function WeakMap.prototype.delete(self, key)
|
|
1982
|
+
local contains = self:has(key)
|
|
1983
|
+
self.items[key] = nil
|
|
1984
|
+
return contains
|
|
1985
|
+
end
|
|
1986
|
+
function WeakMap.prototype.get(self, key)
|
|
1987
|
+
return self.items[key]
|
|
1988
|
+
end
|
|
1989
|
+
function WeakMap.prototype.has(self, key)
|
|
1990
|
+
return self.items[key] ~= nil
|
|
1991
|
+
end
|
|
1992
|
+
function WeakMap.prototype.set(self, key, value)
|
|
1993
|
+
self.items[key] = value
|
|
1994
|
+
return self
|
|
1995
|
+
end
|
|
1996
|
+
WeakMap[Symbol.species] = WeakMap
|
|
1997
|
+
end
|
|
1998
|
+
|
|
1999
|
+
local WeakSet
|
|
2000
|
+
do
|
|
2001
|
+
WeakSet = __TS__Class()
|
|
2002
|
+
WeakSet.name = "WeakSet"
|
|
2003
|
+
function WeakSet.prototype.____constructor(self, values)
|
|
2004
|
+
self[Symbol.toStringTag] = "WeakSet"
|
|
2005
|
+
self.items = {}
|
|
2006
|
+
setmetatable(self.items, {__mode = "k"})
|
|
2007
|
+
if values == nil then
|
|
2008
|
+
return
|
|
2009
|
+
end
|
|
2010
|
+
local iterable = values
|
|
2011
|
+
if iterable[Symbol.iterator] then
|
|
2012
|
+
local iterator = iterable[Symbol.iterator](iterable)
|
|
2013
|
+
while true do
|
|
2014
|
+
local result = iterator:next()
|
|
2015
|
+
if result.done then
|
|
2016
|
+
break
|
|
2017
|
+
end
|
|
2018
|
+
self.items[result.value] = true
|
|
2019
|
+
end
|
|
2020
|
+
else
|
|
2021
|
+
for ____, value in ipairs(values) do
|
|
2022
|
+
self.items[value] = true
|
|
2023
|
+
end
|
|
2024
|
+
end
|
|
2025
|
+
end
|
|
2026
|
+
function WeakSet.prototype.add(self, value)
|
|
2027
|
+
self.items[value] = true
|
|
2028
|
+
return self
|
|
2029
|
+
end
|
|
2030
|
+
function WeakSet.prototype.delete(self, value)
|
|
2031
|
+
local contains = self:has(value)
|
|
2032
|
+
self.items[value] = nil
|
|
2033
|
+
return contains
|
|
2034
|
+
end
|
|
2035
|
+
function WeakSet.prototype.has(self, value)
|
|
2036
|
+
return self.items[value] == true
|
|
2037
|
+
end
|
|
2038
|
+
WeakSet[Symbol.species] = WeakSet
|
|
2039
|
+
end
|
|
2040
|
+
|
|
2041
|
+
local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
2042
|
+
_G.__TS__sourcemap = _G.__TS__sourcemap or ({})
|
|
2043
|
+
_G.__TS__sourcemap[fileName] = sourceMap
|
|
2044
|
+
if _G.__TS__originalTraceback == nil then
|
|
2045
|
+
local originalTraceback = debug.traceback
|
|
2046
|
+
_G.__TS__originalTraceback = originalTraceback
|
|
2047
|
+
debug.traceback = function(thread, message, level)
|
|
2048
|
+
local trace
|
|
2049
|
+
if thread == nil and message == nil and level == nil then
|
|
2050
|
+
trace = originalTraceback()
|
|
2051
|
+
else
|
|
2052
|
+
trace = originalTraceback(thread, message, level)
|
|
2053
|
+
end
|
|
2054
|
+
if type(trace) ~= "string" then
|
|
2055
|
+
return trace
|
|
2056
|
+
end
|
|
2057
|
+
local function replacer(____, file, srcFile, line)
|
|
2058
|
+
local fileSourceMap = _G.__TS__sourcemap[file]
|
|
2059
|
+
if fileSourceMap and fileSourceMap[line] then
|
|
2060
|
+
local data = fileSourceMap[line]
|
|
2061
|
+
if type(data) == "number" then
|
|
2062
|
+
return (srcFile .. ":") .. tostring(data)
|
|
2063
|
+
end
|
|
2064
|
+
return (tostring(data.file) .. ":") .. tostring(data.line)
|
|
2065
|
+
end
|
|
2066
|
+
return (file .. ":") .. line
|
|
2067
|
+
end
|
|
2068
|
+
local result = string.gsub(
|
|
2069
|
+
trace,
|
|
2070
|
+
"(%S+)%.lua:(%d+)",
|
|
2071
|
+
function(file, line) return replacer(nil, file .. ".lua", file .. ".ts", line) end
|
|
2072
|
+
)
|
|
2073
|
+
local function stringReplacer(____, file, line)
|
|
2074
|
+
local fileSourceMap = _G.__TS__sourcemap[file]
|
|
2075
|
+
if fileSourceMap and fileSourceMap[line] then
|
|
2076
|
+
local chunkName = string.match(file, "%[string \"([^\"]+)\"%]")
|
|
2077
|
+
local sourceName = string.gsub(chunkName, ".lua$", ".ts")
|
|
2078
|
+
local data = fileSourceMap[line]
|
|
2079
|
+
if type(data) == "number" then
|
|
2080
|
+
return (sourceName .. ":") .. tostring(data)
|
|
2081
|
+
end
|
|
2082
|
+
return (tostring(data.file) .. ":") .. tostring(data.line)
|
|
2083
|
+
end
|
|
2084
|
+
return (file .. ":") .. line
|
|
2085
|
+
end
|
|
2086
|
+
result = string.gsub(
|
|
2087
|
+
result,
|
|
2088
|
+
"(%[string \"[^\"]+\"%]):(%d+)",
|
|
2089
|
+
function(file, line) return stringReplacer(nil, file, line) end
|
|
2090
|
+
)
|
|
2091
|
+
return result
|
|
2092
|
+
end
|
|
2093
|
+
end
|
|
2094
|
+
end
|
|
2095
|
+
|
|
2096
|
+
local function __TS__Spread(iterable)
|
|
2097
|
+
local arr = {}
|
|
2098
|
+
if type(iterable) == "string" then
|
|
2099
|
+
for i = 0, #iterable - 1 do
|
|
2100
|
+
arr[i + 1] = __TS__StringAccess(iterable, i)
|
|
2101
|
+
end
|
|
2102
|
+
else
|
|
2103
|
+
local len = 0
|
|
2104
|
+
for ____, item in __TS__Iterator(iterable) do
|
|
2105
|
+
len = len + 1
|
|
2106
|
+
arr[len] = item
|
|
2107
|
+
end
|
|
2108
|
+
end
|
|
2109
|
+
return __TS__Unpack(arr)
|
|
2110
|
+
end
|
|
2111
|
+
|
|
2112
|
+
local function __TS__StringCharAt(self, pos)
|
|
2113
|
+
if pos ~= pos then
|
|
2114
|
+
pos = 0
|
|
2115
|
+
end
|
|
2116
|
+
if pos < 0 then
|
|
2117
|
+
return ""
|
|
2118
|
+
end
|
|
2119
|
+
return string.sub(self, pos + 1, pos + 1)
|
|
2120
|
+
end
|
|
2121
|
+
|
|
2122
|
+
local function __TS__StringCharCodeAt(self, index)
|
|
2123
|
+
if index ~= index then
|
|
2124
|
+
index = 0
|
|
2125
|
+
end
|
|
2126
|
+
if index < 0 then
|
|
2127
|
+
return 0 / 0
|
|
2128
|
+
end
|
|
2129
|
+
return string.byte(self, index + 1) or 0 / 0
|
|
2130
|
+
end
|
|
2131
|
+
|
|
2132
|
+
local function __TS__StringEndsWith(self, searchString, endPosition)
|
|
2133
|
+
if endPosition == nil or endPosition > #self then
|
|
2134
|
+
endPosition = #self
|
|
2135
|
+
end
|
|
2136
|
+
return string.sub(self, endPosition - #searchString + 1, endPosition) == searchString
|
|
2137
|
+
end
|
|
2138
|
+
|
|
2139
|
+
local function __TS__StringIncludes(self, searchString, position)
|
|
2140
|
+
if not position then
|
|
2141
|
+
position = 1
|
|
2142
|
+
else
|
|
2143
|
+
position = position + 1
|
|
2144
|
+
end
|
|
2145
|
+
local index = string.find(self, searchString, position, true)
|
|
2146
|
+
return index ~= nil
|
|
2147
|
+
end
|
|
2148
|
+
|
|
2149
|
+
local function __TS__StringPadEnd(self, maxLength, fillString)
|
|
2150
|
+
if fillString == nil then
|
|
2151
|
+
fillString = " "
|
|
2152
|
+
end
|
|
2153
|
+
if maxLength ~= maxLength then
|
|
2154
|
+
maxLength = 0
|
|
2155
|
+
end
|
|
2156
|
+
if maxLength == -math.huge or maxLength == math.huge then
|
|
2157
|
+
error("Invalid string length", 0)
|
|
2158
|
+
end
|
|
2159
|
+
if #self >= maxLength or #fillString == 0 then
|
|
2160
|
+
return self
|
|
2161
|
+
end
|
|
2162
|
+
maxLength = maxLength - #self
|
|
2163
|
+
if maxLength > #fillString then
|
|
2164
|
+
fillString = fillString .. string.rep(
|
|
2165
|
+
fillString,
|
|
2166
|
+
math.floor(maxLength / #fillString)
|
|
2167
|
+
)
|
|
2168
|
+
end
|
|
2169
|
+
return self .. string.sub(
|
|
2170
|
+
fillString,
|
|
2171
|
+
1,
|
|
2172
|
+
math.floor(maxLength)
|
|
2173
|
+
)
|
|
2174
|
+
end
|
|
2175
|
+
|
|
2176
|
+
local function __TS__StringPadStart(self, maxLength, fillString)
|
|
2177
|
+
if fillString == nil then
|
|
2178
|
+
fillString = " "
|
|
2179
|
+
end
|
|
2180
|
+
if maxLength ~= maxLength then
|
|
2181
|
+
maxLength = 0
|
|
2182
|
+
end
|
|
2183
|
+
if maxLength == -math.huge or maxLength == math.huge then
|
|
2184
|
+
error("Invalid string length", 0)
|
|
2185
|
+
end
|
|
2186
|
+
if #self >= maxLength or #fillString == 0 then
|
|
2187
|
+
return self
|
|
2188
|
+
end
|
|
2189
|
+
maxLength = maxLength - #self
|
|
2190
|
+
if maxLength > #fillString then
|
|
2191
|
+
fillString = fillString .. string.rep(
|
|
2192
|
+
fillString,
|
|
2193
|
+
math.floor(maxLength / #fillString)
|
|
2194
|
+
)
|
|
2195
|
+
end
|
|
2196
|
+
return string.sub(
|
|
2197
|
+
fillString,
|
|
2198
|
+
1,
|
|
2199
|
+
math.floor(maxLength)
|
|
2200
|
+
) .. self
|
|
2201
|
+
end
|
|
2202
|
+
|
|
2203
|
+
local __TS__StringReplace
|
|
2204
|
+
do
|
|
2205
|
+
local sub = string.sub
|
|
2206
|
+
function __TS__StringReplace(source, searchValue, replaceValue)
|
|
2207
|
+
local startPos, endPos = string.find(source, searchValue, nil, true)
|
|
2208
|
+
if not startPos then
|
|
2209
|
+
return source
|
|
2210
|
+
end
|
|
2211
|
+
local before = sub(source, 1, startPos - 1)
|
|
2212
|
+
local ____temp_0
|
|
2213
|
+
if type(replaceValue) == "string" then
|
|
2214
|
+
____temp_0 = replaceValue
|
|
2215
|
+
else
|
|
2216
|
+
____temp_0 = replaceValue(nil, searchValue, startPos - 1, source)
|
|
2217
|
+
end
|
|
2218
|
+
local replacement = ____temp_0
|
|
2219
|
+
local after = sub(source, endPos + 1)
|
|
2220
|
+
return (before .. replacement) .. after
|
|
2221
|
+
end
|
|
2222
|
+
end
|
|
2223
|
+
|
|
2224
|
+
local __TS__StringSplit
|
|
2225
|
+
do
|
|
2226
|
+
local sub = string.sub
|
|
2227
|
+
local find = string.find
|
|
2228
|
+
function __TS__StringSplit(source, separator, limit)
|
|
2229
|
+
if limit == nil then
|
|
2230
|
+
limit = 4294967295
|
|
2231
|
+
end
|
|
2232
|
+
if limit == 0 then
|
|
2233
|
+
return {}
|
|
2234
|
+
end
|
|
2235
|
+
local result = {}
|
|
2236
|
+
local resultIndex = 1
|
|
2237
|
+
if separator == nil or separator == "" then
|
|
2238
|
+
for i = 1, #source do
|
|
2239
|
+
result[resultIndex] = sub(source, i, i)
|
|
2240
|
+
resultIndex = resultIndex + 1
|
|
2241
|
+
end
|
|
2242
|
+
else
|
|
2243
|
+
local currentPos = 1
|
|
2244
|
+
while resultIndex <= limit do
|
|
2245
|
+
local startPos, endPos = find(source, separator, currentPos, true)
|
|
2246
|
+
if not startPos then
|
|
2247
|
+
break
|
|
2248
|
+
end
|
|
2249
|
+
result[resultIndex] = sub(source, currentPos, startPos - 1)
|
|
2250
|
+
resultIndex = resultIndex + 1
|
|
2251
|
+
currentPos = endPos + 1
|
|
2252
|
+
end
|
|
2253
|
+
if resultIndex <= limit then
|
|
2254
|
+
result[resultIndex] = sub(source, currentPos)
|
|
2255
|
+
end
|
|
2256
|
+
end
|
|
2257
|
+
return result
|
|
2258
|
+
end
|
|
2259
|
+
end
|
|
2260
|
+
|
|
2261
|
+
local __TS__StringReplaceAll
|
|
2262
|
+
do
|
|
2263
|
+
local sub = string.sub
|
|
2264
|
+
local find = string.find
|
|
2265
|
+
function __TS__StringReplaceAll(source, searchValue, replaceValue)
|
|
2266
|
+
if type(replaceValue) == "string" then
|
|
2267
|
+
local concat = table.concat(
|
|
2268
|
+
__TS__StringSplit(source, searchValue),
|
|
2269
|
+
replaceValue
|
|
2270
|
+
)
|
|
2271
|
+
if #searchValue == 0 then
|
|
2272
|
+
return (replaceValue .. concat) .. replaceValue
|
|
2273
|
+
end
|
|
2274
|
+
return concat
|
|
2275
|
+
end
|
|
2276
|
+
local parts = {}
|
|
2277
|
+
local partsIndex = 1
|
|
2278
|
+
if #searchValue == 0 then
|
|
2279
|
+
parts[1] = replaceValue(nil, "", 0, source)
|
|
2280
|
+
partsIndex = 2
|
|
2281
|
+
for i = 1, #source do
|
|
2282
|
+
parts[partsIndex] = sub(source, i, i)
|
|
2283
|
+
parts[partsIndex + 1] = replaceValue(nil, "", i, source)
|
|
2284
|
+
partsIndex = partsIndex + 2
|
|
2285
|
+
end
|
|
2286
|
+
else
|
|
2287
|
+
local currentPos = 1
|
|
2288
|
+
while true do
|
|
2289
|
+
local startPos, endPos = find(source, searchValue, currentPos, true)
|
|
2290
|
+
if not startPos then
|
|
2291
|
+
break
|
|
2292
|
+
end
|
|
2293
|
+
parts[partsIndex] = sub(source, currentPos, startPos - 1)
|
|
2294
|
+
parts[partsIndex + 1] = replaceValue(nil, searchValue, startPos - 1, source)
|
|
2295
|
+
partsIndex = partsIndex + 2
|
|
2296
|
+
currentPos = endPos + 1
|
|
2297
|
+
end
|
|
2298
|
+
parts[partsIndex] = sub(source, currentPos)
|
|
2299
|
+
end
|
|
2300
|
+
return table.concat(parts)
|
|
2301
|
+
end
|
|
2302
|
+
end
|
|
2303
|
+
|
|
2304
|
+
local function __TS__StringSlice(self, start, ____end)
|
|
2305
|
+
if start == nil or start ~= start then
|
|
2306
|
+
start = 0
|
|
2307
|
+
end
|
|
2308
|
+
if ____end ~= ____end then
|
|
2309
|
+
____end = 0
|
|
2310
|
+
end
|
|
2311
|
+
if start >= 0 then
|
|
2312
|
+
start = start + 1
|
|
2313
|
+
end
|
|
2314
|
+
if ____end ~= nil and ____end < 0 then
|
|
2315
|
+
____end = ____end - 1
|
|
2316
|
+
end
|
|
2317
|
+
return string.sub(self, start, ____end)
|
|
2318
|
+
end
|
|
2319
|
+
|
|
2320
|
+
local function __TS__StringStartsWith(self, searchString, position)
|
|
2321
|
+
if position == nil or position < 0 then
|
|
2322
|
+
position = 0
|
|
2323
|
+
end
|
|
2324
|
+
return string.sub(self, position + 1, #searchString + position) == searchString
|
|
2325
|
+
end
|
|
2326
|
+
|
|
2327
|
+
local function __TS__StringTrim(self)
|
|
2328
|
+
local result = string.gsub(self, "^[%s ]*(.-)[%s ]*$", "%1")
|
|
2329
|
+
return result
|
|
2330
|
+
end
|
|
2331
|
+
|
|
2332
|
+
local function __TS__StringTrimEnd(self)
|
|
2333
|
+
local result = string.gsub(self, "[%s ]*$", "")
|
|
2334
|
+
return result
|
|
2335
|
+
end
|
|
2336
|
+
|
|
2337
|
+
local function __TS__StringTrimStart(self)
|
|
2338
|
+
local result = string.gsub(self, "^[%s ]*", "")
|
|
2339
|
+
return result
|
|
2340
|
+
end
|
|
2341
|
+
|
|
2342
|
+
local __TS__SymbolRegistryFor, __TS__SymbolRegistryKeyFor
|
|
2343
|
+
do
|
|
2344
|
+
local symbolRegistry = {}
|
|
2345
|
+
function __TS__SymbolRegistryFor(key)
|
|
2346
|
+
if not symbolRegistry[key] then
|
|
2347
|
+
symbolRegistry[key] = __TS__Symbol(key)
|
|
2348
|
+
end
|
|
2349
|
+
return symbolRegistry[key]
|
|
2350
|
+
end
|
|
2351
|
+
function __TS__SymbolRegistryKeyFor(sym)
|
|
2352
|
+
for key in pairs(symbolRegistry) do
|
|
2353
|
+
if symbolRegistry[key] == sym then
|
|
2354
|
+
return key
|
|
2355
|
+
end
|
|
2356
|
+
end
|
|
2357
|
+
end
|
|
2358
|
+
end
|
|
2359
|
+
|
|
2360
|
+
local function __TS__TypeOf(value)
|
|
2361
|
+
local luaType = type(value)
|
|
2362
|
+
if luaType == "table" then
|
|
2363
|
+
return "object"
|
|
2364
|
+
elseif luaType == "nil" then
|
|
2365
|
+
return "undefined"
|
|
2366
|
+
else
|
|
2367
|
+
return luaType
|
|
2368
|
+
end
|
|
2369
|
+
end
|
|
2370
|
+
|
|
2371
|
+
return {
|
|
2372
|
+
__TS__ArrayConcat = __TS__ArrayConcat,
|
|
2373
|
+
__TS__ArrayEntries = __TS__ArrayEntries,
|
|
2374
|
+
__TS__ArrayEvery = __TS__ArrayEvery,
|
|
2375
|
+
__TS__ArrayFilter = __TS__ArrayFilter,
|
|
2376
|
+
__TS__ArrayForEach = __TS__ArrayForEach,
|
|
2377
|
+
__TS__ArrayFind = __TS__ArrayFind,
|
|
2378
|
+
__TS__ArrayFindIndex = __TS__ArrayFindIndex,
|
|
2379
|
+
__TS__ArrayFrom = __TS__ArrayFrom,
|
|
2380
|
+
__TS__ArrayIncludes = __TS__ArrayIncludes,
|
|
2381
|
+
__TS__ArrayIndexOf = __TS__ArrayIndexOf,
|
|
2382
|
+
__TS__ArrayIsArray = __TS__ArrayIsArray,
|
|
2383
|
+
__TS__ArrayJoin = __TS__ArrayJoin,
|
|
2384
|
+
__TS__ArrayMap = __TS__ArrayMap,
|
|
2385
|
+
__TS__ArrayPush = __TS__ArrayPush,
|
|
2386
|
+
__TS__ArrayPushArray = __TS__ArrayPushArray,
|
|
2387
|
+
__TS__ArrayReduce = __TS__ArrayReduce,
|
|
2388
|
+
__TS__ArrayReduceRight = __TS__ArrayReduceRight,
|
|
2389
|
+
__TS__ArrayReverse = __TS__ArrayReverse,
|
|
2390
|
+
__TS__ArrayUnshift = __TS__ArrayUnshift,
|
|
2391
|
+
__TS__ArraySort = __TS__ArraySort,
|
|
2392
|
+
__TS__ArraySlice = __TS__ArraySlice,
|
|
2393
|
+
__TS__ArraySome = __TS__ArraySome,
|
|
2394
|
+
__TS__ArraySplice = __TS__ArraySplice,
|
|
2395
|
+
__TS__ArrayToObject = __TS__ArrayToObject,
|
|
2396
|
+
__TS__ArrayFlat = __TS__ArrayFlat,
|
|
2397
|
+
__TS__ArrayFlatMap = __TS__ArrayFlatMap,
|
|
2398
|
+
__TS__ArraySetLength = __TS__ArraySetLength,
|
|
2399
|
+
__TS__AsyncAwaiter = __TS__AsyncAwaiter,
|
|
2400
|
+
__TS__Await = __TS__Await,
|
|
2401
|
+
__TS__Class = __TS__Class,
|
|
2402
|
+
__TS__ClassExtends = __TS__ClassExtends,
|
|
2403
|
+
__TS__CloneDescriptor = __TS__CloneDescriptor,
|
|
2404
|
+
__TS__Decorate = __TS__Decorate,
|
|
2405
|
+
__TS__DecorateParam = __TS__DecorateParam,
|
|
2406
|
+
__TS__Delete = __TS__Delete,
|
|
2407
|
+
__TS__DelegatedYield = __TS__DelegatedYield,
|
|
2408
|
+
Error = Error,
|
|
2409
|
+
RangeError = RangeError,
|
|
2410
|
+
ReferenceError = ReferenceError,
|
|
2411
|
+
SyntaxError = SyntaxError,
|
|
2412
|
+
TypeError = TypeError,
|
|
2413
|
+
URIError = URIError,
|
|
2414
|
+
__TS__FunctionBind = __TS__FunctionBind,
|
|
2415
|
+
__TS__Generator = __TS__Generator,
|
|
2416
|
+
__TS__InstanceOf = __TS__InstanceOf,
|
|
2417
|
+
__TS__InstanceOfObject = __TS__InstanceOfObject,
|
|
2418
|
+
__TS__Iterator = __TS__Iterator,
|
|
2419
|
+
Map = Map,
|
|
2420
|
+
__TS__MathAtan2 = __TS__MathAtan2,
|
|
2421
|
+
__TS__MathSign = __TS__MathSign,
|
|
2422
|
+
__TS__New = __TS__New,
|
|
2423
|
+
__TS__Number = __TS__Number,
|
|
2424
|
+
__TS__NumberIsFinite = __TS__NumberIsFinite,
|
|
2425
|
+
__TS__NumberIsNaN = __TS__NumberIsNaN,
|
|
2426
|
+
__TS__NumberToString = __TS__NumberToString,
|
|
2427
|
+
__TS__ObjectAssign = __TS__ObjectAssign,
|
|
2428
|
+
__TS__ObjectDefineProperty = __TS__ObjectDefineProperty,
|
|
2429
|
+
__TS__ObjectEntries = __TS__ObjectEntries,
|
|
2430
|
+
__TS__ObjectFromEntries = __TS__ObjectFromEntries,
|
|
2431
|
+
__TS__ObjectGetOwnPropertyDescriptor = __TS__ObjectGetOwnPropertyDescriptor,
|
|
2432
|
+
__TS__ObjectGetOwnPropertyDescriptors = __TS__ObjectGetOwnPropertyDescriptors,
|
|
2433
|
+
__TS__ObjectKeys = __TS__ObjectKeys,
|
|
2434
|
+
__TS__ObjectRest = __TS__ObjectRest,
|
|
2435
|
+
__TS__ObjectValues = __TS__ObjectValues,
|
|
2436
|
+
__TS__ParseFloat = __TS__ParseFloat,
|
|
2437
|
+
__TS__ParseInt = __TS__ParseInt,
|
|
2438
|
+
__TS__Promise = __TS__Promise,
|
|
2439
|
+
__TS__PromiseAll = __TS__PromiseAll,
|
|
2440
|
+
__TS__PromiseAllSettled = __TS__PromiseAllSettled,
|
|
2441
|
+
__TS__PromiseAny = __TS__PromiseAny,
|
|
2442
|
+
__TS__PromiseRace = __TS__PromiseRace,
|
|
2443
|
+
Set = Set,
|
|
2444
|
+
__TS__SetDescriptor = __TS__SetDescriptor,
|
|
2445
|
+
__TS__SparseArrayNew = __TS__SparseArrayNew,
|
|
2446
|
+
__TS__SparseArrayPush = __TS__SparseArrayPush,
|
|
2447
|
+
__TS__SparseArraySpread = __TS__SparseArraySpread,
|
|
2448
|
+
WeakMap = WeakMap,
|
|
2449
|
+
WeakSet = WeakSet,
|
|
2450
|
+
__TS__SourceMapTraceBack = __TS__SourceMapTraceBack,
|
|
2451
|
+
__TS__Spread = __TS__Spread,
|
|
2452
|
+
__TS__StringAccess = __TS__StringAccess,
|
|
2453
|
+
__TS__StringCharAt = __TS__StringCharAt,
|
|
2454
|
+
__TS__StringCharCodeAt = __TS__StringCharCodeAt,
|
|
2455
|
+
__TS__StringEndsWith = __TS__StringEndsWith,
|
|
2456
|
+
__TS__StringIncludes = __TS__StringIncludes,
|
|
2457
|
+
__TS__StringPadEnd = __TS__StringPadEnd,
|
|
2458
|
+
__TS__StringPadStart = __TS__StringPadStart,
|
|
2459
|
+
__TS__StringReplace = __TS__StringReplace,
|
|
2460
|
+
__TS__StringReplaceAll = __TS__StringReplaceAll,
|
|
2461
|
+
__TS__StringSlice = __TS__StringSlice,
|
|
2462
|
+
__TS__StringSplit = __TS__StringSplit,
|
|
2463
|
+
__TS__StringStartsWith = __TS__StringStartsWith,
|
|
2464
|
+
__TS__StringSubstr = __TS__StringSubstr,
|
|
2465
|
+
__TS__StringSubstring = __TS__StringSubstring,
|
|
2466
|
+
__TS__StringTrim = __TS__StringTrim,
|
|
2467
|
+
__TS__StringTrimEnd = __TS__StringTrimEnd,
|
|
2468
|
+
__TS__StringTrimStart = __TS__StringTrimStart,
|
|
2469
|
+
__TS__Symbol = __TS__Symbol,
|
|
2470
|
+
Symbol = Symbol,
|
|
2471
|
+
__TS__SymbolRegistryFor = __TS__SymbolRegistryFor,
|
|
2472
|
+
__TS__SymbolRegistryKeyFor = __TS__SymbolRegistryKeyFor,
|
|
2473
|
+
__TS__TypeOf = __TS__TypeOf,
|
|
2474
|
+
__TS__Unpack = __TS__Unpack
|
|
2475
|
+
}
|