@nativewrappers/fivem 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +33 -0
- package/lib/client/Audio.d.ts +17 -0
- package/lib/client/Audio.js +92 -0
- package/lib/client/Blip.d.ts +39 -0
- package/lib/client/Blip.js +104 -0
- package/lib/client/Camera.d.ts +46 -0
- package/lib/client/Camera.js +161 -0
- package/lib/client/Checkpoint.d.ts +18 -0
- package/lib/client/Checkpoint.js +42 -0
- package/lib/client/Events.d.ts +11 -0
- package/lib/client/Events.js +73 -0
- package/lib/client/Game.d.ts +283 -0
- package/lib/client/Game.js +451 -0
- package/lib/client/GameplayCamera.d.ts +102 -0
- package/lib/client/GameplayCamera.js +141 -0
- package/lib/client/Model.d.ts +134 -0
- package/lib/client/Model.js +198 -0
- package/lib/client/NetworkedScene.d.ts +10 -0
- package/lib/client/NetworkedScene.js +17 -0
- package/lib/client/ParticleEffect.d.ts +80 -0
- package/lib/client/ParticleEffect.js +120 -0
- package/lib/client/ParticleEffectAsset.d.ts +54 -0
- package/lib/client/ParticleEffectAsset.js +104 -0
- package/lib/client/Pickup.d.ts +9 -0
- package/lib/client/Pickup.js +18 -0
- package/lib/client/Raycast.d.ts +49 -0
- package/lib/client/Raycast.js +70 -0
- package/lib/client/RelationshipGroup.d.ts +49 -0
- package/lib/client/RelationshipGroup.js +63 -0
- package/lib/client/Rope.d.ts +99 -0
- package/lib/client/Rope.js +125 -0
- package/lib/client/TaskSequence.d.ts +15 -0
- package/lib/client/TaskSequence.js +43 -0
- package/lib/client/Tasks.d.ts +66 -0
- package/lib/client/Tasks.js +236 -0
- package/lib/client/World.d.ts +402 -0
- package/lib/client/World.js +726 -0
- package/lib/client/cfx/StateBagChangeHandler.d.ts +3 -0
- package/lib/client/cfx/StateBagChangeHandler.js +1 -0
- package/lib/client/cfx/index.d.ts +7 -0
- package/lib/client/cfx/index.js +1 -0
- package/lib/client/enums/Alignment.d.ts +5 -0
- package/lib/client/enums/Alignment.js +6 -0
- package/lib/client/enums/AnimationFlags.d.ts +9 -0
- package/lib/client/enums/AnimationFlags.js +10 -0
- package/lib/client/enums/AudioFlag.d.ts +37 -0
- package/lib/client/enums/AudioFlag.js +38 -0
- package/lib/client/enums/BadgeStyle.d.ts +182 -0
- package/lib/client/enums/BadgeStyle.js +183 -0
- package/lib/client/enums/Blip.d.ts +223 -0
- package/lib/client/enums/Blip.js +225 -0
- package/lib/client/enums/Bone.d.ts +101 -0
- package/lib/client/enums/Bone.js +103 -0
- package/lib/client/enums/CameraShake.d.ts +13 -0
- package/lib/client/enums/CameraShake.js +14 -0
- package/lib/client/enums/CameraTypes.d.ts +7 -0
- package/lib/client/enums/CameraTypes.js +8 -0
- package/lib/client/enums/CheckboxStyle.d.ts +4 -0
- package/lib/client/enums/CheckboxStyle.js +5 -0
- package/lib/client/enums/Checkpoint.d.ts +62 -0
- package/lib/client/enums/Checkpoint.js +67 -0
- package/lib/client/enums/ClassTypes.d.ts +11 -0
- package/lib/client/enums/ClassTypes.js +12 -0
- package/lib/client/enums/CloudHat.d.ts +26 -0
- package/lib/client/enums/CloudHat.js +27 -0
- package/lib/client/enums/Control.d.ts +360 -0
- package/lib/client/enums/Control.js +361 -0
- package/lib/client/enums/CursorSprite.d.ts +14 -0
- package/lib/client/enums/CursorSprite.js +15 -0
- package/lib/client/enums/Driving.d.ts +32 -0
- package/lib/client/enums/Driving.js +34 -0
- package/lib/client/enums/ExplosionType.d.ts +44 -0
- package/lib/client/enums/ExplosionType.js +45 -0
- package/lib/client/enums/FiringPattern.d.ts +19 -0
- package/lib/client/enums/FiringPattern.js +20 -0
- package/lib/client/enums/Font.d.ts +7 -0
- package/lib/client/enums/Font.js +8 -0
- package/lib/client/enums/ForceType.d.ts +8 -0
- package/lib/client/enums/ForceType.js +9 -0
- package/lib/client/enums/Gender.d.ts +4 -0
- package/lib/client/enums/Gender.js +5 -0
- package/lib/client/enums/HelmetType.d.ts +5 -0
- package/lib/client/enums/HelmetType.js +6 -0
- package/lib/client/enums/HudColor.d.ts +183 -0
- package/lib/client/enums/HudColor.js +184 -0
- package/lib/client/enums/HudComponent.d.ts +53 -0
- package/lib/client/enums/HudComponent.js +54 -0
- package/lib/client/enums/InputMode.d.ts +4 -0
- package/lib/client/enums/InputMode.js +5 -0
- package/lib/client/enums/IntersectOptions.d.ts +15 -0
- package/lib/client/enums/IntersectOptions.js +16 -0
- package/lib/client/enums/InvertAxis.d.ts +9 -0
- package/lib/client/enums/InvertAxis.js +7 -0
- package/lib/client/enums/Language.d.ts +14 -0
- package/lib/client/enums/Language.js +15 -0
- package/lib/client/enums/LeaveVehicleFlags.d.ts +10 -0
- package/lib/client/enums/LeaveVehicleFlags.js +11 -0
- package/lib/client/enums/LoadingSpinnerType.d.ts +7 -0
- package/lib/client/enums/LoadingSpinnerType.js +8 -0
- package/lib/client/enums/MarkerType.d.ts +49 -0
- package/lib/client/enums/MarkerType.js +50 -0
- package/lib/client/enums/MenuAlignment.d.ts +4 -0
- package/lib/client/enums/MenuAlignment.js +5 -0
- package/lib/client/enums/NotificationType.d.ts +10 -0
- package/lib/client/enums/NotificationType.js +11 -0
- package/lib/client/enums/Parachute.d.ts +13 -0
- package/lib/client/enums/Parachute.js +15 -0
- package/lib/client/enums/PickupType.d.ts +73 -0
- package/lib/client/enums/PickupType.js +74 -0
- package/lib/client/enums/RadioStation.d.ts +24 -0
- package/lib/client/enums/RadioStation.js +25 -0
- package/lib/client/enums/RagdollType.d.ts +6 -0
- package/lib/client/enums/RagdollType.js +7 -0
- package/lib/client/enums/Relationship.d.ts +9 -0
- package/lib/client/enums/Relationship.js +10 -0
- package/lib/client/enums/RopeType.d.ts +5 -0
- package/lib/client/enums/RopeType.js +6 -0
- package/lib/client/enums/ScreenEffect.d.ts +83 -0
- package/lib/client/enums/ScreenEffect.js +84 -0
- package/lib/client/enums/SpeechModifier.d.ts +39 -0
- package/lib/client/enums/SpeechModifier.js +40 -0
- package/lib/client/enums/Vehicle.d.ts +358 -0
- package/lib/client/enums/Vehicle.js +376 -0
- package/lib/client/enums/Weather.d.ts +21 -0
- package/lib/client/enums/Weather.js +22 -0
- package/lib/client/enums/ZoneID.d.ts +94 -0
- package/lib/client/enums/ZoneID.js +95 -0
- package/lib/client/enums/index.d.ts +42 -0
- package/lib/client/enums/index.js +42 -0
- package/lib/client/hashes/MaterialHash.d.ts +216 -0
- package/lib/client/hashes/MaterialHash.js +217 -0
- package/lib/client/hashes/PedHash.d.ts +724 -0
- package/lib/client/hashes/PedHash.js +725 -0
- package/lib/client/hashes/VehicleHash.d.ts +522 -0
- package/lib/client/hashes/VehicleHash.js +523 -0
- package/lib/client/hashes/WeaponHash.d.ts +147 -0
- package/lib/client/hashes/WeaponHash.js +161 -0
- package/lib/client/hashes/WeatherTypeHash.d.ts +21 -0
- package/lib/client/hashes/WeatherTypeHash.js +22 -0
- package/lib/client/hashes/index.d.ts +5 -0
- package/lib/client/hashes/index.js +5 -0
- package/lib/client/index.d.ts +24 -0
- package/lib/client/index.js +25 -0
- package/lib/client/interfaces/Dimensions.d.ts +5 -0
- package/lib/client/interfaces/Dimensions.js +1 -0
- package/lib/client/models/BaseEntity.d.ts +169 -0
- package/lib/client/models/BaseEntity.js +459 -0
- package/lib/client/models/Entity.d.ts +9 -0
- package/lib/client/models/Entity.js +24 -0
- package/lib/client/models/EntityBone.d.ts +12 -0
- package/lib/client/models/EntityBone.js +24 -0
- package/lib/client/models/EntityBoneCollection.d.ts +11 -0
- package/lib/client/models/EntityBoneCollection.js +16 -0
- package/lib/client/models/Ped.d.ts +199 -0
- package/lib/client/models/Ped.js +685 -0
- package/lib/client/models/PedBone.d.ts +6 -0
- package/lib/client/models/PedBone.js +9 -0
- package/lib/client/models/PedBoneCollection.d.ts +8 -0
- package/lib/client/models/PedBoneCollection.js +19 -0
- package/lib/client/models/Player.d.ts +63 -0
- package/lib/client/models/Player.js +174 -0
- package/lib/client/models/Prop.d.ts +11 -0
- package/lib/client/models/Prop.js +26 -0
- package/lib/client/models/Vehicle.d.ts +171 -0
- package/lib/client/models/Vehicle.js +551 -0
- package/lib/client/models/VehicleDoor.d.ts +19 -0
- package/lib/client/models/VehicleDoor.js +42 -0
- package/lib/client/models/VehicleDoorCollection.d.ts +14 -0
- package/lib/client/models/VehicleDoorCollection.js +61 -0
- package/lib/client/models/VehicleMod.d.ts +16 -0
- package/lib/client/models/VehicleMod.js +33 -0
- package/lib/client/models/VehicleModCollection.d.ts +61 -0
- package/lib/client/models/VehicleModCollection.js +227 -0
- package/lib/client/models/VehicleToggleMod.d.ts +14 -0
- package/lib/client/models/VehicleToggleMod.js +27 -0
- package/lib/client/models/VehicleWheel.d.ts +11 -0
- package/lib/client/models/VehicleWheel.js +21 -0
- package/lib/client/models/VehicleWheelCollection.d.ts +13 -0
- package/lib/client/models/VehicleWheelCollection.js +56 -0
- package/lib/client/models/VehicleWindow.d.ts +16 -0
- package/lib/client/models/VehicleWindow.js +33 -0
- package/lib/client/models/VehicleWindowCollection.d.ts +14 -0
- package/lib/client/models/VehicleWindowCollection.js +55 -0
- package/lib/client/models/index.d.ts +18 -0
- package/lib/client/models/index.js +18 -0
- package/lib/client/types/EntityType.d.ts +2 -0
- package/lib/client/types/EntityType.js +1 -0
- package/lib/client/ui/Container.d.ts +11 -0
- package/lib/client/ui/Container.js +28 -0
- package/lib/client/ui/Effects.d.ts +8 -0
- package/lib/client/ui/Effects.js +106 -0
- package/lib/client/ui/Fading.d.ts +41 -0
- package/lib/client/ui/Fading.js +69 -0
- package/lib/client/ui/Hud.d.ts +16 -0
- package/lib/client/ui/Hud.js +39 -0
- package/lib/client/ui/InstructionalButtons.d.ts +33 -0
- package/lib/client/ui/InstructionalButtons.js +53 -0
- package/lib/client/ui/LoadingPrompt.d.ts +27 -0
- package/lib/client/ui/LoadingPrompt.js +45 -0
- package/lib/client/ui/Notification.d.ts +5 -0
- package/lib/client/ui/Notification.js +8 -0
- package/lib/client/ui/Rectangle.d.ts +10 -0
- package/lib/client/ui/Rectangle.js +37 -0
- package/lib/client/ui/Scaleform.d.ts +106 -0
- package/lib/client/ui/Scaleform.js +234 -0
- package/lib/client/ui/Screen.d.ts +16 -0
- package/lib/client/ui/Screen.js +72 -0
- package/lib/client/ui/Sprite.d.ts +17 -0
- package/lib/client/ui/Sprite.js +53 -0
- package/lib/client/ui/Text.d.ts +31 -0
- package/lib/client/ui/Text.js +102 -0
- package/lib/client/ui/Timerbar.d.ts +44 -0
- package/lib/client/ui/Timerbar.js +241 -0
- package/lib/client/ui/index.d.ts +15 -0
- package/lib/client/ui/index.js +15 -0
- package/lib/client/ui/interfaces/IButton.d.ts +5 -0
- package/lib/client/ui/interfaces/IButton.js +1 -0
- package/lib/client/ui/interfaces/IDrawable.d.ts +7 -0
- package/lib/client/ui/interfaces/IDrawable.js +1 -0
- package/lib/client/ui/interfaces/index.d.ts +2 -0
- package/lib/client/ui/interfaces/index.js +1 -0
- package/lib/client/ui/menu/Menu.d.ts +108 -0
- package/lib/client/ui/menu/Menu.js +802 -0
- package/lib/client/ui/menu/MenuControl.d.ts +6 -0
- package/lib/client/ui/menu/MenuControl.js +11 -0
- package/lib/client/ui/menu/MenuControls.d.ts +9 -0
- package/lib/client/ui/menu/MenuControls.js +11 -0
- package/lib/client/ui/menu/MenuSettings.d.ts +20 -0
- package/lib/client/ui/menu/MenuSettings.js +51 -0
- package/lib/client/ui/menu/index.d.ts +6 -0
- package/lib/client/ui/menu/index.js +6 -0
- package/lib/client/ui/menu/items/UIMenuCheckboxItem.d.ts +20 -0
- package/lib/client/ui/menu/items/UIMenuCheckboxItem.js +57 -0
- package/lib/client/ui/menu/items/UIMenuItem.d.ts +78 -0
- package/lib/client/ui/menu/items/UIMenuItem.js +1090 -0
- package/lib/client/ui/menu/items/UIMenuListItem.d.ts +31 -0
- package/lib/client/ui/menu/items/UIMenuListItem.js +110 -0
- package/lib/client/ui/menu/items/UIMenuSeparatorItem.d.ts +11 -0
- package/lib/client/ui/menu/items/UIMenuSeparatorItem.js +29 -0
- package/lib/client/ui/menu/items/UIMenuSliderItem.d.ts +47 -0
- package/lib/client/ui/menu/items/UIMenuSliderItem.js +173 -0
- package/lib/client/ui/menu/items/index.d.ts +6 -0
- package/lib/client/ui/menu/items/index.js +6 -0
- package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.d.ts +17 -0
- package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.js +43 -0
- package/lib/client/ui/menu/items/panels/UIMenuColorPanel.d.ts +36 -0
- package/lib/client/ui/menu/items/panels/UIMenuColorPanel.js +211 -0
- package/lib/client/ui/menu/items/panels/UIMenuGridPanel.d.ts +40 -0
- package/lib/client/ui/menu/items/panels/UIMenuGridPanel.js +215 -0
- package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.d.ts +26 -0
- package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.js +115 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.d.ts +16 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.js +77 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.d.ts +13 -0
- package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.js +32 -0
- package/lib/client/ui/menu/items/panels/index.d.ts +6 -0
- package/lib/client/ui/menu/items/panels/index.js +6 -0
- package/lib/client/ui/menu/modules/ListItem.d.ts +6 -0
- package/lib/client/ui/menu/modules/ListItem.js +8 -0
- package/lib/client/ui/menu/modules/index.d.ts +1 -0
- package/lib/client/ui/menu/modules/index.js +1 -0
- package/lib/client/utils/Animations.d.ts +19 -0
- package/lib/client/utils/Animations.js +55 -0
- package/lib/client/utils/Color.d.ts +15 -0
- package/lib/client/utils/Color.js +22 -0
- package/lib/client/utils/Crypto.d.ts +3 -0
- package/lib/client/utils/Crypto.js +25 -0
- package/lib/client/utils/LiteEvent.d.ts +13 -0
- package/lib/client/utils/LiteEvent.js +21 -0
- package/lib/client/utils/Maths.d.ts +4 -0
- package/lib/client/utils/Maths.js +10 -0
- package/lib/client/utils/Point.d.ts +9 -0
- package/lib/client/utils/Point.js +28 -0
- package/lib/client/utils/PointF.d.ts +12 -0
- package/lib/client/utils/PointF.js +11 -0
- package/lib/client/utils/Quaternion.d.ts +10 -0
- package/lib/client/utils/Quaternion.js +23 -0
- package/lib/client/utils/Size.d.ts +5 -0
- package/lib/client/utils/Size.js +6 -0
- package/lib/client/utils/String.d.ts +6 -0
- package/lib/client/utils/String.js +25 -0
- package/lib/client/utils/Vector2.d.ts +54 -0
- package/lib/client/utils/Vector2.js +106 -0
- package/lib/client/utils/Vector3.d.ts +69 -0
- package/lib/client/utils/Vector3.js +140 -0
- package/lib/client/utils/Vector4.d.ts +62 -0
- package/lib/client/utils/Vector4.js +124 -0
- package/lib/client/utils/enumValues.d.ts +12 -0
- package/lib/client/utils/enumValues.js +14 -0
- package/lib/client/utils/getStringFromUInt8Array.d.ts +8 -0
- package/lib/client/utils/getStringFromUInt8Array.js +10 -0
- package/lib/client/utils/getUInt32FromUint8Array.d.ts +8 -0
- package/lib/client/utils/getUInt32FromUint8Array.js +8 -0
- package/lib/client/utils/index.d.ts +10 -0
- package/lib/client/utils/index.js +10 -0
- package/lib/client/weapon/DlcWeaponData.d.ts +43 -0
- package/lib/client/weapon/DlcWeaponData.js +44 -0
- package/lib/client/weapon/Mk2WeaponHash.d.ts +18 -0
- package/lib/client/weapon/Mk2WeaponHash.js +25 -0
- package/lib/client/weapon/Weapon.d.ts +169 -0
- package/lib/client/weapon/Weapon.js +267 -0
- package/lib/client/weapon/WeaponAsset.d.ts +55 -0
- package/lib/client/weapon/WeaponAsset.js +83 -0
- package/lib/client/weapon/WeaponCollection.d.ts +90 -0
- package/lib/client/weapon/WeaponCollection.js +186 -0
- package/lib/client/weapon/WeaponDisplayNameByHash.d.ts +6 -0
- package/lib/client/weapon/WeaponDisplayNameByHash.js +75 -0
- package/lib/client/weapon/WeaponGroup.d.ts +18 -0
- package/lib/client/weapon/WeaponGroup.js +19 -0
- package/lib/client/weapon/WeaponHudStats.d.ts +27 -0
- package/lib/client/weapon/WeaponHudStats.js +38 -0
- package/lib/client/weapon/WeaponLivery.d.ts +13 -0
- package/lib/client/weapon/WeaponLivery.js +14 -0
- package/lib/client/weapon/WeaponLiveryColor.d.ts +34 -0
- package/lib/client/weapon/WeaponLiveryColor.js +35 -0
- package/lib/client/weapon/WeaponTint.d.ts +42 -0
- package/lib/client/weapon/WeaponTint.js +43 -0
- package/lib/client/weapon/index.d.ts +8 -0
- package/lib/client/weapon/index.js +8 -0
- package/lib/client/weaponComponent/ComponentAttachmentPoint.d.ts +18 -0
- package/lib/client/weaponComponent/ComponentAttachmentPoint.js +19 -0
- package/lib/client/weaponComponent/ComponentAttachmentPointByHash.d.ts +7 -0
- package/lib/client/weaponComponent/ComponentAttachmentPointByHash.js +309 -0
- package/lib/client/weaponComponent/ComponentDisplayNameByHash.d.ts +6 -0
- package/lib/client/weaponComponent/ComponentDisplayNameByHash.js +280 -0
- package/lib/client/weaponComponent/DlcWeaponComponentData.d.ts +40 -0
- package/lib/client/weaponComponent/DlcWeaponComponentData.js +44 -0
- package/lib/client/weaponComponent/InvalidWeaponComponent.d.ts +12 -0
- package/lib/client/weaponComponent/InvalidWeaponComponent.js +28 -0
- package/lib/client/weaponComponent/WeaponComponent.d.ts +81 -0
- package/lib/client/weaponComponent/WeaponComponent.js +119 -0
- package/lib/client/weaponComponent/WeaponComponentCollection.d.ts +108 -0
- package/lib/client/weaponComponent/WeaponComponentCollection.js +172 -0
- package/lib/client/weaponComponent/WeaponComponentHash.d.ts +671 -0
- package/lib/client/weaponComponent/WeaponComponentHash.js +887 -0
- package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.d.ts +8 -0
- package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.js +823 -0
- package/lib/client/weaponComponent/WeaponComponentHudStats.d.ts +27 -0
- package/lib/client/weaponComponent/WeaponComponentHudStats.js +34 -0
- package/lib/client/weaponComponent/index.d.ts +5 -0
- package/lib/client/weaponComponent/index.js +5 -0
- package/lib/common/Convar.d.ts +8 -0
- package/lib/common/Convar.js +20 -0
- package/lib/common/Kvp.d.ts +91 -0
- package/lib/common/Kvp.js +161 -0
- package/lib/common/Resource.d.ts +14 -0
- package/lib/common/Resource.js +35 -0
- package/lib/common/index.d.ts +5 -0
- package/lib/common/index.js +5 -0
- package/lib/common/types.d.ts +6 -0
- package/lib/common/types.js +1 -0
- package/lib/common/utils/Color.d.ts +10 -0
- package/lib/common/utils/Color.js +17 -0
- package/lib/common/utils/Maths.d.ts +4 -0
- package/lib/common/utils/Maths.js +10 -0
- package/lib/common/utils/PointF.d.ts +12 -0
- package/lib/common/utils/PointF.js +11 -0
- package/lib/common/utils/Quaternion.d.ts +10 -0
- package/lib/common/utils/Quaternion.js +23 -0
- package/lib/common/utils/Vector2.d.ts +58 -0
- package/lib/common/utils/Vector2.js +113 -0
- package/lib/common/utils/Vector3.d.ts +73 -0
- package/lib/common/utils/Vector3.js +147 -0
- package/lib/common/utils/Vector4.d.ts +66 -0
- package/lib/common/utils/Vector4.js +131 -0
- package/lib/common/utils/cleanPlayerName.d.ts +6 -0
- package/lib/common/utils/cleanPlayerName.js +27 -0
- package/lib/common/utils/enumValues.d.ts +12 -0
- package/lib/common/utils/enumValues.js +14 -0
- package/lib/common/utils/getStringFromUInt8Array.d.ts +8 -0
- package/lib/common/utils/getStringFromUInt8Array.js +10 -0
- package/lib/common/utils/getUInt32FromUint8Array.d.ts +8 -0
- package/lib/common/utils/getUInt32FromUint8Array.js +8 -0
- package/lib/common/utils/index.d.ts +12 -0
- package/lib/common/utils/index.js +12 -0
- package/lib/server/Anticheat.d.ts +0 -0
- package/lib/server/Anticheat.js +25 -0
- package/lib/server/Events.d.ts +35 -0
- package/lib/server/Events.js +102 -0
- package/lib/server/Game.d.ts +56 -0
- package/lib/server/Game.js +86 -0
- package/lib/server/cfx/StateBagChangeHandler.d.ts +9 -0
- package/lib/server/cfx/StateBagChangeHandler.js +4 -0
- package/lib/server/cfx/index.d.ts +7 -0
- package/lib/server/cfx/index.js +1 -0
- package/lib/server/entities/BaseEntity.d.ts +115 -0
- package/lib/server/entities/BaseEntity.js +161 -0
- package/lib/server/entities/Entity.d.ts +18 -0
- package/lib/server/entities/Entity.js +22 -0
- package/lib/server/entities/Ped.d.ts +87 -0
- package/lib/server/entities/Ped.js +122 -0
- package/lib/server/entities/Player.d.ts +163 -0
- package/lib/server/entities/Player.js +235 -0
- package/lib/server/entities/Prop.d.ts +32 -0
- package/lib/server/entities/Prop.js +42 -0
- package/lib/server/entities/Vehicle.d.ts +230 -0
- package/lib/server/entities/Vehicle.js +331 -0
- package/lib/server/entities/index.d.ts +5 -0
- package/lib/server/entities/index.js +5 -0
- package/lib/server/enum/ClassTypes.d.ts +11 -0
- package/lib/server/enum/ClassTypes.js +12 -0
- package/lib/server/enum/PopulationType.d.ts +13 -0
- package/lib/server/enum/PopulationType.js +14 -0
- package/lib/server/enum/VehicleLockStatus.d.ts +9 -0
- package/lib/server/enum/VehicleLockStatus.js +10 -0
- package/lib/server/enum/VehicleType.d.ts +10 -0
- package/lib/server/enum/VehicleType.js +11 -0
- package/lib/server/enum/eEntityType.d.ts +5 -0
- package/lib/server/enum/eEntityType.js +6 -0
- package/lib/server/enum/index.d.ts +5 -0
- package/lib/server/enum/index.js +5 -0
- package/lib/server/index.d.ts +7 -0
- package/lib/server/index.js +7 -0
- package/lib/server/type/Anticheat.d.ts +471 -0
- package/lib/server/type/Anticheat.js +160 -0
- package/lib/server/type/Hash.d.ts +3 -0
- package/lib/server/type/Hash.js +2 -0
- package/lib/server/utils/index.d.ts +1 -0
- package/lib/server/utils/index.js +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WeaponComponentHash } from './WeaponComponentHash';
|
|
2
|
+
/***
|
|
3
|
+
* WeaponComponentHudStats
|
|
4
|
+
* refer: https://github.com/citizenfx/fivem/blob/master/code/client/clrcore/External/Game.cs#L976
|
|
5
|
+
* [StructLayout(LayoutKind.Explicit, Size = 0x28)]
|
|
6
|
+
* [SecuritySafeCritical]
|
|
7
|
+
* internal struct UnsafeWeaponComponentHudStats
|
|
8
|
+
* {
|
|
9
|
+
* [FieldOffset(0x00)] private int hudDamage;
|
|
10
|
+
* [FieldOffset(0x08)] private int hudSpeed;
|
|
11
|
+
* [FieldOffset(0x10)] private int hudCapacity;
|
|
12
|
+
* [FieldOffset(0x18)] private int hudAccuracy;
|
|
13
|
+
* [FieldOffset(0x20)] private int hudRange;
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export interface WeaponComponentHudStats {
|
|
17
|
+
hudDamage: number;
|
|
18
|
+
hudSpeed: number;
|
|
19
|
+
hudCapacity: number;
|
|
20
|
+
hudAccuracy: number;
|
|
21
|
+
hudRange: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Mapping of WeaponComponentHash -> WeaponComponentHudStats
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export declare const WeaponComponentHudStats: Map<WeaponComponentHash, WeaponComponentHudStats>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { WeaponComponentHash } from './WeaponComponentHash';
|
|
2
|
+
import { enumValues } from '../utils';
|
|
3
|
+
import { getUInt32FromUint8Array } from '../utils';
|
|
4
|
+
/**
|
|
5
|
+
* Mapping of WeaponComponentHash -> WeaponComponentHudStats
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export const WeaponComponentHudStats = new Map();
|
|
9
|
+
function initializeOnce() {
|
|
10
|
+
let isInitialized = false;
|
|
11
|
+
return function () {
|
|
12
|
+
if (isInitialized || IsDuplicityVersion()) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
// magic number based on struct WeaponComponentHudStat
|
|
16
|
+
const intLength = 4;
|
|
17
|
+
for (const hash of enumValues(WeaponComponentHash)) {
|
|
18
|
+
const buffer = new Uint8Array(0x28);
|
|
19
|
+
// https://docs.fivem.net/natives/?_0xB3CAF387AE12E9F8
|
|
20
|
+
Citizen.invokeNative('0xB3CAF387AE12E9F8', hash, buffer, Citizen.returnResultAnyway());
|
|
21
|
+
// noinspection PointlessArithmeticExpressionJS
|
|
22
|
+
const weaponComponentHudStat = {
|
|
23
|
+
hudDamage: getUInt32FromUint8Array(buffer, 0 * intLength, 1 * intLength),
|
|
24
|
+
hudSpeed: getUInt32FromUint8Array(buffer, 2 * intLength, 3 * intLength),
|
|
25
|
+
hudCapacity: getUInt32FromUint8Array(buffer, 4 * intLength, 5 * intLength),
|
|
26
|
+
hudAccuracy: getUInt32FromUint8Array(buffer, 6 * intLength, 7 * intLength),
|
|
27
|
+
hudRange: getUInt32FromUint8Array(buffer, 8 * intLength, 9 * intLength),
|
|
28
|
+
};
|
|
29
|
+
WeaponComponentHudStats.set(hash, weaponComponentHudStat);
|
|
30
|
+
}
|
|
31
|
+
isInitialized = true;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
initializeOnce()();
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DlcWeaponComponentData } from './DlcWeaponComponentData';
|
|
2
|
+
export { WeaponComponentHudStats } from './WeaponComponentHudStats';
|
|
3
|
+
export { ComponentAttachmentPoint } from './ComponentAttachmentPoint';
|
|
4
|
+
export { WeaponComponentHash } from './WeaponComponentHash';
|
|
5
|
+
export { InvalidWeaponComponent } from './InvalidWeaponComponent';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DlcWeaponComponentData } from './DlcWeaponComponentData';
|
|
2
|
+
export { WeaponComponentHudStats } from './WeaponComponentHudStats';
|
|
3
|
+
export { ComponentAttachmentPoint } from './ComponentAttachmentPoint';
|
|
4
|
+
export { WeaponComponentHash } from './WeaponComponentHash';
|
|
5
|
+
export { InvalidWeaponComponent } from './InvalidWeaponComponent';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class Convar {
|
|
2
|
+
buffer(): string;
|
|
3
|
+
get(variable: string, defaultVar: string): string;
|
|
4
|
+
getInt(variable: string, defaultVar: number): number;
|
|
5
|
+
set(variable: string, value: string): void;
|
|
6
|
+
setReplicated(variable: string, value: string): void;
|
|
7
|
+
setServerInfo(variable: string, value: string): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class Convar {
|
|
2
|
+
buffer() {
|
|
3
|
+
return GetConsoleBuffer();
|
|
4
|
+
}
|
|
5
|
+
get(variable, defaultVar) {
|
|
6
|
+
return GetConvar(variable, defaultVar);
|
|
7
|
+
}
|
|
8
|
+
getInt(variable, defaultVar) {
|
|
9
|
+
return GetConvarInt(variable, defaultVar);
|
|
10
|
+
}
|
|
11
|
+
set(variable, value) {
|
|
12
|
+
SetConvar(variable, value);
|
|
13
|
+
}
|
|
14
|
+
setReplicated(variable, value) {
|
|
15
|
+
SetConvarReplicated(variable, value);
|
|
16
|
+
}
|
|
17
|
+
setServerInfo(variable, value) {
|
|
18
|
+
SetConvarServerInfo(variable, value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export declare class Kvp {
|
|
2
|
+
/**
|
|
3
|
+
* Sets the resource key to the specified value this is a blocking operation, if you're doing large write operations you should use [[setKvpAsync]] instead.
|
|
4
|
+
* @param key the key string
|
|
5
|
+
* @param value the value to set the key to
|
|
6
|
+
*/
|
|
7
|
+
setKvp<T = number | string>(key: string, value: T): void;
|
|
8
|
+
/**
|
|
9
|
+
* Sets the resource key to the specified value, this doesn't immediately write to disk and needs [[flush]] called afterwards.
|
|
10
|
+
* @param key the key string
|
|
11
|
+
* @param value the value to set the key to
|
|
12
|
+
*/
|
|
13
|
+
setKvpAsync<T = number | string>(key: string, value: T): void;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the specified key to the specified json value
|
|
16
|
+
* This can error if given an invalid object
|
|
17
|
+
* @param key the key string
|
|
18
|
+
* @param value the value to set the key to
|
|
19
|
+
*/
|
|
20
|
+
setKvpJson(key: string, value: any): void;
|
|
21
|
+
/**
|
|
22
|
+
* Gets the specified value for key
|
|
23
|
+
* @param key the key of the value to get
|
|
24
|
+
* @returns a string, or null if there is no value
|
|
25
|
+
*/
|
|
26
|
+
getKvpString(key: string): string | null;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the specified value for key
|
|
29
|
+
* @param key the key of the value to get
|
|
30
|
+
* @returns the value stored, as a number, or 0 if there is no value
|
|
31
|
+
*/
|
|
32
|
+
getKvpNumber(key: string): number;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the specified value for key
|
|
35
|
+
* @param key the key of the value to get
|
|
36
|
+
* @returns the value stored as a float, or 0.0 if there is no value
|
|
37
|
+
*/
|
|
38
|
+
getKvpFloat(key: string): number;
|
|
39
|
+
getKvpJson<T>(key: string): T;
|
|
40
|
+
/**
|
|
41
|
+
* Deletes the specified value for key, this is a blocking operation, if you're deleting a bunch of keys you should use [[deleteAsync]]
|
|
42
|
+
* @param key the key of the value to delete
|
|
43
|
+
*/
|
|
44
|
+
delete(key: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Deletes the specified resource keys value, this doesn't immediately write to disk and needs [[flush]] called afterwards.
|
|
47
|
+
* @param key the key to delete
|
|
48
|
+
*/
|
|
49
|
+
deleteAsync(key: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Ensures that any previous async call is flushed to disk
|
|
52
|
+
*/
|
|
53
|
+
flush(): void;
|
|
54
|
+
private handleKvp;
|
|
55
|
+
/**
|
|
56
|
+
* enumerates over any kvp prefixed with the prefix
|
|
57
|
+
*
|
|
58
|
+
* ```typescript
|
|
59
|
+
* for (const value of Kvp.getKvpsAsString("native:")) {
|
|
60
|
+
* console.log(value);
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param prefix the prefix to search for
|
|
65
|
+
*/
|
|
66
|
+
getKvpsAsString(prefix: string): IterableIterator<string>;
|
|
67
|
+
/**
|
|
68
|
+
* enumerates over any kvp prefixed with the prefix
|
|
69
|
+
*
|
|
70
|
+
* ```typescript
|
|
71
|
+
* for (const value of Kvp.getKvpsAsNumber("native:")) {
|
|
72
|
+
* console.log(value);
|
|
73
|
+
* }
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @param prefix the prefix to search for
|
|
77
|
+
*/
|
|
78
|
+
getKvpsAsNumber(prefix: string): IterableIterator<number>;
|
|
79
|
+
/**
|
|
80
|
+
* enumerates over any kvp prefixed with the prefix
|
|
81
|
+
*
|
|
82
|
+
* ```typescript
|
|
83
|
+
* for (const value of Kvp.getKvpsAsFloat("native:")) {
|
|
84
|
+
* console.log(value);
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param prefix the prefix to search for
|
|
89
|
+
*/
|
|
90
|
+
getKvpsAsFloat(prefix: string): IterableIterator<number>;
|
|
91
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
export class Kvp {
|
|
3
|
+
// TODO: Find a way to do this without casting to any
|
|
4
|
+
/**
|
|
5
|
+
* Sets the resource key to the specified value this is a blocking operation, if you're doing large write operations you should use [[setKvpAsync]] instead.
|
|
6
|
+
* @param key the key string
|
|
7
|
+
* @param value the value to set the key to
|
|
8
|
+
*/
|
|
9
|
+
setKvp(key, value) {
|
|
10
|
+
const type = typeof value;
|
|
11
|
+
if (type === 'string') {
|
|
12
|
+
SetResourceKvp(key, value);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
if (Number.isInteger(value)) {
|
|
16
|
+
SetResourceKvpInt(key, value);
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
SetResourceKvpFloat(key, value);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sets the resource key to the specified value, this doesn't immediately write to disk and needs [[flush]] called afterwards.
|
|
25
|
+
* @param key the key string
|
|
26
|
+
* @param value the value to set the key to
|
|
27
|
+
*/
|
|
28
|
+
setKvpAsync(key, value) {
|
|
29
|
+
const type = typeof value;
|
|
30
|
+
if (type === 'string') {
|
|
31
|
+
SetResourceKvpNoSync(key, value);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
if (Number.isInteger(value)) {
|
|
35
|
+
SetResourceKvpIntNoSync(key, value);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
SetResourceKvpFloatNoSync(key, value);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Sets the specified key to the specified json value
|
|
44
|
+
* This can error if given an invalid object
|
|
45
|
+
* @param key the key string
|
|
46
|
+
* @param value the value to set the key to
|
|
47
|
+
*/
|
|
48
|
+
setKvpJson(key, value) {
|
|
49
|
+
const stringified = JSON.stringify(value);
|
|
50
|
+
this.setKvp(key, stringified);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Gets the specified value for key
|
|
54
|
+
* @param key the key of the value to get
|
|
55
|
+
* @returns a string, or null if there is no value
|
|
56
|
+
*/
|
|
57
|
+
getKvpString(key) {
|
|
58
|
+
return GetResourceKvpString(key);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets the specified value for key
|
|
62
|
+
* @param key the key of the value to get
|
|
63
|
+
* @returns the value stored, as a number, or 0 if there is no value
|
|
64
|
+
*/
|
|
65
|
+
getKvpNumber(key) {
|
|
66
|
+
return GetResourceKvpInt(key);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Gets the specified value for key
|
|
70
|
+
* @param key the key of the value to get
|
|
71
|
+
* @returns the value stored as a float, or 0.0 if there is no value
|
|
72
|
+
*/
|
|
73
|
+
getKvpFloat(key) {
|
|
74
|
+
return GetResourceKvpFloat(key);
|
|
75
|
+
}
|
|
76
|
+
getKvpJson(key) {
|
|
77
|
+
const kvp = this.getKvpString(key);
|
|
78
|
+
return JSON.parse(kvp || '{}');
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Deletes the specified value for key, this is a blocking operation, if you're deleting a bunch of keys you should use [[deleteAsync]]
|
|
82
|
+
* @param key the key of the value to delete
|
|
83
|
+
*/
|
|
84
|
+
delete(key) {
|
|
85
|
+
DeleteResourceKvp(key);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Deletes the specified resource keys value, this doesn't immediately write to disk and needs [[flush]] called afterwards.
|
|
89
|
+
* @param key the key to delete
|
|
90
|
+
*/
|
|
91
|
+
deleteAsync(key) {
|
|
92
|
+
DeleteResourceKvpNoSync(key);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Ensures that any previous async call is flushed to disk
|
|
96
|
+
*/
|
|
97
|
+
flush() {
|
|
98
|
+
FlushResourceKvp();
|
|
99
|
+
}
|
|
100
|
+
*handleKvp(prefix, iterType) {
|
|
101
|
+
const handle = StartFindKvp(prefix);
|
|
102
|
+
if (handle === -1)
|
|
103
|
+
return;
|
|
104
|
+
let key;
|
|
105
|
+
do {
|
|
106
|
+
key = FindKvp(handle);
|
|
107
|
+
if (iterType === 'string') {
|
|
108
|
+
yield GetResourceKvpString(key);
|
|
109
|
+
}
|
|
110
|
+
else if (iterType === 'number') {
|
|
111
|
+
yield GetResourceKvpInt(key);
|
|
112
|
+
}
|
|
113
|
+
else if (iterType === 'float') {
|
|
114
|
+
yield GetResourceKvpFloat(key);
|
|
115
|
+
}
|
|
116
|
+
} while (key);
|
|
117
|
+
EndFindKvp(handle);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* enumerates over any kvp prefixed with the prefix
|
|
121
|
+
*
|
|
122
|
+
* ```typescript
|
|
123
|
+
* for (const value of Kvp.getKvpsAsString("native:")) {
|
|
124
|
+
* console.log(value);
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @param prefix the prefix to search for
|
|
129
|
+
*/
|
|
130
|
+
getKvpsAsString(prefix) {
|
|
131
|
+
return this.handleKvp(prefix, 'string');
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* enumerates over any kvp prefixed with the prefix
|
|
135
|
+
*
|
|
136
|
+
* ```typescript
|
|
137
|
+
* for (const value of Kvp.getKvpsAsNumber("native:")) {
|
|
138
|
+
* console.log(value);
|
|
139
|
+
* }
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* @param prefix the prefix to search for
|
|
143
|
+
*/
|
|
144
|
+
getKvpsAsNumber(prefix) {
|
|
145
|
+
return this.handleKvp(prefix, 'number');
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* enumerates over any kvp prefixed with the prefix
|
|
149
|
+
*
|
|
150
|
+
* ```typescript
|
|
151
|
+
* for (const value of Kvp.getKvpsAsFloat("native:")) {
|
|
152
|
+
* console.log(value);
|
|
153
|
+
* }
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* @param prefix the prefix to search for
|
|
157
|
+
*/
|
|
158
|
+
getKvpsAsFloat(prefix) {
|
|
159
|
+
return this.handleKvp(prefix, 'float');
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class Resource {
|
|
2
|
+
name: string;
|
|
3
|
+
constructor(name: string);
|
|
4
|
+
getMetadata(metadataKey: string, index: number): string;
|
|
5
|
+
getPath(): string;
|
|
6
|
+
loadFile(fileName: string): string;
|
|
7
|
+
saveFile(fileName: string, data: string, length: number): boolean;
|
|
8
|
+
scheduleTick(): void;
|
|
9
|
+
start(): void;
|
|
10
|
+
stop(): void;
|
|
11
|
+
static startResource(name: string): void;
|
|
12
|
+
static stopResource(name: string): void;
|
|
13
|
+
static resourceCount(): number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class Resource {
|
|
2
|
+
constructor(name) {
|
|
3
|
+
this.name = name;
|
|
4
|
+
}
|
|
5
|
+
getMetadata(metadataKey, index) {
|
|
6
|
+
return GetResourceMetadata(this.name, metadataKey, index);
|
|
7
|
+
}
|
|
8
|
+
getPath() {
|
|
9
|
+
return GetResourcePath(this.name);
|
|
10
|
+
}
|
|
11
|
+
loadFile(fileName) {
|
|
12
|
+
return LoadResourceFile(this.name, fileName);
|
|
13
|
+
}
|
|
14
|
+
saveFile(fileName, data, length) {
|
|
15
|
+
return SaveResourceFile(this.name, fileName, data, length);
|
|
16
|
+
}
|
|
17
|
+
scheduleTick() {
|
|
18
|
+
return ScheduleResourceTick(this.name);
|
|
19
|
+
}
|
|
20
|
+
start() {
|
|
21
|
+
StartResource(this.name);
|
|
22
|
+
}
|
|
23
|
+
stop() {
|
|
24
|
+
StopResource(this.name);
|
|
25
|
+
}
|
|
26
|
+
static startResource(name) {
|
|
27
|
+
StartResource(name);
|
|
28
|
+
}
|
|
29
|
+
static stopResource(name) {
|
|
30
|
+
StopResource(name);
|
|
31
|
+
}
|
|
32
|
+
static resourceCount() {
|
|
33
|
+
return GetNumResources();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class Color {
|
|
2
|
+
static fromArgb(a: number, r: number, g: number, b: number): Color;
|
|
3
|
+
static fromRgb(r: number, g: number, b: number): Color;
|
|
4
|
+
static fromArray(primitive: [number, number, number] | number[]): Color;
|
|
5
|
+
a: number;
|
|
6
|
+
r: number;
|
|
7
|
+
g: number;
|
|
8
|
+
b: number;
|
|
9
|
+
constructor(r: number, g: number, b: number, a?: number);
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class Color {
|
|
2
|
+
static fromArgb(a, r, g, b) {
|
|
3
|
+
return new Color(a, r, g, b);
|
|
4
|
+
}
|
|
5
|
+
static fromRgb(r, g, b) {
|
|
6
|
+
return new Color(255, r, g, b);
|
|
7
|
+
}
|
|
8
|
+
static fromArray(primitive) {
|
|
9
|
+
return new Color(primitive[0], primitive[1], primitive[2], 255);
|
|
10
|
+
}
|
|
11
|
+
constructor(r, g, b, a = 255) {
|
|
12
|
+
this.r = r;
|
|
13
|
+
this.g = g;
|
|
14
|
+
this.b = b;
|
|
15
|
+
this.a = a;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Vector3 } from './Vector3';
|
|
2
|
+
export declare class Quaternion {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
z: number;
|
|
6
|
+
w: number;
|
|
7
|
+
constructor(value: number);
|
|
8
|
+
constructor(vector: Vector3, w: number);
|
|
9
|
+
constructor(x: number, y: number, z: number, w: number);
|
|
10
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Vector3 } from './Vector3';
|
|
2
|
+
export class Quaternion {
|
|
3
|
+
constructor(valueXOrVector, yOrW, z, w) {
|
|
4
|
+
if (valueXOrVector instanceof Vector3) {
|
|
5
|
+
this.x = valueXOrVector.x;
|
|
6
|
+
this.y = valueXOrVector.y;
|
|
7
|
+
this.z = valueXOrVector.z;
|
|
8
|
+
this.w = yOrW ?? 0;
|
|
9
|
+
}
|
|
10
|
+
else if (yOrW === undefined) {
|
|
11
|
+
this.x = valueXOrVector;
|
|
12
|
+
this.y = valueXOrVector;
|
|
13
|
+
this.z = valueXOrVector;
|
|
14
|
+
this.w = valueXOrVector;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.x = valueXOrVector;
|
|
18
|
+
this.y = yOrW;
|
|
19
|
+
this.z = z ?? 0;
|
|
20
|
+
this.w = w ?? 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { MsgpackBuffer } from '@common/types';
|
|
2
|
+
export interface Vec2 {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export type Vector2Type = Vector2 | Vec2;
|
|
7
|
+
export declare class Vector2 implements Vec2 {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
type: string;
|
|
11
|
+
static create(v1: Vec2 | number): Vector2;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a vector from an array of numbers
|
|
14
|
+
* @param primitive An array of numbers (usually returned by a native)
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
static fromArray(primitive: [number, number] | number[]): Vector2;
|
|
18
|
+
/**
|
|
19
|
+
* Creates an array of vectors from an array number arrays
|
|
20
|
+
* @param primitives A multi-dimensional array of number arrays
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
static fromArrays(primitives: [number, number][] | number[][]): Vector2[];
|
|
24
|
+
static fromBuffer({ buffer }: MsgpackBuffer): Vector2;
|
|
25
|
+
static clone(v1: Vec2): Vector2;
|
|
26
|
+
static add(v1: Vector2Type, v2: Vector2Type | number): Vector2;
|
|
27
|
+
static subtract(v1: Vector2Type, v2: Vector2Type | number): Vector2;
|
|
28
|
+
static multiply(v1: Vector2Type, v2: Vector2Type | number): Vector2;
|
|
29
|
+
static divide(v1: Vector2Type, v2: Vector2Type | number): Vector2;
|
|
30
|
+
static dotProduct(v1: Vector2Type, v2: Vector2Type): number;
|
|
31
|
+
static normalize(v: Vector2): Vector2;
|
|
32
|
+
constructor(x: number, y: number);
|
|
33
|
+
toString(): string;
|
|
34
|
+
clone(): Vector2;
|
|
35
|
+
/**
|
|
36
|
+
* The product of the Euclidean magnitudes of this and another Vector2.
|
|
37
|
+
*
|
|
38
|
+
* @param v Vector2 to find Euclidean magnitude between.
|
|
39
|
+
* @returns Euclidean magnitude with another vector.
|
|
40
|
+
*/
|
|
41
|
+
distanceSquared(v: Vector2Type): number;
|
|
42
|
+
/**
|
|
43
|
+
* The distance between two Vectors.
|
|
44
|
+
*
|
|
45
|
+
* @param v Vector2 to find distance between.
|
|
46
|
+
* @returns Distance between this and another vector.
|
|
47
|
+
*/
|
|
48
|
+
distance(v: Vector2Type): number;
|
|
49
|
+
get normalize(): Vector2;
|
|
50
|
+
dotProduct(v: Vector2Type): number;
|
|
51
|
+
add(v: Vector2Type | number): Vector2;
|
|
52
|
+
subtract(v: Vector2Type): Vector2;
|
|
53
|
+
multiply(v: Vector2Type | number): Vector2;
|
|
54
|
+
divide(v: Vector2Type | number): Vector2;
|
|
55
|
+
toArray(): [number, number];
|
|
56
|
+
replace(v: Vector2Type): void;
|
|
57
|
+
get Length(): number;
|
|
58
|
+
}
|