@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.
Files changed (421) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. package/lib/client/Audio.d.ts +17 -0
  4. package/lib/client/Audio.js +92 -0
  5. package/lib/client/Blip.d.ts +39 -0
  6. package/lib/client/Blip.js +104 -0
  7. package/lib/client/Camera.d.ts +46 -0
  8. package/lib/client/Camera.js +161 -0
  9. package/lib/client/Checkpoint.d.ts +18 -0
  10. package/lib/client/Checkpoint.js +42 -0
  11. package/lib/client/Events.d.ts +11 -0
  12. package/lib/client/Events.js +73 -0
  13. package/lib/client/Game.d.ts +283 -0
  14. package/lib/client/Game.js +451 -0
  15. package/lib/client/GameplayCamera.d.ts +102 -0
  16. package/lib/client/GameplayCamera.js +141 -0
  17. package/lib/client/Model.d.ts +134 -0
  18. package/lib/client/Model.js +198 -0
  19. package/lib/client/NetworkedScene.d.ts +10 -0
  20. package/lib/client/NetworkedScene.js +17 -0
  21. package/lib/client/ParticleEffect.d.ts +80 -0
  22. package/lib/client/ParticleEffect.js +120 -0
  23. package/lib/client/ParticleEffectAsset.d.ts +54 -0
  24. package/lib/client/ParticleEffectAsset.js +104 -0
  25. package/lib/client/Pickup.d.ts +9 -0
  26. package/lib/client/Pickup.js +18 -0
  27. package/lib/client/Raycast.d.ts +49 -0
  28. package/lib/client/Raycast.js +70 -0
  29. package/lib/client/RelationshipGroup.d.ts +49 -0
  30. package/lib/client/RelationshipGroup.js +63 -0
  31. package/lib/client/Rope.d.ts +99 -0
  32. package/lib/client/Rope.js +125 -0
  33. package/lib/client/TaskSequence.d.ts +15 -0
  34. package/lib/client/TaskSequence.js +43 -0
  35. package/lib/client/Tasks.d.ts +66 -0
  36. package/lib/client/Tasks.js +236 -0
  37. package/lib/client/World.d.ts +402 -0
  38. package/lib/client/World.js +726 -0
  39. package/lib/client/cfx/StateBagChangeHandler.d.ts +3 -0
  40. package/lib/client/cfx/StateBagChangeHandler.js +1 -0
  41. package/lib/client/cfx/index.d.ts +7 -0
  42. package/lib/client/cfx/index.js +1 -0
  43. package/lib/client/enums/Alignment.d.ts +5 -0
  44. package/lib/client/enums/Alignment.js +6 -0
  45. package/lib/client/enums/AnimationFlags.d.ts +9 -0
  46. package/lib/client/enums/AnimationFlags.js +10 -0
  47. package/lib/client/enums/AudioFlag.d.ts +37 -0
  48. package/lib/client/enums/AudioFlag.js +38 -0
  49. package/lib/client/enums/BadgeStyle.d.ts +182 -0
  50. package/lib/client/enums/BadgeStyle.js +183 -0
  51. package/lib/client/enums/Blip.d.ts +223 -0
  52. package/lib/client/enums/Blip.js +225 -0
  53. package/lib/client/enums/Bone.d.ts +101 -0
  54. package/lib/client/enums/Bone.js +103 -0
  55. package/lib/client/enums/CameraShake.d.ts +13 -0
  56. package/lib/client/enums/CameraShake.js +14 -0
  57. package/lib/client/enums/CameraTypes.d.ts +7 -0
  58. package/lib/client/enums/CameraTypes.js +8 -0
  59. package/lib/client/enums/CheckboxStyle.d.ts +4 -0
  60. package/lib/client/enums/CheckboxStyle.js +5 -0
  61. package/lib/client/enums/Checkpoint.d.ts +62 -0
  62. package/lib/client/enums/Checkpoint.js +67 -0
  63. package/lib/client/enums/ClassTypes.d.ts +11 -0
  64. package/lib/client/enums/ClassTypes.js +12 -0
  65. package/lib/client/enums/CloudHat.d.ts +26 -0
  66. package/lib/client/enums/CloudHat.js +27 -0
  67. package/lib/client/enums/Control.d.ts +360 -0
  68. package/lib/client/enums/Control.js +361 -0
  69. package/lib/client/enums/CursorSprite.d.ts +14 -0
  70. package/lib/client/enums/CursorSprite.js +15 -0
  71. package/lib/client/enums/Driving.d.ts +32 -0
  72. package/lib/client/enums/Driving.js +34 -0
  73. package/lib/client/enums/ExplosionType.d.ts +44 -0
  74. package/lib/client/enums/ExplosionType.js +45 -0
  75. package/lib/client/enums/FiringPattern.d.ts +19 -0
  76. package/lib/client/enums/FiringPattern.js +20 -0
  77. package/lib/client/enums/Font.d.ts +7 -0
  78. package/lib/client/enums/Font.js +8 -0
  79. package/lib/client/enums/ForceType.d.ts +8 -0
  80. package/lib/client/enums/ForceType.js +9 -0
  81. package/lib/client/enums/Gender.d.ts +4 -0
  82. package/lib/client/enums/Gender.js +5 -0
  83. package/lib/client/enums/HelmetType.d.ts +5 -0
  84. package/lib/client/enums/HelmetType.js +6 -0
  85. package/lib/client/enums/HudColor.d.ts +183 -0
  86. package/lib/client/enums/HudColor.js +184 -0
  87. package/lib/client/enums/HudComponent.d.ts +53 -0
  88. package/lib/client/enums/HudComponent.js +54 -0
  89. package/lib/client/enums/InputMode.d.ts +4 -0
  90. package/lib/client/enums/InputMode.js +5 -0
  91. package/lib/client/enums/IntersectOptions.d.ts +15 -0
  92. package/lib/client/enums/IntersectOptions.js +16 -0
  93. package/lib/client/enums/InvertAxis.d.ts +9 -0
  94. package/lib/client/enums/InvertAxis.js +7 -0
  95. package/lib/client/enums/Language.d.ts +14 -0
  96. package/lib/client/enums/Language.js +15 -0
  97. package/lib/client/enums/LeaveVehicleFlags.d.ts +10 -0
  98. package/lib/client/enums/LeaveVehicleFlags.js +11 -0
  99. package/lib/client/enums/LoadingSpinnerType.d.ts +7 -0
  100. package/lib/client/enums/LoadingSpinnerType.js +8 -0
  101. package/lib/client/enums/MarkerType.d.ts +49 -0
  102. package/lib/client/enums/MarkerType.js +50 -0
  103. package/lib/client/enums/MenuAlignment.d.ts +4 -0
  104. package/lib/client/enums/MenuAlignment.js +5 -0
  105. package/lib/client/enums/NotificationType.d.ts +10 -0
  106. package/lib/client/enums/NotificationType.js +11 -0
  107. package/lib/client/enums/Parachute.d.ts +13 -0
  108. package/lib/client/enums/Parachute.js +15 -0
  109. package/lib/client/enums/PickupType.d.ts +73 -0
  110. package/lib/client/enums/PickupType.js +74 -0
  111. package/lib/client/enums/RadioStation.d.ts +24 -0
  112. package/lib/client/enums/RadioStation.js +25 -0
  113. package/lib/client/enums/RagdollType.d.ts +6 -0
  114. package/lib/client/enums/RagdollType.js +7 -0
  115. package/lib/client/enums/Relationship.d.ts +9 -0
  116. package/lib/client/enums/Relationship.js +10 -0
  117. package/lib/client/enums/RopeType.d.ts +5 -0
  118. package/lib/client/enums/RopeType.js +6 -0
  119. package/lib/client/enums/ScreenEffect.d.ts +83 -0
  120. package/lib/client/enums/ScreenEffect.js +84 -0
  121. package/lib/client/enums/SpeechModifier.d.ts +39 -0
  122. package/lib/client/enums/SpeechModifier.js +40 -0
  123. package/lib/client/enums/Vehicle.d.ts +358 -0
  124. package/lib/client/enums/Vehicle.js +376 -0
  125. package/lib/client/enums/Weather.d.ts +21 -0
  126. package/lib/client/enums/Weather.js +22 -0
  127. package/lib/client/enums/ZoneID.d.ts +94 -0
  128. package/lib/client/enums/ZoneID.js +95 -0
  129. package/lib/client/enums/index.d.ts +42 -0
  130. package/lib/client/enums/index.js +42 -0
  131. package/lib/client/hashes/MaterialHash.d.ts +216 -0
  132. package/lib/client/hashes/MaterialHash.js +217 -0
  133. package/lib/client/hashes/PedHash.d.ts +724 -0
  134. package/lib/client/hashes/PedHash.js +725 -0
  135. package/lib/client/hashes/VehicleHash.d.ts +522 -0
  136. package/lib/client/hashes/VehicleHash.js +523 -0
  137. package/lib/client/hashes/WeaponHash.d.ts +147 -0
  138. package/lib/client/hashes/WeaponHash.js +161 -0
  139. package/lib/client/hashes/WeatherTypeHash.d.ts +21 -0
  140. package/lib/client/hashes/WeatherTypeHash.js +22 -0
  141. package/lib/client/hashes/index.d.ts +5 -0
  142. package/lib/client/hashes/index.js +5 -0
  143. package/lib/client/index.d.ts +24 -0
  144. package/lib/client/index.js +25 -0
  145. package/lib/client/interfaces/Dimensions.d.ts +5 -0
  146. package/lib/client/interfaces/Dimensions.js +1 -0
  147. package/lib/client/models/BaseEntity.d.ts +169 -0
  148. package/lib/client/models/BaseEntity.js +459 -0
  149. package/lib/client/models/Entity.d.ts +9 -0
  150. package/lib/client/models/Entity.js +24 -0
  151. package/lib/client/models/EntityBone.d.ts +12 -0
  152. package/lib/client/models/EntityBone.js +24 -0
  153. package/lib/client/models/EntityBoneCollection.d.ts +11 -0
  154. package/lib/client/models/EntityBoneCollection.js +16 -0
  155. package/lib/client/models/Ped.d.ts +199 -0
  156. package/lib/client/models/Ped.js +685 -0
  157. package/lib/client/models/PedBone.d.ts +6 -0
  158. package/lib/client/models/PedBone.js +9 -0
  159. package/lib/client/models/PedBoneCollection.d.ts +8 -0
  160. package/lib/client/models/PedBoneCollection.js +19 -0
  161. package/lib/client/models/Player.d.ts +63 -0
  162. package/lib/client/models/Player.js +174 -0
  163. package/lib/client/models/Prop.d.ts +11 -0
  164. package/lib/client/models/Prop.js +26 -0
  165. package/lib/client/models/Vehicle.d.ts +171 -0
  166. package/lib/client/models/Vehicle.js +551 -0
  167. package/lib/client/models/VehicleDoor.d.ts +19 -0
  168. package/lib/client/models/VehicleDoor.js +42 -0
  169. package/lib/client/models/VehicleDoorCollection.d.ts +14 -0
  170. package/lib/client/models/VehicleDoorCollection.js +61 -0
  171. package/lib/client/models/VehicleMod.d.ts +16 -0
  172. package/lib/client/models/VehicleMod.js +33 -0
  173. package/lib/client/models/VehicleModCollection.d.ts +61 -0
  174. package/lib/client/models/VehicleModCollection.js +227 -0
  175. package/lib/client/models/VehicleToggleMod.d.ts +14 -0
  176. package/lib/client/models/VehicleToggleMod.js +27 -0
  177. package/lib/client/models/VehicleWheel.d.ts +11 -0
  178. package/lib/client/models/VehicleWheel.js +21 -0
  179. package/lib/client/models/VehicleWheelCollection.d.ts +13 -0
  180. package/lib/client/models/VehicleWheelCollection.js +56 -0
  181. package/lib/client/models/VehicleWindow.d.ts +16 -0
  182. package/lib/client/models/VehicleWindow.js +33 -0
  183. package/lib/client/models/VehicleWindowCollection.d.ts +14 -0
  184. package/lib/client/models/VehicleWindowCollection.js +55 -0
  185. package/lib/client/models/index.d.ts +18 -0
  186. package/lib/client/models/index.js +18 -0
  187. package/lib/client/types/EntityType.d.ts +2 -0
  188. package/lib/client/types/EntityType.js +1 -0
  189. package/lib/client/ui/Container.d.ts +11 -0
  190. package/lib/client/ui/Container.js +28 -0
  191. package/lib/client/ui/Effects.d.ts +8 -0
  192. package/lib/client/ui/Effects.js +106 -0
  193. package/lib/client/ui/Fading.d.ts +41 -0
  194. package/lib/client/ui/Fading.js +69 -0
  195. package/lib/client/ui/Hud.d.ts +16 -0
  196. package/lib/client/ui/Hud.js +39 -0
  197. package/lib/client/ui/InstructionalButtons.d.ts +33 -0
  198. package/lib/client/ui/InstructionalButtons.js +53 -0
  199. package/lib/client/ui/LoadingPrompt.d.ts +27 -0
  200. package/lib/client/ui/LoadingPrompt.js +45 -0
  201. package/lib/client/ui/Notification.d.ts +5 -0
  202. package/lib/client/ui/Notification.js +8 -0
  203. package/lib/client/ui/Rectangle.d.ts +10 -0
  204. package/lib/client/ui/Rectangle.js +37 -0
  205. package/lib/client/ui/Scaleform.d.ts +106 -0
  206. package/lib/client/ui/Scaleform.js +234 -0
  207. package/lib/client/ui/Screen.d.ts +16 -0
  208. package/lib/client/ui/Screen.js +72 -0
  209. package/lib/client/ui/Sprite.d.ts +17 -0
  210. package/lib/client/ui/Sprite.js +53 -0
  211. package/lib/client/ui/Text.d.ts +31 -0
  212. package/lib/client/ui/Text.js +102 -0
  213. package/lib/client/ui/Timerbar.d.ts +44 -0
  214. package/lib/client/ui/Timerbar.js +241 -0
  215. package/lib/client/ui/index.d.ts +15 -0
  216. package/lib/client/ui/index.js +15 -0
  217. package/lib/client/ui/interfaces/IButton.d.ts +5 -0
  218. package/lib/client/ui/interfaces/IButton.js +1 -0
  219. package/lib/client/ui/interfaces/IDrawable.d.ts +7 -0
  220. package/lib/client/ui/interfaces/IDrawable.js +1 -0
  221. package/lib/client/ui/interfaces/index.d.ts +2 -0
  222. package/lib/client/ui/interfaces/index.js +1 -0
  223. package/lib/client/ui/menu/Menu.d.ts +108 -0
  224. package/lib/client/ui/menu/Menu.js +802 -0
  225. package/lib/client/ui/menu/MenuControl.d.ts +6 -0
  226. package/lib/client/ui/menu/MenuControl.js +11 -0
  227. package/lib/client/ui/menu/MenuControls.d.ts +9 -0
  228. package/lib/client/ui/menu/MenuControls.js +11 -0
  229. package/lib/client/ui/menu/MenuSettings.d.ts +20 -0
  230. package/lib/client/ui/menu/MenuSettings.js +51 -0
  231. package/lib/client/ui/menu/index.d.ts +6 -0
  232. package/lib/client/ui/menu/index.js +6 -0
  233. package/lib/client/ui/menu/items/UIMenuCheckboxItem.d.ts +20 -0
  234. package/lib/client/ui/menu/items/UIMenuCheckboxItem.js +57 -0
  235. package/lib/client/ui/menu/items/UIMenuItem.d.ts +78 -0
  236. package/lib/client/ui/menu/items/UIMenuItem.js +1090 -0
  237. package/lib/client/ui/menu/items/UIMenuListItem.d.ts +31 -0
  238. package/lib/client/ui/menu/items/UIMenuListItem.js +110 -0
  239. package/lib/client/ui/menu/items/UIMenuSeparatorItem.d.ts +11 -0
  240. package/lib/client/ui/menu/items/UIMenuSeparatorItem.js +29 -0
  241. package/lib/client/ui/menu/items/UIMenuSliderItem.d.ts +47 -0
  242. package/lib/client/ui/menu/items/UIMenuSliderItem.js +173 -0
  243. package/lib/client/ui/menu/items/index.d.ts +6 -0
  244. package/lib/client/ui/menu/items/index.js +6 -0
  245. package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.d.ts +17 -0
  246. package/lib/client/ui/menu/items/panels/AbstractUIMenuPanel.js +43 -0
  247. package/lib/client/ui/menu/items/panels/UIMenuColorPanel.d.ts +36 -0
  248. package/lib/client/ui/menu/items/panels/UIMenuColorPanel.js +211 -0
  249. package/lib/client/ui/menu/items/panels/UIMenuGridPanel.d.ts +40 -0
  250. package/lib/client/ui/menu/items/panels/UIMenuGridPanel.js +215 -0
  251. package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.d.ts +26 -0
  252. package/lib/client/ui/menu/items/panels/UIMenuPercentagePanel.js +115 -0
  253. package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.d.ts +16 -0
  254. package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanel.js +77 -0
  255. package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.d.ts +13 -0
  256. package/lib/client/ui/menu/items/panels/UIMenuStatisticsPanelItem.js +32 -0
  257. package/lib/client/ui/menu/items/panels/index.d.ts +6 -0
  258. package/lib/client/ui/menu/items/panels/index.js +6 -0
  259. package/lib/client/ui/menu/modules/ListItem.d.ts +6 -0
  260. package/lib/client/ui/menu/modules/ListItem.js +8 -0
  261. package/lib/client/ui/menu/modules/index.d.ts +1 -0
  262. package/lib/client/ui/menu/modules/index.js +1 -0
  263. package/lib/client/utils/Animations.d.ts +19 -0
  264. package/lib/client/utils/Animations.js +55 -0
  265. package/lib/client/utils/Color.d.ts +15 -0
  266. package/lib/client/utils/Color.js +22 -0
  267. package/lib/client/utils/Crypto.d.ts +3 -0
  268. package/lib/client/utils/Crypto.js +25 -0
  269. package/lib/client/utils/LiteEvent.d.ts +13 -0
  270. package/lib/client/utils/LiteEvent.js +21 -0
  271. package/lib/client/utils/Maths.d.ts +4 -0
  272. package/lib/client/utils/Maths.js +10 -0
  273. package/lib/client/utils/Point.d.ts +9 -0
  274. package/lib/client/utils/Point.js +28 -0
  275. package/lib/client/utils/PointF.d.ts +12 -0
  276. package/lib/client/utils/PointF.js +11 -0
  277. package/lib/client/utils/Quaternion.d.ts +10 -0
  278. package/lib/client/utils/Quaternion.js +23 -0
  279. package/lib/client/utils/Size.d.ts +5 -0
  280. package/lib/client/utils/Size.js +6 -0
  281. package/lib/client/utils/String.d.ts +6 -0
  282. package/lib/client/utils/String.js +25 -0
  283. package/lib/client/utils/Vector2.d.ts +54 -0
  284. package/lib/client/utils/Vector2.js +106 -0
  285. package/lib/client/utils/Vector3.d.ts +69 -0
  286. package/lib/client/utils/Vector3.js +140 -0
  287. package/lib/client/utils/Vector4.d.ts +62 -0
  288. package/lib/client/utils/Vector4.js +124 -0
  289. package/lib/client/utils/enumValues.d.ts +12 -0
  290. package/lib/client/utils/enumValues.js +14 -0
  291. package/lib/client/utils/getStringFromUInt8Array.d.ts +8 -0
  292. package/lib/client/utils/getStringFromUInt8Array.js +10 -0
  293. package/lib/client/utils/getUInt32FromUint8Array.d.ts +8 -0
  294. package/lib/client/utils/getUInt32FromUint8Array.js +8 -0
  295. package/lib/client/utils/index.d.ts +10 -0
  296. package/lib/client/utils/index.js +10 -0
  297. package/lib/client/weapon/DlcWeaponData.d.ts +43 -0
  298. package/lib/client/weapon/DlcWeaponData.js +44 -0
  299. package/lib/client/weapon/Mk2WeaponHash.d.ts +18 -0
  300. package/lib/client/weapon/Mk2WeaponHash.js +25 -0
  301. package/lib/client/weapon/Weapon.d.ts +169 -0
  302. package/lib/client/weapon/Weapon.js +267 -0
  303. package/lib/client/weapon/WeaponAsset.d.ts +55 -0
  304. package/lib/client/weapon/WeaponAsset.js +83 -0
  305. package/lib/client/weapon/WeaponCollection.d.ts +90 -0
  306. package/lib/client/weapon/WeaponCollection.js +186 -0
  307. package/lib/client/weapon/WeaponDisplayNameByHash.d.ts +6 -0
  308. package/lib/client/weapon/WeaponDisplayNameByHash.js +75 -0
  309. package/lib/client/weapon/WeaponGroup.d.ts +18 -0
  310. package/lib/client/weapon/WeaponGroup.js +19 -0
  311. package/lib/client/weapon/WeaponHudStats.d.ts +27 -0
  312. package/lib/client/weapon/WeaponHudStats.js +38 -0
  313. package/lib/client/weapon/WeaponLivery.d.ts +13 -0
  314. package/lib/client/weapon/WeaponLivery.js +14 -0
  315. package/lib/client/weapon/WeaponLiveryColor.d.ts +34 -0
  316. package/lib/client/weapon/WeaponLiveryColor.js +35 -0
  317. package/lib/client/weapon/WeaponTint.d.ts +42 -0
  318. package/lib/client/weapon/WeaponTint.js +43 -0
  319. package/lib/client/weapon/index.d.ts +8 -0
  320. package/lib/client/weapon/index.js +8 -0
  321. package/lib/client/weaponComponent/ComponentAttachmentPoint.d.ts +18 -0
  322. package/lib/client/weaponComponent/ComponentAttachmentPoint.js +19 -0
  323. package/lib/client/weaponComponent/ComponentAttachmentPointByHash.d.ts +7 -0
  324. package/lib/client/weaponComponent/ComponentAttachmentPointByHash.js +309 -0
  325. package/lib/client/weaponComponent/ComponentDisplayNameByHash.d.ts +6 -0
  326. package/lib/client/weaponComponent/ComponentDisplayNameByHash.js +280 -0
  327. package/lib/client/weaponComponent/DlcWeaponComponentData.d.ts +40 -0
  328. package/lib/client/weaponComponent/DlcWeaponComponentData.js +44 -0
  329. package/lib/client/weaponComponent/InvalidWeaponComponent.d.ts +12 -0
  330. package/lib/client/weaponComponent/InvalidWeaponComponent.js +28 -0
  331. package/lib/client/weaponComponent/WeaponComponent.d.ts +81 -0
  332. package/lib/client/weaponComponent/WeaponComponent.js +119 -0
  333. package/lib/client/weaponComponent/WeaponComponentCollection.d.ts +108 -0
  334. package/lib/client/weaponComponent/WeaponComponentCollection.js +172 -0
  335. package/lib/client/weaponComponent/WeaponComponentHash.d.ts +671 -0
  336. package/lib/client/weaponComponent/WeaponComponentHash.js +887 -0
  337. package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.d.ts +8 -0
  338. package/lib/client/weaponComponent/WeaponComponentHashesByWeaponHash.js +823 -0
  339. package/lib/client/weaponComponent/WeaponComponentHudStats.d.ts +27 -0
  340. package/lib/client/weaponComponent/WeaponComponentHudStats.js +34 -0
  341. package/lib/client/weaponComponent/index.d.ts +5 -0
  342. package/lib/client/weaponComponent/index.js +5 -0
  343. package/lib/common/Convar.d.ts +8 -0
  344. package/lib/common/Convar.js +20 -0
  345. package/lib/common/Kvp.d.ts +91 -0
  346. package/lib/common/Kvp.js +161 -0
  347. package/lib/common/Resource.d.ts +14 -0
  348. package/lib/common/Resource.js +35 -0
  349. package/lib/common/index.d.ts +5 -0
  350. package/lib/common/index.js +5 -0
  351. package/lib/common/types.d.ts +6 -0
  352. package/lib/common/types.js +1 -0
  353. package/lib/common/utils/Color.d.ts +10 -0
  354. package/lib/common/utils/Color.js +17 -0
  355. package/lib/common/utils/Maths.d.ts +4 -0
  356. package/lib/common/utils/Maths.js +10 -0
  357. package/lib/common/utils/PointF.d.ts +12 -0
  358. package/lib/common/utils/PointF.js +11 -0
  359. package/lib/common/utils/Quaternion.d.ts +10 -0
  360. package/lib/common/utils/Quaternion.js +23 -0
  361. package/lib/common/utils/Vector2.d.ts +58 -0
  362. package/lib/common/utils/Vector2.js +113 -0
  363. package/lib/common/utils/Vector3.d.ts +73 -0
  364. package/lib/common/utils/Vector3.js +147 -0
  365. package/lib/common/utils/Vector4.d.ts +66 -0
  366. package/lib/common/utils/Vector4.js +131 -0
  367. package/lib/common/utils/cleanPlayerName.d.ts +6 -0
  368. package/lib/common/utils/cleanPlayerName.js +27 -0
  369. package/lib/common/utils/enumValues.d.ts +12 -0
  370. package/lib/common/utils/enumValues.js +14 -0
  371. package/lib/common/utils/getStringFromUInt8Array.d.ts +8 -0
  372. package/lib/common/utils/getStringFromUInt8Array.js +10 -0
  373. package/lib/common/utils/getUInt32FromUint8Array.d.ts +8 -0
  374. package/lib/common/utils/getUInt32FromUint8Array.js +8 -0
  375. package/lib/common/utils/index.d.ts +12 -0
  376. package/lib/common/utils/index.js +12 -0
  377. package/lib/server/Anticheat.d.ts +0 -0
  378. package/lib/server/Anticheat.js +25 -0
  379. package/lib/server/Events.d.ts +35 -0
  380. package/lib/server/Events.js +102 -0
  381. package/lib/server/Game.d.ts +56 -0
  382. package/lib/server/Game.js +86 -0
  383. package/lib/server/cfx/StateBagChangeHandler.d.ts +9 -0
  384. package/lib/server/cfx/StateBagChangeHandler.js +4 -0
  385. package/lib/server/cfx/index.d.ts +7 -0
  386. package/lib/server/cfx/index.js +1 -0
  387. package/lib/server/entities/BaseEntity.d.ts +115 -0
  388. package/lib/server/entities/BaseEntity.js +161 -0
  389. package/lib/server/entities/Entity.d.ts +18 -0
  390. package/lib/server/entities/Entity.js +22 -0
  391. package/lib/server/entities/Ped.d.ts +87 -0
  392. package/lib/server/entities/Ped.js +122 -0
  393. package/lib/server/entities/Player.d.ts +163 -0
  394. package/lib/server/entities/Player.js +235 -0
  395. package/lib/server/entities/Prop.d.ts +32 -0
  396. package/lib/server/entities/Prop.js +42 -0
  397. package/lib/server/entities/Vehicle.d.ts +230 -0
  398. package/lib/server/entities/Vehicle.js +331 -0
  399. package/lib/server/entities/index.d.ts +5 -0
  400. package/lib/server/entities/index.js +5 -0
  401. package/lib/server/enum/ClassTypes.d.ts +11 -0
  402. package/lib/server/enum/ClassTypes.js +12 -0
  403. package/lib/server/enum/PopulationType.d.ts +13 -0
  404. package/lib/server/enum/PopulationType.js +14 -0
  405. package/lib/server/enum/VehicleLockStatus.d.ts +9 -0
  406. package/lib/server/enum/VehicleLockStatus.js +10 -0
  407. package/lib/server/enum/VehicleType.d.ts +10 -0
  408. package/lib/server/enum/VehicleType.js +11 -0
  409. package/lib/server/enum/eEntityType.d.ts +5 -0
  410. package/lib/server/enum/eEntityType.js +6 -0
  411. package/lib/server/enum/index.d.ts +5 -0
  412. package/lib/server/enum/index.js +5 -0
  413. package/lib/server/index.d.ts +7 -0
  414. package/lib/server/index.js +7 -0
  415. package/lib/server/type/Anticheat.d.ts +471 -0
  416. package/lib/server/type/Anticheat.js +160 -0
  417. package/lib/server/type/Hash.d.ts +3 -0
  418. package/lib/server/type/Hash.js +2 -0
  419. package/lib/server/utils/index.d.ts +1 -0
  420. package/lib/server/utils/index.js +1 -0
  421. package/package.json +54 -0
@@ -0,0 +1,106 @@
1
+ export class Vector2 {
2
+ static create(v1) {
3
+ if (typeof v1 === 'number')
4
+ return new Vector2(v1, v1);
5
+ return new Vector2(v1.x, v1.y);
6
+ }
7
+ /**
8
+ * Creates a vector from an array of numbers
9
+ * @param primitive An array of numbers (usually returned by a native)
10
+ * ```
11
+ */
12
+ static fromArray(primitive) {
13
+ return new Vector2(primitive[0], primitive[1]);
14
+ }
15
+ /**
16
+ * Creates an array of vectors from an array number arrays
17
+ * @param primitives A multi-dimensional array of number arrays
18
+ * ```
19
+ */
20
+ static fromArrays(primitives) {
21
+ return primitives.map(prim => new Vector2(prim[0], prim[1]));
22
+ }
23
+ static clone(v1) {
24
+ return Vector2.create(v1);
25
+ }
26
+ static add(v1, v2) {
27
+ if (typeof v2 === 'number')
28
+ return new Vector2(v1.x + v2, v1.y + v2);
29
+ return new Vector2(v1.x + v2.x, v1.y + v2.y);
30
+ }
31
+ static subtract(v1, v2) {
32
+ if (typeof v2 === 'number')
33
+ return new Vector2(v1.x - v2, v1.y - v2);
34
+ return new Vector2(v1.x - v2.x, v1.y - v2.y);
35
+ }
36
+ static multiply(v1, v2) {
37
+ if (typeof v2 === 'number')
38
+ return new Vector2(v1.x * v2, v1.y * v2);
39
+ return new Vector2(v1.x * v2.x, v1.y * v2.y);
40
+ }
41
+ static divide(v1, v2) {
42
+ if (typeof v2 === 'number')
43
+ return new Vector2(v1.x / v2, v1.y / v2);
44
+ return new Vector2(v1.x / v2.x, v1.y / v2.y);
45
+ }
46
+ static dotProduct(v1, v2) {
47
+ return v1.x * v2.x + v1.y * v2.y;
48
+ }
49
+ static normalize(v) {
50
+ return Vector2.divide(v, v.Length);
51
+ }
52
+ constructor(x, y) {
53
+ this.x = x;
54
+ this.y = y;
55
+ }
56
+ clone() {
57
+ return new Vector2(this.x, this.y);
58
+ }
59
+ /**
60
+ * The product of the Euclidean magnitudes of this and another Vector2.
61
+ *
62
+ * @param v Vector2 to find Euclidean magnitude between.
63
+ * @returns Euclidean magnitude with another vector.
64
+ */
65
+ distanceSquared(v) {
66
+ const w = this.subtract(v);
67
+ return Vector2.dotProduct(w, w);
68
+ }
69
+ /**
70
+ * The distance between two Vectors.
71
+ *
72
+ * @param v Vector2 to find distance between.
73
+ * @returns Distance between this and another vector.
74
+ */
75
+ distance(v) {
76
+ return Math.sqrt(this.distanceSquared(v));
77
+ }
78
+ get normalize() {
79
+ return Vector2.normalize(this);
80
+ }
81
+ dotProduct(v) {
82
+ return Vector2.dotProduct(this, v);
83
+ }
84
+ add(v) {
85
+ return Vector2.add(this, v);
86
+ }
87
+ subtract(v) {
88
+ return Vector2.subtract(this, v);
89
+ }
90
+ multiply(v) {
91
+ return Vector2.multiply(this, v);
92
+ }
93
+ divide(v) {
94
+ return Vector2.divide(this, v);
95
+ }
96
+ toArray() {
97
+ return [this.x, this.y];
98
+ }
99
+ replace(v) {
100
+ this.x = v.x;
101
+ this.y = v.y;
102
+ }
103
+ get Length() {
104
+ return Math.sqrt(this.x * this.x + this.y * this.y);
105
+ }
106
+ }
@@ -0,0 +1,69 @@
1
+ export interface Vec3 {
2
+ x: number;
3
+ y: number;
4
+ z: number;
5
+ }
6
+ export type Vector = Vector3 | Vec3;
7
+ export declare class Vector3 implements Vec3 {
8
+ x: number;
9
+ y: number;
10
+ z: number;
11
+ static readonly Zero: Vector3;
12
+ static create(v1: Vec3 | number): Vector3;
13
+ /**
14
+ * Creates a vector from an array of numbers
15
+ * @param primitive An array of numbers (usually returned by a native)
16
+ * @example ```ts
17
+ * const entityPos = Vector3.fromArray(GetEntityCoords(entity))
18
+ * ```
19
+ */
20
+ static fromArray(primitive: [number, number, number] | number[]): Vector3;
21
+ /**
22
+ * Creates an array of vectors from an array number arrays
23
+ * @param primitives A multi-dimensional array of number arrays
24
+ * @example ```ts
25
+ * const [forward, right, up, position] = Vector3.fromArrays(GetEntityMatrix(entity))
26
+ * ```
27
+ */
28
+ static fromArrays(primitives: [number, number, number][] | number[][]): Vector3[];
29
+ static clone(v1: Vec3): Vector3;
30
+ static add(v1: Vector, v2: Vector | number): Vector3;
31
+ static addX(vec: Vector, x: number): Vector3;
32
+ static addY(vec: Vector, y: number): Vector3;
33
+ static addZ(vec: Vector, z: number): Vector3;
34
+ static subtract(v1: Vector, v2: Vector | number): Vector3;
35
+ static multiply(v1: Vector, v2: Vector | number): Vector3;
36
+ static divide(v1: Vector, v2: Vector | number): Vector3;
37
+ static dotProduct(v1: Vector, v2: Vector): number;
38
+ static crossProduct(v1: Vector, v2: Vector): Vector3;
39
+ static normalize(v: Vector3): Vector3;
40
+ constructor(x: number, y: number, z: number);
41
+ clone(): Vector3;
42
+ /**
43
+ * The product of the Euclidean magnitudes of this and another Vector3.
44
+ *
45
+ * @param v Vector3 to find Euclidean magnitude between.
46
+ * @returns Euclidean magnitude with another vector.
47
+ */
48
+ distanceSquared(v: Vector): number;
49
+ /**
50
+ * The distance between two Vectors.
51
+ *
52
+ * @param v Vector3 to find distance between.
53
+ * @returns Distance between this and another vector.
54
+ */
55
+ distance(v: Vector): number;
56
+ get normalize(): Vector3;
57
+ crossProduct(v: Vector): Vector3;
58
+ dotProduct(v: Vector): number;
59
+ add(v: Vector | number): Vector3;
60
+ addX(x: number): Vector3;
61
+ addY(y: number): Vector3;
62
+ addZ(z: number): Vector3;
63
+ subtract(v: Vector): Vector3;
64
+ multiply(v: Vector | number): Vector3;
65
+ divide(v: Vector | number): Vector3;
66
+ toArray(): [number, number, number];
67
+ replace(v: Vector): void;
68
+ get Length(): number;
69
+ }
@@ -0,0 +1,140 @@
1
+ export class Vector3 {
2
+ static create(v1) {
3
+ if (typeof v1 === 'number')
4
+ return new Vector3(v1, v1, v1);
5
+ return new Vector3(v1.x, v1.y, v1.z);
6
+ }
7
+ /**
8
+ * Creates a vector from an array of numbers
9
+ * @param primitive An array of numbers (usually returned by a native)
10
+ * @example ```ts
11
+ * const entityPos = Vector3.fromArray(GetEntityCoords(entity))
12
+ * ```
13
+ */
14
+ static fromArray(primitive) {
15
+ return new Vector3(primitive[0], primitive[1], primitive[2]);
16
+ }
17
+ /**
18
+ * Creates an array of vectors from an array number arrays
19
+ * @param primitives A multi-dimensional array of number arrays
20
+ * @example ```ts
21
+ * const [forward, right, up, position] = Vector3.fromArrays(GetEntityMatrix(entity))
22
+ * ```
23
+ */
24
+ static fromArrays(primitives) {
25
+ return primitives.map(prim => new Vector3(prim[0], prim[1], prim[2]));
26
+ }
27
+ static clone(v1) {
28
+ return Vector3.create(v1);
29
+ }
30
+ static add(v1, v2) {
31
+ if (typeof v2 === 'number')
32
+ return new Vector3(v1.x + v2, v1.y + v2, v1.z + v2);
33
+ return new Vector3(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
34
+ }
35
+ static addX(vec, x) {
36
+ return new Vector3(vec.x + x, vec.y, vec.z);
37
+ }
38
+ static addY(vec, y) {
39
+ return new Vector3(vec.x, vec.y + y, vec.z);
40
+ }
41
+ static addZ(vec, z) {
42
+ return new Vector3(vec.x, vec.y, vec.z + z);
43
+ }
44
+ static subtract(v1, v2) {
45
+ if (typeof v2 === 'number')
46
+ return new Vector3(v1.x - v2, v1.y - v2, v1.z - v2);
47
+ return new Vector3(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
48
+ }
49
+ static multiply(v1, v2) {
50
+ if (typeof v2 === 'number')
51
+ return new Vector3(v1.x * v2, v1.y * v2, v1.z * v2);
52
+ return new Vector3(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z);
53
+ }
54
+ static divide(v1, v2) {
55
+ if (typeof v2 === 'number')
56
+ return new Vector3(v1.x / v2, v1.y / v2, v1.z / v2);
57
+ return new Vector3(v1.x / v2.x, v1.y / v2.y, v1.z / v2.z);
58
+ }
59
+ static dotProduct(v1, v2) {
60
+ return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
61
+ }
62
+ static crossProduct(v1, v2) {
63
+ const x = v1.y * v2.z - v1.z * v2.y;
64
+ const y = v1.z * v2.x - v1.x * v2.z;
65
+ const z = v1.x * v2.y - v1.y * v2.x;
66
+ return new Vector3(x, y, z);
67
+ }
68
+ static normalize(v) {
69
+ return Vector3.divide(v, v.Length);
70
+ }
71
+ constructor(x, y, z) {
72
+ this.x = x;
73
+ this.y = y;
74
+ this.z = z;
75
+ }
76
+ clone() {
77
+ return new Vector3(this.x, this.y, this.z);
78
+ }
79
+ /**
80
+ * The product of the Euclidean magnitudes of this and another Vector3.
81
+ *
82
+ * @param v Vector3 to find Euclidean magnitude between.
83
+ * @returns Euclidean magnitude with another vector.
84
+ */
85
+ distanceSquared(v) {
86
+ const w = this.subtract(v);
87
+ return Vector3.dotProduct(w, w);
88
+ }
89
+ /**
90
+ * The distance between two Vectors.
91
+ *
92
+ * @param v Vector3 to find distance between.
93
+ * @returns Distance between this and another vector.
94
+ */
95
+ distance(v) {
96
+ return Math.sqrt(this.distanceSquared(v));
97
+ }
98
+ get normalize() {
99
+ return Vector3.normalize(this);
100
+ }
101
+ crossProduct(v) {
102
+ return Vector3.crossProduct(this, v);
103
+ }
104
+ dotProduct(v) {
105
+ return Vector3.dotProduct(this, v);
106
+ }
107
+ add(v) {
108
+ return Vector3.add(this, v);
109
+ }
110
+ addX(x) {
111
+ return Vector3.addX(this, x);
112
+ }
113
+ addY(y) {
114
+ return Vector3.addY(this, y);
115
+ }
116
+ addZ(z) {
117
+ return Vector3.addZ(this, z);
118
+ }
119
+ subtract(v) {
120
+ return Vector3.subtract(this, v);
121
+ }
122
+ multiply(v) {
123
+ return Vector3.multiply(this, v);
124
+ }
125
+ divide(v) {
126
+ return Vector3.divide(this, v);
127
+ }
128
+ toArray() {
129
+ return [this.x, this.y, this.z];
130
+ }
131
+ replace(v) {
132
+ this.x = v.x;
133
+ this.y = v.y;
134
+ this.z = v.z;
135
+ }
136
+ get Length() {
137
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
138
+ }
139
+ }
140
+ Vector3.Zero = new Vector3(0, 0, 0);
@@ -0,0 +1,62 @@
1
+ import { Vector3 } from './Vector3';
2
+ export interface Vec4 {
3
+ x: number;
4
+ y: number;
5
+ z: number;
6
+ w: number;
7
+ }
8
+ export type Vector4Type = Vector4 | Vec4;
9
+ export declare class Vector4 implements Vec4 {
10
+ x: number;
11
+ y: number;
12
+ z: number;
13
+ w: number;
14
+ static create(v1: Vec4 | number): Vector4;
15
+ /**
16
+ * Creates a vector from an array of numbers
17
+ * @param primitive An array of numbers (usually returned by a native)
18
+ * ```
19
+ */
20
+ static fromArray(primitive: [number, number, number, number] | number[]): Vector4;
21
+ /**
22
+ * Creates an array of vectors from an array number arrays
23
+ * @param primitives A multi-dimensional array of number arrays
24
+ * ```
25
+ */
26
+ static fromArrays(primitives: [number, number, number, number][] | number[][]): Vector4[];
27
+ static clone(v1: Vec4): Vector4;
28
+ static add(v1: Vector4Type, v2: Vector4Type | number): Vector4;
29
+ static subtract(v1: Vector4Type, v2: Vector4Type | number): Vector4;
30
+ static multiply(v1: Vector4Type, v2: Vector4Type | number): Vector4;
31
+ static divide(v1: Vector4Type, v2: Vector4Type | number): Vector4;
32
+ static dotProduct(v1: Vector4Type, v2: Vector4Type): number;
33
+ static crossProduct(v1: Vector4Type, v2: Vector4Type): Vector4;
34
+ static normalize(v: Vector4): Vector4;
35
+ constructor(x: number, y: number, z: number, w: number);
36
+ clone(): Vector4;
37
+ /**
38
+ * The product of the Euclidean magnitudes of this and another Vector4.
39
+ *
40
+ * @param v Vector4 to find Euclidean magnitude between.
41
+ * @returns Euclidean magnitude with another vector.
42
+ */
43
+ distanceSquared(v: Vector4Type): number;
44
+ /**
45
+ * The distance between two Vectors.
46
+ *
47
+ * @param v Vector4 to find distance between.
48
+ * @returns Distance between this and another vector.
49
+ */
50
+ distance(v: Vector4Type): number;
51
+ get normalize(): Vector4;
52
+ crossProduct(v: Vector4Type): Vector4;
53
+ dotProduct(v: Vector4Type): number;
54
+ add(v: Vector4Type | number): Vector4;
55
+ subtract(v: Vector4Type): Vector4;
56
+ multiply(v: Vector4Type | number): Vector4;
57
+ divide(v: Vector4Type | number): Vector4;
58
+ toArray(): [number, number, number, number];
59
+ toVec3(): Vector3;
60
+ replace(v: Vector4Type): void;
61
+ get Length(): number;
62
+ }
@@ -0,0 +1,124 @@
1
+ // Source: https://raw.githubusercontent.com/you21979/typescript-vector/master/vector3.ts
2
+ import { Vector3 } from './Vector3';
3
+ export class Vector4 {
4
+ static create(v1) {
5
+ if (typeof v1 === 'number')
6
+ return new Vector4(v1, v1, v1, v1);
7
+ return new Vector4(v1.x, v1.y, v1.z, v1.w);
8
+ }
9
+ /**
10
+ * Creates a vector from an array of numbers
11
+ * @param primitive An array of numbers (usually returned by a native)
12
+ * ```
13
+ */
14
+ static fromArray(primitive) {
15
+ return new Vector4(primitive[0], primitive[1], primitive[2], primitive[3]);
16
+ }
17
+ /**
18
+ * Creates an array of vectors from an array number arrays
19
+ * @param primitives A multi-dimensional array of number arrays
20
+ * ```
21
+ */
22
+ static fromArrays(primitives) {
23
+ return primitives.map(prim => new Vector4(prim[0], prim[1], prim[2], prim[3]));
24
+ }
25
+ static clone(v1) {
26
+ return Vector4.create(v1);
27
+ }
28
+ static add(v1, v2) {
29
+ if (typeof v2 === 'number')
30
+ return new Vector4(v1.x + v2, v1.y + v2, v1.z + v2, v1.w + v2);
31
+ return new Vector4(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z, v1.w + v2.w);
32
+ }
33
+ static subtract(v1, v2) {
34
+ if (typeof v2 === 'number')
35
+ return new Vector4(v1.x - v2, v1.y - v2, v1.z - v2, v1.w - v2);
36
+ return new Vector4(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z, v1.w - v2.w);
37
+ }
38
+ static multiply(v1, v2) {
39
+ if (typeof v2 === 'number')
40
+ return new Vector4(v1.x * v2, v1.y * v2, v1.z * v2, v1.w * v2);
41
+ return new Vector4(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z, v1.w * v2.w);
42
+ }
43
+ static divide(v1, v2) {
44
+ if (typeof v2 === 'number')
45
+ return new Vector4(v1.x / v2, v1.y / v2, v1.z / v2, v1.w / v2);
46
+ return new Vector4(v1.x / v2.x, v1.y / v2.y, v1.z / v2.z, v1.w / v2.w);
47
+ }
48
+ static dotProduct(v1, v2) {
49
+ return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z + v1.w * v2.w;
50
+ }
51
+ static crossProduct(v1, v2) {
52
+ const x = v1.y * v2.z - v1.z * v2.y;
53
+ const y = v1.z * v2.x - v1.x * v2.z;
54
+ const z = v1.x * v2.y - v1.y * v2.x;
55
+ return new Vector4(x, y, z, v1.w);
56
+ }
57
+ static normalize(v) {
58
+ return Vector4.divide(v, v.Length);
59
+ }
60
+ constructor(x, y, z, w) {
61
+ this.x = x;
62
+ this.y = y;
63
+ this.z = z;
64
+ this.w = w;
65
+ }
66
+ clone() {
67
+ return new Vector4(this.x, this.y, this.z, this.w);
68
+ }
69
+ /**
70
+ * The product of the Euclidean magnitudes of this and another Vector4.
71
+ *
72
+ * @param v Vector4 to find Euclidean magnitude between.
73
+ * @returns Euclidean magnitude with another vector.
74
+ */
75
+ distanceSquared(v) {
76
+ const w = this.subtract(v);
77
+ return Vector4.dotProduct(w, w);
78
+ }
79
+ /**
80
+ * The distance between two Vectors.
81
+ *
82
+ * @param v Vector4 to find distance between.
83
+ * @returns Distance between this and another vector.
84
+ */
85
+ distance(v) {
86
+ return Math.sqrt(this.distanceSquared(v));
87
+ }
88
+ get normalize() {
89
+ return Vector4.normalize(this);
90
+ }
91
+ crossProduct(v) {
92
+ return Vector4.crossProduct(this, v);
93
+ }
94
+ dotProduct(v) {
95
+ return Vector4.dotProduct(this, v);
96
+ }
97
+ add(v) {
98
+ return Vector4.add(this, v);
99
+ }
100
+ subtract(v) {
101
+ return Vector4.subtract(this, v);
102
+ }
103
+ multiply(v) {
104
+ return Vector4.multiply(this, v);
105
+ }
106
+ divide(v) {
107
+ return Vector4.divide(this, v);
108
+ }
109
+ toArray() {
110
+ return [this.x, this.y, this.z, this.w];
111
+ }
112
+ toVec3() {
113
+ return new Vector3(this.x, this.y, this.z);
114
+ }
115
+ replace(v) {
116
+ this.x = v.x;
117
+ this.y = v.y;
118
+ this.z = v.z;
119
+ this.w = v.w;
120
+ }
121
+ get Length() {
122
+ return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
123
+ }
124
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * EnumValues - iterate over enum values
3
+ * Just copy&paste from https://github.com/microsoft/TypeScript/issues/4753#issuecomment-694557208
4
+ *
5
+ * @param enumObj
6
+ */
7
+ export declare function enumValues<T extends string>(enumObj: {
8
+ [key: string]: T;
9
+ }): IterableIterator<T>;
10
+ export declare function enumValues<T extends string | number>(enumObj: {
11
+ [key: string]: T;
12
+ }): IterableIterator<Exclude<T, string>>;
@@ -0,0 +1,14 @@
1
+ export function* enumValues(enumObj) {
2
+ let isStringEnum = true;
3
+ for (const property in enumObj) {
4
+ if (typeof enumObj[property] === 'number') {
5
+ isStringEnum = false;
6
+ break;
7
+ }
8
+ }
9
+ for (const property in enumObj) {
10
+ if (isStringEnum || typeof enumObj[property] === 'number') {
11
+ yield enumObj[property];
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * get string from uint8 array
3
+ *
4
+ * @param buffer - Uint8Array
5
+ * @param start - The beginning of the specified portion of the array
6
+ * @param end - The end of the specified portion of the array
7
+ */
8
+ export declare const getStringFromUInt8Array: (buffer: Uint8Array, start: number, end: number) => string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * get string from uint8 array
3
+ *
4
+ * @param buffer - Uint8Array
5
+ * @param start - The beginning of the specified portion of the array
6
+ * @param end - The end of the specified portion of the array
7
+ */
8
+ export const getStringFromUInt8Array = (buffer, start, end) => String.fromCharCode(...buffer.slice(start, end))
9
+ // eslint-disable-next-line no-control-regex
10
+ .replace(/\u0000/g, '');
@@ -0,0 +1,8 @@
1
+ /**
2
+ * get uint32 from uint8 array
3
+ *
4
+ * @param buffer - Uint8Array
5
+ * @param start - The beginning of the specified portion of the array
6
+ * @param end - The end of the specified portion of the array
7
+ */
8
+ export declare const getUInt32FromUint8Array: (buffer: Uint8Array, start: number, end: number) => number;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * get uint32 from uint8 array
3
+ *
4
+ * @param buffer - Uint8Array
5
+ * @param start - The beginning of the specified portion of the array
6
+ * @param end - The end of the specified portion of the array
7
+ */
8
+ export const getUInt32FromUint8Array = (buffer, start, end) => new Uint32Array(buffer.slice(start, end).buffer)[0];
@@ -0,0 +1,10 @@
1
+ export { String } from './String';
2
+ export { LiteEvent } from './LiteEvent';
3
+ export { PointF } from './PointF';
4
+ export { Crypto } from './Crypto';
5
+ export { Point } from './Point';
6
+ export { Size } from './Size';
7
+ export { Color } from './Color';
8
+ export { Vector2, Vector3, Vector4, Maths, Quaternion, Delay, enumValues, getStringFromUInt8Array, getUInt32FromUint8Array, } from '@common/utils/index';
9
+ export declare const Wait: (milliseconds: number) => Promise<void>;
10
+ export * from './Animations';
@@ -0,0 +1,10 @@
1
+ export { String } from './String';
2
+ export { LiteEvent } from './LiteEvent';
3
+ export { PointF } from './PointF';
4
+ export { Crypto } from './Crypto';
5
+ export { Point } from './Point';
6
+ export { Size } from './Size';
7
+ export { Color } from './Color';
8
+ export { Vector2, Vector3, Vector4, Maths, Quaternion, Delay, enumValues, getStringFromUInt8Array, getUInt32FromUint8Array, } from '@common/utils/index';
9
+ export const Wait = (milliseconds) => new Promise(resolve => setTimeout(resolve, milliseconds));
10
+ export * from './Animations';
@@ -0,0 +1,43 @@
1
+ import { WeaponHash } from '../hashes';
2
+ /**
3
+ * DlcWeaponData
4
+ * refer1: https://github.com/citizenfx/fivem/blob/master/code/client/clrcore/External/DlcWeaponStructs.cs#L10
5
+ * refer2: https://docs.fivem.net/natives/?_0xBF0FD6E56C964FCB
6
+ *
7
+ * int emptyCheck; //use DLC1::_IS_DLC_DATA_EMPTY on this
8
+ * int padding1;
9
+ * int weaponHash;
10
+ * int padding2;
11
+ * int unk;
12
+ * int padding3;
13
+ * int weaponCost;
14
+ * int padding4;
15
+ * int ammoCost;
16
+ * int padding5;
17
+ * int ammoType;
18
+ * int padding6;
19
+ * int defaultClipSize;
20
+ * int padding7;
21
+ * char nameLabel[64];
22
+ * char descLabel[64];
23
+ * char desc2Label[64]; // usually "the" + name
24
+ * char upperCaseNameLabel[64];
25
+ *
26
+ */
27
+ export interface DlcWeaponData {
28
+ validCheck: number;
29
+ weaponHash: number;
30
+ unk: number;
31
+ weaponCost: number;
32
+ ammoCost: number;
33
+ ammoType: number;
34
+ defaultClipSize: number;
35
+ name: string;
36
+ desc: string;
37
+ simpleDesc: string;
38
+ upperCaseName: string;
39
+ }
40
+ /**
41
+ * DlcWeaponData - Mapping of WeaponHash -> DlcWeaponData
42
+ */
43
+ export declare const DlcWeaponData: Map<WeaponHash, DlcWeaponData>;
@@ -0,0 +1,44 @@
1
+ import { getUInt32FromUint8Array } from '../utils';
2
+ import { getStringFromUInt8Array } from '../utils';
3
+ /**
4
+ * DlcWeaponData - Mapping of WeaponHash -> DlcWeaponData
5
+ */
6
+ export const DlcWeaponData = new Map();
7
+ /**
8
+ * Initialize DlcWeaponData, avoid calling expansive native repeatedly
9
+ *
10
+ */
11
+ function initializeOnce() {
12
+ let isInitialized = false;
13
+ return function () {
14
+ if (isInitialized || IsDuplicityVersion()) {
15
+ return;
16
+ }
17
+ // magic number based on struct DlcWeaponData
18
+ const intLength = 4;
19
+ const strLength = 64;
20
+ const weaponCount = GetNumDlcWeapons();
21
+ for (let i = 0; i < weaponCount; i++) {
22
+ const buffer = new Uint8Array(14 * intLength + 4 * strLength);
23
+ // https://docs.fivem.net/natives/?_0x79923CD21BECE14E
24
+ Citizen.invokeNative('0x79923CD21BECE14E', i, buffer, Citizen.returnResultAnyway());
25
+ // noinspection PointlessArithmeticExpressionJS
26
+ const dlcWeaponData = {
27
+ validCheck: getUInt32FromUint8Array(buffer, 0 * intLength, 1 * intLength),
28
+ weaponHash: getUInt32FromUint8Array(buffer, 2 * intLength, 3 * intLength),
29
+ unk: getUInt32FromUint8Array(buffer, 4 * intLength, 5 * intLength),
30
+ weaponCost: getUInt32FromUint8Array(buffer, 6 * intLength, 7 * intLength),
31
+ ammoCost: getUInt32FromUint8Array(buffer, 8 * intLength, 9 * intLength),
32
+ ammoType: getUInt32FromUint8Array(buffer, 10 * intLength, 11 * intLength),
33
+ defaultClipSize: getUInt32FromUint8Array(buffer, 12 * intLength, 13 * intLength),
34
+ name: getStringFromUInt8Array(buffer, 14 * intLength, 14 * intLength + strLength),
35
+ desc: getStringFromUInt8Array(buffer, 14 * intLength + strLength, 14 * intLength + 2 * strLength),
36
+ simpleDesc: getStringFromUInt8Array(buffer, 14 * intLength + 2 * strLength, 14 * intLength + 3 * strLength),
37
+ upperCaseName: getStringFromUInt8Array(buffer, 14 * intLength + 3 * strLength, 14 * intLength + 4 * strLength),
38
+ };
39
+ DlcWeaponData.set(dlcWeaponData.weaponHash, dlcWeaponData);
40
+ }
41
+ isInitialized = true;
42
+ };
43
+ }
44
+ initializeOnce()();