@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
@@ -23,9 +23,12 @@ import type {
23
23
  PickValue,
24
24
  Identity,
25
25
  Brand,
26
- } from "fvtt-types/utils";
26
+ AnyMutableObject,
27
+ MaybePromise,
28
+ } from "#utils";
27
29
  import type * as CONST from "../constants.mts";
28
30
  import type {
31
+ DataSchema,
29
32
  DataField,
30
33
  DocumentStatsField,
31
34
  EmbeddedCollectionField,
@@ -33,12 +36,12 @@ import type {
33
36
  SchemaField,
34
37
  TypeDataField,
35
38
  } from "../data/fields.d.mts";
36
- import type { fields } from "../data/module.mts";
37
39
  import type { LogCompatibilityWarningOptions } from "../utils/logging.mts";
38
40
  import type {
39
41
  DatabaseAction,
40
42
  DatabaseCreateOperation,
41
43
  DatabaseDeleteOperation,
44
+ DatabaseGetOperation,
42
45
  DatabaseUpdateOperation,
43
46
  DocumentSocketRequest,
44
47
  } from "./_types.d.mts";
@@ -46,8 +49,6 @@ import type DataModel from "./data.mts";
46
49
  import type DocumentSocketResponse from "./socket.d.mts";
47
50
  import type EmbeddedCollection from "./embedded-collection.d.mts";
48
51
 
49
- type DataSchema = foundry.data.fields.DataSchema;
50
-
51
52
  export default Document;
52
53
 
53
54
  type _ClassMustBeAssignableToInternal = MustConform<typeof Document, Document.Internal.Constructor>;
@@ -57,7 +58,8 @@ type _InstanceMustBeAssignableToInternal = MustConform<Document.Any, Document.In
57
58
  // `name?: string` etc. were to be put in `Document` directly they'd actually override the schema.
58
59
  // Therefore this workaround is used to force `DataModel` to override the properties.
59
60
  declare const _InternalDocument: (new (...args: any[]) => {
60
- name?: string | undefined;
61
+ // TODO: removing undefined breaks everything, but should be valid to do, investigate
62
+ name?: string | null | undefined;
61
63
 
62
64
  // `{}` is used so that `{}` and the actual shape of `system` are merged.
63
65
  // eslint-disable-next-line @typescript-eslint/no-empty-object-type
@@ -90,10 +92,8 @@ declare abstract class Document<
90
92
 
91
93
  override parent: Parent;
92
94
 
93
- protected override _configure(options?: {
94
- pack?: string | null | undefined;
95
- parentCollection?: string | null | undefined;
96
- }): void;
95
+ // options: not null (destructured)
96
+ protected override _configure(options?: Document.ConfigureOptions): void;
97
97
 
98
98
  /**
99
99
  * An immutable reverse-reference to the name of the collection that this Document exists in on its parent, if any.
@@ -113,9 +113,10 @@ declare abstract class Document<
113
113
  /**
114
114
  * Ensure that all Document classes share the same schema of their base declaration.
115
115
  */
116
- static get schema(): foundry.data.fields.SchemaField.Any;
116
+ static get schema(): SchemaField.Any;
117
117
 
118
- protected _initialize(options?: any): void;
118
+ // options: not null (parameter default only)
119
+ protected _initialize(options?: Document.InitializeOptions): void;
119
120
 
120
121
  /**
121
122
  * A mapping of singleton embedded Documents which exist in this model.
@@ -201,6 +202,9 @@ declare abstract class Document<
201
202
  /**
202
203
  * Identify the collection in a parent Document that this Document exists belongs to, if any.
203
204
  * @param parentCollection - An explicitly provided parent collection name.
205
+ * @remarks If passed a value for `parentCollection`, simply returns that value
206
+ *
207
+ * Foundry marked `@internal`
204
208
  */
205
209
  _getParentCollection(parentCollection?: string): string | null;
206
210
 
@@ -224,17 +228,18 @@ declare abstract class Document<
224
228
  * @param user - The User being tested
225
229
  * @returns Does the User have a sufficient role to create?
226
230
  */
227
- static canUserCreate(user: User.Internal.Implementation): boolean;
231
+ static canUserCreate(user: User.Implementation): boolean;
228
232
 
229
233
  /**
230
- * Get the explicit permission level that a specific User has over this Document, a value in CONST.DOCUMENT_OWNERSHIP_LEVELS.
234
+ * Get the explicit permission level that a specific User has over this Document, a value in {@link CONST.DOCUMENT_OWNERSHIP_LEVELS | `CONST.DOCUMENT_OWNERSHIP_LEVELS`}.
231
235
  * This method returns the value recorded in Document ownership, regardless of the User's role.
232
236
  * To test whether a user has a certain capability over the document, testUserPermission should be used.
233
- * @param user - The User being tested
234
- * (default: `game.user`)
237
+ * @param user - The User being tested (default: `game.user`)
235
238
  * @returns A numeric permission level from CONST.DOCUMENT_OWNERSHIP_LEVELS or null
239
+ *
240
+ * @privateRemarks Making this just `User.Implementation` causes circularities
236
241
  */
237
- getUserLevel(user?: User.Internal.Implementation): CONST.DOCUMENT_OWNERSHIP_LEVELS | null;
242
+ getUserLevel(user?: User.Internal.Implementation | null): CONST.DOCUMENT_OWNERSHIP_LEVELS | null;
238
243
 
239
244
  /**
240
245
  * Test whether a certain User has a requested permission level (or greater) over the Document
@@ -242,11 +247,13 @@ declare abstract class Document<
242
247
  * @param permission - The permission level from DOCUMENT_PERMISSION_LEVELS to test
243
248
  * @param options - Additional options involved in the permission test
244
249
  * @returns Does the user have this permission level over the Document?
250
+ *
251
+ * @privateRemarks Making this just `User.Implementation` causes circularities
245
252
  */
246
253
  // options: not null (destructured)
247
254
  testUserPermission(
248
255
  user: User.Internal.Implementation,
249
- permission: Document.TestableOwnershipLevel,
256
+ permission: Document.ActionPermission,
250
257
  options?: Document.TestUserPermissionOptions,
251
258
  ): boolean;
252
259
 
@@ -254,10 +261,12 @@ declare abstract class Document<
254
261
  * Test whether a given User has permission to perform some action on this Document
255
262
  * @param user - The User attempting modification
256
263
  * @param action - The attempted action
257
- * @param data - Data involved in the attempted action
258
- * (default: `{}`)
264
+ * @param data - Data involved in the attempted action (default: `{}`)
259
265
  * @returns Does the User have permission?
266
+ *
267
+ * @privateRemarks Making this just `User.Implementation` causes circularities
260
268
  */
269
+ // data: not null (parameter default only)
261
270
  canUserModify<Action extends "create" | "update" | "delete">(
262
271
  user: User.Internal.Implementation,
263
272
  action: Action,
@@ -271,21 +280,22 @@ declare abstract class Document<
271
280
  * @param context - Additional context options passed to the create method
272
281
  * @returns The cloned Document instance
273
282
  */
274
- override clone<Save extends boolean = false>(
275
- data?: fields.SchemaField.UpdateData<Schema>,
276
- context?: Document.CloneContext<Save> & InexactPartial<Document.ConstructionContext<Parent>>,
283
+ // data: not null (property access), context: not null (destructured)
284
+ override clone<Save extends boolean | null | undefined = false>(
285
+ data?: SchemaField.UpdateData<Schema>,
286
+ context?: Document.CloneContext<Save>,
277
287
  ): Save extends true ? Promise<this> : this;
278
288
 
279
289
  /**
280
290
  * For Documents which include game system data, migrate the system data object to conform to its latest data model.
281
291
  * The data model is defined by the template.json specification included by the game system.
282
292
  * @returns The migrated system data object
293
+ * @throws If this document type either doesn't have subtypes or it does but the one on this document is a DataModel
283
294
  */
284
295
  migrateSystemData(): object;
285
296
 
286
- override toObject<Source extends boolean | undefined>(
287
- source?: Source,
288
- ): Source extends false ? SchemaField.SourceData<Schema> : Readonly<SchemaField.SourceData<Schema>>;
297
+ /** @remarks `Document#toObject` calls `this.constructor.shimData()` on the data before returning */
298
+ override toObject(source?: boolean | null): SchemaField.SourceData<Schema>;
289
299
 
290
300
  /**
291
301
  * Create multiple Documents using provided input data.
@@ -443,6 +453,7 @@ declare abstract class Document<
443
453
  * returned.
444
454
  */
445
455
  // Note: This uses `never` because it's unsound to try to call `Document.create` directly.
456
+ // TODO: This can take an array of data and return an array of documents, in addition to its current typing
446
457
  static create(data: never, operation?: never): Promise<Document.Any | undefined>;
447
458
 
448
459
  /**
@@ -478,8 +489,16 @@ declare abstract class Document<
478
489
  * @param documentId - The Document ID
479
490
  * @param operation - Additional options which customize the request
480
491
  * @returns The retrieved Document, or null
492
+ *
493
+ * @remarks If the Document is in a compendium (i.e `operation.pack` is provided), returns the index
494
+ * entry (or `null`), instead of the Document.
495
+ *
496
+ * {@link FogExploration.get | `FogExploration.get`} can possibly forward args and return to/from
497
+ * {@link FogExploration.load | `FogExploration.load`}, which accounts for the `Promise<>` part
498
+ * of the return; All other documents return `SomeDoc.Implementation | null`
481
499
  */
482
- static get(documentId: string, operation?: Document.Database.GetOptions): Document.Any | null;
500
+ // TODO: Type for possible index entry return
501
+ static get(documentId: string, operation?: Document.Database.GetOptions): MaybePromise<Document.Any | null>;
483
502
 
484
503
  /**
485
504
  * A compatibility method that returns the appropriate name of an embedded collection within this Document.
@@ -638,7 +657,7 @@ declare abstract class Document<
638
657
  * @param options - Additional options which modify the creation request
639
658
  * @param userId - The id of the User requesting the document update
640
659
  */
641
- protected _onCreate(data: never, options: never, userId: string): void;
660
+ protected _onCreate(data: never, options: never, userId: string): MaybePromise<void>;
642
661
 
643
662
  /**
644
663
  * Pre-process a creation operation, potentially altering its instructions or input data. Pre-operation events only
@@ -695,7 +714,7 @@ declare abstract class Document<
695
714
  * @param options - Additional options which modify the update request
696
715
  * @param userId - The id of the User requesting the document update
697
716
  */
698
- protected _onUpdate(changed: never, options: never, userId: string): void;
717
+ protected _onUpdate(changed: never, options: never, userId: string): MaybePromise<void>;
699
718
 
700
719
  /**
701
720
  * Pre-process an update operation, potentially altering its instructions or input data. Pre-operation events only
@@ -751,7 +770,7 @@ declare abstract class Document<
751
770
  * @param options - Additional options which modify the deletion request
752
771
  * @param userId - The id of the User requesting the document update
753
772
  */
754
- protected _onDelete(options: never, userId: string): void;
773
+ protected _onDelete(options: never, userId: string): MaybePromise<void>;
755
774
 
756
775
  /**
757
776
  * Pre-process a deletion operation, potentially altering its instructions or input data. Pre-operation events only
@@ -794,9 +813,13 @@ declare abstract class Document<
794
813
  ): Promise<unknown>;
795
814
 
796
815
  /**
797
- * Configure whether V10 Document Model migration warnings should be logged for this class.
816
+ * @deprecated since v10, no specified end
817
+ * @remarks "You are accessing the "data" field of which was deprecated in v10 and replaced with "system".
818
+ * Continued usage of pre-v10 ".data" paths is no longer supported"
819
+ *
820
+ * @throws An error with the above deprecation warning, if this Document's schema has a `system` field
798
821
  */
799
- static LOG_V10_COMPATIBILITY_WARNINGS: boolean;
822
+ get data(): never;
800
823
 
801
824
  /**
802
825
  * @deprecated since v11, will be removed in v13
@@ -807,13 +830,18 @@ declare abstract class Document<
807
830
  /**
808
831
  * A reusable helper for adding migration shims.
809
832
  */
810
- protected static _addDataFieldShims(data: AnyObject, shims: AnyObject, options?: Document.DataFieldShimOptions): void;
811
-
833
+ // options: not null (parameter default only in _addDataFieldShim)
834
+ protected static _addDataFieldShims(
835
+ data: AnyMutableObject,
836
+ shims: Record<string, string>,
837
+ options?: Document.DataFieldShimOptions,
838
+ ): void;
812
839
  /**
813
840
  * A reusable helper for adding a migration shim
814
841
  */
842
+ // options: not null (parameter default only)
815
843
  protected static _addDataFieldShim(
816
- data: AnyObject,
844
+ data: AnyMutableObject,
817
845
  oldKey: string,
818
846
  newKey: string,
819
847
  options?: Document.DataFieldShimOptions,
@@ -826,15 +854,16 @@ declare abstract class Document<
826
854
  * @param oldKey - The old field name
827
855
  * @param newKey - The new field name
828
856
  * @param apply - An application function, otherwise the old value is applied
829
- * @internal
857
+ * @remarks Foundry marked `@internal`
830
858
  */
831
859
  protected static _addDataFieldMigration(
832
- data: AnyObject,
860
+ data: AnyMutableObject,
833
861
  oldKey: string,
834
862
  newKey: string,
835
- apply?: (data: AnyObject) => unknown,
863
+ apply?: (data: AnyMutableObject) => unknown,
836
864
  ): unknown;
837
865
 
866
+ // options: not null (destructured where forwarded)
838
867
  protected static _logDataFieldMigration(
839
868
  oldKey: string,
840
869
  newKey: string,
@@ -843,7 +872,7 @@ declare abstract class Document<
843
872
 
844
873
  /**
845
874
  * @deprecated since v12, will be removed in v14
846
- * @remarks `"The Document._onCreateDocuments static method is deprecated in favor of Document._onCreateOperation"`
875
+ * @remarks "The `Document._onCreateDocuments` static method is deprecated in favor of {@link Document._onCreateOperation | `Document._onCreateOperation`}"
847
876
  */
848
877
  // Note: This uses `never` because it's unsound to try to do `Document._onCreateDocuments` directly.
849
878
  protected static _onCreateDocuments(
@@ -853,7 +882,7 @@ declare abstract class Document<
853
882
 
854
883
  /**
855
884
  * @deprecated since v12, will be removed in v14
856
- * @remarks `"The Document._onUpdateDocuments static method is deprecated in favor of Document._onUpdateOperation"`
885
+ * @remarks "The `Document._onUpdateDocuments` static method is deprecated in favor of {@link Document._onUpdateOperation | `Document._onUpdateOperation`}"
857
886
  */
858
887
  // Note: This uses `never` because it's unsound to try to do `Document._onUpdateDocuments` directly.
859
888
  protected static _onUpdateDocuments(
@@ -863,7 +892,7 @@ declare abstract class Document<
863
892
 
864
893
  /**
865
894
  * @deprecated since v12, will be removed in v14
866
- * @remarks `"The Document._onDeleteDocuments static method is deprecated in favor of Document._onDeleteOperation"`
895
+ * @remarks "The `Document._onDeleteDocuments` static method is deprecated in favor of {@link Document._onDeleteOperation | `Document._onDeleteOperation`}"
867
896
  */
868
897
  // Note: This uses `never` because it's unsound to try to do `Document._onDeleteDocuments` directly.
869
898
  protected static _onDeleteDocuments(
@@ -1303,7 +1332,7 @@ declare namespace Document {
1303
1332
  type MetadataFor<Name extends Document.Type> = ConfiguredMetadata[Name];
1304
1333
 
1305
1334
  type CollectionRecord<Schema extends DataSchema> = {
1306
- [Key in keyof Schema]: Schema[Key] extends fields.EmbeddedCollectionField.Any ? Schema[Key] : never;
1335
+ [Key in keyof Schema]: Schema[Key] extends EmbeddedCollectionField.Any ? Schema[Key] : never;
1307
1336
  };
1308
1337
 
1309
1338
  type Flags<ConcreteDocument extends Internal.Instance.Any> = OptionsForSchema<SchemaFor<ConcreteDocument>>;
@@ -1351,30 +1380,59 @@ declare namespace Document {
1351
1380
  };
1352
1381
  }
1353
1382
 
1354
- interface ConstructionContext<Parent extends Document.Any | null> {
1383
+ /** @internal */
1384
+ type _ConstructionContext<Parent extends Document.Any | null> = NullishProps<{
1355
1385
  /**
1356
1386
  * The parent Document of this one, if this one is embedded
1357
1387
  * @defaultValue `null`
1358
1388
  */
1359
- parent?: Parent | null | undefined;
1389
+ parent: Parent;
1360
1390
 
1361
1391
  /**
1362
1392
  * The compendium collection ID which contains this Document, if any
1363
1393
  * @defaultValue `null`
1364
1394
  */
1365
- pack?: string | null | undefined;
1395
+ pack: string;
1366
1396
 
1367
1397
  /**
1368
1398
  * Whether to validate initial data strictly?
1369
1399
  * @defaultValue `true`
1370
1400
  */
1371
- strict?: boolean | null | undefined;
1401
+ strict: boolean;
1372
1402
 
1373
1403
  /**
1374
- * An immutable reverse-reference to the name of the collection that thi8s Document exists in on its parent, if any.
1404
+ * An immutable reverse-reference to the name of the collection that this Document exists in on its parent, if any.
1405
+ * @privateRemarks Omitted from the typedef, inferred from usage in {@link Document._configure | `Document#_configure`}
1406
+ * (and included in the construction context rather than `ConfigureOptions` due to being passed to construction in
1407
+ * {@link foundry.abstract.EmbeddedCollection.createDocument | `EmbeddedCollection#createDocument`})
1375
1408
  */
1376
- parentCollection?: string | null | undefined;
1377
- }
1409
+ parentCollection: string;
1410
+ }>;
1411
+
1412
+ /**
1413
+ * Foundry does not include the properties from the DataModel construction context in `DocumentConstructionContext`,
1414
+ * but they're all still valid.
1415
+ *
1416
+ * `strict` is omitted from the DataModel interface so the Document interface's property
1417
+ * description takes precedence.
1418
+ */
1419
+ interface ConstructionContext<Parent extends Document.Any | null = Document.Any | null>
1420
+ extends Omit<DataModel._ConstructionContext, "strict">,
1421
+ _ConstructionContext<Parent> {}
1422
+
1423
+ /** `DataModel#constructor` pulls `parent` and `strict` out of the passed context before forwarding to `#_configure` */
1424
+ interface ConfigureOptions extends Omit<ConstructionContext, "parent" | "strict"> {}
1425
+
1426
+ /** `DataModel#constructor` pulls `parent` out of the passed context before forwarding to `#_initializeSource` */
1427
+ interface InitializeOptions extends Omit<ConstructionContext, "parent"> {}
1428
+
1429
+ /**
1430
+ * `DataModel#constructor` pulls `parent` out of the passed context before forwarding to `#_initializeSource`
1431
+ * @privateRemarks `Document` doesn't override `_initializeSource`, but at least one specific document does (Actor only, as of v12);
1432
+ * Without an override, this is handled by the `& ExtraConstructorOptions` in the `DataModel` signature, but with one,
1433
+ * a manually combined interface is needed.
1434
+ */
1435
+ interface InitializeSourceOptions extends DataModel.InitializeSourceOptions, Omit<ConstructionContext, "parent"> {}
1378
1436
 
1379
1437
  interface ModificationContext<Parent extends Document.Any | null> {
1380
1438
  /**
@@ -1460,25 +1518,34 @@ declare namespace Document {
1460
1518
  deleteAll?: boolean | undefined;
1461
1519
  }
1462
1520
 
1463
- interface CloneContext<Save extends boolean | undefined = boolean | undefined> {
1521
+ /** @internal */
1522
+ type _CloneContext<Save extends boolean | null | undefined = boolean | null | undefined> = NullishProps<{
1464
1523
  /**
1465
1524
  * Save the clone to the World database?
1466
1525
  * @defaultValue `false`
1467
1526
  */
1468
- save?: Save;
1527
+ save: Save;
1469
1528
 
1470
1529
  /**
1471
1530
  * Keep the same ID of the original document
1472
1531
  * @defaultValue `false`
1473
1532
  */
1474
- keepId?: boolean | undefined;
1533
+ keepId: boolean;
1475
1534
 
1476
1535
  /**
1477
1536
  * Track the clone source
1478
1537
  * @defaultValue `false`
1479
1538
  */
1480
- addSource?: boolean | undefined;
1481
- }
1539
+ addSource: boolean;
1540
+ }>;
1541
+
1542
+ /**
1543
+ * @privateRemarks Since we've lost the ExtraConstructorOptions type param, we have to extend
1544
+ * the (parentless) construction context
1545
+ */
1546
+ interface CloneContext<Save extends boolean | null | undefined = boolean | null | undefined>
1547
+ extends _CloneContext<Save>,
1548
+ Omit<Document.ConstructionContext, "parent"> {}
1482
1549
 
1483
1550
  type ModificationOptions = Omit<Document.ModificationContext<Document.Any | null>, "parent" | "pack">;
1484
1551
 
@@ -1599,9 +1666,11 @@ declare namespace Document {
1599
1666
  namespace Database {
1600
1667
  type Operation = "create" | "update" | "delete";
1601
1668
 
1602
- interface GetOptions {
1603
- pack?: string | null;
1604
- }
1669
+ /**
1670
+ * @privateRemarks Foundry types {@link Document.get | `Document.get`} as taking a {@link DatabaseGetOperation | `DatabaseGetOperation`}
1671
+ * but it only ever looks for `pack`
1672
+ */
1673
+ interface GetOptions extends Pick<DatabaseGetOperation, "pack"> {}
1605
1674
 
1606
1675
  /** Used for {@link Document.createDocuments | `Document.createDocuments`} */
1607
1676
  type CreateOperation<Op extends DatabaseCreateOperation> = NullishProps<Omit<Op, "data" | "modifiedTime">>;
@@ -1919,7 +1988,7 @@ declare namespace Document {
1919
1988
 
1920
1989
  interface DataFieldShimOptions {
1921
1990
  /**
1922
- * Apply shims to embedded models?
1991
+ * A string to log as a compatibility warning on accessing the `oldKey`
1923
1992
  */
1924
1993
  warning?: string | null | undefined;
1925
1994
 
@@ -1929,6 +1998,10 @@ declare namespace Document {
1929
1998
  value?: unknown;
1930
1999
  }
1931
2000
 
2001
+ /**
2002
+ * @internal
2003
+ * If a `parent` is required for a given Document's creation, its template must pass `NonNullable<X.Parent>` to `CreateDialogContext`
2004
+ */
1932
2005
  type ParentContext<Parent extends Document.Any | null> = Parent extends null
1933
2006
  ? {
1934
2007
  /** A parent document within which the created Document should belong */
@@ -1939,45 +2012,89 @@ declare namespace Document {
1939
2012
  parent: Parent;
1940
2013
  };
1941
2014
 
1942
- type DefaultNameContext<SubType extends string, Parent extends Document.Any | null> = {
1943
- /** The sub-type of the document */
1944
- type?: SubType | undefined;
1945
-
1946
- /** A compendium pack within which the Document should be created */
1947
- pack?: string | undefined;
1948
- } & ParentContext<Parent>;
2015
+ /** @internal */
2016
+ type _PossibleSubtypeContext<DocumentName extends Document.Type> =
2017
+ GetKey<Document.MetadataFor<DocumentName>, "hasTypeData"> extends true
2018
+ ? NullishProps<{
2019
+ /**
2020
+ * The sub-type of the document
2021
+ * @remarks Pulls from `CONFIG[documentName].typeLabels?.[type]` if provided. Ignored if falsey.
2022
+ */
2023
+ type: Document.SubTypesOf<DocumentName>;
2024
+ }>
2025
+ : {
2026
+ /** @deprecated This Document type does not support subtypes */
2027
+ type?: never;
2028
+ };
2029
+
2030
+ type DefaultNameContext<DocumentName extends Document.Type, Parent extends Document.Any | null> = NullishProps<{
2031
+ /**
2032
+ * A compendium pack within which the Document should be created
2033
+ * @remarks Only used to generate the list of existing names to check against when incrementing the index for the `(number)` suffix.
2034
+ * Ignored if falsey, or if `parent` is provided and truthy.
2035
+ */
2036
+ pack: string;
1949
2037
 
1950
- interface FromDropDataOptions {
1951
2038
  /**
1952
- * Import the provided document data into the World, if it is not already a World-level Document reference
1953
- * @defaultValue `false`
2039
+ * A parent document within which the created Document should belong
2040
+ * @remarks Only used to generate the list of existing names to check against when incrementing the index for the `(number)` suffix.
2041
+ * Ignored if falsey.
1954
2042
  */
1955
- importWorld?: boolean;
1956
- }
2043
+ parent: Parent;
2044
+ }> &
2045
+ _PossibleSubtypeContext<DocumentName>;
1957
2046
 
1958
2047
  type CreateDialogData<CreateData extends object> = InexactPartial<
1959
2048
  CreateData,
1960
2049
  Extract<AllKeysOf<CreateData>, "name" | "type" | "folder">
1961
2050
  >;
1962
2051
 
2052
+ /** @internal */
2053
+ type _PossibleSubtypesContext<DocumentName extends Document.Type> =
2054
+ GetKey<Document.MetadataFor<DocumentName>, "hasTypeData"> extends true
2055
+ ? {
2056
+ /** @deprecated This Document type does not support subtypes */
2057
+ types?: never;
2058
+ }
2059
+ : NullishProps<{
2060
+ /**
2061
+ * A restriction the selectable sub-types of the Dialog.
2062
+ * @remarks Only checked if the document has `static TYPES` of length \> 1 (i.e it both `hasTypeData` and has
2063
+ * at least one non-`"base"` type registered). The computed list will always exclude {@link CONST.BASE_DOCUMENT_TYPE | `CONST.BASE_DOCUMENT_TYPE`},
2064
+ * so it is disallowed in this whitelist.
2065
+ */
2066
+ types: Exclude<Document.SubTypesOf<DocumentName>, "base">[];
2067
+ }>;
2068
+
1963
2069
  type CreateDialogContext<
1964
- SubType extends string,
2070
+ DocumentName extends Document.Type,
1965
2071
  Parent extends Document.Any | null,
1966
- > = InexactPartial<Dialog.Options> & {
2072
+ > = InexactPartial<Dialog.Options> &
2073
+ NullishProps<{
2074
+ /**
2075
+ * A compendium pack within which the Document should be created
2076
+ * @remarks Only checked if `parent` is falsey, and only used to generate the list of folders for the dialog
2077
+ */
2078
+ pack: string;
2079
+ }> &
2080
+ _PossibleSubtypesContext<DocumentName> &
2081
+ ParentContext<Parent>;
2082
+
2083
+ interface FromImportContext<Parent extends Document.Any | null> extends Omit<ConstructionContext<Parent>, "strict"> {
1967
2084
  /**
1968
- * A compendium pack within which the Document should be created
2085
+ * Strict validation is enabled by default.
2086
+ * @defaultValue `true`
2087
+ * @remarks Not allowed to be `undefined` as that would produce `false`, not the expected default of `true`, due to being spread
2088
+ * into an object with `strict: true`, then passed to {@link Document.fromSource | `Document.fromSource`}, where the parameter
2089
+ * default is `false`
1969
2090
  */
1970
- pack?: string | null | undefined;
1971
-
1972
- /** A restriction the selectable sub-types of the Dialog. */
1973
- types?: SubType[] | null | undefined;
1974
- } & ParentContext<Parent>;
2091
+ strict?: boolean | null;
2092
+ }
1975
2093
 
1976
- interface FromImportContext<Parent extends Document.Any | null>
1977
- extends ConstructionContext<Parent>,
1978
- DataModel.DataValidationOptions<Parent> {}
2094
+ type ActionPermission = keyof typeof CONST.DOCUMENT_OWNERSHIP_LEVELS | CONST.DOCUMENT_OWNERSHIP_LEVELS;
1979
2095
 
1980
- type TestableOwnershipLevel = keyof typeof CONST.DOCUMENT_OWNERSHIP_LEVELS | CONST.DOCUMENT_OWNERSHIP_LEVELS;
2096
+ /** @deprecated Use {@linkcode Document.ActionPermission} instead */
2097
+ type TestableOwnershipLevel = ActionPermission;
1981
2098
 
1982
2099
  /** @internal */
1983
2100
  type _TestUserPermissionsOptions = NullishProps<{
@@ -1,4 +1,4 @@
1
- import type { InexactPartial } from "fvtt-types/utils";
1
+ import type { InexactPartial } from "#utils";
2
2
  import type Document from "./document.d.mts";
3
3
  import type EmbeddedCollection from "./embedded-collection.d.mts";
4
4
 
@@ -1,4 +1,4 @@
1
- import type { InexactPartial } from "fvtt-types/utils";
1
+ import type { InexactPartial } from "#utils";
2
2
  import type _Collection from "../utils/collection.d.mts";
3
3
  import type { DatabaseAction, DatabaseOperation } from "./_types.d.mts";
4
4
  import type Document from "./document.d.mts";
@@ -1,4 +1,4 @@
1
- import type { AnyObject } from "fvtt-types/utils";
1
+ import type { AnyObject } from "#utils";
2
2
  import type { DatabaseAction, DatabaseOperation, DocumentSocketRequest } from "./_types.d.mts";
3
3
 
4
4
  /**
@@ -8,7 +8,7 @@ import type {
8
8
  RemoveIndexSignatures,
9
9
  SimpleMerge,
10
10
  Identity,
11
- } from "fvtt-types/utils";
11
+ } from "#utils";
12
12
  import type { SchemaField } from "../data/fields.d.mts";
13
13
  import type { DatabaseCreateOperation, DatabaseDeleteOperation, DatabaseUpdateOperation } from "./_types.d.mts";
14
14
  import type { DataModel } from "./data.d.mts";
@@ -292,6 +292,7 @@ declare abstract class TypeDataModel<
292
292
  * @param options - Additional options which modify the creation request
293
293
  * @param userId - The id of the User requesting the document update
294
294
  */
295
+ // TODO: should be `MaybePromise<void>` to allow async subclassing?
295
296
  protected _onCreate(
296
297
  data: TypeDataModel.ParentAssignmentType<Schema, Parent>,
297
298
  options: Document.Database.CreateOptions<DatabaseCreateOperation>,
@@ -319,6 +320,7 @@ declare abstract class TypeDataModel<
319
320
  * @param options - Additional options which modify the update request
320
321
  * @param userId - The id of the User requesting the document update
321
322
  */
323
+ // TODO: should be `MaybePromise<void>` to allow async subclassing?
322
324
  protected _onUpdate(
323
325
  changed: DeepPartial<TypeDataModel.ParentAssignmentType<Schema, Parent>>,
324
326
  options: Document.Database.UpdateOptions<DatabaseUpdateOperation>,
@@ -343,6 +345,7 @@ declare abstract class TypeDataModel<
343
345
  * @param options - Additional options which modify the deletion request
344
346
  * @param userId - The id of the User requesting the document update
345
347
  */
348
+ // TODO: should be `MaybePromise<void>` to allow async subclassing?
346
349
  protected _onDelete(options: Document.Database.DeleteOptions<DatabaseDeleteOperation>, userId: string): void;
347
350
  }
348
351
 
@@ -1,7 +1,7 @@
1
1
  import type { DataModel } from "./abstract/data.d.mts";
2
2
  import type * as fields from "./data/fields.d.mts";
3
3
  import type { SOFTWARE_UPDATE_CHANNELS } from "./constants.d.mts";
4
- import type { AnyMutableObject } from "fvtt-types/utils";
4
+ import type { AnyMutableObject } from "#utils";
5
5
 
6
6
  type DataSchema = foundry.data.fields.DataSchema;
7
7
 
@@ -193,6 +193,12 @@ declare namespace ApplicationConfiguration {
193
193
  declare class ApplicationConfiguration extends DataModel<ApplicationConfiguration.Schema> {
194
194
  static defineSchema(): ApplicationConfiguration.Schema;
195
195
 
196
+ /**
197
+ * @remarks
198
+ * Migrations:
199
+ * - pre-v9 `dataChannel`s to their updated names
200
+ * - `awsConfig === true` to `""`
201
+ */
196
202
  static override migrateData(source: AnyMutableObject): AnyMutableObject;
197
203
 
198
204
  /**
@@ -1,4 +1,4 @@
1
- import type { Brand, ValueOf } from "fvtt-types/utils";
1
+ import type { Brand, ValueOf } from "#utils";
2
2
 
3
3
  /**
4
4
  * The shortened software name