@league-of-foundry-developers/foundry-vtt-types 12.331.4-beta → 12.331.5

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 (377) hide show
  1. package/package.json +18 -1
  2. package/src/configuration/configuration.d.mts +1 -1
  3. package/src/foundry/client/apps/app.d.mts +1 -1
  4. package/src/foundry/client/apps/av/av-config.d.mts +1 -1
  5. package/src/foundry/client/apps/av/cameras.d.mts +1 -1
  6. package/src/foundry/client/apps/dice/dice-config.d.mts +1 -1
  7. package/src/foundry/client/apps/form.d.mts +1 -1
  8. package/src/foundry/client/apps/forms/actor.d.mts +1 -1
  9. package/src/foundry/client/apps/forms/adventure-exporter.d.mts +1 -1
  10. package/src/foundry/client/apps/forms/adventure-importer.d.mts +1 -1
  11. package/src/foundry/client/apps/forms/base-sheet.d.mts +1 -1
  12. package/src/foundry/client/apps/forms/card-config.d.mts +1 -1
  13. package/src/foundry/client/apps/forms/cards-config.d.mts +1 -1
  14. package/src/foundry/client/apps/forms/combat-config.d.mts +1 -1
  15. package/src/foundry/client/apps/forms/effect-config.d.mts +1 -1
  16. package/src/foundry/client/apps/forms/folder-config.d.mts +7 -2
  17. package/src/foundry/client/apps/forms/fonts.d.mts +1 -1
  18. package/src/foundry/client/apps/forms/grid-config.d.mts +1 -1
  19. package/src/foundry/client/apps/forms/image-popout.d.mts +1 -1
  20. package/src/foundry/client/apps/forms/item.d.mts +1 -1
  21. package/src/foundry/client/apps/forms/journal-page-sheet.d.mts +1 -1
  22. package/src/foundry/client/apps/forms/journal-sheet.d.mts +1 -1
  23. package/src/foundry/client/apps/forms/macro-config.d.mts +1 -1
  24. package/src/foundry/client/apps/forms/measure-template.d.mts +1 -1
  25. package/src/foundry/client/apps/forms/ownership.d.mts +1 -1
  26. package/src/foundry/client/apps/forms/playlist-config.d.mts +1 -1
  27. package/src/foundry/client/apps/forms/playlist-sound-config.d.mts +1 -1
  28. package/src/foundry/client/apps/forms/roll-table-config.d.mts +1 -1
  29. package/src/foundry/client/apps/forms/scene-config.d.mts +1 -1
  30. package/src/foundry/client/apps/forms/sheet-config.d.mts +1 -1
  31. package/src/foundry/client/apps/forms/user-config.d.mts +1 -1
  32. package/src/foundry/client/apps/hud/chatbubble.d.mts +1 -1
  33. package/src/foundry/client/apps/hud/container.d.mts +1 -1
  34. package/src/foundry/client/apps/hud/controls.d.mts +1 -1
  35. package/src/foundry/client/apps/hud/hotbar.d.mts +1 -1
  36. package/src/foundry/client/apps/hud/hud.d.mts +1 -1
  37. package/src/foundry/client/apps/hud/menu.d.mts +1 -1
  38. package/src/foundry/client/apps/hud/navigation.d.mts +1 -1
  39. package/src/foundry/client/apps/hud/pause.d.mts +1 -1
  40. package/src/foundry/client/apps/hud/players.d.mts +1 -1
  41. package/src/foundry/client/apps/placeables/drawing-config.d.mts +1 -1
  42. package/src/foundry/client/apps/placeables/drawing-hud.d.mts +1 -1
  43. package/src/foundry/client/apps/placeables/note-config.d.mts +1 -1
  44. package/src/foundry/client/apps/placeables/tile-config.d.mts +1 -1
  45. package/src/foundry/client/apps/placeables/tile-hud.d.mts +1 -1
  46. package/src/foundry/client/apps/placeables/token-config.d.mts +1 -1
  47. package/src/foundry/client/apps/placeables/token-hud.d.mts +1 -1
  48. package/src/foundry/client/apps/placeables/wall-config.d.mts +1 -1
  49. package/src/foundry/client/apps/sidebar/apps/keybindings-config.d.mts +1 -1
  50. package/src/foundry/client/apps/sidebar/apps/module-management.d.mts +1 -1
  51. package/src/foundry/client/apps/sidebar/apps/support-details.d.mts +1 -1
  52. package/src/foundry/client/apps/sidebar/apps/tours-management.d.mts +1 -1
  53. package/src/foundry/client/apps/sidebar/apps/world-config.d.mts +1 -1
  54. package/src/foundry/client/apps/sidebar/directory-tab-mixin.d.mts +1 -1
  55. package/src/foundry/client/apps/sidebar/package-configuration.d.mts +1 -1
  56. package/src/foundry/client/apps/sidebar/sidebar.d.mts +1 -1
  57. package/src/foundry/client/apps/sidebar/tabs/actors-directory.d.mts +1 -1
  58. package/src/foundry/client/apps/sidebar/tabs/cards-directory.d.mts +1 -1
  59. package/src/foundry/client/apps/sidebar/tabs/chat-log.d.mts +1 -1
  60. package/src/foundry/client/apps/sidebar/tabs/combat-tracker.d.mts +1 -1
  61. package/src/foundry/client/apps/sidebar/tabs/compendium-directory.d.mts +1 -1
  62. package/src/foundry/client/apps/sidebar/tabs/items-directory.d.mts +1 -1
  63. package/src/foundry/client/apps/sidebar/tabs/journal-directory.d.mts +1 -1
  64. package/src/foundry/client/apps/sidebar/tabs/macros-directory.d.mts +1 -1
  65. package/src/foundry/client/apps/sidebar/tabs/playlists-directory.d.mts +1 -1
  66. package/src/foundry/client/apps/sidebar/tabs/roll-table-directory.d.mts +1 -1
  67. package/src/foundry/client/apps/sidebar/tabs/scenes-directory.d.mts +1 -1
  68. package/src/foundry/client/apps/sidebar/tabs/settings.d.mts +1 -1
  69. package/src/foundry/client/av/client.d.mts +1 -1
  70. package/src/foundry/client/av/clients/simplepeer.d.mts +1 -1
  71. package/src/foundry/client/av/master.d.mts +1 -1
  72. package/src/foundry/client/av/settings.d.mts +1 -1
  73. package/src/foundry/client/config.d.mts +1 -1
  74. package/src/foundry/client/core/hooks.d.mts +1 -1
  75. package/src/foundry/client/core/image.d.mts +1 -1
  76. package/src/foundry/client/core/keybindings.d.mts +1 -1
  77. package/src/foundry/client/core/packages.d.mts +4 -2
  78. package/src/foundry/client/core/settings.d.mts +1 -1
  79. package/src/foundry/client/core/socket.d.mts +1 -1
  80. package/src/foundry/client/core/tooltip.d.mts +1 -1
  81. package/src/foundry/client/core/tour.d.mts +1 -1
  82. package/src/foundry/client/core/utils.d.mts +1 -1
  83. package/src/foundry/client/core/workers.d.mts +1 -1
  84. package/src/foundry/client/data/abstract/canvas-document.d.mts +9 -20
  85. package/src/foundry/client/data/abstract/client-document.d.mts +133 -71
  86. package/src/foundry/client/data/abstract/directory-collection-mixin.d.mts +2 -2
  87. package/src/foundry/client/data/abstract/document-collection.d.mts +1 -1
  88. package/src/foundry/client/data/abstract/world-collection.d.mts +8 -1
  89. package/src/foundry/client/data/collections/actors.d.mts +1 -1
  90. package/src/foundry/client/data/collections/cards.d.mts +1 -1
  91. package/src/foundry/client/data/collections/combats.d.mts +1 -1
  92. package/src/foundry/client/data/collections/compendium-collection.d.mts +5 -4
  93. package/src/foundry/client/data/collections/fog.d.mts +1 -1
  94. package/src/foundry/client/data/collections/folder.d.mts +1 -1
  95. package/src/foundry/client/data/collections/items.d.mts +1 -1
  96. package/src/foundry/client/data/collections/journal.d.mts +1 -1
  97. package/src/foundry/client/data/collections/macros.d.mts +1 -1
  98. package/src/foundry/client/data/collections/messages.d.mts +1 -1
  99. package/src/foundry/client/data/collections/playlists.d.mts +1 -1
  100. package/src/foundry/client/data/collections/scenes.d.mts +1 -1
  101. package/src/foundry/client/data/collections/settings.d.mts +1 -1
  102. package/src/foundry/client/data/collections/tables.d.mts +1 -1
  103. package/src/foundry/client/data/collections/users.d.mts +4 -4
  104. package/src/foundry/client/data/documents/active-effect.d.mts +124 -48
  105. package/src/foundry/client/data/documents/actor-delta.d.mts +53 -22
  106. package/src/foundry/client/data/documents/actor.d.mts +147 -93
  107. package/src/foundry/client/data/documents/adventure.d.mts +74 -45
  108. package/src/foundry/client/data/documents/ambient-light.d.mts +13 -10
  109. package/src/foundry/client/data/documents/ambient-sound.d.mts +12 -7
  110. package/src/foundry/client/data/documents/card.d.mts +57 -34
  111. package/src/foundry/client/data/documents/cards.d.mts +171 -135
  112. package/src/foundry/client/data/documents/chat-message.d.mts +131 -72
  113. package/src/foundry/client/data/documents/combat.d.mts +80 -60
  114. package/src/foundry/client/data/documents/combatant.d.mts +53 -20
  115. package/src/foundry/client/data/documents/drawing.d.mts +12 -7
  116. package/src/foundry/client/data/documents/fog-exploration.d.mts +57 -17
  117. package/src/foundry/client/data/documents/folder.d.mts +114 -31
  118. package/src/foundry/client/data/documents/item.d.mts +31 -21
  119. package/src/foundry/client/data/documents/journal-entry-page.d.mts +90 -57
  120. package/src/foundry/client/data/documents/journal-entry.d.mts +29 -34
  121. package/src/foundry/client/data/documents/macro.d.mts +60 -34
  122. package/src/foundry/client/data/documents/measured-template.d.mts +13 -8
  123. package/src/foundry/client/data/documents/note.d.mts +14 -7
  124. package/src/foundry/client/data/documents/playlist-sound.d.mts +29 -33
  125. package/src/foundry/client/data/documents/playlist.d.mts +74 -54
  126. package/src/foundry/client/data/documents/region-behavior.d.mts +16 -7
  127. package/src/foundry/client/data/documents/region.d.mts +53 -48
  128. package/src/foundry/client/data/documents/scene.d.mts +310 -89
  129. package/src/foundry/client/data/documents/setting.d.mts +24 -23
  130. package/src/foundry/client/data/documents/table-result.d.mts +20 -8
  131. package/src/foundry/client/data/documents/table.d.mts +19 -13
  132. package/src/foundry/client/data/documents/tile.d.mts +13 -7
  133. package/src/foundry/client/data/documents/token.d.mts +148 -117
  134. package/src/foundry/client/data/documents/user.d.mts +141 -53
  135. package/src/foundry/client/data/documents/wall.d.mts +17 -10
  136. package/src/foundry/client/game.d.mts +1 -1
  137. package/src/foundry/client/head.d.mts +1 -1
  138. package/src/foundry/client/hooks.d.mts +9 -18
  139. package/src/foundry/client/pixi/board.d.mts +3 -2
  140. package/src/foundry/client/pixi/core/containers/base-canvas-group.d.mts +1 -1
  141. package/src/foundry/client/pixi/core/containers/cached-container.d.mts +1 -1
  142. package/src/foundry/client/pixi/core/containers/full-canvas-container.d.mts +1 -1
  143. package/src/foundry/client/pixi/core/containers/point-source-mesh.d.mts +1 -1
  144. package/src/foundry/client/pixi/core/containers/quad-mesh.d.mts +1 -1
  145. package/src/foundry/client/pixi/core/containers/quadtree.d.mts +1 -1
  146. package/src/foundry/client/pixi/core/containers/sprite-mesh.d.mts +1 -1
  147. package/src/foundry/client/pixi/core/containers/unbound-container.d.mts +1 -1
  148. package/src/foundry/client/pixi/core/interaction/canvas-animation.d.mts +1 -1
  149. package/src/foundry/client/pixi/core/interaction/control-icon.d.mts +1 -1
  150. package/src/foundry/client/pixi/core/interaction/mouse-handler.d.mts +1 -1
  151. package/src/foundry/client/pixi/core/interaction/ping.d.mts +1 -1
  152. package/src/foundry/client/pixi/core/interaction/pings/pulse.d.mts +1 -1
  153. package/src/foundry/client/pixi/core/interaction/render-flags.d.mts +1 -8
  154. package/src/foundry/client/pixi/core/interaction/resize-handle.d.mts +1 -1
  155. package/src/foundry/client/pixi/core/interaction/targets.d.mts +1 -1
  156. package/src/foundry/client/pixi/core/loader.d.mts +1 -1
  157. package/src/foundry/client/pixi/core/shapes/limited-angle-polygon.d.mts +1 -1
  158. package/src/foundry/client/pixi/core/shapes/polygon-mesher.d.mts +1 -1
  159. package/src/foundry/client/pixi/core/shapes/precise-text.d.mts +1 -1
  160. package/src/foundry/client/pixi/core/shapes/ray.d.mts +1 -1
  161. package/src/foundry/client/pixi/core/shapes/source-polygon.d.mts +1 -1
  162. package/src/foundry/client/pixi/extensions/circle.d.mts +1 -1
  163. package/src/foundry/client/pixi/extensions/observable-transform.d.mts +1 -1
  164. package/src/foundry/client/pixi/extensions/polygon.d.mts +1 -1
  165. package/src/foundry/client/pixi/extensions/rectangle.d.mts +1 -1
  166. package/src/foundry/client/pixi/groups/effects.d.mts +1 -1
  167. package/src/foundry/client/pixi/groups/environment.d.mts +1 -1
  168. package/src/foundry/client/pixi/groups/hidden.d.mts +1 -1
  169. package/src/foundry/client/pixi/groups/interface.d.mts +1 -1
  170. package/src/foundry/client/pixi/groups/overlay.d.mts +1 -1
  171. package/src/foundry/client/pixi/groups/primary.d.mts +1 -1
  172. package/src/foundry/client/pixi/groups/rendered.d.mts +1 -1
  173. package/src/foundry/client/pixi/layers/base/canvas-layer.d.mts +1 -1
  174. package/src/foundry/client/pixi/layers/base/interaction-layer.d.mts +1 -1
  175. package/src/foundry/client/pixi/layers/base/placeables-layer.d.mts +1 -1
  176. package/src/foundry/client/pixi/layers/controls/cursor.d.mts +1 -1
  177. package/src/foundry/client/pixi/layers/controls/door.d.mts +1 -1
  178. package/src/foundry/client/pixi/layers/controls/layer.d.mts +1 -1
  179. package/src/foundry/client/pixi/layers/controls/ruler.d.mts +1 -1
  180. package/src/foundry/client/pixi/layers/effects/background-effects.d.mts +1 -1
  181. package/src/foundry/client/pixi/layers/effects/coloration-effects.d.mts +1 -1
  182. package/src/foundry/client/pixi/layers/effects/darkness-effects.d.mts +1 -1
  183. package/src/foundry/client/pixi/layers/effects/illumination-effects.d.mts +1 -1
  184. package/src/foundry/client/pixi/layers/effects/visibility.d.mts +1 -1
  185. package/src/foundry/client/pixi/layers/effects/weather/particles/effect.d.mts +1 -1
  186. package/src/foundry/client/pixi/layers/effects/weather/particles/leaves.d.mts +1 -1
  187. package/src/foundry/client/pixi/layers/effects/weather-effects.d.mts +1 -1
  188. package/src/foundry/client/pixi/layers/grid/highlight.d.mts +1 -1
  189. package/src/foundry/client/pixi/layers/grid/layer.d.mts +1 -1
  190. package/src/foundry/client/pixi/layers/grid/mesh.d.mts +1 -1
  191. package/src/foundry/client/pixi/layers/masks/depth.d.mts +1 -1
  192. package/src/foundry/client/pixi/layers/masks/occlusion.d.mts +1 -1
  193. package/src/foundry/client/pixi/layers/masks/vision.d.mts +1 -1
  194. package/src/foundry/client/pixi/layers/placeables/drawings.d.mts +1 -1
  195. package/src/foundry/client/pixi/layers/placeables/lighting.d.mts +1 -1
  196. package/src/foundry/client/pixi/layers/placeables/notes.d.mts +1 -1
  197. package/src/foundry/client/pixi/layers/placeables/regions.d.mts +1 -1
  198. package/src/foundry/client/pixi/layers/placeables/sounds.d.mts +1 -1
  199. package/src/foundry/client/pixi/layers/placeables/templates.d.mts +1 -1
  200. package/src/foundry/client/pixi/layers/placeables/tiles.d.mts +1 -1
  201. package/src/foundry/client/pixi/layers/placeables/tokens.d.mts +1 -1
  202. package/src/foundry/client/pixi/layers/placeables/walls.d.mts +1 -1
  203. package/src/foundry/client/pixi/perception/clockwise-sweep.d.mts +1 -1
  204. package/src/foundry/client/pixi/perception/detection-mode.d.mts +1 -1
  205. package/src/foundry/client/pixi/perception/fog.d.mts +1 -1
  206. package/src/foundry/client/pixi/perception/perception-manager.d.mts +1 -1
  207. package/src/foundry/client/pixi/perception/vision-mode.d.mts +1 -1
  208. package/src/foundry/client/pixi/perception/weiler-atherton-clipping.d.mts +1 -1
  209. package/src/foundry/client/pixi/placeable.d.mts +2 -1
  210. package/src/foundry/client/pixi/placeables/drawing.d.mts +1 -1
  211. package/src/foundry/client/pixi/placeables/light.d.mts +1 -7
  212. package/src/foundry/client/pixi/placeables/note.d.mts +1 -1
  213. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-canvas-object.d.mts +1 -1
  214. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-graphics.d.mts +1 -1
  215. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-occludable-object.d.mts +1 -1
  216. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-sprite-mesh.d.mts +1 -1
  217. package/src/foundry/client/pixi/placeables/region.d.mts +1 -1
  218. package/src/foundry/client/pixi/placeables/sound.d.mts +1 -1
  219. package/src/foundry/client/pixi/placeables/template.d.mts +1 -1
  220. package/src/foundry/client/pixi/placeables/tile.d.mts +1 -1
  221. package/src/foundry/client/pixi/placeables/token.d.mts +1 -1
  222. package/src/foundry/client/pixi/placeables/wall.d.mts +1 -1
  223. package/src/foundry/client/pixi/webgl/extensions/batch-renderer.d.mts +1 -1
  224. package/src/foundry/client/pixi/webgl/extensions/batch-shader-generator.d.mts +1 -1
  225. package/src/foundry/client/pixi/webgl/helpers/framebuffer-snapshot.d.mts +1 -1
  226. package/src/foundry/client/pixi/webgl/helpers/smooth-noise.d.mts +1 -1
  227. package/src/foundry/client/pixi/webgl/helpers/texture-extractor.d.mts +1 -1
  228. package/src/foundry/client/pixi/webgl/shaders/base-shader-mixin.d.mts +1 -1
  229. package/src/foundry/client/pixi/webgl/shaders/base-shader.d.mts +1 -1
  230. package/src/foundry/client/pixi/webgl/shaders/filters/base-filter.d.mts +1 -1
  231. package/src/foundry/client/pixi/webgl/shaders/filters/effects-masking.d.mts +1 -1
  232. package/src/foundry/client/pixi/webgl/shaders/filters/glow-overlay.d.mts +1 -1
  233. package/src/foundry/client/pixi/webgl/shaders/filters/outline-overlay.d.mts +1 -1
  234. package/src/foundry/client/pixi/webgl/shaders/filters/transition.d.mts +1 -1
  235. package/src/foundry/client/pixi/webgl/shaders/filters/visibility.d.mts +1 -1
  236. package/src/foundry/client/pixi/webgl/shaders/filters/vision-mask-filter.d.mts +1 -1
  237. package/src/foundry/client/pixi/webgl/shaders/fragment-channel-mixin.d.mts +1 -1
  238. package/src/foundry/client/pixi/webgl/shaders/grid/grid.d.mts +1 -1
  239. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/fairy-light.d.mts +1 -1
  240. package/src/foundry/client/pixi/webgl/shaders/samplers/base-sampler.d.mts +1 -1
  241. package/src/foundry/client/pixi/webgl/shaders/samplers/token-ring.d.mts +1 -1
  242. package/src/foundry/client/pixi/webgl/shaders/weather/base-weather.d.mts +1 -1
  243. package/src/foundry/client/pixi/webgl/shaders/weather/effect.d.mts +1 -1
  244. package/src/foundry/client/pixi/workers/texture-worker.d.mts +1 -1
  245. package/src/foundry/client/ui/context.d.mts +1 -1
  246. package/src/foundry/client/ui/dialog.d.mts +1 -1
  247. package/src/foundry/client/ui/dragdrop.d.mts +1 -1
  248. package/src/foundry/client/ui/editor.d.mts +1 -1
  249. package/src/foundry/client/ui/filepicker.d.mts +1 -1
  250. package/src/foundry/client/ui/filter.d.mts +1 -1
  251. package/src/foundry/client-esm/applications/api/application.d.mts +1 -9
  252. package/src/foundry/client-esm/applications/api/dialog.d.mts +1 -1
  253. package/src/foundry/client-esm/applications/api/document-sheet.d.mts +1 -1
  254. package/src/foundry/client-esm/applications/api/handlebars-application.d.mts +1 -1
  255. package/src/foundry/client-esm/applications/apps/compendium-art-config.d.mts +1 -1
  256. package/src/foundry/client-esm/applications/apps/permission-config.d.mts +1 -1
  257. package/src/foundry/client-esm/applications/dice/roll-resolver.d.mts +1 -1
  258. package/src/foundry/client-esm/applications/forms/fields.d.mts +1 -1
  259. package/src/foundry/client-esm/applications/sheets/actor-sheet.d.mts +1 -1
  260. package/src/foundry/client-esm/applications/sheets/ambient-light-config.d.mts +1 -1
  261. package/src/foundry/client-esm/applications/sheets/ambient-sound-config.d.mts +1 -1
  262. package/src/foundry/client-esm/applications/sheets/item-sheet.d.mts +1 -1
  263. package/src/foundry/client-esm/applications/sheets/region-behavior-config.d.mts +1 -1
  264. package/src/foundry/client-esm/applications/sheets/region-config.d.mts +1 -1
  265. package/src/foundry/client-esm/applications/sheets/user-config.d.mts +1 -1
  266. package/src/foundry/client-esm/applications/ui/region-legend.d.mts +1 -1
  267. package/src/foundry/client-esm/audio/biquad.d.mts +1 -1
  268. package/src/foundry/client-esm/audio/convolver.d.mts +1 -1
  269. package/src/foundry/client-esm/audio/helper.d.mts +1 -1
  270. package/src/foundry/client-esm/audio/sound.d.mts +2 -2
  271. package/src/foundry/client-esm/canvas/edges/collision.d.mts +1 -1
  272. package/src/foundry/client-esm/canvas/edges/edge.d.mts +1 -1
  273. package/src/foundry/client-esm/canvas/edges/vertex.d.mts +1 -1
  274. package/src/foundry/client-esm/canvas/scene-manager.d.mts +1 -1
  275. package/src/foundry/client-esm/canvas/smaa/smaa.d.mts +1 -1
  276. package/src/foundry/client-esm/canvas/sources/base-effect-source.d.mts +1 -1
  277. package/src/foundry/client-esm/canvas/sources/base-light-source.d.mts +1 -1
  278. package/src/foundry/client-esm/canvas/sources/global-light-source.d.mts +1 -1
  279. package/src/foundry/client-esm/canvas/sources/point-darkness-source.d.mts +1 -1
  280. package/src/foundry/client-esm/canvas/sources/point-effect-source.d.mts +1 -1
  281. package/src/foundry/client-esm/canvas/sources/point-light-source.d.mts +1 -1
  282. package/src/foundry/client-esm/canvas/sources/point-sound-source.d.mts +1 -1
  283. package/src/foundry/client-esm/canvas/sources/point-vision-source.d.mts +1 -1
  284. package/src/foundry/client-esm/canvas/sources/rendered-effect-source.d.mts +1 -1
  285. package/src/foundry/client-esm/canvas/tokens/ring-data.d.mts +3 -2
  286. package/src/foundry/client-esm/canvas/tokens/ring.d.mts +1 -1
  287. package/src/foundry/client-esm/data/client-backend.d.mts +1 -1
  288. package/src/foundry/client-esm/data/region-behaviors/adjust-darkness-level.d.mts +4 -5
  289. package/src/foundry/client-esm/data/region-behaviors/base.d.mts +1 -1
  290. package/src/foundry/client-esm/data/region-behaviors/display-scrolling-text.d.mts +1 -1
  291. package/src/foundry/client-esm/data/region-behaviors/toggle-behavior.d.mts +4 -4
  292. package/src/foundry/client-esm/dice/roll.d.mts +5 -8
  293. package/src/foundry/client-esm/dice/terms/coin.d.mts +1 -1
  294. package/src/foundry/client-esm/dice/terms/dice.d.mts +1 -1
  295. package/src/foundry/client-esm/dice/terms/die.d.mts +1 -1
  296. package/src/foundry/client-esm/dice/terms/fate.d.mts +1 -1
  297. package/src/foundry/client-esm/dice/terms/function.d.mts +1 -1
  298. package/src/foundry/client-esm/dice/terms/numeric.d.mts +1 -1
  299. package/src/foundry/client-esm/dice/terms/operator.d.mts +1 -1
  300. package/src/foundry/client-esm/dice/terms/parenthetical.d.mts +1 -1
  301. package/src/foundry/client-esm/dice/terms/pool.d.mts +1 -1
  302. package/src/foundry/client-esm/dice/terms/string.d.mts +1 -1
  303. package/src/foundry/client-esm/dice/terms/term.d.mts +1 -1
  304. package/src/foundry/common/abstract/backend.d.mts +1 -1
  305. package/src/foundry/common/abstract/data.d.mts +197 -146
  306. package/src/foundry/common/abstract/document.d.mts +198 -81
  307. package/src/foundry/common/abstract/embedded-collection-delta.d.mts +1 -1
  308. package/src/foundry/common/abstract/embedded-collection.d.mts +1 -1
  309. package/src/foundry/common/abstract/socket.d.mts +1 -1
  310. package/src/foundry/common/abstract/type-data.d.mts +4 -1
  311. package/src/foundry/common/config.d.mts +7 -1
  312. package/src/foundry/common/constants.d.mts +1 -1
  313. package/src/foundry/common/data/data.d.mts +42 -12
  314. package/src/foundry/common/data/fields.d.mts +656 -252
  315. package/src/foundry/common/documents/_types.d.mts +0 -6
  316. package/src/foundry/common/documents/active-effect.d.mts +116 -53
  317. package/src/foundry/common/documents/actor-delta.d.mts +139 -58
  318. package/src/foundry/common/documents/actor.d.mts +105 -51
  319. package/src/foundry/common/documents/adventure.d.mts +84 -39
  320. package/src/foundry/common/documents/ambient-light.d.mts +66 -38
  321. package/src/foundry/common/documents/ambient-sound.d.mts +66 -38
  322. package/src/foundry/common/documents/card.d.mts +100 -59
  323. package/src/foundry/common/documents/cards.d.mts +97 -42
  324. package/src/foundry/common/documents/chat-message.d.mts +105 -52
  325. package/src/foundry/common/documents/combat.d.mts +101 -48
  326. package/src/foundry/common/documents/combatant.d.mts +94 -50
  327. package/src/foundry/common/documents/drawing.d.mts +87 -46
  328. package/src/foundry/common/documents/fog-exploration.d.mts +87 -41
  329. package/src/foundry/common/documents/folder.d.mts +100 -46
  330. package/src/foundry/common/documents/item.d.mts +116 -45
  331. package/src/foundry/common/documents/journal-entry-page.d.mts +90 -40
  332. package/src/foundry/common/documents/journal-entry.d.mts +90 -39
  333. package/src/foundry/common/documents/macro.d.mts +116 -52
  334. package/src/foundry/common/documents/measured-template.d.mts +80 -44
  335. package/src/foundry/common/documents/note.d.mts +75 -39
  336. package/src/foundry/common/documents/playlist-sound.d.mts +88 -47
  337. package/src/foundry/common/documents/playlist.d.mts +101 -50
  338. package/src/foundry/common/documents/region-behavior.d.mts +71 -40
  339. package/src/foundry/common/documents/region.d.mts +68 -40
  340. package/src/foundry/common/documents/roll-table.d.mts +43 -9
  341. package/src/foundry/common/documents/scene.d.mts +190 -43
  342. package/src/foundry/common/documents/setting.d.mts +98 -42
  343. package/src/foundry/common/documents/table-result.d.mts +98 -48
  344. package/src/foundry/common/documents/tile.d.mts +77 -43
  345. package/src/foundry/common/documents/token.d.mts +95 -52
  346. package/src/foundry/common/documents/user.d.mts +100 -89
  347. package/src/foundry/common/documents/wall.d.mts +47 -17
  348. package/src/foundry/common/grid/base.d.mts +1 -1
  349. package/src/foundry/common/grid/gridless.d.mts +1 -1
  350. package/src/foundry/common/grid/hexagonal.d.mts +1 -1
  351. package/src/foundry/common/grid/square.d.mts +1 -1
  352. package/src/foundry/common/packages/base-package.d.mts +37 -14
  353. package/src/foundry/common/packages/base-system.d.mts +39 -0
  354. package/src/foundry/common/packages/base-world.d.mts +8 -1
  355. package/src/foundry/common/packages/sub-types.d.mts +3 -5
  356. package/src/foundry/common/primitives/array.d.mts +1 -1
  357. package/src/foundry/common/primitives/string.d.mts +1 -1
  358. package/src/foundry/common/prosemirror/dirty-plugin.d.mts +1 -1
  359. package/src/foundry/common/prosemirror/dom-parser.d.mts +1 -1
  360. package/src/foundry/common/prosemirror/highlight-matches-plugin.d.mts +1 -1
  361. package/src/foundry/common/prosemirror/image-plugin.d.mts +1 -1
  362. package/src/foundry/common/prosemirror/paste-transformer.d.mts +1 -1
  363. package/src/foundry/common/prosemirror/plugin.d.mts +1 -1
  364. package/src/foundry/common/types.d.mts +1 -1
  365. package/src/foundry/common/utils/bitmask.d.mts +1 -1
  366. package/src/foundry/common/utils/collection.d.mts +1 -1
  367. package/src/foundry/common/utils/event-emitter.d.mts +1 -1
  368. package/src/foundry/common/utils/helpers.d.mts +1 -1
  369. package/src/foundry/public/scripts/clipper/clipper.d.mts +1 -1
  370. package/src/types/augments/particles.d.mts +1 -1
  371. package/src/types/augments/pixi.d.mts +1 -1
  372. package/src/types/augments/smooth.d.mts +1 -1
  373. package/src/types/augments/tinyMCE.d.mts +1 -1
  374. package/src/types/config.d.mts +2 -5
  375. package/src/types/documentConfiguration.d.mts +1 -1
  376. package/src/types/lib.d.mts +1 -1
  377. package/src/types/workers/image-compressor.d.mts +1 -1
@@ -1,5 +1,5 @@
1
1
  import type { ConfiguredCombat } from "../../../../configuration/index.d.mts";
2
- import type { Merge } from "../../../../utils/index.d.mts";
2
+ import type { AnyObject, InexactPartial, Merge, NullishProps } from "#utils";
3
3
  import type { documents } from "../../../client-esm/client.d.mts";
4
4
  import type Document from "../../../common/abstract/document.d.mts";
5
5
  import type { DataSchema } from "../../../common/data/fields.d.mts";
@@ -228,7 +228,7 @@ declare global {
228
228
  type Collection = CombatEncounters.Configured;
229
229
 
230
230
  /**
231
- * An instance of `Combat` that comes from the database but failed validation meaining that
231
+ * An instance of `Combat` that comes from the database but failed validation meaning that
232
232
  * its `system` and `_source` could theoretically be anything.
233
233
  */
234
234
  interface Invalid<out SubType extends Combat.SubType = Combat.SubType> extends Document.Invalid<OfType<SubType>> {}
@@ -296,7 +296,7 @@ declare global {
296
296
  */
297
297
  _id: fields.DocumentIdField;
298
298
 
299
- type: fields.DocumentTypeField<typeof BaseCombat, { initial: typeof foundry.CONST.BASE_DOCUMENT_TYPE }>;
299
+ type: fields.DocumentTypeField<typeof BaseCombat, { initial: typeof CONST.BASE_DOCUMENT_TYPE }>;
300
300
 
301
301
  system: fields.TypeDataField<typeof BaseCombat>;
302
302
 
@@ -552,25 +552,30 @@ declare global {
552
552
  */
553
553
  type ConfiguredInstance = Implementation;
554
554
 
555
- interface InitiativeOptions {
555
+ /** @internal */
556
+ type _InitiativeOptions = NullishProps<{
556
557
  /**
557
558
  * A non-default initiative formula to roll. Otherwise the system default is used.
558
559
  * @defaultValue `null`
559
560
  */
560
- formula?: string | null;
561
+ formula: string;
561
562
 
562
563
  /**
563
564
  * Update the Combat turn after adding new initiative scores to keep the turn on the same Combatant.
564
565
  * @defaultValue `true`
565
566
  */
566
- updateTurn?: boolean;
567
+ updateTurn: boolean;
568
+ }> &
569
+ InexactPartial<{
570
+ /**
571
+ * Additional options with which to customize created Chat Messages
572
+ * @defaultValue `{}`
573
+ * @remarks Can't be `null` as it only has a parameter default
574
+ */
575
+ messageOptions: ChatMessage.CreateData;
576
+ }>;
567
577
 
568
- /**
569
- * Additional options with which to customize created Chat Messages
570
- * @defaultValue `{}`
571
- */
572
- messageOptions?: foundry.documents.BaseChatMessage.CreateData;
573
- }
578
+ interface InitiativeOptions extends _InitiativeOptions {}
574
579
 
575
580
  interface HistoryData {
576
581
  round: number | null;
@@ -604,17 +609,24 @@ declare global {
604
609
  /** Record the current round, turn, and tokenId to understand changes in the encounter state */
605
610
  current: Combat.HistoryData;
606
611
 
607
- /** Track the previous round, turn, and tokenId to understand changes in the encounter state */
608
- previous: Combat.HistoryData;
612
+ /**
613
+ * Track the previous round, turn, and tokenId to understand changes in the encounter state
614
+ * @remarks Only `undefined` prior to first {@link Combat._onUpdate | `Combat#_onUpdate`} or {@link Combat.setupTurns | `Combat#setupTurns`} (which is called in
615
+ * {@link Combat.prepareDerivedData | `Combat#prepareDerivedData`}) call
616
+ */
617
+ previous: Combat.HistoryData | undefined;
609
618
 
610
619
  /**
611
620
  * The configuration setting used to record Combat preferences
612
- * Default: `"combatTrackerConfig"`
621
+ * @defaultValue `"combatTrackerConfig"`
622
+ * @privateRemarks Right now it doesn't make sense to make this not a literal, as `type CONFIG_SETTING` is static, so changing this would
623
+ * just make {@link Combat.settings | `Combat#settings`} and {@linkcode CombatEncounters.settings} incorrect
613
624
  */
614
- static CONFIG_SETTING: string;
625
+ // TODO: Make the setting name configurable?
626
+ static CONFIG_SETTING: "combatTrackerConfig";
615
627
 
616
628
  /** Get the Combatant who has the current turn. */
617
- get combatant(): this["turns"][number] | undefined;
629
+ get combatant(): Combatant.Implementation | undefined;
618
630
 
619
631
  /**
620
632
  * Get the Combatant who has the next turn.
@@ -623,12 +635,14 @@ declare global {
623
635
 
624
636
  /** Return the object of settings which modify the Combat Tracker behavior */
625
637
  // Type is copied here to avoid recursion issue
638
+ // TODO: Make the setting name configurable?
626
639
  get settings(): ClientSettings.SettingInitializedType<"core", Combat.CONFIG_SETTING>;
627
640
 
628
641
  /** Has this combat encounter been started? */
629
642
  get started(): boolean;
630
643
 
631
- get visible(): true;
644
+ /** @remarks Foundry's implementation in {@linkcode Combat} always returns `true` */
645
+ override get visible(): boolean;
632
646
 
633
647
  /** Is this combat active in the current scene? */
634
648
  get isActive(): boolean;
@@ -640,6 +654,7 @@ declare global {
640
654
  */
641
655
  activate(options?: Combat.Database.UpdateOperation): Promise<Combat.Implementation[]>;
642
656
 
657
+ /** @remarks Calls {@link Combat.setupTurns | `Combat#setupTurns`} if there is at least one Combatant and `this.turns` is empty */
643
658
  override prepareDerivedData(): void;
644
659
 
645
660
  /**
@@ -656,49 +671,46 @@ declare global {
656
671
  getCombatantsByActor(actorOrId: string | Actor.Implementation): Combatant.Implementation[];
657
672
 
658
673
  /** Begin the combat encounter, advancing to round 1 and turn 1 */
659
- startCombat(): Promise<this>;
674
+ startCombat(): Promise<this | undefined>;
660
675
 
661
676
  /** Advance the combat to the next round */
662
- nextRound(): Promise<this>;
677
+ nextRound(): Promise<this | undefined>;
663
678
 
664
679
  /** Rewind the combat to the previous round */
665
- previousRound(): Promise<this>;
680
+ previousRound(): Promise<this | undefined>;
666
681
 
667
682
  /** Advance the combat to the next turn */
668
- nextTurn(): Promise<this>;
683
+ nextTurn(): Promise<this | undefined>;
669
684
 
670
685
  /** Rewind the combat to the previous turn */
671
- previousTurn(): Promise<this>;
686
+ previousTurn(): Promise<this | undefined>;
672
687
 
673
688
  /** Display a dialog querying the GM whether they wish to end the combat encounter and empty the tracker */
674
- endCombat(): Promise<this>;
689
+ endCombat(): Promise<this | undefined>;
675
690
 
676
691
  /** Toggle whether this combat is linked to the scene or globally available. */
677
- toggleSceneLink(): Promise<this>;
692
+ toggleSceneLink(): Promise<this | undefined>;
678
693
 
679
694
  /** Reset all combatant initiative scores, setting the turn back to zero */
680
- resetAll(): Promise<this>;
695
+ resetAll(): Promise<this | undefined>;
681
696
 
682
697
  /**
683
698
  * Roll initiative for one or multiple Combatants within the Combat document
684
699
  * @param ids - A Combatant id or Array of ids for which to roll
685
- * @param options - Additional options which modify how initiative rolls are created or presented.
686
- * default `{}`
700
+ * @param options - Additional options which modify how initiative rolls are created or presented. (default: `{}`)
687
701
  * @returns A promise which resolves to the updated Combat document once updates are complete.
688
702
  */
689
703
  rollInitiative(ids: string | string[], options?: Combat.InitiativeOptions): Promise<this>;
690
704
 
691
705
  /**
692
706
  * Roll initiative for all combatants which have not already rolled
693
- * @param options - Additional options forwarded to the Combat.rollInitiative method
694
- * default `{}`
707
+ * @param options - Additional options forwarded to the Combat.rollInitiative method (default: `{}`)
695
708
  */
696
709
  rollAll(options?: Combat.InitiativeOptions): Promise<this>;
697
710
 
698
711
  /**
699
712
  * Roll initiative for all non-player actors who have not already rolled
700
- * @param options - Additional options forwarded to the Combat.rollInitiative method
701
- * default `{}`
713
+ * @param options - Additional options forwarded to the Combat.rollInitiative method (default: `{}`)
702
714
  */
703
715
  rollNPC(options?: Combat.InitiativeOptions): Promise<this>;
704
716
 
@@ -711,13 +723,13 @@ declare global {
711
723
  setInitiative(id: string, value: number): Promise<void>;
712
724
 
713
725
  /** Return the Array of combatants sorted into initiative order, breaking ties alphabetically by name. */
714
- setupTurns(): this["turns"];
726
+ setupTurns(): Combatant.Implementation[];
715
727
 
716
728
  /**
717
729
  * Debounce changes to the composition of the Combat encounter to de-duplicate multiple concurrent Combatant changes.
718
730
  * If this is the currently viewed encounter, re-render the CombatTracker application.
719
731
  */
720
- debounceSetup: () => ReturnType<typeof foundry.utils.debounce>;
732
+ debounceSetup: () => void;
721
733
 
722
734
  /**
723
735
  * Update active effect durations for all actors present in this Combat encounter.
@@ -729,13 +741,14 @@ declare global {
729
741
  * If multiple exist for that type, one is chosen at random.
730
742
  * @param announcement - The announcement that should be played: "startEncounter", "nextUp", or "yourTurn".
731
743
  */
732
- protected _playCombatSound(announcement: foundry.CONST.COMBAT_ANNOUNCEMENTS): void;
744
+ protected _playCombatSound(announcement: CONST.COMBAT_ANNOUNCEMENTS): void;
733
745
 
734
746
  /**
735
747
  * Define how the array of Combatants is sorted in the displayed list of the tracker.
736
748
  * This method can be overridden by a system or module which needs to display combatants in an alternative order.
737
- * By default sort by initiative, next falling back to name, lastly tie-breaking by combatant id.
738
- * @internal
749
+ * The default sorting rules sort in descending order of initiative using combatant IDs for tiebreakers.
750
+ * @param a - Some combatant
751
+ * @param b - Some other combatant
739
752
  */
740
753
  protected _sortCombatants(a: Combatant.Implementation, b: Combatant.Implementation): number;
741
754
 
@@ -743,15 +756,13 @@ declare global {
743
756
  * Refresh the Token HUD under certain circumstances.
744
757
  * @param documents - A list of Combatant documents that were added or removed.
745
758
  */
746
- protected _refreshTokenHUD(documents: Array<Combatant.Implementation>): void;
759
+ protected _refreshTokenHUD(documents: Combatant.Implementation[]): void;
747
760
 
748
- /**
749
- * @privateRemarks _onCreate, _onUpdate, and _onDelete are all overridden but with no signature changes from BaseCombat.
750
- */
761
+ // _onCreate, _onUpdate, and _onDelete are all overridden but with no signature changes from BaseCombat.
751
762
 
752
763
  /**
753
764
  * @remarks To make it possible for narrowing one parameter to jointly narrow other parameters
754
- * this method must be overriden like so:
765
+ * this method must be overridden like so:
755
766
  * ```typescript
756
767
  * class GurpsCombat extends Combat {
757
768
  * protected override _onCreateDescendantDocuments(...args: Combat.OnCreateDescendantDocumentsArgs) {
@@ -769,7 +780,7 @@ declare global {
769
780
 
770
781
  /**
771
782
  * @remarks To make it possible for narrowing one parameter to jointly narrow other parameters
772
- * this method must be overriden like so:
783
+ * this method must be overridden like so:
773
784
  * ```typescript
774
785
  * class Ptr2eCombat extends Combat {
775
786
  * protected override _onUpdateDescendantDocuments(...args: Combat.OnUpdateDescendantDocumentsArgs) {
@@ -787,7 +798,7 @@ declare global {
787
798
 
788
799
  /**
789
800
  * @remarks To make it possible for narrowing one parameter to jointly narrow other parameters
790
- * this method must be overriden like so:
801
+ * this method must be overridden like so:
791
802
  * ```typescript
792
803
  * class BladesCombat extends Combat {
793
804
  * protected override _onDeleteDescendantDocuments(...args: Combat.OnUpdateDescendantDocuments) {
@@ -807,9 +818,9 @@ declare global {
807
818
 
808
819
  /**
809
820
  * Get the current history state of the Combat encounter.
810
- * @param combatant - The new active combatant
821
+ * @param combatant - The new active combatant (default: `this.combatant`)
811
822
  */
812
- protected _getCurrentState(combatant: Combatant.Implementation): Combat.HistoryData;
823
+ protected _getCurrentState(combatant?: Combatant.Implementation): Combat.HistoryData;
813
824
 
814
825
  /**
815
826
  * Manage the execution of Combat lifecycle events.
@@ -819,9 +830,8 @@ declare global {
819
830
  * 3. Begin Round
820
831
  * 4. Begin Turn
821
832
  * Each lifecycle event is an async method, and each is awaited before proceeding.
822
- * @param adjustedTurn - Optionally, an adjusted turn to commit to the Combat.
823
833
  */
824
- protected _manageTurnEvents(adjustedTurn: number): Promise<void>;
834
+ protected _manageTurnEvents(): Promise<void>;
825
835
 
826
836
  /**
827
837
  * A workflow that occurs at the end of each Combat Turn.
@@ -858,19 +868,22 @@ declare global {
858
868
  protected _onStartTurn(combatant: Combatant.Implementation): Promise<void>;
859
869
 
860
870
  /**
861
- * @deprecated Since v11 until v13. Use {@link Combat.updateCombatantActors | `Combat#updateCombatantActors`} instead.
871
+ * @deprecated Since v11 until v13.
872
+ * @remarks "`Combat#updateEffectDurations` is renamed to {@link Combat.updateCombatantActors | `Combat#updateCombatantActors`}"
862
873
  */
863
874
  updateEffectDurations(): void;
864
875
 
865
876
  /**
866
- * @deprecated Since v12. Use {@link Combat.getCombatantsByActor | `Combat#getCombatantsByActor`} instead.
877
+ * @deprecated Since v12, no stated end
878
+ * @remarks Foundry provides no deprecation warning; use {@link Combat.getCombatantsByActor | `Combat#getCombatantsByActor`} instead.
867
879
  */
868
- getCombatantByActor(actor: Actor.Implementation): Combatant.Implementation[];
880
+ getCombatantByActor(actor: string | Actor.Implementation): Combatant.Implementation | null;
869
881
 
870
882
  /**
871
- * @deprecated Since v12. Use {@link Combat.getCombatantsByActor | `Combat#getCombatantsByActor`} instead.
883
+ * @deprecated Since v12, no stated end
884
+ * @remarks Foundry provides no deprecation warning; use {@link Combat.getCombatantsByActor | `Combat#getCombatantsByActor`} instead.
872
885
  */
873
- getCombatantByToken(token: Token.Object): Combatant.Implementation[];
886
+ getCombatantByToken(token: string | Token.Object): Combatant.Implementation | null;
874
887
 
875
888
  /*
876
889
  * After this point these are not really overridden methods.
@@ -886,7 +899,7 @@ declare global {
886
899
 
887
900
  /**
888
901
  * @remarks To make it possible for narrowing one parameter to jointly narrow other parameters
889
- * this method must be overriden like so:
902
+ * this method must be overridden like so:
890
903
  * ```typescript
891
904
  * class SwadeCombat extends Combat {
892
905
  * protected override _preCreateDescendantDocuments(...args: Combat.PreCreateDescendantDocumentsArgs) {
@@ -904,7 +917,7 @@ declare global {
904
917
 
905
918
  /**
906
919
  * @remarks To make it possible for narrowing one parameter to jointly narrow other parameters
907
- * this method must be overriden like so:
920
+ * this method must be overridden like so:
908
921
  * ```typescript
909
922
  * class LancerCombat extends Combat {
910
923
  * protected override _preUpdateDescendantDocuments(...args: Combat.OnUpdateDescendantDocuments) {
@@ -922,7 +935,7 @@ declare global {
922
935
 
923
936
  /**
924
937
  * @remarks To make it possible for narrowing one parameter to jointly narrow other parameters
925
- * this method must be overriden like so:
938
+ * this method must be overridden like so:
926
939
  * ```typescript
927
940
  * class KultCombat extends Combat {
928
941
  * protected override _preDeleteDescendantDocuments(...args: Combat.PreDeleteDescendantDocumentsArgs) {
@@ -938,21 +951,28 @@ declare global {
938
951
  */
939
952
  protected override _preDeleteDescendantDocuments(...args: Combat.PreDeleteDescendantDocumentsArgs): void;
940
953
 
941
- static override defaultName(context?: Document.DefaultNameContext<Combat.SubType, Combat.Parent>): string;
954
+ // context: not null (destructured)
955
+ static override defaultName(context?: Document.DefaultNameContext<"Combat", Combat.Parent>): string;
942
956
 
957
+ // data: not null (parameter default only), context: not null (destructured)
943
958
  static override createDialog(
944
959
  data?: Document.CreateDialogData<Combat.CreateData>,
945
- context?: Document.CreateDialogContext<Combat.SubType, Combat.Parent>,
960
+ context?: Document.CreateDialogContext<"Combat", Combat.Parent>,
946
961
  ): Promise<Combat.Stored | null | undefined>;
947
962
 
963
+ // options: not null (parameter default only)
948
964
  static override fromDropData(
949
965
  data: Document.DropData<Combat.Implementation>,
950
- options?: Document.FromDropDataOptions,
966
+ options?: AnyObject,
951
967
  ): Promise<Combat.Implementation | undefined>;
952
968
 
953
969
  static override fromImport(
954
970
  source: Combat.Source,
955
- context?: Document.FromImportContext<Combat.Parent>,
971
+ context?: Document.FromImportContext<Combat.Parent> | null,
956
972
  ): Promise<Combat.Implementation>;
973
+
974
+ override _onClickDocumentLink(event: MouseEvent): ClientDocument.OnClickDocumentLinkReturn;
975
+
976
+ #Combat: true;
957
977
  }
958
978
  }
@@ -1,5 +1,5 @@
1
1
  import type { ConfiguredCombatant } from "../../../../configuration/index.d.mts";
2
- import type { Merge, ValueOf } from "fvtt-types/utils";
2
+ import type { AnyObject, Merge } from "#utils";
3
3
  import type { documents } from "../../../client-esm/client.d.mts";
4
4
  import type Document from "../../../common/abstract/document.d.mts";
5
5
  import type { DataSchema } from "../../../common/data/fields.d.mts";
@@ -161,7 +161,7 @@ declare global {
161
161
  type Collection = never;
162
162
 
163
163
  /**
164
- * An instance of `Combatant` that comes from the database but failed validation meaining that
164
+ * An instance of `Combatant` that comes from the database but failed validation meaning that
165
165
  * its `system` and `_source` could theoretically be anything.
166
166
  */
167
167
  interface Invalid<out SubType extends Combatant.SubType = Combatant.SubType>
@@ -232,6 +232,7 @@ declare global {
232
232
  */
233
233
  _id: fields.DocumentIdField;
234
234
 
235
+ /** @defaultValue `"base"` */
235
236
  type: fields.DocumentTypeField<typeof BaseCombatant, { initial: typeof foundry.CONST.BASE_DOCUMENT_TYPE }>;
236
237
 
237
238
  system: fields.TypeDataField<typeof BaseCombatant>;
@@ -264,7 +265,7 @@ declare global {
264
265
 
265
266
  /**
266
267
  * A customized name which replaces the name of the Token in the tracker
267
- * @defaultValue `""`
268
+ * @defaultValue `undefined`
268
269
  */
269
270
  name: fields.StringField<{ label: "COMBAT.CombatantName"; textSearch: true }>;
270
271
 
@@ -272,7 +273,7 @@ declare global {
272
273
  * A customized image which replaces the Token image in the tracker
273
274
  * @defaultValue `null`
274
275
  */
275
- img: fields.FilePathField<{ categories: "IMAGE"[]; label: "COMBAT.CombatantImage" }>;
276
+ img: fields.FilePathField<{ categories: ["IMAGE"]; label: "COMBAT.CombatantImage" }>;
276
277
 
277
278
  /**
278
279
  * The initiative score for the Combatant which determines its turn order
@@ -434,6 +435,23 @@ declare global {
434
435
  type Get<Scope extends Flags.Scope, Key extends Flags.Key<Scope>> = Document.GetFlag<Name, Scope, Key>;
435
436
  }
436
437
 
438
+ /**
439
+ * @remarks
440
+ * This is typed based on what is reasonable to expect, rather than accurately, as accurately would mean `unknown` (Foundry's type is `object|null`).
441
+ *
442
+ * Technically this is the value of an arbitrary property path in the Combatant's Actor's `system` (using `getProperty`), and while that path can usually be
443
+ * assumed to have been set to something in the return of {@linkcode TokenDocument.getTrackedAttributes}, since that's what the {@linkcode CombatTrackerConfig}
444
+ * provides as options, the path is stored in the {@linkcode Combat.CONFIG_SETTING} which could be updated to be anything. Also, `TokenDocument.getTrackedAttributes`
445
+ * doesn't actually check what the type of `value` and `max` are for bar type attributes, so even sticking to those choices isn't guaranteed safe.
446
+ *
447
+ * There's clear intent that the value *should* be numeric or null, but nothing seems to do math on it in core, and it's simply output in the {@linkcode CombatEncounters}
448
+ * template as `{{resource}}`, so `string` has been allowed.
449
+ *
450
+ * @privateRemarks Adding `boolean` is something that was discussed and decided against for now, but its plausible a system may request such in the future, and wouldn't
451
+ * make us any more wrong than currently.
452
+ */
453
+ type Resource = string | number | null;
454
+
437
455
  /**
438
456
  * @deprecated {@link Combatant.Database | `Combatant.DatabaseOperation`}
439
457
  */
@@ -484,11 +502,12 @@ declare global {
484
502
 
485
503
  /**
486
504
  * The token video source image (if any)
505
+ * @defaultValue `null`
487
506
  */
488
507
  _videoSrc: string | null;
489
508
 
490
509
  /** The current value of the special tracked resource which pertains to this Combatant */
491
- resource: `${number}` | number | boolean | null;
510
+ resource: Combatant.Resource | null;
492
511
 
493
512
  /**
494
513
  * A convenience alias of Combatant#parent which is more semantically intuitive
@@ -500,8 +519,9 @@ declare global {
500
519
 
501
520
  /**
502
521
  * Eschew `ClientDocument`'s redirection to `Combat#permission` in favor of special ownership determination.
522
+ * @remarks Uses {@link BaseCombatant.getUserLevel | `BaseCombatant#getUserLevel`}, so can't return `null`
503
523
  */
504
- override get permission(): ValueOf<typeof CONST.DOCUMENT_OWNERSHIP_LEVELS>;
524
+ override get permission(): CONST.DOCUMENT_OWNERSHIP_LEVELS;
505
525
 
506
526
  override get visible(): boolean;
507
527
 
@@ -511,7 +531,7 @@ declare global {
511
531
  /** A reference to the Token document which this Combatant represents, if any */
512
532
  get token(): TokenDocument.Implementation | null;
513
533
 
514
- /** An array of User documents who have ownership of this Document */
534
+ /** An array of non-Gamemaster Users who have ownership of this Combatant. */
515
535
  get players(): User.Implementation[];
516
536
 
517
537
  /**
@@ -519,10 +539,17 @@ declare global {
519
539
  */
520
540
  get isDefeated(): boolean;
521
541
 
542
+ /**
543
+ * @remarks Returns `true` for GMs, regardless of `options.exact`. Otherwise, returns
544
+ * `this.actor?.canUserModify(user, "update") || false`
545
+ *
546
+ * @privateRemarks This is the only document that overrides this in the non-Base class
547
+ */
548
+ // options: not null (destructured)
522
549
  override testUserPermission(
523
550
  user: User.Implementation,
524
- permission: keyof typeof foundry.CONST.DOCUMENT_OWNERSHIP_LEVELS | foundry.CONST.DOCUMENT_OWNERSHIP_LEVELS,
525
- { exact }?: { exact?: boolean },
551
+ permission: Document.ActionPermission,
552
+ options?: Document.TestUserPermissionOptions,
526
553
  ): boolean;
527
554
 
528
555
  /**
@@ -530,7 +557,7 @@ declare global {
530
557
  * @param formula - An explicit Roll formula to use for the combatant.
531
558
  * @returns The Roll instance to use for the combatant.
532
559
  */
533
- getInitiativeRoll(formula?: string): Roll;
560
+ getInitiativeRoll(formula?: string): Roll.ConfiguredInstance;
534
561
 
535
562
  /**
536
563
  * Roll initiative for this particular combatant.
@@ -539,12 +566,15 @@ declare global {
539
566
  */
540
567
  rollInitiative(formula: string): Promise<this | undefined>;
541
568
 
569
+ /**
570
+ * @remarks Initializes `_videoSrc`, applies `img` and `name` fallbacks, and calls {@link Combatant.updateResource | `Combatant#updateResource`}
571
+ */
542
572
  override prepareDerivedData(): void;
543
573
 
544
574
  /**
545
575
  * Update the value of the tracked resource for this Combatant.
546
576
  */
547
- updateResource(): this["resource"];
577
+ updateResource(): Combatant.Resource;
548
578
 
549
579
  /**
550
580
  * Acquire the default dice formula which should be used to roll initiative for this combatant.
@@ -553,10 +583,8 @@ declare global {
553
583
  */
554
584
  protected _getInitiativeFormula(): string;
555
585
 
556
- /**
557
- * @privateRemarks DatabaseLifecycle Events are overridden but with no signature changes.
558
- * These are already covered in BaseCombatant
559
- */
586
+ // DatabaseLifecycle Events are overridden but with no signature changes.
587
+ // These are already covered in BaseCombatant
560
588
 
561
589
  /*
562
590
  * After this point these are not really overridden methods.
@@ -572,23 +600,28 @@ declare global {
572
600
 
573
601
  // Descendant Document operations have been left out because Combatant does not have any descendant documents.
574
602
 
603
+ // context: not null (destructured)
575
604
  static override defaultName(
576
- context: Document.DefaultNameContext<Combatant.SubType, NonNullable<Combatant.Parent>>,
605
+ context?: Document.DefaultNameContext<"Combatant", NonNullable<Combatant.Parent>>,
577
606
  ): string;
578
607
 
608
+ /** @remarks `context.parent` is required as creation requires one */
579
609
  static override createDialog(
580
- data: Document.CreateDialogData<Combatant.CreateData>,
581
- context: Document.CreateDialogContext<Combatant.SubType, NonNullable<Combatant.Parent>>,
610
+ data: Document.CreateDialogData<Combatant.CreateData> | undefined,
611
+ context: Document.CreateDialogContext<"Combatant", NonNullable<Combatant.Parent>>,
582
612
  ): Promise<Combatant.Stored | null | undefined>;
583
613
 
614
+ // options: not null (parameter default only)
584
615
  static override fromDropData(
585
616
  data: Document.DropData<Combatant.Implementation>,
586
- options?: Document.FromDropDataOptions,
617
+ options?: AnyObject,
587
618
  ): Promise<Combatant.Implementation | undefined>;
588
619
 
589
620
  static override fromImport(
590
621
  source: Combatant.Source,
591
- context?: Document.FromImportContext<Combatant.Parent>,
622
+ context?: Document.FromImportContext<Combatant.Parent> | null,
592
623
  ): Promise<Combatant.Implementation>;
624
+
625
+ override _onClickDocumentLink(event: MouseEvent): ClientDocument.OnClickDocumentLinkReturn;
593
626
  }
594
627
  }
@@ -1,4 +1,4 @@
1
- import type { Merge } from "../../../../utils/index.d.mts";
1
+ import type { AnyObject, Merge } from "#utils";
2
2
  import type { documents } from "../../../client-esm/client.d.mts";
3
3
  import type Document from "../../../common/abstract/document.d.mts";
4
4
  import type { DataSchema } from "../../../common/data/fields.d.mts";
@@ -113,7 +113,7 @@ declare global {
113
113
  type Collection = never;
114
114
 
115
115
  /**
116
- * An instance of `DrawingDocument` that comes from the database but failed validation meaining that
116
+ * An instance of `DrawingDocument` that comes from the database but failed validation meaning that
117
117
  * its `system` and `_source` could theoretically be anything.
118
118
  */
119
119
  interface Invalid extends Document.Invalid<DrawingDocument.Implementation> {}
@@ -539,23 +539,28 @@ declare global {
539
539
 
540
540
  // Descendant Document operations have been left out because Drawing does not have any descendant documents.
541
541
 
542
+ // context: not null (destructured)
542
543
  static override defaultName(
543
- context: Document.DefaultNameContext<"base", NonNullable<DrawingDocument.Parent>>,
544
+ context?: Document.DefaultNameContext<"Drawing", NonNullable<DrawingDocument.Parent>>,
544
545
  ): string;
545
546
 
547
+ /** @remarks `context.parent` is required as creation requires one */
546
548
  static override createDialog(
547
- data: Document.CreateDialogData<DrawingDocument.CreateData>,
548
- context: Document.CreateDialogContext<string, NonNullable<DrawingDocument.Parent>>,
549
+ data: Document.CreateDialogData<DrawingDocument.CreateData> | undefined,
550
+ context: Document.CreateDialogContext<"Drawing", NonNullable<DrawingDocument.Parent>>,
549
551
  ): Promise<DrawingDocument.Stored | null | undefined>;
550
552
 
553
+ // options: not null (parameter default only)
551
554
  static override fromDropData(
552
555
  data: Document.DropData<DrawingDocument.Implementation>,
553
- options?: Document.FromDropDataOptions,
556
+ options?: AnyObject,
554
557
  ): Promise<DrawingDocument.Implementation | undefined>;
555
558
 
556
559
  static override fromImport(
557
560
  source: DrawingDocument.Source,
558
- context?: Document.FromImportContext<DrawingDocument.Parent>,
561
+ context?: Document.FromImportContext<DrawingDocument.Parent> | null,
559
562
  ): Promise<DrawingDocument.Implementation>;
563
+
564
+ override _onClickDocumentLink(event: MouseEvent): ClientDocument.OnClickDocumentLinkReturn;
560
565
  }
561
566
  }