@league-of-foundry-developers/foundry-vtt-types 0.8.9-8 → 9.242.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.
Files changed (250) hide show
  1. package/README.md +44 -27
  2. package/index.d.ts +2 -2
  3. package/package.json +34 -15
  4. package/src/foundry/common/abstract/document.mjs.d.ts +24 -10
  5. package/src/foundry/common/config.mjs/index.d.ts +1 -0
  6. package/src/foundry/common/config.mjs/releaseData.d.ts +98 -0
  7. package/src/foundry/common/constants.mjs.d.ts +403 -213
  8. package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +36 -29
  9. package/src/foundry/common/data/data.mjs/actorData.d.ts +32 -21
  10. package/src/foundry/common/data/data.mjs/adventureData.d.ts +165 -0
  11. package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +45 -124
  12. package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +49 -77
  13. package/src/foundry/common/data/data.mjs/animationData.d.ts +17 -9
  14. package/src/foundry/common/data/data.mjs/cardData.d.ts +265 -0
  15. package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +66 -0
  16. package/src/foundry/common/data/data.mjs/cardsData.d.ts +238 -0
  17. package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +51 -39
  18. package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +18 -11
  19. package/src/foundry/common/data/data.mjs/combatData.d.ts +51 -25
  20. package/src/foundry/common/data/data.mjs/combatantData.d.ts +48 -30
  21. package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +8 -7
  22. package/src/foundry/common/data/data.mjs/drawingData.d.ts +68 -67
  23. package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +21 -25
  24. package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +24 -23
  25. package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +23 -16
  26. package/src/foundry/common/data/data.mjs/folderData.d.ts +28 -25
  27. package/src/foundry/common/data/data.mjs/index.d.ts +5 -0
  28. package/src/foundry/common/data/data.mjs/itemData.d.ts +26 -18
  29. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +24 -23
  30. package/src/foundry/common/data/data.mjs/lightData.d.ts +228 -0
  31. package/src/foundry/common/data/data.mjs/macroData.d.ts +52 -35
  32. package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +41 -38
  33. package/src/foundry/common/data/data.mjs/noteData.d.ts +47 -37
  34. package/src/foundry/common/data/data.mjs/playlistData.d.ts +55 -26
  35. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +32 -16
  36. package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +7 -11
  37. package/src/foundry/common/data/data.mjs/rollTableData.d.ts +30 -24
  38. package/src/foundry/common/data/data.mjs/sceneData.d.ts +132 -111
  39. package/src/foundry/common/data/data.mjs/settingData.d.ts +11 -8
  40. package/src/foundry/common/data/data.mjs/tableResultData.d.ts +30 -26
  41. package/src/foundry/common/data/data.mjs/tileData.d.ts +43 -36
  42. package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +10 -9
  43. package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +6 -3
  44. package/src/foundry/common/data/data.mjs/tokenData.d.ts +105 -157
  45. package/src/foundry/common/data/data.mjs/userData.d.ts +118 -33
  46. package/src/foundry/common/data/data.mjs/videoData.d.ts +9 -8
  47. package/src/foundry/common/data/data.mjs/wallData.d.ts +67 -39
  48. package/src/foundry/common/data/fields.mjs.d.ts +180 -83
  49. package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +9 -3
  50. package/src/foundry/common/documents.mjs/baseActor.d.ts +17 -45
  51. package/src/foundry/common/documents.mjs/baseAdventure.d.ts +38 -0
  52. package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +3 -0
  53. package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +3 -1
  54. package/src/foundry/common/documents.mjs/baseCard.d.ts +62 -0
  55. package/src/foundry/common/documents.mjs/baseCards.d.ts +39 -0
  56. package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +3 -0
  57. package/src/foundry/common/documents.mjs/baseCombat.d.ts +5 -2
  58. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +9 -2
  59. package/src/foundry/common/documents.mjs/baseDrawing.d.ts +11 -1
  60. package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +4 -3
  61. package/src/foundry/common/documents.mjs/baseFolder.d.ts +10 -1
  62. package/src/foundry/common/documents.mjs/baseItem.d.ts +11 -29
  63. package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +3 -0
  64. package/src/foundry/common/documents.mjs/baseMacro.d.ts +16 -14
  65. package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +4 -1
  66. package/src/foundry/common/documents.mjs/baseNote.d.ts +2 -2
  67. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +1 -0
  68. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +2 -1
  69. package/src/foundry/common/documents.mjs/baseRollTable.d.ts +3 -0
  70. package/src/foundry/common/documents.mjs/baseScene.d.ts +1 -0
  71. package/src/foundry/common/documents.mjs/baseSetting.d.ts +1 -0
  72. package/src/foundry/common/documents.mjs/baseTableResult.d.ts +10 -3
  73. package/src/foundry/common/documents.mjs/baseTile.d.ts +1 -0
  74. package/src/foundry/common/documents.mjs/baseToken.d.ts +3 -0
  75. package/src/foundry/common/documents.mjs/baseUser.d.ts +7 -1
  76. package/src/foundry/common/documents.mjs/baseWall.d.ts +7 -10
  77. package/src/foundry/common/documents.mjs/index.d.ts +3 -0
  78. package/src/foundry/common/module.mjs.d.ts +3 -0
  79. package/src/foundry/common/packages.mjs/moduleData.d.ts +12 -9
  80. package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +24 -24
  81. package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +27 -21
  82. package/src/foundry/common/packages.mjs/packageData.d.ts +108 -82
  83. package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +18 -11
  84. package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +16 -15
  85. package/src/foundry/common/packages.mjs/systemData.d.ts +21 -20
  86. package/src/foundry/common/packages.mjs/tagPackageAvailability.d.ts +3 -3
  87. package/src/foundry/common/packages.mjs/worldData.d.ts +29 -18
  88. package/src/foundry/common/types.mjs.d.ts +95 -0
  89. package/src/foundry/common/utils/geometry.mjs.d.ts +148 -0
  90. package/src/foundry/common/utils/helpers.mjs.d.ts +64 -39
  91. package/src/foundry/common/utils/module.mjs.d.ts +1 -0
  92. package/src/foundry/common/utils/primitives.mjs.d.ts +99 -16
  93. package/src/foundry/foundry.js/application.d.ts +2 -2
  94. package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
  95. package/src/foundry/foundry.js/applications/formApplication.d.ts +1 -1
  96. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +1 -1
  97. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +1 -1
  98. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
  99. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +104 -0
  100. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +1 -1
  101. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +1 -1
  102. package/src/foundry/foundry.js/applications/formApplications/documentSheets/index.d.ts +1 -0
  103. package/src/foundry/foundry.js/applications/formApplications/documentSheets/lightConfig.d.ts +5 -79
  104. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +1 -1
  105. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +2 -2
  106. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +5 -5
  107. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +1 -1
  108. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +5 -8
  109. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +3 -3
  110. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +1 -1
  111. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
  112. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
  113. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
  114. package/src/foundry/foundry.js/applications/formApplications/index.d.ts +1 -0
  115. package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +257 -0
  116. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +8 -9
  117. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +6 -6
  118. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +1 -1
  119. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +7 -6
  120. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  121. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/cardsDirectory.d.ts +7 -0
  122. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/index.d.ts +1 -0
  123. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectories/playlistDirectory.d.ts +2 -2
  124. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +2 -2
  125. package/src/foundry/foundry.js/audioContainer.d.ts +28 -10
  126. package/src/foundry/foundry.js/avSettings.d.ts +7 -7
  127. package/src/foundry/foundry.js/canvas.d.ts +148 -46
  128. package/src/foundry/foundry.js/canvasAnimation.d.ts +31 -8
  129. package/src/foundry/foundry.js/canvasDocumentMixin.d.ts +7 -0
  130. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +45 -91
  131. package/src/foundry/foundry.js/clientDocuments/activeEffect.d.ts +3 -2
  132. package/src/foundry/foundry.js/clientDocuments/actor.d.ts +3 -7
  133. package/src/foundry/foundry.js/clientDocuments/canvasDocuments/ambientSoundDocument.d.ts +1 -6
  134. package/src/foundry/foundry.js/clientDocuments/card.d.ts +133 -0
  135. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +375 -0
  136. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +11 -10
  137. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +46 -48
  138. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +15 -18
  139. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +4 -6
  140. package/src/foundry/foundry.js/clientDocuments/index.d.ts +2 -0
  141. package/src/foundry/foundry.js/clientDocuments/item.d.ts +3 -4
  142. package/src/foundry/foundry.js/clientDocuments/playlist.d.ts +4 -3
  143. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +2 -2
  144. package/src/foundry/foundry.js/clientDocuments/scene.d.ts +30 -23
  145. package/src/foundry/foundry.js/clientKeybindings.d.ts +309 -0
  146. package/src/foundry/foundry.js/clientSettings.d.ts +11 -9
  147. package/src/foundry/foundry.js/collections/documentCollections/compendiumCollection.d.ts +1 -1
  148. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/cardStacks.d.ts +9 -0
  149. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/index.d.ts +1 -0
  150. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/playlists.d.ts +3 -2
  151. package/src/foundry/foundry.js/collisionResult.d.ts +60 -0
  152. package/src/foundry/foundry.js/config.d.ts +484 -907
  153. package/src/foundry/foundry.js/dragDrop.d.ts +2 -2
  154. package/src/foundry/foundry.js/game.d.ts +171 -50
  155. package/src/foundry/foundry.js/gamepadManager.d.ts +41 -0
  156. package/src/foundry/foundry.js/handlebarsHelpers.d.ts +4 -4
  157. package/src/foundry/foundry.js/hooks.d.ts +210 -84
  158. package/src/foundry/foundry.js/imageHelper.d.ts +26 -2
  159. package/src/foundry/foundry.js/keyboardManager.d.ts +165 -213
  160. package/src/foundry/foundry.js/mouseManager.d.ts +18 -0
  161. package/src/foundry/foundry.js/newUserExperience.d.ts +34 -0
  162. package/src/foundry/foundry.js/pixi/containers/cachedContainer.d.ts +8 -0
  163. package/src/foundry/foundry.js/pixi/containers/cachedContainers/index.d.ts +1 -0
  164. package/src/foundry/foundry.js/pixi/containers/cachedContainers/primaryCanvasGroup.d.ts +42 -0
  165. package/src/foundry/foundry.js/pixi/containers/canvasLayers/gridLayer.d.ts +2 -2
  166. package/src/foundry/foundry.js/pixi/containers/canvasLayers/index.d.ts +1 -1
  167. package/src/foundry/foundry.js/pixi/containers/canvasLayers/placeablesLayers/wallsLayer.d.ts +3 -3
  168. package/src/foundry/foundry.js/pixi/containers/canvasLayers/{effectsLayer.d.ts → weatherLayer.d.ts} +7 -7
  169. package/src/foundry/foundry.js/pixi/containers/effectsCanvasGroup.d.ts +29 -0
  170. package/src/foundry/foundry.js/pixi/containers/index.d.ts +3 -0
  171. package/src/foundry/foundry.js/pixi/containers/interfaceCanvasGroup.d.ts +27 -0
  172. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +2 -2
  173. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +3 -3
  174. package/src/foundry/foundry.js/pixi/index.d.ts +1 -0
  175. package/src/foundry/foundry.js/pixi/points/index.d.ts +1 -0
  176. package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +92 -0
  177. package/src/foundry/foundry.js/pixi/polygons/index.d.ts +2 -1
  178. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +98 -0
  179. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +388 -0
  180. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/index.d.ts +1 -0
  181. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShader.d.ts +11 -37
  182. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShader.d.ts +114 -0
  183. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveBackgroundShader.d.ts +57 -0
  184. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShader.d.ts +47 -0
  185. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/bewitchingWaveColorationShader.d.ts +6 -0
  186. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/chromaColorationShader.d.ts +6 -0
  187. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/emanationColorationShader.d.ts +6 -0
  188. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/energyFieldColorationShader.d.ts +6 -0
  189. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fairyLightColorationShader.d.ts +6 -0
  190. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fogColorationShader.d.ts +6 -0
  191. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/ghostLightColorationShader.d.ts +1 -1
  192. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/hexaDomeColorationShader.d.ts +6 -0
  193. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/index.d.ts +5 -0
  194. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/lightDomeColorationShader.d.ts +6 -0
  195. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/pulseColorationShader.d.ts +1 -1
  196. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/radialRainbowColorationShader.d.ts +6 -0
  197. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/sunburstColorationShader.d.ts +1 -1
  198. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/swirlingRainbowColorationShader.d.ts +6 -0
  199. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/torchColorationShader.d.ts +3 -2
  200. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/vortexColorationShader.d.ts +6 -0
  201. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/waveColorationShader.d.ts +1 -1
  202. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShader.d.ts +63 -0
  203. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/bewitchingWaveIlluminationShader.d.ts +6 -0
  204. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/blackHoleIlluminationShader.d.ts +1 -1
  205. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/fairyLightIlluminationShader.d.ts +6 -0
  206. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/ghostLightIlluminationShader.d.ts +1 -1
  207. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/index.d.ts +3 -0
  208. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/pulseIlluminationShader.d.ts +1 -1
  209. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/roilingIlluminationShader.d.ts +1 -1
  210. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/sunburstIlluminationShader.d.ts +1 -2
  211. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/torchIlluminationShader.d.ts +1 -1
  212. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/vortexIlluminationShader.d.ts +6 -0
  213. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/waveIlluminationShader.d.ts +1 -1
  214. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/index.d.ts +5 -0
  215. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/baseSamplerShader.d.ts +22 -0
  216. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/index.d.ts +3 -4
  217. package/src/foundry/foundry.js/pixi/texts/preciseText.d.ts +10 -2
  218. package/src/foundry/foundry.js/pointSource.d.ts +59 -328
  219. package/src/foundry/foundry.js/pointSources/index.d.ts +3 -0
  220. package/src/foundry/foundry.js/pointSources/lightSource.d.ts +417 -0
  221. package/src/foundry/foundry.js/pointSources/soundSource.d.ts +46 -0
  222. package/src/foundry/foundry.js/pointSources/visionSource.d.ts +125 -0
  223. package/src/foundry/foundry.js/polygonEdge.d.ts +26 -0
  224. package/src/foundry/foundry.js/polygonVertex.d.ts +89 -0
  225. package/src/foundry/foundry.js/quadtreeCulling.d.ts +11 -0
  226. package/src/foundry/foundry.js/ray.d.ts +156 -162
  227. package/src/foundry/foundry.js/rays/index.d.ts +1 -0
  228. package/src/foundry/foundry.js/rays/sightRay.d.ts +34 -0
  229. package/src/foundry/foundry.js/roll.d.ts +49 -65
  230. package/src/foundry/foundry.js/rollTerm.d.ts +7 -4
  231. package/src/foundry/foundry.js/rollTerms/diceTerm.d.ts +4 -22
  232. package/src/foundry/foundry.js/rollTerms/mathTerm.d.ts +3 -0
  233. package/src/foundry/foundry.js/rollTerms/parentheticalTerm.d.ts +3 -0
  234. package/src/foundry/foundry.js/rollTerms/poolTerm.d.ts +3 -5
  235. package/src/foundry/foundry.js/rollTerms/stringTerm.d.ts +4 -1
  236. package/src/foundry/foundry.js/screenCulling.d.ts +19 -0
  237. package/src/foundry/foundry.js/searchFilter.d.ts +1 -1
  238. package/src/foundry/foundry.js/specialEffect.d.ts +1 -1
  239. package/src/foundry/foundry.js/textEditor.d.ts +1 -1
  240. package/src/foundry/index.d.ts +29 -26
  241. package/src/types/utils.d.ts +11 -3
  242. package/src/foundry/foundry.js/pixi/polygons/sourcePolygon.d.ts +0 -25
  243. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShader.d.ts +0 -21
  244. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/chromaColorationShader.d.ts +0 -18
  245. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/emanationColorationShader.d.ts +0 -17
  246. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/energyFieldColorationShader.d.ts +0 -18
  247. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/fogColorationShader.d.ts +0 -17
  248. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/hexaDomeColorationShader.d.ts +0 -17
  249. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/lightDomeColorationShader.d.ts +0 -17
  250. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardIlluminationShader.d.ts +0 -22
@@ -3,13 +3,13 @@ import * as fields from '../data/fields.mjs';
3
3
  import { PackageData, PackageDataConstructorData, PackageDataProperties, PackageDataSchema } from './packageData';
4
4
 
5
5
  interface WorldDataSchema extends Omit<PackageDataSchema, 'system'> {
6
- system: typeof fields.REQUIRED_STRING;
7
- background: typeof fields.STRING_FIELD;
8
- coreVersion: typeof fields.REQUIRED_STRING;
9
- nextSession: typeof fields.STRING_FIELD;
10
- resetKeys: typeof fields.BOOLEAN_FIELD;
11
- safeMode: typeof fields.BOOLEAN_FIELD;
12
- systemVersion: FieldReturnType<typeof fields.REQUIRED_STRING, { default: () => string }>;
6
+ system: fields.RequiredString;
7
+ background: fields.StringField;
8
+ coreVersion: fields.RequiredString;
9
+ nextSession: fields.StringField;
10
+ resetKeys: fields.BooleanField;
11
+ safeMode: fields.BooleanField;
12
+ systemVersion: FieldReturnType<fields.RequiredString, { default: () => string }>;
13
13
  }
14
14
 
15
15
  interface WorldDataProperties extends Omit<PackageDataProperties, 'system'> {
@@ -17,19 +17,24 @@ interface WorldDataProperties extends Omit<PackageDataProperties, 'system'> {
17
17
  system: string;
18
18
 
19
19
  /** A web URL or local file path which provides a background banner image */
20
- background?: string;
20
+ background: string | undefined;
21
21
 
22
22
  /** The version of the core software for which this world has been migrated */
23
23
  coreVersion: string;
24
24
 
25
25
  /** An ISO datetime string when the next game session is scheduled to occur */
26
- nextSession?: string;
26
+ nextSession: string | undefined;
27
27
 
28
+ /** @defaultValue `false` */
28
29
  resetKeys: boolean;
29
30
 
31
+ /** @defaultValue `false` */
30
32
  safeMode: boolean;
31
33
 
32
- /** The version of the game system for which this world has been migrated */
34
+ /**
35
+ * The version of the game system for which this world has been migrated
36
+ * @defaultValue `"0"`
37
+ */
33
38
  systemVersion: string;
34
39
  }
35
40
 
@@ -38,29 +43,35 @@ interface WorldDataConstructorData extends Omit<PackageDataConstructorData, 'sys
38
43
  system: string;
39
44
 
40
45
  /** A web URL or local file path which provides a background banner image */
41
- background?: string | null;
46
+ background?: string | null | undefined;
42
47
 
43
48
  /** The version of the core software for which this world has been migrated */
44
49
  coreVersion: string;
45
50
 
46
51
  /** An ISO datetime string when the next game session is scheduled to occur */
47
- nextSession?: string | null;
52
+ nextSession?: string | null | undefined;
48
53
 
49
- resetKeys?: boolean | null;
54
+ /** @defaultValue `false` */
55
+ resetKeys?: boolean | null | undefined;
50
56
 
51
- safeMode?: boolean | null;
57
+ /** @defaultValue `false` */
58
+ safeMode?: boolean | null | undefined;
52
59
 
53
- /** The version of the game system for which this world has been migrated */
54
- systemVersion?: string | null;
60
+ /**
61
+ * The version of the game system for which this world has been migrated
62
+ * @defaultValue `"0"`
63
+ */
64
+ systemVersion?: string | null | undefined;
55
65
  }
56
66
 
57
67
  /**
58
68
  * The data schema used to define World manifest files.
59
69
  * Extends the basic PackageData schema with some additional world-specific fields.
60
70
  */
61
- export declare class WorldData extends PackageData<WorldDataSchema, WorldDataProperties, WorldDataConstructorData> {
71
+ export class WorldData extends PackageData<WorldDataSchema, WorldDataProperties, WorldDataConstructorData> {
72
+ /** @override */
62
73
  static defineSchema(): WorldDataSchema;
63
74
  }
64
75
 
65
76
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
66
- export declare interface WorldData extends WorldDataProperties {}
77
+ export interface WorldData extends WorldDataProperties {}
@@ -20,6 +20,101 @@ declare type Rectangle =
20
20
  height: number;
21
21
  };
22
22
 
23
+ /** A Client Keybinding Action Configuration */
24
+ declare interface KeybindingActionConfig {
25
+ /** The namespace within which the action was registered */
26
+ namespace?: string;
27
+
28
+ /** The human readable name */
29
+ name: string;
30
+
31
+ /** An additional human readable hint */
32
+ hint?: string;
33
+
34
+ /** The default bindings that can never be changed nor removed. */
35
+ uneditable?: KeybindingActionBinding[];
36
+
37
+ /** The default bindings that can be changed by the user. */
38
+ editable?: KeybindingActionBinding[];
39
+
40
+ /** A function to execute when a key down event occurs. If True is returned, the event is consumed and no further keybinds execute. */
41
+ onDown?: () => boolean | void;
42
+
43
+ /** A function to execute when a key up event occurs. If True is returned, the event is consumed and no further keybinds execute. */
44
+ onUp?: () => boolean | void;
45
+
46
+ /** If True, allows Repeat events to execute the Action's onDown. Defaults to false. */
47
+ repeat?: boolean;
48
+
49
+ /** If true, only a GM can edit and execute this Action */
50
+ restricted?: boolean;
51
+
52
+ /** Modifiers such as [ "CONTROL" ] that can be also pressed when executing this Action. Prevents using one of these modifiers as a Binding. */
53
+ reservedModifiers?: string[];
54
+
55
+ /** The preferred precedence of running this Keybinding Action */
56
+ precedence?: number; // TODO: KEYBINDING_PRECEDENCE?
57
+
58
+ /** The recorded registration order of the action */
59
+ order?: number;
60
+ }
61
+
62
+ /** A Client Keybinding Action Binding */
63
+ declare interface KeybindingActionBinding {
64
+ /** The KeyboardEvent#code value from https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values */
65
+ key: string;
66
+
67
+ /** An array of modifiers keys from KeyboardManager.MODIFIER_KEYS which are required for this binding to be activated */
68
+ modifiers?: string[];
69
+ }
70
+
71
+ declare interface KeybindingAction {
72
+ action: string;
73
+ key: string;
74
+ name: string;
75
+ requiredModifiers: string[];
76
+ optionalModifiers: string[];
77
+ onDown: Function;
78
+ onUp: Function;
79
+ repeat: boolean;
80
+ restricted: boolean;
81
+ precedence: number;
82
+ order: number;
83
+ }
84
+
85
+ /** Keyboard event context */
86
+ declare interface KeyboardEventContext {
87
+ /** The normalized string key, such as "A" */
88
+ key: string;
89
+
90
+ /** The originating keypress event */
91
+ event: KeyboardEvent;
92
+
93
+ /** Is the Shift modifier being pressed */
94
+ isShift: boolean;
95
+
96
+ /** Is the Control or Meta modifier being processed */
97
+ isControl: boolean;
98
+
99
+ /** Is the Alt modifier being pressed */
100
+ isAlt: boolean;
101
+
102
+ /** Are any of the modifiers being pressed */
103
+ hasModifier: boolean;
104
+
105
+ /** A list of string modifiers applied to this context, such as [ "CONTROL" ] */
106
+ modifiers: string[];
107
+
108
+ /** True if the Key is Up, else False if down */
109
+ up: boolean;
110
+
111
+ /** True if the given key is being held down such that it is automatically repeating. */
112
+ repeat: boolean;
113
+
114
+ /** The executing Keybinding Action. May be undefined until the action is known. */
115
+ action: string | undefined;
116
+ }
117
+
23
118
  type RequestData = object | object[] | string | string[];
24
119
 
25
120
  interface SocketRequest {
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Determine the relative orientation of three points in two-dimensional space.
3
+ * The result is also an approximation of twice the signed area of the triangle defined by the three points.
4
+ * This method is fast - but not robust against issues of floating point precision. Best used with integer coordinates.
5
+ * Adapted from https://github.com/mourner/robust-predicates
6
+ *
7
+ * @param a - An endpoint of segment AB, relative to which point C is tested
8
+ * @param b - An endpoint of segment AB, relative to which point C is tested
9
+ * @param c - A point that is tested relative to segment AB
10
+ *
11
+ * @returns The relative orientation of points A, B, and C
12
+ * A positive value if the points are in counter-clockwise order (C lies to the left of AB)
13
+ * A negative value if the points are in clockwise order (C lies to the right of AB)
14
+ * Zero if the points A, B, and C are collinear.
15
+ */
16
+ export function orient2dFast(a: Point, b: Point, c: Point): number;
17
+
18
+ /**
19
+ * Quickly test whether the line segment AB intersects with the line segment CD.
20
+ * This method does not determine the point of intersection, for that use lineLineIntersection
21
+ *
22
+ * @param a - The first endpoint of segment AB
23
+ * @param b - The second endpoint of segment AB
24
+ * @param c - The first endpoint of segment CD
25
+ * @param d - The second endpoint of segment CD
26
+ *
27
+ * @returns Do the line segments intersect?
28
+ */
29
+ export function lineSegmentIntersects(a: Point, b: Point, c: Point, d: Point): boolean;
30
+
31
+ interface LineIntersection {
32
+ /** The x-coordinate of intersection */
33
+ x: number;
34
+
35
+ /** The y-coordinate of intersection */
36
+ y: number;
37
+
38
+ /** The vector distance from A to B on segment AB */
39
+ t0: number;
40
+
41
+ /** The vector distance from C to D on segment CD */
42
+ t1?: number;
43
+ }
44
+
45
+ /**
46
+ * An internal helper method for computing the intersection between two infinite-length lines.
47
+ * Adapted from http://paulbourke.net/geometry/pointlineplane/
48
+ *
49
+ * @param a - The first endpoint of segment AB
50
+ * @param b - The second endpoint of segment AB
51
+ * @param c - The first endpoint of segment CD
52
+ * @param d - The second endpoint of segment CD
53
+ *
54
+ * @returns An intersection point, or null if no intersection occurred
55
+ */
56
+ export function lineLineIntersection(a: Point, b: Point, c: Point, d: Point): LineIntersection | null;
57
+
58
+ /**
59
+ * An internal helper method for computing the intersection between two finite line segments.
60
+ * Adapted from http://paulbourke.net/geometry/pointlineplane/
61
+ *
62
+ * @param a - The first endpoint of segment AB
63
+ * @param b - The second endpoint of segment AB
64
+ * @param c - The first endpoint of segment CD
65
+ * @param d - The second endpoint of segment CD
66
+ * @param epsilon - A small epsilon which defines a tolerance for near-equality
67
+ * (default: `1e-8`)
68
+ *
69
+ * @returns An intersection point, or null if no intersection occurred
70
+ */
71
+ export function lineSegmentIntersection(
72
+ a: Point,
73
+ b: Point,
74
+ c: Point,
75
+ d: Point,
76
+ epsilon?: number
77
+ ): LineIntersection | null;
78
+
79
+ interface LineCircleIntersection {
80
+ /** Is point A inside the circle? */
81
+ aInside: boolean;
82
+
83
+ /** Is point B inside the circle? */
84
+ bInside: boolean;
85
+
86
+ /** Is the segment AB contained within the circle? */
87
+ contained: boolean;
88
+
89
+ /** Is the segment AB fully outside the circle? */
90
+ outside: boolean;
91
+
92
+ /** Is the segment AB tangent to the circle? */
93
+ tangent: boolean;
94
+
95
+ /** Intersection points: zero, one, or two */
96
+ intersections: [number] | [number, number] | [number, number, number];
97
+ }
98
+
99
+ /**
100
+ * Determine the intersection between a candidate wall and the circular radius of the polygon.
101
+ *
102
+ * @param a - The initial vertex of the candidate edge
103
+ * @param b - The second vertex of the candidate edge
104
+ * @param center - The center of the bounding circle
105
+ * @param radius - The radius of the bounding circle
106
+ * @param epsilon - A small tolerance for floating point precision
107
+ * (default: `1e-8`)
108
+ *
109
+ * @returns The intersection of the segment AB with the circle
110
+ */
111
+ export function lineCircleIntersection(
112
+ a: Point,
113
+ b: Point,
114
+ center: Point,
115
+ radius: number,
116
+ epsilon?: number
117
+ ): LineCircleIntersection;
118
+
119
+ /**
120
+ * Identify the point closest to C on segment AB
121
+ *
122
+ * @param c - The reference point C
123
+ * @param a - Point A on segment AB
124
+ * @param b - Point B on segment AB
125
+ *
126
+ * @returns The closest point to C on segment AB
127
+ */
128
+ export function closestPointToSegment(c: Point, a: Point, b: Point): Point;
129
+
130
+ /**
131
+ * Determine the points of intersection between a line segment (p0,p1) and a circle.
132
+ * There will be zero, one, or two intersections
133
+ * See https://math.stackexchange.com/a/311956
134
+ *
135
+ * @param p0 - The initial point of the line segment
136
+ * @param p1 - The terminal point of the line segment
137
+ * @param center - The center of the circle
138
+ * @param radius - The radius of the circle
139
+ * @param epsilon - A small tolerance for floating point precision
140
+ * (default: `0`)
141
+ */
142
+ export function quadraticIntersection(
143
+ p0: Point,
144
+ p1: Point,
145
+ center: Point,
146
+ radius: number,
147
+ epsilon?: number
148
+ ): { x: number; y: number }[];
@@ -2,8 +2,13 @@
2
2
  * Benchmark the performance of a function, calling it a requested number of iterations.
3
3
  * @param func - The function to benchmark
4
4
  * @param iterations - The number of iterations to test
5
+ * @param args - Additional arguments passed to the benchmarked function
5
6
  */
6
- export declare function benchmark(func: () => unknown, iterations: number): void;
7
+ export declare function benchmark<F extends (...args: any[]) => unknown>(
8
+ func: F,
9
+ iterations: number,
10
+ ...args: Parameters<F>
11
+ ): Promise<void>;
7
12
 
8
13
  /**
9
14
  * Wrap a callback in a debounced timeout.
@@ -22,9 +27,18 @@ export declare function debounce<T extends (...args: any[]) => unknown>(
22
27
  * This method DOES support recursive data structures containing inner objects or arrays.
23
28
  * This method DOES NOT support advanced object types like Set, Map, or other specialized classes.
24
29
  * @param original - Some sort of data
30
+ * @param options - Options to configure the behaviour of deepClone
25
31
  * @returns The clone of that data
26
32
  */
27
- export declare function deepClone<T>(original: T): T;
33
+ export declare function deepClone<T>(original: T, options?: DeepCloneOptions): T;
34
+
35
+ interface DeepCloneOptions {
36
+ /**
37
+ * Throw an Error if deepClone is unable to clone something instead of returning the original
38
+ * @defaultValue `false`
39
+ */
40
+ strict?: boolean;
41
+ }
28
42
 
29
43
  /**
30
44
  * Deeply difference an object against some other, returning the update keys and values
@@ -101,6 +115,17 @@ type InnerDuplicated<T> = T extends { toJSON(): infer U }
101
115
  */
102
116
  export type Duplicated<T> = T extends NonStringifiable ? never : InnerDuplicated<T>;
103
117
 
118
+ /**
119
+ * Test whether some class is a subclass of a parent.
120
+ * @param cls - The class to test
121
+ * @param parent - Some other class which may be a parent
122
+ * @returns Is the class a subclass of the parent?
123
+ */
124
+ export declare function isSubclass(
125
+ cls: new (...args: any[]) => unknown,
126
+ parent: new (...args: any[]) => unknown
127
+ ): boolean;
128
+
104
129
  /**
105
130
  * Encode a url-like string by replacing any characters which need encoding
106
131
  * @param path - A fully-qualified URL or url component (like a relative path)
@@ -233,43 +258,6 @@ export declare function isNewerVersion(v1: number | string, v0: number | string)
233
258
  */
234
259
  export declare function isObjectEmpty(obj: object): boolean;
235
260
 
236
- /**
237
- * Update a source object by replacing its keys and values with those from a target object.
238
- *
239
- * @param original - The initial object which should be updated with values from the target
240
- * @param other - A new object whose values should replace those in the source
241
- * (default: `{}`)
242
- * @param options - Additional options which configure the merge
243
- * (default: `{}`)
244
- * @param _d - A privately used parameter to track recursion depth.
245
- * (default: `0`)
246
- * @returns The original source object including updated, inserted, or overwritten records.
247
- *
248
- * @example <caption>Control how new keys and values are added</caption>
249
- * ```typescript
250
- * mergeObject({k1: "v1"}, {k2: "v2"}, {insertKeys: false}); // {k1: "v1"}
251
- * mergeObject({k1: "v1"}, {k2: "v2"}, {insertKeys: true}); // {k1: "v1", k2: "v2"}
252
- * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {insertValues: false}); // {k1: {i1: "v1"}}
253
- * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {insertValues: true}); // {k1: {i1: "v1", i2: "v2"}}
254
- * ```
255
- *
256
- * @example <caption>Control how existing data is overwritten</caption>
257
- * ```typescript
258
- * mergeObject({k1: "v1"}, {k1: "v2"}, {overwrite: true}); // {k1: "v2"}
259
- * mergeObject({k1: "v1"}, {k1: "v2"}, {overwrite: false}); // {k1: "v1"}
260
- * ```
261
- *
262
- * @example <caption>Control whether merges are performed recursively</caption>
263
- * ```typescript
264
- * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {recursive: false}); // {k1: {i1: "v2"}}
265
- * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {recursive: true}); // {k1: {i1: "v1", i2: "v2"}}
266
- * ```
267
- *
268
- * @example <caption>Deleting an existing object key</caption>
269
- * ```typescript
270
- * mergeObject({k1: "v1", k2: "v2"}, {"-=k1": null}); // {k2: "v2"}
271
- * ```
272
- */
273
261
  type OmitByValue<T, ValueType> = { [Key in keyof T as T[Key] extends ValueType ? never : Key]: T[Key] };
274
262
  type RemoveNever<T> = OmitByValue<T, never>;
275
263
  type PropWithMinus<K> = K extends string ? `-=${K}` : never;
@@ -308,6 +296,43 @@ type WithWidenedArrayTypes<T> = T extends Array<any>
308
296
  ? { [K in keyof T]: WithWidenedArrayTypes<T[K]> }
309
297
  : T;
310
298
 
299
+ /**
300
+ * Update a source object by replacing its keys and values with those from a target object.
301
+ *
302
+ * @param original - The initial object which should be updated with values from the target
303
+ * @param other - A new object whose values should replace those in the source
304
+ * (default: `{}`)
305
+ * @param options - Additional options which configure the merge
306
+ * (default: `{}`)
307
+ * @param _d - A privately used parameter to track recursion depth.
308
+ * (default: `0`)
309
+ * @returns The original source object including updated, inserted, or overwritten records.
310
+ *
311
+ * @example <caption>Control how new keys and values are added</caption>
312
+ * ```typescript
313
+ * mergeObject({k1: "v1"}, {k2: "v2"}, {insertKeys: false}); // {k1: "v1"}
314
+ * mergeObject({k1: "v1"}, {k2: "v2"}, {insertKeys: true}); // {k1: "v1", k2: "v2"}
315
+ * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {insertValues: false}); // {k1: {i1: "v1"}}
316
+ * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {insertValues: true}); // {k1: {i1: "v1", i2: "v2"}}
317
+ * ```
318
+ *
319
+ * @example <caption>Control how existing data is overwritten</caption>
320
+ * ```typescript
321
+ * mergeObject({k1: "v1"}, {k1: "v2"}, {overwrite: true}); // {k1: "v2"}
322
+ * mergeObject({k1: "v1"}, {k1: "v2"}, {overwrite: false}); // {k1: "v1"}
323
+ * ```
324
+ *
325
+ * @example <caption>Control whether merges are performed recursively</caption>
326
+ * ```typescript
327
+ * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {recursive: false}); // {k1: {i1: "v2"}}
328
+ * mergeObject({k1: {i1: "v1"}}, {k1: {i2: "v2"}}, {recursive: true}); // {k1: {i1: "v1", i2: "v2"}}
329
+ * ```
330
+ *
331
+ * @example <caption>Deleting an existing object key</caption>
332
+ * ```typescript
333
+ * mergeObject({k1: "v1", k2: "v2"}, {"-=k1": null}); // {k2: "v2"}
334
+ * ```
335
+ */
311
336
  export declare function mergeObject<
312
337
  T extends object,
313
338
  U extends DeepPartial<WithWidenedArrayTypes<T>>,
@@ -1,3 +1,4 @@
1
+ export * from './geometry.mjs';
1
2
  export * from './helpers.mjs';
2
3
  export { default as Collection } from './collection.mjs';
3
4
  export { default as Semaphore } from './semaphore.mjs';
@@ -1,4 +1,4 @@
1
- declare interface Math {
1
+ interface Math {
2
2
  /**
3
3
  * Bound a number between some minimum and maximum value, inclusively
4
4
  * @param num - The current value
@@ -44,7 +44,7 @@ declare interface Math {
44
44
  toRadians(angle: number): number;
45
45
  }
46
46
 
47
- declare interface Set<T> {
47
+ interface Set<T> {
48
48
  /**
49
49
  * Test whether this set is equal to some other set.
50
50
  * Sets are equal if they share the same members, independent of order
@@ -53,6 +53,26 @@ declare interface Set<T> {
53
53
  */
54
54
  equals(other: Set<T>): boolean;
55
55
 
56
+ /**
57
+ * Return the first value from the set.
58
+ * @returns The first element in the set, or undefined
59
+ */
60
+ first(): T | undefined;
61
+
62
+ /**
63
+ * Return the intersection of two sets.
64
+ * @param other - Some other set to compare against
65
+ * @returns The intersection of both sets
66
+ */
67
+ intersection(other: Set<T>): Set<T>;
68
+
69
+ /**
70
+ * Test whether this set has an intersection with another set.
71
+ * @param other - Another set to compare against
72
+ * @returns Do the sets intersect?
73
+ */
74
+ intersects(other: Set<T>): boolean;
75
+
56
76
  /**
57
77
  * Test whether this set is a subset of some other set.
58
78
  * A set is a subset if all its members are also present in the other set.
@@ -62,9 +82,15 @@ declare interface Set<T> {
62
82
  isSubset(other: Set<T>): boolean;
63
83
  }
64
84
 
65
- declare interface String {
85
+ interface String {
86
+ /**
87
+ * Capitalize a string, transforming it's first character to a capital letter
88
+ */
66
89
  capitalize<S extends string>(this: S): Capitalize<S>;
67
90
 
91
+ /**
92
+ * Convert a string to Title Case where the first letter of each word is capitalized
93
+ */
68
94
  titleCase<S extends string>(this: S): Titlecase<S>;
69
95
 
70
96
  /**
@@ -74,20 +100,59 @@ declare interface String {
74
100
 
75
101
  /**
76
102
  * Transform any string into a url-viable slug string
77
- * @param replacement - The replacement character to separate terms
78
- * (default: `'-'`)
79
- * @param strict - Replace all non-alphanumeric characters, or allow them?
80
- * (default: `false`)
103
+ * @param options - Optional arguments which customize how the slugify operation is performed
81
104
  * @returns The cleaned slug string
82
105
  */
83
- slugify({ replacement, strict }?: { replacement?: string; strict?: boolean }): string;
106
+ slugify(options?: String.SlugifyOptions): string;
107
+ }
108
+
109
+ declare namespace String {
110
+ interface SlugifyOptions {
111
+ /**
112
+ * The replacement character to separate terms
113
+ * @defaultValue `'-'`
114
+ */
115
+ replacement?: string;
116
+
117
+ /**
118
+ * Replace all non-alphanumeric characters, or allow them?
119
+ * @defaultValue `false`
120
+ */
121
+ strict?: boolean;
122
+ }
84
123
  }
85
124
 
86
- declare interface Number {
125
+ interface Number {
126
+ /**
127
+ * Test for near-equivalence of two numbers within some permitted epsilon
128
+ * @param n - Some other number
129
+ * @param e - Some permitted epsilon, by default 1e-8
130
+ (default: `1e-8`)
131
+ * @returns Are the numbers almost equal?
132
+ */
133
+ almostEqual(n: number, e?: number): boolean;
134
+
135
+ /**
136
+ * Transform a number to an ordinal string representation. i.e.
137
+ * ```
138
+ * 1 => 1st
139
+ * 2 => 2nd
140
+ * 3 => 3rd
141
+ * ```
142
+ */
87
143
  ordinalString(): string;
88
144
 
145
+ /**
146
+ * Return a string front-padded by zeroes to reach a certain number of numeral characters
147
+ * @param digits - The number of characters desired
148
+ * @returns The zero-padded number
149
+ */
89
150
  paddedString(digits: number): string;
90
151
 
152
+ /**
153
+ * Return a string prefaced by the sign of the number (+) or (-)
154
+ * @returns The signed number as a string
155
+ */
91
156
  signedString(): string;
92
157
 
93
158
  /**
@@ -110,10 +175,15 @@ declare interface Number {
110
175
  */
111
176
  toNearest(interval?: number, method?: 'round' | 'ceil' | 'floor'): number;
112
177
 
178
+ /**
179
+ * A faster numeric between check which avoids type coercion to the Number object
180
+ * Since this avoids coercion, if non-numbers are passed in unpredictable results will occur. Use with caution.
181
+ * @param inclusive - (default: `true`)
182
+ */
113
183
  between(a: number, b: number, inclusive?: boolean): boolean;
114
184
  }
115
185
 
116
- declare interface NumberConstructor {
186
+ interface NumberConstructor {
117
187
  /**
118
188
  * A faster numeric between check which avoids type coercion to the Number object
119
189
  * Since this avoids coercion, if non-numbers are passed in unpredictable results will occur. Use with caution.
@@ -123,19 +193,27 @@ declare interface NumberConstructor {
123
193
 
124
194
  /**
125
195
  * Test whether a value is numeric
126
- * This is the highest performing algorithm currently available
127
- * https://jsperf.com/isnan-vs-typeof/5
196
+ * This is the highest performing algorithm currently available, per https://jsperf.com/isnan-vs-typeof/5
128
197
  * @param n - A value to test
129
198
  * @returns Is it a number?
130
199
  */
131
200
  isNumeric(n: unknown): n is number;
132
201
  }
133
202
 
134
- declare interface ArrayConstructor {
203
+ interface ArrayConstructor {
204
+ /**
205
+ * Create and initialize an array of length n with integers from 0 to n-1
206
+ * @param n - The desired array length
207
+ * @returns An array of integers from 0 to n
208
+ */
135
209
  fromRange(n: number): number[];
136
210
  }
137
211
 
138
- declare interface Array<T> {
212
+ interface Array<T> {
213
+ /**
214
+ * Flatten nested arrays by concatenating their contents
215
+ * @returns An array containing the concatenated inner values
216
+ */
139
217
  deepFlatten(): Array<Array.Flattened<T>>;
140
218
 
141
219
  /**
@@ -171,7 +249,7 @@ declare namespace Array {
171
249
  type Flattened<T> = T extends Array<infer U> ? Flattened<U> : T;
172
250
  }
173
251
 
174
- declare interface Date {
252
+ interface Date {
175
253
  /**
176
254
  * Test whether a Date instance is valid.
177
255
  * A valid date returns a number for its timestamp, and NaN otherwise.
@@ -192,6 +270,11 @@ declare interface Date {
192
270
  toTimeInputString(): string;
193
271
  }
194
272
 
195
- declare interface RegExpConstructor {
273
+ interface RegExpConstructor {
274
+ /**
275
+ * Escape a given input string, prefacing special characters with backslashes for use in a regular expression
276
+ * @param string - The un-escaped input string
277
+ * @returns The escaped string, suitable for use in regular expression
278
+ */
196
279
  escape(string: string): string;
197
280
  }