@league-of-foundry-developers/foundry-vtt-types 9.280.0 → 12.331.1-beta

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 (938) hide show
  1. package/README.md +21 -18
  2. package/index-lenient.d.mts +7 -0
  3. package/index.d.mts +5 -0
  4. package/package.json +67 -39
  5. package/src/foundry/client/apps/app.d.mts +595 -0
  6. package/src/foundry/client/apps/av/av-config.d.mts +93 -0
  7. package/src/foundry/client/apps/av/cameras.d.mts +189 -0
  8. package/src/foundry/client/apps/av/index.d.mts +3 -0
  9. package/src/foundry/client/apps/dialogs/folder-export.d.mts +16 -0
  10. package/src/foundry/client/apps/dialogs/index.d.mts +1 -0
  11. package/src/foundry/client/apps/form.d.mts +469 -0
  12. package/src/foundry/client/apps/forms/actor.d.mts +176 -0
  13. package/src/foundry/client/apps/forms/adventure-exporter.d.mts +132 -0
  14. package/src/foundry/client/apps/forms/adventure-importer.d.mts +85 -0
  15. package/src/foundry/client/apps/forms/base-sheet.d.mts +45 -0
  16. package/src/foundry/client/apps/forms/card-config.d.mts +48 -0
  17. package/src/foundry/client/apps/forms/cards-config.d.mts +141 -0
  18. package/src/foundry/client/apps/forms/combat-config.d.mts +51 -0
  19. package/src/foundry/client/apps/forms/combatant-config.d.mts +45 -0
  20. package/src/foundry/client/apps/forms/default-sheets-config.d.mts +46 -0
  21. package/src/foundry/client/apps/forms/effect-config.d.mts +77 -0
  22. package/src/foundry/client/apps/forms/folder-config.d.mts +60 -0
  23. package/src/foundry/client/apps/forms/fonts.d.mts +168 -0
  24. package/src/foundry/client/apps/forms/grid-config.d.mts +144 -0
  25. package/src/foundry/client/apps/forms/image-popout.d.mts +179 -0
  26. package/src/foundry/client/apps/forms/index.d.mts +26 -0
  27. package/src/foundry/client/apps/forms/item.d.mts +58 -0
  28. package/src/foundry/client/apps/forms/journal-page-sheet.d.mts +313 -0
  29. package/src/foundry/client/apps/forms/journal-sheet.d.mts +312 -0
  30. package/src/foundry/client/apps/forms/macro-config.d.mts +59 -0
  31. package/src/foundry/client/apps/forms/measure-template.d.mts +59 -0
  32. package/src/foundry/client/apps/forms/ownership.d.mts +66 -0
  33. package/src/foundry/client/apps/forms/playlist-config.d.mts +46 -0
  34. package/src/foundry/client/apps/forms/playlist-sound-config.d.mts +63 -0
  35. package/src/foundry/client/apps/forms/roll-table-config.d.mts +160 -0
  36. package/src/foundry/client/apps/forms/scene-config.d.mts +157 -0
  37. package/src/foundry/client/apps/forms/sheet-config.d.mts +202 -0
  38. package/src/foundry/client/apps/forms/user-config.d.mts +71 -0
  39. package/src/foundry/client/apps/hud/chatbubble.d.mts +113 -0
  40. package/src/foundry/client/apps/hud/container.d.mts +54 -0
  41. package/src/foundry/client/apps/hud/controls.d.mts +166 -0
  42. package/src/foundry/client/apps/hud/hotbar.d.mts +169 -0
  43. package/src/foundry/client/apps/hud/hud.d.mts +87 -0
  44. package/src/foundry/client/apps/hud/index.d.mts +9 -0
  45. package/src/foundry/client/apps/hud/menu.d.mts +77 -0
  46. package/src/foundry/client/apps/hud/navigation.d.mts +116 -0
  47. package/src/foundry/client/apps/hud/pause.d.mts +32 -0
  48. package/src/foundry/client/apps/hud/players.d.mts +82 -0
  49. package/src/foundry/client/apps/i18n.d.mts +162 -0
  50. package/src/foundry/client/apps/index.d.mts +10 -0
  51. package/src/foundry/client/apps/placeables/drawing-config.d.mts +80 -0
  52. package/src/foundry/client/apps/placeables/drawing-hud.d.mts +31 -0
  53. package/src/foundry/client/apps/placeables/index.d.mts +10 -0
  54. package/src/foundry/client/apps/placeables/light-config.d.mts +100 -0
  55. package/src/foundry/client/apps/placeables/note-config.d.mts +65 -0
  56. package/src/foundry/client/apps/placeables/sound-config.d.mts +43 -0
  57. package/src/foundry/client/apps/placeables/tile-config.d.mts +54 -0
  58. package/src/foundry/client/apps/placeables/tile-hud.d.mts +37 -0
  59. package/src/foundry/client/apps/placeables/token-config.d.mts +244 -0
  60. package/src/foundry/client/apps/placeables/token-hud.d.mts +134 -0
  61. package/src/foundry/client/apps/placeables/wall-config.d.mts +63 -0
  62. package/src/foundry/client/apps/sidebar/apps/chat-popout.d.mts +39 -0
  63. package/src/foundry/client/apps/sidebar/apps/client-settings.d.mts +98 -0
  64. package/src/foundry/client/apps/sidebar/apps/compendium.d.mts +93 -0
  65. package/src/foundry/client/apps/sidebar/apps/index.d.mts +10 -0
  66. package/src/foundry/client/apps/sidebar/apps/invitation-links.d.mts +32 -0
  67. package/src/foundry/client/apps/sidebar/apps/keybindings-config.d.mts +180 -0
  68. package/src/foundry/client/apps/sidebar/apps/module-management.d.mts +135 -0
  69. package/src/foundry/client/apps/sidebar/apps/permission-config.d.mts +72 -0
  70. package/src/foundry/client/apps/sidebar/apps/support-details.d.mts +121 -0
  71. package/src/foundry/client/apps/sidebar/apps/tours-management.d.mts +54 -0
  72. package/src/foundry/client/apps/sidebar/apps/world-config.d.mts +57 -0
  73. package/src/foundry/client/apps/sidebar/directory-tab-mixin.d.mts +276 -0
  74. package/src/foundry/client/apps/sidebar/document-directory.d.mts +164 -0
  75. package/src/foundry/client/apps/sidebar/index.d.mts +7 -0
  76. package/src/foundry/client/apps/sidebar/package-configuration.d.mts +86 -0
  77. package/src/foundry/client/apps/sidebar/sidebar-tab.d.mts +80 -0
  78. package/src/foundry/client/apps/sidebar/sidebar.d.mts +95 -0
  79. package/src/foundry/client/apps/sidebar/tabs/actors-directory.d.mts +20 -0
  80. package/src/foundry/client/apps/sidebar/tabs/cards-directory.d.mts +12 -0
  81. package/src/foundry/client/apps/sidebar/tabs/chat-log.d.mts +364 -0
  82. package/src/foundry/client/apps/sidebar/tabs/combat-tracker.d.mts +156 -0
  83. package/src/foundry/client/apps/sidebar/tabs/compendium-directory.d.mts +105 -0
  84. package/src/foundry/client/apps/sidebar/tabs/index.d.mts +12 -0
  85. package/src/foundry/client/apps/sidebar/tabs/items-directory.d.mts +14 -0
  86. package/src/foundry/client/apps/sidebar/tabs/journal-directory.d.mts +13 -0
  87. package/src/foundry/client/apps/sidebar/tabs/macros-directory.d.mts +16 -0
  88. package/src/foundry/client/apps/sidebar/tabs/playlists-directory.d.mts +275 -0
  89. package/src/foundry/client/apps/sidebar/tabs/roll-table-directory.d.mts +13 -0
  90. package/src/foundry/client/apps/sidebar/tabs/scenes-directory.d.mts +34 -0
  91. package/src/foundry/client/apps/sidebar/tabs/settings.d.mts +72 -0
  92. package/src/foundry/client/apps/templates.d.mts +546 -0
  93. package/src/foundry/client/audio/audio.d.mts +390 -0
  94. package/src/foundry/client/audio/container.d.mts +176 -0
  95. package/src/foundry/client/audio/index.d.mts +3 -0
  96. package/src/foundry/client/audio/sound.d.mts +307 -0
  97. package/src/foundry/client/av/client.d.mts +162 -0
  98. package/src/foundry/client/av/clients/index.d.mts +1 -0
  99. package/src/foundry/client/av/clients/simplepeer.d.mts +155 -0
  100. package/src/foundry/client/av/index.d.mts +4 -0
  101. package/src/foundry/client/av/master.d.mts +191 -0
  102. package/src/foundry/client/av/settings.d.mts +315 -0
  103. package/src/foundry/client/config.d.mts +2856 -0
  104. package/src/foundry/client/core/clipboard.d.mts +20 -0
  105. package/src/foundry/client/core/document-index.d.mts +118 -0
  106. package/src/foundry/client/core/gamepad.d.mts +62 -0
  107. package/src/foundry/client/core/hooks.d.mts +132 -0
  108. package/src/foundry/client/core/image.d.mts +190 -0
  109. package/src/foundry/client/core/index.d.mts +20 -0
  110. package/src/foundry/client/core/issues.d.mts +102 -0
  111. package/src/foundry/client/core/keybindings.d.mts +312 -0
  112. package/src/foundry/client/core/keyboard.d.mts +224 -0
  113. package/src/foundry/client/core/mouse.d.mts +28 -0
  114. package/src/foundry/client/core/nue.d.mts +38 -0
  115. package/src/foundry/client/core/packages.d.mts +185 -0
  116. package/src/foundry/client/core/settings.d.mts +260 -0
  117. package/src/foundry/client/core/socket.d.mts +16 -0
  118. package/src/foundry/client/core/sorting.d.mts +76 -0
  119. package/src/foundry/client/core/time.d.mts +73 -0
  120. package/src/foundry/client/core/tooltip.d.mts +198 -0
  121. package/src/foundry/client/core/tour.d.mts +279 -0
  122. package/src/foundry/client/core/tours.d.mts +22 -0
  123. package/src/foundry/client/core/utils.d.mts +71 -0
  124. package/src/foundry/client/core/video.d.mts +161 -0
  125. package/src/foundry/client/core/workers.d.mts +128 -0
  126. package/src/foundry/client/data/abstract/canvas-document.d.mts +63 -0
  127. package/src/foundry/client/data/abstract/client-document.d.mts +717 -0
  128. package/src/foundry/client/data/abstract/directory-collection-mixin.d.mts +135 -0
  129. package/src/foundry/client/data/abstract/document-collection.d.mts +204 -0
  130. package/src/foundry/client/data/abstract/index.d.mts +5 -0
  131. package/src/foundry/client/data/abstract/world-collection.d.mts +171 -0
  132. package/src/foundry/client/data/collections/actors.d.mts +41 -0
  133. package/src/foundry/client/data/collections/cards.d.mts +12 -0
  134. package/src/foundry/client/data/collections/combats.d.mts +43 -0
  135. package/src/foundry/client/data/collections/compendium-collection.d.mts +504 -0
  136. package/src/foundry/client/data/collections/compendium-folders.d.mts +13 -0
  137. package/src/foundry/client/data/collections/compendium-packs.d.mts +27 -0
  138. package/src/foundry/client/data/collections/fog.d.mts +17 -0
  139. package/src/foundry/client/data/collections/folder.d.mts +27 -0
  140. package/src/foundry/client/data/collections/index.d.mts +17 -0
  141. package/src/foundry/client/data/collections/items.d.mts +14 -0
  142. package/src/foundry/client/data/collections/journal.d.mts +62 -0
  143. package/src/foundry/client/data/collections/macros.d.mts +32 -0
  144. package/src/foundry/client/data/collections/messages.d.mts +35 -0
  145. package/src/foundry/client/data/collections/playlists.d.mts +34 -0
  146. package/src/foundry/client/data/collections/scenes.d.mts +68 -0
  147. package/src/foundry/client/data/collections/settings.d.mts +29 -0
  148. package/src/foundry/client/data/collections/tables.d.mts +21 -0
  149. package/src/foundry/client/data/collections/users.d.mts +50 -0
  150. package/src/foundry/client/data/documents/active-effect.d.mts +348 -0
  151. package/src/foundry/client/data/documents/actor-delta.d.mts +88 -0
  152. package/src/foundry/client/data/documents/actor.d.mts +301 -0
  153. package/src/foundry/client/data/documents/adventure.d.mts +94 -0
  154. package/src/foundry/client/data/documents/ambient-light.d.mts +32 -0
  155. package/src/foundry/client/data/documents/ambient-sound.d.mts +19 -0
  156. package/src/foundry/client/data/documents/card.d.mts +115 -0
  157. package/src/foundry/client/data/documents/cards.d.mts +342 -0
  158. package/src/foundry/client/data/documents/chat-message.d.mts +218 -0
  159. package/src/foundry/client/data/documents/combat.d.mts +315 -0
  160. package/src/foundry/client/data/documents/combatant.d.mts +90 -0
  161. package/src/foundry/client/data/documents/drawing.d.mts +24 -0
  162. package/src/foundry/client/data/documents/fog-exploration.d.mts +51 -0
  163. package/src/foundry/client/data/documents/folder.d.mts +123 -0
  164. package/src/foundry/client/data/documents/index.d.mts +30 -0
  165. package/src/foundry/client/data/documents/item.d.mts +55 -0
  166. package/src/foundry/client/data/documents/journal-entry-page.d.mts +219 -0
  167. package/src/foundry/client/data/documents/journal-entry.d.mts +71 -0
  168. package/src/foundry/client/data/documents/macro.d.mts +73 -0
  169. package/src/foundry/client/data/documents/measured-template.d.mts +29 -0
  170. package/src/foundry/client/data/documents/note.d.mts +35 -0
  171. package/src/foundry/client/data/documents/playlist-sound.d.mts +114 -0
  172. package/src/foundry/client/data/documents/playlist.d.mts +196 -0
  173. package/src/foundry/client/data/documents/scene.d.mts +228 -0
  174. package/src/foundry/client/data/documents/setting.d.mts +43 -0
  175. package/src/foundry/client/data/documents/table-result.d.mts +29 -0
  176. package/src/foundry/client/data/documents/table.d.mts +310 -0
  177. package/src/foundry/client/data/documents/tile.d.mts +21 -0
  178. package/src/foundry/client/data/documents/token.d.mts +342 -0
  179. package/src/foundry/client/data/documents/user.d.mts +153 -0
  180. package/src/foundry/client/data/documents/wall.d.mts +19 -0
  181. package/src/foundry/client/data/index.d.mts +3 -0
  182. package/src/foundry/client/game.d.mts +702 -0
  183. package/src/foundry/client/head.d.mts +87 -0
  184. package/src/foundry/client/hooks.d.mts +1184 -0
  185. package/src/foundry/client/index.d.mts +13 -0
  186. package/src/foundry/client/pixi/board.d.mts +927 -0
  187. package/src/foundry/client/pixi/core/containers/base-canvas-group.d.mts +83 -0
  188. package/src/foundry/client/pixi/core/containers/cached-container.d.mts +116 -0
  189. package/src/foundry/client/pixi/core/containers/full-canvas-container.d.mts +35 -0
  190. package/src/foundry/client/pixi/core/containers/index.d.mts +8 -0
  191. package/src/foundry/client/pixi/core/containers/point-source-mesh.d.mts +62 -0
  192. package/src/foundry/client/pixi/core/containers/quad-mesh.d.mts +43 -0
  193. package/src/foundry/client/pixi/core/containers/quadtree.d.mts +199 -0
  194. package/src/foundry/client/pixi/core/containers/sprite-mesh.d.mts +326 -0
  195. package/src/foundry/client/pixi/core/containers/unbound-container.d.mts +21 -0
  196. package/src/foundry/client/pixi/core/index.d.mts +4 -0
  197. package/src/foundry/client/pixi/core/interaction/canvas-animation.d.mts +160 -0
  198. package/src/foundry/client/pixi/core/interaction/control-icon.d.mts +80 -0
  199. package/src/foundry/client/pixi/core/interaction/index.d.mts +8 -0
  200. package/src/foundry/client/pixi/core/interaction/mouse-handler.d.mts +264 -0
  201. package/src/foundry/client/pixi/core/interaction/ping.d.mts +58 -0
  202. package/src/foundry/client/pixi/core/interaction/pings/chevron.d.mts +73 -0
  203. package/src/foundry/client/pixi/core/interaction/pings/index.d.mts +2 -0
  204. package/src/foundry/client/pixi/core/interaction/pings/pulse.d.mts +115 -0
  205. package/src/foundry/client/pixi/core/interaction/render-flags.d.mts +103 -0
  206. package/src/foundry/client/pixi/core/interaction/resize-handle.d.mts +52 -0
  207. package/src/foundry/client/pixi/core/interaction/targets.d.mts +45 -0
  208. package/src/foundry/client/pixi/core/loader.d.mts +206 -0
  209. package/src/foundry/client/pixi/core/shapes/index.d.mts +6 -0
  210. package/src/foundry/client/pixi/core/shapes/limited-angle-polygon.d.mts +119 -0
  211. package/src/foundry/client/pixi/core/shapes/polygon-helpers.d.mts +31 -0
  212. package/src/foundry/client/pixi/core/shapes/polygon-mesher.d.mts +110 -0
  213. package/src/foundry/client/pixi/core/shapes/precise-text.d.mts +27 -0
  214. package/src/foundry/client/pixi/core/shapes/ray.d.mts +165 -0
  215. package/src/foundry/client/pixi/core/shapes/source-polygon.d.mts +251 -0
  216. package/src/foundry/client/pixi/extensions/circle.d.mts +130 -0
  217. package/src/foundry/client/pixi/extensions/index.d.mts +3 -0
  218. package/src/foundry/client/pixi/extensions/polygon.d.mts +152 -0
  219. package/src/foundry/client/pixi/extensions/rectangle.d.mts +226 -0
  220. package/src/foundry/client/pixi/groups/effects.d.mts +189 -0
  221. package/src/foundry/client/pixi/groups/environment.d.mts +80 -0
  222. package/src/foundry/client/pixi/groups/hidden.d.mts +40 -0
  223. package/src/foundry/client/pixi/groups/index.d.mts +7 -0
  224. package/src/foundry/client/pixi/groups/interface.d.mts +74 -0
  225. package/src/foundry/client/pixi/groups/overlay.d.mts +18 -0
  226. package/src/foundry/client/pixi/groups/primary.d.mts +207 -0
  227. package/src/foundry/client/pixi/groups/rendered.d.mts +18 -0
  228. package/src/foundry/client/pixi/index.d.mts +10 -0
  229. package/src/foundry/client/pixi/layers/base/canvas-layer.d.mts +79 -0
  230. package/src/foundry/client/pixi/layers/base/index.d.mts +3 -0
  231. package/src/foundry/client/pixi/layers/base/interaction-layer.d.mts +139 -0
  232. package/src/foundry/client/pixi/layers/base/placeables-layer.d.mts +598 -0
  233. package/src/foundry/client/pixi/layers/controls/cursor.d.mts +27 -0
  234. package/src/foundry/client/pixi/layers/controls/door.d.mts +70 -0
  235. package/src/foundry/client/pixi/layers/controls/hud.d.mts +114 -0
  236. package/src/foundry/client/pixi/layers/controls/index.d.mts +5 -0
  237. package/src/foundry/client/pixi/layers/controls/layer.d.mts +229 -0
  238. package/src/foundry/client/pixi/layers/controls/ruler.d.mts +316 -0
  239. package/src/foundry/client/pixi/layers/effects/background-effects.d.mts +34 -0
  240. package/src/foundry/client/pixi/layers/effects/coloration-effects.d.mts +27 -0
  241. package/src/foundry/client/pixi/layers/effects/illumination-effects.d.mts +74 -0
  242. package/src/foundry/client/pixi/layers/effects/index.d.mts +6 -0
  243. package/src/foundry/client/pixi/layers/effects/visibility.d.mts +194 -0
  244. package/src/foundry/client/pixi/layers/effects/weather/particles/effect.d.mts +47 -0
  245. package/src/foundry/client/pixi/layers/effects/weather/particles/index.d.mts +2 -0
  246. package/src/foundry/client/pixi/layers/effects/weather/particles/leaves.d.mts +20 -0
  247. package/src/foundry/client/pixi/layers/effects/weather-effects.d.mts +172 -0
  248. package/src/foundry/client/pixi/layers/grid/highlight.d.mts +32 -0
  249. package/src/foundry/client/pixi/layers/grid/index.d.mts +2 -0
  250. package/src/foundry/client/pixi/layers/grid/layer.d.mts +225 -0
  251. package/src/foundry/client/pixi/layers/index.d.mts +6 -0
  252. package/src/foundry/client/pixi/layers/masks/depth.d.mts +37 -0
  253. package/src/foundry/client/pixi/layers/masks/index.d.mts +3 -0
  254. package/src/foundry/client/pixi/layers/masks/occlusion.d.mts +55 -0
  255. package/src/foundry/client/pixi/layers/masks/vision.d.mts +85 -0
  256. package/src/foundry/client/pixi/layers/placeables/drawings.d.mts +92 -0
  257. package/src/foundry/client/pixi/layers/placeables/index.d.mts +8 -0
  258. package/src/foundry/client/pixi/layers/placeables/lighting.d.mts +137 -0
  259. package/src/foundry/client/pixi/layers/placeables/notes.d.mts +99 -0
  260. package/src/foundry/client/pixi/layers/placeables/sounds.d.mts +129 -0
  261. package/src/foundry/client/pixi/layers/placeables/templates.d.mts +60 -0
  262. package/src/foundry/client/pixi/layers/placeables/tiles.d.mts +114 -0
  263. package/src/foundry/client/pixi/layers/placeables/tokens.d.mts +180 -0
  264. package/src/foundry/client/pixi/layers/placeables/walls.d.mts +210 -0
  265. package/src/foundry/client/pixi/perception/clockwise-sweep.d.mts +169 -0
  266. package/src/foundry/client/pixi/perception/color-manager.d.mts +86 -0
  267. package/src/foundry/client/pixi/perception/detection-mode.d.mts +196 -0
  268. package/src/foundry/client/pixi/perception/fog.d.mts +102 -0
  269. package/src/foundry/client/pixi/perception/index.d.mts +7 -0
  270. package/src/foundry/client/pixi/perception/perception-manager.d.mts +166 -0
  271. package/src/foundry/client/pixi/perception/vision-mode.d.mts +197 -0
  272. package/src/foundry/client/pixi/perception/weiler-atherton-clipping.d.mts +152 -0
  273. package/src/foundry/client/pixi/placeable.d.mts +586 -0
  274. package/src/foundry/client/pixi/placeables/drawing.d.mts +292 -0
  275. package/src/foundry/client/pixi/placeables/index.d.mts +9 -0
  276. package/src/foundry/client/pixi/placeables/light.d.mts +140 -0
  277. package/src/foundry/client/pixi/placeables/note.d.mts +114 -0
  278. package/src/foundry/client/pixi/placeables/primary-canvas-objects/drawing-shape.d.mts +143 -0
  279. package/src/foundry/client/pixi/placeables/primary-canvas-objects/index.d.mts +5 -0
  280. package/src/foundry/client/pixi/placeables/primary-canvas-objects/occludable-object.d.mts +175 -0
  281. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-canvas-object.d.mts +159 -0
  282. package/src/foundry/client/pixi/placeables/primary-canvas-objects/tile-mesh.d.mts +52 -0
  283. package/src/foundry/client/pixi/placeables/primary-canvas-objects/token-mesh.d.mts +62 -0
  284. package/src/foundry/client/pixi/placeables/sound.d.mts +133 -0
  285. package/src/foundry/client/pixi/placeables/template.d.mts +211 -0
  286. package/src/foundry/client/pixi/placeables/tile.d.mts +284 -0
  287. package/src/foundry/client/pixi/placeables/token.d.mts +825 -0
  288. package/src/foundry/client/pixi/placeables/wall.d.mts +275 -0
  289. package/src/foundry/client/pixi/webgl/extensions/batch-renderer.d.mts +60 -0
  290. package/src/foundry/client/pixi/webgl/extensions/batch-shader-generator.d.mts +21 -0
  291. package/src/foundry/client/pixi/webgl/extensions/blend-modes.d.mts +53 -0
  292. package/src/foundry/client/pixi/webgl/extensions/index.d.mts +3 -0
  293. package/src/foundry/client/pixi/webgl/helpers/framebugger-snapshot.d.mts +22 -0
  294. package/src/foundry/client/pixi/webgl/helpers/index.d.mts +3 -0
  295. package/src/foundry/client/pixi/webgl/helpers/smooth-noise.d.mts +61 -0
  296. package/src/foundry/client/pixi/webgl/helpers/texture-extractor.d.mts +80 -0
  297. package/src/foundry/client/pixi/webgl/index.d.mts +3 -0
  298. package/src/foundry/client/pixi/webgl/shaders/base.d.mts +691 -0
  299. package/src/foundry/client/pixi/webgl/shaders/effects/index.d.mts +3 -0
  300. package/src/foundry/client/pixi/webgl/shaders/effects/lighting.d.mts +642 -0
  301. package/src/foundry/client/pixi/webgl/shaders/effects/vision.d.mts +216 -0
  302. package/src/foundry/client/pixi/webgl/shaders/effects/weather/base.d.mts +102 -0
  303. package/src/foundry/client/pixi/webgl/shaders/effects/weather/effect.d.mts +38 -0
  304. package/src/foundry/client/pixi/webgl/shaders/effects/weather/fog.d.mts +34 -0
  305. package/src/foundry/client/pixi/webgl/shaders/effects/weather/index.d.mts +5 -0
  306. package/src/foundry/client/pixi/webgl/shaders/effects/weather/rain.d.mts +24 -0
  307. package/src/foundry/client/pixi/webgl/shaders/effects/weather/snow.d.mts +20 -0
  308. package/src/foundry/client/pixi/webgl/shaders/filters/blur.d.mts +163 -0
  309. package/src/foundry/client/pixi/webgl/shaders/filters/filters.d.mts +462 -0
  310. package/src/foundry/client/pixi/webgl/shaders/filters/fxaa.d.mts +74 -0
  311. package/src/foundry/client/pixi/webgl/shaders/filters/index.d.mts +3 -0
  312. package/src/foundry/client/pixi/webgl/shaders/index.d.mts +4 -0
  313. package/src/foundry/client/pixi/webgl/shaders/samplers/color-adjustment.d.mts +101 -0
  314. package/src/foundry/client/pixi/webgl/shaders/samplers/fog-of-war.d.mts +16 -0
  315. package/src/foundry/client/pixi/webgl/shaders/samplers/index.d.mts +6 -0
  316. package/src/foundry/client/pixi/webgl/shaders/samplers/inverse-occlusion.d.mts +47 -0
  317. package/src/foundry/client/pixi/webgl/shaders/samplers/invisibility.d.mts +28 -0
  318. package/src/foundry/client/pixi/webgl/shaders/samplers/monochromatic.d.mts +30 -0
  319. package/src/foundry/client/pixi/webgl/shaders/samplers/occlusion.d.mts +69 -0
  320. package/src/foundry/client/pixi/workers/index.d.mts +1 -0
  321. package/src/foundry/client/pixi/workers/texture-worker.d.mts +125 -0
  322. package/src/foundry/client/tours/canvas-tour.d.mts +9 -0
  323. package/src/foundry/client/tours/index.d.mts +3 -0
  324. package/src/foundry/client/tours/setup-tour.d.mts +26 -0
  325. package/src/foundry/client/tours/sidebar-tour.d.mts +9 -0
  326. package/src/foundry/client/ui/context.d.mts +213 -0
  327. package/src/foundry/client/ui/dialog.d.mts +326 -0
  328. package/src/foundry/client/ui/drag.d.mts +128 -0
  329. package/src/foundry/client/ui/dragdrop.d.mts +124 -0
  330. package/src/foundry/client/ui/editor.d.mts +546 -0
  331. package/src/foundry/client/ui/filepicker.d.mts +477 -0
  332. package/src/foundry/client/ui/filter.d.mts +148 -0
  333. package/src/foundry/client/ui/forms.d.mts +85 -0
  334. package/src/foundry/client/ui/index.d.mts +12 -0
  335. package/src/foundry/client/ui/notifications.d.mts +136 -0
  336. package/src/foundry/client/ui/prosemirror.d.mts +171 -0
  337. package/src/foundry/client/ui/secrets.d.mts +75 -0
  338. package/src/foundry/client/ui/tabs.d.mts +117 -0
  339. package/src/foundry/client-esm/applications/_module.d.mts +25 -0
  340. package/src/foundry/client-esm/applications/_types.d.mts +38 -0
  341. package/src/foundry/client-esm/applications/api/_module.d.mts +9 -0
  342. package/src/foundry/client-esm/applications/api/application.d.mts +705 -0
  343. package/src/foundry/client-esm/applications/api/dialog.d.mts +268 -0
  344. package/src/foundry/client-esm/applications/api/document-sheet.d.mts +119 -0
  345. package/src/foundry/client-esm/applications/api/handlebars-application.d.mts +180 -0
  346. package/src/foundry/client-esm/applications/apps/_module.d.mts +7 -0
  347. package/src/foundry/client-esm/applications/apps/compendium-art-config.d.mts +53 -0
  348. package/src/foundry/client-esm/applications/apps/permission-config.d.mts +60 -0
  349. package/src/foundry/client-esm/applications/dice/_module.d.mts +6 -0
  350. package/src/foundry/client-esm/applications/dice/roll-resolver.d.mts +98 -0
  351. package/src/foundry/client-esm/applications/elements/_module.d.mts +16 -0
  352. package/src/foundry/client-esm/applications/elements/color-picker.d.mts +26 -0
  353. package/src/foundry/client-esm/applications/elements/document-tags.d.mts +90 -0
  354. package/src/foundry/client-esm/applications/elements/file-picker.d.mts +62 -0
  355. package/src/foundry/client-esm/applications/elements/form-element.d.mts +106 -0
  356. package/src/foundry/client-esm/applications/elements/hue-slider.d.mts +20 -0
  357. package/src/foundry/client-esm/applications/elements/multi-select.d.mts +95 -0
  358. package/src/foundry/client-esm/applications/elements/prosemirror-editor.d.mts +53 -0
  359. package/src/foundry/client-esm/applications/elements/range-picker.d.mts +41 -0
  360. package/src/foundry/client-esm/applications/elements/string-tags.d.mts +73 -0
  361. package/src/foundry/client-esm/applications/forms/fields.d.mts +219 -0
  362. package/src/foundry/client-esm/applications/sheets/_module.d.mts +12 -0
  363. package/src/foundry/client-esm/applications/sheets/actor-sheet.d.mts +31 -0
  364. package/src/foundry/client-esm/applications/sheets/ambient-light-config.d.mts +18 -0
  365. package/src/foundry/client-esm/applications/sheets/ambient-sound-config.d.mts +18 -0
  366. package/src/foundry/client-esm/applications/sheets/item-sheet.d.mts +22 -0
  367. package/src/foundry/client-esm/applications/sheets/region-behavior-config.d.mts +13 -0
  368. package/src/foundry/client-esm/applications/sheets/region-config.d.mts +13 -0
  369. package/src/foundry/client-esm/applications/sheets/user-config.d.mts +18 -0
  370. package/src/foundry/client-esm/applications/ui/_module.d.mts +6 -0
  371. package/src/foundry/client-esm/applications/ui/region-legend.d.mts +12 -0
  372. package/src/foundry/client-esm/audio/_module.d.mts +13 -0
  373. package/src/foundry/client-esm/audio/_types.d.mts +1 -0
  374. package/src/foundry/client-esm/canvas/_module.d.mts +11 -0
  375. package/src/foundry/client-esm/canvas/edges/_module.d.mts +9 -0
  376. package/src/foundry/client-esm/canvas/edges/collision.d.mts +93 -0
  377. package/src/foundry/client-esm/canvas/edges/edge.d.mts +184 -0
  378. package/src/foundry/client-esm/canvas/edges/edges.d.mts +23 -0
  379. package/src/foundry/client-esm/canvas/edges/vertex.d.mts +134 -0
  380. package/src/foundry/client-esm/canvas/regions/_module.d.mts +10 -0
  381. package/src/foundry/client-esm/canvas/scene-manager.d.mts +1 -0
  382. package/src/foundry/client-esm/canvas/smaa/blend.d.mts +6 -0
  383. package/src/foundry/client-esm/canvas/smaa/edges.d.mts +6 -0
  384. package/src/foundry/client-esm/canvas/smaa/smaa.d.mts +56 -0
  385. package/src/foundry/client-esm/canvas/smaa/weights.d.mts +6 -0
  386. package/src/foundry/client-esm/canvas/sources/_module.d.mts +15 -0
  387. package/src/foundry/client-esm/canvas/sources/base-effect-source.d.mts +243 -0
  388. package/src/foundry/client-esm/canvas/sources/base-light-source.d.mts +162 -0
  389. package/src/foundry/client-esm/canvas/sources/global-light-source.d.mts +47 -0
  390. package/src/foundry/client-esm/canvas/sources/point-darkness-source.d.mts +77 -0
  391. package/src/foundry/client-esm/canvas/sources/point-effect-source.d.mts +91 -0
  392. package/src/foundry/client-esm/canvas/sources/point-light-source.d.mts +43 -0
  393. package/src/foundry/client-esm/canvas/sources/point-movement-source.d.mts +15 -0
  394. package/src/foundry/client-esm/canvas/sources/point-sound-source.d.mts +29 -0
  395. package/src/foundry/client-esm/canvas/sources/point-vision-source.d.mts +206 -0
  396. package/src/foundry/client-esm/canvas/sources/rendered-effect-source.d.mts +328 -0
  397. package/src/foundry/client-esm/canvas/tokens/_module.d.mts +7 -0
  398. package/src/foundry/client-esm/client.d.mts +291 -0
  399. package/src/foundry/client-esm/data/_module.d.mts +8 -0
  400. package/src/foundry/client-esm/data/client-backend.d.mts +52 -0
  401. package/src/foundry/client-esm/data/region-behaviors/_module.d.mts +14 -0
  402. package/src/foundry/client-esm/dice/_module.d.mts +13 -0
  403. package/src/foundry/client-esm/dice/_types.d.mts +61 -0
  404. package/src/foundry/client-esm/dice/parser.d.mts +205 -0
  405. package/src/foundry/client-esm/dice/roll.d.mts +645 -0
  406. package/src/foundry/client-esm/dice/terms/_module.d.mts +17 -0
  407. package/src/foundry/client-esm/dice/terms/coin.d.mts +68 -0
  408. package/src/foundry/client-esm/dice/terms/dice.d.mts +381 -0
  409. package/src/foundry/client-esm/dice/terms/die.d.mts +241 -0
  410. package/src/foundry/client-esm/dice/terms/fate.d.mts +50 -0
  411. package/src/foundry/client-esm/dice/terms/function.d.mts +104 -0
  412. package/src/foundry/client-esm/dice/terms/numeric.d.mts +56 -0
  413. package/src/foundry/client-esm/dice/terms/operator.d.mts +55 -0
  414. package/src/foundry/client-esm/dice/terms/parenthetical.d.mts +105 -0
  415. package/src/foundry/client-esm/dice/terms/pool.d.mts +278 -0
  416. package/src/foundry/client-esm/dice/terms/string.d.mts +34 -0
  417. package/src/foundry/client-esm/dice/terms/term.d.mts +160 -0
  418. package/src/foundry/client-esm/dice/twister.d.mts +134 -0
  419. package/src/foundry/client-esm/helpers/_module.d.mts +8 -0
  420. package/src/foundry/client-esm/helpers/_types.d.mts +51 -0
  421. package/src/foundry/client-esm/helpers/compendium-art.d.mts +47 -0
  422. package/src/foundry/clipper/clipper.d.mts +927 -0
  423. package/src/foundry/clipper/index.d.mts +1 -0
  424. package/src/foundry/common/abstract/_types.d.mts +274 -0
  425. package/src/foundry/common/abstract/backend.d.mts +190 -0
  426. package/src/foundry/common/abstract/data.d.mts +457 -0
  427. package/src/foundry/common/abstract/document.d.mts +1372 -0
  428. package/src/foundry/common/abstract/embedded-collection-delta.d.mts +96 -0
  429. package/src/foundry/common/abstract/embedded-collection.d.mts +252 -0
  430. package/src/foundry/common/abstract/module.d.mts +13 -0
  431. package/src/foundry/common/abstract/singleton-collection.d.mts +19 -0
  432. package/src/foundry/common/abstract/socket.d.mts +36 -0
  433. package/src/foundry/common/abstract/type-data.d.mts +337 -0
  434. package/src/foundry/common/config.d.mts +302 -0
  435. package/src/foundry/common/constants.d.mts +2054 -0
  436. package/src/foundry/common/data/data.d.mts +667 -0
  437. package/src/foundry/common/data/fields.d.mts +3388 -0
  438. package/src/foundry/common/data/module.d.mts +9 -0
  439. package/src/foundry/common/data/validation-failure.d.mts +174 -0
  440. package/src/foundry/common/data/validators.d.mts +30 -0
  441. package/src/foundry/common/documents/_module.d.mts +35 -0
  442. package/src/foundry/common/documents/_types.d.mts +143 -0
  443. package/src/foundry/common/documents/active-effect.d.mts +229 -0
  444. package/src/foundry/common/documents/actor-delta.d.mts +132 -0
  445. package/src/foundry/common/documents/actor.d.mts +209 -0
  446. package/src/foundry/common/documents/adventure.d.mts +212 -0
  447. package/src/foundry/common/documents/ambient-light.d.mts +107 -0
  448. package/src/foundry/common/documents/ambient-sound.d.mts +142 -0
  449. package/src/foundry/common/documents/card.d.mts +254 -0
  450. package/src/foundry/common/documents/cards.d.mts +191 -0
  451. package/src/foundry/common/documents/chat-message.d.mts +208 -0
  452. package/src/foundry/common/documents/combat.d.mts +124 -0
  453. package/src/foundry/common/documents/combatant.d.mts +127 -0
  454. package/src/foundry/common/documents/drawing.d.mts +255 -0
  455. package/src/foundry/common/documents/fog-exploration.d.mts +110 -0
  456. package/src/foundry/common/documents/folder.d.mts +130 -0
  457. package/src/foundry/common/documents/item.d.mts +181 -0
  458. package/src/foundry/common/documents/journal-entry-page.d.mts +229 -0
  459. package/src/foundry/common/documents/journal-entry.d.mts +133 -0
  460. package/src/foundry/common/documents/macro.d.mts +190 -0
  461. package/src/foundry/common/documents/measured-template.d.mts +183 -0
  462. package/src/foundry/common/documents/module.d.mts +35 -0
  463. package/src/foundry/common/documents/note.d.mts +195 -0
  464. package/src/foundry/common/documents/playlist-sound.d.mts +131 -0
  465. package/src/foundry/common/documents/playlist.d.mts +160 -0
  466. package/src/foundry/common/documents/roll-table.d.mts +153 -0
  467. package/src/foundry/common/documents/scene.d.mts +395 -0
  468. package/src/foundry/common/documents/setting.d.mts +88 -0
  469. package/src/foundry/common/documents/table-result.d.mts +157 -0
  470. package/src/foundry/common/documents/tile.d.mts +204 -0
  471. package/src/foundry/common/documents/token.d.mts +515 -0
  472. package/src/foundry/common/documents/user.d.mts +247 -0
  473. package/src/foundry/common/documents/wall.d.mts +196 -0
  474. package/src/foundry/common/grid/_module.d.mts +10 -0
  475. package/src/foundry/common/grid/base.d.mts +640 -0
  476. package/src/foundry/common/grid/grid-hex.d.mts +55 -0
  477. package/src/foundry/common/grid/gridless.d.mts +71 -0
  478. package/src/foundry/common/grid/hexagonal.d.mts +391 -0
  479. package/src/foundry/common/grid/square.d.mts +100 -0
  480. package/src/foundry/common/packages/base-module.d.mts +46 -0
  481. package/src/foundry/common/packages/base-package.d.mts +677 -0
  482. package/src/foundry/common/packages/base-system.d.mts +90 -0
  483. package/src/foundry/common/packages/base-world.d.mts +116 -0
  484. package/src/foundry/common/packages/module.d.mts +28 -0
  485. package/src/foundry/common/packages/sub-types.d.mts +42 -0
  486. package/src/foundry/common/primitives/array.d.mts +56 -0
  487. package/src/foundry/common/primitives/date.d.mts +24 -0
  488. package/src/foundry/common/primitives/math.d.mts +103 -0
  489. package/src/foundry/common/primitives/module.d.mts +8 -0
  490. package/src/foundry/common/primitives/number.d.mts +91 -0
  491. package/src/foundry/common/primitives/regex.d.mts +12 -0
  492. package/src/foundry/common/primitives/regexp.d.mts +12 -0
  493. package/src/foundry/common/primitives/set.d.mts +105 -0
  494. package/src/foundry/common/primitives/string.d.mts +58 -0
  495. package/src/foundry/common/primitives/url.d.mts +18 -0
  496. package/src/foundry/common/prosemirror/_module.d.mts +82 -0
  497. package/src/foundry/common/prosemirror/click-handler.d.mts +34 -0
  498. package/src/foundry/common/prosemirror/content-link-plugin.d.mts +47 -0
  499. package/src/foundry/common/prosemirror/dirty-plugin.d.mts +13 -0
  500. package/src/foundry/common/prosemirror/dom-parser.d.mts +9 -0
  501. package/src/foundry/common/prosemirror/dropdown.d.mts +65 -0
  502. package/src/foundry/common/prosemirror/extensions.d.mts +12 -0
  503. package/src/foundry/common/prosemirror/highlight-matches-plugin.d.mts +82 -0
  504. package/src/foundry/common/prosemirror/image-plugin.d.mts +82 -0
  505. package/src/foundry/common/prosemirror/index.d.mts +22 -0
  506. package/src/foundry/common/prosemirror/input-rules.d.mts +34 -0
  507. package/src/foundry/common/prosemirror/keymaps.d.mts +47 -0
  508. package/src/foundry/common/prosemirror/menu.d.mts +255 -0
  509. package/src/foundry/common/prosemirror/paste-transformer.d.mts +22 -0
  510. package/src/foundry/common/prosemirror/plugin.d.mts +24 -0
  511. package/src/foundry/common/prosemirror/schema/attribute-capture.d.mts +39 -0
  512. package/src/foundry/common/prosemirror/schema/core.d.mts +51 -0
  513. package/src/foundry/common/prosemirror/schema/image-link-node.d.mts +29 -0
  514. package/src/foundry/common/prosemirror/schema/image-node.d.mts +19 -0
  515. package/src/foundry/common/prosemirror/schema/index.d.mts +12 -0
  516. package/src/foundry/common/prosemirror/schema/link-mark.d.mts +30 -0
  517. package/src/foundry/common/prosemirror/schema/lists.d.mts +55 -0
  518. package/src/foundry/common/prosemirror/schema/marks.d.mts +44 -0
  519. package/src/foundry/common/prosemirror/schema/other.d.mts +149 -0
  520. package/src/foundry/common/prosemirror/schema/schema-definition.d.mts +39 -0
  521. package/src/foundry/common/prosemirror/schema/secret-node.d.mts +27 -0
  522. package/src/foundry/common/prosemirror/schema/tables.d.mts +106 -0
  523. package/src/foundry/common/prosemirror/schema/utils.d.mts +37 -0
  524. package/src/foundry/common/prosemirror/schema.d.mts +138 -0
  525. package/src/foundry/common/prosemirror/string-serializer.d.mts +120 -0
  526. package/src/foundry/common/prosemirror/util.d.mts +43 -0
  527. package/src/foundry/common/types.d.mts +332 -0
  528. package/src/foundry/common/utils/bitmask.d.mts +110 -0
  529. package/src/foundry/common/utils/collection.d.mts +176 -0
  530. package/src/foundry/common/utils/color.d.mts +291 -0
  531. package/src/foundry/common/utils/event-emitter.d.mts +62 -0
  532. package/src/foundry/common/utils/geometry.d.mts +198 -0
  533. package/src/foundry/common/utils/helpers.d.mts +752 -0
  534. package/src/foundry/common/utils/http.d.mts +52 -0
  535. package/src/foundry/common/utils/iterable-weak-map.d.mts +80 -0
  536. package/src/foundry/common/utils/iterable-weak-set.d.mts +47 -0
  537. package/src/foundry/common/utils/logging.d.mts +42 -0
  538. package/src/foundry/common/utils/module.d.mts +18 -0
  539. package/src/foundry/common/utils/semaphore.d.mts +82 -0
  540. package/src/foundry/common/utils/string-tree.d.mts +95 -0
  541. package/src/foundry/common/utils/word-tree.d.mts +66 -0
  542. package/src/foundry/index.d.mts +5 -0
  543. package/src/foundry/public/index.d.mts +1 -0
  544. package/src/foundry/public/scripts/earcut-edges/earcut-edges.d.mts +11 -0
  545. package/src/foundry/public/scripts/earcut-edges/index.d.mts +1 -0
  546. package/src/foundry/public/scripts/index.d.mts +1 -0
  547. package/src/index.d.mts +2 -0
  548. package/src/types/augments/index.d.mts +4 -0
  549. package/src/types/augments/pixi.d.mts +38 -0
  550. package/src/types/augments/simple-peer.d.mts +13 -0
  551. package/src/types/augments/socket.io-client.d.mts +12 -0
  552. package/src/types/augments/tinyMCE.d.mts +72 -0
  553. package/src/types/config.d.mts +331 -0
  554. package/src/types/configuredDocuments.d.mts +103 -0
  555. package/src/types/helperTypes.d.mts +261 -0
  556. package/src/types/index.d.mts +4 -0
  557. package/src/types/utils.d.mts +406 -0
  558. package/index-lenient.d.ts +0 -10
  559. package/index.d.ts +0 -4
  560. package/src/foundry/client/apps/app.d.ts +0 -560
  561. package/src/foundry/client/apps/av/av-config.d.ts +0 -85
  562. package/src/foundry/client/apps/av/cameras.d.ts +0 -174
  563. package/src/foundry/client/apps/av/index.d.ts +0 -3
  564. package/src/foundry/client/apps/form.d.ts +0 -384
  565. package/src/foundry/client/apps/forms/actor.d.ts +0 -192
  566. package/src/foundry/client/apps/forms/card-config.d.ts +0 -51
  567. package/src/foundry/client/apps/forms/cards-config.d.ts +0 -128
  568. package/src/foundry/client/apps/forms/combat-config.d.ts +0 -41
  569. package/src/foundry/client/apps/forms/combatant-config.d.ts +0 -49
  570. package/src/foundry/client/apps/forms/effect-config.d.ts +0 -65
  571. package/src/foundry/client/apps/forms/folder-config.d.ts +0 -63
  572. package/src/foundry/client/apps/forms/grid-config.d.ts +0 -151
  573. package/src/foundry/client/apps/forms/image-popout.d.ts +0 -166
  574. package/src/foundry/client/apps/forms/index.d.ts +0 -20
  575. package/src/foundry/client/apps/forms/item.d.ts +0 -71
  576. package/src/foundry/client/apps/forms/journal-sheet.d.ts +0 -107
  577. package/src/foundry/client/apps/forms/macro-config.d.ts +0 -71
  578. package/src/foundry/client/apps/forms/measure-template.d.ts +0 -53
  579. package/src/foundry/client/apps/forms/permission.d.ts +0 -58
  580. package/src/foundry/client/apps/forms/playlist-config.d.ts +0 -43
  581. package/src/foundry/client/apps/forms/playlist-sound-config.d.ts +0 -61
  582. package/src/foundry/client/apps/forms/roll-table-config.d.ts +0 -175
  583. package/src/foundry/client/apps/forms/scene-config.d.ts +0 -148
  584. package/src/foundry/client/apps/forms/sheet-config.d.ts +0 -184
  585. package/src/foundry/client/apps/forms/user-config.d.ts +0 -74
  586. package/src/foundry/client/apps/hud/chatbubble.d.ts +0 -89
  587. package/src/foundry/client/apps/hud/container.d.ts +0 -46
  588. package/src/foundry/client/apps/hud/controls.d.ts +0 -156
  589. package/src/foundry/client/apps/hud/hotbar.d.ts +0 -143
  590. package/src/foundry/client/apps/hud/hud.d.ts +0 -84
  591. package/src/foundry/client/apps/hud/index.d.ts +0 -9
  592. package/src/foundry/client/apps/hud/menu.d.ts +0 -71
  593. package/src/foundry/client/apps/hud/navigation.d.ts +0 -110
  594. package/src/foundry/client/apps/hud/pause.d.ts +0 -20
  595. package/src/foundry/client/apps/hud/players.d.ts +0 -55
  596. package/src/foundry/client/apps/i18n.d.ts +0 -136
  597. package/src/foundry/client/apps/index.d.ts +0 -9
  598. package/src/foundry/client/apps/placeables/drawing-config.d.ts +0 -99
  599. package/src/foundry/client/apps/placeables/drawing-hud.d.ts +0 -32
  600. package/src/foundry/client/apps/placeables/index.d.ts +0 -10
  601. package/src/foundry/client/apps/placeables/light-config.d.ts +0 -95
  602. package/src/foundry/client/apps/placeables/note-config.d.ts +0 -57
  603. package/src/foundry/client/apps/placeables/sound-config.d.ts +0 -47
  604. package/src/foundry/client/apps/placeables/tile-config.d.ts +0 -55
  605. package/src/foundry/client/apps/placeables/tile-hud.d.ts +0 -37
  606. package/src/foundry/client/apps/placeables/token-config.d.ts +0 -226
  607. package/src/foundry/client/apps/placeables/token-hud.d.ts +0 -140
  608. package/src/foundry/client/apps/placeables/wall-config.d.ts +0 -75
  609. package/src/foundry/client/apps/sidebar/apps/chat-popout.d.ts +0 -34
  610. package/src/foundry/client/apps/sidebar/apps/client-settings.d.ts +0 -116
  611. package/src/foundry/client/apps/sidebar/apps/compendium.d.ts +0 -86
  612. package/src/foundry/client/apps/sidebar/apps/controls-reference.d.ts +0 -30
  613. package/src/foundry/client/apps/sidebar/apps/index.d.ts +0 -10
  614. package/src/foundry/client/apps/sidebar/apps/invitation-links.d.ts +0 -37
  615. package/src/foundry/client/apps/sidebar/apps/keybindings-config.d.ts +0 -247
  616. package/src/foundry/client/apps/sidebar/apps/module-management.d.ts +0 -120
  617. package/src/foundry/client/apps/sidebar/apps/permission-config.d.ts +0 -64
  618. package/src/foundry/client/apps/sidebar/apps/support-details.d.ts +0 -76
  619. package/src/foundry/client/apps/sidebar/apps/world-config.d.ts +0 -77
  620. package/src/foundry/client/apps/sidebar/index.d.ts +0 -5
  621. package/src/foundry/client/apps/sidebar/sidebar.d.ts +0 -102
  622. package/src/foundry/client/apps/sidebar/tab-base.d.ts +0 -68
  623. package/src/foundry/client/apps/sidebar/tab-directory.d.ts +0 -236
  624. package/src/foundry/client/apps/sidebar/tabs/actors-directory.d.ts +0 -16
  625. package/src/foundry/client/apps/sidebar/tabs/cards-directory.d.ts +0 -6
  626. package/src/foundry/client/apps/sidebar/tabs/chat-log.d.ts +0 -351
  627. package/src/foundry/client/apps/sidebar/tabs/combat-tracker.d.ts +0 -205
  628. package/src/foundry/client/apps/sidebar/tabs/compendium-directory.d.ts +0 -77
  629. package/src/foundry/client/apps/sidebar/tabs/index.d.ts +0 -12
  630. package/src/foundry/client/apps/sidebar/tabs/items-directory.d.ts +0 -10
  631. package/src/foundry/client/apps/sidebar/tabs/journal-directory.d.ts +0 -11
  632. package/src/foundry/client/apps/sidebar/tabs/macros-directory.d.ts +0 -12
  633. package/src/foundry/client/apps/sidebar/tabs/playlists-directory.d.ts +0 -306
  634. package/src/foundry/client/apps/sidebar/tabs/roll-table-directory.d.ts +0 -9
  635. package/src/foundry/client/apps/sidebar/tabs/scenes-directory.d.ts +0 -18
  636. package/src/foundry/client/apps/sidebar/tabs/settings.d.ts +0 -88
  637. package/src/foundry/client/apps/templates.d.ts +0 -425
  638. package/src/foundry/client/audio/audio.d.ts +0 -343
  639. package/src/foundry/client/audio/container.d.ts +0 -175
  640. package/src/foundry/client/audio/index.d.ts +0 -3
  641. package/src/foundry/client/audio/sound.d.ts +0 -303
  642. package/src/foundry/client/av/client.d.ts +0 -158
  643. package/src/foundry/client/av/clients/index.d.ts +0 -1
  644. package/src/foundry/client/av/clients/simplepeer.d.ts +0 -151
  645. package/src/foundry/client/av/index.d.ts +0 -4
  646. package/src/foundry/client/av/master.d.ts +0 -187
  647. package/src/foundry/client/av/settings.d.ts +0 -236
  648. package/src/foundry/client/config.d.ts +0 -1425
  649. package/src/foundry/client/core/gamepad.d.ts +0 -53
  650. package/src/foundry/client/core/hooks.d.ts +0 -967
  651. package/src/foundry/client/core/image.d.ts +0 -129
  652. package/src/foundry/client/core/index.d.ts +0 -13
  653. package/src/foundry/client/core/keybindings.d.ts +0 -298
  654. package/src/foundry/client/core/keyboard.d.ts +0 -247
  655. package/src/foundry/client/core/mouse.d.ts +0 -18
  656. package/src/foundry/client/core/nue.d.ts +0 -34
  657. package/src/foundry/client/core/settings.d.ts +0 -222
  658. package/src/foundry/client/core/socket.d.ts +0 -46
  659. package/src/foundry/client/core/sorting.d.ts +0 -78
  660. package/src/foundry/client/core/time.d.ts +0 -67
  661. package/src/foundry/client/core/utils.d.ts +0 -33
  662. package/src/foundry/client/core/video.d.ts +0 -65
  663. package/src/foundry/client/data/abstract/canvas-document.d.ts +0 -70
  664. package/src/foundry/client/data/abstract/client-backend.d.ts +0 -206
  665. package/src/foundry/client/data/abstract/client-document.d.ts +0 -439
  666. package/src/foundry/client/data/abstract/document-collection.d.ts +0 -192
  667. package/src/foundry/client/data/abstract/index.d.ts +0 -5
  668. package/src/foundry/client/data/abstract/world-collection.d.ts +0 -167
  669. package/src/foundry/client/data/collections/actors.d.ts +0 -35
  670. package/src/foundry/client/data/collections/cards.d.ts +0 -8
  671. package/src/foundry/client/data/collections/combats.d.ts +0 -43
  672. package/src/foundry/client/data/collections/compendium.d.ts +0 -321
  673. package/src/foundry/client/data/collections/fog.d.ts +0 -7
  674. package/src/foundry/client/data/collections/folder.d.ts +0 -27
  675. package/src/foundry/client/data/collections/index.d.ts +0 -15
  676. package/src/foundry/client/data/collections/items.d.ts +0 -10
  677. package/src/foundry/client/data/collections/journal.d.ts +0 -26
  678. package/src/foundry/client/data/collections/macros.d.ts +0 -26
  679. package/src/foundry/client/data/collections/messages.d.ts +0 -39
  680. package/src/foundry/client/data/collections/playlists.d.ts +0 -41
  681. package/src/foundry/client/data/collections/scenes.d.ts +0 -62
  682. package/src/foundry/client/data/collections/settings.d.ts +0 -25
  683. package/src/foundry/client/data/collections/tables.d.ts +0 -17
  684. package/src/foundry/client/data/collections/users.d.ts +0 -43
  685. package/src/foundry/client/data/documents/active-effect.d.ts +0 -172
  686. package/src/foundry/client/data/documents/actor.d.ts +0 -231
  687. package/src/foundry/client/data/documents/ambient-light.d.ts +0 -18
  688. package/src/foundry/client/data/documents/ambient-sound.d.ts +0 -9
  689. package/src/foundry/client/data/documents/card.d.ts +0 -133
  690. package/src/foundry/client/data/documents/cards.d.ts +0 -376
  691. package/src/foundry/client/data/documents/chat-message.d.ts +0 -267
  692. package/src/foundry/client/data/documents/combat.d.ts +0 -227
  693. package/src/foundry/client/data/documents/combatant.d.ts +0 -104
  694. package/src/foundry/client/data/documents/drawing.d.ts +0 -19
  695. package/src/foundry/client/data/documents/fog-exploration.d.ts +0 -64
  696. package/src/foundry/client/data/documents/folder.d.ts +0 -115
  697. package/src/foundry/client/data/documents/index.d.ts +0 -27
  698. package/src/foundry/client/data/documents/item.d.ts +0 -59
  699. package/src/foundry/client/data/documents/journal-entry.d.ts +0 -71
  700. package/src/foundry/client/data/documents/macro.d.ts +0 -60
  701. package/src/foundry/client/data/documents/measured-template.d.ts +0 -21
  702. package/src/foundry/client/data/documents/note.d.ts +0 -19
  703. package/src/foundry/client/data/documents/playlist-sound.d.ts +0 -117
  704. package/src/foundry/client/data/documents/playlist.d.ts +0 -192
  705. package/src/foundry/client/data/documents/scene.d.ts +0 -465
  706. package/src/foundry/client/data/documents/setting.d.ts +0 -35
  707. package/src/foundry/client/data/documents/table-result.d.ts +0 -30
  708. package/src/foundry/client/data/documents/table.d.ts +0 -220
  709. package/src/foundry/client/data/documents/tile.d.ts +0 -13
  710. package/src/foundry/client/data/documents/token.d.ts +0 -281
  711. package/src/foundry/client/data/documents/user.d.ts +0 -155
  712. package/src/foundry/client/data/documents/wall.d.ts +0 -9
  713. package/src/foundry/client/data/index.d.ts +0 -3
  714. package/src/foundry/client/dice/dice/coin.d.ts +0 -49
  715. package/src/foundry/client/dice/dice/die.d.ts +0 -230
  716. package/src/foundry/client/dice/dice/fate.d.ts +0 -37
  717. package/src/foundry/client/dice/dice/index.d.ts +0 -3
  718. package/src/foundry/client/dice/index.d.ts +0 -5
  719. package/src/foundry/client/dice/roll.d.ts +0 -495
  720. package/src/foundry/client/dice/term.d.ts +0 -123
  721. package/src/foundry/client/dice/terms/dice.d.ts +0 -277
  722. package/src/foundry/client/dice/terms/index.d.ts +0 -7
  723. package/src/foundry/client/dice/terms/math.d.ts +0 -69
  724. package/src/foundry/client/dice/terms/numeric.d.ts +0 -53
  725. package/src/foundry/client/dice/terms/operator.d.ts +0 -18
  726. package/src/foundry/client/dice/terms/parenthetical.d.ts +0 -51
  727. package/src/foundry/client/dice/terms/pool.d.ts +0 -235
  728. package/src/foundry/client/dice/terms/string.d.ts +0 -31
  729. package/src/foundry/client/dice/twister.d.ts +0 -134
  730. package/src/foundry/client/game.d.ts +0 -682
  731. package/src/foundry/client/head.d.ts +0 -44
  732. package/src/foundry/client/index.d.ts +0 -12
  733. package/src/foundry/client/pixi/board.d.ts +0 -626
  734. package/src/foundry/client/pixi/core/containers/cached-container.d.ts +0 -64
  735. package/src/foundry/client/pixi/core/containers/index.d.ts +0 -3
  736. package/src/foundry/client/pixi/core/containers/quadtree.d.ts +0 -166
  737. package/src/foundry/client/pixi/core/containers/sampler-mesh.d.ts +0 -22
  738. package/src/foundry/client/pixi/core/culling.d.ts +0 -37
  739. package/src/foundry/client/pixi/core/index.d.ts +0 -5
  740. package/src/foundry/client/pixi/core/interaction/canvas-animation.d.ts +0 -148
  741. package/src/foundry/client/pixi/core/interaction/control-icon.d.ts +0 -58
  742. package/src/foundry/client/pixi/core/interaction/index.d.ts +0 -5
  743. package/src/foundry/client/pixi/core/interaction/mouse-handler.d.ts +0 -323
  744. package/src/foundry/client/pixi/core/interaction/resize-handle.d.ts +0 -48
  745. package/src/foundry/client/pixi/core/interaction/targets.d.ts +0 -51
  746. package/src/foundry/client/pixi/core/loader.d.ts +0 -157
  747. package/src/foundry/client/pixi/core/shapes/index.d.ts +0 -5
  748. package/src/foundry/client/pixi/core/shapes/normalized-rectangle.d.ts +0 -31
  749. package/src/foundry/client/pixi/core/shapes/polygon-helpers.d.ts +0 -263
  750. package/src/foundry/client/pixi/core/shapes/precise-text.d.ts +0 -18
  751. package/src/foundry/client/pixi/core/shapes/ray.d.ts +0 -200
  752. package/src/foundry/client/pixi/core/shapes/source-polygon.d.ts +0 -110
  753. package/src/foundry/client/pixi/groups/effects.d.ts +0 -29
  754. package/src/foundry/client/pixi/groups/index.d.ts +0 -3
  755. package/src/foundry/client/pixi/groups/interface.d.ts +0 -27
  756. package/src/foundry/client/pixi/groups/primary.d.ts +0 -40
  757. package/src/foundry/client/pixi/index.d.ts +0 -10
  758. package/src/foundry/client/pixi/layer.d.ts +0 -105
  759. package/src/foundry/client/pixi/layers/controls/cursor.d.ts +0 -27
  760. package/src/foundry/client/pixi/layers/controls/door.d.ts +0 -67
  761. package/src/foundry/client/pixi/layers/controls/hud.d.ts +0 -117
  762. package/src/foundry/client/pixi/layers/controls/index.d.ts +0 -4
  763. package/src/foundry/client/pixi/layers/controls/ruler.d.ts +0 -207
  764. package/src/foundry/client/pixi/layers/controls.d.ts +0 -144
  765. package/src/foundry/client/pixi/layers/drawings.d.ts +0 -116
  766. package/src/foundry/client/pixi/layers/effects/effect.d.ts +0 -133
  767. package/src/foundry/client/pixi/layers/effects/index.d.ts +0 -4
  768. package/src/foundry/client/pixi/layers/effects/leaves.d.ts +0 -79
  769. package/src/foundry/client/pixi/layers/effects/rain.d.ts +0 -107
  770. package/src/foundry/client/pixi/layers/effects/snow.d.ts +0 -62
  771. package/src/foundry/client/pixi/layers/effects.d.ts +0 -61
  772. package/src/foundry/client/pixi/layers/grid/grid.d.ts +0 -171
  773. package/src/foundry/client/pixi/layers/grid/hex.d.ts +0 -118
  774. package/src/foundry/client/pixi/layers/grid/highlight.d.ts +0 -28
  775. package/src/foundry/client/pixi/layers/grid/index.d.ts +0 -4
  776. package/src/foundry/client/pixi/layers/grid/square.d.ts +0 -48
  777. package/src/foundry/client/pixi/layers/grid.d.ts +0 -204
  778. package/src/foundry/client/pixi/layers/index.d.ts +0 -15
  779. package/src/foundry/client/pixi/layers/lighting.d.ts +0 -229
  780. package/src/foundry/client/pixi/layers/map.d.ts +0 -263
  781. package/src/foundry/client/pixi/layers/notes.d.ts +0 -64
  782. package/src/foundry/client/pixi/layers/sight.d.ts +0 -313
  783. package/src/foundry/client/pixi/layers/sounds.d.ts +0 -112
  784. package/src/foundry/client/pixi/layers/templates.d.ts +0 -51
  785. package/src/foundry/client/pixi/layers/tokens.d.ts +0 -169
  786. package/src/foundry/client/pixi/layers/walls.d.ts +0 -321
  787. package/src/foundry/client/pixi/perception/clockwise-sweep.d.ts +0 -406
  788. package/src/foundry/client/pixi/perception/index.d.ts +0 -2
  789. package/src/foundry/client/pixi/perception/perception-manager.d.ts +0 -107
  790. package/src/foundry/client/pixi/placeable.d.ts +0 -414
  791. package/src/foundry/client/pixi/placeables/drawing.d.ts +0 -289
  792. package/src/foundry/client/pixi/placeables/index.d.ts +0 -8
  793. package/src/foundry/client/pixi/placeables/light.d.ts +0 -126
  794. package/src/foundry/client/pixi/placeables/note.d.ts +0 -67
  795. package/src/foundry/client/pixi/placeables/sound.d.ts +0 -131
  796. package/src/foundry/client/pixi/placeables/template.d.ts +0 -153
  797. package/src/foundry/client/pixi/placeables/tile.d.ts +0 -315
  798. package/src/foundry/client/pixi/placeables/token.d.ts +0 -722
  799. package/src/foundry/client/pixi/placeables/wall.d.ts +0 -268
  800. package/src/foundry/client/pixi/placeables.d.ts +0 -520
  801. package/src/foundry/client/pixi/sources/base-source.d.ts +0 -145
  802. package/src/foundry/client/pixi/sources/index.d.ts +0 -4
  803. package/src/foundry/client/pixi/sources/light-source.d.ts +0 -413
  804. package/src/foundry/client/pixi/sources/sound-source.d.ts +0 -45
  805. package/src/foundry/client/pixi/sources/vision-source.d.ts +0 -123
  806. package/src/foundry/client/pixi/webgl/base.d.ts +0 -69
  807. package/src/foundry/client/pixi/webgl/blend_modes.d.ts +0 -33
  808. package/src/foundry/client/pixi/webgl/filters.d.ts +0 -182
  809. package/src/foundry/client/pixi/webgl/index.d.ts +0 -5
  810. package/src/foundry/client/pixi/webgl/lighting.d.ts +0 -480
  811. package/src/foundry/client/pixi/webgl/sampler.d.ts +0 -19
  812. package/src/foundry/client/ui/context.d.ts +0 -136
  813. package/src/foundry/client/ui/dialog.d.ts +0 -286
  814. package/src/foundry/client/ui/drag.d.ts +0 -105
  815. package/src/foundry/client/ui/dragdrop.d.ts +0 -118
  816. package/src/foundry/client/ui/editor.d.ts +0 -321
  817. package/src/foundry/client/ui/filepicker.d.ts +0 -510
  818. package/src/foundry/client/ui/filter.d.ts +0 -106
  819. package/src/foundry/client/ui/forms.d.ts +0 -47
  820. package/src/foundry/client/ui/index.d.ts +0 -10
  821. package/src/foundry/client/ui/notifications.d.ts +0 -110
  822. package/src/foundry/client/ui/tabs.d.ts +0 -103
  823. package/src/foundry/common/abstract/backend.mjs.d.ts +0 -253
  824. package/src/foundry/common/abstract/data.mjs.d.ts +0 -316
  825. package/src/foundry/common/abstract/document.mjs.d.ts +0 -838
  826. package/src/foundry/common/abstract/embedded-collection.mjs.d.ts +0 -79
  827. package/src/foundry/common/abstract/module.mjs.d.ts +0 -6
  828. package/src/foundry/common/config.mjs/index.d.ts +0 -1
  829. package/src/foundry/common/config.mjs/releaseData.d.ts +0 -100
  830. package/src/foundry/common/constants.mjs.d.ts +0 -940
  831. package/src/foundry/common/data/data.mjs/activeEffectData.d.ts +0 -168
  832. package/src/foundry/common/data/data.mjs/actorData.d.ts +0 -219
  833. package/src/foundry/common/data/data.mjs/adventureData.d.ts +0 -166
  834. package/src/foundry/common/data/data.mjs/ambientLightData.d.ts +0 -154
  835. package/src/foundry/common/data/data.mjs/ambientSoundData.d.ts +0 -195
  836. package/src/foundry/common/data/data.mjs/animationData.d.ts +0 -91
  837. package/src/foundry/common/data/data.mjs/cardData.d.ts +0 -264
  838. package/src/foundry/common/data/data.mjs/cardFaceData.d.ts +0 -67
  839. package/src/foundry/common/data/data.mjs/cardsData.d.ts +0 -237
  840. package/src/foundry/common/data/data.mjs/chatMessageData.d.ts +0 -220
  841. package/src/foundry/common/data/data.mjs/chatSpeakerData.d.ts +0 -80
  842. package/src/foundry/common/data/data.mjs/combatData.d.ts +0 -149
  843. package/src/foundry/common/data/data.mjs/combatantData.d.ts +0 -136
  844. package/src/foundry/common/data/data.mjs/darknessActivation.d.ts +0 -55
  845. package/src/foundry/common/data/data.mjs/drawingData.d.ts +0 -407
  846. package/src/foundry/common/data/data.mjs/effectChangeData.d.ts +0 -80
  847. package/src/foundry/common/data/data.mjs/effectDurationData.d.ts +0 -109
  848. package/src/foundry/common/data/data.mjs/fogExplorationData.d.ts +0 -115
  849. package/src/foundry/common/data/data.mjs/folderData.d.ts +0 -155
  850. package/src/foundry/common/data/data.mjs/index.d.ts +0 -31
  851. package/src/foundry/common/data/data.mjs/itemData.d.ts +0 -184
  852. package/src/foundry/common/data/data.mjs/journalEntryData.d.ts +0 -132
  853. package/src/foundry/common/data/data.mjs/lightData.d.ts +0 -227
  854. package/src/foundry/common/data/data.mjs/macroData.d.ts +0 -199
  855. package/src/foundry/common/data/data.mjs/measuredTemplateData.d.ts +0 -212
  856. package/src/foundry/common/data/data.mjs/noteData.d.ts +0 -233
  857. package/src/foundry/common/data/data.mjs/playlistData.d.ts +0 -201
  858. package/src/foundry/common/data/data.mjs/playlistSoundData.d.ts +0 -159
  859. package/src/foundry/common/data/data.mjs/prototypeTokenData.d.ts +0 -75
  860. package/src/foundry/common/data/data.mjs/rollTableData.d.ts +0 -189
  861. package/src/foundry/common/data/data.mjs/sceneData.d.ts +0 -665
  862. package/src/foundry/common/data/data.mjs/settingData.d.ts +0 -86
  863. package/src/foundry/common/data/data.mjs/tableResultData.d.ts +0 -167
  864. package/src/foundry/common/data/data.mjs/tileData.d.ts +0 -246
  865. package/src/foundry/common/data/data.mjs/tileOcclusion.d.ts +0 -62
  866. package/src/foundry/common/data/data.mjs/tokenBarData.d.ts +0 -47
  867. package/src/foundry/common/data/data.mjs/tokenData.d.ts +0 -505
  868. package/src/foundry/common/data/data.mjs/userData.d.ts +0 -177
  869. package/src/foundry/common/data/data.mjs/videoData.d.ts +0 -70
  870. package/src/foundry/common/data/data.mjs/wallData.d.ts +0 -222
  871. package/src/foundry/common/data/fields.mjs.d.ts +0 -526
  872. package/src/foundry/common/data/module.mjs.d.ts +0 -3
  873. package/src/foundry/common/data/validators.mjs.d.ts +0 -56
  874. package/src/foundry/common/documents.mjs/baseActiveEffect.d.ts +0 -44
  875. package/src/foundry/common/documents.mjs/baseActor.d.ts +0 -68
  876. package/src/foundry/common/documents.mjs/baseAdventure.d.ts +0 -38
  877. package/src/foundry/common/documents.mjs/baseAmbientLight.d.ts +0 -31
  878. package/src/foundry/common/documents.mjs/baseAmbientSound.d.ts +0 -29
  879. package/src/foundry/common/documents.mjs/baseCard.d.ts +0 -58
  880. package/src/foundry/common/documents.mjs/baseCards.d.ts +0 -39
  881. package/src/foundry/common/documents.mjs/baseChatMessage.d.ts +0 -49
  882. package/src/foundry/common/documents.mjs/baseCombat.d.ts +0 -40
  883. package/src/foundry/common/documents.mjs/baseCombatant.d.ts +0 -48
  884. package/src/foundry/common/documents.mjs/baseDrawing.d.ts +0 -54
  885. package/src/foundry/common/documents.mjs/baseFogExploration.d.ts +0 -41
  886. package/src/foundry/common/documents.mjs/baseFolder.d.ts +0 -30
  887. package/src/foundry/common/documents.mjs/baseItem.d.ts +0 -57
  888. package/src/foundry/common/documents.mjs/baseJournalEntry.d.ts +0 -26
  889. package/src/foundry/common/documents.mjs/baseMacro.d.ts +0 -42
  890. package/src/foundry/common/documents.mjs/baseMeasuredTemplate.d.ts +0 -66
  891. package/src/foundry/common/documents.mjs/baseNote.d.ts +0 -39
  892. package/src/foundry/common/documents.mjs/basePlaylist.d.ts +0 -32
  893. package/src/foundry/common/documents.mjs/basePlaylistSound.d.ts +0 -37
  894. package/src/foundry/common/documents.mjs/baseRollTable.d.ts +0 -31
  895. package/src/foundry/common/documents.mjs/baseScene.d.ts +0 -120
  896. package/src/foundry/common/documents.mjs/baseSetting.d.ts +0 -38
  897. package/src/foundry/common/documents.mjs/baseTableResult.d.ts +0 -52
  898. package/src/foundry/common/documents.mjs/baseTile.d.ts +0 -29
  899. package/src/foundry/common/documents.mjs/baseToken.d.ts +0 -44
  900. package/src/foundry/common/documents.mjs/baseUser.d.ts +0 -102
  901. package/src/foundry/common/documents.mjs/baseWall.d.ts +0 -43
  902. package/src/foundry/common/documents.mjs/index.d.ts +0 -28
  903. package/src/foundry/common/module.mjs.d.ts +0 -114
  904. package/src/foundry/common/packages.mjs/index.d.ts +0 -8
  905. package/src/foundry/common/packages.mjs/moduleData.d.ts +0 -55
  906. package/src/foundry/common/packages.mjs/packageAuthorData.d.ts +0 -58
  907. package/src/foundry/common/packages.mjs/packageCompendiumData.d.ts +0 -88
  908. package/src/foundry/common/packages.mjs/packageData.d.ts +0 -319
  909. package/src/foundry/common/packages.mjs/packageDependencyData.d.ts +0 -69
  910. package/src/foundry/common/packages.mjs/packageLanguageData.d.ts +0 -75
  911. package/src/foundry/common/packages.mjs/systemData.d.ts +0 -58
  912. package/src/foundry/common/packages.mjs/tagPackageAvailability.d.ts +0 -9
  913. package/src/foundry/common/packages.mjs/worldData.d.ts +0 -76
  914. package/src/foundry/common/types.mjs.d.ts +0 -299
  915. package/src/foundry/common/utils/collection.mjs.d.ts +0 -151
  916. package/src/foundry/common/utils/geometry.mjs.d.ts +0 -148
  917. package/src/foundry/common/utils/helpers.mjs.d.ts +0 -498
  918. package/src/foundry/common/utils/http.mjs.d.ts +0 -52
  919. package/src/foundry/common/utils/module.mjs.d.ts +0 -5
  920. package/src/foundry/common/utils/primitives.mjs.d.ts +0 -287
  921. package/src/foundry/common/utils/semaphore.mjs.d.ts +0 -83
  922. package/src/foundry/index.d.ts +0 -3
  923. package/src/foundry/templates/index.d.ts +0 -1
  924. package/src/foundry/templates/views/layouts/main.hbs.d.ts +0 -11
  925. package/src/index.d.ts +0 -2
  926. package/src/types/augments/index.d.ts +0 -6
  927. package/src/types/augments/pixiGraphicsSmooth.d.ts +0 -7
  928. package/src/types/augments/pixiLegacyGraphics.d.ts +0 -7
  929. package/src/types/augments/pixiParticles.d.ts +0 -7
  930. package/src/types/augments/simple-peer.d.ts +0 -13
  931. package/src/types/augments/socket.io-client.d.ts +0 -12
  932. package/src/types/augments/tinyMCE.d.ts +0 -82
  933. package/src/types/config.d.ts +0 -183
  934. package/src/types/helperTypes.d.ts +0 -151
  935. package/src/types/index.d.ts +0 -3
  936. package/src/types/utils.d.ts +0 -143
  937. /package/src/foundry/client/apps/av/{camera-popout.d.ts → camera-popout.d.mts} +0 -0
  938. /package/src/foundry/client/{tail.d.ts → tail.d.mts} +0 -0
@@ -0,0 +1,3388 @@
1
+ import type {
2
+ RemoveIndexSignatures,
3
+ ConstructorOf,
4
+ SimpleMerge,
5
+ ValueOf,
6
+ AnyObject,
7
+ EmptyObject,
8
+ } from "../../../types/utils.d.mts";
9
+ import type { DataModel } from "../abstract/data.mts";
10
+ import type Document from "../abstract/document.mts";
11
+ import type { EmbeddedCollection, EmbeddedCollectionDelta } from "../abstract/module.d.mts";
12
+ import type { DOCUMENT_OWNERSHIP_LEVELS } from "../constants.d.mts";
13
+ import type { CONST } from "../../client-esm/client.d.mts";
14
+ import type { DataModelValidationFailure } from "./validation-failure.mts";
15
+
16
+ declare global {
17
+ /**
18
+ * @typeParam BaseAssignmentType - the base assignment type for a DataField, without null or undefined
19
+ */
20
+ interface DataFieldOptions<BaseAssignmentType> {
21
+ /**
22
+ * Is this field required to be populated?
23
+ * @defaultValue `false`
24
+ */
25
+ required?: boolean | undefined;
26
+
27
+ /**
28
+ * Can this field have null values?
29
+ * @defaultValue `false`
30
+ */
31
+ nullable?: boolean | undefined;
32
+
33
+ /** The initial value of a field, or a function which assigns that initial value. */
34
+ initial?:
35
+ | DataFieldOptions.InitialType<
36
+ DataFieldOptions.InitialReturnType<BaseAssignmentType, this["nullable"], this["required"]>
37
+ >
38
+ | undefined;
39
+
40
+ /** A data validation function which accepts one argument with the current value. */
41
+ validate?:
42
+ | ((this: DataField.Any, value: any, options?: DataField.ValidationOptions<DataField.Any>) => boolean | void)
43
+ | undefined;
44
+
45
+ /** A localizable label displayed on forms which render this field. */
46
+ label?: string | undefined;
47
+
48
+ /** Localizable help text displayed on forms which render this field. */
49
+ hint?: string | undefined;
50
+
51
+ /**
52
+ * A custom validation error string. When displayed will be prepended with the
53
+ * document name, field name, and candidate value.
54
+ */
55
+ validationError?: string | undefined;
56
+ }
57
+
58
+ namespace DataFieldOptions {
59
+ /** Any DataFieldOptions. */
60
+ type Any = DataFieldOptions<any>;
61
+
62
+ /**
63
+ * A helper type for the {@link DataFieldOptions.initial} option.
64
+ * @typeParam ReturnType - the return type of the option
65
+ */
66
+ type InitialType<ReturnType> = ReturnType | ((initialData: unknown) => ReturnType);
67
+
68
+ /**
69
+ * The decorated return type for the {@link DataFieldOptions.initial} option.
70
+ * @typeParam BaseAssignmentType - the base assignment type for a DataField
71
+ * @typeParam NullableOption - the value of the nullable option
72
+ * @typeParam RequiredOption - the value of the required option
73
+ */
74
+ type InitialReturnType<BaseAssignmentType, NullableOption, RequiredOption> =
75
+ | Exclude<BaseAssignmentType, null | undefined>
76
+ | (NullableOption extends true ? null : never)
77
+ | (RequiredOption extends true ? never : undefined);
78
+ }
79
+
80
+ interface DataFieldValidationOptions {
81
+ /** Whether this is a partial schema validation, or a complete one. */
82
+ partial?: boolean;
83
+
84
+ /** Whether to allow replacing invalid values with valid fallbacks. */
85
+ fallback?: boolean;
86
+
87
+ /** The full source object being evaluated. */
88
+ source?: AnyObject;
89
+
90
+ /**
91
+ * If true, invalid embedded documents will emit a warning and be placed in
92
+ * the invalidDocuments collection rather than causing the parent to be
93
+ * considered invalid.
94
+ */
95
+ dropInvalidEmbedded?: boolean;
96
+ }
97
+ }
98
+
99
+ /**
100
+ * An abstract class that defines the base pattern for a data field within a data schema.
101
+ * @typeParam Options - the options of the DataField instance
102
+ * @typeParam AssignmentType - the type of the allowed assignment values of the DataField
103
+ * @typeParam InitializedType - the type of the initialized values of the DataField
104
+ * @typeParam PersistedType - the type of the persisted values of the DataField
105
+ * @remarks
106
+ * Defaults:
107
+ * AssignmentType: `any | null | undefined`
108
+ * InitializedType: `unknown | undefined`
109
+ * PersistedType: `unknown | undefined`
110
+ * InitialValue: `undefined`
111
+ */
112
+ declare abstract class DataField<
113
+ const Options extends DataFieldOptions.Any = DataField.DefaultOptions,
114
+ const AssignmentType = DataField.AssignmentType<Options>,
115
+ const InitializedType = DataField.InitializedType<Options>,
116
+ const PersistedType extends unknown | null | undefined = InitializedType,
117
+ > {
118
+ /**
119
+ * @param options - Options which configure the behavior of the field
120
+ */
121
+ constructor(options?: Options);
122
+
123
+ /** The initially provided options which configure the data field */
124
+ options: Options;
125
+
126
+ /**
127
+ * Is this field required to be populated?
128
+ * @defaultValue `false`
129
+ */
130
+ required: boolean;
131
+
132
+ /**
133
+ * Can this field have null values?
134
+ * @defaultValue `false`
135
+ */
136
+ nullable: boolean;
137
+
138
+ /**
139
+ * The initial value of a field, or a function which assigns that initial value.
140
+ * @defaultValue `undefined`
141
+ */
142
+ initial: DataFieldOptions.InitialType<InitializedType>;
143
+
144
+ /**
145
+ * Should the prepared value of the field be read-only, preventing it from being
146
+ * changed unless a change to the _source data is applied.
147
+ * @defaultValue `false`
148
+ */
149
+ readonly: boolean;
150
+
151
+ /**
152
+ * A localizable label displayed on forms which render this field.
153
+ * @defaultValue `""`
154
+ */
155
+ label: string;
156
+
157
+ /**
158
+ * Localizable help text displayed on forms which render this field.
159
+ * @defaultValue `""`
160
+ */
161
+ hint: string;
162
+
163
+ /**
164
+ * A custom validation error string. When displayed will be prepended with the
165
+ * document name, field name, and candidate value.
166
+ * @defaultValue `"is not a valid value"`
167
+ */
168
+ validationError: string;
169
+
170
+ /**
171
+ * The name of this data field within the schema that contains it
172
+ *
173
+ * The field name of this DataField instance.
174
+ * This is assigned by SchemaField#initialize.
175
+ * @internal
176
+ */
177
+ name: string | undefined;
178
+
179
+ /**
180
+ * A reference to the parent schema to which this DataField belongs.
181
+ * This is assigned by SchemaField#initialize.
182
+ * @internal
183
+ */
184
+ parent: DataField.Any | undefined;
185
+
186
+ /**
187
+ * Whether this field defines part of a Document/Embedded Document hierarchy.
188
+ * @defaultValue `false`
189
+ */
190
+ static hierarchical: boolean;
191
+
192
+ /**
193
+ * Does this field type contain other fields in a recursive structure?
194
+ * Examples of recursive fields are SchemaField, ArrayField, or TypeDataField
195
+ * Examples of non-recursive fields are StringField, NumberField, or ObjectField
196
+ * @defaultValue `false`
197
+ */
198
+ static recursive: boolean;
199
+
200
+ /**
201
+ * Default parameters for this field type
202
+ * @remarks This is not entirely type-safe, overrides should specify a more concrete return type.
203
+ */
204
+ protected static get _defaults(): DataFieldOptions.Any;
205
+
206
+ /**
207
+ * A dot-separated string representation of the field path within the parent schema.
208
+ */
209
+ get fieldPath(): string;
210
+
211
+ /**
212
+ * Apply a function to this DataField which propagates through recursively to any contained data schema.
213
+ * @param fn - The function to apply
214
+ * @param value - The current value of this field
215
+ * @param options - Additional options passed to the applied function
216
+ * (default `{}`)
217
+ * @returns The results object
218
+ */
219
+ apply<Value, Options, Return>(
220
+ fn: keyof this | ((this: this, value: Value, options: Options) => Return),
221
+ value: Value,
222
+ options?: Options,
223
+ ): Return;
224
+
225
+ /**
226
+ * Coerce source data to ensure that it conforms to the correct data type for the field.
227
+ * Data coercion operations should be simple and synchronous as these are applied whenever a DataModel is constructed.
228
+ * For one-off cleaning of user-provided input the sanitize method should be used.
229
+ * @param value - The initial value
230
+ * @param options - Additional options for how the field is cleaned
231
+ * @returns The cast value
232
+ */
233
+ clean(value: AssignmentType, options?: DataField.CleanOptions): InitializedType;
234
+
235
+ /**
236
+ * Apply any cleaning logic specific to this DataField type.
237
+ * @param value - The appropriately coerced value.
238
+ * @param options - Additional options for how the field is cleaned.
239
+ * @returns The cleaned value.
240
+ */
241
+ protected _cleanType(value: InitializedType, options?: DataField.CleanOptions): InitializedType;
242
+
243
+ /**
244
+ * Cast a non-default value to ensure it is the correct type for the field
245
+ * @param value - The provided non-default value
246
+ * @returns The standardized value
247
+ */
248
+ protected abstract _cast(value: AssignmentType): InitializedType;
249
+
250
+ /**
251
+ * Attempt to retrieve a valid initial value for the DataField.
252
+ * @param data - The source data object for which an initial value is required
253
+ * @returns A valid initial value
254
+ * @throws An error if there is no valid initial value defined
255
+ */
256
+ getInitialValue(data: DataField.CleanOptions["source"]): InitializedType;
257
+
258
+ /**
259
+ * Validate a candidate input for this field, ensuring it meets the field requirements.
260
+ * A validation failure can be provided as a raised Error (with a string message), by returning false, or by returning
261
+ * a DataModelValidationFailure instance.
262
+ * A validator which returns true denotes that the result is certainly valid and further validations are unnecessary.
263
+ * @param value - The initial value
264
+ * @param options - Options which affect validation behavior
265
+ * (default: `{}`)
266
+ * @returns Returns a ModelValidationError if a validation failure occurred
267
+ */
268
+ validate(
269
+ value: AssignmentType,
270
+ options?: DataField.ValidationOptions<DataField.Any>,
271
+ ): DataModelValidationFailure | undefined;
272
+
273
+ /**
274
+ * Special validation rules which supersede regular field validation.
275
+ * This validator screens for certain values which are otherwise incompatible with this field like null or undefined.
276
+ * @param value - The candidate value
277
+ * @returns A boolean to indicate with certainty whether the value is valid.
278
+ * Otherwise, return void.
279
+ * @throws May throw a specific error if the value is not valid
280
+ */
281
+ protected _validateSpecial(value: AssignmentType): boolean | void;
282
+
283
+ /**
284
+ * A default type-specific validator that can be overridden by child classes
285
+ * @param value - The candidate value
286
+ * @param options - Options which affect validation behavior
287
+ * @returns A boolean to indicate with certainty whether the value is
288
+ * valid, or specific DataModelValidationFailure information,
289
+ * otherwise void.
290
+ * @throws May throw a specific error if the value is not valid
291
+ */
292
+ protected _validateType(
293
+ value: InitializedType,
294
+ options?: DataField.ValidationOptions<DataField.Any>,
295
+ ): boolean | DataModelValidationFailure | void;
296
+
297
+ /**
298
+ * Certain fields may declare joint data validation criteria.
299
+ * This method will only be called if the field is designated as recursive.
300
+ * @param data - Candidate data for joint model validation
301
+ * @param options - Options which modify joint model validation
302
+ * @throws An error if joint model validation fails
303
+ * @internal
304
+ */
305
+ protected _validateModel(data: AnyObject, options?: AnyObject): void; // TODO: Type further.
306
+
307
+ /**
308
+ * Initialize the original source data into a mutable copy for the DataModel instance.
309
+ * @param value - The source value of the field
310
+ * @param model - The DataModel instance that this field belongs to
311
+ * @param options - Initialization options
312
+ * @returns An initialized copy of the source data
313
+ */
314
+ initialize(
315
+ value: PersistedType,
316
+ model: DataModel.Any,
317
+ options?: AnyObject, // TODO: Type further.
318
+ ): (() => InitializedType | null) | InitializedType;
319
+
320
+ /**
321
+ * Export the current value of the field into a serializable object.
322
+ * @param value - The initialized value of the field
323
+ * @returns An exported representation of the field
324
+ */
325
+ toObject(value: InitializedType): PersistedType;
326
+
327
+ /**
328
+ * Recursively traverse a schema and retrieve a field specification by a given path
329
+ * @param path - The field path as an array of strings
330
+ */
331
+ protected _getField(path: string[]): unknown; // TODO: Type further.
332
+ }
333
+
334
+ declare namespace DataField {
335
+ /** Any DataField. */
336
+ type Any = DataField<any, any, any, any>;
337
+
338
+ /** A DataField with unknown inner types. */
339
+ type Unknown = DataField<any, unknown, unknown, unknown>;
340
+
341
+ type AssignmentTypeFor<ConcreteDataField extends Any> =
342
+ ConcreteDataField extends DataField<any, infer AssignmentType, any, any> ? AssignmentType : never;
343
+
344
+ /** The type of the default options for the {@link DataField} class. */
345
+ interface DefaultOptions {
346
+ required: false;
347
+ nullable: false;
348
+ initial: undefined;
349
+ readonly: false;
350
+ label: "";
351
+ hint: "";
352
+ validationError: "is not a valid value";
353
+ }
354
+
355
+ /**
356
+ * A helper type for the given options type merged into the default options of the DataField class.
357
+ * @typeParam Options - the options that override the default options
358
+ */
359
+ type MergedOptions<Options extends DataFieldOptions.Any> = SimpleMerge<DefaultOptions, Options>;
360
+
361
+ /**
362
+ * A type to decorate the base assignment type to a DataField, based on the options of the field.
363
+ * @typeParam BaseAssignmentType - the base assignment type of the DataField, without null or undefined
364
+ * @typeParam Options - the options of the DataField
365
+ */
366
+ type DerivedAssignmentType<BaseAssignmentType, Options extends DataFieldOptions.Any> =
367
+ | Exclude<BaseAssignmentType, null | undefined> // Always include the base type
368
+ | (Options["nullable"] extends true // determine whether null is in the union
369
+ ? // when nullable, null is always allowed
370
+ null
371
+ : // otherwise, it depends on required
372
+ Options["required"] extends true
373
+ ? // when required and not nullable, null can only be passed when initial is present
374
+ "initial" extends keyof Options
375
+ ? // when initial is present, null can be passed
376
+ null
377
+ : // when initial is not in the options, then null can not be passed
378
+ never
379
+ : // when not required, null can safely be passed
380
+ null)
381
+ | (Options["required"] extends true // determine whether undefined is in the union
382
+ ? // when required, it depends on initial
383
+ "initial" extends keyof Options
384
+ ? // when initial is in the options, undefined is allowed
385
+ undefined
386
+ : // when initial is not in the options, then undefined is not allowed
387
+ never
388
+ : // when not required, undefined can safely be passed
389
+ undefined);
390
+
391
+ /**
392
+ * A type to decorate the base initialized type of a DataField, based on the options of the field.
393
+ * @typeParam BaseInitializedType - the base initialized type of the DataField, without null or undefined
394
+ * @typeParam Options - the options of the DataField
395
+ */
396
+ type DerivedInitializedType<BaseInitializedType, Options extends DataFieldOptions.Any> =
397
+ | Exclude<BaseInitializedType, null | undefined>
398
+ | (Options["nullable"] extends true ? null : never)
399
+ | (Options["required"] extends true ? never : undefined);
400
+
401
+ /**
402
+ * A shorthand for the assignment type of a DataField class.
403
+ * @typeParam Options - the options overriding the defaults
404
+ */
405
+ type AssignmentType<Options extends DataFieldOptions.Any> = DerivedAssignmentType<any, MergedOptions<Options>>;
406
+
407
+ /**
408
+ * A shorthand for the initialized type of a DataField class.
409
+ * @typeParam Options - the options overriding the defaults
410
+ */
411
+ type InitializedType<Options extends DataFieldOptions.Any> = DerivedInitializedType<any, MergedOptions<Options>>;
412
+
413
+ /** An interface for the options of the {@link DataField} clean functions. */
414
+ interface CleanOptions {
415
+ /** Whether to perform partial cleaning? */
416
+ partial?: boolean;
417
+
418
+ /** The root data model being cleaned */
419
+ source?: {
420
+ type?: string;
421
+ };
422
+ }
423
+
424
+ /**
425
+ * An interface for the options of the {@link DataField} validation functions.
426
+ * @typeParam DataField - the type of the DataField, which is the receiver of the validate function
427
+ */
428
+ interface ValidationOptions<DataField extends DataField.Any> extends DataValidationOptions {
429
+ source?: AnyObject;
430
+ validate?: (this: DataField, value: unknown, options: ValidationOptions<DataField>) => boolean;
431
+ }
432
+ }
433
+
434
+ /**
435
+ * A special class of {@link DataField} which defines a data schema.
436
+ * @typeParam Fields - the DataSchema fields of the SchemaField
437
+ * @typeParam Options - the options of the SchemaField instance
438
+ * @typeParam AssignmentType - the type of the allowed assignment values of the SchemaField
439
+ * @typeParam InitializedType - the type of the initialized values of the SchemaField
440
+ * @typeParam PersistedType - the type of the persisted values of the SchemaField
441
+ * @remarks
442
+ * Defaults:
443
+ * AssignmentType: `SchemaField.AssignmentType<Fields> | null | undefined`
444
+ * InitializedType: `SchemaField.InitializedType<Fields>`
445
+ * PersistedType: `SchemaField.PersistedType<Fields>`
446
+ * InitialValue: `{}`
447
+ */
448
+ declare class SchemaField<
449
+ Fields extends DataSchema,
450
+ Options extends SchemaField.Options<Fields> = SchemaField.DefaultOptions,
451
+ AssignmentType = SchemaField.AssignmentType<Fields, SimpleMerge<Options, SchemaField.DefaultOptions>>,
452
+ InitializedType = SchemaField.InitializedType<Fields, SimpleMerge<Options, SchemaField.DefaultOptions>>,
453
+ PersistedType extends AnyObject | null | undefined = SchemaField.PersistedType<
454
+ Fields,
455
+ SimpleMerge<Options, SchemaField.DefaultOptions>
456
+ >,
457
+ > extends DataField<Options, AssignmentType, InitializedType, PersistedType> {
458
+ /**
459
+ * @param fields - The contained field definitions
460
+ * @param options - Options which configure the behavior of the field
461
+ */
462
+ // Saying `fields: Fields` here causes the inference for the fields to be unnecessarily widened. This might effectively be a no-op but it fixes the inference.
463
+ constructor(fields: { [K in keyof Fields]: Fields[K] }, options?: Options);
464
+
465
+ /** @defaultValue `true` */
466
+ override required: boolean;
467
+
468
+ /** @defaultValue `false` */
469
+ override nullable: boolean;
470
+
471
+ /** @defaultValue `() => this.clean({})` */
472
+ override initial: DataFieldOptions.InitialType<InitializedType>;
473
+
474
+ protected static override get _defaults(): SchemaField.Options<DataSchema>;
475
+
476
+ /** @defaultValue `true` */
477
+ static override recursive: boolean;
478
+
479
+ /**
480
+ * The contained field definitions.
481
+ */
482
+ fields: Fields;
483
+
484
+ /**
485
+ * Initialize and validate the structure of the provided field definitions.
486
+ * @param fields - The provided field definitions
487
+ * @returns The validated schema
488
+ */
489
+ protected _initialize(fields: Fields): Fields;
490
+
491
+ /**
492
+ * Iterate over a SchemaField by iterating over its fields.
493
+ */
494
+ [Symbol.iterator](): Generator<DataField.Unknown>;
495
+
496
+ /**
497
+ * An array of field names which are present in the schema.
498
+ */
499
+ keys(): string[];
500
+
501
+ /**
502
+ * An array of DataField instances which are present in the schema.
503
+ */
504
+ values(): DataField.Unknown[];
505
+
506
+ /**
507
+ * An array of [name, DataField] tuples which define the schema.
508
+ */
509
+ entries(): [name: string, dataField: DataField.Unknown][];
510
+
511
+ /**
512
+ * Test whether a certain field name belongs to this schema definition.
513
+ * @param fieldName - The field name
514
+ * @returns Does the named field exist in this schema?
515
+ */
516
+ has(fieldName: string): boolean;
517
+
518
+ /**
519
+ * Get a DataField instance from the schema by name
520
+ * @param fieldName - The field name
521
+ * @returns The DataField instance or undefined
522
+ */
523
+ get(fieldName: string): DataField.Unknown | undefined;
524
+
525
+ /**
526
+ * Traverse the schema, obtaining the DataField definition for a particular field.
527
+ * @param fieldName - A field path like ["abilities", "strength"] or "abilities.strength"
528
+ * @returns The corresponding DataField definition for that field, or undefined
529
+ */
530
+ getField(fieldName: string | string[]): DataField.Unknown | undefined;
531
+
532
+ protected override _getField(path: string[]): DataField.Unknown;
533
+
534
+ protected override _cast(value: AssignmentType): InitializedType;
535
+
536
+ protected override _cleanType(value: InitializedType, options?: DataField.CleanOptions): InitializedType;
537
+
538
+ override initialize(
539
+ value: PersistedType,
540
+ model: DataModel.Any,
541
+ options?: AnyObject,
542
+ ): InitializedType | (() => InitializedType | null);
543
+
544
+ protected override _validateType(
545
+ value: InitializedType,
546
+ options?: DataField.ValidationOptions<DataField.Any>,
547
+ ): boolean | DataModelValidationFailure | void;
548
+
549
+ protected override _validateModel(data: AnyObject, options?: AnyObject): void;
550
+
551
+ override toObject(value: InitializedType): PersistedType;
552
+
553
+ override apply<Value, Options, Return>(
554
+ fn: keyof this | ((this: this, value: Value, options: Options) => Return),
555
+ value: Value,
556
+ options?: Options,
557
+ ): Return;
558
+
559
+ /**
560
+ * Migrate this field's candidate source data.
561
+ * @param sourceData - Candidate source data of the root model
562
+ * @param fieldData - The value of this field within the source data
563
+ */
564
+ migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
565
+ }
566
+
567
+ // FIXME(LukeAbby): This is a quick patch that avoids issues with the fact that the `initial` in `SchemaField` is not actually assignable to its assignment type etc.
568
+ // This will be superceded once proper field treatment is applied.
569
+ declare const __SchemaFieldInitialSymbol: unique symbol;
570
+
571
+ type __SchemaFieldInitial = typeof __SchemaFieldInitialSymbol;
572
+
573
+ declare namespace SchemaField {
574
+ /**
575
+ * A shorthand for the options of a SchemaField class.
576
+ * @typeParam Fields - the DataSchema fields of the SchemaField
577
+ */
578
+ type Options<Fields extends DataSchema> = DataFieldOptions<InnerAssignmentType<Fields> | __SchemaFieldInitial>;
579
+
580
+ /** Any SchemaField. */
581
+ type Any = SchemaField<any, any, any, any, any>;
582
+
583
+ /**
584
+ * Get the constructor type for the given DataSchema.
585
+ * @typeParam Fields - the DataSchema fields of the SchemaField
586
+ */
587
+ type InnerConstructorType<Fields extends DataSchema> = InnerAssignmentType<Fields>;
588
+
589
+ /**
590
+ * Get the inner assignment type for the given DataSchema.
591
+ * @typeParam Fields - the DataSchema fields of the SchemaField
592
+ */
593
+ type InnerAssignmentType<Fields extends DataSchema> = RemoveIndexSignatures<{
594
+ [Key in keyof Fields]?: Fields[Key] extends DataField<any, infer AssignType, any, any>
595
+ ? Fields[Key] extends SchemaField<infer SubSchema, any, any, any, any>
596
+ ? // FIXME(LukeAbby): This is a quick hack into InnerAssignmentType that assumes that the `initial` of `SchemaField` is not changed from the default of `{}`
597
+ // This will be fixed with the refactoring of the types
598
+ EmptyObject extends InnerAssignmentType<SubSchema>
599
+ ? InnerAssignmentType<SubSchema> | undefined | null
600
+ : InnerAssignmentType<SubSchema>
601
+ : AssignType
602
+ : never;
603
+ }>;
604
+
605
+ /**
606
+ * Get the inner initialized type for the given DataSchema.
607
+ * @typeParam Fields - the DataSchema fields of the SchemaField
608
+ */
609
+ type InnerInitializedType<Fields extends DataSchema> = RemoveIndexSignatures<{
610
+ [Key in keyof Fields]: Fields[Key] extends DataField<any, any, infer InitType, any>
611
+ ? Fields[Key] extends EmbeddedDataField<infer Model, any, any, any, any>
612
+ ? Model
613
+ : Fields[Key] extends SchemaField<infer SubSchema, any, any, any, any>
614
+ ? InnerInitializedType<SubSchema>
615
+ : InitType
616
+ : never;
617
+ }>;
618
+
619
+ /**
620
+ * Get the inner persisted type for the given DataSchema.
621
+ * @typeParam Fields - the DataSchema fields of the SchemaField
622
+ */
623
+ type InnerPersistedType<Fields extends DataSchema> = RemoveIndexSignatures<{
624
+ [Key in keyof Fields]: Fields[Key] extends DataField<any, any, any, infer PersistType>
625
+ ? Fields[Key] extends SchemaField<infer SubSchema, any, any, any, any>
626
+ ? InnerPersistedType<SubSchema>
627
+ : PersistType
628
+ : never;
629
+ }>;
630
+
631
+ /** The type of the default options for the {@link SchemaField} class. */
632
+ type DefaultOptions = SimpleMerge<
633
+ DataField.DefaultOptions,
634
+ {
635
+ required: true;
636
+ nullable: false;
637
+ initial: __SchemaFieldInitial;
638
+ }
639
+ >;
640
+
641
+ /**
642
+ * A helper type for the given options type merged into the default options of the SchemaField class.
643
+ * @typeParam Fields - the DataSchema fields of the SchemaField
644
+ * @typeParam Opts - the options that override the default options
645
+ */
646
+ type MergedOptions<Fields extends DataSchema, Opts extends Options<Fields>> = SimpleMerge<DefaultOptions, Opts>;
647
+
648
+ // FIXME: null or undefined should be permissible, cast as the initialized type
649
+ /**
650
+ * A shorthand for the assignment type of a SchemaField class.
651
+ * @typeParam Fields - the DataSchema fields of the SchemaField
652
+ * @typeParam Opts - the options that override the default options
653
+ */
654
+ type AssignmentType<
655
+ Fields extends DataSchema,
656
+ Opts extends Options<Fields> = DefaultOptions,
657
+ > = DataField.DerivedAssignmentType<InnerAssignmentType<Fields>, MergedOptions<Fields, Opts>>;
658
+
659
+ /**
660
+ * A shorthand for the assignment type of a SchemaField class.
661
+ * @typeParam Fields - the DataSchema fields of the SchemaField
662
+ * @typeParam Opts - the options that override the default options
663
+ */
664
+ type InitializedType<
665
+ Fields extends DataSchema,
666
+ Opts extends Options<Fields> = DefaultOptions,
667
+ > = DataField.DerivedInitializedType<InnerInitializedType<Fields>, MergedOptions<Fields, Opts>>;
668
+
669
+ /**
670
+ * A shorthand for the assignment type of a SchemaField class.
671
+ * @typeParam Fields - the DataSchema fields of the SchemaField
672
+ * @typeParam Opts - the options that override the default options
673
+ */
674
+ type PersistedType<
675
+ Fields extends DataSchema,
676
+ Opts extends Options<Fields> = DefaultOptions,
677
+ > = DataField.DerivedInitializedType<InnerPersistedType<Fields>, MergedOptions<Fields, Opts>>;
678
+ }
679
+
680
+ /**
681
+ * A subclass of [DataField]{@link DataField} which deals with boolean-typed data.
682
+ * @typeParam Options - the options of the BooleanField instance
683
+ * @typeParam AssignmentType - the type of the allowed assignment values of the BooleanField
684
+ * @typeParam InitializedType - the type of the initialized values of the BooleanField
685
+ * @typeParam PersistedType - the type of the persisted values of the BooleanField
686
+ * @remarks
687
+ * Defaults:
688
+ * AssignmentType: `boolean | null | undefined`
689
+ * InitializedType: `boolean`
690
+ * PersistedType: `boolean`
691
+ * InitialValue: `false`
692
+ */
693
+ declare class BooleanField<
694
+ const Options extends BooleanField.Options = BooleanField.DefaultOptions,
695
+ const AssignmentType = BooleanField.AssignmentType<SimpleMerge<Options, BooleanField.DefaultOptions>>,
696
+ const InitializedType = BooleanField.InitializedType<SimpleMerge<Options, BooleanField.DefaultOptions>>,
697
+ const PersistedType extends boolean | null | undefined = BooleanField.InitializedType<
698
+ SimpleMerge<Options, BooleanField.DefaultOptions>
699
+ >,
700
+ > extends DataField<Options, AssignmentType, InitializedType, PersistedType> {
701
+ /** @defaultValue `true` */
702
+ override required: boolean;
703
+
704
+ /** @defaultValue `false` */
705
+ override nullable: boolean;
706
+
707
+ /** @defaultValue `false` */
708
+ override initial: DataFieldOptions.InitialType<InitializedType>;
709
+
710
+ protected static override get _defaults(): BooleanField.Options;
711
+
712
+ protected override _cast(value: AssignmentType): InitializedType;
713
+
714
+ protected override _validateType(
715
+ value: InitializedType,
716
+ options?: DataField.ValidationOptions<DataField.Any>,
717
+ ): boolean | DataModelValidationFailure | void;
718
+ }
719
+
720
+ declare namespace BooleanField {
721
+ /** A shorthand for the options of a BooleanField class. */
722
+ type Options = DataFieldOptions<boolean>;
723
+
724
+ /** The type of the default options for the {@link BooleanField} class. */
725
+ type DefaultOptions = SimpleMerge<
726
+ DataField.DefaultOptions,
727
+ {
728
+ required: true;
729
+ nullable: false;
730
+ initial: boolean;
731
+ }
732
+ >;
733
+
734
+ /**
735
+ * A helper type for the given options type merged into the default options of the BooleanField class.
736
+ * @typeParam Opts - the options that override the default options
737
+ */
738
+ type MergedOptions<Opts extends Options> = SimpleMerge<DefaultOptions, Opts>;
739
+
740
+ /**
741
+ * A shorthand for the assignment type of a BooleanField class.
742
+ * @typeParam Opts - the options that override the default options
743
+ */
744
+ type AssignmentType<Opts extends Options> = DataField.DerivedAssignmentType<boolean, MergedOptions<Opts>>;
745
+
746
+ /**
747
+ * A shorthand for the initialized type of a BooleanField class.
748
+ * @typeParam Opts - the options that override the default options
749
+ */
750
+ type InitializedType<Opts extends Options> = DataField.DerivedInitializedType<boolean, MergedOptions<Opts>>;
751
+ }
752
+
753
+ declare global {
754
+ interface NumberFieldOptions extends DataFieldOptions<number> {
755
+ /**
756
+ * A minimum allowed value
757
+ * @defaultValue `undefined`
758
+ */
759
+ min?: number | undefined;
760
+
761
+ /**
762
+ * A maximum allowed value
763
+ * @defaultValue `undefined`
764
+ */
765
+ max?: number | undefined;
766
+
767
+ /**
768
+ * A permitted step size
769
+ * @defaultValue `undefined`
770
+ */
771
+ step?: number | undefined;
772
+
773
+ /**
774
+ * Must the number be an integer?
775
+ * @defaultValue `false`
776
+ */
777
+ integer?: boolean | undefined;
778
+
779
+ /**
780
+ * Must the number be positive?
781
+ * @defaultValue `false`
782
+ */
783
+ positive?: boolean | undefined;
784
+
785
+ /**
786
+ * An array of values or an object of values/labels which represent
787
+ * allowed choices for the field. A function may be provided which dynamically
788
+ * returns the array of choices.
789
+ * @defaultValue `undefined`
790
+ */
791
+ choices?: NumberField.Choices | undefined;
792
+ }
793
+ }
794
+
795
+ /**
796
+ * A subclass of [DataField]{@link DataField} which deals with number-typed data.
797
+ * @typeParam Options - the options of the NumberField instance
798
+ * @typeParam AssignmentType - the type of the allowed assignment values of the NumberField
799
+ * @typeParam InitializedType - the type of the initialized values of the NumberField
800
+ * @typeParam PersistedType - the type of the persisted values of the NumberField
801
+ * @remarks
802
+ * Defaults:
803
+ * AssignmentType: `number | null | undefined`
804
+ * InitializedType: `number | null`
805
+ * PersistedType: `number | null`
806
+ * InitialValue: `null`
807
+ */
808
+ declare class NumberField<
809
+ const Options extends NumberFieldOptions = NumberField.DefaultOptions,
810
+ const AssignmentType = NumberField.AssignmentType<Options>,
811
+ const InitializedType = NumberField.InitializedType<Options>,
812
+ const PersistedType extends number | null | undefined = NumberField.InitializedType<Options>,
813
+ > extends DataField<Options, AssignmentType, InitializedType, PersistedType> {
814
+ /**
815
+ * @param options - Options which configure the behavior of the field
816
+ */
817
+ constructor(options?: Options);
818
+
819
+ /** @defaultValue `null` */
820
+ override initial: DataFieldOptions.InitialType<InitializedType>;
821
+
822
+ /** @defaultValue `true` */
823
+ override nullable: boolean;
824
+
825
+ /**
826
+ * A minimum allowed value
827
+ * @defaultValue `undefined`
828
+ */
829
+ min: number | undefined;
830
+
831
+ /**
832
+ * A maximum allowed value
833
+ * @defaultValue `undefined`
834
+ */
835
+ max: number | undefined;
836
+
837
+ /**
838
+ * A permitted step size
839
+ * @defaultValue `undefined`
840
+ */
841
+ step: number | undefined;
842
+
843
+ /**
844
+ * Must the number be an integer?
845
+ * @defaultValue `false`
846
+ */
847
+ integer: boolean;
848
+
849
+ /**
850
+ * Must the number be positive?
851
+ * @defaultValue `false`
852
+ */
853
+ positive: boolean;
854
+
855
+ /**
856
+ * An array of values or an object of values/labels which represent
857
+ * allowed choices for the field. A function may be provided which dynamically
858
+ * returns the array of choices.
859
+ * @defaultValue `undefined`
860
+ */
861
+ choices: number[] | Record<number, string> | (() => number[] | Record<number, string>) | undefined;
862
+
863
+ protected static override get _defaults(): NumberFieldOptions;
864
+
865
+ protected override _cast(value: AssignmentType): InitializedType;
866
+
867
+ protected override _cleanType(value: InitializedType, options?: DataField.CleanOptions): InitializedType;
868
+
869
+ protected override _validateType(
870
+ value: InitializedType,
871
+ options?: DataField.ValidationOptions<DataField.Any>,
872
+ ): boolean | DataModelValidationFailure | void;
873
+
874
+ /**
875
+ * Test whether a provided value is a valid choice from the allowed choice set
876
+ * @param value - The provided value
877
+ * @returns Is the choice valid?
878
+ */
879
+ #isValidChoice(value: AssignmentType): boolean;
880
+ }
881
+
882
+ declare namespace NumberField {
883
+ /** The type of the default options for the {@link NumberField} class. */
884
+ type DefaultOptions = SimpleMerge<
885
+ DataField.DefaultOptions,
886
+ {
887
+ initial: null;
888
+ nullable: true;
889
+ min: undefined;
890
+ max: undefined;
891
+ step: undefined;
892
+ integer: false;
893
+ positive: false;
894
+ choices: undefined;
895
+ }
896
+ >;
897
+
898
+ /** The type of the default options for the {@link NumberField} class when choices are provided. */
899
+ type DefaultOptionsWhenChoicesProvided = SimpleMerge<DefaultOptions, { nullable: false }>;
900
+
901
+ /**
902
+ * A helper type for the given options type merged into the default options of the NumberField class.
903
+ * @typeParam Options - the options that override the default options
904
+ */
905
+ type MergedOptions<Options extends NumberFieldOptions> = SimpleMerge<
906
+ undefined extends Options["choices"] ? DefaultOptions : DefaultOptionsWhenChoicesProvided,
907
+ Options
908
+ >;
909
+
910
+ /**
911
+ * A shorthand for the assignment type of a NumberField class.
912
+ * @typeParam Options - the options that override the default options
913
+ */
914
+ type AssignmentType<Options extends NumberFieldOptions> = DataField.DerivedAssignmentType<
915
+ number,
916
+ MergedOptions<Options>
917
+ >;
918
+
919
+ /**
920
+ * A shorthand for the initialized type of a NumberField class.
921
+ * @typeParam Options - the options that override the default options
922
+ */
923
+ type InitializedType<Options extends NumberFieldOptions> = DataField.DerivedInitializedType<
924
+ number,
925
+ MergedOptions<Options>
926
+ >;
927
+
928
+ type BaseChoices =
929
+ | {
930
+ readonly [K: number | `${number}`]: string;
931
+ }
932
+ | readonly number[];
933
+
934
+ type Choices = BaseChoices | (() => BaseChoices);
935
+ }
936
+
937
+ declare global {
938
+ interface StringFieldOptions extends DataFieldOptions<string> {
939
+ /**
940
+ * Is the string allowed to be blank (empty)?
941
+ * @defaultValue `true`
942
+ */
943
+ blank?: boolean | undefined;
944
+
945
+ /**
946
+ * Should any provided string be trimmed as part of cleaning?
947
+ * @defaultValue `true`
948
+ */
949
+ trim?: boolean | undefined;
950
+
951
+ /**
952
+ * An array of values or an object of values/labels which represent
953
+ * allowed choices for the field. A function may be provided which dynamically
954
+ * returns the array of choices.
955
+ * @defaultValue `undefined`
956
+ */
957
+ choices?: StringField.Choices | undefined;
958
+
959
+ /**
960
+ * @defaultValue `false`
961
+ */
962
+ textSearch?: boolean | undefined;
963
+ }
964
+ }
965
+
966
+ /**
967
+ * A subclass of [DataField]{@link DataField} which deals with string-typed data.
968
+ * @typeParam Options - the options of the StringField instance
969
+ * @typeParam AssignmentType - the type of the allowed assignment values of the StringField
970
+ * @typeParam InitializedType - the type of the initialized values of the StringField
971
+ * @typeParam PersistedType - the type of the persisted values of the StringField
972
+ * @remarks
973
+ * Defaults:
974
+ * AssignmentType: `string | null | undefined`
975
+ * InitializedType: `string`
976
+ * PersistedType: `string`
977
+ * InitialValue: `""`
978
+ */
979
+ declare class StringField<
980
+ const Options extends StringFieldOptions = StringField.DefaultOptions,
981
+ const AssignmentType = StringField.AssignmentType<Options>,
982
+ const InitializedType = StringField.InitializedType<Options>,
983
+ const PersistedType extends string | null | undefined = StringField.InitializedType<Options>,
984
+ > extends DataField<Options, AssignmentType, InitializedType, PersistedType> {
985
+ /**
986
+ * @param options - Options which configure the behavior of the field
987
+ */
988
+ constructor(options?: Options);
989
+
990
+ /** @defaultValue `undefined` */
991
+ override initial: DataFieldOptions.InitialType<InitializedType>;
992
+
993
+ /**
994
+ * Is the string allowed to be blank (empty)?
995
+ * @defaultValue `true`
996
+ */
997
+ blank: boolean;
998
+
999
+ /**
1000
+ * Should any provided string be trimmed as part of cleaning?
1001
+ * @defaultValue `true`
1002
+ */
1003
+ trim: boolean;
1004
+
1005
+ /** @defaultValue `false` */
1006
+ override nullable: boolean;
1007
+
1008
+ /**
1009
+ * An array of values or an object of values/labels which represent
1010
+ * allowed choices for the field. A function may be provided which dynamically
1011
+ * returns the array of choices.
1012
+ * @defaultValue `undefined`
1013
+ */
1014
+ choices: string[] | Record<string, string> | (() => string[] | Record<string, string>) | undefined;
1015
+
1016
+ /** @defaultValue `false` */
1017
+ textSearch: boolean;
1018
+
1019
+ protected static override get _defaults(): StringFieldOptions;
1020
+
1021
+ override clean(value: AssignmentType, options?: DataField.CleanOptions): InitializedType;
1022
+
1023
+ protected override _cast(value: AssignmentType): InitializedType;
1024
+
1025
+ protected override _validateSpecial(value: AssignmentType): boolean | void;
1026
+
1027
+ protected override _validateType(
1028
+ value: InitializedType,
1029
+ options?: DataField.ValidationOptions<DataField.Any>,
1030
+ ): boolean | DataModelValidationFailure | void;
1031
+
1032
+ /**
1033
+ * Test whether a provided value is a valid choice from the allowed choice set
1034
+ * @param value - The provided value
1035
+ * @returns Is the choice valid?
1036
+ */
1037
+ protected _isValidChoice(value: AssignmentType): boolean;
1038
+ }
1039
+
1040
+ declare namespace StringField {
1041
+ /** The type of the default options for the {@link StringField} class. */
1042
+ type DefaultOptions = SimpleMerge<
1043
+ DataField.DefaultOptions,
1044
+ {
1045
+ initial: string;
1046
+ blank: true;
1047
+ trim: true;
1048
+ nullable: false;
1049
+ choices: undefined;
1050
+ }
1051
+ >;
1052
+
1053
+ /** The type of the default options for the {@link StringField} class when choices are provided. */
1054
+ type DefaultOptionsWhenChoicesProvided = SimpleMerge<DefaultOptions, { nullable: false; blank: false }>;
1055
+
1056
+ /**
1057
+ * A helper type for the given options type merged into the default options of the StringField class.
1058
+ * @typeParam Options - the options that override the default options
1059
+ */
1060
+ type MergedOptions<Options extends StringFieldOptions> = SimpleMerge<
1061
+ _OptionsForInitial<_OptionsForChoices<Options["choices"]>>,
1062
+ Options
1063
+ >;
1064
+
1065
+ type _OptionsForChoices<Choices extends StringFieldOptions["choices"]> = undefined extends Choices
1066
+ ? DefaultOptions
1067
+ : DefaultOptionsWhenChoicesProvided;
1068
+
1069
+ // FIXME: `"initial" extends keyof Options` does not work for modeling `"initial" in options`.
1070
+ type _OptionsForInitial<Options extends StringFieldOptions> = "initial" extends keyof Options
1071
+ ? Options
1072
+ : SimpleMerge<Options, { initial: _InitialForOptions<Options> }>;
1073
+
1074
+ type _InitialForOptions<Options extends StringFieldOptions> = Options["required"] extends false | undefined
1075
+ ? undefined
1076
+ : Options["blank"] extends true
1077
+ ? string
1078
+ : Options["nullable"] extends true
1079
+ ? null
1080
+ : undefined;
1081
+
1082
+ // choices?: string[] | Record<string, string> | (() => string[] | Record<string, string>) | undefined;
1083
+
1084
+ type ValidChoice<Options extends StringFieldOptions> = Options["choices"] extends undefined
1085
+ ? string
1086
+ : Options["choices"] extends (...args: any) => infer Choices
1087
+ ? FixedChoice<Choices>
1088
+ : FixedChoice<Options["choices"]>;
1089
+
1090
+ type FixedChoice<Choices> = Choices extends Array<infer U> ? U : Choices extends Record<infer K, any> ? K : string;
1091
+
1092
+ /**
1093
+ * A shorthand for the assignment type of a StringField class.
1094
+ * @typeParam Options - the options that override the default options
1095
+ */
1096
+ type AssignmentType<Options extends StringFieldOptions> = DataField.DerivedAssignmentType<
1097
+ ValidChoice<Options>,
1098
+ MergedOptions<Options>
1099
+ >;
1100
+
1101
+ /**
1102
+ * A shorthand for the initialized type of a StringField class.
1103
+ * @typeParam Options - the options that override the default options
1104
+ */
1105
+ type InitializedType<Options extends StringFieldOptions> = DataField.DerivedInitializedType<
1106
+ // TODO(LukeAbby): This is a workaround for how `ValidChoice` is defined ignorant of the `StringField`/`NumberField` divide.
1107
+ ValidChoice<Options> & (string | null | undefined),
1108
+ MergedOptions<Options>
1109
+ >;
1110
+
1111
+ type BaseChoices =
1112
+ | {
1113
+ readonly [K: string]: string;
1114
+ }
1115
+ | readonly string[];
1116
+
1117
+ type Choices = BaseChoices | (() => BaseChoices);
1118
+ }
1119
+
1120
+ /**
1121
+ * A subclass of [DataField]{@link DataField} which deals with object-typed data.
1122
+ * @typeParam Options - the options of the ObjectField instance
1123
+ * @typeParam AssignmentType - the type of the allowed assignment values of the ObjectField
1124
+ * @typeParam InitializedType - the type of the initialized values of the ObjectField
1125
+ * @typeParam PersistedType - the type of the persisted values of the ObjectField
1126
+ * @remarks
1127
+ * Defaults:
1128
+ * AssignmentType: `object | null | undefined`
1129
+ * InitializedType: `object`
1130
+ * PersistedType: `object`
1131
+ * InitialValue: `{}`
1132
+ */
1133
+ declare class ObjectField<
1134
+ const Options extends DataFieldOptions<AnyObject> = ObjectField.DefaultOptions,
1135
+ const AssignmentType = ObjectField.AssignmentType<Options>,
1136
+ const InitializedType = ObjectField.InitializedType<Options>,
1137
+ const PersistedType extends AnyObject | null | undefined = ObjectField.InitializedType<Options>,
1138
+ > extends DataField<Options, AssignmentType, InitializedType, PersistedType> {
1139
+ /** @defaultValue `true` */
1140
+ override required: boolean;
1141
+
1142
+ /** @defaultValue `false` */
1143
+ override nullable: boolean;
1144
+
1145
+ /** @defaultValue `() => ({})` */
1146
+ override initial: DataFieldOptions.InitialType<InitializedType>;
1147
+
1148
+ protected static override get _defaults(): DataFieldOptions<AnyObject>;
1149
+
1150
+ protected override _cast(value: AssignmentType): InitializedType;
1151
+
1152
+ override initialize(
1153
+ value: PersistedType,
1154
+ model: DataModel.Any,
1155
+ options?: AnyObject,
1156
+ ): InitializedType | (() => InitializedType | null);
1157
+
1158
+ override toObject(value: InitializedType): PersistedType;
1159
+
1160
+ protected override _validateType(
1161
+ value: InitializedType,
1162
+ options?: DataField.ValidationOptions<DataField.Any>,
1163
+ ): boolean | DataModelValidationFailure | void;
1164
+ }
1165
+
1166
+ declare namespace ObjectField {
1167
+ /** The type of the default options for the {@link ObjectField} class. */
1168
+ type DefaultOptions = SimpleMerge<
1169
+ DataField.DefaultOptions,
1170
+ {
1171
+ required: true;
1172
+ nullable: false;
1173
+ }
1174
+ >;
1175
+
1176
+ /**
1177
+ * A helper type for the given options type merged into the default options of the ObjectField class.
1178
+ * @typeParam Options - the options that override the default options
1179
+ */
1180
+ type MergedOptions<Options extends DataFieldOptions<AnyObject>> = SimpleMerge<DefaultOptions, Options>;
1181
+
1182
+ /**
1183
+ * A shorthand for the assignment type of a ObjectField class.
1184
+ * @typeParam Options - the options that override the default options
1185
+ */
1186
+ type AssignmentType<Options extends DataFieldOptions<AnyObject>> = DataField.DerivedAssignmentType<
1187
+ AnyObject,
1188
+ MergedOptions<Options>
1189
+ >;
1190
+
1191
+ /**
1192
+ * A shorthand for the initialized type of a ObjectField class.
1193
+ * @typeParam Options - the options that override the default options
1194
+ */
1195
+ type InitializedType<Options extends DataFieldOptions<AnyObject>> = DataField.DerivedInitializedType<
1196
+ AnyObject,
1197
+ MergedOptions<Options>
1198
+ >;
1199
+
1200
+ /**
1201
+ * A helper to create a flags object field for the given key in the {@link FlagConfig}.
1202
+ * @typeParam Key - the key to look for in the FlagConfig
1203
+ * @typeParam ExtensionFlags - additional flags besides the ones configured for the class
1204
+ * @typeParam Options - the options of the field
1205
+ */
1206
+ type FlagsField<
1207
+ Name extends Document.Type,
1208
+ // The type `{}` is useful here because in an intersection it reduces down to nothing unlike `EmptyObject`.
1209
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
1210
+ ExtensionFlags extends AnyObject = {},
1211
+ Options extends DataFieldOptions.Any = ObjectField.DefaultOptions,
1212
+ > = ObjectField<
1213
+ Options,
1214
+ DataField.DerivedAssignmentType<Document.ConfiguredFlagsForName<Name> & ExtensionFlags, MergedOptions<Options>>,
1215
+ DataField.DerivedInitializedType<Document.ConfiguredFlagsForName<Name> & ExtensionFlags, MergedOptions<Options>>,
1216
+ DataField.DerivedInitializedType<Document.ConfiguredFlagsForName<Name> & ExtensionFlags, MergedOptions<Options>>
1217
+ >;
1218
+ }
1219
+
1220
+ /**
1221
+ * A subclass of [DataField]{@link DataField} which deals with array-typed data.
1222
+ * @typeParam ElementFieldType - the field type for the elements in the ArrayField
1223
+ * @typeParam AssignmentElementType - the assignment type for the elements in the array
1224
+ * @typeParam InitializedElementType - the initialized type for the elements in the array
1225
+ * @typeParam Options - the options of the ArrayField instance
1226
+ * @typeParam AssignmentType - the type of the allowed assignment values of the ArrayField
1227
+ * @typeParam InitializedType - the type of the initialized values of the ArrayField
1228
+ * @typeParam PersistedElementType - the persisted type for the elements in the array
1229
+ * @typeParam PersistedType - the type of the persisted values of the ArrayField
1230
+ * @remarks
1231
+ * Defaults:
1232
+ * AssignmentType: `ArrayField.BaseAssignmentType<AssignmentElementType> | null | undefined`
1233
+ * InitializedType: `InitializedElementType[]`
1234
+ * PersistedType: `PersistedElementType[]`
1235
+ * InitialValue: `[]`
1236
+ */
1237
+ declare class ArrayField<
1238
+ const ElementFieldType extends DataField.Any | Document.AnyConstructor,
1239
+ const AssignmentElementType = ArrayField.AssignmentElementType<ElementFieldType>,
1240
+ const InitializedElementType = ArrayField.InitializedElementType<ElementFieldType>,
1241
+ const Options extends ArrayField.Options<AssignmentElementType> = ArrayField.DefaultOptions<AssignmentElementType>,
1242
+ const AssignmentType = ArrayField.AssignmentType<AssignmentElementType, Options>,
1243
+ const InitializedType = ArrayField.InitializedType<AssignmentElementType, InitializedElementType, Options>,
1244
+ const PersistedElementType = ArrayField.PersistedElementType<ElementFieldType>,
1245
+ const PersistedType extends PersistedElementType[] | null | undefined = ArrayField.PersistedType<
1246
+ AssignmentElementType,
1247
+ PersistedElementType,
1248
+ Options
1249
+ >,
1250
+ > extends DataField<Options, AssignmentType, InitializedType, PersistedType> {
1251
+ /**
1252
+ * @param element - A DataField instance which defines the type of element contained in the Array.
1253
+ * @param options - Options which configure the behavior of the field
1254
+ */
1255
+ constructor(element: ElementFieldType, options?: Options);
1256
+
1257
+ /** @defaultValue `true` */
1258
+ override required: boolean;
1259
+
1260
+ /** @defaultValue `false` */
1261
+ override nullable: boolean;
1262
+
1263
+ /** @defaultValue `() => []` */
1264
+ override initial: DataFieldOptions.InitialType<InitializedType>;
1265
+
1266
+ /**
1267
+ * The data type of each element in this array
1268
+ */
1269
+ element: ElementFieldType;
1270
+
1271
+ protected static override get _defaults(): ArrayField.Options<
1272
+ ArrayField.AssignmentElementType<DataField.Any | Document.AnyConstructor>
1273
+ >;
1274
+
1275
+ /** @defaultValue `true` */
1276
+ static override recursive: boolean;
1277
+
1278
+ /**
1279
+ * Validate the contained element type of the ArrayField
1280
+ * @param element - The type of Array element
1281
+ * @returns The validated element type
1282
+ * @throws An error if the element is not a valid type
1283
+ */
1284
+ protected static _validateElementType<T extends DataField.Any>(element: T): T;
1285
+
1286
+ protected override _validateModel(data: AnyObject, options?: AnyObject): void;
1287
+
1288
+ protected override _cast(value: AssignmentType): InitializedType;
1289
+
1290
+ protected override _cleanType(value: InitializedType, options?: DataField.CleanOptions): InitializedType;
1291
+
1292
+ protected override _validateType(
1293
+ value: InitializedType,
1294
+ options?: DataField.ValidationOptions<DataField.Any>,
1295
+ ): boolean | DataModelValidationFailure | void;
1296
+
1297
+ /**
1298
+ * Validate every element of the ArrayField
1299
+ * @param value - The array to validate
1300
+ * @param options - Validation options
1301
+ * @returns An array of element-specific errors
1302
+ */
1303
+ protected _validateElements(
1304
+ value: any[],
1305
+ options?: DataField.ValidationOptions<DataField.Any>,
1306
+ ): DataModelValidationFailure | void;
1307
+
1308
+ /**
1309
+ * Validate a single element of the ArrayField.
1310
+ * @param value - The value of the array element
1311
+ * @param options - Validation options
1312
+ * @returns A validation failure if the element failed validation
1313
+ */
1314
+ protected _validateElement(
1315
+ value: any,
1316
+ options: DataField.ValidationOptions<DataField.Any>,
1317
+ ): DataModelValidationFailure | void;
1318
+
1319
+ override initialize(
1320
+ value: PersistedType,
1321
+ model: DataModel.Any,
1322
+ options?: AnyObject,
1323
+ ): InitializedType | (() => InitializedType | null);
1324
+
1325
+ override toObject(value: InitializedType): PersistedType;
1326
+
1327
+ // TODO: Limit to the keys of `this` that are actually callable.
1328
+ override apply<Value, Options, Return>(
1329
+ fn: keyof this | ((this: this, value: Value, options: Options) => Return),
1330
+ value: Value,
1331
+ options?: Options,
1332
+ ): Return;
1333
+
1334
+ protected override _getField(path: string[]): unknown;
1335
+
1336
+ /**
1337
+ * Migrate this field's candidate source data.
1338
+ * @param sourceData - Candidate source data of the root model
1339
+ * @param fieldData - The value of this field within the source data
1340
+ */
1341
+ migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
1342
+ }
1343
+
1344
+ declare namespace ArrayField {
1345
+ /**
1346
+ * A shorthand for the options of an ArrayField class.
1347
+ * @typeParam AssignmentElementType - the assignment type of the elements in the array
1348
+ */
1349
+ type Options<AssignmentElementType> = DataFieldOptions<BaseAssignmentType<AssignmentElementType>>;
1350
+
1351
+ /**
1352
+ * The base assignment type for the {@link ArrayField} class.
1353
+ * @typeParam AssignmentElementType - the assignment type of the elements in the array
1354
+ */
1355
+ type BaseAssignmentType<AssignmentElementType> =
1356
+ | Record<number | string, AssignmentElementType>
1357
+ | Iterable<AssignmentElementType>
1358
+ | AssignmentElementType[]
1359
+ | AssignmentElementType;
1360
+
1361
+ /**
1362
+ * The type of the default options for the {@link ArrayField} class.
1363
+ * @typeParam AssignmentElementType - the assignment type of the elements in the array
1364
+ */
1365
+ type DefaultOptions<AssignmentElementType> = SimpleMerge<
1366
+ DataField.DefaultOptions,
1367
+ {
1368
+ required: true;
1369
+ nullable: false;
1370
+ initial: () => AssignmentElementType[];
1371
+ }
1372
+ >;
1373
+
1374
+ /**
1375
+ * A helper type for the given options type merged into the default options of the ArrayField class.
1376
+ * @typeParam AssignmentElementType - the assignment type of the elements of the ArrayField
1377
+ * @typeParam Opts - the options that override the default options
1378
+ */
1379
+ type MergedOptions<AssignmentElementType, Opts extends Options<AssignmentElementType>> = SimpleMerge<
1380
+ DefaultOptions<AssignmentElementType>,
1381
+ Opts
1382
+ >;
1383
+
1384
+ /**
1385
+ * A type to infer the assignment element type of an ArrayField from its ElementFieldType.
1386
+ * @typeParam ElementFieldType - the DataField type of the elements in the ArrayField
1387
+ */
1388
+ type AssignmentElementType<ElementFieldType extends DataField.Any | Document.AnyConstructor> =
1389
+ ElementFieldType extends DataField<any, infer Assign, any, any>
1390
+ ? Assign
1391
+ : ElementFieldType extends new (...args: any[]) => Document<infer Schema extends DataSchema, any, any>
1392
+ ? SchemaField.InnerAssignmentType<Schema>
1393
+ : never;
1394
+
1395
+ /**
1396
+ * A type to infer the initialized element type of an ArrayField from its ElementFieldType.
1397
+ * @typeParam ElementFieldType - the DataField type of the elements in the ArrayField
1398
+ */
1399
+ type InitializedElementType<ElementFieldType extends DataField.Any | Document.AnyConstructor> =
1400
+ ElementFieldType extends DataField<any, any, infer Init, any>
1401
+ ? Init
1402
+ : ElementFieldType extends new (...args: any[]) => Document<infer Schema extends DataSchema, any, any>
1403
+ ? SchemaField.InnerInitializedType<Schema>
1404
+ : never;
1405
+
1406
+ /**
1407
+ * A type to infer the initialized element type of an ArrayField from its ElementFieldType.
1408
+ * @typeParam ElementFieldType - the DataField type of the elements in the ArrayField
1409
+ */
1410
+ type PersistedElementType<ElementFieldType extends DataField.Any | Document.AnyConstructor> =
1411
+ ElementFieldType extends DataField<any, any, any, infer Persist>
1412
+ ? Persist
1413
+ : ElementFieldType extends new (...args: any[]) => Document<infer Schema extends DataSchema, any, any>
1414
+ ? SchemaField.InnerPersistedType<Schema>
1415
+ : never;
1416
+
1417
+ /**
1418
+ * A shorthand for the assignment type of an ArrayField class.
1419
+ * @typeParam AssignmentElementType - the assignment type of the elements of the ArrayField
1420
+ * @typeParam Opts - the options that override the default options
1421
+ */
1422
+ type AssignmentType<
1423
+ AssignmentElementType,
1424
+ Opts extends Options<AssignmentElementType>,
1425
+ > = DataField.DerivedAssignmentType<
1426
+ BaseAssignmentType<AssignmentElementType>,
1427
+ MergedOptions<AssignmentElementType, Opts>
1428
+ >;
1429
+
1430
+ /**
1431
+ * A shorthand for the initialized type of an ArrayField class.
1432
+ * @typeParam AssignmentElementType - the assignment type of the elements of the ArrayField
1433
+ * @typeParam InitializedElementType - the initialized type of the elements of the ArrayField
1434
+ * @typeParam Opts - the options that override the default options
1435
+ */
1436
+ type InitializedType<
1437
+ AssignmentElementType,
1438
+ InitializedElementType,
1439
+ Opts extends Options<AssignmentElementType>,
1440
+ > = DataField.DerivedInitializedType<InitializedElementType[], MergedOptions<AssignmentElementType, Opts>>;
1441
+
1442
+ /**
1443
+ * A shorthand for the persisted type of an ArrayField class.
1444
+ * @typeParam AssignmentElementType - the assignment type of the elements of the ArrayField
1445
+ * @typeParam PersistedElementType - the perssited type of the elements of the ArrayField
1446
+ * @typeParam Opts - the options that override the default options
1447
+ */
1448
+ type PersistedType<
1449
+ AssignmentElementType,
1450
+ PersistedElementType,
1451
+ Opts extends Options<AssignmentElementType>,
1452
+ > = DataField.DerivedInitializedType<PersistedElementType[], MergedOptions<AssignmentElementType, Opts>>;
1453
+ }
1454
+
1455
+ /**
1456
+ * A subclass of [ArrayField]{@link ArrayField} which supports a set of contained elements.
1457
+ * Elements in this set are treated as fungible and may be represented in any order or discarded if invalid.
1458
+ * @typeParam ElementFieldType - the field type for the elements in the SetField
1459
+ * @typeParam AssignmentElementType - the assignment type for the elements in the set
1460
+ * @typeParam InitializedElementType - the initialized type for the elements in the set
1461
+ * @typeParam Options - the options of the SetField instance
1462
+ * @typeParam AssignmentType - the type of the allowed assignment values of the SetField
1463
+ * @typeParam InitializedType - the type of the initialized values of the SetField
1464
+ * @typeParam PersistedElementType - the persisted type for the elements in the set
1465
+ * @typeParam PersistedType - the type of the persisted values of the SetField
1466
+ * @remarks
1467
+ * Defaults:
1468
+ * AssignmentType: `SetField.BaseAssignmentType<AssignmentElementType> | null | undefined`
1469
+ * InitializedType: `Set<InitializedElementType>`
1470
+ * PersistedType: `PersistedElementType[]`
1471
+ * InitialValue: `new Set()`
1472
+ */
1473
+ declare class SetField<
1474
+ ElementFieldType extends DataField.Any,
1475
+ AssignmentElementType = ArrayField.AssignmentElementType<ElementFieldType>,
1476
+ InitializedElementType = ArrayField.InitializedElementType<ElementFieldType>,
1477
+ Options extends SetField.Options<AssignmentElementType> = SetField.DefaultOptions<AssignmentElementType>,
1478
+ AssignmentType = SetField.AssignmentType<AssignmentElementType, Options>,
1479
+ InitializedType = SetField.InitializedType<AssignmentElementType, InitializedElementType, Options>,
1480
+ PersistedElementType = ArrayField.PersistedElementType<ElementFieldType>,
1481
+ PersistedType extends PersistedElementType[] | null | undefined = SetField.PersistedType<
1482
+ AssignmentElementType,
1483
+ PersistedElementType,
1484
+ Options
1485
+ >,
1486
+ > extends ArrayField<
1487
+ ElementFieldType,
1488
+ AssignmentElementType,
1489
+ InitializedElementType,
1490
+ Options,
1491
+ AssignmentType,
1492
+ InitializedType,
1493
+ PersistedElementType,
1494
+ PersistedType
1495
+ > {
1496
+ protected override _validateElements(
1497
+ value: any[],
1498
+ options?: DataField.ValidationOptions<DataField.Any>,
1499
+ ): void | DataModelValidationFailure;
1500
+
1501
+ override initialize(
1502
+ value: PersistedType,
1503
+ model: DataModel.Any,
1504
+ options?: AnyObject,
1505
+ ): InitializedType | (() => InitializedType | null);
1506
+
1507
+ override toObject(value: InitializedType): PersistedType;
1508
+ }
1509
+
1510
+ declare namespace SetField {
1511
+ /** Any SetField */
1512
+ type Any = SetField<DataField.Any, any, any, any, any, any, any, any>;
1513
+
1514
+ /**
1515
+ * A shorthand for the options of a SetField class.
1516
+ * @typeParam AssignmentElementType - the assignment type of the elements in the array
1517
+ */
1518
+ type Options<AssignmentElementType> = DataFieldOptions<SetField.BaseAssignmentType<AssignmentElementType>>;
1519
+
1520
+ /**
1521
+ * The base assignment type for the {@link SetField} class.
1522
+ * @typeParam AssignmentElementType - the assignment type of the elements in the array
1523
+ */
1524
+ type BaseAssignmentType<AssignmentElementType> = ArrayField.BaseAssignmentType<AssignmentElementType>;
1525
+
1526
+ /**
1527
+ * The type of the default options for the {@link SetField} class.
1528
+ * @typeParam AssignmentElementType - the assignment type of the elements in the array
1529
+ */
1530
+ type DefaultOptions<AssignmentElementType> = ArrayField.DefaultOptions<AssignmentElementType>;
1531
+
1532
+ /**
1533
+ * A helper type for the given options type merged into the default options of the SetField class.
1534
+ * @typeParam AssignmentElementType - the assignment type of the elements of the SetField
1535
+ * @typeParam Opts - the options that override the default options
1536
+ */
1537
+ type MergedOptions<AssignmentElementType, Opts extends Options<AssignmentElementType>> = SimpleMerge<
1538
+ DefaultOptions<AssignmentElementType>,
1539
+ Opts
1540
+ >;
1541
+
1542
+ /**
1543
+ * A shorthand for the assignment type of a SetField class.
1544
+ * @typeParam AssignmentElementType - the assignment type of the elements of the SetField
1545
+ * @typeParam Opts - the options that override the default options
1546
+ */
1547
+ type AssignmentType<
1548
+ AssignmentElementType,
1549
+ Opts extends Options<AssignmentElementType>,
1550
+ > = DataField.DerivedAssignmentType<
1551
+ BaseAssignmentType<AssignmentElementType>,
1552
+ MergedOptions<AssignmentElementType, Opts>
1553
+ >;
1554
+
1555
+ /**
1556
+ * A shorthand for the initialized type of a SetField class.
1557
+ * @typeParam AssignmentElementType - the assignment type of the elements of the SetField
1558
+ * @typeParam InitializedElementType - the initialized type of the elements of the SetField
1559
+ * @typeParam Opts - the options that override the default options
1560
+ */
1561
+ type InitializedType<
1562
+ AssignmentElementType,
1563
+ InitializedElementType,
1564
+ Opts extends Options<AssignmentElementType>,
1565
+ > = DataField.DerivedInitializedType<Set<InitializedElementType>, MergedOptions<AssignmentElementType, Opts>>;
1566
+
1567
+ /**
1568
+ * A shorthand for the persisted type of a SetField class.
1569
+ * @typeParam AssignmentElementType - the assignment type of the elements of the SetField
1570
+ * @typeParam PersistedElementType - the perssited type of the elements of the SetField
1571
+ * @typeParam Opts - the options that override the default options
1572
+ */
1573
+ type PersistedType<
1574
+ AssignmentElementType,
1575
+ PersistedElementType,
1576
+ Opts extends Options<AssignmentElementType>,
1577
+ > = DataField.DerivedInitializedType<PersistedElementType[], MergedOptions<AssignmentElementType, Opts>>;
1578
+ }
1579
+
1580
+ /**
1581
+ * A subclass of [ObjectField]{@link ObjectField} which embeds some other DataModel definition as an inner object.
1582
+ * @typeParam ModelType - the DataModel for the embedded data
1583
+ * @typeParam Options - the options of the EmbeddedDataField instance
1584
+ * @typeParam AssignmentType - the type of the allowed assignment values of the EmbeddedDataField
1585
+ * @typeParam InitializedType - the type of the initialized values of the EmbeddedDataField
1586
+ * @typeParam PersistedType - the type of the persisted values of the EmbeddedDataField
1587
+ * @remarks
1588
+ * Defaults:
1589
+ * AssignmentType: `SchemaField.AssignmentType<ModelType["schema"]["fields"]> | null | undefined`
1590
+ * InitializedType: `SchemaField.InitializedType<ModelType["schema"]["fields"]>`
1591
+ * PersistedType: `SchemaField.PersistedType<ModelType["schema"]["fields"]>`
1592
+ * InitialValue: `{}`
1593
+ */
1594
+ declare class EmbeddedDataField<
1595
+ const ModelType extends DataModel.Any,
1596
+ const Options extends EmbeddedDataField.Options<ModelType> = EmbeddedDataField.DefaultOptions,
1597
+ const AssignmentType = EmbeddedDataField.AssignmentType<ModelType, Options>,
1598
+ const InitializedType = EmbeddedDataField.InitializedType<ModelType, Options>,
1599
+ const PersistedType extends AnyObject | null | undefined = EmbeddedDataField.PersistedType<ModelType, Options>,
1600
+ > extends SchemaField<DataModel.SchemaFor<ModelType>, Options, AssignmentType, InitializedType, PersistedType> {
1601
+ /**
1602
+ * @param model - The class of DataModel which should be embedded in this field
1603
+ * @param options - Options which configure the behavior of the field
1604
+ */
1605
+ constructor(model: ConstructorOf<ModelType>, options?: Options);
1606
+
1607
+ /**
1608
+ * The embedded DataModel definition which is contained in this field.
1609
+ */
1610
+ model: ConstructorOf<ModelType>;
1611
+
1612
+ protected override _initialize(fields: DataSchema): DataSchema;
1613
+
1614
+ override initialize(
1615
+ value: PersistedType,
1616
+ model: DataModel.Any,
1617
+ options?: AnyObject,
1618
+ ): InitializedType | (() => InitializedType | null);
1619
+
1620
+ override toObject(value: InitializedType): PersistedType;
1621
+
1622
+ /**
1623
+ * Migrate this field's candidate source data.
1624
+ * @param sourceData - Candidate source data of the root model
1625
+ * @param fieldData - The value of this field within the source data
1626
+ */
1627
+ migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
1628
+
1629
+ protected override _validateModel(data: AnyObject, options?: AnyObject): void;
1630
+ }
1631
+
1632
+ declare namespace EmbeddedDataField {
1633
+ /**
1634
+ * A shorthand for the options of an EmbeddedDataField class.
1635
+ * @typeParam ModelType - the DataModel for the embedded data
1636
+ */
1637
+ type Options<ModelType extends DataModel.Any> = DataFieldOptions<
1638
+ SchemaField.InnerAssignmentType<DataModel.SchemaFor<ModelType>> | __SchemaFieldInitial
1639
+ >;
1640
+
1641
+ /** The type of the default options for the {@link EmbeddedDataField} class. */
1642
+ type DefaultOptions = SchemaField.DefaultOptions;
1643
+
1644
+ /**
1645
+ * A helper type for the given options type merged into the default options of the EmbeddedDataField class.
1646
+ * @typeParam ModelType - the DataModel for the embedded data
1647
+ * @typeParam Opts - the options that override the default options
1648
+ */
1649
+ type MergedOptions<ModelType extends DataModel.Any, Opts extends Options<ModelType>> = SimpleMerge<
1650
+ DefaultOptions,
1651
+ Opts
1652
+ >;
1653
+
1654
+ /**
1655
+ * A shorthand for the assignment type of an EmbeddedDataField class.
1656
+ * @typeParam ModelType - the DataModel for the embedded data
1657
+ * @typeParam Opts - the options that override the default options
1658
+ */
1659
+ type AssignmentType<
1660
+ ModelType extends DataModel.Any,
1661
+ Opts extends Options<ModelType>,
1662
+ > = DataField.DerivedAssignmentType<
1663
+ SchemaField.InnerAssignmentType<DataModel.SchemaFor<ModelType>>,
1664
+ MergedOptions<ModelType, Opts>
1665
+ >;
1666
+
1667
+ /**
1668
+ * A shorthand for the initialized type of an EmbeddedDataField class.
1669
+ * @typeParam ModelType - the DataModel for the embedded data
1670
+ * @typeParam Opts - the options that override the default options
1671
+ */
1672
+ // FIXME: Schema is unsure in src\foundry\common\data\data.d.mts
1673
+ type InitializedType<
1674
+ ModelType extends DataModel.Any,
1675
+ Opts extends Options<ModelType>,
1676
+ > = DataField.DerivedInitializedType<
1677
+ SchemaField.InnerInitializedType<DataModel.SchemaFor<ModelType>>,
1678
+ MergedOptions<ModelType, Opts>
1679
+ >;
1680
+
1681
+ /**
1682
+ * A shorthand for the persisted type of an EmbeddedDataField class.
1683
+ * @typeParam ModelType - the DataModel for the embedded data
1684
+ * @typeParam Opts - the options that override the default options
1685
+ */
1686
+ type PersistedType<
1687
+ ModelType extends DataModel.Any,
1688
+ Opts extends Options<ModelType>,
1689
+ > = DataField.DerivedInitializedType<
1690
+ SchemaField.InnerPersistedType<DataModel.SchemaFor<ModelType>>,
1691
+ MergedOptions<ModelType, Opts>
1692
+ >;
1693
+ }
1694
+
1695
+ /**
1696
+ * A subclass of [ArrayField]{@link ArrayField} which supports an embedded Document collection.
1697
+ * Invalid elements will be dropped from the collection during validation rather than failing for the field entirely.
1698
+ * @typeParam ElementFieldType - the field type for the elements in the EmbeddedCollectionField
1699
+ * @typeParam AssignmentElementType - the assignment type for the elements in the collection
1700
+ * @typeParam InitializedElementType - the initialized type for the elements in the collection
1701
+ * @typeParam Options - the options of the EmbeddedCollectionField instance
1702
+ * @typeParam AssignmentType - the type of the allowed assignment values of the EmbeddedCollectionField
1703
+ * @typeParam InitializedType - the type of the initialized values of the EmbeddedCollectionField
1704
+ * @typeParam PersistedElementType - the persisted type for the elements in the collection
1705
+ * @typeParam PersistedType - the type of the persisted values of the EmbeddedCollectionField
1706
+ * @remarks
1707
+ * Defaults:
1708
+ * AssignmentType: `ArrayField.BaseAssignmentType<AssignmentElementType> | null | undefined`
1709
+ * InitializedType: `Collection<InitializedElementType>`
1710
+ * PersistedType: `PersistedElementType[]`
1711
+ * InitialValue: `[]`
1712
+ */
1713
+ declare class EmbeddedCollectionField<
1714
+ ElementFieldType extends Document.AnyConstructor,
1715
+ ParentDataModel extends Document.Any,
1716
+ AssignmentElementType = EmbeddedCollectionField.AssignmentElementType<ElementFieldType>,
1717
+ InitializedElementType extends Document.Any = EmbeddedCollectionField.InitializedElementType<ElementFieldType>,
1718
+ Options extends
1719
+ EmbeddedCollectionField.Options<AssignmentElementType> = EmbeddedCollectionField.DefaultOptions<AssignmentElementType>,
1720
+ AssignmentType = EmbeddedCollectionField.AssignmentType<AssignmentElementType, Options>,
1721
+ InitializedType = EmbeddedCollectionField.InitializedType<
1722
+ AssignmentElementType,
1723
+ InitializedElementType,
1724
+ ParentDataModel,
1725
+ Options
1726
+ >,
1727
+ PersistedElementType = EmbeddedCollectionField.PersistedElementType<ElementFieldType>,
1728
+ PersistedType extends PersistedElementType[] | null | undefined = EmbeddedCollectionField.PersistedType<
1729
+ AssignmentElementType,
1730
+ PersistedElementType,
1731
+ Options
1732
+ >,
1733
+ > extends ArrayField<
1734
+ ElementFieldType,
1735
+ AssignmentElementType,
1736
+ InitializedElementType,
1737
+ Options,
1738
+ AssignmentType,
1739
+ InitializedType,
1740
+ PersistedElementType,
1741
+ PersistedType
1742
+ > {
1743
+ /**
1744
+ * @param element - The type of Document which belongs to this embedded collection
1745
+ * @param options - Options which configure the behavior of the field
1746
+ */
1747
+ constructor(element: ElementFieldType, options?: Options);
1748
+
1749
+ /** @defaultValue `true` */
1750
+ override readonly: true;
1751
+
1752
+ protected static override _validateElementType<T extends DataField.Any | Document.AnyConstructor>(element: T): T;
1753
+
1754
+ /**
1755
+ * The Collection implementation to use when initializing the collection.
1756
+ */
1757
+ static get implementation(): typeof EmbeddedCollection;
1758
+
1759
+ /** @defaultValue `true` */
1760
+ static override hierarchical: boolean;
1761
+
1762
+ /**
1763
+ * A reference to the DataModel subclass of the embedded document element
1764
+ */
1765
+ get model(): Document.AnyConstructor;
1766
+
1767
+ /**
1768
+ * The DataSchema of the contained Document model.
1769
+ */
1770
+ get schema(): this["model"]["schema"];
1771
+
1772
+ protected override _cleanType(value: InitializedType, options?: DataField.CleanOptions): InitializedType;
1773
+
1774
+ protected override _validateElements(
1775
+ value: any[],
1776
+ options?: DataField.ValidationOptions<DataField.Any>,
1777
+ ): DataModelValidationFailure | void;
1778
+
1779
+ override initialize(
1780
+ value: PersistedType,
1781
+ model: DataModel.Any,
1782
+ options?: AnyObject,
1783
+ ): InitializedType | (() => InitializedType | null);
1784
+
1785
+ override toObject(value: InitializedType): PersistedType;
1786
+
1787
+ override apply<Value, Options, Return>(
1788
+ fn: keyof this | ((this: this, value: Value, options: Options) => Return),
1789
+ value: Value,
1790
+ options?: Options,
1791
+ ): Return;
1792
+
1793
+ /**
1794
+ * Migrate this field's candidate source data.
1795
+ * @param sourceData - Candidate source data of the root model
1796
+ * @param fieldData - The value of this field within the source data
1797
+ */
1798
+ migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
1799
+
1800
+ /**
1801
+ * Return the embedded document(s) as a Collection.
1802
+ * @param parent - The parent document.
1803
+ */
1804
+ getCollection<P extends Document.Any>(parent: P): Collection<P>;
1805
+ }
1806
+
1807
+ declare namespace EmbeddedCollectionField {
1808
+ type Any = EmbeddedCollectionField<any, any, any, any, any, any, any, any, any>;
1809
+
1810
+ /**
1811
+ * A shorthand for the options of an EmbeddedCollectionField class.
1812
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionField
1813
+ */
1814
+ type Options<AssignmentElementType> = DataFieldOptions<ArrayField.BaseAssignmentType<AssignmentElementType>>;
1815
+
1816
+ /**
1817
+ * The type of the default options for the {@link EmbeddedCollectionField} class.
1818
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionField
1819
+ */
1820
+ type DefaultOptions<AssignmentElementType> = ArrayField.DefaultOptions<AssignmentElementType>;
1821
+
1822
+ /**
1823
+ * A helper type for the given options type merged into the default options of the EmbeddedCollectionField class.
1824
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionField
1825
+ * @typeParam Opts - the options that override the default options
1826
+ */
1827
+ type MergedOptions<AssignmentElementType, Opts extends Options<AssignmentElementType>> = SimpleMerge<
1828
+ DefaultOptions<AssignmentElementType>,
1829
+ Opts
1830
+ >;
1831
+
1832
+ /**
1833
+ * A type to infer the assignment element type of an EmbeddedCollectionField from its ElementFieldType.
1834
+ * @typeParam ElementFieldType - the DataField type of the elements in the EmbeddedCollectionField
1835
+ */
1836
+ type AssignmentElementType<ElementFieldType extends Document.AnyConstructor> = ElementFieldType extends new (
1837
+ ...args: any[]
1838
+ ) => Document<infer Schema extends DataSchema, any, any>
1839
+ ? SchemaField.InnerAssignmentType<Schema>
1840
+ : never;
1841
+
1842
+ /**
1843
+ * A type to infer the initialized element type of an EmbeddedCollectionField from its ElementFieldType.
1844
+ * @typeParam ElementFieldType - the DataField type of the elements in the EmbeddedCollectionField
1845
+ */
1846
+ type InitializedElementType<ElementFieldType extends Document.AnyConstructor> =
1847
+ Document.ToConfiguredInstance<ElementFieldType>;
1848
+
1849
+ /**
1850
+ * A type to infer the initialized element type of an EmbeddedCollectionField from its ElementFieldType.
1851
+ * @typeParam ElementFieldType - the DataField type of the elements in the EmbeddedCollectionField
1852
+ */
1853
+ type PersistedElementType<ElementFieldType extends Document.AnyConstructor> = ElementFieldType extends new (
1854
+ ...args: any[]
1855
+ ) => Document<infer Schema extends DataSchema, any, any>
1856
+ ? SchemaField.InnerPersistedType<Schema>
1857
+ : never;
1858
+
1859
+ /**
1860
+ * A shorthand for the assignment type of an ArrayField class.
1861
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionField
1862
+ * @typeParam Opts - the options that override the default options
1863
+ */
1864
+ type AssignmentType<
1865
+ AssignmentElementType,
1866
+ Opts extends Options<AssignmentElementType>,
1867
+ > = DataField.DerivedAssignmentType<
1868
+ ArrayField.BaseAssignmentType<AssignmentElementType>,
1869
+ MergedOptions<AssignmentElementType, Opts>
1870
+ >;
1871
+
1872
+ /**
1873
+ * A shorthand for the initialized type of an ArrayField class.
1874
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionField
1875
+ * @typeParam InitializedElementType - the initialized type of the elements of the EmbeddedCollectionField
1876
+ * @typeParam Opts - the options that override the default options
1877
+ */
1878
+ type InitializedType<
1879
+ AssignmentElementType,
1880
+ InitializedElementType extends Document.Internal.Instance.Any,
1881
+ ParentDataModel extends Document.Any,
1882
+ Opts extends Options<AssignmentElementType>,
1883
+ > = DataField.DerivedInitializedType<
1884
+ EmbeddedCollection<Document.Internal.Instance.Complete<InitializedElementType>, ParentDataModel>,
1885
+ MergedOptions<AssignmentElementType, Opts>
1886
+ >;
1887
+
1888
+ /**
1889
+ * A shorthand for the persisted type of an ArrayField class.
1890
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionField
1891
+ * @typeParam PersistedElementType - the perssited type of the elements of the EmbeddedCollectionField
1892
+ * @typeParam Opts - the options that override the default options
1893
+ */
1894
+ type PersistedType<
1895
+ AssignmentElementType,
1896
+ PersistedElementType,
1897
+ Opts extends Options<AssignmentElementType>,
1898
+ > = DataField.DerivedInitializedType<PersistedElementType[], MergedOptions<AssignmentElementType, Opts>>;
1899
+ }
1900
+
1901
+ /**
1902
+ * A subclass of {@link EmbeddedCollectionField} which manages a collection of delta objects relative to another
1903
+ * collection.
1904
+ * @typeParam ElementFieldType - the field type for the elements in the EmbeddedCollectionDeltaField
1905
+ * @typeParam AssignmentElementType - the assignment type for the elements in the collection
1906
+ * @typeParam InitializedElementType - the initialized type for the elements in the collection
1907
+ * @typeParam Options - the options of the EmbeddedCollectionDeltaField instance
1908
+ * @typeParam AssignmentType - the type of the allowed assignment values of the EmbeddedCollectionDeltaField
1909
+ * @typeParam InitializedType - the type of the initialized values of the EmbeddedCollectionDeltaField
1910
+ * @typeParam PersistedElementType - the persisted type for the elements in the collection
1911
+ * @typeParam PersistedType - the type of the persisted values of the EmbeddedCollectionDeltaField
1912
+ * @remarks
1913
+ * Defaults:
1914
+ * AssignmentType: `ArrayField.BaseAssignmentType<AssignmentElementType> | null | undefined`
1915
+ * InitializedType: `Collection<InitializedElementType>`
1916
+ * PersistedType: `PersistedElementType[]`
1917
+ * InitialValue: `[]`
1918
+ */
1919
+ declare class EmbeddedCollectionDeltaField<
1920
+ ElementFieldType extends Document.AnyConstructor,
1921
+ ParentDataModel extends Document.Any,
1922
+ AssignmentElementType = EmbeddedCollectionDeltaField.AssignmentElementType<ElementFieldType>,
1923
+ InitializedElementType extends Document.Any = EmbeddedCollectionDeltaField.InitializedElementType<ElementFieldType>,
1924
+ Options extends
1925
+ EmbeddedCollectionDeltaField.Options<AssignmentElementType> = EmbeddedCollectionDeltaField.DefaultOptions<AssignmentElementType>,
1926
+ AssignmentType = EmbeddedCollectionDeltaField.AssignmentType<AssignmentElementType, Options>,
1927
+ InitializedType = EmbeddedCollectionDeltaField.InitializedType<
1928
+ AssignmentElementType,
1929
+ InitializedElementType,
1930
+ ParentDataModel,
1931
+ Options
1932
+ >,
1933
+ PersistedElementType = EmbeddedCollectionDeltaField.PersistedElementType<ElementFieldType>,
1934
+ PersistedType extends PersistedElementType[] | null | undefined = EmbeddedCollectionDeltaField.PersistedType<
1935
+ AssignmentElementType,
1936
+ PersistedElementType,
1937
+ Options
1938
+ >,
1939
+ > extends EmbeddedCollectionField<
1940
+ ElementFieldType,
1941
+ ParentDataModel,
1942
+ AssignmentElementType,
1943
+ InitializedElementType,
1944
+ Options,
1945
+ AssignmentType,
1946
+ InitializedType,
1947
+ PersistedElementType,
1948
+ PersistedType
1949
+ > {
1950
+ static override get implementation(): typeof EmbeddedCollectionDelta;
1951
+
1952
+ protected override _cleanType(value: InitializedType, options?: DataField.CleanOptions): InitializedType;
1953
+
1954
+ protected override _validateElements(
1955
+ value: any[],
1956
+ options?: DataField.ValidationOptions<DataField.Any>,
1957
+ ): void | DataModelValidationFailure;
1958
+ }
1959
+
1960
+ declare namespace EmbeddedCollectionDeltaField {
1961
+ /**
1962
+ * A shorthand for the options of an EmbeddedCollectionDeltaField class.
1963
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionDeltaField
1964
+ */
1965
+ type Options<AssignmentElementType> = DataFieldOptions<ArrayField.BaseAssignmentType<AssignmentElementType>>;
1966
+
1967
+ /**
1968
+ * The type of the default options for the {@link EmbeddedCollectionDeltaField} class.
1969
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionDeltaField
1970
+ */
1971
+ type DefaultOptions<AssignmentElementType> = ArrayField.DefaultOptions<AssignmentElementType>;
1972
+
1973
+ /**
1974
+ * A helper type for the given options type merged into the default options of the EmbeddedCollectionDeltaField class.
1975
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionDeltaField
1976
+ * @typeParam Opts - the options that override the default options
1977
+ */
1978
+ type MergedOptions<AssignmentElementType, Opts extends Options<AssignmentElementType>> = SimpleMerge<
1979
+ DefaultOptions<AssignmentElementType>,
1980
+ Opts
1981
+ >;
1982
+
1983
+ /**
1984
+ * A type to infer the assignment element type of an EmbeddedCollectionDeltaField from its ElementFieldType.
1985
+ * @typeParam ElementFieldType - the DataField type of the elements in the EmbeddedCollectionDeltaField
1986
+ */
1987
+ type AssignmentElementType<ElementFieldType extends Document.AnyConstructor> = ElementFieldType extends new (
1988
+ ...args: any[]
1989
+ ) => Document<infer Schema extends DataSchema, any, any>
1990
+ ? SchemaField.InnerAssignmentType<Schema>
1991
+ : never;
1992
+
1993
+ /**
1994
+ * A type to infer the initialized element type of an EmbeddedCollectionDeltaField from its ElementFieldType.
1995
+ * @typeParam ElementFieldType - the DataField type of the elements in the EmbeddedCollectionDeltaField
1996
+ */
1997
+ type InitializedElementType<ElementFieldType extends Document.AnyConstructor> =
1998
+ Document.ToConfiguredInstance<ElementFieldType>;
1999
+
2000
+ /**
2001
+ * A type to infer the initialized element type of an EmbeddedCollectionDeltaField from its ElementFieldType.
2002
+ * @typeParam ElementFieldType - the DataField type of the elements in the EmbeddedCollectionDeltaField
2003
+ */
2004
+ type PersistedElementType<ElementFieldType extends Document.AnyConstructor> = ElementFieldType extends new (
2005
+ ...args: any[]
2006
+ ) => Document<infer Schema extends DataSchema, any, any>
2007
+ ? SchemaField.InnerPersistedType<Schema>
2008
+ : never;
2009
+
2010
+ /**
2011
+ * A shorthand for the assignment type of an ArrayField class.
2012
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionDeltaField
2013
+ * @typeParam Opts - the options that override the default options
2014
+ */
2015
+ type AssignmentType<
2016
+ AssignmentElementType,
2017
+ Opts extends Options<AssignmentElementType>,
2018
+ > = DataField.DerivedAssignmentType<
2019
+ ArrayField.BaseAssignmentType<AssignmentElementType>,
2020
+ MergedOptions<AssignmentElementType, Opts>
2021
+ >;
2022
+
2023
+ /**
2024
+ * A shorthand for the initialized type of an ArrayField class.
2025
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionDeltaField
2026
+ * @typeParam InitializedElementType - the initialized type of the elements of the EmbeddedCollectionDeltaField
2027
+ * @typeParam Opts - the options that override the default options
2028
+ */
2029
+ type InitializedType<
2030
+ AssignmentElementType,
2031
+ InitializedElementType extends Document.Internal.Instance.Any,
2032
+ ParentDataModel extends Document.Any,
2033
+ Opts extends Options<AssignmentElementType>,
2034
+ > = DataField.DerivedInitializedType<
2035
+ EmbeddedCollectionDelta<Document.Internal.Instance.Complete<InitializedElementType>, ParentDataModel>,
2036
+ MergedOptions<AssignmentElementType, Opts>
2037
+ >;
2038
+
2039
+ /**
2040
+ * A shorthand for the persisted type of an ArrayField class.
2041
+ * @typeParam AssignmentElementType - the assignment type of the elements of the EmbeddedCollectionDeltaField
2042
+ * @typeParam PersistedElementType - the perssited type of the elements of the EmbeddedCollectionDeltaField
2043
+ * @typeParam Opts - the options that override the default options
2044
+ */
2045
+ type PersistedType<
2046
+ AssignmentElementType,
2047
+ PersistedElementType,
2048
+ Opts extends Options<AssignmentElementType>,
2049
+ > = DataField.DerivedInitializedType<PersistedElementType[], MergedOptions<AssignmentElementType, Opts>>;
2050
+ }
2051
+
2052
+ /**
2053
+ * A subclass of {@link EmbeddedDataField} which supports a single embedded Document.
2054
+ * @typeParam DocumentType - the type of the embedded Document
2055
+ * @typeParam Options - the options of the EmbeddedDocumentField instance
2056
+ * @typeParam AssignmentType - the type of the allowed assignment values of the EmbeddedDocumentField
2057
+ * @typeParam InitializedType - the type of the initialized values of the EmbeddedDocumentField
2058
+ * @typeParam PersistedType - the type of the persisted values of the EmbeddedDocumentField
2059
+ * @remarks
2060
+ * Defaults:
2061
+ * AssignmentType: `SchemaField.AssignmentType<DocumentType["schema"]["fields"]> | null | undefined`
2062
+ * InitializedType: `SchemaField.InitializedType<DocumentType["schema"]["fields"]> | null`
2063
+ * PersistedType: `SchemaField.PersistedType<DocumentType["schema"]["fields"]> | null`
2064
+ * InitialValue: `{}`
2065
+ */
2066
+ declare class EmbeddedDocumentField<
2067
+ const DocumentType extends Document.Any,
2068
+ const Options extends EmbeddedDocumentField.Options<DocumentType> = EmbeddedDocumentField.DefaultOptions,
2069
+ const AssignmentType = EmbeddedDocumentField.AssignmentType<DocumentType, Options>,
2070
+ const InitializedType = EmbeddedDocumentField.InitializedType<DocumentType, Options>,
2071
+ const PersistedType extends AnyObject | null | undefined = EmbeddedDocumentField.PersistedType<DocumentType, Options>,
2072
+ > extends EmbeddedDataField<DocumentType, Options, AssignmentType, InitializedType, PersistedType> {
2073
+ /**
2074
+ * @param model - The type of Document which is embedded.
2075
+ * @param options - Options which configure the behavior of the field.
2076
+ */
2077
+ constructor(model: ConstructorOf<DocumentType>, options?: Options);
2078
+
2079
+ /** @defaultValue `true` */
2080
+ override nullable: boolean;
2081
+
2082
+ protected static override get _defaults(): EmbeddedDocumentField.Options<Document.Any>;
2083
+
2084
+ /** @defaultValue `true` */
2085
+ static override hierarchical: boolean;
2086
+
2087
+ override initialize(
2088
+ value: PersistedType,
2089
+ model: DataModel.Any,
2090
+ options?: AnyObject,
2091
+ ): InitializedType | (() => InitializedType | null);
2092
+
2093
+ /**
2094
+ * Return the embedded document(s) as a Collection.
2095
+ * @param parent - The parent document.
2096
+ */
2097
+ getCollection<P extends Document.Any>(parent: P): Collection<P>;
2098
+ }
2099
+
2100
+ declare namespace EmbeddedDocumentField {
2101
+ /**
2102
+ * A shorthand for the options of an EmbeddedDocumentField class.
2103
+ * @typeParam DocumentType - the type of the embedded Document
2104
+ */
2105
+ type Options<DocumentType extends Document.Any> = DataFieldOptions<
2106
+ SchemaField.InnerAssignmentType<DataModel.SchemaFor<DocumentType>> | __SchemaFieldInitial
2107
+ >;
2108
+
2109
+ /** The type of the default options for the {@link EmbeddedDocumentField} class. */
2110
+ type DefaultOptions = SimpleMerge<
2111
+ EmbeddedDataField.DefaultOptions,
2112
+ {
2113
+ nullable: true;
2114
+ }
2115
+ >;
2116
+
2117
+ /**
2118
+ * A helper type for the given options type merged into the default options of the EmbeddedDocumentField class.
2119
+ * @typeParam DocumentType - the type of the embedded Document
2120
+ * @typeParam Opts - the options that override the default options
2121
+ */
2122
+ type MergedOptions<DocumentType extends Document.Any, Opts extends Options<DocumentType>> = SimpleMerge<
2123
+ DefaultOptions,
2124
+ Opts
2125
+ >;
2126
+
2127
+ /**
2128
+ * A shorthand for the assignment type of an EmbeddedDocumentField class.
2129
+ * @typeParam DocumentType - the type of the embedded Document
2130
+ * @typeParam Opts - the options that override the default options
2131
+ */
2132
+ type AssignmentType<
2133
+ DocumentType extends Document.Any,
2134
+ Opts extends Options<DocumentType>,
2135
+ > = DataField.DerivedAssignmentType<
2136
+ SchemaField.InnerAssignmentType<DataModel.SchemaFor<DocumentType>>,
2137
+ MergedOptions<DocumentType, Opts>
2138
+ >;
2139
+
2140
+ /**
2141
+ * A shorthand for the initialized type of an EmbeddedDocumentField class.
2142
+ * @typeParam DocumentType - the type of the embedded Document
2143
+ * @typeParam Opts - the options that override the default options
2144
+ */
2145
+ type InitializedType<
2146
+ DocumentType extends Document.Any,
2147
+ Opts extends Options<DocumentType>,
2148
+ > = DataField.DerivedInitializedType<
2149
+ SchemaField.InnerInitializedType<DataModel.SchemaFor<DocumentType>>,
2150
+ MergedOptions<DocumentType, Opts>
2151
+ >;
2152
+
2153
+ /**
2154
+ * A shorthand for the persisted type of an EmbeddedDocumentField class.
2155
+ * @typeParam DocumentType - the type of the embedded Document
2156
+ * @typeParam Opts - the options that override the default options
2157
+ */
2158
+ type PersistedType<
2159
+ DocumentType extends Document.Any,
2160
+ Opts extends Options<DocumentType>,
2161
+ > = DataField.DerivedInitializedType<
2162
+ SchemaField.InnerPersistedType<DataModel.SchemaFor<DocumentType>>,
2163
+ MergedOptions<DocumentType, Opts>
2164
+ >;
2165
+ }
2166
+
2167
+ /**
2168
+ * A subclass of [StringField]{@link StringField} which provides the primary _id for a Document.
2169
+ * The field may be initially null, but it must be non-null when it is saved to the database.
2170
+ * @typeParam Options - the options of the DocumentIdField instance
2171
+ * @typeParam AssignmentType - the type of the allowed assignment values of the DocumentIdField
2172
+ * @typeParam InitializedType - the type of the initialized values of the DocumentIdField
2173
+ * @typeParam PersistedType - the type of the persisted values of the DocumentIdField
2174
+ * @remarks
2175
+ * Defaults:
2176
+ * AssignmentType: `string | Document.Any | null | undefined`
2177
+ * InitializedType: `string | null`
2178
+ * PersistedType: `string | null`
2179
+ * InitialValue: `null`
2180
+ */
2181
+ declare class DocumentIdField<
2182
+ Options extends StringFieldOptions = DocumentIdField.DefaultOptions,
2183
+ AssignmentType = DocumentIdField.AssignmentType<Options>,
2184
+ InitializedType = DocumentIdField.InitializedType<Options>,
2185
+ PersistedType extends string | null | undefined = DocumentIdField.InitializedType<Options>,
2186
+ > extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
2187
+ /** @defaultValue `true` */
2188
+ override required: boolean;
2189
+
2190
+ /** @defaultValue `false` */
2191
+ override blank: boolean;
2192
+
2193
+ /** @defaultValue `true` */
2194
+ override nullable: boolean;
2195
+
2196
+ /** @defaultValue `null` */
2197
+ override initial: DataFieldOptions.InitialType<InitializedType>;
2198
+
2199
+ /** @defaultValue `true` */
2200
+ override readonly: boolean;
2201
+
2202
+ /** @defaultValue `"is not a valid Document ID string"` */
2203
+ override validationError: string;
2204
+
2205
+ protected static override get _defaults(): StringFieldOptions;
2206
+
2207
+ protected override _cast(value: AssignmentType): InitializedType;
2208
+
2209
+ protected override _validateType(
2210
+ value: InitializedType,
2211
+ options?: DataField.ValidationOptions<DataField.Any>,
2212
+ ): boolean | DataModelValidationFailure | void;
2213
+ }
2214
+
2215
+ declare namespace DocumentIdField {
2216
+ /** The type of the default options for the {@link DocumentIdField} class. */
2217
+ type DefaultOptions = SimpleMerge<
2218
+ StringField.DefaultOptions,
2219
+ {
2220
+ required: true;
2221
+ blank: false;
2222
+ nullable: true;
2223
+ initial: null;
2224
+ readonly: true;
2225
+ validationError: "is not a valid Document ID string";
2226
+ }
2227
+ >;
2228
+
2229
+ /**
2230
+ * A helper type for the given options type merged into the default options of the DocumentIdField class.
2231
+ * @typeParam Options - the options that override the default options
2232
+ */
2233
+ type MergedOptions<Options extends StringFieldOptions> = SimpleMerge<DefaultOptions, Options>;
2234
+
2235
+ /**
2236
+ * A shorthand for the assignment type of a StringField class.
2237
+ * @typeParam Options - the options that override the default options
2238
+ */
2239
+ type AssignmentType<Options extends StringFieldOptions> = DataField.DerivedAssignmentType<
2240
+ string | Document.Any,
2241
+ MergedOptions<Options>
2242
+ >;
2243
+
2244
+ /**
2245
+ * A shorthand for the initialized type of a StringField class.
2246
+ * @typeParam Options - the options that override the default options
2247
+ */
2248
+ type InitializedType<Options extends StringFieldOptions> = DataField.DerivedInitializedType<
2249
+ string,
2250
+ MergedOptions<Options>
2251
+ >;
2252
+ }
2253
+
2254
+ /**
2255
+ * A special class of [StringField]{@link StringField} field which references another DataModel by its id.
2256
+ * This field may also be null to indicate that no foreign model is linked.
2257
+ * @typeParam DocumentType - the type of the foreign document constructor
2258
+ * @typeParam Options - the options for the ForeignDocumentField
2259
+ * @typeParam AssignmentType - the type of the allowed assignment values of the ForeignDocumentField
2260
+ * @typeParam InitializedType - the type of the initialized values of the ForeignDocumentField
2261
+ * @typeParam PersistedType - the type of the persisted values of the ForeignDocumentField
2262
+ * @remarks
2263
+ * Defaults:
2264
+ * AssignmentType: `string | InstanceType<DocumentType> | null | undefined`
2265
+ * InitializedType: `InstanceType<DocumentType> | null`
2266
+ * PersistedType: `string | null`
2267
+ * InitialValue: `null`
2268
+ */
2269
+ declare class ForeignDocumentField<
2270
+ DocumentType extends Document.Any,
2271
+ Options extends ForeignDocumentField.Options = ForeignDocumentField.DefaultOptions,
2272
+ AssignmentType = ForeignDocumentField.AssignmentType<DocumentType, Options>,
2273
+ InitializedType = ForeignDocumentField.InitializedType<DocumentType, Options>,
2274
+ PersistedType extends string | null | undefined = ForeignDocumentField.PersistedType<Options>,
2275
+ > extends DocumentIdField<Options, AssignmentType, InitializedType, PersistedType> {
2276
+ /**
2277
+ * @param model - The foreign DataModel class definition which this field should link to.
2278
+ * @param options - Options which configure the behavior of the field
2279
+ */
2280
+ constructor(model: ConstructorOf<DocumentType>, options?: Options);
2281
+
2282
+ /** @defaultValue `true` */
2283
+ override nullable: boolean;
2284
+
2285
+ /** @defaultValue `false` */
2286
+ override readonly: boolean;
2287
+
2288
+ /** @defaultValue `false` */
2289
+ idOnly: boolean;
2290
+
2291
+ /**
2292
+ * A reference to the model class which is stored in this field
2293
+ */
2294
+ model: ConstructorOf<DocumentType>;
2295
+
2296
+ protected static override get _defaults(): ForeignDocumentField.Options;
2297
+
2298
+ protected override _cast(value: AssignmentType): InitializedType;
2299
+
2300
+ override initialize(
2301
+ value: PersistedType,
2302
+ model: DataModel.Any,
2303
+ options?: AnyObject,
2304
+ ): InitializedType | (() => InitializedType | null);
2305
+
2306
+ override toObject(value: InitializedType): PersistedType;
2307
+ }
2308
+
2309
+ declare namespace ForeignDocumentField {
2310
+ /** The options for the ForeignDocumentField class. */
2311
+ type Options = StringFieldOptions &
2312
+ DataFieldOptions<string | Document.Any> & {
2313
+ // Making this ---------^ more concrete leads to excessively deep instantiation
2314
+ idOnly?: boolean;
2315
+ };
2316
+
2317
+ /** The type of the default options for the {@link ForeignDocumentField} class. */
2318
+ type DefaultOptions = SimpleMerge<
2319
+ DocumentIdField.DefaultOptions,
2320
+ {
2321
+ nullable: true;
2322
+ readonly: false;
2323
+ idOnly: false;
2324
+ }
2325
+ >;
2326
+
2327
+ /**
2328
+ * A helper type for the given options type merged into the default options of the ForeignDocumentField class.
2329
+ * @typeParam Opts - the options that override the default options
2330
+ */
2331
+ type MergedOptions<Opts extends Options> = SimpleMerge<DefaultOptions, Opts>;
2332
+
2333
+ /**
2334
+ * A shorthand for the assignment type of a ForeignDocumentField class.
2335
+ * @typeParam Opts - the options that override the default options
2336
+ */
2337
+ type AssignmentType<ConcreteDocument extends Document.Any, Opts extends Options> = DataField.DerivedAssignmentType<
2338
+ string | Document.ConfiguredClassForName<ConcreteDocument["documentName"]>,
2339
+ MergedOptions<Opts>
2340
+ >;
2341
+
2342
+ /**
2343
+ * A shorthand for the initialized type of a ForeignDocumentField class.
2344
+ * @typeParam Opts - the options that override the default options
2345
+ */
2346
+ type InitializedType<ConcreteDocument extends Document.Any, Opts extends Options> = DataField.DerivedInitializedType<
2347
+ Opts["idOnly"] extends true ? string : Document.ConfiguredInstanceForName<ConcreteDocument["documentName"]>,
2348
+ MergedOptions<Opts>
2349
+ >;
2350
+
2351
+ /**
2352
+ * A shorthand for the persisted type of a ForeignDocumentField class.
2353
+ * @typeParam Opts - the options that override the default options
2354
+ */
2355
+ type PersistedType<Opts extends Options> = DataField.DerivedInitializedType<string, MergedOptions<Opts>>;
2356
+ }
2357
+
2358
+ /**
2359
+ * A special [StringField]{@link StringField} which records a standardized CSS color string.
2360
+ * @typeParam Options - the options of the ColorField instance
2361
+ * @typeParam AssignmentType - the type of the allowed assignment values of the ColorField
2362
+ * @typeParam InitializedType - the type of the initialized values of the ColorField
2363
+ * @typeParam PersistedType - the type of the persisted values of the ColorField
2364
+ * @remarks
2365
+ * Defaults:
2366
+ * AssignmentType: `string | null | undefined`
2367
+ * InitializedType: `string | null`
2368
+ * PersistedType: `string | null`
2369
+ * InitialValue: `null`
2370
+ */
2371
+ declare class ColorField<
2372
+ Options extends StringFieldOptions = ColorField.DefaultOptions,
2373
+ AssignmentType = ColorField.AssignmentType<Options>,
2374
+ InitializedType = ColorField.InitializedType<Options>,
2375
+ PersistedType extends string | null | undefined = ColorField.InitializedType<Options>,
2376
+ > extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
2377
+ /** @defaultValue `true` */
2378
+ override nullable: boolean;
2379
+
2380
+ /** @defaultValue `null` */
2381
+ override initial: DataFieldOptions.InitialType<InitializedType>;
2382
+
2383
+ /** @defaultValue `false` */
2384
+ override blank: boolean;
2385
+
2386
+ /** @defaultValue `"is not a valid hexadecimal color string"` */
2387
+ override validationError: string;
2388
+
2389
+ protected static override get _defaults(): StringFieldOptions;
2390
+
2391
+ override clean(value: AssignmentType, options?: DataField.CleanOptions): InitializedType;
2392
+
2393
+ protected override _validateType(
2394
+ value: InitializedType,
2395
+ options?: DataField.ValidationOptions<DataField.Any>,
2396
+ ): boolean | DataModelValidationFailure | void;
2397
+ }
2398
+
2399
+ declare namespace ColorField {
2400
+ /** The type of the default options for the {@link ColorField} class. */
2401
+ type DefaultOptions = SimpleMerge<
2402
+ StringField.DefaultOptions,
2403
+ {
2404
+ nullable: true;
2405
+ initial: null;
2406
+ blank: false;
2407
+ validationError: "is not a valid hexadecimal color string";
2408
+ }
2409
+ >;
2410
+
2411
+ /**
2412
+ * A helper type for the given options type merged into the default options of the ColorField class.
2413
+ * @typeParam Options - the options that override the default options
2414
+ */
2415
+ type MergedOptions<Options extends StringFieldOptions> = SimpleMerge<DefaultOptions, Options>;
2416
+
2417
+ /**
2418
+ * A shorthand for the assignment type of a ColorField class.
2419
+ * @typeParam Options - the options that override the default options
2420
+ */
2421
+ type AssignmentType<Options extends StringFieldOptions> = DataField.DerivedAssignmentType<
2422
+ string,
2423
+ MergedOptions<Options>
2424
+ >;
2425
+
2426
+ /**
2427
+ * A shorthand for the initialized type of a ColorField class.
2428
+ * @typeParam Options - the options that override the default options
2429
+ */
2430
+ type InitializedType<Options extends StringFieldOptions> = DataField.DerivedInitializedType<
2431
+ string,
2432
+ MergedOptions<Options>
2433
+ >;
2434
+ }
2435
+
2436
+ declare global {
2437
+ /**
2438
+ * @typeParam Value - the type of the value of the field
2439
+ */
2440
+ interface FilePathFieldOptions extends StringFieldOptions {
2441
+ /**
2442
+ * A set of categories in CONST.FILE_CATEGORIES which this field supports
2443
+ * @defaultValue `[]`
2444
+ */
2445
+ categories?: (keyof typeof CONST.FILE_CATEGORIES)[];
2446
+
2447
+ /**
2448
+ * Is embedded base64 data supported in lieu of a file path?
2449
+ * @defaultValue `false`
2450
+ */
2451
+ base64?: boolean;
2452
+
2453
+ /**
2454
+ * Does this file path field allow wildcard characters?
2455
+ * @defaultValue `false`
2456
+ */
2457
+ wildcard?: boolean;
2458
+ }
2459
+ }
2460
+
2461
+ /**
2462
+ * A special [StringField]{@link StringField} which records a file path or inline base64 data.
2463
+ * @typeParam Options - the options of the FilePathField instance
2464
+ * @typeParam AssignmentType - the type of the allowed assignment values of the FilePathField
2465
+ * @typeParam InitializedType - the type of the initialized values of the FilePathField
2466
+ * @typeParam PersistedType - the type of the persisted values of the FilePathField
2467
+ * @remarks
2468
+ * Defaults:
2469
+ * AssignmentType: `string | null | undefined`
2470
+ * InitializedType: `string | null`
2471
+ * PersistedType: `string | null`
2472
+ * InitialValue: `null`
2473
+ */
2474
+ declare class FilePathField<
2475
+ Options extends FilePathFieldOptions = FilePathField.DefaultOptions,
2476
+ AssignmentType = FilePathField.AssignmentType<Options>,
2477
+ InitializedType = FilePathField.InitializedType<Options>,
2478
+ PersistedType extends string | null | undefined = FilePathField.InitializedType<Options>,
2479
+ > extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
2480
+ /**
2481
+ * @param options - Options which configure the behavior of the field
2482
+ */
2483
+ constructor(options?: Options);
2484
+
2485
+ /**
2486
+ * A set of categories in CONST.FILE_CATEGORIES which this field supports
2487
+ * @defaultValue `[]`
2488
+ */
2489
+ categories: (keyof typeof CONST.FILE_CATEGORIES)[];
2490
+
2491
+ /**
2492
+ * Is embedded base64 data supported in lieu of a file path?
2493
+ * @defaultValue `false`
2494
+ */
2495
+ base64: boolean;
2496
+
2497
+ /**
2498
+ * Does this file path field allow wildcard characters?
2499
+ * @defaultValue `false`
2500
+ */
2501
+ wildcard: boolean;
2502
+
2503
+ /** @defaultValue `true` */
2504
+ override nullable: boolean;
2505
+
2506
+ /** @defaultValue `false` */
2507
+ override blank: boolean;
2508
+
2509
+ /** @defaultValue `null` */
2510
+ override initial: DataFieldOptions.InitialType<InitializedType>;
2511
+
2512
+ protected static override get _defaults(): FilePathFieldOptions;
2513
+
2514
+ override clean(value: AssignmentType, options?: DataField.CleanOptions): InitializedType;
2515
+
2516
+ protected override _validateType(
2517
+ value: InitializedType,
2518
+ options?: DataField.ValidationOptions<DataField.Any>,
2519
+ ): boolean | DataModelValidationFailure | void;
2520
+ }
2521
+
2522
+ declare namespace FilePathField {
2523
+ /** The type of the default options for the {@link FilePathField} class. */
2524
+ type DefaultOptions = SimpleMerge<
2525
+ StringField.DefaultOptions,
2526
+ {
2527
+ categories: (keyof typeof CONST.FILE_CATEGORIES)[];
2528
+ base64: false;
2529
+ wildcard: false;
2530
+ nullable: true;
2531
+ blank: false;
2532
+ initial: null;
2533
+ }
2534
+ >;
2535
+
2536
+ /**
2537
+ * A helper type for the given options type merged into the default options of the FilePathField class.
2538
+ * @typeParam Options - the options that override the default options
2539
+ */
2540
+ type MergedOptions<Options extends StringFieldOptions> = SimpleMerge<DefaultOptions, Options>;
2541
+
2542
+ /**
2543
+ * A shorthand for the assignment type of a FilePathField class.
2544
+ * @typeParam Options - the options that override the default options
2545
+ */
2546
+ type AssignmentType<Options extends StringFieldOptions> = DataField.DerivedAssignmentType<
2547
+ string,
2548
+ MergedOptions<Options>
2549
+ >;
2550
+
2551
+ /**
2552
+ * A shorthand for the initialized type of a FilePathField class.
2553
+ * @typeParam Options - the options that override the default options
2554
+ */
2555
+ type InitializedType<Options extends StringFieldOptions> = DataField.DerivedInitializedType<
2556
+ string,
2557
+ MergedOptions<Options>
2558
+ >;
2559
+ }
2560
+
2561
+ /**
2562
+ * A special [NumberField]{@link NumberField} which represents an angle of rotation in degrees between 0 and 360.
2563
+ * @typeParam Options - the options of the AngleField instance
2564
+ * @typeParam AssignmentType - the type of the allowed assignment values of the AngleField
2565
+ * @typeParam InitializedType - the type of the initialized values of the AngleField
2566
+ * @typeParam PersistedType - the type of the persisted values of the AngleField
2567
+ * @remarks
2568
+ * Defaults:
2569
+ * AssignmentType: `number | null | undefined`
2570
+ * InitializedType: `number`
2571
+ * PersistedType: `number`
2572
+ * InitialValue: `0`
2573
+ */
2574
+ declare class AngleField<
2575
+ Options extends NumberFieldOptions = AngleField.DefaultOptions,
2576
+ AssignmentType = AngleField.AssignmentType<Options>,
2577
+ InitializedType = AngleField.InitializedType<Options>,
2578
+ PersistedType extends number | null | undefined = AngleField.InitializedType<Options>,
2579
+ > extends NumberField<Options, AssignmentType, InitializedType, PersistedType> {
2580
+ /** @defaultValue `true` */
2581
+ override required: boolean;
2582
+
2583
+ /** @defaultValue `false` */
2584
+ override nullable: boolean;
2585
+
2586
+ /** @defaultValue `0` */
2587
+ override initial: DataFieldOptions.InitialType<InitializedType>;
2588
+
2589
+ /** @defaultValue `0` */
2590
+ base: number;
2591
+
2592
+ /** @defaultValue `0` */
2593
+ override min: number | undefined;
2594
+
2595
+ /** @defaultValue `360` */
2596
+ override max: number | undefined;
2597
+
2598
+ /** @defaultValue `"is not a number between 0 and 360"` */
2599
+ override validationError: string;
2600
+
2601
+ protected static override get _defaults(): NumberFieldOptions;
2602
+
2603
+ protected override _cast(value: AssignmentType): InitializedType;
2604
+ }
2605
+
2606
+ declare namespace AngleField {
2607
+ /** The type of the default options for the {@link AngleField} class. */
2608
+ type DefaultOptions = SimpleMerge<
2609
+ NumberField.DefaultOptions,
2610
+ {
2611
+ required: true;
2612
+ nullable: false;
2613
+ initial: 0;
2614
+ base: 0;
2615
+ min: 0;
2616
+ max: 360;
2617
+ validationError: "is not a number between 0 and 360";
2618
+ }
2619
+ >;
2620
+
2621
+ /**
2622
+ * A helper type for the given options type merged into the default options of the AngleField class.
2623
+ * @typeParam Options - the options that override the default options
2624
+ */
2625
+ type MergedOptions<Options extends NumberFieldOptions> = SimpleMerge<DefaultOptions, Options>;
2626
+
2627
+ /**
2628
+ * A shorthand for the assignment type of a AngleField class.
2629
+ * @typeParam Options - the options that override the default options
2630
+ */
2631
+ type AssignmentType<Options extends NumberFieldOptions> = DataField.DerivedAssignmentType<
2632
+ number,
2633
+ MergedOptions<Options>
2634
+ >;
2635
+
2636
+ /**
2637
+ * A shorthand for the initialized type of a AngleField class.
2638
+ * @typeParam Options - the options that override the default options
2639
+ */
2640
+ type InitializedType<Options extends NumberFieldOptions> = DataField.DerivedInitializedType<
2641
+ number,
2642
+ MergedOptions<Options>
2643
+ >;
2644
+ }
2645
+
2646
+ /**
2647
+ * A special [NumberField]{@link NumberField} represents a number between 0 and 1.
2648
+ * @typeParam Options - the options of the AlphaField instance
2649
+ * @typeParam AssignmentType - the type of the allowed assignment values of the AlphaField
2650
+ * @typeParam InitializedType - the type of the initialized values of the AlphaField
2651
+ * @typeParam PersistedType - the type of the persisted values of the AlphaField
2652
+ * @remarks
2653
+ * Defaults:
2654
+ * AssignmentType: `number | null | undefined`
2655
+ * InitializedType: `number`
2656
+ * PersistedType: `number`
2657
+ * InitialValue: `1`
2658
+ */
2659
+ declare class AlphaField<
2660
+ Options extends NumberFieldOptions = AlphaField.DefaultOptions,
2661
+ AssignmentType = AlphaField.AssignmentType<Options>,
2662
+ InitializedType = AlphaField.InitializedType<Options>,
2663
+ PersistedType extends number | null | undefined = AlphaField.InitializedType<Options>,
2664
+ > extends NumberField<Options, AssignmentType, InitializedType, PersistedType> {
2665
+ /** @defaultValue `true` */
2666
+ override required: boolean;
2667
+
2668
+ /** @defaultValue `false` */
2669
+ override nullable: boolean;
2670
+
2671
+ /** @defaultValue `1` */
2672
+ override initial: DataFieldOptions.InitialType<InitializedType>;
2673
+
2674
+ /** @defaultValue `0` */
2675
+ override min: number | undefined;
2676
+
2677
+ /** @defaultValue `1` */
2678
+ override max: number | undefined;
2679
+
2680
+ /** @defaultValue `"is not a number between 0 and 1"` */
2681
+ override validationError: string;
2682
+
2683
+ protected static override get _defaults(): NumberFieldOptions;
2684
+ }
2685
+
2686
+ declare namespace AlphaField {
2687
+ /** The type of the default options for the {@link AlphaField} class. */
2688
+ type DefaultOptions = SimpleMerge<
2689
+ NumberField.DefaultOptions,
2690
+ {
2691
+ required: true;
2692
+ nullable: false;
2693
+ initial: 1;
2694
+ min: 0;
2695
+ max: 1;
2696
+ validationError: "is not a number between 0 and 1";
2697
+ }
2698
+ >;
2699
+
2700
+ /**
2701
+ * A helper type for the given options type merged into the default options of the AlphaField class.
2702
+ * @typeParam Options - the options that override the default options
2703
+ */
2704
+ type MergedOptions<Options extends NumberFieldOptions> = SimpleMerge<DefaultOptions, Options>;
2705
+
2706
+ /**
2707
+ * A shorthand for the assignment type of a AlphaField class.
2708
+ * @typeParam Options - the options that override the default options
2709
+ */
2710
+ type AssignmentType<Options extends NumberFieldOptions> = DataField.DerivedAssignmentType<
2711
+ number,
2712
+ MergedOptions<Options>
2713
+ >;
2714
+
2715
+ /**
2716
+ * A shorthand for the initialized type of a AlphaField class.
2717
+ * @typeParam Options - the options that override the default options
2718
+ */
2719
+ type InitializedType<Options extends NumberFieldOptions> = DataField.DerivedInitializedType<
2720
+ number,
2721
+ MergedOptions<Options>
2722
+ >;
2723
+ }
2724
+
2725
+ /**
2726
+ * A special [ObjectField]{@link ObjectField} which captures a mapping of User IDs to Document permission levels.
2727
+ * @typeParam Options - the options of the DocumentOwnershipField instance
2728
+ * @typeParam AssignmentType - the type of the allowed assignment values of the DocumentOwnershipField
2729
+ * @typeParam InitializedType - the type of the initialized values of the DocumentOwnershipField
2730
+ * @typeParam PersistedType - the type of the persisted values of the DocumentOwnershipField
2731
+ * @remarks
2732
+ * Defaults:
2733
+ * AssignmentType: `Record<string, DOCUMENT_OWNERSHIP_LEVELS> | null | undefined`
2734
+ * InitializedType: `Record<string, DOCUMENT_OWNERSHIP_LEVELS>`
2735
+ * PersistedType: `Record<string, DOCUMENT_OWNERSHIP_LEVELS>`
2736
+ * InitialValue: `{ default: DOCUMENT_OWNERSHIP_LEVELS.NONE }`
2737
+ */
2738
+ declare class DocumentOwnershipField<
2739
+ Options extends DocumentOwnershipField.Options = DocumentOwnershipField.DefaultOptions,
2740
+ AssignmentType = DocumentOwnershipField.AssignmentType<Options>,
2741
+ InitializedType = DocumentOwnershipField.InitializedType<Options>,
2742
+ PersistedType extends
2743
+ | Record<string, DOCUMENT_OWNERSHIP_LEVELS>
2744
+ | null
2745
+ | undefined = DocumentOwnershipField.InitializedType<Options>,
2746
+ > extends ObjectField<Options, AssignmentType, InitializedType, PersistedType> {
2747
+ /** @defaultValue `{"default": DOCUMENT_OWNERSHIP_LEVELS.NONE}` */
2748
+ override initial: DataFieldOptions.InitialType<InitializedType>;
2749
+
2750
+ /** @defaultValue `"is not a mapping of user IDs and document permission levels"` */
2751
+ override validationError: string;
2752
+
2753
+ protected static override get _defaults(): DocumentOwnershipField.Options;
2754
+
2755
+ protected override _validateType(
2756
+ value: InitializedType,
2757
+ options?: DataField.ValidationOptions<DataField.Any>,
2758
+ ): boolean | DataModelValidationFailure | void;
2759
+ }
2760
+
2761
+ declare namespace DocumentOwnershipField {
2762
+ /** A shorthand for the options of a DocumentOwnershipField class. */
2763
+ type Options = DataFieldOptions<Record<string, DOCUMENT_OWNERSHIP_LEVELS>>;
2764
+
2765
+ /** The type of the default options for the {@link DocumentOwnershipField} class. */
2766
+ type DefaultOptions = SimpleMerge<
2767
+ ObjectField.DefaultOptions,
2768
+ {
2769
+ initial: Record<string, DOCUMENT_OWNERSHIP_LEVELS>;
2770
+ validationError: "is not a mapping of user IDs and document permission levels";
2771
+ }
2772
+ >;
2773
+
2774
+ /**
2775
+ * A helper type for the given options type merged into the default options of the ObjectField class.
2776
+ * @typeParam Opts - the options that override the default options
2777
+ */
2778
+ type MergedOptions<Opts extends Options> = SimpleMerge<DefaultOptions, Opts>;
2779
+
2780
+ /**
2781
+ * A shorthand for the assignment type of a ObjectField class.
2782
+ * @typeParam Opts - the options that override the default options
2783
+ */
2784
+ type AssignmentType<Opts extends Options> = DataField.DerivedAssignmentType<
2785
+ Record<string, DOCUMENT_OWNERSHIP_LEVELS>,
2786
+ MergedOptions<Opts>
2787
+ >;
2788
+
2789
+ /**
2790
+ * A shorthand for the initialized type of a ObjectField class.
2791
+ * @typeParam Opts - the options that override the default options
2792
+ */
2793
+ type InitializedType<Opts extends Options> = DataField.DerivedInitializedType<
2794
+ Record<string, DOCUMENT_OWNERSHIP_LEVELS>,
2795
+ MergedOptions<Opts>
2796
+ >;
2797
+ }
2798
+
2799
+ /**
2800
+ * A special [StringField]{@link StringField} which contains serialized JSON data.
2801
+ * @typeParam Options - the options of the JSONField instance
2802
+ * @typeParam AssignmentType - the type of the allowed assignment values of the JSONField
2803
+ * @typeParam InitializedType - the type of the initialized values of the JSONField
2804
+ * @typeParam PersistedType - the type of the persisted values of the JSONField
2805
+ * @remarks
2806
+ * Defaults:
2807
+ * AssignmentType: `string | null | undefined`
2808
+ * InitializedType: `object | undefined`
2809
+ * PersistedType: `string | undefined`
2810
+ * InitialValue: `undefined`
2811
+ */
2812
+ declare class JSONField<
2813
+ Options extends StringFieldOptions = JSONField.DefaultOptions,
2814
+ AssignmentType = JSONField.AssignmentType<Options>,
2815
+ InitializedType = JSONField.InitializedType<Options>,
2816
+ PersistedType extends string | null | undefined = JSONField.PersistedType<Options>,
2817
+ > extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
2818
+ /** @defaultValue `false` */
2819
+ override blank: boolean;
2820
+
2821
+ /** @defaultValue `undefined` */
2822
+ override initial: DataFieldOptions.InitialType<InitializedType>;
2823
+
2824
+ /** @defaultValue `"is not a valid JSON string"` */
2825
+ override validationError: string;
2826
+
2827
+ protected static override get _defaults(): StringFieldOptions;
2828
+
2829
+ override clean(value: AssignmentType, options?: DataField.CleanOptions): InitializedType;
2830
+
2831
+ protected override _validateType(
2832
+ value: InitializedType,
2833
+ options?: DataField.ValidationOptions<DataField.Any>,
2834
+ ): boolean | DataModelValidationFailure | void;
2835
+
2836
+ override initialize(
2837
+ value: PersistedType,
2838
+ model: DataModel.Any,
2839
+ options?: AnyObject,
2840
+ ): InitializedType | (() => InitializedType | null);
2841
+
2842
+ override toObject(value: InitializedType): PersistedType;
2843
+ }
2844
+
2845
+ declare namespace JSONField {
2846
+ /** The type of the default options for the {@link JSONField} class. */
2847
+ type DefaultOptions = SimpleMerge<
2848
+ StringField.DefaultOptions,
2849
+ {
2850
+ blank: false;
2851
+ initial: undefined;
2852
+ validationError: "is not a valid JSON string";
2853
+ }
2854
+ >;
2855
+
2856
+ /**
2857
+ * A helper type for the given options type merged into the default options of the JSONField class.
2858
+ * @typeParam Options - the options that override the default options
2859
+ */
2860
+ type MergedOptions<Options extends StringFieldOptions> = SimpleMerge<DefaultOptions, Options>;
2861
+
2862
+ /**
2863
+ * A shorthand for the assignment type of a JSONField class.
2864
+ * @typeParam Options - the options that override the default options
2865
+ */
2866
+ type AssignmentType<Options extends StringFieldOptions> = DataField.DerivedAssignmentType<
2867
+ string,
2868
+ MergedOptions<Options>
2869
+ >;
2870
+
2871
+ /**
2872
+ * A shorthand for the initialized type of a JSONField class.
2873
+ * @typeParam Options - the options that override the default options
2874
+ */
2875
+ type InitializedType<Options extends StringFieldOptions> = DataField.DerivedInitializedType<
2876
+ AnyObject,
2877
+ MergedOptions<Options>
2878
+ >;
2879
+
2880
+ /**
2881
+ * A shorthand for the persisted type of a JSONField class.
2882
+ * @typeParam Options - the options that override the default options
2883
+ */
2884
+ type PersistedType<Options extends StringFieldOptions> = DataField.DerivedInitializedType<
2885
+ string,
2886
+ MergedOptions<Options>
2887
+ >;
2888
+ }
2889
+
2890
+ /**
2891
+ * A subclass of [StringField]{@link StringField} which contains a sanitized HTML string.
2892
+ * This class does not override any StringField behaviors, but is used by the server-side to identify fields which
2893
+ * require sanitization of user input.
2894
+ * @typeParam Options - the options of the HTMLField instance
2895
+ * @typeParam AssignmentType - the type of the allowed assignment values of the HTMLField
2896
+ * @typeParam InitializedType - the type of the initialized values of the HTMLField
2897
+ * @typeParam PersistedType - the type of the persisted values of the HTMLField
2898
+ * @remarks
2899
+ * Defaults:
2900
+ * AssignmentType: `string | null | undefined`
2901
+ * InitializedType: `string`
2902
+ * PersistedType: `string`
2903
+ * InitialValue: `""`
2904
+ */
2905
+ declare class HTMLField<
2906
+ Options extends StringFieldOptions = HTMLField.DefaultOptions,
2907
+ AssignmentType = HTMLField.AssignmentType<Options>,
2908
+ InitializedType = HTMLField.InitializedType<Options>,
2909
+ PersistedType extends string | null | undefined = HTMLField.InitializedType<Options>,
2910
+ > extends StringField<Options, AssignmentType, InitializedType, PersistedType> {
2911
+ /** @defaultValue `true` */
2912
+ override required: boolean;
2913
+
2914
+ /** @defaultValue `true` */
2915
+ override blank: boolean;
2916
+
2917
+ protected static override get _defaults(): StringFieldOptions;
2918
+ }
2919
+
2920
+ declare namespace HTMLField {
2921
+ /** The type of the default options for the {@link HTMLField} class. */
2922
+ type DefaultOptions = SimpleMerge<
2923
+ StringField.DefaultOptions,
2924
+ {
2925
+ required: true;
2926
+ blank: true;
2927
+ }
2928
+ >;
2929
+
2930
+ /**
2931
+ * A helper type for the given options type merged into the default options of the HTMLField class.
2932
+ * @typeParam Options - the options that override the default options
2933
+ */
2934
+ type MergedOptions<Options extends StringFieldOptions> = SimpleMerge<DefaultOptions, Options>;
2935
+
2936
+ /**
2937
+ * A shorthand for the assignment type of a HTMLField class.
2938
+ * @typeParam Options - the options that override the default options
2939
+ */
2940
+ type AssignmentType<Options extends StringFieldOptions> = DataField.DerivedAssignmentType<
2941
+ string,
2942
+ MergedOptions<Options>
2943
+ >;
2944
+
2945
+ /**
2946
+ * A shorthand for the initialized type of a HTMLField class.
2947
+ * @typeParam Options - the options that override the default options
2948
+ */
2949
+ type InitializedType<Options extends StringFieldOptions> = DataField.DerivedInitializedType<
2950
+ string,
2951
+ MergedOptions<Options>
2952
+ >;
2953
+ }
2954
+
2955
+ /**
2956
+ * A subclass of {@link NumberField} which is used for storing integer sort keys.
2957
+ * @typeParam Options - the options of the IntegerSortField instance
2958
+ * @typeParam AssignmentType - the type of the allowed assignment values of the IntegerSortField
2959
+ * @typeParam InitializedType - the type of the initialized values of the IntegerSortField
2960
+ * @typeParam PersistedType - the type of the persisted values of the IntegerSortField
2961
+ * @remarks
2962
+ * Defaults:
2963
+ * AssignmentType: `number | null | undefined`
2964
+ * InitializedType: `number`
2965
+ * PersistedType: `number`
2966
+ * InitialValue: `0`
2967
+ */
2968
+ declare class IntegerSortField<
2969
+ Options extends NumberFieldOptions = IntegerSortField.DefaultOptions,
2970
+ AssignmentType = IntegerSortField.AssignmentType<Options>,
2971
+ InitializedType = IntegerSortField.InitializedType<Options>,
2972
+ PersistedType extends number | null | undefined = IntegerSortField.InitializedType<Options>,
2973
+ > extends NumberField<Options, AssignmentType, InitializedType, PersistedType> {
2974
+ /** @defaultValue `true` */
2975
+ override required: boolean;
2976
+
2977
+ /** @defaultValue `false` */
2978
+ override nullable: boolean;
2979
+
2980
+ /** @defaultValue `true` */
2981
+ override integer: boolean;
2982
+
2983
+ /** @defaultValue `0` */
2984
+ override initial: DataFieldOptions.InitialType<InitializedType>;
2985
+
2986
+ /** @defaultValue `"FOLDER.DocumentSort"` */
2987
+ override label: string;
2988
+
2989
+ /** @defaultValue `"FOLDER.DocumentSortHint"` */
2990
+ override hint: string;
2991
+ }
2992
+
2993
+ declare namespace IntegerSortField {
2994
+ /** The type of the default options for the {@link IntegerSortField} class. */
2995
+ type DefaultOptions = SimpleMerge<
2996
+ DataField.DefaultOptions,
2997
+ {
2998
+ required: true;
2999
+ nullable: false;
3000
+ integer: true;
3001
+ initial: 0;
3002
+ label: "FOLDER.DocumentSort";
3003
+ hint: "FOLDER.DocumentSortHint";
3004
+ }
3005
+ >;
3006
+
3007
+ /**
3008
+ * A helper type for the given options type merged into the default options of the IntegerSortField class.
3009
+ * @typeParam Options - the options that override the default options
3010
+ */
3011
+ type MergedOptions<Options extends NumberFieldOptions> = SimpleMerge<DefaultOptions, Options>;
3012
+
3013
+ /**
3014
+ * A shorthand for the assignment type of a IntegerSortField class.
3015
+ * @typeParam Options - the options that override the default options
3016
+ */
3017
+ type AssignmentType<Options extends NumberFieldOptions> = DataField.DerivedAssignmentType<
3018
+ number,
3019
+ MergedOptions<Options>
3020
+ >;
3021
+
3022
+ /**
3023
+ * A shorthand for the initialized type of a IntegerSortField class.
3024
+ * @typeParam Options - the options that override the default options
3025
+ */
3026
+ type InitializedType<Options extends NumberFieldOptions> = DataField.DerivedInitializedType<
3027
+ number,
3028
+ MergedOptions<Options>
3029
+ >;
3030
+ }
3031
+
3032
+ declare global {
3033
+ type DocumentStats = DocumentStatsField.Properties;
3034
+ }
3035
+
3036
+ /**
3037
+ * A subclass of {@link SchemaField} which stores document metadata in the _stats field.
3038
+ * @typeParam Options - the options of the DocumentStatsField instance
3039
+ * @typeParam AssignmentType - the type of the allowed assignment values of the DocumentStatsField
3040
+ * @typeParam InitializedType - the type of the initialized values of the DocumentStatsField
3041
+ * @typeParam PersistedType - the type of the persisted values of the DocumentStatsField
3042
+ * @remarks
3043
+ * Defaults:
3044
+ * AssignmentType: `Partial<DocumentStats> | null | undefined`
3045
+ * InitializedType: `DocumentStats`
3046
+ * PersistedType: `object`
3047
+ * InitialValue:
3048
+ * ```typescript
3049
+ * {
3050
+ * systemId: null,
3051
+ * systemVersion: null,
3052
+ * coreVersion: null,
3053
+ * createdTime: null,
3054
+ * modifiedTime: null,
3055
+ * lastModifiedBy: null
3056
+ * }
3057
+ * ```
3058
+ */
3059
+ declare class DocumentStatsField<
3060
+ Options extends DocumentStatsField.Options = DocumentStatsField.DefaultOptions,
3061
+ AssignmentType = DocumentStatsField.AssignmentType<Options>,
3062
+ InitializedType = DocumentStatsField.InitializedType<Options>,
3063
+ PersistedType extends AnyObject | null | undefined = DocumentStatsField.PersistedType<Options>,
3064
+ > extends SchemaField<DocumentStatsField.Schema, Options, AssignmentType, InitializedType, PersistedType> {
3065
+ constructor(options?: Options);
3066
+ }
3067
+
3068
+ declare namespace DocumentStatsField {
3069
+ /** A shorthand for the options of a DocumentStatsField class. */
3070
+ type Options = DataFieldOptions<SchemaField.InnerAssignmentType<Schema>>;
3071
+
3072
+ /** The type of the default options for the {@link DocumentStatsField} class. */
3073
+ type DefaultOptions = SimpleMerge<SchemaField.DefaultOptions, { initial: SchemaField.InnerAssignmentType<Schema> }>;
3074
+
3075
+ /**
3076
+ * A helper type for the given options type merged into the default options of the {@link DocumentStatsField} class.
3077
+ * @typeParam Opts - the options that override the default options
3078
+ */
3079
+ type MergedOptions<Opts extends Options> = SimpleMerge<DefaultOptions, Opts>;
3080
+
3081
+ /**
3082
+ * A shorthand for the assignment type of a DocumentStatsField class.
3083
+ * @typeParam Opts - the options that override the default options
3084
+ */
3085
+ type AssignmentType<Opts extends Options = DefaultOptions> = DataField.DerivedAssignmentType<
3086
+ SchemaField.InnerAssignmentType<Schema>,
3087
+ MergedOptions<Opts>
3088
+ >;
3089
+
3090
+ /**
3091
+ * A shorthand for the assignment type of a DocumentStatsField class.
3092
+ * @typeParam Opts - the options that override the default options
3093
+ */
3094
+ type InitializedType<Opts extends Options = DefaultOptions> = DataField.DerivedInitializedType<
3095
+ SchemaField.InnerInitializedType<Schema>,
3096
+ MergedOptions<Opts>
3097
+ >;
3098
+
3099
+ /**
3100
+ * A shorthand for the assignment type of a DocumentStatsField class.
3101
+ * @typeParam Opts - the options that override the default options
3102
+ */
3103
+ type PersistedType<Opts extends Options = DefaultOptions> = DataField.DerivedInitializedType<
3104
+ SchemaField.InnerPersistedType<Schema>,
3105
+ MergedOptions<Opts>
3106
+ >;
3107
+
3108
+ type ConstructorData = SchemaField.InnerConstructorType<Schema>;
3109
+ type Properties = SchemaField.InnerInitializedType<Schema>;
3110
+ type Source = SchemaField.InnerPersistedType<Schema>;
3111
+
3112
+ interface Schema extends DataSchema {
3113
+ /**
3114
+ * The package name of the system the Document was created in.
3115
+ * @defaultValue `null`
3116
+ */
3117
+ systemId: StringField<{ required: true; blank: false; nullable: true; initial: null }>;
3118
+
3119
+ /**
3120
+ * The version of the system the Document was created in.
3121
+ * @defaultValue `null`
3122
+ */
3123
+ systemVersion: StringField<{ required: true; blank: false; nullable: true; initial: null }>;
3124
+
3125
+ /**
3126
+ * The core version the Document was created in.
3127
+ * @defaultValue `null`
3128
+ */
3129
+ coreVersion: StringField<{ required: true; blank: false; nullable: true; initial: null }>;
3130
+
3131
+ /**
3132
+ * A timestamp of when the Document was created.
3133
+ * @defaultValue `null`
3134
+ */
3135
+ createdTime: NumberField;
3136
+
3137
+ /**
3138
+ * A timestamp of when the Document was last modified.
3139
+ * @defaultValue `null`
3140
+ */
3141
+ modifiedTime: NumberField;
3142
+
3143
+ /**
3144
+ * The ID of the user who last modified the Document.
3145
+ * @defaultValue `null`
3146
+ */
3147
+ lastModifiedBy: ForeignDocumentField<foundry.documents.BaseUser, { idOnly: true }>;
3148
+ }
3149
+ }
3150
+
3151
+ /**
3152
+ * A subclass of [ObjectField]{@link ObjectField} which supports a type-specific data object.
3153
+ * @typeParam DocumentType - the type of the embedded Document
3154
+ * @typeParam Options - the options of the TypeDataField instance
3155
+ * @typeParam AssignmentType - the type of the allowed assignment values of the TypeDataField
3156
+ * @typeParam InitializedType - the type of the initialized values of the TypeDataField
3157
+ * @typeParam PersistedType - the type of the persisted values of the TypeDataField
3158
+ * @remarks
3159
+ * Defaults:
3160
+ * AssignmentType: `SchemaField.AssignmentType<DocumentType["schema"]["fields"]> | null | undefined`
3161
+ * InitializedType: `SchemaField.InitializedType<DocumentType["schema"]["fields"]>`
3162
+ * PersistedType: `SchemaField.PersistedType<DocumentType["schema"]["fields"]>`
3163
+ * InitialValue: `{}`
3164
+ */
3165
+ declare class TypeDataField<
3166
+ const SystemDocument extends Document.SystemConstructor,
3167
+ const Options extends TypeDataField.Options<InstanceType<SystemDocument>> = TypeDataField.DefaultOptions,
3168
+ const AssignmentType = TypeDataField.AssignmentType<SystemDocument, Options>,
3169
+ const InitializedType = TypeDataField.InitializedType<SystemDocument, Options>,
3170
+ const PersistedType extends AnyObject | null | undefined = TypeDataField.PersistedType<SystemDocument, Options>,
3171
+ > extends ObjectField<Options, AssignmentType, InitializedType, PersistedType> {
3172
+ /**
3173
+ * @param document - The base document class which belongs in this field
3174
+ * @param options - Options which configure the behavior of the field
3175
+ */
3176
+ constructor(document: ConstructorOf<SystemDocument>, options?: Options);
3177
+
3178
+ /** @defaultValue `true` */
3179
+ override required: boolean;
3180
+
3181
+ /**
3182
+ * The canonical document name of the document type which belongs in this field
3183
+ */
3184
+ document: ConstructorOf<SystemDocument>;
3185
+
3186
+ protected static override get _defaults(): TypeDataField.Options<Document.Any>;
3187
+
3188
+ /** @defaultValue `true` */
3189
+ static override recursive: boolean;
3190
+
3191
+ /**
3192
+ * Return the package that provides the sub-type for the given model.
3193
+ * @param model - The model instance created for this sub-type.
3194
+ */
3195
+ static getModelProvider(model: DataModel.Any): System | Module | null;
3196
+
3197
+ /**
3198
+ * A convenience accessor for the name of the document type associated with this TypeDataField
3199
+ */
3200
+ get documentName(): string;
3201
+
3202
+ /**
3203
+ * Get the DataModel definition that should be used for this type of document.
3204
+ * @param type - The Document instance type
3205
+ * @returns The DataModel class or null
3206
+ */
3207
+ getModelForType(type: string): ConstructorOf<DataModel.Any> | null;
3208
+
3209
+ override getInitialValue(data: { type?: string }): InitializedType;
3210
+
3211
+ protected override _cleanType(value: InitializedType, options?: DataField.CleanOptions): InitializedType;
3212
+
3213
+ override initialize(
3214
+ value: PersistedType,
3215
+ model: DataModel.Any,
3216
+ options?: AnyObject,
3217
+ ): InitializedType | (() => InitializedType | null);
3218
+
3219
+ protected override _validateType(
3220
+ value: InitializedType,
3221
+ options?: DataField.ValidationOptions<DataField.Any>,
3222
+ ): boolean | DataModelValidationFailure | void;
3223
+
3224
+ protected override _validateModel(data: AnyObject, options?: AnyObject): void;
3225
+
3226
+ override toObject(value: InitializedType): PersistedType;
3227
+
3228
+ /**
3229
+ * Migrate this field's candidate source data.
3230
+ * @param sourceData - Candidate source data of the root model
3231
+ * @param fieldData - The value of this field within the source data
3232
+ */
3233
+ migrateSource(sourceData: AnyObject, fieldData: unknown): unknown;
3234
+ }
3235
+
3236
+ declare namespace TypeDataField {
3237
+ /**
3238
+ * A shorthand for the options of a TypeDataField class.
3239
+ * @typeParam DocumentType - the type of the embedded Document
3240
+ */
3241
+ type Options<DocumentType extends Document.Any> = DataFieldOptions<
3242
+ SchemaField.InnerAssignmentType<DataModel.SchemaFor<DocumentType>>
3243
+ >;
3244
+
3245
+ /** The type of the default options for the {@link TypeDataField} class. */
3246
+ type DefaultOptions = SimpleMerge<
3247
+ ObjectField.DefaultOptions,
3248
+ {
3249
+ required: true;
3250
+ }
3251
+ >;
3252
+
3253
+ /**
3254
+ * A helper type for the given options type merged into the default options of the TypeDataField class.
3255
+ * @typeParam DocumentType - the type of the embedded Document
3256
+ * @typeParam Options - the options that override the default options
3257
+ */
3258
+ type MergedOptions<DocumentType extends Document.Any, Opts extends Options<DocumentType>> = SimpleMerge<
3259
+ DefaultOptions,
3260
+ Opts
3261
+ >;
3262
+
3263
+ /**
3264
+ * Get the system DataModel configuration for a specific document type.
3265
+ * @typeParam DocumentType - the type of the Document this system data is for
3266
+ */
3267
+ type Config<DocumentType extends Document.SystemConstructor> =
3268
+ DocumentType["metadata"]["name"] extends keyof DataModelConfig
3269
+ ? DataModelConfig[DocumentType["metadata"]["name"]]
3270
+ : EmptyObject;
3271
+
3272
+ /**
3273
+ * Get the configured core and system type names for a specific document type.
3274
+ * @typeParam DocumentType - the type of the Document this data is for
3275
+ */
3276
+ type TypeNames<DocumentType extends Document.SystemConstructor> =
3277
+ | CoreTypeNames<DocumentType>
3278
+ | SystemTypeNames<DocumentType>;
3279
+
3280
+ /**
3281
+ * Get the core type names for a specific document type.
3282
+ * @typeParam DocumentType - the type of the Document this data is for
3283
+ */
3284
+ type CoreTypeNames<DocumentType extends Document.SystemConstructor> =
3285
+ DocumentType["metadata"]["coreTypes"] extends string[]
3286
+ ? DocumentType["metadata"]["coreTypes"][number] | "base"
3287
+ : "base";
3288
+
3289
+ /**
3290
+ * Get the configured system type names for a specific document type.
3291
+ * @typeParam DocumentType - the type of the Document this system data is for
3292
+ */
3293
+ // The `& string` is helpful even though there should never be any numeric/symbol keys.
3294
+ // This is because when `keyof Config<...>` is deferred then TypeScript does a bunch of proofs under the assumption that `SystemTypeNames` could be a `string | number` until proven otherwise.
3295
+ // This causes issues where there shouldn't be, for example it has been observed to obstruct the resolution of the `Actor` class.
3296
+ type SystemTypeNames<DocumentType extends Document.SystemConstructor> = keyof Config<DocumentType> & string;
3297
+
3298
+ /**
3299
+ * A shorthand for the assignment type of a TypeDataField class.
3300
+ * @typeParam DocumentType - the type of the embedded Document
3301
+ * @typeParam Options - the options that override the default options
3302
+ */
3303
+ type AssignmentType<
3304
+ SystemDocumentConstructor extends Document.SystemConstructor,
3305
+ Opts extends Options<InstanceType<SystemDocumentConstructor>>,
3306
+ > = DataField.DerivedAssignmentType<AnyObject, MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>>;
3307
+
3308
+ /**
3309
+ * A shorthand for the initialized type of a TypeDataField class.
3310
+ * @typeParam DocumentType - the type of the embedded Document
3311
+ * @typeParam Options - the options that override the default options
3312
+ */
3313
+ type InitializedType<
3314
+ SystemDocumentConstructor extends Document.SystemConstructor,
3315
+ Opts extends Options<InstanceType<SystemDocumentConstructor>>,
3316
+ > = DataField.DerivedInitializedType<
3317
+ ValueOf<Config<SystemDocumentConstructor>> | AnyObject,
3318
+ MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>
3319
+ >;
3320
+
3321
+ /**
3322
+ * A shorthand for the persisted type of a TypeDataField class.
3323
+ * @typeParam DocumentType - the type of the embedded Document
3324
+ * @typeParam Opts - the options that override the default options
3325
+ */
3326
+ type PersistedType<
3327
+ SystemDocumentConstructor extends Document.SystemConstructor,
3328
+ Opts extends Options<InstanceType<SystemDocumentConstructor>>,
3329
+ > = DataField.DerivedInitializedType<AnyObject, MergedOptions<InstanceType<SystemDocumentConstructor>, Opts>>;
3330
+ }
3331
+
3332
+ /**
3333
+ * @deprecated since v11; ModelValidationError is deprecated. Please use DataModelValidationError instead.
3334
+ * @typeParam Errors - the type of the errors contained in this error
3335
+ */
3336
+ declare class ModelValidationError<
3337
+ Errors extends ModelValidationError.Errors = ModelValidationError.Errors,
3338
+ > extends Error {
3339
+ /**
3340
+ * @deprecated since v11; ModelValidationError is deprecated. Please use DataModelValidationError instead.
3341
+ * @param errors - An array or object containing several errors.
3342
+ */
3343
+ constructor(errors: Errors);
3344
+
3345
+ errors: Errors;
3346
+
3347
+ /**
3348
+ * Collect all the errors into a single message for consumers who do not handle the ModelValidationError specially.
3349
+ * @param errors - The raw error structure
3350
+ * @returns A formatted error message
3351
+ */
3352
+ static formatErrors(errors: ModelValidationError.Errors): string;
3353
+ }
3354
+
3355
+ declare namespace ModelValidationError {
3356
+ /**
3357
+ * @deprecated since v11; ModelValidationError is deprecated. Please use DataModelValidationError instead.
3358
+ */
3359
+ type Errors = Record<number | string | symbol, Error> | Error[] | string;
3360
+ }
3361
+
3362
+ export {
3363
+ AlphaField,
3364
+ AngleField,
3365
+ ArrayField,
3366
+ BooleanField,
3367
+ ColorField,
3368
+ DataField,
3369
+ DocumentIdField,
3370
+ DocumentOwnershipField,
3371
+ DocumentStatsField,
3372
+ EmbeddedCollectionDeltaField,
3373
+ EmbeddedCollectionField,
3374
+ EmbeddedDataField,
3375
+ EmbeddedDocumentField,
3376
+ FilePathField,
3377
+ ForeignDocumentField,
3378
+ HTMLField,
3379
+ IntegerSortField,
3380
+ JSONField,
3381
+ ModelValidationError,
3382
+ NumberField,
3383
+ ObjectField,
3384
+ SchemaField,
3385
+ SetField,
3386
+ StringField,
3387
+ TypeDataField,
3388
+ };