@league-of-foundry-developers/foundry-vtt-types 12.331.2-beta → 13.340.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 (695) hide show
  1. package/README.md +13 -17
  2. package/package.json +84 -41
  3. package/src/configuration/configuration.d.mts +315 -0
  4. package/src/configuration/globals.d.mts +349 -0
  5. package/src/configuration/index.d.mts +4 -0
  6. package/src/foundry/client/apps/app.d.mts +10 -5
  7. package/src/foundry/client/apps/av/av-config.d.mts +2 -2
  8. package/src/foundry/client/apps/av/cameras.d.mts +7 -2
  9. package/src/foundry/client/apps/dice/dice-config.d.mts +45 -0
  10. package/src/foundry/client/apps/dice/index.d.mts +1 -0
  11. package/src/foundry/client/apps/form.d.mts +13 -4
  12. package/src/foundry/client/apps/forms/actor.d.mts +4 -4
  13. package/src/foundry/client/apps/forms/adventure-exporter.d.mts +1 -1
  14. package/src/foundry/client/apps/forms/adventure-importer.d.mts +1 -1
  15. package/src/foundry/client/apps/forms/base-sheet.d.mts +7 -6
  16. package/src/foundry/client/apps/forms/card-config.d.mts +8 -8
  17. package/src/foundry/client/apps/forms/cards-config.d.mts +5 -4
  18. package/src/foundry/client/apps/forms/combat-config.d.mts +1 -1
  19. package/src/foundry/client/apps/forms/combatant-config.d.mts +1 -1
  20. package/src/foundry/client/apps/forms/effect-config.d.mts +1 -1
  21. package/src/foundry/client/apps/forms/folder-config.d.mts +1 -1
  22. package/src/foundry/client/apps/forms/fonts.d.mts +1 -1
  23. package/src/foundry/client/apps/forms/grid-config.d.mts +3 -8
  24. package/src/foundry/client/apps/forms/image-popout.d.mts +1 -1
  25. package/src/foundry/client/apps/forms/item.d.mts +8 -8
  26. package/src/foundry/client/apps/forms/journal-page-sheet.d.mts +1 -1
  27. package/src/foundry/client/apps/forms/journal-sheet.d.mts +4 -3
  28. package/src/foundry/client/apps/forms/macro-config.d.mts +2 -2
  29. package/src/foundry/client/apps/forms/measure-template.d.mts +8 -10
  30. package/src/foundry/client/apps/forms/ownership.d.mts +1 -1
  31. package/src/foundry/client/apps/forms/playlist-config.d.mts +1 -1
  32. package/src/foundry/client/apps/forms/playlist-sound-config.d.mts +1 -1
  33. package/src/foundry/client/apps/forms/roll-table-config.d.mts +5 -3
  34. package/src/foundry/client/apps/forms/scene-config.d.mts +5 -6
  35. package/src/foundry/client/apps/forms/sheet-config.d.mts +6 -18
  36. package/src/foundry/client/apps/forms/user-config.d.mts +6 -5
  37. package/src/foundry/client/apps/hud/chatbubble.d.mts +7 -0
  38. package/src/foundry/client/apps/hud/container.d.mts +1 -1
  39. package/src/foundry/client/apps/hud/controls.d.mts +6 -1
  40. package/src/foundry/client/apps/hud/hotbar.d.mts +9 -4
  41. package/src/foundry/client/apps/hud/hud.d.mts +1 -1
  42. package/src/foundry/client/apps/hud/menu.d.mts +8 -1
  43. package/src/foundry/client/apps/hud/navigation.d.mts +8 -3
  44. package/src/foundry/client/apps/hud/pause.d.mts +7 -2
  45. package/src/foundry/client/apps/hud/players.d.mts +8 -3
  46. package/src/foundry/client/apps/i18n.d.mts +16 -13
  47. package/src/foundry/client/apps/index.d.mts +1 -0
  48. package/src/foundry/client/apps/placeables/drawing-config.d.mts +1 -1
  49. package/src/foundry/client/apps/placeables/drawing-hud.d.mts +1 -1
  50. package/src/foundry/client/apps/placeables/light-config.d.mts +4 -4
  51. package/src/foundry/client/apps/placeables/note-config.d.mts +3 -3
  52. package/src/foundry/client/apps/placeables/sound-config.d.mts +4 -3
  53. package/src/foundry/client/apps/placeables/tile-config.d.mts +2 -2
  54. package/src/foundry/client/apps/placeables/tile-hud.d.mts +7 -2
  55. package/src/foundry/client/apps/placeables/token-config.d.mts +16 -4
  56. package/src/foundry/client/apps/placeables/token-hud.d.mts +7 -2
  57. package/src/foundry/client/apps/placeables/wall-config.d.mts +4 -3
  58. package/src/foundry/client/apps/sidebar/apps/client-settings.d.mts +1 -1
  59. package/src/foundry/client/apps/sidebar/apps/compendium.d.mts +6 -7
  60. package/src/foundry/client/apps/sidebar/apps/keybindings-config.d.mts +2 -1
  61. package/src/foundry/client/apps/sidebar/apps/module-management.d.mts +1 -1
  62. package/src/foundry/client/apps/sidebar/apps/permission-config.d.mts +1 -1
  63. package/src/foundry/client/apps/sidebar/apps/support-details.d.mts +1 -1
  64. package/src/foundry/client/apps/sidebar/apps/tours-management.d.mts +1 -1
  65. package/src/foundry/client/apps/sidebar/apps/world-config.d.mts +1 -1
  66. package/src/foundry/client/apps/sidebar/directory-tab-mixin.d.mts +12 -5
  67. package/src/foundry/client/apps/sidebar/document-directory.d.mts +12 -5
  68. package/src/foundry/client/apps/sidebar/package-configuration.d.mts +1 -1
  69. package/src/foundry/client/apps/sidebar/sidebar.d.mts +7 -2
  70. package/src/foundry/client/apps/sidebar/tabs/actors-directory.d.mts +10 -1
  71. package/src/foundry/client/apps/sidebar/tabs/cards-directory.d.mts +10 -1
  72. package/src/foundry/client/apps/sidebar/tabs/chat-log.d.mts +8 -1
  73. package/src/foundry/client/apps/sidebar/tabs/combat-tracker.d.mts +10 -1
  74. package/src/foundry/client/apps/sidebar/tabs/compendium-directory.d.mts +15 -9
  75. package/src/foundry/client/apps/sidebar/tabs/items-directory.d.mts +10 -1
  76. package/src/foundry/client/apps/sidebar/tabs/journal-directory.d.mts +10 -1
  77. package/src/foundry/client/apps/sidebar/tabs/macros-directory.d.mts +9 -0
  78. package/src/foundry/client/apps/sidebar/tabs/playlists-directory.d.mts +16 -8
  79. package/src/foundry/client/apps/sidebar/tabs/roll-table-directory.d.mts +10 -1
  80. package/src/foundry/client/apps/sidebar/tabs/scenes-directory.d.mts +11 -2
  81. package/src/foundry/client/apps/sidebar/tabs/settings.d.mts +19 -1
  82. package/src/foundry/client/apps/templates.d.mts +5 -1
  83. package/src/foundry/client/av/client.d.mts +1 -1
  84. package/src/foundry/client/av/clients/simplepeer.d.mts +11 -1
  85. package/src/foundry/client/av/master.d.mts +2 -2
  86. package/src/foundry/client/av/settings.d.mts +1 -2
  87. package/src/foundry/client/config.d.mts +201 -198
  88. package/src/foundry/client/core/hooks.d.mts +2 -2
  89. package/src/foundry/client/core/image.d.mts +81 -33
  90. package/src/foundry/client/core/keybindings.d.mts +2 -2
  91. package/src/foundry/client/core/packages.d.mts +9 -2
  92. package/src/foundry/client/core/settings.d.mts +34 -31
  93. package/src/foundry/client/core/socket.d.mts +1 -1
  94. package/src/foundry/client/core/sorting.d.mts +1 -1
  95. package/src/foundry/client/core/tooltip.d.mts +1 -1
  96. package/src/foundry/client/core/tour.d.mts +1 -1
  97. package/src/foundry/client/core/utils.d.mts +33 -10
  98. package/src/foundry/client/core/video.d.mts +1 -1
  99. package/src/foundry/client/core/workers.d.mts +1 -1
  100. package/src/foundry/client/data/abstract/canvas-document.d.mts +25 -15
  101. package/src/foundry/client/data/abstract/client-document.d.mts +48 -39
  102. package/src/foundry/client/data/abstract/directory-collection-mixin.d.mts +19 -13
  103. package/src/foundry/client/data/abstract/document-collection.d.mts +8 -8
  104. package/src/foundry/client/data/abstract/world-collection.d.mts +3 -5
  105. package/src/foundry/client/data/collections/actors.d.mts +10 -1
  106. package/src/foundry/client/data/collections/cards.d.mts +9 -0
  107. package/src/foundry/client/data/collections/combats.d.mts +10 -1
  108. package/src/foundry/client/data/collections/compendium-collection.d.mts +8 -37
  109. package/src/foundry/client/data/collections/compendium-packs.d.mts +2 -2
  110. package/src/foundry/client/data/collections/fog.d.mts +9 -0
  111. package/src/foundry/client/data/collections/folder.d.mts +9 -0
  112. package/src/foundry/client/data/collections/items.d.mts +9 -0
  113. package/src/foundry/client/data/collections/journal.d.mts +10 -1
  114. package/src/foundry/client/data/collections/macros.d.mts +10 -1
  115. package/src/foundry/client/data/collections/messages.d.mts +9 -0
  116. package/src/foundry/client/data/collections/playlists.d.mts +10 -1
  117. package/src/foundry/client/data/collections/scenes.d.mts +10 -1
  118. package/src/foundry/client/data/collections/settings.d.mts +9 -0
  119. package/src/foundry/client/data/collections/tables.d.mts +10 -1
  120. package/src/foundry/client/data/collections/users.d.mts +10 -1
  121. package/src/foundry/client/data/documents/active-effect.d.mts +43 -14
  122. package/src/foundry/client/data/documents/actor-delta.d.mts +4 -4
  123. package/src/foundry/client/data/documents/actor.d.mts +7 -4
  124. package/src/foundry/client/data/documents/adventure.d.mts +9 -8
  125. package/src/foundry/client/data/documents/ambient-light.d.mts +3 -2
  126. package/src/foundry/client/data/documents/ambient-sound.d.mts +3 -2
  127. package/src/foundry/client/data/documents/card.d.mts +4 -3
  128. package/src/foundry/client/data/documents/cards.d.mts +15 -20
  129. package/src/foundry/client/data/documents/chat-message.d.mts +4 -3
  130. package/src/foundry/client/data/documents/combat.d.mts +5 -4
  131. package/src/foundry/client/data/documents/combatant.d.mts +5 -4
  132. package/src/foundry/client/data/documents/drawing.d.mts +3 -2
  133. package/src/foundry/client/data/documents/fog-exploration.d.mts +13 -3
  134. package/src/foundry/client/data/documents/folder.d.mts +27 -9
  135. package/src/foundry/client/data/documents/index.d.mts +2 -0
  136. package/src/foundry/client/data/documents/item.d.mts +6 -2
  137. package/src/foundry/client/data/documents/journal-entry-page.d.mts +5 -4
  138. package/src/foundry/client/data/documents/journal-entry.d.mts +5 -4
  139. package/src/foundry/client/data/documents/macro.d.mts +5 -6
  140. package/src/foundry/client/data/documents/measured-template.d.mts +3 -2
  141. package/src/foundry/client/data/documents/note.d.mts +3 -2
  142. package/src/foundry/client/data/documents/playlist-sound.d.mts +4 -3
  143. package/src/foundry/client/data/documents/playlist.d.mts +13 -13
  144. package/src/foundry/client/data/documents/region-behavior.d.mts +78 -0
  145. package/src/foundry/client/data/documents/region.d.mts +160 -0
  146. package/src/foundry/client/data/documents/scene.d.mts +18 -10
  147. package/src/foundry/client/data/documents/setting.d.mts +3 -2
  148. package/src/foundry/client/data/documents/table-result.d.mts +3 -2
  149. package/src/foundry/client/data/documents/table.d.mts +5 -4
  150. package/src/foundry/client/data/documents/tile.d.mts +3 -2
  151. package/src/foundry/client/data/documents/token.d.mts +7 -16
  152. package/src/foundry/client/data/documents/user.d.mts +5 -4
  153. package/src/foundry/client/data/documents/wall.d.mts +3 -2
  154. package/src/foundry/client/game.d.mts +28 -21
  155. package/src/foundry/client/head.d.mts +12 -7
  156. package/src/foundry/client/hooks.d.mts +60 -41
  157. package/src/foundry/client/pixi/board.d.mts +21 -20
  158. package/src/foundry/client/pixi/core/containers/base-canvas-group.d.mts +95 -24
  159. package/src/foundry/client/pixi/core/containers/cached-container.d.mts +36 -18
  160. package/src/foundry/client/pixi/core/containers/full-canvas-container.d.mts +7 -10
  161. package/src/foundry/client/pixi/core/containers/point-source-mesh.d.mts +24 -14
  162. package/src/foundry/client/pixi/core/containers/quad-mesh.d.mts +15 -5
  163. package/src/foundry/client/pixi/core/containers/quadtree.d.mts +107 -50
  164. package/src/foundry/client/pixi/core/containers/sprite-mesh.d.mts +66 -23
  165. package/src/foundry/client/pixi/core/containers/unbound-container.d.mts +20 -2
  166. package/src/foundry/client/pixi/core/interaction/canvas-animation.d.mts +158 -99
  167. package/src/foundry/client/pixi/core/interaction/control-icon.d.mts +61 -22
  168. package/src/foundry/client/pixi/core/interaction/mouse-handler.d.mts +119 -52
  169. package/src/foundry/client/pixi/core/interaction/ping.d.mts +51 -28
  170. package/src/foundry/client/pixi/core/interaction/pings/chevron.d.mts +16 -8
  171. package/src/foundry/client/pixi/core/interaction/pings/pulse.d.mts +84 -33
  172. package/src/foundry/client/pixi/core/interaction/render-flags.d.mts +16 -7
  173. package/src/foundry/client/pixi/core/interaction/resize-handle.d.mts +35 -5
  174. package/src/foundry/client/pixi/core/interaction/targets.d.mts +19 -16
  175. package/src/foundry/client/pixi/core/loader.d.mts +85 -75
  176. package/src/foundry/client/pixi/core/shapes/limited-angle-polygon.d.mts +36 -16
  177. package/src/foundry/client/pixi/core/shapes/polygon-mesher.d.mts +92 -64
  178. package/src/foundry/client/pixi/core/shapes/precise-text.d.mts +28 -10
  179. package/src/foundry/client/pixi/core/shapes/ray.d.mts +27 -9
  180. package/src/foundry/client/pixi/core/shapes/source-polygon.d.mts +162 -72
  181. package/src/foundry/client/pixi/extensions/circle.d.mts +133 -122
  182. package/src/foundry/client/pixi/extensions/graphics.d.mts +3 -1
  183. package/src/foundry/client/pixi/extensions/observable-transform.d.mts +10 -2
  184. package/src/foundry/client/pixi/extensions/polygon.d.mts +155 -134
  185. package/src/foundry/client/pixi/extensions/rectangle.d.mts +266 -240
  186. package/src/foundry/client/pixi/groups/effects.d.mts +75 -24
  187. package/src/foundry/client/pixi/groups/environment.d.mts +68 -19
  188. package/src/foundry/client/pixi/groups/hidden.d.mts +27 -11
  189. package/src/foundry/client/pixi/groups/interface.d.mts +62 -38
  190. package/src/foundry/client/pixi/groups/overlay.d.mts +18 -6
  191. package/src/foundry/client/pixi/groups/primary.d.mts +64 -42
  192. package/src/foundry/client/pixi/groups/rendered.d.mts +18 -6
  193. package/src/foundry/client/pixi/layers/base/canvas-layer.d.mts +9 -13
  194. package/src/foundry/client/pixi/layers/base/interaction-layer.d.mts +18 -17
  195. package/src/foundry/client/pixi/layers/base/placeables-layer.d.mts +86 -98
  196. package/src/foundry/client/pixi/layers/controls/cursor.d.mts +1 -1
  197. package/src/foundry/client/pixi/layers/controls/door.d.mts +9 -0
  198. package/src/foundry/client/pixi/layers/controls/layer.d.mts +10 -8
  199. package/src/foundry/client/pixi/layers/controls/ruler.d.mts +1 -1
  200. package/src/foundry/client/pixi/layers/effects/background-effects.d.mts +6 -8
  201. package/src/foundry/client/pixi/layers/effects/coloration-effects.d.mts +4 -7
  202. package/src/foundry/client/pixi/layers/effects/darkness-effects.d.mts +3 -6
  203. package/src/foundry/client/pixi/layers/effects/illumination-effects.d.mts +4 -7
  204. package/src/foundry/client/pixi/layers/effects/visibility.d.mts +11 -8
  205. package/src/foundry/client/pixi/layers/effects/weather/particles/effect.d.mts +1 -1
  206. package/src/foundry/client/pixi/layers/effects/weather-effects.d.mts +5 -8
  207. package/src/foundry/client/pixi/layers/grid/highlight.d.mts +1 -1
  208. package/src/foundry/client/pixi/layers/grid/layer.d.mts +6 -8
  209. package/src/foundry/client/pixi/layers/grid/mesh.d.mts +1 -1
  210. package/src/foundry/client/pixi/layers/masks/depth.d.mts +11 -6
  211. package/src/foundry/client/pixi/layers/masks/occlusion.d.mts +18 -11
  212. package/src/foundry/client/pixi/layers/masks/vision.d.mts +100 -14
  213. package/src/foundry/client/pixi/layers/placeables/drawings.d.mts +3 -6
  214. package/src/foundry/client/pixi/layers/placeables/index.d.mts +1 -0
  215. package/src/foundry/client/pixi/layers/placeables/lighting.d.mts +4 -7
  216. package/src/foundry/client/pixi/layers/placeables/notes.d.mts +4 -6
  217. package/src/foundry/client/pixi/layers/placeables/regions.d.mts +100 -0
  218. package/src/foundry/client/pixi/layers/placeables/sounds.d.mts +4 -8
  219. package/src/foundry/client/pixi/layers/placeables/templates.d.mts +3 -6
  220. package/src/foundry/client/pixi/layers/placeables/tiles.d.mts +3 -5
  221. package/src/foundry/client/pixi/layers/placeables/tokens.d.mts +6 -10
  222. package/src/foundry/client/pixi/layers/placeables/walls.d.mts +9 -11
  223. package/src/foundry/client/pixi/perception/clockwise-sweep.d.mts +53 -24
  224. package/src/foundry/client/pixi/perception/detection-mode.d.mts +4 -2
  225. package/src/foundry/client/pixi/perception/fog.d.mts +9 -0
  226. package/src/foundry/client/pixi/perception/perception-manager.d.mts +1 -1
  227. package/src/foundry/client/pixi/perception/vision-mode.d.mts +31 -13
  228. package/src/foundry/client/pixi/perception/weiler-atherton-clipping.d.mts +77 -39
  229. package/src/foundry/client/pixi/placeable.d.mts +15 -7
  230. package/src/foundry/client/pixi/placeables/drawing.d.mts +10 -9
  231. package/src/foundry/client/pixi/placeables/index.d.mts +1 -0
  232. package/src/foundry/client/pixi/placeables/light.d.mts +8 -6
  233. package/src/foundry/client/pixi/placeables/note.d.mts +8 -7
  234. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-canvas-object.d.mts +29 -8
  235. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-graphics.d.mts +41 -11
  236. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-occludable-object.d.mts +59 -18
  237. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-sprite-mesh.d.mts +120 -37
  238. package/src/foundry/client/pixi/placeables/region.d.mts +177 -0
  239. package/src/foundry/client/pixi/placeables/sound.d.mts +7 -6
  240. package/src/foundry/client/pixi/placeables/template.d.mts +12 -11
  241. package/src/foundry/client/pixi/placeables/tile.d.mts +12 -10
  242. package/src/foundry/client/pixi/placeables/token.d.mts +149 -19
  243. package/src/foundry/client/pixi/placeables/wall.d.mts +11 -9
  244. package/src/foundry/client/pixi/webgl/extensions/batch-renderer.d.mts +50 -33
  245. package/src/foundry/client/pixi/webgl/extensions/batch-shader-generator.d.mts +9 -8
  246. package/src/foundry/client/pixi/webgl/helpers/{framebugger-snapshot.d.mts → framebuffer-snapshot.d.mts} +9 -8
  247. package/src/foundry/client/pixi/webgl/helpers/index.d.mts +1 -1
  248. package/src/foundry/client/pixi/webgl/helpers/smooth-noise.d.mts +30 -23
  249. package/src/foundry/client/pixi/webgl/helpers/texture-extractor.d.mts +82 -53
  250. package/src/foundry/client/pixi/webgl/shaders/base-shader-mixin.d.mts +10 -10
  251. package/src/foundry/client/pixi/webgl/shaders/base-shader.d.mts +45 -28
  252. package/src/foundry/client/pixi/webgl/shaders/filters/base-filter.d.mts +11 -10
  253. package/src/foundry/client/pixi/webgl/shaders/filters/base-mask-filter.d.mts +11 -9
  254. package/src/foundry/client/pixi/webgl/shaders/filters/blur.d.mts +21 -19
  255. package/src/foundry/client/pixi/webgl/shaders/filters/effects-masking.d.mts +33 -32
  256. package/src/foundry/client/pixi/webgl/shaders/filters/environment.d.mts +9 -8
  257. package/src/foundry/client/pixi/webgl/shaders/filters/glow-overlay.d.mts +11 -10
  258. package/src/foundry/client/pixi/webgl/shaders/filters/invisibility.d.mts +9 -8
  259. package/src/foundry/client/pixi/webgl/shaders/filters/outline-overlay.d.mts +11 -10
  260. package/src/foundry/client/pixi/webgl/shaders/filters/transition.d.mts +65 -58
  261. package/src/foundry/client/pixi/webgl/shaders/filters/visibility.d.mts +20 -16
  262. package/src/foundry/client/pixi/webgl/shaders/filters/vision-mask-filter.d.mts +13 -10
  263. package/src/foundry/client/pixi/webgl/shaders/filters/void.d.mts +9 -8
  264. package/src/foundry/client/pixi/webgl/shaders/filters/weather-occlusion-masks.d.mts +9 -8
  265. package/src/foundry/client/pixi/webgl/shaders/fragment-channel-mixin.d.mts +20 -14
  266. package/src/foundry/client/pixi/webgl/shaders/grid/grid.d.mts +11 -10
  267. package/src/foundry/client/pixi/webgl/shaders/lighting/background-lighting.d.mts +9 -8
  268. package/src/foundry/client/pixi/webgl/shaders/lighting/base-lighting.d.mts +32 -32
  269. package/src/foundry/client/pixi/webgl/shaders/lighting/coloration-lighting.d.mts +9 -8
  270. package/src/foundry/client/pixi/webgl/shaders/lighting/darkness-lighting.d.mts +9 -8
  271. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/bewitching-wave.d.mts +18 -16
  272. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/black-hole.d.mts +9 -8
  273. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/chroma.d.mts +9 -8
  274. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/emanation.d.mts +9 -8
  275. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/energy-field.d.mts +9 -8
  276. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/fairy-light.d.mts +18 -16
  277. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/flame.d.mts +18 -16
  278. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/fog.d.mts +9 -8
  279. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/force-grid.d.mts +9 -7
  280. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/ghost-light.d.mts +18 -16
  281. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/hexa-dome.d.mts +9 -8
  282. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/light-dome.d.mts +9 -8
  283. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/magical-gloom.d.mts +9 -8
  284. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/pulse.d.mts +18 -16
  285. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/radial-rainbow.d.mts +9 -8
  286. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/revolving-light.d.mts +9 -8
  287. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/roiling-mass.d.mts +9 -8
  288. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/siren-light.d.mts +18 -16
  289. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/smoke-patch.d.mts +19 -17
  290. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/star-light.d.mts +9 -8
  291. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/sunburst.d.mts +18 -16
  292. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/swirling-rainbow.d.mts +9 -9
  293. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/torch.d.mts +18 -16
  294. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/vortex.d.mts +18 -16
  295. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/wave.d.mts +18 -16
  296. package/src/foundry/client/pixi/webgl/shaders/lighting/illumination-lighting.d.mts +9 -8
  297. package/src/foundry/client/pixi/webgl/shaders/region/adjust-darkness-level.d.mts +70 -28
  298. package/src/foundry/client/pixi/webgl/shaders/region/base.d.mts +52 -8
  299. package/src/foundry/client/pixi/webgl/shaders/region/highlight.d.mts +68 -8
  300. package/src/foundry/client/pixi/webgl/shaders/samplers/base-sampler.d.mts +23 -24
  301. package/src/foundry/client/pixi/webgl/shaders/samplers/baseline-illumination.d.mts +9 -8
  302. package/src/foundry/client/pixi/webgl/shaders/samplers/color-adjustment.d.mts +37 -28
  303. package/src/foundry/client/pixi/webgl/shaders/samplers/depth.d.mts +20 -16
  304. package/src/foundry/client/pixi/webgl/shaders/samplers/fog-of-war.d.mts +9 -8
  305. package/src/foundry/client/pixi/webgl/shaders/samplers/occlusion.d.mts +19 -17
  306. package/src/foundry/client/pixi/webgl/shaders/samplers/primary.d.mts +9 -0
  307. package/src/foundry/client/pixi/webgl/shaders/samplers/token-ring.d.mts +29 -1
  308. package/src/foundry/client/pixi/webgl/shaders/vision/background-vision.d.mts +9 -8
  309. package/src/foundry/client/pixi/webgl/shaders/vision/base-vision.d.mts +10 -8
  310. package/src/foundry/client/pixi/webgl/shaders/vision/coloration-vision.d.mts +9 -8
  311. package/src/foundry/client/pixi/webgl/shaders/vision/effects/amplification.d.mts +9 -8
  312. package/src/foundry/client/pixi/webgl/shaders/vision/effects/wave.d.mts +18 -16
  313. package/src/foundry/client/pixi/webgl/shaders/vision/illumination-vision.d.mts +9 -8
  314. package/src/foundry/client/pixi/webgl/shaders/weather/base-weather.d.mts +37 -32
  315. package/src/foundry/client/pixi/webgl/shaders/weather/effect.d.mts +15 -14
  316. package/src/foundry/client/pixi/webgl/shaders/weather/fog.d.mts +16 -15
  317. package/src/foundry/client/pixi/webgl/shaders/weather/rain.d.mts +18 -17
  318. package/src/foundry/client/pixi/webgl/shaders/weather/snow.d.mts +14 -13
  319. package/src/foundry/client/pixi/workers/texture-worker.d.mts +33 -53
  320. package/src/foundry/client/ui/dialog.d.mts +136 -125
  321. package/src/foundry/client/ui/drag.d.mts +1 -1
  322. package/src/foundry/client/ui/dragdrop.d.mts +1 -1
  323. package/src/foundry/client/ui/editor.d.mts +3 -3
  324. package/src/foundry/client/ui/filepicker.d.mts +1 -1
  325. package/src/foundry/client/ui/filter.d.mts +2 -2
  326. package/src/foundry/client/ui/index.d.mts +0 -2
  327. package/src/foundry/client-esm/_module.d.mts +112 -0
  328. package/src/foundry/client-esm/_types.d.mts +8 -0
  329. package/src/foundry/client-esm/applications/_module.d.mts +10 -5
  330. package/src/foundry/client-esm/applications/_types.d.mts +2 -2
  331. package/src/foundry/client-esm/applications/api/_module.d.mts +6 -5
  332. package/src/foundry/client-esm/applications/api/application.d.mts +221 -55
  333. package/src/foundry/client-esm/applications/api/category-browser.d.mts +40 -0
  334. package/src/foundry/client-esm/applications/api/dialog.d.mts +152 -74
  335. package/src/foundry/client-esm/applications/api/document-sheet.d.mts +21 -8
  336. package/src/foundry/client-esm/applications/api/handlebars-application.d.mts +161 -131
  337. package/src/foundry/client-esm/applications/apps/_module.d.mts +9 -2
  338. package/src/foundry/client-esm/applications/apps/av/_module.d.mts +7 -0
  339. package/src/foundry/client-esm/applications/apps/av/camera-popout.d.mts +23 -0
  340. package/src/foundry/client-esm/applications/apps/av/cameras.d.mts +95 -0
  341. package/src/foundry/client-esm/applications/apps/combat-tracker-config.d.mts +21 -0
  342. package/src/foundry/client-esm/applications/apps/compendium-art-config.d.mts +6 -5
  343. package/src/foundry/client-esm/applications/apps/document-ownership.d.mts +21 -0
  344. package/src/foundry/client-esm/applications/apps/document-sheet-config.d.mts +24 -0
  345. package/src/foundry/client-esm/applications/apps/file-picker.d.mts +410 -0
  346. package/src/foundry/client-esm/applications/apps/grid-config.d.mts +25 -0
  347. package/src/foundry/client-esm/applications/apps/image-popout.d.mts +56 -0
  348. package/src/foundry/client-esm/applications/apps/permission-config.d.mts +4 -4
  349. package/src/foundry/client-esm/applications/dice/_module.d.mts +2 -2
  350. package/src/foundry/client-esm/applications/dice/roll-resolver.d.mts +14 -2
  351. package/src/foundry/client-esm/applications/elements/_module.d.mts +5 -2
  352. package/src/foundry/client-esm/applications/elements/codemirror/element.d.mts +16 -0
  353. package/src/foundry/client-esm/applications/elements/codemirror/extensions.d.mts +20 -0
  354. package/src/foundry/client-esm/applications/elements/codemirror/view.d.mts +8 -0
  355. package/src/foundry/client-esm/applications/elements/document-embed.d.mts +14 -0
  356. package/src/foundry/client-esm/applications/elements/document-tags.d.mts +2 -0
  357. package/src/foundry/client-esm/applications/elements/enriched-content.d.mts +29 -0
  358. package/src/foundry/client-esm/applications/elements/multi-select.d.mts +15 -5
  359. package/src/foundry/client-esm/applications/elements/prosemirror-editor.d.mts +1 -1
  360. package/src/foundry/client-esm/applications/elements/secret-block.d.mts +7 -0
  361. package/src/foundry/client-esm/applications/elements/string-tags.d.mts +1 -1
  362. package/src/foundry/client-esm/applications/forms/fields.d.mts +6 -1
  363. package/src/foundry/client-esm/applications/handlebars.d.mts +3 -0
  364. package/src/foundry/client-esm/applications/hud/_module.d.mts +10 -0
  365. package/src/foundry/client-esm/applications/hud/container.d.mts +15 -0
  366. package/src/foundry/client-esm/applications/hud/drawing-hud.d.mts +19 -0
  367. package/src/foundry/client-esm/applications/hud/placeable-hud.d.mts +41 -0
  368. package/src/foundry/client-esm/applications/hud/tile-hud.d.mts +19 -0
  369. package/src/foundry/client-esm/applications/hud/token-hud.d.mts +20 -0
  370. package/src/foundry/client-esm/applications/quickstart.d.mts +20 -0
  371. package/src/foundry/client-esm/applications/settings/_module.d.mts +7 -0
  372. package/src/foundry/client-esm/applications/settings/config.d.mts +21 -0
  373. package/src/foundry/client-esm/applications/settings/dependency-resolution.d.mts +19 -0
  374. package/src/foundry/client-esm/applications/settings/menus/_module.d.mts +11 -0
  375. package/src/foundry/client-esm/applications/settings/menus/av-config.d.mts +27 -0
  376. package/src/foundry/client-esm/applications/settings/menus/default-sheets-config.d.mts +19 -0
  377. package/src/foundry/client-esm/applications/settings/menus/dice-config.d.mts +18 -0
  378. package/src/foundry/client-esm/applications/settings/menus/font-config.d.mts +43 -0
  379. package/src/foundry/client-esm/applications/settings/menus/prototype-overrides.d.mts +21 -0
  380. package/src/foundry/client-esm/applications/settings/menus/ui-config.d.mts +26 -0
  381. package/src/foundry/client-esm/applications/sheets/_module.d.mts +30 -5
  382. package/src/foundry/client-esm/applications/sheets/active-effect-config.d.mts +25 -0
  383. package/src/foundry/client-esm/applications/sheets/actor-sheet.d.mts +1 -1
  384. package/src/foundry/client-esm/applications/sheets/adventure-exporter.d.mts +25 -0
  385. package/src/foundry/client-esm/applications/sheets/adventure-importer.d.mts +25 -0
  386. package/src/foundry/client-esm/applications/sheets/ambient-light-config.d.mts +9 -6
  387. package/src/foundry/client-esm/applications/sheets/ambient-sound-config.d.mts +3 -3
  388. package/src/foundry/client-esm/applications/sheets/base-sheet.d.mts +23 -0
  389. package/src/foundry/client-esm/applications/sheets/card-config.d.mts +25 -0
  390. package/src/foundry/client-esm/applications/sheets/cards-config.d.mts +49 -0
  391. package/src/foundry/client-esm/applications/sheets/combatant-config.d.mts +25 -0
  392. package/src/foundry/client-esm/applications/sheets/drawing-config.d.mts +25 -0
  393. package/src/foundry/client-esm/applications/sheets/folder-config.d.mts +25 -0
  394. package/src/foundry/client-esm/applications/sheets/item-sheet.d.mts +1 -1
  395. package/src/foundry/client-esm/applications/sheets/journal/_module.d.mts +16 -0
  396. package/src/foundry/client-esm/applications/sheets/journal/dialog-show.d.mts +19 -0
  397. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-category-config.d.mts +25 -0
  398. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-page-hbs-sheet.d.mts +19 -0
  399. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-page-image-sheet.d.mts +18 -0
  400. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-page-markdown-sheet.d.mts +18 -0
  401. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-page-pdf-sheet.d.mts +18 -0
  402. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-page-prose-mirror-sheet.d.mts +18 -0
  403. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-page-sheet.d.mts +28 -0
  404. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-page-text-sheet.d.mts +18 -0
  405. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-page-video-sheet.d.mts +18 -0
  406. package/src/foundry/client-esm/applications/sheets/journal/journal-entry-sheet.d.mts +35 -0
  407. package/src/foundry/client-esm/applications/sheets/macro-config.d.mts +25 -0
  408. package/src/foundry/client-esm/applications/sheets/note-config.d.mts +25 -0
  409. package/src/foundry/client-esm/applications/sheets/playlist-config.d.mts +25 -0
  410. package/src/foundry/client-esm/applications/sheets/playlist-sound-config.d.mts +25 -0
  411. package/src/foundry/client-esm/applications/sheets/region-behavior-config.d.mts +29 -5
  412. package/src/foundry/client-esm/applications/sheets/region-config.d.mts +35 -5
  413. package/src/foundry/client-esm/applications/sheets/roll-table-config.d.mts +25 -0
  414. package/src/foundry/client-esm/applications/sheets/roll-table-sheet.d.mts +25 -0
  415. package/src/foundry/client-esm/applications/sheets/scene-config.d.mts +25 -0
  416. package/src/foundry/client-esm/applications/sheets/table-result-config.d.mts +25 -0
  417. package/src/foundry/client-esm/applications/sheets/template-config.d.mts +25 -0
  418. package/src/foundry/client-esm/applications/sheets/tile-config.d.mts +25 -0
  419. package/src/foundry/client-esm/applications/sheets/token/_module.d.mts +7 -0
  420. package/src/foundry/client-esm/applications/sheets/token/mixin.d.mts +27 -0
  421. package/src/foundry/client-esm/applications/sheets/token/prototype-config.d.mts +18 -0
  422. package/src/foundry/client-esm/applications/sheets/token/token-config.d.mts +25 -0
  423. package/src/foundry/client-esm/applications/sheets/user-config.d.mts +3 -3
  424. package/src/foundry/client-esm/applications/sheets/wall-config.d.mts +25 -0
  425. package/src/foundry/client-esm/applications/sidebar/_module.d.mts +10 -0
  426. package/src/foundry/client-esm/applications/sidebar/apps/_module.d.mts +15 -0
  427. package/src/foundry/client-esm/applications/sidebar/apps/chat-popout.d.mts +22 -0
  428. package/src/foundry/client-esm/applications/sidebar/apps/compendium.d.mts +21 -0
  429. package/src/foundry/client-esm/applications/sidebar/apps/controls-config.d.mts +20 -0
  430. package/src/foundry/client-esm/applications/sidebar/apps/folder-export.d.mts +18 -0
  431. package/src/foundry/client-esm/applications/sidebar/apps/frame-viewer.d.mts +22 -0
  432. package/src/foundry/client-esm/applications/sidebar/apps/invitation-links.d.mts +17 -0
  433. package/src/foundry/client-esm/applications/sidebar/apps/module-management.d.mts +21 -0
  434. package/src/foundry/client-esm/applications/sidebar/apps/support-details.d.mts +17 -0
  435. package/src/foundry/client-esm/applications/sidebar/apps/tours-management.d.mts +20 -0
  436. package/src/foundry/client-esm/applications/sidebar/apps/world-config.d.mts +19 -0
  437. package/src/foundry/client-esm/applications/sidebar/document-directory.d.mts +30 -0
  438. package/src/foundry/client-esm/applications/sidebar/sidebar-tab.d.mts +86 -0
  439. package/src/foundry/client-esm/applications/sidebar/sidebar.d.mts +18 -0
  440. package/src/foundry/client-esm/applications/sidebar/tabs/_module.d.mts +17 -0
  441. package/src/foundry/client-esm/applications/sidebar/tabs/actor-directory.d.mts +20 -0
  442. package/src/foundry/client-esm/applications/sidebar/tabs/cards-directory.d.mts +20 -0
  443. package/src/foundry/client-esm/applications/sidebar/tabs/chat.d.mts +19 -0
  444. package/src/foundry/client-esm/applications/sidebar/tabs/combat-tracker.d.mts +19 -0
  445. package/src/foundry/client-esm/applications/sidebar/tabs/compendium-directory.d.mts +19 -0
  446. package/src/foundry/client-esm/applications/sidebar/tabs/item-directory.d.mts +20 -0
  447. package/src/foundry/client-esm/applications/sidebar/tabs/journal-directory.d.mts +20 -0
  448. package/src/foundry/client-esm/applications/sidebar/tabs/macro-directory.d.mts +20 -0
  449. package/src/foundry/client-esm/applications/sidebar/tabs/playlist-directory.d.mts +20 -0
  450. package/src/foundry/client-esm/applications/sidebar/tabs/roll-table-directory.d.mts +20 -0
  451. package/src/foundry/client-esm/applications/sidebar/tabs/scene-directory.d.mts +20 -0
  452. package/src/foundry/client-esm/applications/sidebar/tabs/settings.d.mts +18 -0
  453. package/src/foundry/client-esm/applications/ui/_module.d.mts +9 -2
  454. package/src/foundry/client-esm/applications/ui/game-pause.d.mts +22 -0
  455. package/src/foundry/client-esm/applications/ui/hotbar.d.mts +29 -0
  456. package/src/foundry/client-esm/applications/ui/main-menu.d.mts +27 -0
  457. package/src/foundry/client-esm/applications/ui/notifications.d.mts +208 -0
  458. package/src/foundry/client-esm/applications/ui/players.d.mts +26 -0
  459. package/src/foundry/client-esm/applications/ui/region-legend.d.mts +48 -3
  460. package/src/foundry/client-esm/applications/ui/scene-controls.d.mts +20 -0
  461. package/src/foundry/client-esm/applications/ui/scene-navigation.d.mts +28 -0
  462. package/src/foundry/client-esm/applications/ux/_module.d.mts +14 -0
  463. package/src/foundry/client-esm/applications/ux/context-menu.d.mts +359 -0
  464. package/src/foundry/client-esm/applications/ux/drag-drop.d.mts +21 -0
  465. package/src/foundry/client-esm/applications/ux/draggable.d.mts +9 -0
  466. package/src/foundry/client-esm/applications/ux/form-data-extended.d.mts +17 -0
  467. package/src/foundry/client-esm/applications/ux/html-secret.d.mts +21 -0
  468. package/src/foundry/client-esm/applications/ux/prosemirror-editor.d.mts +9 -0
  469. package/src/foundry/client-esm/applications/ux/search-filter.d.mts +9 -0
  470. package/src/foundry/client-esm/applications/ux/tabs.d.mts +29 -0
  471. package/src/foundry/client-esm/applications/ux/text-editor.d.mts +9 -0
  472. package/src/foundry/client-esm/appv1/_module.d.mts +7 -0
  473. package/src/foundry/client-esm/appv1/api/_module.d.mts +9 -0
  474. package/src/foundry/client-esm/appv1/api/application-v1.d.mts +5 -0
  475. package/src/foundry/client-esm/appv1/api/dialog-v1.d.mts +5 -0
  476. package/src/foundry/client-esm/appv1/api/document-sheet-v1.d.mts +5 -0
  477. package/src/foundry/client-esm/appv1/api/form-application-v1.d.mts +5 -0
  478. package/src/foundry/client-esm/appv1/sheets/_module.d.mts +10 -0
  479. package/src/foundry/client-esm/appv1/sheets/actor-sheet.d.mts +5 -0
  480. package/src/foundry/client-esm/appv1/sheets/adventure-importer.d.mts +5 -0
  481. package/src/foundry/client-esm/appv1/sheets/item-sheet.d.mts +5 -0
  482. package/src/foundry/client-esm/appv1/sheets/journal-page-sheet.d.mts +7 -0
  483. package/src/foundry/client-esm/appv1/sheets/journal-sheet.d.mts +5 -0
  484. package/src/foundry/client-esm/audio/_module.d.mts +2 -3
  485. package/src/foundry/client-esm/audio/_types.d.mts +1 -1
  486. package/src/foundry/client-esm/audio/biquad.d.mts +1 -1
  487. package/src/foundry/client-esm/audio/convolver.d.mts +1 -1
  488. package/src/foundry/client-esm/audio/helper.d.mts +6 -5
  489. package/src/foundry/client-esm/audio/sound.d.mts +2 -2
  490. package/src/foundry/client-esm/audio/timeout.d.mts +5 -2
  491. package/src/foundry/client-esm/av/_module.d.mts +10 -0
  492. package/src/foundry/client-esm/av/client.d.mts +18 -0
  493. package/src/foundry/client-esm/av/clients/_module.d.mts +6 -0
  494. package/src/foundry/client-esm/av/clients/simplepeer.d.mts +11 -0
  495. package/src/foundry/client-esm/av/master.d.mts +12 -0
  496. package/src/foundry/client-esm/av/settings.d.mts +30 -0
  497. package/src/foundry/client-esm/canvas/_module.d.mts +2 -2
  498. package/src/foundry/client-esm/canvas/edges/_module.d.mts +2 -2
  499. package/src/foundry/client-esm/canvas/edges/collision.d.mts +61 -18
  500. package/src/foundry/client-esm/canvas/edges/edge.d.mts +106 -42
  501. package/src/foundry/client-esm/canvas/edges/edges.d.mts +9 -0
  502. package/src/foundry/client-esm/canvas/edges/vertex.d.mts +51 -23
  503. package/src/foundry/client-esm/canvas/regions/_module.d.mts +2 -3
  504. package/src/foundry/client-esm/canvas/regions/geometry.d.mts +31 -0
  505. package/src/foundry/client-esm/canvas/regions/mesh.d.mts +61 -0
  506. package/src/foundry/client-esm/canvas/regions/polygon-tree.d.mts +101 -0
  507. package/src/foundry/client-esm/canvas/regions/shape.d.mts +118 -0
  508. package/src/foundry/client-esm/canvas/scene-manager.d.mts +12 -3
  509. package/src/foundry/client-esm/canvas/smaa/smaa.d.mts +2 -3
  510. package/src/foundry/client-esm/canvas/sources/_module.d.mts +2 -2
  511. package/src/foundry/client-esm/canvas/sources/base-effect-source.d.mts +32 -18
  512. package/src/foundry/client-esm/canvas/sources/base-light-source.d.mts +53 -15
  513. package/src/foundry/client-esm/canvas/sources/global-light-source.d.mts +18 -3
  514. package/src/foundry/client-esm/canvas/sources/point-darkness-source.d.mts +47 -23
  515. package/src/foundry/client-esm/canvas/sources/point-effect-source.d.mts +17 -7
  516. package/src/foundry/client-esm/canvas/sources/point-light-source.d.mts +26 -14
  517. package/src/foundry/client-esm/canvas/sources/point-movement-source.d.mts +20 -4
  518. package/src/foundry/client-esm/canvas/sources/point-sound-source.d.mts +26 -8
  519. package/src/foundry/client-esm/canvas/sources/point-vision-source.d.mts +26 -25
  520. package/src/foundry/client-esm/canvas/sources/rendered-effect-source.d.mts +89 -52
  521. package/src/foundry/client-esm/canvas/tokens/_module.d.mts +2 -3
  522. package/src/foundry/client-esm/canvas/tokens/ring-config.d.mts +112 -2
  523. package/src/foundry/client-esm/canvas/tokens/ring-data.d.mts +170 -3
  524. package/src/foundry/client-esm/canvas/tokens/ring.d.mts +189 -2
  525. package/src/foundry/client-esm/client.d.mts +56 -63
  526. package/src/foundry/client-esm/config.d.mts +1 -0
  527. package/src/foundry/client-esm/data/_module.d.mts +8 -3
  528. package/src/foundry/client-esm/data/_types.d.mts +10 -0
  529. package/src/foundry/client-esm/data/calendar.d.mts +213 -0
  530. package/src/foundry/client-esm/data/client-backend.d.mts +17 -18
  531. package/src/foundry/client-esm/data/combat-config.d.mts +53 -0
  532. package/src/foundry/client-esm/data/region-behaviors/_module.d.mts +3 -3
  533. package/src/foundry/client-esm/data/region-behaviors/adjust-darkness-level.d.mts +57 -0
  534. package/src/foundry/client-esm/data/region-behaviors/base.d.mts +59 -0
  535. package/src/foundry/client-esm/data/region-behaviors/display-scrolling-text.d.mts +64 -0
  536. package/src/foundry/client-esm/data/region-behaviors/execute-macro.d.mts +27 -0
  537. package/src/foundry/client-esm/data/region-behaviors/execute-script.d.mts +23 -0
  538. package/src/foundry/client-esm/data/region-behaviors/pause-game.d.mts +23 -0
  539. package/src/foundry/client-esm/data/region-behaviors/suppress-weather.d.mts +17 -0
  540. package/src/foundry/client-esm/data/region-behaviors/teleport-token.d.mts +32 -0
  541. package/src/foundry/client-esm/data/region-behaviors/toggle-behavior.d.mts +31 -0
  542. package/src/foundry/client-esm/data/terrain-data.d.mts +22 -0
  543. package/src/foundry/client-esm/dice/_module.d.mts +2 -3
  544. package/src/foundry/client-esm/dice/parser.d.mts +8 -0
  545. package/src/foundry/client-esm/dice/roll.d.mts +64 -30
  546. package/src/foundry/client-esm/dice/terms/_module.d.mts +2 -3
  547. package/src/foundry/client-esm/dice/terms/coin.d.mts +8 -1
  548. package/src/foundry/client-esm/dice/terms/dice.d.mts +11 -2
  549. package/src/foundry/client-esm/dice/terms/die.d.mts +9 -2
  550. package/src/foundry/client-esm/dice/terms/fate.d.mts +9 -2
  551. package/src/foundry/client-esm/dice/terms/function.d.mts +5 -2
  552. package/src/foundry/client-esm/dice/terms/numeric.d.mts +1 -1
  553. package/src/foundry/client-esm/dice/terms/operator.d.mts +1 -1
  554. package/src/foundry/client-esm/dice/terms/parenthetical.d.mts +1 -1
  555. package/src/foundry/client-esm/dice/terms/pool.d.mts +15 -6
  556. package/src/foundry/client-esm/dice/terms/string.d.mts +1 -1
  557. package/src/foundry/client-esm/dice/terms/term.d.mts +12 -3
  558. package/src/foundry/client-esm/documents/_module.d.mts +11 -0
  559. package/src/foundry/client-esm/documents/_types.d.mts +8 -0
  560. package/src/foundry/client-esm/documents/abstract/_module.d.mts +6 -0
  561. package/src/foundry/client-esm/documents/collections/_module.d.mts +6 -0
  562. package/src/foundry/client-esm/game.d.mts +7 -0
  563. package/src/foundry/client-esm/helpers/_module.d.mts +2 -2
  564. package/src/foundry/client-esm/helpers/_types.d.mts +1 -1
  565. package/src/foundry/client-esm/hooks.d.mts +1 -0
  566. package/src/foundry/client-esm/nue/_module.d.mts +9 -0
  567. package/src/foundry/client-esm/nue/nue-manager.d.mts +18 -0
  568. package/src/foundry/client-esm/nue/tour.d.mts +9 -0
  569. package/src/foundry/client-esm/nue/tours/_module.d.mts +8 -0
  570. package/src/foundry/client-esm/nue/tours/canvas-tour.d.mts +12 -0
  571. package/src/foundry/client-esm/nue/tours/setup-tour.d.mts +11 -0
  572. package/src/foundry/client-esm/nue/tours/sidebar-tour.d.mts +11 -0
  573. package/src/foundry/client-esm/nue/tours-collection.d.mts +25 -0
  574. package/src/foundry/client-esm/packages/_module.d.mts +22 -0
  575. package/src/foundry/client-esm/packages/_types.d.mts +11 -0
  576. package/src/foundry/client-esm/packages/client-package.d.mts +11 -0
  577. package/src/foundry/client-esm/packages/module.d.mts +8 -0
  578. package/src/foundry/client-esm/packages/system.d.mts +8 -0
  579. package/src/foundry/client-esm/packages/world.d.mts +8 -0
  580. package/src/foundry/client-esm/ui.d.mts +1 -0
  581. package/src/foundry/client-esm/utils/_module.d.mts +7 -0
  582. package/src/foundry/client-esm/utils/_types.d.mts +2 -0
  583. package/src/foundry/client-esm/utils/helpers.d.mts +6 -0
  584. package/src/foundry/common/{types.d.mts → _types.d.mts} +3 -3
  585. package/src/foundry/common/abstract/{module.d.mts → _module.d.mts} +2 -2
  586. package/src/foundry/common/abstract/backend.d.mts +38 -44
  587. package/src/foundry/common/abstract/data.d.mts +22 -51
  588. package/src/foundry/common/abstract/document.d.mts +212 -121
  589. package/src/foundry/common/abstract/embedded-collection-delta.d.mts +1 -1
  590. package/src/foundry/common/abstract/embedded-collection.d.mts +37 -7
  591. package/src/foundry/common/abstract/socket.d.mts +1 -1
  592. package/src/foundry/common/abstract/type-data.d.mts +40 -24
  593. package/src/foundry/common/config.d.mts +3 -1
  594. package/src/foundry/common/constants.d.mts +234 -205
  595. package/src/foundry/common/data/{module.d.mts → _module.d.mts} +2 -2
  596. package/src/foundry/common/data/_types.d.mts +47 -0
  597. package/src/foundry/common/data/data.d.mts +25 -19
  598. package/src/foundry/common/data/fields.d.mts +469 -423
  599. package/src/foundry/common/data/validation-failure.d.mts +4 -6
  600. package/src/foundry/common/documents/_module.d.mts +4 -2
  601. package/src/foundry/common/documents/_types.d.mts +10 -45
  602. package/src/foundry/common/documents/active-effect.d.mts +7 -4
  603. package/src/foundry/common/documents/actor-delta.d.mts +7 -5
  604. package/src/foundry/common/documents/actor.d.mts +6 -19
  605. package/src/foundry/common/documents/adventure.d.mts +13 -2
  606. package/src/foundry/common/documents/ambient-light.d.mts +3 -1
  607. package/src/foundry/common/documents/ambient-sound.d.mts +3 -1
  608. package/src/foundry/common/documents/card.d.mts +6 -4
  609. package/src/foundry/common/documents/cards.d.mts +3 -1
  610. package/src/foundry/common/documents/chat-message.d.mts +10 -8
  611. package/src/foundry/common/documents/combat.d.mts +3 -1
  612. package/src/foundry/common/documents/combatant.d.mts +4 -12
  613. package/src/foundry/common/documents/drawing.d.mts +6 -4
  614. package/src/foundry/common/documents/fog-exploration.d.mts +3 -1
  615. package/src/foundry/common/documents/folder.d.mts +9 -1
  616. package/src/foundry/common/documents/item.d.mts +5 -3
  617. package/src/foundry/common/documents/journal-entry-page.d.mts +3 -2
  618. package/src/foundry/common/documents/journal-entry.d.mts +3 -1
  619. package/src/foundry/common/documents/macro.d.mts +5 -3
  620. package/src/foundry/common/documents/measured-template.d.mts +6 -8
  621. package/src/foundry/common/documents/module.d.mts +2 -2
  622. package/src/foundry/common/documents/note.d.mts +4 -2
  623. package/src/foundry/common/documents/playlist-sound.d.mts +4 -2
  624. package/src/foundry/common/documents/playlist.d.mts +3 -1
  625. package/src/foundry/common/documents/region-behavior.d.mts +88 -0
  626. package/src/foundry/common/documents/region.d.mts +108 -0
  627. package/src/foundry/common/documents/roll-table.d.mts +3 -1
  628. package/src/foundry/common/documents/scene.d.mts +9 -1
  629. package/src/foundry/common/documents/setting.d.mts +3 -2
  630. package/src/foundry/common/documents/table-result.d.mts +4 -4
  631. package/src/foundry/common/documents/tile.d.mts +3 -1
  632. package/src/foundry/common/documents/token.d.mts +15 -7
  633. package/src/foundry/common/documents/user.d.mts +7 -5
  634. package/src/foundry/common/documents/wall.d.mts +12 -15
  635. package/src/foundry/common/grid/_module.d.mts +3 -3
  636. package/src/foundry/common/grid/_types.d.mts +47 -0
  637. package/src/foundry/common/grid/base.d.mts +10 -14
  638. package/src/foundry/common/grid/gridless.d.mts +2 -2
  639. package/src/foundry/common/grid/hexagonal.d.mts +21 -10
  640. package/src/foundry/common/grid/square.d.mts +2 -2
  641. package/src/foundry/common/packages/{module.d.mts → _module.d.mts} +2 -2
  642. package/src/foundry/common/packages/_types.d.mts +25 -0
  643. package/src/foundry/common/packages/base-package.d.mts +6 -6
  644. package/src/foundry/common/packages/base-system.d.mts +19 -4
  645. package/src/foundry/common/packages/base-world.d.mts +2 -2
  646. package/src/foundry/common/packages/sub-types.d.mts +1 -1
  647. package/src/foundry/common/primitives/array.d.mts +1 -1
  648. package/src/foundry/common/primitives/number.d.mts +1 -1
  649. package/src/foundry/common/primitives/string.d.mts +1 -1
  650. package/src/foundry/common/prosemirror/_module.d.mts +15 -15
  651. package/src/foundry/common/prosemirror/_types.d.mts +29 -0
  652. package/src/foundry/common/prosemirror/dirty-plugin.d.mts +1 -1
  653. package/src/foundry/common/prosemirror/dom-parser.d.mts +2 -1
  654. package/src/foundry/common/prosemirror/highlight-matches-plugin.d.mts +1 -1
  655. package/src/foundry/common/prosemirror/image-plugin.d.mts +1 -1
  656. package/src/foundry/common/prosemirror/paste-transformer.d.mts +1 -1
  657. package/src/foundry/common/prosemirror/plugin.d.mts +1 -1
  658. package/src/foundry/common/prosemirror/schema/index.d.mts +1 -1
  659. package/src/foundry/common/prosemirror/schema/lists.d.mts +2 -0
  660. package/src/foundry/common/utils/{module.d.mts → _module.d.mts} +2 -2
  661. package/src/foundry/common/utils/_types.d.mts +1 -0
  662. package/src/foundry/common/utils/bitmask.d.mts +20 -11
  663. package/src/foundry/common/utils/collection.d.mts +7 -19
  664. package/src/foundry/common/utils/color.d.mts +20 -2
  665. package/src/foundry/common/utils/event-emitter.d.mts +1 -1
  666. package/src/foundry/common/utils/geometry.d.mts +12 -2
  667. package/src/foundry/common/utils/helpers.d.mts +23 -13
  668. package/src/foundry/common/utils/string-tree.d.mts +1 -1
  669. package/src/foundry/common/utils/word-tree.d.mts +1 -1
  670. package/src/foundry/index.d.mts +0 -1
  671. package/src/foundry/{clipper → public/scripts/clipper}/clipper.d.mts +52 -43
  672. package/src/foundry/public/scripts/index.d.mts +1 -0
  673. package/src/foundry/public/scripts/workers/image-compressor.d.mts +23 -0
  674. package/src/foundry/public/scripts/workers/index.d.mts +1 -0
  675. package/{index-lenient.d.mts → src/index-lenient.d.mts} +2 -0
  676. package/src/index.d.mts +6 -0
  677. package/src/tsconfig.json +19 -0
  678. package/src/types/augments/particles.d.mts +29 -0
  679. package/src/types/augments/pixi.d.mts +1013 -10
  680. package/src/types/augments/smooth.d.mts +31 -0
  681. package/src/types/augments/tinyMCE.d.mts +1 -1
  682. package/src/types/config.d.mts +20 -311
  683. package/src/types/documentConfiguration.d.mts +91 -32
  684. package/src/types/index.d.mts +1 -1
  685. package/src/types/lib.d.mts +12 -0
  686. package/src/types/workers/image-compressor.d.mts +176 -0
  687. package/src/utils/index.d.mts +1091 -0
  688. package/index.d.mts +0 -5
  689. package/src/foundry/client/ui/context.d.mts +0 -213
  690. package/src/foundry/client/ui/notifications.d.mts +0 -136
  691. package/src/foundry/common/primitives/regex.d.mts +0 -12
  692. package/src/types/helperTypes.d.mts +0 -389
  693. package/src/types/utils.d.mts +0 -520
  694. /package/src/foundry/common/primitives/{module.d.mts → _module.d.mts} +0 -0
  695. /package/src/foundry/{clipper → public/scripts/clipper}/index.d.mts +0 -0
@@ -5,43 +5,49 @@ import type {
5
5
  ConstructorData,
6
6
  } from "../../../types/documentConfiguration.d.mts";
7
7
  import type {
8
- DatabaseOperationsFor,
9
8
  GetKey,
10
9
  InterfaceToObject,
11
10
  MakeConform,
12
11
  MustConform,
13
12
  ToMethod,
14
- } from "../../../types/helperTypes.mts";
15
- import type {
16
13
  AnyObject,
17
14
  DeepPartial,
18
15
  EmptyObject,
19
16
  InexactPartial,
20
17
  RemoveIndexSignatures,
21
- } from "../../../types/utils.mts";
22
- import type { documents } from "../../client-esm/client.d.mts";
18
+ FixedInstanceType,
19
+ } from "../../../utils/index.d.mts";
23
20
  import type * as CONST from "../constants.mts";
24
21
  import type { DataField, EmbeddedCollectionField, EmbeddedDocumentField } from "../data/fields.d.mts";
25
- import type { fields } from "../data/module.mts";
22
+ import type { fields } from "../data/_module.d.mts";
26
23
  import type { LogCompatibilityWarningOptions } from "../utils/logging.mts";
27
24
  import type {
25
+ DatabaseAction,
28
26
  DatabaseCreateOperation,
29
27
  DatabaseDeleteOperation,
30
28
  DatabaseGetOperation,
31
29
  DatabaseUpdateOperation,
30
+ DocumentSocketRequest,
32
31
  } from "./_types.d.mts";
33
32
  import type DataModel from "./data.mts";
33
+ import type DocumentSocketResponse from "./socket.d.mts";
34
34
 
35
- export default Document;
36
-
37
- declare const __DocumentBrand: unique symbol;
35
+ type DataSchema = foundry.data.fields.DataSchema;
38
36
 
39
- declare const __Schema: unique symbol;
40
- declare const __Parent: unique symbol;
37
+ export default Document;
41
38
 
42
39
  type _ClassMustBeAssignableToInternal = MustConform<typeof Document, Document.Internal.Constructor>;
43
40
  type _InstanceMustBeAssignableToInternal = MustConform<Document.Any, Document.Internal.Instance.Any>;
44
41
 
42
+ type _ConfigurationFailureClassMustBeAssignableToInternal = MustConform<
43
+ Document.ConfigurationFailureClass,
44
+ Document.Internal.Constructor
45
+ >;
46
+ type _ConfigurationFailureInstanceMustBeAssignableToInternal = MustConform<
47
+ Document.ConfigurationFailureInstance,
48
+ Document.Internal.Instance.Any
49
+ >;
50
+
45
51
  /**
46
52
  * An extension of the base DataModel which defines a Document.
47
53
  * Documents are special in that they are persisted to the database and referenced by _id.
@@ -51,10 +57,11 @@ declare abstract class Document<
51
57
  Schema extends DataSchema,
52
58
  Parent extends Document.Any | null = null,
53
59
  > extends DataModel<Schema, Parent, InterfaceToObject<Document.ConstructionContext<Parent>>> {
54
- static [__DocumentBrand]: never;
60
+ static [Document.Internal.DocumentBrand]: true;
55
61
 
56
- [__Schema]: Schema;
57
- [__Parent]: Parent;
62
+ [Document.Internal.DocumentName]: DocumentName;
63
+ [Document.Internal.Schema]: Schema;
64
+ [Document.Internal.Parent]: Parent;
58
65
 
59
66
  /**
60
67
  * @param data - Initial data provided to construct the Document
@@ -130,8 +137,6 @@ declare abstract class Document<
130
137
  /**
131
138
  * Return a reference to the implemented subclass of this base document type.
132
139
  */
133
- // Referencing the concrete class the config is not possible because accessors cannot be generic and there is not
134
- // static polymorphic this type
135
140
  static get implementation(): Document.AnyConstructor;
136
141
 
137
142
  /**
@@ -157,7 +162,7 @@ declare abstract class Document<
157
162
  /**
158
163
  * The canonical name of this Document type, for example "Actor".
159
164
  */
160
- get documentName(): Document.Internal.SimpleMetadata<DocumentName>["name"];
165
+ get documentName(): DocumentName;
161
166
 
162
167
  /**
163
168
  * The allowed types which may exist for this Document class
@@ -201,7 +206,7 @@ declare abstract class Document<
201
206
  * @param user - The User being tested
202
207
  * @returns Does the User have a sufficient role to create?
203
208
  */
204
- static canUserCreate(user: foundry.documents.BaseUser): boolean;
209
+ static canUserCreate(user: User): boolean;
205
210
 
206
211
  /**
207
212
  * Get the explicit permission level that a specific User has over this Document, a value in CONST.DOCUMENT_OWNERSHIP_LEVELS.
@@ -211,7 +216,7 @@ declare abstract class Document<
211
216
  * (default: `game.user`)
212
217
  * @returns A numeric permission level from CONST.DOCUMENT_OWNERSHIP_LEVELS or null
213
218
  */
214
- getUserLevel(user?: foundry.documents.BaseUser): CONST.DOCUMENT_OWNERSHIP_LEVELS | null;
219
+ getUserLevel(user?: User): CONST.DOCUMENT_OWNERSHIP_LEVELS | null;
215
220
 
216
221
  /**
217
222
  * Test whether a certain User has a requested permission level (or greater) over the Document
@@ -221,7 +226,7 @@ declare abstract class Document<
221
226
  * @returns Does the user have this permission level over the Document?
222
227
  */
223
228
  testUserPermission(
224
- user: foundry.documents.BaseUser,
229
+ user: User,
225
230
  permission: keyof typeof CONST.DOCUMENT_OWNERSHIP_LEVELS | CONST.DOCUMENT_OWNERSHIP_LEVELS,
226
231
  options?: InexactPartial<{
227
232
  /**
@@ -240,7 +245,7 @@ declare abstract class Document<
240
245
  * (default: `{}`)
241
246
  * @returns Does the User have permission?
242
247
  */
243
- canUserModify(user: foundry.documents.BaseUser, action: "create" | "update" | "delete", data?: object): boolean;
248
+ canUserModify(user: User, action: "create" | "update" | "delete", data?: object): boolean;
244
249
 
245
250
  /**
246
251
  * Clone a document, creating a new document by combining current data with provided overrides.
@@ -321,8 +326,10 @@ declare abstract class Document<
321
326
  */
322
327
  static createDocuments<T extends Document.AnyConstructor, Temporary extends boolean | undefined>(
323
328
  this: T,
324
- data: Array<Document.ConstructorDataFor<T>>,
325
- operation?: InexactPartial<Omit<DatabaseOperationsFor<T["metadata"]["name"], "create">, "data">> & {
329
+ data: Array<Document.ConstructorDataFor<NoInfer<T>>>,
330
+ operation?: InexactPartial<
331
+ Omit<Document.Database.OperationOf<NoInfer<T>["metadata"]["name"], "create">, "data">
332
+ > & {
326
333
  temporary?: Temporary;
327
334
  },
328
335
  ): Promise<Document.ToStoredIf<T, Temporary>[] | undefined>;
@@ -364,8 +371,10 @@ declare abstract class Document<
364
371
  */
365
372
  static updateDocuments<T extends Document.AnyConstructor>(
366
373
  this: T,
367
- updates?: Array<DeepPartial<Document.UpdateDataFor<T>>>,
368
- operation?: InexactPartial<Omit<DatabaseOperationsFor<InstanceType<T>["documentName"], "update">, "updates">>,
374
+ updates?: Array<DeepPartial<Document.UpdateDataFor<NoInfer<T>>>>,
375
+ operation?: InexactPartial<
376
+ Omit<Document.Database.OperationOf<FixedInstanceType<NoInfer<T>>["documentName"], "update">, "updates">
377
+ >,
369
378
  ): Promise<Document.ToConfiguredInstance<T>[]>;
370
379
 
371
380
  /**
@@ -408,7 +417,9 @@ declare abstract class Document<
408
417
  static deleteDocuments<T extends Document.AnyConstructor>(
409
418
  this: T,
410
419
  ids?: string[],
411
- operation?: InexactPartial<Omit<DatabaseOperationsFor<InstanceType<T>["documentName"], "delete">, "ids">>,
420
+ operation?: InexactPartial<
421
+ Omit<Document.Database.OperationOf<FixedInstanceType<NoInfer<T>>["documentName"], "delete">, "ids">
422
+ >,
412
423
  ): Promise<Document.ToConfiguredInstance<T>[]>;
413
424
 
414
425
  /**
@@ -442,8 +453,10 @@ declare abstract class Document<
442
453
  */
443
454
  static create<T extends Document.AnyConstructor, Temporary extends boolean | undefined>(
444
455
  this: T,
445
- data: Document.ConstructorDataFor<T> | Document.ConstructorDataFor<T>[],
446
- operation?: InexactPartial<Omit<DatabaseOperationsFor<T["metadata"]["name"], "create">, "data">> & {
456
+ data: Document.ConstructorDataFor<NoInfer<T>> | Document.ConstructorDataFor<NoInfer<T>>[],
457
+ operation?: InexactPartial<
458
+ Omit<Document.Database.OperationOf<NoInfer<T>["metadata"]["name"], "create">, "data">
459
+ > & {
447
460
  temporary?: Temporary;
448
461
  },
449
462
  ): Promise<Document.ToStoredIf<T, Temporary> | undefined>;
@@ -462,7 +475,7 @@ declare abstract class Document<
462
475
  update(
463
476
  // TODO: Determine if this is Partial, DeepPartial, or InexactPartial.
464
477
  data?: Partial<Document.ConstructorDataForSchema<Schema>>,
465
- operation?: InexactPartial<Omit<DatabaseOperationsFor<DocumentName, "update">, "updates">>,
478
+ operation?: InexactPartial<Omit<Document.Database.OperationOf<DocumentName, "update">, "updates">>,
466
479
  ): Promise<this | undefined>;
467
480
 
468
481
  /**
@@ -475,7 +488,7 @@ declare abstract class Document<
475
488
  * @remarks If no document has actually been deleted, the returned {@link Promise} resolves to `undefined`.
476
489
  */
477
490
  delete(
478
- operation?: InexactPartial<Omit<DatabaseOperationsFor<DocumentName, "delete">, "ids">>,
491
+ operation?: InexactPartial<Omit<Document.Database.OperationOf<DocumentName, "delete">, "ids">>,
479
492
  ): Promise<this | undefined>;
480
493
 
481
494
  /**
@@ -511,10 +524,9 @@ declare abstract class Document<
511
524
  * @returns The Collection instance of embedded Documents of the requested type
512
525
  * @remarks Usually returns some form of DocumentCollection, but not always (e.g. Token["actors"])
513
526
  */
514
- // TODO: After regions are defined, change first parameter to `extends foundry.CONST.EMBEDDED_DOCUMENT_TYPES`
515
- getEmbeddedCollection<
516
- EmbeddedName extends Exclude<foundry.CONST.EMBEDDED_DOCUMENT_TYPES, "Region" | "RegionBehavior">,
517
- >(embeddedName: EmbeddedName): Collection<Document.ConfiguredInstanceForName<EmbeddedName>>;
527
+ getEmbeddedCollection<EmbeddedName extends foundry.CONST.EMBEDDED_DOCUMENT_TYPES>(
528
+ embeddedName: EmbeddedName,
529
+ ): Collection<Document.ConfiguredInstanceForName<EmbeddedName>>;
518
530
 
519
531
  /**
520
532
  * Get an embedded document by its id from a named collection in the parent document.
@@ -551,7 +563,6 @@ declare abstract class Document<
551
563
  * (default: `{}`)
552
564
  * @returns An array of created Document instances
553
565
  */
554
- // TODO: After regions are defined, change first parameter to `extends foundry.CONST.EMBEDDED_DOCUMENT_TYPES`
555
566
  // TODO: I think we could do a better job on all the embedded methods of limiting the types here based on the
556
567
  // allowed embedded types of the parent (vs. allowing any document to create embedded
557
568
  // documents of any type)
@@ -561,7 +572,7 @@ declare abstract class Document<
561
572
  >(
562
573
  embeddedName: EmbeddedName,
563
574
  data?: Array<Document.ConstructorDataForName<Extract<EmbeddedName, Document.Type>>>,
564
- operation?: InexactPartial<DatabaseOperationsFor<Extract<EmbeddedName, Document.Type>, "create">> & {
575
+ operation?: InexactPartial<Document.Database.OperationOf<Extract<EmbeddedName, Document.Type>, "create">> & {
565
576
  temporary?: Temporary;
566
577
  },
567
578
  ): Promise<Array<Document.ConfiguredInstanceForName<Extract<EmbeddedName, Document.Type>>> | undefined>;
@@ -576,7 +587,6 @@ declare abstract class Document<
576
587
  * (default: `{}`)
577
588
  * @returns An array of updated Document instances
578
589
  */
579
- // TODO: After regions are defined, change first parameter to `extends foundry.CONST.EMBEDDED_DOCUMENT_TYPES`
580
590
  updateEmbeddedDocuments<EmbeddedName extends foundry.CONST.EMBEDDED_DOCUMENT_TYPES>(
581
591
  embeddedName: EmbeddedName,
582
592
  updates?: Array<AnyObject>,
@@ -592,13 +602,10 @@ declare abstract class Document<
592
602
  * (default: `{}`)
593
603
  * @returns An array of deleted Document instances
594
604
  */
595
- // TODO: After regions are defined, change first parameter to `extends foundry.CONST.EMBEDDED_DOCUMENT_TYPES`
596
- deleteEmbeddedDocuments<
597
- EmbeddedName extends Exclude<foundry.CONST.EMBEDDED_DOCUMENT_TYPES, "Region" | "RegionBehavior">,
598
- >(
605
+ deleteEmbeddedDocuments<EmbeddedName extends foundry.CONST.EMBEDDED_DOCUMENT_TYPES>(
599
606
  embeddedName: EmbeddedName,
600
607
  ids: Array<string>,
601
- operation?: DatabaseOperationsFor<DocumentName, "delete">,
608
+ operation?: Document.Database.OperationOf<DocumentName, "delete">,
602
609
  ): Promise<Array<Document.Stored<Document.ConfiguredInstanceForName<EmbeddedName>>>>;
603
610
 
604
611
  /**
@@ -665,7 +672,7 @@ declare abstract class Document<
665
672
  protected _preCreate(
666
673
  data: fields.SchemaField.AssignmentType<Schema>,
667
674
  options: Document.PreCreateOptions<DocumentName>,
668
- user: foundry.documents.BaseUser,
675
+ user: User,
669
676
  ): Promise<boolean | void>;
670
677
 
671
678
  /**
@@ -697,9 +704,9 @@ declare abstract class Document<
697
704
  */
698
705
  protected static _preCreateOperation<T extends Document.AnyConstructor>(
699
706
  this: T,
700
- documents: InstanceType<Document.ConfiguredClass<T>>[],
701
- operation: DatabaseOperationsFor<T["metadata"]["name"], "create">,
702
- user: foundry.documents.BaseUser,
707
+ documents: Document.ToConfiguredInstance<NoInfer<T>>[],
708
+ operation: Document.Database.OperationOf<NoInfer<T>["metadata"]["name"], "create">,
709
+ user: User,
703
710
  ): Promise<boolean | void>;
704
711
 
705
712
  /**
@@ -714,9 +721,9 @@ declare abstract class Document<
714
721
  */
715
722
  protected static _onCreateOperation<T extends Document.AnyConstructor>(
716
723
  this: T,
717
- documents: InstanceType<Document.ConfiguredClass<T>>[],
718
- operation: DatabaseOperationsFor<T["metadata"]["name"], "create">,
719
- user: foundry.documents.BaseUser,
724
+ documents: Document.ToConfiguredInstance<NoInfer<T>>[],
725
+ operation: Document.Database.OperationOf<NoInfer<T>["metadata"]["name"], "create">,
726
+ user: User,
720
727
  ): Promise<void>;
721
728
 
722
729
  /**
@@ -730,7 +737,7 @@ declare abstract class Document<
730
737
  protected _preUpdate(
731
738
  changed: fields.SchemaField.AssignmentType<Schema>,
732
739
  options: Document.PreUpdateOptions<DocumentName>,
733
- user: foundry.documents.BaseUser,
740
+ user: User,
734
741
  ): Promise<boolean | void>;
735
742
 
736
743
  /**
@@ -741,7 +748,7 @@ declare abstract class Document<
741
748
  * @param userId - The id of the User requesting the document update
742
749
  */
743
750
  protected _onUpdate(
744
- changed: fields.SchemaField.InnerAssignmentType<Schema>,
751
+ changed: fields.SchemaField.InnerUpdateData<Schema>,
745
752
  options: Document.OnUpdateOptions<DocumentName>,
746
753
  userId: string,
747
754
  ): void;
@@ -763,9 +770,9 @@ declare abstract class Document<
763
770
  */
764
771
  protected static _preUpdateOperation<T extends Document.AnyConstructor>(
765
772
  this: T,
766
- documents: InstanceType<Document.ConfiguredClass<T>>[],
767
- operation: DatabaseOperationsFor<InstanceType<T>["documentName"], "update">,
768
- user: foundry.documents.BaseUser,
773
+ documents: Document.ToConfiguredInstance<NoInfer<T>>[],
774
+ operation: Document.Database.OperationOf<FixedInstanceType<NoInfer<T>>["documentName"], "update">,
775
+ user: User,
769
776
  ): Promise<boolean | void>;
770
777
 
771
778
  /**
@@ -780,9 +787,9 @@ declare abstract class Document<
780
787
  */
781
788
  protected static _onUpdateOperation<T extends Document.AnyConstructor>(
782
789
  this: T,
783
- documents: InstanceType<Document.ConfiguredClass<T>>[],
784
- operation: DatabaseOperationsFor<InstanceType<T>["documentName"], "update">,
785
- user: foundry.documents.BaseUser,
790
+ documents: Document.ToConfiguredInstance<NoInfer<T>>[],
791
+ operation: Document.Database.OperationOf<FixedInstanceType<NoInfer<T>>["documentName"], "update">,
792
+ user: User,
786
793
  ): Promise<void>;
787
794
 
788
795
  /**
@@ -792,10 +799,7 @@ declare abstract class Document<
792
799
  * @param user - The User requesting the document deletion
793
800
  * @returns A return value of false indicates the delete operation should be cancelled
794
801
  */
795
- protected _preDelete(
796
- options: Document.PreDeleteOptions<DocumentName>,
797
- user: foundry.documents.BaseUser,
798
- ): Promise<boolean | void>;
802
+ protected _preDelete(options: Document.PreDeleteOptions<DocumentName>, user: User): Promise<boolean | void>;
799
803
 
800
804
  /**
801
805
  * Perform follow-up operations after a Document of this type is deleted.
@@ -823,9 +827,9 @@ declare abstract class Document<
823
827
  */
824
828
  protected static _preDeleteOperation<T extends Document.AnyConstructor>(
825
829
  this: T,
826
- documents: Array<Document.ToConfiguredInstance<T>>,
827
- operation: DatabaseOperationsFor<InstanceType<T>["documentName"], "delete">,
828
- user: foundry.documents.BaseUser,
830
+ documents: Document.ToConfiguredInstance<NoInfer<T>>[],
831
+ operation: Document.Database.OperationOf<FixedInstanceType<NoInfer<T>>["documentName"], "delete">,
832
+ user: User,
829
833
  ): Promise<unknown>;
830
834
 
831
835
  /**
@@ -840,9 +844,9 @@ declare abstract class Document<
840
844
  */
841
845
  protected static _onDeleteOperation<T extends Document.AnyConstructor>(
842
846
  this: T,
843
- documents: Array<Document.ToConfiguredInstance<T>>,
844
- operation: DatabaseOperationsFor<InstanceType<T>["documentName"], "delete">,
845
- user: foundry.documents.BaseUser,
847
+ documents: Document.ToConfiguredInstance<NoInfer<T>>[],
848
+ operation: Document.Database.OperationOf<FixedInstanceType<NoInfer<T>>["documentName"], "delete">,
849
+ user: User,
846
850
  ): Promise<unknown>;
847
851
 
848
852
  /**
@@ -894,7 +898,7 @@ declare abstract class Document<
894
898
  */
895
899
  protected static _onCreateDocuments<T extends Document.AnyConstructor>(
896
900
  this: T,
897
- documents: Array<Document.ToConfiguredInstance<T>>,
901
+ documents: Array<Document.ToConfiguredInstance<NoInfer<T>>>,
898
902
  context: Document.ModificationContext<Document.Any | null>,
899
903
  ): Promise<void>;
900
904
 
@@ -904,7 +908,7 @@ declare abstract class Document<
904
908
  */
905
909
  protected static _onUpdateDocuments<T extends Document.AnyConstructor>(
906
910
  this: T,
907
- documents: Array<Document.ToConfiguredInstance<T>>,
911
+ documents: Array<Document.ToConfiguredInstance<NoInfer<T>>>,
908
912
  context: Document.ModificationContext<Document.Any | null>,
909
913
  ): Promise<unknown>;
910
914
 
@@ -914,7 +918,7 @@ declare abstract class Document<
914
918
  */
915
919
  protected static _onDeleteDocuments<T extends Document.AnyConstructor>(
916
920
  this: T,
917
- documents: Array<Document.ToConfiguredInstance<T>>,
921
+ documents: Array<Document.ToConfiguredInstance<NoInfer<T>>>,
918
922
  context: Document.ModificationContext<Document.Any | null>,
919
923
  ): Promise<unknown>;
920
924
  }
@@ -922,9 +926,9 @@ declare abstract class Document<
922
926
  declare abstract class AnyDocument extends Document<any, any, any> {
923
927
  constructor(arg0: never, ...args: never[]);
924
928
 
925
- // Note(LukeAbby): Specifically adding the `__DocumentBrand` should be redundant but in practice it seems to help tsc more efficiently deduce that it's actually inheriting from `Document`.
929
+ // Note(LukeAbby): Specifically adding the `DocumentBrand` should be redundant but in practice it seems to help tsc more efficiently deduce that it's actually inheriting from `Document`.
926
930
  // This is odd but probably is because it bails from looking up the parent class properties at times or something.
927
- static [__DocumentBrand]: never;
931
+ static [Document.Internal.DocumentBrand]: true;
928
932
 
929
933
  flags?: unknown;
930
934
 
@@ -934,11 +938,17 @@ declare abstract class AnyDocument extends Document<any, any, any> {
934
938
  // Note(LukeAbby): The point of this class is to show up in intellisense.
935
939
  // When something fails to be configured it should be replaced with `typeof ConfigurationFailure & typeof Item` or whatever the relevant class is.
936
940
  // This helps to minimize the number of errors that appears in a repo with broken configuration as they can be very misleading and confusing.
937
- declare abstract class ConfigurationFailure extends AnyDocument {}
941
+ declare abstract class ConfigurationFailure extends AnyDocument {
942
+ static [Document.Internal.DocumentBrand]: true;
943
+ }
938
944
 
939
945
  declare namespace Document {
940
946
  /** Any Document, except for Settings */
941
947
  type Any = AnyDocument;
948
+ type AnyConstructor = typeof AnyDocument;
949
+
950
+ type ConfigurationFailureClass = typeof ConfigurationFailure;
951
+ type ConfigurationFailureInstance = ConfigurationFailure;
942
952
 
943
953
  type Type =
944
954
  | "ActiveEffect"
@@ -958,6 +968,8 @@ declare namespace Document {
958
968
  | "Macro"
959
969
  | "PlaylistSound"
960
970
  | "Playlist"
971
+ | "RegionBehavior"
972
+ | "Region"
961
973
  | "RollTable"
962
974
  | "Scene"
963
975
  | "Setting"
@@ -972,6 +984,7 @@ declare namespace Document {
972
984
  | "Drawing"
973
985
  | "MeasuredTemplate"
974
986
  | "Note"
987
+ | "Region"
975
988
  | "Tile"
976
989
  | "Token"
977
990
  | "Wall";
@@ -989,10 +1002,14 @@ declare namespace Document {
989
1002
  | "Combat"
990
1003
  | "Combatant"
991
1004
  | "Item"
992
- | "JournalEntryPage";
1005
+ | "JournalEntryPage"
1006
+ | "RegionBehavior";
993
1007
 
994
1008
  type EmbeddableNamesFor<ConcreteDocument extends Document.Internal.Instance.Any> = {
995
- [K in keyof ConfiguredDocuments]: IsParentOf<ConcreteDocument, InstanceType<ConfiguredDocuments[K]>> extends true
1009
+ [K in keyof ConfiguredDocuments]: IsParentOf<
1010
+ ConcreteDocument,
1011
+ FixedInstanceType<ConfiguredDocuments[K]>
1012
+ > extends true
996
1013
  ? K
997
1014
  : never;
998
1015
  };
@@ -1002,25 +1019,44 @@ declare namespace Document {
1002
1019
  ChildDocument extends Document.Internal.Instance.Any,
1003
1020
  > = ParentDocument extends Internal.ParentFor<ChildDocument> ? true : false;
1004
1021
 
1022
+ type SocketRequest<Action extends DatabaseAction> = DocumentSocketRequest<Action>;
1023
+ type SocketResponse<Action extends DatabaseAction> = DocumentSocketResponse<Action>;
1024
+
1005
1025
  // Documented at https://gist.github.com/LukeAbby/c7420b053d881db4a4d4496b95995c98
1006
1026
  namespace Internal {
1027
+ const DocumentBrand: unique symbol;
1028
+
1029
+ const DocumentName: unique symbol;
1030
+ const Schema: unique symbol;
1031
+ const Parent: unique symbol;
1032
+
1033
+ // This metadata is called "simple" because where there should be proper references to the
1034
+ // current document there is instead `Document.Any`. This helps simplify loops.
1035
+ // Use cases should be limited to when these references aren't needed.
1007
1036
  type SimpleMetadata<Name extends Document.Type> = ConfiguredMetadata<Document.Any>[Name];
1008
1037
 
1009
1038
  type Constructor = (abstract new (arg0: never, ...args: never[]) => Instance.Any) & {
1010
- [__DocumentBrand]: never;
1039
+ [DocumentBrand]: true;
1011
1040
  };
1012
1041
 
1013
- interface Instance<Schema extends DataSchema, Parent extends Document.Internal.Instance.Any | null> {
1014
- [__Schema]: Schema;
1015
- [__Parent]: Parent;
1042
+ interface Instance<
1043
+ DocumentName extends Document.Type,
1044
+ Schema extends DataSchema,
1045
+ Parent extends Document.Internal.Instance.Any | null,
1046
+ > {
1047
+ [DocumentName]: DocumentName;
1048
+ [Schema]: Schema;
1049
+ [Parent]: Parent;
1016
1050
  }
1017
1051
 
1018
- type SchemaFor<ConcreteInstance extends Instance.Any> = ConcreteInstance[typeof __Schema];
1052
+ type DocumentNameFor<ConcreteInstance extends Instance.Any> = ConcreteInstance[typeof DocumentName];
1053
+
1054
+ type SchemaFor<ConcreteInstance extends Instance.Any> = ConcreteInstance[typeof Schema];
1019
1055
 
1020
- type ParentFor<ConcreteInstance extends Instance.Any> = ConcreteInstance[typeof __Parent];
1056
+ type ParentFor<ConcreteInstance extends Instance.Any> = ConcreteInstance[typeof Parent];
1021
1057
 
1022
1058
  namespace Instance {
1023
- type Any = Instance<any, any>;
1059
+ type Any = Instance<any, any, any>;
1024
1060
 
1025
1061
  type Complete<T extends Any> = T extends Document.Any ? T : never;
1026
1062
  }
@@ -1029,8 +1065,6 @@ declare namespace Document {
1029
1065
  /** Any Document, that is a child of the given parent Document. */
1030
1066
  type AnyChild<Parent extends Any | null> = Document<any, any, Parent>;
1031
1067
 
1032
- type AnyConstructor = typeof AnyDocument;
1033
-
1034
1068
  /**
1035
1069
  * Returns the type of the constructor data for the given {@link foundry.abstract.Document}.
1036
1070
  */
@@ -1054,25 +1088,28 @@ declare namespace Document {
1054
1088
  metadata: { name: SystemType };
1055
1089
  };
1056
1090
 
1057
- type ConfiguredClass<T extends { metadata: Metadata.Any }> = ConfiguredClassForName<T["metadata"]["name"]>;
1058
-
1059
1091
  type ConfiguredClassForName<Name extends Type> = MakeConform<
1060
1092
  ConfiguredDocuments[Name],
1093
+ Document.Internal.Constructor,
1061
1094
  typeof ConfigurationFailure & DefaultDocuments[Name]
1062
1095
  >;
1063
1096
 
1064
1097
  type SubTypesOf<T extends Type> =
1065
1098
  ConfiguredInstanceForName<T> extends { type: infer Types } ? Types : typeof foundry.CONST.BASE_DOCUMENT_TYPE;
1066
1099
 
1100
+ // NOTE(LukeAbby): This type is less DRY than it could be to avoid undue complexity in such a critical helpeer.
1101
+ // This has _many_ times been seen to cause loops so this type is written in an intentionally more paranoid way.
1102
+ // The reason for the verbosity and repetition is to avoid eagerly evaluating any branches that might cause a loop.
1067
1103
  type ToConfiguredClass<ConcreteDocument extends Document.Internal.Constructor> = MakeConform<
1068
1104
  ConfiguredDocuments[NameFor<ConcreteDocument>],
1105
+ Document.AnyConstructor,
1069
1106
  typeof ConfigurationFailure & DefaultDocuments[NameFor<ConcreteDocument>]
1070
1107
  >;
1071
1108
 
1072
1109
  type ToConfiguredInstance<ConcreteDocument extends Document.Internal.Constructor> = MakeConform<
1073
- // NOTE(LukeAbby): This avoids calling `Document.ToConfiguredClass` because that checks the static side of the class which can be expensive and even lead to loops.
1074
- InstanceType<ConfiguredDocuments[NameFor<ConcreteDocument>]>,
1075
- ConfigurationFailure & InstanceType<DefaultDocuments[NameFor<ConcreteDocument>]>
1110
+ FixedInstanceType<ConfiguredDocuments[NameFor<ConcreteDocument>]>,
1111
+ Document.Any,
1112
+ ConfigurationFailure & FixedInstanceType<DefaultDocuments[NameFor<ConcreteDocument>]>
1076
1113
  >;
1077
1114
 
1078
1115
  type ToConfiguredStored<D extends Document.Internal.Constructor> = Stored<ToConfiguredInstance<D>>;
@@ -1097,12 +1134,12 @@ declare namespace Document {
1097
1134
  : never;
1098
1135
 
1099
1136
  type ConfiguredInstanceForName<Name extends Type> = MakeConform<
1100
- InstanceType<ConfiguredDocuments[Name]>,
1137
+ FixedInstanceType<ConfiguredDocuments[Name]>,
1101
1138
  Document.Any
1102
1139
  >;
1103
1140
 
1104
1141
  type ConfiguredObjectClassForName<Name extends PlaceableType> = CONFIG[Name]["objectClass"];
1105
- type ConfiguredObjectInstanceForName<Name extends PlaceableType> = InstanceType<CONFIG[Name]["objectClass"]>;
1142
+ type ConfiguredObjectInstanceForName<Name extends PlaceableType> = FixedInstanceType<CONFIG[Name]["objectClass"]>;
1106
1143
 
1107
1144
  type ConfiguredDataForName<Name extends Type> = GetKey<DataConfig, Name, EmptyObject>;
1108
1145
 
@@ -1117,7 +1154,7 @@ declare namespace Document {
1117
1154
  : T;
1118
1155
 
1119
1156
  type SchemaFor<ConcreteDocument extends Internal.Instance.Any> =
1120
- ConcreteDocument extends Internal.Instance<infer Schema, any> ? Schema : never;
1157
+ ConcreteDocument extends Internal.Instance<infer _1, infer Schema, infer _2> ? Schema : never;
1121
1158
 
1122
1159
  type MetadataFor<ConcreteDocument extends Document.Internal.Instance.Any> =
1123
1160
  ConfiguredMetadata<ConcreteDocument>[ConcreteDocument extends {
@@ -1132,11 +1169,12 @@ declare namespace Document {
1132
1169
 
1133
1170
  type Flags<ConcreteDocument extends Internal.Instance.Any> = OptionsForSchema<SchemaFor<ConcreteDocument>>;
1134
1171
 
1135
- interface OptionsInFlags<Options extends DataFieldOptions.Any> {
1172
+ /** @internal */
1173
+ interface OptionsInFlags<Options extends DataField.Options.Any> {
1136
1174
  readonly flags?: DataField<Options, any>;
1137
1175
  }
1138
1176
 
1139
- // These types only exists to simplify solving the `Document` type. Using `Document.Flags<this>` means the constraint `this extends Document.Any` has to be proved.
1177
+ // These types only exists to simplify solving the `Document` type. Using `Document.Flags<this>` means the constraint `this extends Document.Any` has to be proved.
1140
1178
  // This is much more complex than proving the constraint for `Document.FlagsInternal<Schema>` that `Schema extends DataSchema`.
1141
1179
 
1142
1180
  // TODO: This needs to use the derived flags not just how they're initialized.
@@ -1279,29 +1317,29 @@ declare namespace Document {
1279
1317
  type ModificationOptions = Omit<Document.ModificationContext<Document.Any | null>, "parent" | "pack">;
1280
1318
 
1281
1319
  type PreCreateOptions<Name extends Type> = Omit<
1282
- DatabaseOperationsFor<Name, "create">,
1320
+ Document.Database.OperationOf<Name, "create">,
1283
1321
  "data" | "noHook" | "pack" | "parent"
1284
1322
  >;
1285
1323
  type OnCreateOptions<Name extends Type> = Omit<
1286
- DatabaseOperationsFor<Name, "create">,
1324
+ Document.Database.OperationOf<Name, "create">,
1287
1325
  "pack" | "parentUuid" | "syntheticActorUpdate"
1288
1326
  >;
1289
1327
 
1290
1328
  type PreUpdateOptions<Name extends Type> = Omit<
1291
- DatabaseOperationsFor<Name, "update">,
1329
+ Document.Database.OperationOf<Name, "update">,
1292
1330
  "updates" | "restoreDelta" | "noHook" | "parent" | "pack"
1293
1331
  >;
1294
1332
  type OnUpdateOptions<Name extends Type> = Omit<
1295
- DatabaseOperationsFor<Name, "update">,
1333
+ Document.Database.OperationOf<Name, "update">,
1296
1334
  "pack" | "parentUuid" | "syntheticActorUpdate"
1297
1335
  >;
1298
1336
 
1299
1337
  type PreDeleteOptions<Name extends Type> = Omit<
1300
- DatabaseOperationsFor<Name, "delete">,
1338
+ Document.Database.OperationOf<Name, "delete">,
1301
1339
  "ids" | "deleteAll" | "noHook" | "pack" | "parent"
1302
1340
  >;
1303
1341
  type OnDeleteOptions<Name extends Type> = Omit<
1304
- DatabaseOperationsFor<Name, "delete">,
1342
+ Document.Database.OperationOf<Name, "delete">,
1305
1343
  "deleteAll" | "pack" | "parentUuid" | "syntheticActorUpdate"
1306
1344
  >;
1307
1345
 
@@ -1317,17 +1355,9 @@ declare namespace Document {
1317
1355
  readonly coreTypes: readonly string[];
1318
1356
  readonly embedded: Record<string, string>;
1319
1357
  readonly permissions: {
1320
- create:
1321
- | string
1322
- | ToMethod<
1323
- (user: foundry.documents.BaseUser, doc: ThisType, data: Document.ConstructorDataForName<Type>) => boolean
1324
- >;
1325
- update:
1326
- | string
1327
- | ToMethod<
1328
- (user: foundry.documents.BaseUser, doc: ThisType, data: Document.UpdateDataForName<Type>) => boolean
1329
- >;
1330
- delete: string | ToMethod<(user: foundry.documents.BaseUser, doc: ThisType, data: EmptyObject) => boolean>;
1358
+ create: string | ToMethod<(user: User, doc: ThisType, data: Document.ConstructorDataForName<Type>) => boolean>;
1359
+ update: string | ToMethod<(user: User, doc: ThisType, data: Document.UpdateDataForName<Type>) => boolean>;
1360
+ delete: string | ToMethod<(user: User, doc: ThisType, data: EmptyObject) => boolean>;
1331
1361
  };
1332
1362
  readonly preserveOnImport?: readonly string[] | undefined;
1333
1363
  readonly schemaVersion: string | undefined;
@@ -1355,23 +1385,85 @@ declare namespace Document {
1355
1385
  pack: null;
1356
1386
  }
1357
1387
  }
1388
+
1389
+ /**
1390
+ * @deprecated {@link Document.Database.OperationOf | `Document.Database.OperationOf`}
1391
+ */
1392
+ type DatabaseOperationsFor<
1393
+ Name extends Document.Type,
1394
+ ConcreteOperation extends Document.Database.Operation,
1395
+ > = Document.Database.OperationOf<Name, ConcreteOperation>;
1396
+
1397
+ type ConfiguredSheetClassFor<Name extends Document.Type> = MakeConform<
1398
+ GetKey<GetKey<CONFIG, Name>, "sheetClass">,
1399
+ AnyConstructor
1400
+ >;
1401
+
1402
+ type ConfiguredObjectClassFor<Name extends Document.Type> = GetKey<GetKey<CONFIG, Name>, "objectClass">;
1403
+
1404
+ type ConfiguredLayerClassFor<Name extends Document.Type> = GetKey<GetKey<CONFIG, Name>, "layerClass">;
1405
+
1406
+ type DropData<T extends Document.Any> = T extends { id: string | undefined }
1407
+ ? DropData.Data<T> & DropData.UUID
1408
+ : DropData.Data<T>;
1409
+
1410
+ namespace DropData {
1411
+ type Any = DropData<any>;
1412
+
1413
+ interface Data<T extends Document.Any> {
1414
+ type: T["documentName"];
1415
+ data: T["_source"];
1416
+ }
1417
+
1418
+ interface UUID {
1419
+ uuid: string;
1420
+ }
1421
+ }
1422
+
1423
+ namespace Database {
1424
+ type Operation = "create" | "update" | "delete";
1425
+
1426
+ /* eslint-disable @typescript-eslint/no-empty-object-type */
1427
+ interface Operations<
1428
+ T extends Document.Internal.Instance.Any = Document.Internal.Instance.Any,
1429
+ ExtraCreateOptions extends AnyObject = {},
1430
+ ExtraUpdateOptions extends AnyObject = {},
1431
+ ExtraDeleteOptions extends AnyObject = {},
1432
+ > {
1433
+ create: DatabaseCreateOperation<T> & InexactPartial<ExtraCreateOptions>;
1434
+ update: DatabaseUpdateOperation<T> & InexactPartial<ExtraUpdateOptions>;
1435
+ delete: DatabaseDeleteOperation & InexactPartial<ExtraDeleteOptions>;
1436
+ }
1437
+ /* eslint-enable @typescript-eslint/no-empty-object-type */
1438
+
1439
+ /**
1440
+ * This is a helper type that gets the right DatabaseOperation (including the
1441
+ * proper options) for a particular Document type.
1442
+ */
1443
+ type OperationOf<
1444
+ T extends Document.Type,
1445
+ Operation extends Database.Operation,
1446
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
1447
+ > = DatabaseOperationMap[T][Operation];
1448
+ }
1358
1449
  }
1359
1450
 
1360
- export type Operation = "create" | "update" | "delete";
1451
+ /** @deprecated {@link Document.Database.Operation | `Document.Database.Operation`} */
1452
+ export type Operation = Document.Database.Operation;
1361
1453
 
1362
1454
  /* eslint-disable @typescript-eslint/no-empty-object-type */
1363
- export interface DocumentDatabaseOperations<
1455
+ /** @deprecated {@link Document.Database.Operations | `Document.Database.Operations`} */
1456
+ export type DocumentDatabaseOperations<
1364
1457
  T extends Document.Internal.Instance.Any = Document.Internal.Instance.Any,
1365
1458
  ExtraCreateOptions extends AnyObject = {},
1366
1459
  ExtraUpdateOptions extends AnyObject = {},
1367
1460
  ExtraDeleteOptions extends AnyObject = {},
1368
- > {
1369
- create: DatabaseCreateOperation<T> & InexactPartial<ExtraCreateOptions>;
1370
- update: DatabaseUpdateOperation<T> & InexactPartial<ExtraUpdateOptions>;
1371
- delete: DatabaseDeleteOperation & InexactPartial<ExtraDeleteOptions>;
1372
- }
1461
+ > = Document.Database.Operations<T, ExtraCreateOptions, ExtraUpdateOptions, ExtraDeleteOptions>;
1373
1462
  /* eslint-enable @typescript-eslint/no-empty-object-type */
1374
1463
 
1464
+ /**
1465
+ * @deprecated if you want to get individual operations see {@link Document.Database.OperationOf | `Document.Database.OperationOf`}
1466
+ */
1375
1467
  export interface DatabaseOperationMap {
1376
1468
  ActiveEffect: ActiveEffect.DatabaseOperations;
1377
1469
  Actor: Actor.DatabaseOperations;
@@ -1395,9 +1487,8 @@ export interface DatabaseOperationMap {
1395
1487
  Note: NoteDocument.DatabaseOperations;
1396
1488
  Playlist: Playlist.DatabaseOperations;
1397
1489
  PlaylistSound: PlaylistSound.DatabaseOperations;
1398
- // TODO: Add these once documents are done
1399
- // Region: ActiveEffect.DatabaseOperations;
1400
- // RegionBehavior: ActiveEffect.DatabaseOperations;
1490
+ Region: ActiveEffect.DatabaseOperations;
1491
+ RegionBehavior: ActiveEffect.DatabaseOperations;
1401
1492
  RollTable: RollTable.DatabaseOperations;
1402
1493
  Scene: Scene.DatabaseOperations;
1403
1494
  Setting: Setting.DatabaseOperations;