@league-of-foundry-developers/foundry-vtt-types 9.238.0 → 9.249.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 (173) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/src/foundry/common/constants.mjs.d.ts +1 -0
  4. package/src/foundry/common/data/data.mjs/adventureData.d.ts +21 -21
  5. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +3 -3
  6. package/src/foundry/common/data/data.mjs/userData.d.ts +10 -3
  7. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +2 -4
  8. package/src/foundry/common/utils/geometry.mjs.d.ts +148 -0
  9. package/src/foundry/common/utils/helpers.mjs.d.ts +37 -37
  10. package/src/foundry/common/utils/module.mjs.d.ts +1 -0
  11. package/src/foundry/common/utils/primitives.mjs.d.ts +7 -0
  12. package/src/foundry/foundry.js/application.d.ts +138 -110
  13. package/src/foundry/foundry.js/applications/basePlaceableHUD.d.ts +2 -2
  14. package/src/foundry/foundry.js/applications/basePlaceableHUDs/drawingHUD.d.ts +2 -2
  15. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tileHUD.d.ts +2 -2
  16. package/src/foundry/foundry.js/applications/basePlaceableHUDs/tokenHUD.d.ts +3 -3
  17. package/src/foundry/foundry.js/applications/cameraViews.d.ts +2 -2
  18. package/src/foundry/foundry.js/applications/chatPopout.d.ts +3 -3
  19. package/src/foundry/foundry.js/applications/compendium.d.ts +2 -2
  20. package/src/foundry/foundry.js/applications/dialog.d.ts +1 -1
  21. package/src/foundry/foundry.js/applications/filePicker.d.ts +1 -1
  22. package/src/foundry/foundry.js/applications/formApplication.d.ts +45 -14
  23. package/src/foundry/foundry.js/applications/formApplications/avConfig.d.ts +1 -1
  24. package/src/foundry/foundry.js/applications/formApplications/combatTrackerConfig.d.ts +2 -2
  25. package/src/foundry/foundry.js/applications/formApplications/defaultTokenConfig.d.ts +1 -1
  26. package/src/foundry/foundry.js/applications/formApplications/documentSheet.d.ts +20 -31
  27. package/src/foundry/foundry.js/applications/formApplications/documentSheets/activeEffectConfig.d.ts +2 -2
  28. package/src/foundry/foundry.js/applications/formApplications/documentSheets/actorSheet.d.ts +1 -1
  29. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientLightConfig.d.ts +4 -4
  30. package/src/foundry/foundry.js/applications/formApplications/documentSheets/ambientSoundConfig.d.ts +4 -4
  31. package/src/foundry/foundry.js/applications/formApplications/documentSheets/combatantConfig.d.ts +3 -3
  32. package/src/foundry/foundry.js/applications/formApplications/documentSheets/folderConfig.d.ts +2 -2
  33. package/src/foundry/foundry.js/applications/formApplications/documentSheets/itemSheet.d.ts +1 -1
  34. package/src/foundry/foundry.js/applications/formApplications/documentSheets/journalSheet.d.ts +1 -1
  35. package/src/foundry/foundry.js/applications/formApplications/documentSheets/macroConfig.d.ts +3 -3
  36. package/src/foundry/foundry.js/applications/formApplications/documentSheets/measuredTemplateConfig.d.ts +3 -3
  37. package/src/foundry/foundry.js/applications/formApplications/documentSheets/noteConfig.d.ts +3 -3
  38. package/src/foundry/foundry.js/applications/formApplications/documentSheets/permissionControl.d.ts +2 -2
  39. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistConfig.d.ts +3 -3
  40. package/src/foundry/foundry.js/applications/formApplications/documentSheets/playlistSoundConfig.d.ts +3 -3
  41. package/src/foundry/foundry.js/applications/formApplications/documentSheets/rollTableConfig.d.ts +2 -2
  42. package/src/foundry/foundry.js/applications/formApplications/documentSheets/sceneConfig.d.ts +4 -4
  43. package/src/foundry/foundry.js/applications/formApplications/documentSheets/tileConfig.d.ts +2 -2
  44. package/src/foundry/foundry.js/applications/formApplications/documentSheets/userConfig.d.ts +7 -7
  45. package/src/foundry/foundry.js/applications/formApplications/drawingConfig.d.ts +1 -1
  46. package/src/foundry/foundry.js/applications/formApplications/entitySheetConfig.d.ts +3 -3
  47. package/src/foundry/foundry.js/applications/formApplications/gridConfig.d.ts +1 -1
  48. package/src/foundry/foundry.js/applications/formApplications/imagePopout.d.ts +1 -1
  49. package/src/foundry/foundry.js/applications/formApplications/keybindingsConfig.d.ts +2 -2
  50. package/src/foundry/foundry.js/applications/formApplications/moduleManagement.d.ts +2 -2
  51. package/src/foundry/foundry.js/applications/formApplications/permissionConfig.d.ts +2 -2
  52. package/src/foundry/foundry.js/applications/formApplications/settingsConfig.d.ts +1 -1
  53. package/src/foundry/foundry.js/applications/formApplications/tokenConfig.d.ts +3 -3
  54. package/src/foundry/foundry.js/applications/formApplications/wallConfig.d.ts +3 -3
  55. package/src/foundry/foundry.js/applications/formApplications/worldConfig.d.ts +1 -1
  56. package/src/foundry/foundry.js/applications/frameViewer.d.ts +1 -1
  57. package/src/foundry/foundry.js/applications/headsUpDisplay.d.ts +2 -2
  58. package/src/foundry/foundry.js/applications/hotbar.d.ts +2 -2
  59. package/src/foundry/foundry.js/applications/mainMenu.d.ts +2 -2
  60. package/src/foundry/foundry.js/applications/notifications.d.ts +7 -4
  61. package/src/foundry/foundry.js/applications/pause.d.ts +2 -2
  62. package/src/foundry/foundry.js/applications/playerList.d.ts +2 -2
  63. package/src/foundry/foundry.js/applications/sceneControls.d.ts +2 -2
  64. package/src/foundry/foundry.js/applications/sceneNavigation.d.ts +3 -3
  65. package/src/foundry/foundry.js/applications/sidebar.d.ts +2 -2
  66. package/src/foundry/foundry.js/applications/sidebarTab.d.ts +4 -7
  67. package/src/foundry/foundry.js/applications/sidebarTabs/chatLog.d.ts +3 -3
  68. package/src/foundry/foundry.js/applications/sidebarTabs/combatTracker.d.ts +26 -28
  69. package/src/foundry/foundry.js/applications/sidebarTabs/compendiumDirectory.d.ts +2 -2
  70. package/src/foundry/foundry.js/applications/sidebarTabs/settings.d.ts +2 -2
  71. package/src/foundry/foundry.js/applications/sidebarTabs/sidebarDirectory.d.ts +1 -1
  72. package/src/foundry/foundry.js/audioContainer.d.ts +28 -10
  73. package/src/foundry/foundry.js/canvas.d.ts +5 -0
  74. package/src/foundry/foundry.js/canvasAnimation.d.ts +30 -7
  75. package/src/foundry/foundry.js/clientDocumentMixin.d.ts +2 -1
  76. package/src/foundry/foundry.js/clientDocuments/card.d.ts +2 -1
  77. package/src/foundry/foundry.js/clientDocuments/cards.d.ts +4 -18
  78. package/src/foundry/foundry.js/clientDocuments/chatMessage.d.ts +2 -2
  79. package/src/foundry/foundry.js/clientDocuments/combat.d.ts +46 -44
  80. package/src/foundry/foundry.js/clientDocuments/combatant.d.ts +14 -17
  81. package/src/foundry/foundry.js/clientDocuments/folder.d.ts +15 -9
  82. package/src/foundry/foundry.js/clientDocuments/rollTable.d.ts +2 -2
  83. package/src/foundry/foundry.js/clientKeybindings.d.ts +12 -2
  84. package/src/foundry/foundry.js/clientSettings.d.ts +2 -2
  85. package/src/foundry/foundry.js/collections/documentCollection.d.ts +1 -1
  86. package/src/foundry/foundry.js/collections/documentCollections/worldCollections/folders.d.ts +1 -1
  87. package/src/foundry/foundry.js/collisionResult.d.ts +60 -0
  88. package/src/foundry/foundry.js/config.d.ts +38 -36
  89. package/src/foundry/foundry.js/dragDrop.d.ts +27 -34
  90. package/src/foundry/foundry.js/game.d.ts +89 -43
  91. package/src/foundry/foundry.js/hooks.d.ts +154 -85
  92. package/src/foundry/foundry.js/imageHelper.d.ts +26 -2
  93. package/src/foundry/foundry.js/keyboardManager.d.ts +2 -2
  94. package/src/foundry/foundry.js/pixi/containers/placeableObject.d.ts +2 -2
  95. package/src/foundry/foundry.js/pixi/containers/placeableObjects/token.d.ts +2 -2
  96. package/src/foundry/foundry.js/pixi/index.d.ts +3 -0
  97. package/src/foundry/foundry.js/pixi/meshes/index.d.ts +1 -0
  98. package/src/foundry/foundry.js/pixi/meshes/samplerMesh.d.ts +22 -0
  99. package/src/foundry/foundry.js/pixi/points/index.d.ts +1 -0
  100. package/src/foundry/foundry.js/pixi/points/wallEndpoint.d.ts +92 -0
  101. package/src/foundry/foundry.js/pixi/polygons/index.d.ts +2 -1
  102. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygon.d.ts +98 -0
  103. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/clockwiseSweepPolygon.d.ts +396 -0
  104. package/src/foundry/foundry.js/pixi/polygons/pointSourcePolygons/index.d.ts +1 -0
  105. package/src/foundry/foundry.js/pixi/rectangles/normalizedRectangle.d.ts +7 -0
  106. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShader.d.ts +11 -37
  107. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShader.d.ts +114 -0
  108. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveBackgroundShader.d.ts +57 -0
  109. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShader.d.ts +47 -0
  110. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/bewitchingWaveColorationShader.d.ts +6 -0
  111. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/chromaColorationShader.d.ts +6 -0
  112. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/emanationColorationShader.d.ts +6 -0
  113. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/energyFieldColorationShader.d.ts +6 -0
  114. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fairyLightColorationShader.d.ts +6 -0
  115. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/fogColorationShader.d.ts +6 -0
  116. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/ghostLightColorationShader.d.ts +1 -1
  117. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/hexaDomeColorationShader.d.ts +6 -0
  118. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/index.d.ts +5 -0
  119. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/lightDomeColorationShader.d.ts +6 -0
  120. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/pulseColorationShader.d.ts +1 -1
  121. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/radialRainbowColorationShader.d.ts +6 -0
  122. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/sunburstColorationShader.d.ts +1 -1
  123. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/swirlingRainbowColorationShader.d.ts +6 -0
  124. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/torchColorationShader.d.ts +3 -2
  125. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveColorationShaders/vortexColorationShader.d.ts +6 -0
  126. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardColorationShaders → adaptiveLightingShaders/adaptiveColorationShaders}/waveColorationShader.d.ts +1 -1
  127. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShader.d.ts +63 -0
  128. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/bewitchingWaveIlluminationShader.d.ts +6 -0
  129. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/blackHoleIlluminationShader.d.ts +1 -1
  130. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/fairyLightIlluminationShader.d.ts +6 -0
  131. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/ghostLightIlluminationShader.d.ts +1 -1
  132. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/index.d.ts +3 -0
  133. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/pulseIlluminationShader.d.ts +1 -1
  134. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/roilingIlluminationShader.d.ts +1 -1
  135. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/sunburstIlluminationShader.d.ts +1 -2
  136. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/torchIlluminationShader.d.ts +1 -1
  137. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/adaptiveIlluminationShaders/vortexIlluminationShader.d.ts +6 -0
  138. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/{standardIlluminationShaders → adaptiveLightingShaders/adaptiveIlluminationShaders}/waveIlluminationShader.d.ts +1 -1
  139. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/adaptiveLightingShaders/index.d.ts +5 -0
  140. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/baseSamplerShader.d.ts +22 -0
  141. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/index.d.ts +3 -4
  142. package/src/foundry/foundry.js/pixi/texts/preciseText.d.ts +10 -2
  143. package/src/foundry/foundry.js/pixi/transforms/index.d.ts +1 -0
  144. package/src/foundry/foundry.js/pixi/transforms/synchronizedTransform.d.ts +38 -0
  145. package/src/foundry/foundry.js/pointSource.d.ts +59 -328
  146. package/src/foundry/foundry.js/pointSources/index.d.ts +3 -0
  147. package/src/foundry/foundry.js/pointSources/lightSource.d.ts +417 -0
  148. package/src/foundry/foundry.js/pointSources/soundSource.d.ts +46 -0
  149. package/src/foundry/foundry.js/pointSources/visionSource.d.ts +125 -0
  150. package/src/foundry/foundry.js/polygonEdge.d.ts +26 -0
  151. package/src/foundry/foundry.js/polygonVertex.d.ts +89 -0
  152. package/src/foundry/foundry.js/quadtree.d.ts +2 -2
  153. package/src/foundry/foundry.js/quadtreeCulling.d.ts +11 -0
  154. package/src/foundry/foundry.js/ray.d.ts +156 -162
  155. package/src/foundry/foundry.js/rays/index.d.ts +1 -0
  156. package/src/foundry/foundry.js/rays/sightRay.d.ts +34 -0
  157. package/src/foundry/foundry.js/roll.d.ts +40 -43
  158. package/src/foundry/foundry.js/screenCulling.d.ts +19 -0
  159. package/src/foundry/foundry.js/searchFilter.d.ts +37 -33
  160. package/src/foundry/foundry.js/specialEffect.d.ts +1 -1
  161. package/src/foundry/foundry.js/textureLoader.d.ts +28 -18
  162. package/src/foundry/foundry.js/textureUtils.d.ts +5 -8
  163. package/src/foundry/foundry.js/videoHelper.d.ts +2 -1
  164. package/src/foundry/index.d.ts +26 -27
  165. package/src/foundry/foundry.js/pixi/polygons/sourcePolygon.d.ts +0 -25
  166. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShader.d.ts +0 -21
  167. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/chromaColorationShader.d.ts +0 -18
  168. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/emanationColorationShader.d.ts +0 -17
  169. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/energyFieldColorationShader.d.ts +0 -18
  170. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/fogColorationShader.d.ts +0 -17
  171. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/hexaDomeColorationShader.d.ts +0 -17
  172. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardColorationShaders/lightDomeColorationShader.d.ts +0 -17
  173. package/src/foundry/foundry.js/pixi/shaders/abstractBaseShaders/standardIlluminationShader.d.ts +0 -22
@@ -47,7 +47,8 @@ declare global {
47
47
  get source(): InstanceType<ConfiguredDocumentClassForName<'Cards'>> | undefined | null;
48
48
 
49
49
  /**
50
- * A convenience property for whether or not the Card is within its source Cards stack.
50
+ * A convenience property for whether or not the Card is within its source Cards stack. Cards in decks are always
51
+ * considered home.
51
52
  */
52
53
  get isHome(): boolean;
53
54
 
@@ -99,11 +99,8 @@ declare global {
99
99
  * Shuffle this Cards stack, randomizing the sort order of all the cards it contains.
100
100
  * @param options - (default: `{}`)
101
101
  * @returns The Cards document after the shuffle operation has completed
102
- * @remarks The returns documentaion is incorrect (https://gitlab.com/foundrynet/foundryvtt/-/issues/6367).
103
102
  */
104
- shuffle(
105
- options?: Cards.ShuffleOptions | undefined
106
- ): Promise<InstanceType<ConfiguredDocumentClassForName<'Card'>>[]>;
103
+ shuffle(options?: Cards.ShuffleOptions | undefined): Promise<InstanceType<ConfiguredDocumentClassForName<'Cards'>>>;
107
104
 
108
105
  /**
109
106
  * Reset the Cards stack, retrieving all original cards from other stacks where they may have been drawn if this is a
@@ -111,13 +108,8 @@ declare global {
111
108
  * @param options - Options which modify the reset operation
112
109
  * (default: `{}`)
113
110
  * @returns The Cards document after the reset operation has completed
114
- * @remarks The returns documentaion is incorrect (https://gitlab.com/foundrynet/foundryvtt/-/issues/6367).
115
111
  */
116
- reset(
117
- options?: Cards.ResetOptions | undefined
118
- ): Promise<
119
- InstanceType<ConfiguredDocumentClassForName<'Card'>>[] | InstanceType<ConfiguredDocumentClassForName<'Cards'>>
120
- >;
112
+ reset(options?: Cards.ResetOptions | undefined): Promise<InstanceType<ConfiguredDocumentClassForName<'Cards'>>>;
121
113
 
122
114
  /**
123
115
  * Perform a reset operation for a deck, retrieving all original cards from other stacks where they may have been
@@ -126,11 +118,10 @@ declare global {
126
118
  * (default: `{}`)
127
119
  * @returns The Cards document after the reset operation has completed.
128
120
  * @internal
129
- * @remarks The returns documentaion is incorrect (https://gitlab.com/foundrynet/foundryvtt/-/issues/6367).
130
121
  */
131
122
  protected _resetDeck(
132
123
  options?: Cards.ResetOptions | undefined
133
- ): Promise<InstanceType<ConfiguredDocumentClassForName<'Card'>>[]>;
124
+ ): Promise<InstanceType<ConfiguredDocumentClassForName<'Cards'>>>;
134
125
 
135
126
  /**
136
127
  * Return all cards in this stack to their original decks.
@@ -220,15 +211,10 @@ declare global {
220
211
  * Display a dialog which prompts the user to play a specific Card to some other Cards document
221
212
  * @see {@link Cards#pass}
222
213
  * @param card - The specific card being played as part of this dialog
223
- * @remarks returns documentation is incorrect.
224
214
  */
225
215
  playDialog(
226
216
  card: InstanceType<ConfiguredDocumentClassForName<'Card'>>
227
- ): Promise<
228
- | InstanceType<ConfiguredDocumentClassForName<'Card'>>[]
229
- | InstanceType<ConfiguredDocumentClassForName<'Cards'>>
230
- | null
231
- >;
217
+ ): Promise<InstanceType<ConfiguredDocumentClassForName<'Card'>>[] | void | null>;
232
218
 
233
219
  /**
234
220
  * Display a confirmation dialog for whether or not the user wishes to reset a Cards stack
@@ -74,14 +74,14 @@ declare global {
74
74
  */
75
75
  static applyRollMode(
76
76
  chatData: ChatMessageDataConstructorData,
77
- rollMode: foundry.CONST.DICE_ROLL_MODES
77
+ rollMode: keyof typeof CONFIG.Dice.rollModes | 'roll'
78
78
  ): ChatMessageDataConstructorData;
79
79
 
80
80
  /**
81
81
  * Update the data of a ChatMessage instance to apply a requested rollMode
82
82
  * @param rollMode - The rollMode preference to apply to this message data
83
83
  */
84
- applyRollMode(rollMode: foundry.CONST.DICE_ROLL_MODES): void;
84
+ applyRollMode(rollMode: keyof typeof CONFIG.Dice.rollModes | 'roll'): void;
85
85
 
86
86
  /**
87
87
  * Attempt to determine who is the speaking character (and token) for a certain Chat Message
@@ -1,7 +1,7 @@
1
- import { ConfiguredDocumentClass, PropertiesToSource } from '../../../types/helperTypes';
2
- import { DocumentModificationOptions } from '../../common/abstract/document.mjs';
3
- import { CombatantDataProperties } from '../../common/data/data.mjs/combatantData';
4
- import type { CombatDataConstructorData } from '../../common/data/data.mjs/combatData.js';
1
+ import type { ConfiguredDocumentClass, PropertiesToSource } from '../../../types/helperTypes';
2
+ import type { DocumentModificationOptions } from '../../common/abstract/document.mjs';
3
+ import type { ChatMessageDataConstructorData } from '../../common/data/data.mjs/chatMessageData.js';
4
+ import type { CombatantDataProperties } from '../../common/data/data.mjs/combatantData';
5
5
 
6
6
  declare global {
7
7
  /**
@@ -12,10 +12,11 @@ declare global {
12
12
  * @see {@link documents.Combats} The world-level collection of Combat documents
13
13
  * @see {@link embedded.Combatant} The Combatant embedded document which exists within a Combat document
14
14
  * @see {@link applications.CombatConfig} The Combat configuration application
15
- *
16
- * @param data - Initial data provided to construct the Combat document
17
15
  */
18
16
  class Combat extends ClientDocumentMixin(foundry.documents.BaseCombat) {
17
+ /**
18
+ * @param data - Initial data provided to construct the Combat document
19
+ */
19
20
  constructor(
20
21
  data?: ConstructorParameters<ConstructorOf<foundry.documents.BaseCombat>>[0],
21
22
  context?: ConstructorParameters<ConstructorOf<foundry.documents.BaseCombat>>[1]
@@ -33,6 +34,7 @@ declare global {
33
34
  /**
34
35
  * Track whether a sound notification is currently being played to avoid double-dipping
35
36
  * @defaultValue `false`
37
+ * @internal
36
38
  */
37
39
  protected _soundPlaying: boolean;
38
40
 
@@ -40,7 +42,7 @@ declare global {
40
42
  static CONFIG_SETTING: 'combatTrackerConfig';
41
43
 
42
44
  /** Get the Combatant who has the current turn. */
43
- get combatant(): this['turns'][number];
45
+ get combatant(): this['turns'][number] | undefined;
44
46
 
45
47
  /** The numeric round of the Combat encounter */
46
48
  get round(): number;
@@ -58,10 +60,13 @@ declare global {
58
60
  get started(): boolean;
59
61
 
60
62
  /** The numeric turn of the combat round in the Combat encounter */
61
- get turn(): number;
63
+ get turn(): number | null;
62
64
 
63
65
  get visible(): true;
64
66
 
67
+ /** Is this combat active in the current scene? */
68
+ get isActive(): boolean;
69
+
65
70
  /**
66
71
  * Set the current Combat encounter as active within the Scene.
67
72
  * Deactivate all other Combat encounters within the viewed Scene and set this one as active
@@ -78,7 +83,13 @@ declare global {
78
83
  * Get a Combatant using its Token id
79
84
  * @param tokenId - The id of the Token for which to acquire the combatant
80
85
  */
81
- getCombatantByToken(tokenId: string): ReturnType<this['combatants']['find']>;
86
+ getCombatantByToken(tokenId: string): InstanceType<ConfiguredDocumentClass<typeof Combatant>> | undefined;
87
+
88
+ /**
89
+ * Get a Combatant using its Actor id
90
+ * @param actorId - The id of the Actor for which to acquire the combatant
91
+ */
92
+ getCombatantByActor(actorId: string): InstanceType<ConfiguredDocumentClass<typeof Combatant>> | undefined;
82
93
 
83
94
  /** Advance the combat to the next round */
84
95
  nextRound(): Promise<this | undefined>;
@@ -95,15 +106,18 @@ declare global {
95
106
  /** Rewind the combat to the previous turn */
96
107
  previousTurn(): Promise<this | undefined>;
97
108
 
109
+ /** Toggle whether this combat is linked to the scene or globally available. */
110
+ toggleSceneLink(): Promise<this | undefined>;
111
+
98
112
  /** Reset all combatant initiative scores, setting the turn back to zero */
99
113
  resetAll(): Promise<this | undefined>;
100
114
 
101
115
  /**
102
- * Roll initiative for one or multiple Combatants within the Combat entity
103
- * @param ids - A Combatant id or Array of ids for which to roll
116
+ * Roll initiative for one or multiple Combatants within the Combat document
117
+ * @param ids - A Combatant id or Array of ids for which to roll
104
118
  * @param options - Additional options which modify how initiative rolls are created or presented.
105
119
  * default `{}`
106
- * @returns A promise which resolves to the updated Combat entity once updates are complete.
120
+ * @returns A promise which resolves to the updated Combat document once updates are complete.
107
121
  */
108
122
  rollInitiative(ids: string | string[], options?: InitiativeOptions): Promise<this>;
109
123
 
@@ -112,19 +126,19 @@ declare global {
112
126
  * @param options - Additional options forwarded to the Combat.rollInitiative method
113
127
  * default `{}`
114
128
  */
115
- rollAll(options?: InitiativeOptions): this['rollInitiative'];
129
+ rollAll(options?: InitiativeOptions): Promise<this>;
116
130
 
117
131
  /**
118
132
  * Roll initiative for all non-player actors who have not already rolled
119
133
  * @param options - Additional options forwarded to the Combat.rollInitiative method
120
134
  * default `{}`
121
135
  */
122
- rollNPC(options?: InitiativeOptions): this['rollInitiative'];
136
+ rollNPC(options?: InitiativeOptions): Promise<this>;
123
137
 
124
138
  /**
125
139
  * Assign initiative for a single Combatant within the Combat encounter.
126
140
  * Update the Combat turn order to maintain the same combatant as the current turn.
127
- * @param id - The combatant ID for which to set initiative
141
+ * @param id - The combatant ID for which to set initiative
128
142
  * @param value - A specific initiative value to set
129
143
  */
130
144
  setInitiative(id: string, value: number): Promise<void>;
@@ -139,66 +153,52 @@ declare global {
139
153
  * Define how the array of Combatants is sorted in the displayed list of the tracker.
140
154
  * This method can be overridden by a system or module which needs to display combatants in an alternative order.
141
155
  * By default sort by initiative, next falling back to name, lastly tie-breaking by combatant id.
156
+ * @internal
142
157
  */
143
158
  protected _sortCombatants(
144
159
  a: InstanceType<ConfiguredDocumentClass<typeof Combatant>>,
145
160
  b: InstanceType<ConfiguredDocumentClass<typeof Combatant>>
146
161
  ): number;
147
162
 
163
+ /** @override */
148
164
  protected _onCreate(data: this['data']['_source'], options: DocumentModificationOptions, userId: string): void;
149
165
 
166
+ /** @override */
150
167
  protected _onUpdate(
151
168
  changed: DeepPartial<this['data']['_source']>,
152
169
  options: DocumentModificationOptions,
153
170
  userId: string
154
- ): void; //TODO Returntype could also be CombatTracker.scrollToTurn
171
+ ): void;
155
172
 
173
+ /** @override */
156
174
  protected _onDelete(options: DocumentModificationOptions, userId: string): void;
157
175
 
176
+ /** @override */
158
177
  protected _onCreateEmbeddedDocuments(
159
- embeddedName: string,
160
- documents: Combatant[],
161
- result: DeepPartial<PropertiesToSource<CombatantDataProperties>>[],
178
+ type: string,
179
+ documents: InstanceType<ConfiguredDocumentClass<typeof Combatant>>[],
180
+ result: PropertiesToSource<CombatantDataProperties>[],
162
181
  options: DocumentModificationOptions,
163
182
  userId: string
164
183
  ): void;
165
184
 
185
+ /** @override */
166
186
  protected _onUpdateEmbeddedDocuments(
167
187
  embeddedName: string,
168
- documents: Combatant[],
169
- result: DeepPartial<PropertiesToSource<CombatantDataProperties>>[],
188
+ documents: InstanceType<ConfiguredDocumentClass<typeof Combatant>>[],
189
+ result: PropertiesToSource<CombatantDataProperties>[],
170
190
  options: DocumentModificationOptions,
171
191
  userId: string
172
192
  ): void;
173
193
 
194
+ /** @override */
174
195
  protected _onDeleteEmbeddedDocuments(
175
196
  embeddedName: string,
176
- documents: Combatant[],
197
+ documents: InstanceType<ConfiguredDocumentClass<typeof Combatant>>[],
177
198
  result: string[],
178
199
  options: DocumentModificationContext,
179
200
  userId: string
180
201
  ): void;
181
-
182
- /** @deprecated since 0.8.0 */
183
- getCombatant(id: string): this['combatants']['get'];
184
-
185
- /** @deprecated since 0.8.0 */
186
- createCombatant(
187
- data: CombatDataConstructorData | (CombatDataConstructorData & Record<string, unknown>),
188
- options?: DocumentModificationContext
189
- ): this['createEmbeddedDocuments'];
190
-
191
- /** @deprecated since 0.8.0 */
192
- updateCombatant(
193
- data: DeepPartial<CombatDataConstructorData | (CombatDataConstructorData & Record<string, unknown>)>,
194
- options?: DocumentModificationContext
195
- ): NonNullable<ReturnType<this['combatants']['get']>>['update'];
196
-
197
- /** @deprecated since 0.8.0 */
198
- deleteCombatant(
199
- id: string,
200
- options?: DocumentModificationContext
201
- ): NonNullable<ReturnType<this['combatants']['get']>>['delete'];
202
202
  }
203
203
  }
204
204
 
@@ -208,16 +208,18 @@ interface InitiativeOptions {
208
208
  * @defaultValue `null`
209
209
  */
210
210
  formula?: string | null;
211
+
211
212
  /**
212
213
  * Update the Combat turn after adding new initiative scores to keep the turn on the same Combatant.
213
214
  * @defaultValue `true`
214
215
  */
215
216
  updateTurn?: boolean;
217
+
216
218
  /**
217
219
  * Additional options with which to customize created Chat Messages
218
220
  * @defaultValue `{}`
219
221
  */
220
- messageOptions?: object; //TODO Type properly once ChatMessage is typed
222
+ messageOptions?: ChatMessageDataConstructorData;
221
223
  }
222
224
 
223
225
  interface RoundData {
@@ -1,5 +1,4 @@
1
1
  import { ConfiguredDocumentClass } from '../../../types/helperTypes';
2
- import { BaseUser } from '../../common/documents.mjs';
3
2
 
4
3
  declare global {
5
4
  /**
@@ -22,18 +21,6 @@ declare global {
22
21
  context: ConstructorParameters<typeof foundry.documents.BaseCombatant>[1]
23
22
  );
24
23
 
25
- /**
26
- * A cached reference to the Token which this Combatant represents, if any
27
- * @defaultValue `undefined`
28
- * */
29
- protected _token: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseToken>> | null | undefined;
30
-
31
- /**
32
- * A cached reference to the Actor which this Combatant represents, if any
33
- * @defaultValue `undefined`
34
- * */
35
- protected _actor: InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseActor>> | null | undefined;
36
-
37
24
  /** The current value of the special tracked resource which pertains to this Combatant */
38
25
  resource: `${number}` | number | boolean | null;
39
26
 
@@ -54,8 +41,8 @@ declare global {
54
41
  /** @override */
55
42
  get isOwner(): boolean;
56
43
 
57
- /** Is this Combatant entry currently visible in the Combat Tracker? */
58
- get isVisible(): boolean;
44
+ /** @override */
45
+ get visible(): boolean;
59
46
 
60
47
  /** Is this Combatant "hidden", either because they are explicitly marked as hidden or because their token is hidden */
61
48
  get hidden(): boolean;
@@ -72,9 +59,14 @@ declare global {
72
59
  /** An array of User documents who have ownership of this Document */
73
60
  get players(): InstanceType<ConfiguredDocumentClass<typeof foundry.documents.BaseUser>>[];
74
61
 
62
+ /**
63
+ * Has this combatant been marked as defeated?
64
+ */
65
+ get isDefeated(): boolean;
66
+
75
67
  /** @override */
76
68
  testUserPermission(
77
- user: BaseUser,
69
+ user: foundry.documents.BaseUser,
78
70
  permission: keyof typeof foundry.CONST.DOCUMENT_PERMISSION_LEVELS | foundry.CONST.DOCUMENT_PERMISSION_LEVELS,
79
71
  { exact }?: { exact?: boolean }
80
72
  ): boolean;
@@ -89,7 +81,7 @@ declare global {
89
81
  /**
90
82
  * Roll initiative for this particular combatant.
91
83
  * @param formula - A dice formula which overrides the default for this Combatant.
92
- * @returns The Roll instance to use for the combatant.
84
+ * @returns The updated Combatant.
93
85
  */
94
86
  rollInitiative(formula: string): Promise<this | undefined>;
95
87
 
@@ -107,6 +99,11 @@ declare global {
107
99
  * @returns The initiative formula to use for this combatant.
108
100
  */
109
101
  protected _getInitiativeFormula(): string;
102
+
103
+ /**
104
+ * @deprecated since v9
105
+ */
106
+ get isVisible(): boolean;
110
107
  }
111
108
  }
112
109
  export {};
@@ -1,6 +1,5 @@
1
- import { ConfiguredDocumentClass } from '../../../types/helperTypes';
1
+ import { ConfiguredDocumentClass, ConstructorDataType, DocumentConstructor } from '../../../types/helperTypes';
2
2
  import { DocumentModificationOptions } from '../../common/abstract/document.mjs';
3
- import type { FolderDataConstructorData } from '../../common/data/data.mjs/folderData.js';
4
3
 
5
4
  declare global {
6
5
  /**
@@ -65,14 +64,21 @@ declare global {
65
64
  * @returns An active FolderConfig instance for creating the new Folder entity
66
65
  *
67
66
  * @remarks
68
- * This actually returns a FolderConfig but that is incorrectly overriding
69
- * ClientDocumentMixin.createDialog, for which a Promise of the created
70
- * Document is returned.
67
+ * The documented return type is incorrect. It now returns a promise that resolves to the
68
+ * created folder as intended. See https://gitlab.com/foundrynet/foundryvtt/-/issues/6619
69
+ *
70
+ * For weird reasons, we need to make this generic.
71
71
  */
72
- static createDialog(
73
- data?: DeepPartial<FolderDataConstructorData | (FolderDataConstructorData & Record<string, unknown>)> | undefined,
74
- options?: Dialog.Options | undefined
75
- ): any;
72
+ static createDialog<T extends DocumentConstructor>(
73
+ this: T,
74
+ data?:
75
+ | DeepPartial<
76
+ | ConstructorDataType<InstanceType<T>['data']>
77
+ | (ConstructorDataType<InstanceType<T>['data']> & Record<string, unknown>)
78
+ >
79
+ | undefined,
80
+ options?: Partial<DocumentSheetOptions> | undefined
81
+ ): Promise<InstanceType<ConfiguredDocumentClass<T>> | null | undefined>;
76
82
 
77
83
  /**
78
84
  * Export all Documents contained in this Folder to a given Compendium pack.
@@ -158,7 +158,7 @@ declare global {
158
158
  /**
159
159
  * The chat roll mode to use when displaying the result
160
160
  */
161
- rollMode: foundry.CONST.DICE_ROLL_MODES;
161
+ rollMode: keyof CONFIG.Dice.RollModes | 'roll';
162
162
  }
163
163
 
164
164
  /**
@@ -180,7 +180,7 @@ declare global {
180
180
  * Additional options which customize the created messages
181
181
  * @defaultValue `{}`
182
182
  */
183
- messageOptions: ConstructorParameters<typeof foundry.documents.BaseChatMessage>[1];
183
+ messageOptions: DocumentModificationContext & { rollMode: keyof CONFIG.Dice.RollModes | 'roll' };
184
184
  }
185
185
 
186
186
  interface RollOptions {
@@ -240,11 +240,21 @@ declare class ClientKeybindings {
240
240
  protected _onPan(context: KeyboardEventContext, movementDirections: ClientKeybindings.MovementDirection[]): boolean;
241
241
 
242
242
  /**
243
- * Handle number key presses
243
+ * Handle Macro executions
244
244
  * @param context - The context data of the event
245
245
  * @internal
246
246
  */
247
- protected static _onMacro(context: KeyboardEventContext): true;
247
+ protected static _onMacroExecute(
248
+ context: KeyboardEventContext,
249
+ number: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
250
+ ): boolean;
251
+
252
+ /**
253
+ * Handle Macro page swaps
254
+ * @param context - The context data of the event
255
+ * @internal
256
+ */
257
+ protected static _onMacroPageSwap(context: KeyboardEventContext, page: number): true;
248
258
 
249
259
  /**
250
260
  * Handle action to copy data to clipboard
@@ -211,7 +211,7 @@ declare namespace ClientSettings {
211
211
  label?: string;
212
212
  name?: string;
213
213
  restricted: boolean;
214
- type: ConstructorOf<FormApplication<FormApplication.Options, object>>;
214
+ type: ConstructorOf<FormApplication<FormApplicationOptions, object>>;
215
215
  }
216
216
 
217
217
  interface RegisteredMenuSettings {
@@ -239,7 +239,7 @@ declare namespace ClientSettings {
239
239
  'core.nue.shownTips': boolean;
240
240
  'core.noCanvas': boolean;
241
241
  'core.permissions': Game.Permissions;
242
- 'core.rollMode': foundry.CONST.DICE_ROLL_MODES;
242
+ 'core.rollMode': keyof CONFIG.Dice.RollModes;
243
243
  'core.softShadows': boolean;
244
244
  'core.time': number;
245
245
  'core.tokenDragPreview': boolean;
@@ -39,7 +39,7 @@ declare global {
39
39
  /**
40
40
  * Render any Applications associated with this DocumentCollection.
41
41
  */
42
- render(force?: boolean, options?: Application.Options): void;
42
+ render(force?: boolean, options?: ApplicationOptions): void;
43
43
 
44
44
  /**
45
45
  * Update all objects in this DocumentCollection with a provided transformation.
@@ -19,7 +19,7 @@ declare global {
19
19
  static documentName: 'Folder';
20
20
 
21
21
  /** @override */
22
- render(force?: boolean, context?: Application.Options): void;
22
+ render(force?: boolean, context?: ApplicationOptions): void;
23
23
 
24
24
  /**
25
25
  * Refresh the display of any active JournalSheet instances where the folder list will change.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * An object containing the result of a collision test.
3
+ * @internal
4
+ */
5
+ declare class CollisionResult {
6
+ constructor(values?: {
7
+ target?: PolygonVertex | null;
8
+ collisions?: PolygonVertex[];
9
+ cwEdges?: EdgeSet;
10
+ ccwEdges?: EdgeSet;
11
+ isBehind?: boolean;
12
+ isLimited?: boolean;
13
+ isRequired?: boolean;
14
+ wasLimited?: boolean;
15
+ });
16
+
17
+ /**
18
+ * The vertex that was the target of this result
19
+ * @defaultValue `null`
20
+ */
21
+ target: PolygonVertex | null;
22
+
23
+ /**
24
+ * The array of collision points which apply to this result
25
+ * @defaultValue `[]`
26
+ */
27
+ collisions: PolygonVertex[];
28
+
29
+ /**
30
+ * The set of edges connected to the target vertex that continue clockwise
31
+ * @defaultValue `new Set()`
32
+ */
33
+ cwEdges: EdgeSet;
34
+
35
+ /**
36
+ * The set of edges connected to the target vertex that continue counter-clockwise
37
+ * @defaultValue `new Set()`
38
+ */
39
+ ccwEdges: EdgeSet;
40
+
41
+ /**
42
+ * Is the target vertex for this result behind some closer active edge?
43
+ */
44
+ isBehind: boolean | undefined;
45
+
46
+ /**
47
+ * Does the target vertex for this result impose a limited collision?
48
+ */
49
+ isLimited: boolean | undefined;
50
+
51
+ /**
52
+ * Is this result required due to a limited angle?
53
+ */
54
+ isRequired: boolean | undefined;
55
+
56
+ /**
57
+ * Has the set of collisions for this result encountered a limited edge?
58
+ */
59
+ wasLimited: boolean | undefined;
60
+ }