@league-of-foundry-developers/foundry-vtt-types 12.331.2-beta → 12.331.4-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 (560) hide show
  1. package/README.md +17 -18
  2. package/package.json +73 -32
  3. package/src/configuration/configuration.d.mts +316 -0
  4. package/src/configuration/documents.d.mts +295 -0
  5. package/src/configuration/globals.d.mts +357 -0
  6. package/src/configuration/index.d.mts +5 -0
  7. package/src/foundry/client/apps/app.d.mts +129 -122
  8. package/src/foundry/client/apps/av/av-config.d.mts +12 -7
  9. package/src/foundry/client/apps/av/cameras.d.mts +12 -7
  10. package/src/foundry/client/apps/dice/dice-config.d.mts +59 -0
  11. package/src/foundry/client/apps/dice/index.d.mts +1 -0
  12. package/src/foundry/client/apps/form.d.mts +114 -86
  13. package/src/foundry/client/apps/forms/actor.d.mts +21 -11
  14. package/src/foundry/client/apps/forms/adventure-exporter.d.mts +12 -7
  15. package/src/foundry/client/apps/forms/adventure-importer.d.mts +14 -6
  16. package/src/foundry/client/apps/forms/base-sheet.d.mts +16 -8
  17. package/src/foundry/client/apps/forms/card-config.d.mts +16 -8
  18. package/src/foundry/client/apps/forms/cards-config.d.mts +15 -14
  19. package/src/foundry/client/apps/forms/combat-config.d.mts +7 -7
  20. package/src/foundry/client/apps/forms/combatant-config.d.mts +3 -3
  21. package/src/foundry/client/apps/forms/default-sheets-config.d.mts +1 -1
  22. package/src/foundry/client/apps/forms/effect-config.d.mts +7 -7
  23. package/src/foundry/client/apps/forms/folder-config.d.mts +5 -5
  24. package/src/foundry/client/apps/forms/fonts.d.mts +42 -35
  25. package/src/foundry/client/apps/forms/grid-config.d.mts +12 -17
  26. package/src/foundry/client/apps/forms/image-popout.d.mts +29 -23
  27. package/src/foundry/client/apps/forms/item.d.mts +9 -9
  28. package/src/foundry/client/apps/forms/journal-page-sheet.d.mts +16 -14
  29. package/src/foundry/client/apps/forms/journal-sheet.d.mts +48 -38
  30. package/src/foundry/client/apps/forms/macro-config.d.mts +7 -7
  31. package/src/foundry/client/apps/forms/measure-template.d.mts +10 -12
  32. package/src/foundry/client/apps/forms/ownership.d.mts +5 -5
  33. package/src/foundry/client/apps/forms/playlist-config.d.mts +8 -10
  34. package/src/foundry/client/apps/forms/playlist-sound-config.d.mts +7 -7
  35. package/src/foundry/client/apps/forms/roll-table-config.d.mts +11 -10
  36. package/src/foundry/client/apps/forms/scene-config.d.mts +40 -41
  37. package/src/foundry/client/apps/forms/sheet-config.d.mts +9 -21
  38. package/src/foundry/client/apps/forms/user-config.d.mts +13 -12
  39. package/src/foundry/client/apps/hud/chatbubble.d.mts +18 -6
  40. package/src/foundry/client/apps/hud/container.d.mts +4 -4
  41. package/src/foundry/client/apps/hud/controls.d.mts +126 -81
  42. package/src/foundry/client/apps/hud/hotbar.d.mts +17 -12
  43. package/src/foundry/client/apps/hud/hud.d.mts +5 -5
  44. package/src/foundry/client/apps/hud/menu.d.mts +10 -3
  45. package/src/foundry/client/apps/hud/navigation.d.mts +14 -9
  46. package/src/foundry/client/apps/hud/pause.d.mts +9 -4
  47. package/src/foundry/client/apps/hud/players.d.mts +14 -9
  48. package/src/foundry/client/apps/i18n.d.mts +34 -27
  49. package/src/foundry/client/apps/index.d.mts +1 -0
  50. package/src/foundry/client/apps/placeables/drawing-config.d.mts +41 -33
  51. package/src/foundry/client/apps/placeables/drawing-hud.d.mts +5 -5
  52. package/src/foundry/client/apps/placeables/index.d.mts +0 -2
  53. package/src/foundry/client/apps/placeables/note-config.d.mts +28 -18
  54. package/src/foundry/client/apps/placeables/tile-config.d.mts +23 -10
  55. package/src/foundry/client/apps/placeables/tile-hud.d.mts +10 -5
  56. package/src/foundry/client/apps/placeables/token-config.d.mts +91 -58
  57. package/src/foundry/client/apps/placeables/token-hud.d.mts +12 -7
  58. package/src/foundry/client/apps/placeables/wall-config.d.mts +21 -17
  59. package/src/foundry/client/apps/sidebar/apps/chat-popout.d.mts +5 -5
  60. package/src/foundry/client/apps/sidebar/apps/client-settings.d.mts +3 -3
  61. package/src/foundry/client/apps/sidebar/apps/compendium.d.mts +15 -13
  62. package/src/foundry/client/apps/sidebar/apps/invitation-links.d.mts +3 -3
  63. package/src/foundry/client/apps/sidebar/apps/keybindings-config.d.mts +3 -2
  64. package/src/foundry/client/apps/sidebar/apps/module-management.d.mts +6 -6
  65. package/src/foundry/client/apps/sidebar/apps/permission-config.d.mts +6 -6
  66. package/src/foundry/client/apps/sidebar/apps/support-details.d.mts +34 -29
  67. package/src/foundry/client/apps/sidebar/apps/tours-management.d.mts +2 -2
  68. package/src/foundry/client/apps/sidebar/apps/world-config.d.mts +13 -10
  69. package/src/foundry/client/apps/sidebar/directory-tab-mixin.d.mts +50 -35
  70. package/src/foundry/client/apps/sidebar/document-directory.d.mts +52 -38
  71. package/src/foundry/client/apps/sidebar/package-configuration.d.mts +4 -4
  72. package/src/foundry/client/apps/sidebar/sidebar-tab.d.mts +3 -3
  73. package/src/foundry/client/apps/sidebar/sidebar.d.mts +9 -4
  74. package/src/foundry/client/apps/sidebar/tabs/actors-directory.d.mts +11 -2
  75. package/src/foundry/client/apps/sidebar/tabs/cards-directory.d.mts +11 -2
  76. package/src/foundry/client/apps/sidebar/tabs/chat-log.d.mts +39 -27
  77. package/src/foundry/client/apps/sidebar/tabs/combat-tracker.d.mts +21 -12
  78. package/src/foundry/client/apps/sidebar/tabs/compendium-directory.d.mts +30 -15
  79. package/src/foundry/client/apps/sidebar/tabs/items-directory.d.mts +11 -2
  80. package/src/foundry/client/apps/sidebar/tabs/journal-directory.d.mts +11 -2
  81. package/src/foundry/client/apps/sidebar/tabs/macros-directory.d.mts +14 -5
  82. package/src/foundry/client/apps/sidebar/tabs/playlists-directory.d.mts +30 -22
  83. package/src/foundry/client/apps/sidebar/tabs/roll-table-directory.d.mts +11 -2
  84. package/src/foundry/client/apps/sidebar/tabs/scenes-directory.d.mts +14 -5
  85. package/src/foundry/client/apps/sidebar/tabs/settings.d.mts +23 -5
  86. package/src/foundry/client/apps/templates.d.mts +6 -2
  87. package/src/foundry/client/av/client.d.mts +1 -1
  88. package/src/foundry/client/av/clients/simplepeer.d.mts +11 -1
  89. package/src/foundry/client/av/master.d.mts +2 -2
  90. package/src/foundry/client/av/settings.d.mts +17 -15
  91. package/src/foundry/client/config.d.mts +444 -314
  92. package/src/foundry/client/core/document-index.d.mts +11 -3
  93. package/src/foundry/client/core/hooks.d.mts +2 -4
  94. package/src/foundry/client/core/image.d.mts +92 -42
  95. package/src/foundry/client/core/issues.d.mts +9 -4
  96. package/src/foundry/client/core/keybindings.d.mts +5 -5
  97. package/src/foundry/client/core/nue.d.mts +1 -1
  98. package/src/foundry/client/core/packages.d.mts +397 -61
  99. package/src/foundry/client/core/settings.d.mts +62 -38
  100. package/src/foundry/client/core/socket.d.mts +2 -2
  101. package/src/foundry/client/core/sorting.d.mts +6 -6
  102. package/src/foundry/client/core/time.d.mts +6 -3
  103. package/src/foundry/client/core/tooltip.d.mts +2 -2
  104. package/src/foundry/client/core/tour.d.mts +59 -50
  105. package/src/foundry/client/core/tours.d.mts +1 -1
  106. package/src/foundry/client/core/utils.d.mts +33 -10
  107. package/src/foundry/client/core/video.d.mts +1 -1
  108. package/src/foundry/client/core/workers.d.mts +24 -17
  109. package/src/foundry/client/data/abstract/canvas-document.d.mts +21 -17
  110. package/src/foundry/client/data/abstract/client-document.d.mts +153 -183
  111. package/src/foundry/client/data/abstract/directory-collection-mixin.d.mts +23 -39
  112. package/src/foundry/client/data/abstract/document-collection.d.mts +96 -68
  113. package/src/foundry/client/data/abstract/world-collection.d.mts +48 -56
  114. package/src/foundry/client/data/collections/actors.d.mts +30 -28
  115. package/src/foundry/client/data/collections/cards.d.mts +16 -3
  116. package/src/foundry/client/data/collections/combats.d.mts +18 -5
  117. package/src/foundry/client/data/collections/compendium-collection.d.mts +85 -101
  118. package/src/foundry/client/data/collections/compendium-folders.d.mts +6 -6
  119. package/src/foundry/client/data/collections/compendium-packs.d.mts +6 -6
  120. package/src/foundry/client/data/collections/fog.d.mts +16 -3
  121. package/src/foundry/client/data/collections/folder.d.mts +20 -6
  122. package/src/foundry/client/data/collections/items.d.mts +17 -4
  123. package/src/foundry/client/data/collections/journal.d.mts +22 -7
  124. package/src/foundry/client/data/collections/macros.d.mts +21 -19
  125. package/src/foundry/client/data/collections/messages.d.mts +19 -6
  126. package/src/foundry/client/data/collections/playlists.d.mts +17 -5
  127. package/src/foundry/client/data/collections/scenes.d.mts +24 -27
  128. package/src/foundry/client/data/collections/settings.d.mts +16 -3
  129. package/src/foundry/client/data/collections/tables.d.mts +18 -5
  130. package/src/foundry/client/data/collections/users.d.mts +19 -7
  131. package/src/foundry/client/data/documents/active-effect.d.mts +677 -85
  132. package/src/foundry/client/data/documents/actor-delta.d.mts +670 -27
  133. package/src/foundry/client/data/documents/actor.d.mts +718 -55
  134. package/src/foundry/client/data/documents/adventure.d.mts +480 -46
  135. package/src/foundry/client/data/documents/ambient-light.d.mts +423 -19
  136. package/src/foundry/client/data/documents/ambient-sound.d.mts +473 -14
  137. package/src/foundry/client/data/documents/card.d.mts +567 -36
  138. package/src/foundry/client/data/documents/cards.d.mts +744 -85
  139. package/src/foundry/client/data/documents/chat-message.d.mts +574 -42
  140. package/src/foundry/client/data/documents/combat.d.mts +699 -69
  141. package/src/foundry/client/data/documents/combatant.d.mts +504 -24
  142. package/src/foundry/client/data/documents/drawing.d.mts +540 -14
  143. package/src/foundry/client/data/documents/fog-exploration.d.mts +416 -21
  144. package/src/foundry/client/data/documents/folder.d.mts +468 -30
  145. package/src/foundry/client/data/documents/index.d.mts +2 -0
  146. package/src/foundry/client/data/documents/item.d.mts +677 -20
  147. package/src/foundry/client/data/documents/journal-entry-page.d.mts +585 -19
  148. package/src/foundry/client/data/documents/journal-entry.d.mts +619 -18
  149. package/src/foundry/client/data/documents/macro.d.mts +528 -25
  150. package/src/foundry/client/data/documents/measured-template.d.mts +478 -14
  151. package/src/foundry/client/data/documents/note.d.mts +491 -15
  152. package/src/foundry/client/data/documents/playlist-sound.d.mts +426 -24
  153. package/src/foundry/client/data/documents/playlist.d.mts +665 -74
  154. package/src/foundry/client/data/documents/region-behavior.d.mts +507 -0
  155. package/src/foundry/client/data/documents/region.d.mts +784 -0
  156. package/src/foundry/client/data/documents/scene.d.mts +983 -140
  157. package/src/foundry/client/data/documents/setting.d.mts +395 -13
  158. package/src/foundry/client/data/documents/table-result.d.mts +476 -14
  159. package/src/foundry/client/data/documents/table.d.mts +661 -78
  160. package/src/foundry/client/data/documents/tile.d.mts +499 -14
  161. package/src/foundry/client/data/documents/token.d.mts +1110 -97
  162. package/src/foundry/client/data/documents/user.d.mts +493 -25
  163. package/src/foundry/client/data/documents/wall.d.mts +548 -14
  164. package/src/foundry/client/game.d.mts +62 -89
  165. package/src/foundry/client/head.d.mts +9 -9
  166. package/src/foundry/client/hooks.d.mts +257 -237
  167. package/src/foundry/client/pixi/board.d.mts +111 -104
  168. package/src/foundry/client/pixi/core/containers/base-canvas-group.d.mts +97 -25
  169. package/src/foundry/client/pixi/core/containers/cached-container.d.mts +37 -19
  170. package/src/foundry/client/pixi/core/containers/full-canvas-container.d.mts +7 -10
  171. package/src/foundry/client/pixi/core/containers/point-source-mesh.d.mts +25 -15
  172. package/src/foundry/client/pixi/core/containers/quad-mesh.d.mts +16 -6
  173. package/src/foundry/client/pixi/core/containers/quadtree.d.mts +113 -54
  174. package/src/foundry/client/pixi/core/containers/sprite-mesh.d.mts +69 -26
  175. package/src/foundry/client/pixi/core/containers/unbound-container.d.mts +20 -2
  176. package/src/foundry/client/pixi/core/interaction/canvas-animation.d.mts +164 -99
  177. package/src/foundry/client/pixi/core/interaction/control-icon.d.mts +61 -22
  178. package/src/foundry/client/pixi/core/interaction/mouse-handler.d.mts +120 -53
  179. package/src/foundry/client/pixi/core/interaction/ping.d.mts +62 -31
  180. package/src/foundry/client/pixi/core/interaction/pings/chevron.d.mts +23 -10
  181. package/src/foundry/client/pixi/core/interaction/pings/pulse.d.mts +91 -34
  182. package/src/foundry/client/pixi/core/interaction/render-flags.d.mts +76 -31
  183. package/src/foundry/client/pixi/core/interaction/resize-handle.d.mts +35 -5
  184. package/src/foundry/client/pixi/core/interaction/targets.d.mts +21 -18
  185. package/src/foundry/client/pixi/core/loader.d.mts +86 -76
  186. package/src/foundry/client/pixi/core/shapes/limited-angle-polygon.d.mts +42 -17
  187. package/src/foundry/client/pixi/core/shapes/polygon-mesher.d.mts +92 -64
  188. package/src/foundry/client/pixi/core/shapes/precise-text.d.mts +28 -10
  189. package/src/foundry/client/pixi/core/shapes/ray.d.mts +47 -23
  190. package/src/foundry/client/pixi/core/shapes/source-polygon.d.mts +170 -75
  191. package/src/foundry/client/pixi/extensions/circle.d.mts +133 -122
  192. package/src/foundry/client/pixi/extensions/graphics.d.mts +3 -1
  193. package/src/foundry/client/pixi/extensions/observable-transform.d.mts +10 -2
  194. package/src/foundry/client/pixi/extensions/polygon.d.mts +155 -134
  195. package/src/foundry/client/pixi/extensions/rectangle.d.mts +266 -240
  196. package/src/foundry/client/pixi/groups/effects.d.mts +75 -24
  197. package/src/foundry/client/pixi/groups/environment.d.mts +68 -19
  198. package/src/foundry/client/pixi/groups/hidden.d.mts +27 -11
  199. package/src/foundry/client/pixi/groups/interface.d.mts +62 -38
  200. package/src/foundry/client/pixi/groups/overlay.d.mts +19 -7
  201. package/src/foundry/client/pixi/groups/primary.d.mts +66 -44
  202. package/src/foundry/client/pixi/groups/rendered.d.mts +19 -7
  203. package/src/foundry/client/pixi/layers/base/canvas-layer.d.mts +11 -15
  204. package/src/foundry/client/pixi/layers/base/interaction-layer.d.mts +29 -28
  205. package/src/foundry/client/pixi/layers/base/placeables-layer.d.mts +306 -272
  206. package/src/foundry/client/pixi/layers/controls/cursor.d.mts +18 -9
  207. package/src/foundry/client/pixi/layers/controls/door.d.mts +32 -11
  208. package/src/foundry/client/pixi/layers/controls/layer.d.mts +89 -77
  209. package/src/foundry/client/pixi/layers/controls/ruler.d.mts +121 -96
  210. package/src/foundry/client/pixi/layers/effects/background-effects.d.mts +9 -12
  211. package/src/foundry/client/pixi/layers/effects/coloration-effects.d.mts +9 -10
  212. package/src/foundry/client/pixi/layers/effects/darkness-effects.d.mts +8 -8
  213. package/src/foundry/client/pixi/layers/effects/illumination-effects.d.mts +22 -22
  214. package/src/foundry/client/pixi/layers/effects/visibility.d.mts +106 -86
  215. package/src/foundry/client/pixi/layers/effects/weather/particles/effect.d.mts +14 -5
  216. package/src/foundry/client/pixi/layers/effects/weather/particles/leaves.d.mts +31 -2
  217. package/src/foundry/client/pixi/layers/effects/weather-effects.d.mts +137 -65
  218. package/src/foundry/client/pixi/layers/grid/highlight.d.mts +14 -4
  219. package/src/foundry/client/pixi/layers/grid/layer.d.mts +92 -92
  220. package/src/foundry/client/pixi/layers/grid/mesh.d.mts +37 -16
  221. package/src/foundry/client/pixi/layers/masks/depth.d.mts +12 -7
  222. package/src/foundry/client/pixi/layers/masks/occlusion.d.mts +19 -12
  223. package/src/foundry/client/pixi/layers/masks/vision.d.mts +104 -18
  224. package/src/foundry/client/pixi/layers/placeables/drawings.d.mts +16 -15
  225. package/src/foundry/client/pixi/layers/placeables/index.d.mts +1 -0
  226. package/src/foundry/client/pixi/layers/placeables/lighting.d.mts +12 -14
  227. package/src/foundry/client/pixi/layers/placeables/notes.d.mts +49 -32
  228. package/src/foundry/client/pixi/layers/placeables/regions.d.mts +113 -0
  229. package/src/foundry/client/pixi/layers/placeables/sounds.d.mts +81 -67
  230. package/src/foundry/client/pixi/layers/placeables/templates.d.mts +11 -15
  231. package/src/foundry/client/pixi/layers/placeables/tiles.d.mts +30 -21
  232. package/src/foundry/client/pixi/layers/placeables/tokens.d.mts +66 -52
  233. package/src/foundry/client/pixi/layers/placeables/walls.d.mts +54 -57
  234. package/src/foundry/client/pixi/perception/clockwise-sweep.d.mts +62 -27
  235. package/src/foundry/client/pixi/perception/detection-mode.d.mts +121 -47
  236. package/src/foundry/client/pixi/perception/fog.d.mts +38 -15
  237. package/src/foundry/client/pixi/perception/perception-manager.d.mts +136 -136
  238. package/src/foundry/client/pixi/perception/vision-mode.d.mts +108 -66
  239. package/src/foundry/client/pixi/perception/weiler-atherton-clipping.d.mts +77 -39
  240. package/src/foundry/client/pixi/placeable.d.mts +238 -137
  241. package/src/foundry/client/pixi/placeables/drawing.d.mts +255 -133
  242. package/src/foundry/client/pixi/placeables/index.d.mts +1 -0
  243. package/src/foundry/client/pixi/placeables/light.d.mts +199 -64
  244. package/src/foundry/client/pixi/placeables/note.d.mts +145 -54
  245. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-canvas-object.d.mts +30 -8
  246. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-graphics.d.mts +41 -11
  247. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-occludable-object.d.mts +59 -18
  248. package/src/foundry/client/pixi/placeables/primary-canvas-objects/primary-sprite-mesh.d.mts +120 -37
  249. package/src/foundry/client/pixi/placeables/region.d.mts +280 -0
  250. package/src/foundry/client/pixi/placeables/sound.d.mts +205 -66
  251. package/src/foundry/client/pixi/placeables/template.d.mts +181 -99
  252. package/src/foundry/client/pixi/placeables/tile.d.mts +206 -140
  253. package/src/foundry/client/pixi/placeables/token.d.mts +916 -448
  254. package/src/foundry/client/pixi/placeables/wall.d.mts +249 -129
  255. package/src/foundry/client/pixi/webgl/extensions/batch-renderer.d.mts +72 -33
  256. package/src/foundry/client/pixi/webgl/extensions/batch-shader-generator.d.mts +10 -9
  257. package/src/foundry/client/pixi/webgl/helpers/{framebugger-snapshot.d.mts → framebuffer-snapshot.d.mts} +10 -9
  258. package/src/foundry/client/pixi/webgl/helpers/index.d.mts +1 -1
  259. package/src/foundry/client/pixi/webgl/helpers/smooth-noise.d.mts +38 -23
  260. package/src/foundry/client/pixi/webgl/helpers/texture-extractor.d.mts +82 -53
  261. package/src/foundry/client/pixi/webgl/shaders/base-shader-mixin.d.mts +12 -12
  262. package/src/foundry/client/pixi/webgl/shaders/base-shader.d.mts +45 -28
  263. package/src/foundry/client/pixi/webgl/shaders/filters/base-filter.d.mts +12 -11
  264. package/src/foundry/client/pixi/webgl/shaders/filters/base-mask-filter.d.mts +12 -10
  265. package/src/foundry/client/pixi/webgl/shaders/filters/blur.d.mts +22 -20
  266. package/src/foundry/client/pixi/webgl/shaders/filters/effects-masking.d.mts +36 -32
  267. package/src/foundry/client/pixi/webgl/shaders/filters/environment.d.mts +10 -9
  268. package/src/foundry/client/pixi/webgl/shaders/filters/glow-overlay.d.mts +12 -11
  269. package/src/foundry/client/pixi/webgl/shaders/filters/invisibility.d.mts +10 -9
  270. package/src/foundry/client/pixi/webgl/shaders/filters/outline-overlay.d.mts +12 -11
  271. package/src/foundry/client/pixi/webgl/shaders/filters/transition.d.mts +67 -60
  272. package/src/foundry/client/pixi/webgl/shaders/filters/visibility.d.mts +24 -17
  273. package/src/foundry/client/pixi/webgl/shaders/filters/vision-mask-filter.d.mts +13 -10
  274. package/src/foundry/client/pixi/webgl/shaders/filters/void.d.mts +10 -9
  275. package/src/foundry/client/pixi/webgl/shaders/filters/weather-occlusion-masks.d.mts +11 -10
  276. package/src/foundry/client/pixi/webgl/shaders/fragment-channel-mixin.d.mts +20 -14
  277. package/src/foundry/client/pixi/webgl/shaders/grid/grid.d.mts +12 -11
  278. package/src/foundry/client/pixi/webgl/shaders/lighting/background-lighting.d.mts +10 -9
  279. package/src/foundry/client/pixi/webgl/shaders/lighting/base-lighting.d.mts +33 -33
  280. package/src/foundry/client/pixi/webgl/shaders/lighting/coloration-lighting.d.mts +10 -9
  281. package/src/foundry/client/pixi/webgl/shaders/lighting/darkness-lighting.d.mts +10 -9
  282. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/bewitching-wave.d.mts +19 -17
  283. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/black-hole.d.mts +10 -9
  284. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/chroma.d.mts +10 -9
  285. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/emanation.d.mts +10 -9
  286. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/energy-field.d.mts +10 -9
  287. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/fairy-light.d.mts +19 -17
  288. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/flame.d.mts +19 -17
  289. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/fog.d.mts +10 -9
  290. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/force-grid.d.mts +10 -8
  291. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/ghost-light.d.mts +19 -17
  292. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/hexa-dome.d.mts +10 -9
  293. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/light-dome.d.mts +10 -9
  294. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/magical-gloom.d.mts +10 -9
  295. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/pulse.d.mts +19 -17
  296. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/radial-rainbow.d.mts +10 -9
  297. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/revolving-light.d.mts +10 -9
  298. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/roiling-mass.d.mts +10 -9
  299. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/siren-light.d.mts +19 -17
  300. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/smoke-patch.d.mts +20 -17
  301. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/star-light.d.mts +10 -9
  302. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/sunburst.d.mts +19 -17
  303. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/swirling-rainbow.d.mts +10 -9
  304. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/torch.d.mts +19 -17
  305. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/vortex.d.mts +19 -17
  306. package/src/foundry/client/pixi/webgl/shaders/lighting/effects/wave.d.mts +19 -17
  307. package/src/foundry/client/pixi/webgl/shaders/lighting/illumination-lighting.d.mts +10 -9
  308. package/src/foundry/client/pixi/webgl/shaders/region/adjust-darkness-level.d.mts +71 -29
  309. package/src/foundry/client/pixi/webgl/shaders/region/base.d.mts +54 -10
  310. package/src/foundry/client/pixi/webgl/shaders/region/highlight.d.mts +69 -9
  311. package/src/foundry/client/pixi/webgl/shaders/samplers/base-sampler.d.mts +24 -25
  312. package/src/foundry/client/pixi/webgl/shaders/samplers/baseline-illumination.d.mts +10 -9
  313. package/src/foundry/client/pixi/webgl/shaders/samplers/color-adjustment.d.mts +38 -29
  314. package/src/foundry/client/pixi/webgl/shaders/samplers/depth.d.mts +21 -17
  315. package/src/foundry/client/pixi/webgl/shaders/samplers/fog-of-war.d.mts +10 -9
  316. package/src/foundry/client/pixi/webgl/shaders/samplers/occlusion.d.mts +20 -18
  317. package/src/foundry/client/pixi/webgl/shaders/samplers/primary.d.mts +11 -2
  318. package/src/foundry/client/pixi/webgl/shaders/samplers/token-ring.d.mts +28 -2
  319. package/src/foundry/client/pixi/webgl/shaders/vision/background-vision.d.mts +10 -9
  320. package/src/foundry/client/pixi/webgl/shaders/vision/base-vision.d.mts +11 -9
  321. package/src/foundry/client/pixi/webgl/shaders/vision/coloration-vision.d.mts +10 -9
  322. package/src/foundry/client/pixi/webgl/shaders/vision/effects/amplification.d.mts +10 -9
  323. package/src/foundry/client/pixi/webgl/shaders/vision/effects/wave.d.mts +19 -17
  324. package/src/foundry/client/pixi/webgl/shaders/vision/illumination-vision.d.mts +10 -9
  325. package/src/foundry/client/pixi/webgl/shaders/weather/base-weather.d.mts +40 -36
  326. package/src/foundry/client/pixi/webgl/shaders/weather/effect.d.mts +27 -33
  327. package/src/foundry/client/pixi/webgl/shaders/weather/fog.d.mts +17 -16
  328. package/src/foundry/client/pixi/webgl/shaders/weather/rain.d.mts +19 -18
  329. package/src/foundry/client/pixi/webgl/shaders/weather/snow.d.mts +15 -14
  330. package/src/foundry/client/pixi/workers/texture-worker.d.mts +33 -53
  331. package/src/foundry/client/tours/setup-tour.d.mts +15 -10
  332. package/src/foundry/client/ui/context.d.mts +48 -40
  333. package/src/foundry/client/ui/dialog.d.mts +137 -126
  334. package/src/foundry/client/ui/drag.d.mts +1 -1
  335. package/src/foundry/client/ui/dragdrop.d.mts +34 -28
  336. package/src/foundry/client/ui/editor.d.mts +29 -21
  337. package/src/foundry/client/ui/filepicker.d.mts +43 -38
  338. package/src/foundry/client/ui/filter.d.mts +62 -50
  339. package/src/foundry/client/ui/forms.d.mts +22 -22
  340. package/src/foundry/client/ui/notifications.d.mts +10 -3
  341. package/src/foundry/client/ui/prosemirror.d.mts +15 -7
  342. package/src/foundry/client/ui/secrets.d.mts +42 -27
  343. package/src/foundry/client/ui/tabs.d.mts +40 -33
  344. package/src/foundry/client-esm/applications/_module.d.mts +3 -3
  345. package/src/foundry/client-esm/applications/_types.d.mts +0 -2
  346. package/src/foundry/client-esm/applications/api/_module.d.mts +2 -2
  347. package/src/foundry/client-esm/applications/api/application.d.mts +51 -39
  348. package/src/foundry/client-esm/applications/api/dialog.d.mts +20 -22
  349. package/src/foundry/client-esm/applications/api/document-sheet.d.mts +26 -12
  350. package/src/foundry/client-esm/applications/api/handlebars-application.d.mts +142 -126
  351. package/src/foundry/client-esm/applications/apps/_module.d.mts +2 -2
  352. package/src/foundry/client-esm/applications/apps/compendium-art-config.d.mts +10 -10
  353. package/src/foundry/client-esm/applications/apps/permission-config.d.mts +3 -3
  354. package/src/foundry/client-esm/applications/dice/_module.d.mts +2 -2
  355. package/src/foundry/client-esm/applications/dice/roll-resolver.d.mts +14 -2
  356. package/src/foundry/client-esm/applications/elements/_module.d.mts +2 -2
  357. package/src/foundry/client-esm/applications/elements/document-tags.d.mts +2 -0
  358. package/src/foundry/client-esm/applications/elements/file-picker.d.mts +1 -1
  359. package/src/foundry/client-esm/applications/elements/multi-select.d.mts +15 -5
  360. package/src/foundry/client-esm/applications/elements/string-tags.d.mts +1 -1
  361. package/src/foundry/client-esm/applications/forms/fields.d.mts +6 -1
  362. package/src/foundry/client-esm/applications/sheets/_module.d.mts +2 -2
  363. package/src/foundry/client-esm/applications/sheets/actor-sheet.d.mts +3 -3
  364. package/src/foundry/client-esm/applications/sheets/ambient-light-config.d.mts +16 -11
  365. package/src/foundry/client-esm/applications/sheets/ambient-sound-config.d.mts +9 -7
  366. package/src/foundry/client-esm/applications/sheets/item-sheet.d.mts +3 -3
  367. package/src/foundry/client-esm/applications/sheets/region-behavior-config.d.mts +30 -5
  368. package/src/foundry/client-esm/applications/sheets/region-config.d.mts +36 -5
  369. package/src/foundry/client-esm/applications/sheets/user-config.d.mts +8 -7
  370. package/src/foundry/client-esm/applications/ui/_module.d.mts +2 -2
  371. package/src/foundry/client-esm/applications/ui/region-legend.d.mts +45 -3
  372. package/src/foundry/client-esm/audio/_module.d.mts +2 -3
  373. package/src/foundry/client-esm/audio/_types.d.mts +3 -1
  374. package/src/foundry/client-esm/audio/biquad.d.mts +76 -26
  375. package/src/foundry/client-esm/audio/cache.d.mts +31 -20
  376. package/src/foundry/client-esm/audio/convolver.d.mts +47 -25
  377. package/src/foundry/client-esm/audio/helper.d.mts +123 -78
  378. package/src/foundry/client-esm/audio/sound.d.mts +230 -126
  379. package/src/foundry/client-esm/audio/timeout.d.mts +30 -11
  380. package/src/foundry/client-esm/canvas/_module.d.mts +2 -2
  381. package/src/foundry/client-esm/canvas/edges/_module.d.mts +2 -2
  382. package/src/foundry/client-esm/canvas/edges/collision.d.mts +69 -18
  383. package/src/foundry/client-esm/canvas/edges/edge.d.mts +110 -41
  384. package/src/foundry/client-esm/canvas/edges/edges.d.mts +10 -0
  385. package/src/foundry/client-esm/canvas/edges/vertex.d.mts +56 -26
  386. package/src/foundry/client-esm/canvas/regions/_module.d.mts +2 -3
  387. package/src/foundry/client-esm/canvas/regions/geometry.d.mts +38 -0
  388. package/src/foundry/client-esm/canvas/regions/mesh.d.mts +72 -0
  389. package/src/foundry/client-esm/canvas/regions/polygon-tree.d.mts +130 -0
  390. package/src/foundry/client-esm/canvas/regions/shape.d.mts +129 -0
  391. package/src/foundry/client-esm/canvas/scene-manager.d.mts +16 -6
  392. package/src/foundry/client-esm/canvas/smaa/blend.d.mts +14 -3
  393. package/src/foundry/client-esm/canvas/smaa/edges.d.mts +25 -3
  394. package/src/foundry/client-esm/canvas/smaa/smaa.d.mts +121 -23
  395. package/src/foundry/client-esm/canvas/smaa/weights.d.mts +26 -3
  396. package/src/foundry/client-esm/canvas/sources/_module.d.mts +2 -2
  397. package/src/foundry/client-esm/canvas/sources/base-effect-source.d.mts +84 -40
  398. package/src/foundry/client-esm/canvas/sources/base-light-source.d.mts +103 -39
  399. package/src/foundry/client-esm/canvas/sources/global-light-source.d.mts +89 -15
  400. package/src/foundry/client-esm/canvas/sources/point-darkness-source.d.mts +71 -30
  401. package/src/foundry/client-esm/canvas/sources/point-effect-source.d.mts +49 -20
  402. package/src/foundry/client-esm/canvas/sources/point-light-source.d.mts +57 -16
  403. package/src/foundry/client-esm/canvas/sources/point-movement-source.d.mts +31 -4
  404. package/src/foundry/client-esm/canvas/sources/point-sound-source.d.mts +45 -12
  405. package/src/foundry/client-esm/canvas/sources/point-vision-source.d.mts +98 -52
  406. package/src/foundry/client-esm/canvas/sources/rendered-effect-source.d.mts +180 -69
  407. package/src/foundry/client-esm/canvas/tokens/_module.d.mts +2 -3
  408. package/src/foundry/client-esm/canvas/tokens/ring-config.d.mts +174 -2
  409. package/src/foundry/client-esm/canvas/tokens/ring-data.d.mts +141 -2
  410. package/src/foundry/client-esm/canvas/tokens/ring.d.mts +284 -2
  411. package/src/foundry/client-esm/client.d.mts +47 -54
  412. package/src/foundry/client-esm/data/_module.d.mts +2 -2
  413. package/src/foundry/client-esm/data/client-backend.d.mts +22 -23
  414. package/src/foundry/client-esm/data/region-behaviors/_module.d.mts +3 -3
  415. package/src/foundry/client-esm/data/region-behaviors/adjust-darkness-level.d.mts +57 -0
  416. package/src/foundry/client-esm/data/region-behaviors/base.d.mts +59 -0
  417. package/src/foundry/client-esm/data/region-behaviors/display-scrolling-text.d.mts +64 -0
  418. package/src/foundry/client-esm/data/region-behaviors/execute-macro.d.mts +27 -0
  419. package/src/foundry/client-esm/data/region-behaviors/execute-script.d.mts +23 -0
  420. package/src/foundry/client-esm/data/region-behaviors/pause-game.d.mts +23 -0
  421. package/src/foundry/client-esm/data/region-behaviors/suppress-weather.d.mts +17 -0
  422. package/src/foundry/client-esm/data/region-behaviors/teleport-token.d.mts +32 -0
  423. package/src/foundry/client-esm/data/region-behaviors/toggle-behavior.d.mts +31 -0
  424. package/src/foundry/client-esm/dice/_module.d.mts +2 -3
  425. package/src/foundry/client-esm/dice/parser.d.mts +11 -25
  426. package/src/foundry/client-esm/dice/roll.d.mts +115 -89
  427. package/src/foundry/client-esm/dice/terms/_module.d.mts +2 -3
  428. package/src/foundry/client-esm/dice/terms/coin.d.mts +8 -5
  429. package/src/foundry/client-esm/dice/terms/dice.d.mts +93 -63
  430. package/src/foundry/client-esm/dice/terms/die.d.mts +11 -4
  431. package/src/foundry/client-esm/dice/terms/fate.d.mts +9 -2
  432. package/src/foundry/client-esm/dice/terms/function.d.mts +18 -18
  433. package/src/foundry/client-esm/dice/terms/numeric.d.mts +3 -5
  434. package/src/foundry/client-esm/dice/terms/operator.d.mts +2 -2
  435. package/src/foundry/client-esm/dice/terms/parenthetical.d.mts +9 -10
  436. package/src/foundry/client-esm/dice/terms/pool.d.mts +25 -31
  437. package/src/foundry/client-esm/dice/terms/string.d.mts +4 -4
  438. package/src/foundry/client-esm/dice/terms/term.d.mts +18 -4
  439. package/src/foundry/client-esm/dice/twister.d.mts +3 -3
  440. package/src/foundry/client-esm/helpers/_module.d.mts +2 -2
  441. package/src/foundry/client-esm/helpers/_types.d.mts +12 -46
  442. package/src/foundry/client-esm/helpers/compendium-art.d.mts +56 -4
  443. package/src/foundry/common/abstract/_types.d.mts +60 -54
  444. package/src/foundry/common/abstract/backend.d.mts +51 -45
  445. package/src/foundry/common/abstract/data.d.mts +140 -154
  446. package/src/foundry/common/abstract/document.d.mts +1305 -421
  447. package/src/foundry/common/abstract/embedded-collection-delta.d.mts +1 -1
  448. package/src/foundry/common/abstract/embedded-collection.d.mts +37 -7
  449. package/src/foundry/common/abstract/module.d.mts +3 -2
  450. package/src/foundry/common/abstract/singleton-collection.d.mts +1 -1
  451. package/src/foundry/common/abstract/socket.d.mts +1 -1
  452. package/src/foundry/common/abstract/type-data.d.mts +62 -54
  453. package/src/foundry/common/config.d.mts +5 -3
  454. package/src/foundry/common/constants.d.mts +261 -231
  455. package/src/foundry/common/data/data.d.mts +200 -94
  456. package/src/foundry/common/data/fields.d.mts +746 -585
  457. package/src/foundry/common/data/module.d.mts +2 -2
  458. package/src/foundry/common/data/validation-failure.d.mts +12 -9
  459. package/src/foundry/common/documents/_module.d.mts +4 -2
  460. package/src/foundry/common/documents/_types.d.mts +22 -50
  461. package/src/foundry/common/documents/active-effect.d.mts +280 -177
  462. package/src/foundry/common/documents/actor-delta.d.mts +318 -69
  463. package/src/foundry/common/documents/actor.d.mts +305 -117
  464. package/src/foundry/common/documents/adventure.d.mts +266 -141
  465. package/src/foundry/common/documents/ambient-light.d.mts +268 -75
  466. package/src/foundry/common/documents/ambient-sound.d.mts +268 -109
  467. package/src/foundry/common/documents/card.d.mts +267 -174
  468. package/src/foundry/common/documents/cards.d.mts +299 -126
  469. package/src/foundry/common/documents/chat-message.d.mts +276 -158
  470. package/src/foundry/common/documents/combat.d.mts +300 -89
  471. package/src/foundry/common/documents/combatant.d.mts +275 -88
  472. package/src/foundry/common/documents/drawing.d.mts +286 -206
  473. package/src/foundry/common/documents/fog-exploration.d.mts +258 -70
  474. package/src/foundry/common/documents/folder.d.mts +252 -81
  475. package/src/foundry/common/documents/item.d.mts +305 -99
  476. package/src/foundry/common/documents/journal-entry-page.d.mts +279 -189
  477. package/src/foundry/common/documents/journal-entry.d.mts +294 -68
  478. package/src/foundry/common/documents/macro.d.mts +254 -132
  479. package/src/foundry/common/documents/measured-template.d.mts +293 -139
  480. package/src/foundry/common/documents/note.d.mts +274 -149
  481. package/src/foundry/common/documents/playlist-sound.d.mts +260 -94
  482. package/src/foundry/common/documents/playlist.d.mts +279 -120
  483. package/src/foundry/common/documents/region-behavior.d.mts +329 -0
  484. package/src/foundry/common/documents/region.d.mts +327 -0
  485. package/src/foundry/common/documents/roll-table.d.mts +286 -102
  486. package/src/foundry/common/documents/scene.d.mts +276 -336
  487. package/src/foundry/common/documents/setting.d.mts +229 -54
  488. package/src/foundry/common/documents/table-result.d.mts +267 -96
  489. package/src/foundry/common/documents/tile.d.mts +301 -170
  490. package/src/foundry/common/documents/token.d.mts +351 -445
  491. package/src/foundry/common/documents/user.d.mts +256 -144
  492. package/src/foundry/common/documents/wall.d.mts +273 -161
  493. package/src/foundry/common/grid/_module.d.mts +3 -3
  494. package/src/foundry/common/grid/base.d.mts +66 -49
  495. package/src/foundry/common/grid/gridless.d.mts +2 -2
  496. package/src/foundry/common/grid/hexagonal.d.mts +40 -29
  497. package/src/foundry/common/grid/square.d.mts +3 -3
  498. package/src/foundry/common/packages/base-module.d.mts +6 -24
  499. package/src/foundry/common/packages/base-package.d.mts +23 -21
  500. package/src/foundry/common/packages/base-system.d.mts +6 -63
  501. package/src/foundry/common/packages/base-world.d.mts +8 -61
  502. package/src/foundry/common/packages/module.d.mts +7 -7
  503. package/src/foundry/common/packages/sub-types.d.mts +2 -2
  504. package/src/foundry/common/primitives/array.d.mts +4 -4
  505. package/src/foundry/common/primitives/math.d.mts +7 -1
  506. package/src/foundry/common/primitives/number.d.mts +2 -2
  507. package/src/foundry/common/primitives/set.d.mts +17 -14
  508. package/src/foundry/common/primitives/string.d.mts +1 -1
  509. package/src/foundry/common/prosemirror/_module.d.mts +15 -15
  510. package/src/foundry/common/prosemirror/dirty-plugin.d.mts +1 -1
  511. package/src/foundry/common/prosemirror/dom-parser.d.mts +2 -1
  512. package/src/foundry/common/prosemirror/dropdown.d.mts +1 -1
  513. package/src/foundry/common/prosemirror/highlight-matches-plugin.d.mts +2 -2
  514. package/src/foundry/common/prosemirror/image-plugin.d.mts +1 -1
  515. package/src/foundry/common/prosemirror/menu.d.mts +3 -3
  516. package/src/foundry/common/prosemirror/paste-transformer.d.mts +1 -1
  517. package/src/foundry/common/prosemirror/plugin.d.mts +2 -2
  518. package/src/foundry/common/prosemirror/schema/index.d.mts +0 -1
  519. package/src/foundry/common/prosemirror/schema/lists.d.mts +2 -0
  520. package/src/foundry/common/prosemirror/util.d.mts +1 -1
  521. package/src/foundry/common/types.d.mts +3 -3
  522. package/src/foundry/common/utils/bitmask.d.mts +23 -11
  523. package/src/foundry/common/utils/collection.d.mts +61 -38
  524. package/src/foundry/common/utils/color.d.mts +20 -2
  525. package/src/foundry/common/utils/event-emitter.d.mts +32 -17
  526. package/src/foundry/common/utils/geometry.d.mts +12 -2
  527. package/src/foundry/common/utils/helpers.d.mts +36 -26
  528. package/src/foundry/common/utils/http.d.mts +2 -2
  529. package/src/foundry/common/utils/module.d.mts +2 -2
  530. package/src/foundry/common/utils/string-tree.d.mts +45 -39
  531. package/src/foundry/common/utils/word-tree.d.mts +10 -23
  532. package/src/foundry/index.d.mts +0 -1
  533. package/src/foundry/{clipper → public/scripts/clipper}/clipper.d.mts +52 -43
  534. package/src/foundry/public/scripts/index.d.mts +1 -0
  535. package/src/foundry/public/scripts/workers/image-compressor.d.mts +23 -0
  536. package/src/foundry/public/scripts/workers/index.d.mts +1 -0
  537. package/{index-lenient.d.mts → src/index-lenient.d.mts} +2 -0
  538. package/src/index.d.mts +6 -0
  539. package/src/tsconfig.json +15 -0
  540. package/src/types/augments/particles.d.mts +29 -0
  541. package/src/types/augments/pixi.d.mts +1024 -21
  542. package/src/types/augments/smooth.d.mts +31 -0
  543. package/src/types/augments/tinyMCE.d.mts +1 -1
  544. package/src/types/config.d.mts +20 -311
  545. package/src/types/documentConfiguration.d.mts +286 -542
  546. package/src/types/index.d.mts +1 -1
  547. package/src/types/lib.d.mts +12 -0
  548. package/src/types/workers/image-compressor.d.mts +176 -0
  549. package/src/utils/index.d.mts +1279 -0
  550. package/tsconfig.json +29 -0
  551. package/tsconfig.main.json +8 -0
  552. package/tsconfig.miscellaneous.json +16 -0
  553. package/index.d.mts +0 -5
  554. package/src/foundry/client/apps/placeables/light-config.d.mts +0 -100
  555. package/src/foundry/client/apps/placeables/sound-config.d.mts +0 -43
  556. package/src/foundry/common/documents/module.d.mts +0 -35
  557. package/src/foundry/common/primitives/regex.d.mts +0 -12
  558. package/src/types/helperTypes.d.mts +0 -389
  559. package/src/types/utils.d.mts +0 -520
  560. /package/src/foundry/{clipper → public/scripts/clipper}/index.d.mts +0 -0
@@ -1,340 +1,172 @@
1
- import type { RequiredProps } from "../../../../types/utils.d.mts";
1
+ import type {
2
+ Coalesce,
3
+ DeepPartial,
4
+ FixedInstanceType,
5
+ HandleEmptyObject,
6
+ InexactPartial,
7
+ IntentionalPartial,
8
+ NullishProps,
9
+ RequiredProps,
10
+ } from "fvtt-types/utils";
2
11
  import type { ConfiguredObjectClassOrDefault } from "../../config.d.mts";
12
+ import BaseToken = foundry.documents.BaseToken;
13
+ import sources = foundry.canvas.sources;
3
14
 
4
15
  declare global {
5
- namespace Token {
6
- type ConfiguredClass = ConfiguredObjectClassOrDefault<typeof Token>;
7
- type ConfiguredInstance = InstanceType<ConfiguredClass>;
8
-
9
- interface RenderFlags extends PlaceableObject.RenderFlags {
10
- redrawEffects: boolean;
11
-
12
- refreshSize: boolean;
13
-
14
- refreshPosition: boolean;
15
-
16
- refreshElevation: boolean;
17
-
18
- refreshVisibility: boolean;
19
-
20
- refreshEffects: boolean;
21
-
22
- refreshMesh: boolean;
23
-
24
- refreshShader: boolean;
25
-
26
- refreshBars: boolean;
27
-
28
- refreshNameplate: boolean;
29
-
30
- refreshBorder: boolean;
31
-
32
- refreshTarget: boolean;
33
- }
34
-
35
- interface ReticuleOptions {
36
- /**
37
- * The amount of margin between the targeting arrows and the token's bounding box, expressed as a fraction of an arrow's size.
38
- * @defaultValue `0`
39
- */
40
- margin?: number;
41
-
42
- /**
43
- * The alpha value of the arrows.
44
- * @defaultValue `1`
45
- */
46
- alpha?: number;
47
-
48
- /**
49
- * The size of the arrows as a proportion of grid size.
50
- * @defaultValue `0.15`
51
- */
52
- size?: number;
53
-
54
- /**
55
- * The color of the arrows.
56
- * @defaultValue `0xFF6400`
57
- */
58
- color?: number;
59
-
60
- /** The arrows' border style configuration. */
61
- border?: {
62
- /**
63
- * The border color.
64
- * @defaultValue `0`
65
- */
66
- color?: number;
67
-
68
- /**
69
- * The border width.
70
- * @defaultValue `2`
71
- */
72
- width?: number;
73
- };
74
- }
75
-
76
- type SourceType = "move" | "sight" | "light" | "sound";
77
-
78
- interface Bar {
79
- attribute: string;
80
- }
81
-
82
- interface Velocity {
83
- dx: number;
84
- sx: number;
85
- dy: number;
86
- sy: number;
87
- }
88
-
89
- /** The UI frame container which depicts Token metadata and status, displayed in the ControlsLayer. */
90
- interface ObjectHUD extends globalThis.ObjectHUD {
91
- /** Token health bars */
92
- bars?: PIXI.Container;
93
-
94
- /** Token nameplate */
95
- nameplate?: PreciseText;
96
-
97
- /** Token elevation tooltip */
98
- tooltip?: PreciseText;
99
-
100
- /** Token status effects */
101
- effects?: PIXI.Container;
102
-
103
- /** Token target marker */
104
- target?: PIXI.Graphics;
105
- }
106
-
107
- type InitializedObjectHUD = RequiredProps<ObjectHUD, "bars" | "nameplate" | "tooltip" | "effects" | "target">;
108
-
109
- interface UpdateLightSourceOptions {
110
- /**
111
- * Defer updating perception to manually update it later.
112
- * @defaultValue `false`
113
- */
114
- defer?: boolean | undefined;
115
-
116
- /**
117
- * Indicate that this light source has been deleted.
118
- * @defaultValue `false`
119
- */
120
- deleted?: boolean | undefined;
121
- }
122
-
123
- interface UpdateVisionSourceOptions {
124
- /**
125
- * Defer updating perception to manually update it later.
126
- * @defaultValue `false`
127
- */
128
- defer?: boolean | undefined;
129
-
130
- /**
131
- * Indicate that this vision source has been deleted.
132
- * @defaultValue `false`
133
- */
134
- deleted?: boolean | undefined;
135
- }
136
-
137
- type UpdateSourceOptions = UpdateLightSourceOptions & UpdateVisionSourceOptions;
138
-
139
- interface PlayOptions {
140
- /**
141
- * Should the video loop?
142
- * @defaultValue `true`
143
- */
144
- loop?: boolean | undefined;
145
-
146
- /**
147
- * A specific timestamp between 0 and the video duration to begin playback
148
- * @defaultValue `0`
149
- */
150
- offset?: number | undefined;
151
-
152
- /**
153
- * Desired volume level of the video's audio channel (if any)
154
- * @defaultValue `0`
155
- */
156
- volume?: number | undefined;
157
- }
158
-
159
- interface DrawOverlayOptions {
160
- src?: string | undefined;
161
- tint?: number | undefined;
162
- }
163
-
164
- interface PositionOptions {
165
- /**
166
- * Animate the movement path
167
- * @defaultValue `true`
168
- */
169
- animate?: boolean;
170
-
171
- /**
172
- * Automatically re-center the view if token movement goes off-screen
173
- * @defaultValue `true`
174
- */
175
- recenter?: boolean | undefined;
176
- }
177
-
178
- interface EffectToggleOptions {
179
- /**
180
- * Force a certain active state for the effect
181
- * @defaultValue `false`
182
- */
183
- active?: boolean | undefined;
184
-
185
- /**
186
- * Whether to set the effect as the overlay effect?
187
- * @defaultValue `false`
188
- */
189
- overlay?: boolean | undefined;
190
- }
191
-
192
- interface SetTargetContext {
193
- /**
194
- * Assign the token as a target for a specific User
195
- * @defaultValue `null`
196
- */
197
- user?: User.ConfiguredInstance | null | undefined;
198
-
199
- /**
200
- * Release other active targets for the same player?
201
- * @defaultValue `true`
202
- */
203
- releaseOthers?: boolean | undefined;
204
-
205
- /**
206
- * Is this target being set as part of a group selection workflow?
207
- * @defaultValue `Is this target being set as part of a group selection workflow?`
208
- */
209
- groupSelection?: boolean | undefined;
210
- }
211
-
212
- interface ControlOptions extends PlaceableObject.ControlOptions {
213
- /** @defaultValue `false` */
214
- pan?: boolean;
215
- }
216
- }
217
-
218
16
  /**
219
17
  * A Token is an implementation of PlaceableObject which represents an Actor within a viewed Scene on the game canvas.
220
- * @see TokenDocument
221
- * @see TokenLayer
18
+ * @see {@link TokenDocument | `TokenDocument`}
19
+ * @see {@link TokenLayer | `TokenLayer`}
222
20
  */
223
- class Token extends PlaceableObject<TokenDocument.ConfiguredInstance> {
21
+ class Token extends PlaceableObject<TokenDocument.Implementation> {
224
22
  static override embeddedName: "Token";
225
23
 
226
- static override RENDER_FLAGS: {
227
- /** @defaultValue `{ propagate: ["refresh"] }` */
228
- redraw: RenderFlag<Partial<Token.RenderFlags>>;
229
-
230
- /** @defaultValue `{}` */
231
- redrawEffects: RenderFlag<Partial<Token.RenderFlags>>;
232
-
233
- /** @defaultValue `{ propagate: ["refreshState", "refreshSize", "refreshPosition", "refreshElevation", "refreshBars", "refreshNameplate", "refreshBorder", "refreshShader"], alias: true }` */
234
- refresh: RenderFlag<Partial<Token.RenderFlags>>;
24
+ static override RENDER_FLAGS: Token.RENDER_FLAGS;
235
25
 
236
- /** @defaultValue `{ propagate: ["refreshVisibility", "refreshBorder"] }` */
237
- refreshState: RenderFlag<Partial<Token.RenderFlags>>;
26
+ // Note: This isn't a "real" override but `renderFlags` is set corresponding to the
27
+ // `RENDER_FLAGS` and so it has to be adjusted here.
28
+ renderFlags: RenderFlags<Token.RENDER_FLAGS>;
238
29
 
239
- /** @defaultValue `{ propagate: ["refreshMesh", "refreshBorder", "refreshBars", "refreshPosition", "refreshTarget", "refreshEffects"] }` */
240
- refreshSize: RenderFlag<Partial<Token.RenderFlags>>;
30
+ // fake override; super has to type as if this could be a ControlIcon, but Tokens don't use one
31
+ override controlIcon: null;
241
32
 
242
- /** @defaultValue `{ propagate: ["refreshMesh", "refreshVisibility"] }` */
243
- refreshPosition: RenderFlag<Partial<Token.RenderFlags>>;
244
-
245
- /** @defaultValue `{ propagate: ["refreshMesh"] }` */
246
- refreshElevation: RenderFlag<Partial<Token.RenderFlags>>;
247
-
248
- /** @defaultValue `{}` */
249
- refreshVisibility: RenderFlag<Partial<Token.RenderFlags>>;
33
+ /**
34
+ * The shape of this token.
35
+ * @defaultValue `undefined`
36
+ * @remarks Only `undefined` prior to {@link Token._refreshShape | `Token#_refreshShape`} being called. *
37
+ * @privateRemarks Foundry types this as possibly being `PIXI.Circle` but {@link Token.getShape | `Token#getShape`} only returns `Rectangle` or `Polygon` in v12
38
+ */
39
+ shape: PIXI.Rectangle | PIXI.Polygon | undefined;
250
40
 
251
- /** @defaultValue `{}` */
252
- refreshEffects: RenderFlag<Partial<Token.RenderFlags>>;
41
+ /**
42
+ * Defines the filter to use for detection.
43
+ * @defaultValue `null`
44
+ * @remarks Only set to other-than-`null` externally, in {@link CanvasVisibility.testVisibility | `CanvasVisibility#testVisibility`}
45
+ *
46
+ * Set `null` unconditionally when {@link Token.isVisible | `Token#isVisible`} is accessed
47
+ */
48
+ detectionFilter: PIXI.Filter | null;
253
49
 
254
- /** @defaultValue `{}` */
255
- refreshMesh: RenderFlag<Partial<Token.RenderFlags>>;
50
+ /**
51
+ * A Graphics instance which renders the border frame for this Token inside the GridLayer.
52
+ * @defaultValue `undefined`
53
+ * @remarks Only `undefined` prior to first draw
54
+ * */
55
+ border: PIXI.Graphics | undefined;
256
56
 
257
- /** @defaultValue `{}` */
258
- refreshShader: RenderFlag<Partial<Token.RenderFlags>>;
57
+ /**
58
+ * The attribute bars of this Token.
59
+ * @defaultValue `undefined`
60
+ * @remarks Only `undefined` prior to first draw
61
+ */
62
+ bars: Token.Bars | undefined;
259
63
 
260
- /** @defaultValue `{}` */
261
- refreshBars: RenderFlag<Partial<Token.RenderFlags>>;
64
+ /**
65
+ * The tooltip text of this Token, which contains its elevation.
66
+ * @defaultValue `undefined`
67
+ * @remarks Only `undefined` prior to first draw
68
+ */
69
+ tooltip: PreciseText | undefined;
262
70
 
263
- /** @defaultValue `{}` */
264
- refreshNameplate: RenderFlag<Partial<Token.RenderFlags>>;
71
+ /**
72
+ * The target marker, which indicates that this Token is targeted by this User or others.
73
+ * @defaultValue `undefined`
74
+ * @remarks Only `undefined` prior to first draw
75
+ */
76
+ target: PIXI.Graphics | undefined;
265
77
 
266
- /** @defaultValue `{}` */
267
- refreshBorder: RenderFlag<Partial<Token.RenderFlags>>;
78
+ /**
79
+ * The nameplate of this Token, which displays its name.
80
+ * @defaultValue `undefined`
81
+ * @remarks Only `undefined` prior to first draw
82
+ */
83
+ nameplate: PreciseText | undefined;
268
84
 
269
- /** @defaultValue `{}` */
270
- refreshTarget: RenderFlag<Partial<Token.RenderFlags>>;
271
- };
85
+ /**
86
+ * Track the set of User documents which are currently targeting this Token
87
+ */
88
+ targeted: Set<User.Stored>;
272
89
 
273
90
  /**
274
- * Defines the filter to use for detection.
91
+ * A reference to the SpriteMesh which displays this Token in the PrimaryCanvasGroup.
92
+ * @defaultValue `undefined`
93
+ * @remarks Only `undefined` prior to first draw
275
94
  */
276
- detectionFilter?: PIXI.Filter | null;
95
+ mesh: PrimarySpriteMesh | undefined;
277
96
 
278
97
  /**
279
- * A Graphics instance which renders the border frame for this Token inside the GridLayer.
98
+ * Renders the mesh of this Token with ERASE blending in the Token.
280
99
  * @defaultValue `undefined`
281
- * */
282
- border?: PIXI.Graphics;
100
+ * @remarks Only `undefined` prior to first draw
101
+ * @privateRemarks Foundry types as `PIXI.DisplayObject`, but its only ever set to `PIXI.Container` in v12
102
+ */
103
+ voidMesh: PIXI.Container | undefined;
283
104
 
284
105
  /**
285
- * Track the set of User documents which are currently targeting this Token
106
+ * Renders the mesh of with the detection filter.
107
+ * @defaultValue `undefined`
108
+ * @remarks Only `undefined` prior to first draw
109
+ * @privateRemarks Foundry types as `PIXI.DisplayObject`, but its only ever set to `PIXI.Container` in v12
286
110
  */
287
- targeted: Set<User>;
111
+ detectionFilterMesh: PIXI.Container | undefined;
288
112
 
289
113
  /**
290
- * A reference to the SpriteMesh which displays this Token in the PrimaryCanvasGroup.
114
+ * The texture of this Token, which is used by its mesh.
115
+ * @defaultValue `undefined`
116
+ * @remarks `undefined` prior to first draw or after {@link Token._destroy | `Token#_destroy`} is called
291
117
  */
292
- mesh: PrimarySpriteMesh;
118
+ texture: PIXI.Texture | undefined;
293
119
 
294
120
  /**
295
121
  * A reference to the VisionSource object which defines this vision source area of effect
122
+ * @defaultValue `undefined`
123
+ * @remarks `undefined` prior to first draw or after {@link Token._destroy | `Token#_destroy`} is called, or
124
+ * {@link Token.initializeVisionSource | `Token#initializeVisionSource`} is called with `{deleted: true}`
296
125
  */
297
- vision: foundry.canvas.sources.PointVisionSource.Any;
126
+ vision: sources.PointVisionSource.ConfiguredInstance | undefined;
298
127
 
299
128
  /**
300
129
  * A reference to the LightSource object which defines this light source area of effect
130
+ * @defaultValue `undefined`
131
+ * @remarks `undefined` prior to first draw or after {@link Token._destroy | `Token#_destroy`} is called, or
132
+ * {@link Token.initializeLightSource | `Token#initializeLightSource`} is called with `{deleted: true}`
133
+ *
134
+ * Whether this is a LightSource or a DarknessSource depends on `this.document.light.negative`
301
135
  */
302
- light: foundry.canvas.sources.PointLightSource;
136
+ light: sources.PointLightSource.ConfiguredInstance | sources.PointDarknessSource.ConfiguredInstance | undefined;
303
137
 
304
138
  /**
305
- * A reference to an animation that is currently in progress for this Token, if any
306
- * @internal
139
+ * The current animations of this Token.
307
140
  */
308
- protected _animation: Promise<number> | null;
141
+ get animationContexts(): Map<string, Token.AnimationContext>;
309
142
 
310
143
  /**
311
- * A convenient reference to the Actor object associated with the Token embedded document.
144
+ * A TokenRing instance which is used if this Token applies a dynamic ring.
145
+ * This property is null if the Token does not use a dynamic ring.
146
+ * @defaultValue `undefined`
147
+ * @remarks Only `undefined` prior to first draw. Set `null` if `token.document.ring.enabled` is `false`.
312
148
  */
313
- get actor(): this["document"]["actor"];
149
+ get ring(): foundry.canvas.tokens.TokenRing.ConfiguredInstance | null | undefined;
314
150
 
315
151
  /**
316
- * A convenient reference for whether the current User has full control over the Token document.
152
+ * A convenience boolean to test whether the Token is using a dynamic ring.
317
153
  */
318
- get owner(): boolean;
319
-
320
- get isOwner(): boolean;
154
+ get hasDynamicRing(): boolean;
321
155
 
322
156
  /**
323
- * A boolean flag for whether the current game User has observer permission for the Token
157
+ * A convenient reference to the Actor object associated with the Token embedded document.
324
158
  */
325
- get observer(): boolean;
159
+ get actor(): TokenDocument.Implementation["actor"];
326
160
 
327
161
  /**
328
- * Is the HUD display active for this token?
162
+ * A boolean flag for whether the current game User has observer permission for the Token
329
163
  */
330
- get hasActiveHUD(): boolean;
164
+ get observer(): boolean;
331
165
 
332
166
  /**
333
167
  * Convenience access to the token's nameplate string
334
- * @remarks
335
- * This is actually a getter that returns data.name
336
168
  */
337
- readonly name: string;
169
+ get name(): string;
338
170
 
339
171
  override get bounds(): PIXI.Rectangle;
340
172
 
@@ -351,17 +183,21 @@ declare global {
351
183
  /**
352
184
  * The Token's current central position
353
185
  */
354
- get center(): Canvas.Point;
186
+ get center(): PIXI.Point;
355
187
 
356
188
  /**
357
189
  * The Token's central position, adjusted in each direction by one or zero pixels to offset it relative to walls.
358
190
  */
359
- getMovementAdjustedPoint(point: Canvas.Point, offset?: { offsetX: number; offsetY: number }): Canvas.Point;
191
+ // offsets: not null (destructured)
192
+ getMovementAdjustedPoint(point: Canvas.Point, offsets?: Token.GetMovementAdjustedPointOffsets): Canvas.Point;
360
193
 
361
194
  /**
362
195
  * The HTML source element for the primary Tile texture
196
+ * @privateRemarks Foundry types this as `HTMLImageElement | HTMLVideoElement`, but this just
197
+ * returns `this.texture?.baseTexture.resource.source`, which could be any of `PIXI.ImageSource`,
198
+ * and returns `ImageBitmap`, not `HTMLImageElement`, for static images.
363
199
  */
364
- get sourceElement(): HTMLImageElement | HTMLVideoElement | undefined;
200
+ get sourceElement(): PIXI.ImageSource | undefined;
365
201
 
366
202
  override get sourceId(): string;
367
203
 
@@ -378,7 +214,7 @@ declare global {
378
214
  /**
379
215
  * Return a reference to a Combatant that represents this Token, if one is present in the current encounter.
380
216
  */
381
- get combatant(): Combatant.ConfiguredInstance | null;
217
+ get combatant(): Combatant.Stored;
382
218
 
383
219
  /**
384
220
  * An indicator for whether the Token is currently targeted by the active game User
@@ -388,7 +224,7 @@ declare global {
388
224
  /**
389
225
  * Return a reference to the detection modes array.
390
226
  */
391
- get detectionModes(): Array<DetectionMode>;
227
+ get detectionModes(): TokenDocument.Implementation["detectionModes"];
392
228
 
393
229
  /**
394
230
  * Determine whether the Token is visible to the calling user's perspective.
@@ -397,12 +233,16 @@ declare global {
397
233
  * Controlled tokens are always visible.
398
234
  * All Tokens are visible to a GM user if no Token is controlled.
399
235
  *
400
- * @see {@link CanvasVisibility#testVisibility}
236
+ * @see {@link CanvasVisibility.testVisibility | `CanvasVisibility#testVisibility`}
401
237
  */
402
238
  get isVisible(): boolean;
403
239
 
404
240
  /**
405
241
  * The animation name used for Token movement
242
+ * @defaultValue
243
+ * ```js
244
+ * `${this.objectId}.animate`
245
+ * ```
406
246
  */
407
247
  get animationName(): string;
408
248
 
@@ -412,7 +252,19 @@ declare global {
412
252
  get hasSight(): boolean;
413
253
 
414
254
  /**
415
- * Test whether the Token emits light (or darkness) at any radius
255
+ * Does this Token actively emit light given its properties and the current darkness level of the Scene?
256
+ */
257
+ protected _isLightSource(): boolean;
258
+
259
+ /**
260
+ * Does this Ambient Light actively emit darkness given
261
+ * its properties and the current darkness level of the Scene?
262
+ */
263
+ get emitsDarkness(): boolean;
264
+
265
+ /**
266
+ * Does this Ambient Light actively emit light given
267
+ * its properties and the current darkness level of the Scene?
416
268
  */
417
269
  get emitsLight(): boolean;
418
270
 
@@ -431,6 +283,16 @@ declare global {
431
283
  */
432
284
  get brightRadius(): number;
433
285
 
286
+ /**
287
+ * The maximum radius in pixels of the light field
288
+ */
289
+ get radius(): number;
290
+
291
+ /**
292
+ * The range of this token's light perception in pixels.
293
+ */
294
+ get lightPerceptionRange(): number;
295
+
434
296
  /**
435
297
  * Translate the token's vision range in units into a radius in pixels.
436
298
  */
@@ -441,37 +303,44 @@ declare global {
441
303
  */
442
304
  get optimalSightRange(): number;
443
305
 
444
- // TODO(LukeAbby): This override appears to fail because it creates a circular dependency that tsc can't resolve for some reason. Bug report?
445
- // `Token` is a `PlaceableObject` if it properly extends `PlaceableObject` however `clone` is a proper override of `PlaceableObject.clone` only if its return value extends `PlaceableObject`.
446
- // This creates a loop of checking `Token` against `PlaceableObject`.
447
- // override clone(): Token;
448
-
449
306
  /**
450
- * Update the light and vision source objects associated with this Token
307
+ * Update the light and vision source objects associated with this Token.
451
308
  * @param options - Options which configure how perception sources are updated
452
309
  */
453
- updateSource(options?: Token.UpdateSourceOptions): void;
310
+ // options: not null (destructured)
311
+ initializeSources(options?: Token.InitializeSourcesOptions): void;
454
312
 
455
313
  /**
456
314
  * Update an emitted light source associated with this Token.
457
- * @param options - (default `{}`)
458
315
  */
459
- updateLightSource(options?: Token.UpdateLightSourceOptions): void;
316
+ // options: not null (destructured)
317
+ initializeLightSource(options?: Token.InitializeSourcesOptions): void;
460
318
 
461
319
  /**
462
- * Update an Token vision source associated for this token.
463
- * @param options - Options which affect how the vision source is updated
464
- * (default: `{}`)
320
+ * Get the light source data.
465
321
  */
466
- updateVisionSource(options?: Token.UpdateVisionSourceOptions): void;
322
+ protected _getLightSourceData(): Token.LightSourceData;
467
323
 
468
324
  /**
469
- * Test whether this Token is a viable vision source for the current User
470
- * @internal
325
+ * Update the VisionSource instance associated with this Token.
471
326
  */
472
- protected _isVisionSource(): boolean;
327
+ // options: not null (destructured)
328
+ initializeVisionSource(options?: Token.InitializeSourcesOptions): void;
473
329
 
474
- override render(renderer: PIXI.Renderer): void;
330
+ /**
331
+ * Returns a record of blinding state.
332
+ */
333
+ protected _getVisionBlindedStates(): Token.BlindedStates;
334
+
335
+ /**
336
+ * Get the vision source data.
337
+ */
338
+ protected _getVisionSourceData(): Token.VisionSourceData;
339
+
340
+ /**
341
+ * Test whether this Token is a viable vision source for the current User.
342
+ */
343
+ protected _isVisionSource(): boolean;
475
344
 
476
345
  /**
477
346
  * Render the bound mesh detection filter.
@@ -481,17 +350,58 @@ declare global {
481
350
 
482
351
  override clear(): void;
483
352
 
484
- protected override _destroy(options?: PIXI.IDestroyOptions | boolean): void;
353
+ protected override _destroy(options: PIXI.IDestroyOptions | boolean | undefined): void;
485
354
 
486
- protected override _draw(options?: Record<string, unknown>): Promise<void>;
355
+ protected override _draw(options: HandleEmptyObject<Token.DrawOptions> | undefined): Promise<void>;
487
356
 
488
357
  protected override _applyRenderFlags(flags: Token.RenderFlags): void;
489
358
 
359
+ /**
360
+ * Refresh the token ring visuals if necessary.
361
+ */
362
+ protected _refreshRingVisuals(): void;
363
+
490
364
  /**
491
365
  * Refresh the visibility.
492
366
  */
493
367
  protected _refreshVisibility(): void;
494
368
 
369
+ /**
370
+ * Refresh aspects of the user interaction state.
371
+ * For example the border, nameplate, or bars may be shown on Hover or on Control.
372
+ */
373
+ protected _refreshState(): void;
374
+
375
+ /**
376
+ * Refresh the size.
377
+ */
378
+ protected _refreshSize(): void;
379
+
380
+ /**
381
+ * Refresh the shape.
382
+ */
383
+ protected _refreshShape(): void;
384
+
385
+ /**
386
+ * Refresh the rotation.
387
+ */
388
+ protected _refreshRotation(): void;
389
+
390
+ /**
391
+ * Refresh the position.
392
+ */
393
+ protected _refreshPosition(): void;
394
+
395
+ /**
396
+ * Refresh the elevation
397
+ */
398
+ protected _refreshElevation(): void;
399
+
400
+ /**
401
+ * Refresh the tooltip.
402
+ */
403
+ protected _refreshTooltip(): void;
404
+
495
405
  /**
496
406
  * Refresh the text content, position, and visibility of the Token nameplate.
497
407
  */
@@ -508,34 +418,32 @@ declare global {
508
418
  protected _refreshShader(): void;
509
419
 
510
420
  /**
511
- * Draw the Token border, taking into consideration the grid type and border color
512
- * @internal
421
+ * Refresh the border.
513
422
  */
514
423
  protected _refreshBorder(): void;
515
424
 
516
425
  /**
517
426
  * Get the hex color that should be used to render the Token border
518
427
  * @returns The hex color used to depict the border color
519
- * @internal
428
+ * @throws If this Token's Document somehow has an invalid `disposition`
429
+ * @remarks Border colors set via `CONFIG.Canvas.dispositionColors`
520
430
  */
521
- protected _getBorderColor(options?: {
522
- /**
523
- * Return a border color for this hover state, otherwise use the token's current state.
524
- */
525
- hover?: boolean;
526
- }): number | null;
431
+ protected _getBorderColor(): number;
527
432
 
528
433
  /**
529
434
  * Refresh the target indicators for the Token.
530
435
  * Draw both target arrows for the primary User and indicator pips for other Users targeting the same Token.
531
436
  * @param reticule - Additional parameters to configure how the targeting reticule is drawn.
437
+ * @remarks Forwards `reticule` to {@link Token._drawTarget | `Token#_drawTarget`}
532
438
  */
439
+ // reticule: not null (destructured in _drawTarget)
533
440
  protected _refreshTarget(reticule?: Token.ReticuleOptions): void;
534
441
 
535
442
  /**
536
443
  * Draw the targeting arrows around this token.
537
444
  * @param reticule - Additional parameters to configure how the targeting reticule is drawn.
538
445
  */
446
+ // reticule: not null (destructured)
539
447
  protected _drawTarget(reticule?: Token.ReticuleOptions): void;
540
448
 
541
449
  /**
@@ -549,8 +457,15 @@ declare global {
549
457
  * @param number - The Bar number
550
458
  * @param bar - The Bar container
551
459
  * @param data - Resource data for this bar
460
+ * @remarks Called in {@link Token.drawBars | `Token#drawBars`} only after checking `data` for truthiness.
461
+ *
462
+ * Unconditionally returns `true`
552
463
  */
553
- protected _drawBar(number: number, bar: PIXI.Graphics, data: ReturnType<TokenDocument["getBarAttribute"]>): void;
464
+ protected _drawBar(
465
+ number: number,
466
+ bar: PIXI.Graphics,
467
+ data: NonNullable<TokenDocument.GetBarAttributeReturn>,
468
+ ): boolean;
554
469
 
555
470
  /**
556
471
  * Return the text which should be displayed in a token's tooltip field
@@ -565,17 +480,27 @@ declare global {
565
480
  /**
566
481
  * Draw the active effects and overlay effect icons which are present upon the Token
567
482
  */
568
- drawEffects(): Promise<void>;
483
+ drawEffects(): Promise<this>;
484
+
485
+ /**
486
+ * Draw the effect icons for ActiveEffect documents which apply to the Token's Actor.
487
+ * Called by {@link Token.drawEffects | `Token#drawEffects`}.
488
+ */
489
+ protected _drawEffects(): Promise<void>;
569
490
 
570
491
  /**
571
492
  * Draw a status effect icon
493
+ * @param src - Path to a texture
494
+ * @param tint - A tint to apply to the returned sprite (default: `0xFFFFFF`)
495
+ * @remarks Returns early if `src` is falsey, but otherwise calls {@link loadTexture | `loadTexture`} with `{ fallback: "icons/svg/hazard.svg" }` and returns that
572
496
  */
573
- protected _drawEffect(src: string, tint: number | null): Promise<PIXI.Sprite | undefined>;
497
+ protected _drawEffect(src: string, tint?: number | null): Promise<PIXI.Sprite | undefined>;
574
498
 
575
499
  /**
576
500
  * Draw the overlay effect icon
501
+ * @remarks Forwards both arguments to {@link Token._drawEffect | `Token#_drawEffect`}, and returns its output.
577
502
  */
578
- protected _drawOverlay(src: string, tint: number | null): Promise<PIXI.Sprite>;
503
+ protected _drawOverlay(src: string, tint?: number | null): Promise<PIXI.Sprite | undefined>;
579
504
 
580
505
  /**
581
506
  * Refresh the display of status effects, adjusting their position for the token width and height.
@@ -587,128 +512,167 @@ declare global {
587
512
  * @param mode - The mode from CONST.TOKEN_DISPLAY_MODES
588
513
  * @returns Is the attribute viewable?
589
514
  */
590
- protected _canViewMode(mode: foundry.CONST.TOKEN_DISPLAY_MODES): boolean;
515
+ protected _canViewMode(mode: CONST.TOKEN_DISPLAY_MODES): boolean;
591
516
 
592
517
  /**
593
- * Animate changes to the appearance of the Token.
594
- * Animations are performed over differences between the TokenDocument and the current Token and TokenMesh appearance.
595
- * @param updateData - A record of the differential data which changed, for reference only
596
- * @param options - Options which configure the animation behavior
597
- * @returns A promise which resolves once the animation is complete
518
+ * Override ring colors for this particular Token instance.
519
+ * @remarks The return gets `mergeObject`ed over {@link TokenDocument.ring | `TokenDocument#ring#colors`}
520
+ * in {@link foundry.canvas.tokens.TokenRing.configureVisuals | `TokenRing#configureVisuals`} and
521
+ * {@link foundry.canvas.tokens.TokenRing.flashColor | `TokenRing#flashColor`}. Foundry's implementation returns `{}`
598
522
  */
599
- animate(
600
- updateData: unknown,
601
- options: {
602
- /** An optional function called each animation frame */
603
- ontick: (dt: number, data: CanvasAnimationData) => number;
523
+ getRingColors(): Token.RingColors;
604
524
 
605
- /**
606
- * A desired token movement speed in grid spaces per second
607
- * @defaultValue `6`
608
- */
609
- movementSpeed: number;
525
+ /**
526
+ * Apply additional ring effects for this particular Token instance.
527
+ * Effects are returned as an array of integers in {@link foundry.canvas.tokens.TokenRing.effects}.
528
+ * @remarks Additional effects to add over and above those in `CONFIG.Token.ring.effects`. Foundry's implementation returns `[]`
529
+ */
530
+ getRingEffects(): foundry.canvas.tokens.TokenRing.EFFECTS[];
610
531
 
611
- /**
612
- * The animation starting attributes if different from those cached.
613
- *
614
- * @deprecated since v12, will be removed in v14
615
- */
616
- a0: unknown;
617
- },
618
- ): Promise<void>;
532
+ /**
533
+ * Get the animation data for the current state of the document.
534
+ * @returns The target animation data object
535
+ */
536
+ protected _getAnimationData(): Token.AnimationData;
619
537
 
620
538
  /**
621
- * Terminate animation of this particular Token.
539
+ * Animate from the old to the new state of this Token.
540
+ * @param to - The animation data to animate to
541
+ * @param options - The options that configure the animation behavior. Passed to {@link Token._getAnimationDuration | `Token#_getAnimationDuration`}.
622
542
  */
623
- stopAnimation(): void;
543
+ // options: not null (destructured)
544
+ animate(to: Token.PartialAnimationData, options?: Token.AnimateOptions): Promise<void>;
624
545
 
625
546
  /**
626
- * Check for collision when attempting a move to a new position
627
- * @param destination - The central destination point of the attempted movement
628
- * @param options - Additional options forwarded to WallsLayer#checkCollision
629
- * @returns The result of the WallsLayer#checkCollision test
547
+ * Get the duration of the animation.
548
+ * @param from - The animation data to animate from
549
+ * @param to - The animation data to animate to
550
+ * @param options - The options that configure the animation behavior
551
+ * @returns The duration of the animation in milliseconds
630
552
  */
631
- checkCollision(
632
- destination: Canvas.Point,
633
- options: {
634
- origin: Canvas.Point;
553
+ // options: not null (destructured)
554
+ protected _getAnimationDuration(
555
+ from: Token.AnimationDataForDuration,
556
+ to: Token.PartialAnimationData,
557
+ options?: Token.GetAnimationDurationOptions,
558
+ ): number;
635
559
 
636
- /** @defaultValue `"move"` */
637
- type: Exclude<Token.SourceType, "Sound">;
560
+ /**
561
+ * Called each animation frame.
562
+ * @param changed - The animation data that changed
563
+ * @param context - The animation context
564
+ */
565
+ protected _onAnimationUpdate(changed: Token.PartialAnimationData, context: Token.AnimationContext): void;
638
566
 
639
- /** @defaultValue `"any"` */
640
- mode: PointSourcePolygon.CollisionModes;
641
- },
642
- ): boolean;
643
567
  /**
644
- * Get the center-point coordinate for a given grid position
645
- * @param x - The grid x-coordinate that represents the top-left of the Token
646
- * @param y - The grid y-coordinate that represents the top-left of the Token
647
- * @returns The coordinate pair which represents the Token's center at position (x, y)
568
+ * Terminate animation of this particular Token.
648
569
  */
649
- getCenter(
650
- x: number,
651
- y: number,
652
- ): {
653
- x: number;
654
- y: number;
655
- };
570
+ // options: not null (destructured)
571
+ stopAnimation(options?: Token.StopAnimationOptions): void;
656
572
 
657
573
  /**
658
- * Set the token's position by comparing its center position vs the nearest grid vertex
659
- * Return a Promise that resolves to the Token once the animation for the movement has been completed
660
- * @param x - The x-coordinate of the token center
661
- * @param y - The y-coordinate of the token center
662
- * @param options - Additional options which configure the token movement
663
- * (defaultValue: `{}`)
664
- * @returns The Token after animation has completed
574
+ * Prepare the animation data changes: performs special handling required for animating rotation.
575
+ * @param from - The animation data to animate from
576
+ * @param changes - The animation data changes
577
+ * @param context - The animation context
578
+ * @param options - The options that configure the animation behavior
579
+ * @returns The animation attributes
665
580
  */
666
- setPosition(x: number, y: number, options?: Token.PositionOptions): Promise<this>;
581
+ // options: not null (property access)
582
+ protected _prepareAnimation(
583
+ from: Token.AnimationDataForRotation,
584
+ changes: Token.PartialAnimationData,
585
+ context: Token.AnimationContext,
586
+ options?: Token.PrepareAnimationOptions,
587
+ ): CanvasAnimation.Attribute[];
667
588
 
668
589
  /**
669
- * Update the Token velocity auto-regressively, shifting increasing weight towards more recent movement
670
- * Employ a magic constant chosen to minimize (effectively zero) the likelihood of trigonometric edge cases
671
- * @param ray - The proposed movement ray
672
- * @returns An updated velocity with directional memory
673
- * @internal
590
+ * Check for collision when attempting a move to a new position
591
+ * @param destination - The central destination point of the attempted movement
592
+ * @param options - Additional options forwarded to {@link WallsLayer.checkCollision | `WallsLayer#checkCollision`}
593
+ * @returns The result of the `WallsLayer#checkCollision` test
674
594
  */
675
- protected _updateVelocity(ray: Ray): Token.Velocity;
595
+ // options: not null (destructured)
596
+ checkCollision<Mode extends PointSourcePolygon.CollisionModes | undefined = undefined>(
597
+ destination: Canvas.Point,
598
+ options?: Token.CheckCollisionOptions<Mode>,
599
+ ): PointSourcePolygon.TestCollision<Coalesce<Mode, "any">>;
676
600
 
677
601
  /**
678
- * Set this Token as an active target for the current game User
679
- * @param targeted - Is the Token now targeted?
680
- * (default: `true`)
681
- * @param context - Additional context options
682
- * (default `{}`)
602
+ * Get the width and height of the Token in pixels.
603
+ * @returns The size in pixels
604
+ */
605
+ getSize(): Token.Size;
606
+
607
+ /**
608
+ * Get the shape of this Token.
609
+ * @privateRemarks Foundry types this as possibly returning a `PIXI.Circle`, but it never does in practice in v12.
610
+ * Not reported as this has changed in v13.
683
611
  */
684
- setTarget(targeted?: boolean, context?: Token.SetTargetContext): void;
612
+ getShape(): PIXI.Rectangle | PIXI.Polygon;
685
613
 
686
614
  /**
687
- * Add or remove the currently controlled Tokens from the active combat encounter
688
- * @param combat - A specific combat encounter to which this Token should be added
689
- * @returns The Token which initiated the toggle
615
+ * Get the center point for a given position or the current position.
616
+ * @param position - The position to be used instead of the current position (default: `this.document`)
617
+ * @returns The center point
690
618
  */
691
- toggleCombat(combat?: Combat.ConfiguredInstance): Promise<this>;
619
+ getCenterPoint(position?: Canvas.Point | null): Canvas.Point;
620
+
621
+ override getSnappedPosition(position?: Canvas.Point | null): Canvas.Point;
692
622
 
693
623
  /**
694
- * Toggle an active effect by its texture path.
695
- * Copy the existing Array in order to ensure the update method detects the data as changed.
624
+ * Test whether the Token is inside the Region.
625
+ * This function determines the state of {@link TokenDocument.regions | `TokenDocument#regions`} and {@link RegionDocument.tokens | `RegionDocument#tokens`}.
696
626
  *
697
- * @param effect - The texture file-path of the effect icon to toggle on the Token.
698
- * @param options - Additional optional arguments which configure how the effect is handled.
699
- * (defaultValue: `{}`)
700
- * @returns Was the texture applied (true) or removed (false)
627
+ * Implementations of this function are restricted in the following ways:
628
+ * - If the bounds (given by {@link Token.getSize | `Token#getSize`}) of the Token do not intersect the Region, then the Token is not
629
+ * contained within the Region.
630
+ * - If the Token is inside the Region a particular elevation, then the Token is inside the Region at any elevation
631
+ * within the elevation range of the Region.
632
+ *
633
+ * If this function is overridden, then {@link Token.segmentizeRegionMovement | `Token#segmentizeRegionMovement`} must be overridden too.
634
+ * @param region - The region.
635
+ * @param position - The (x, y) and/or elevation to use instead of the current values.
636
+ * @returns Is the Token inside the Region?
637
+ * @remarks `position` can be `{x, y}`, `{elevation}`, both, or neither. If either part is omitted, uses the document's value(s)
701
638
  */
702
- toggleEffect(
703
- effect: string | Parameters<TokenDocument["toggleActiveEffect"]>[0],
704
- options?: Token.EffectToggleOptions,
705
- ): Promise<boolean>;
639
+ testInsideRegion(region: Region.Object, position?: Token.TestablePosition | null): boolean;
706
640
 
707
641
  /**
708
- * Toggle the visibility state of any Tokens in the currently selected set
709
- * @returns A Promise which resolves to the updated Token documents
642
+ * Split the Token movement through the waypoints into its segments.
643
+ *
644
+ * Implementations of this function are restricted in the following ways:
645
+ * - The segments must go through the waypoints.
646
+ * - The *from* position matches the *to* position of the succeeding segment.
647
+ * - The Token must be contained (w.r.t. {@link Token.testInsideRegion | `Token#testInsideRegion`}) within the Region
648
+ * at the *from* and *to* of MOVE segments.
649
+ * - The Token must be contained (w.r.t. {@link Token.testInsideRegion | `Token#testInsideRegion`}) within the Region
650
+ * at the *to* position of ENTER segments.
651
+ * - The Token must be contained (w.r.t. {@link Token.testInsideRegion | `Token#testInsideRegion`}) within the Region
652
+ * at the *from* position of EXIT segments.
653
+ * - The Token must not be contained (w.r.t. {@link Token.testInsideRegion | `Token#testInsideRegion`}) within the Region
654
+ * at the *from* position of ENTER segments.
655
+ * - The Token must not be contained (w.r.t. {@link Token.testInsideRegion | `Token#testInsideRegion`}) within the Region
656
+ * at the *to* position of EXIT segments.
657
+ * @param region - The region.
658
+ * @param waypoints - The waypoints of movement.
659
+ * @param options - Additional options
660
+ * @returns The movement split into its segments.
661
+ */
662
+ // options: not null (destructured)
663
+ segmentizeRegionMovement(
664
+ region: Region.Object,
665
+ waypoints: Region.MovementWaypoint[],
666
+ options?: Region.SegmentizeMovementOptions,
667
+ ): Region.MovementSegment[];
668
+
669
+ /**
670
+ * Set this Token as an active target for the current game User
671
+ * @param targeted - Is the Token now targeted? (default: `true`)
672
+ * @param context - Additional context options
710
673
  */
711
- toggleVisibility(): Promise<TokenDocument.ConfiguredInstance[]>;
674
+ // targeted: not null (!== check with a boolean), context: not null (destructured)
675
+ setTarget(targeted?: boolean, context?: Token.TargetContext): void;
712
676
 
713
677
  /**
714
678
  * The external radius of the token in pixels.
@@ -724,97 +688,601 @@ declare global {
724
688
  */
725
689
  getLightRadius(units: number): number;
726
690
 
727
- protected override _getShiftedPosition(dx: number, dy: number): { x: number; y: number };
691
+ protected override _getShiftedPosition(dx: number, dy: number): Canvas.Point;
692
+
693
+ // options: not null (destructured)
694
+ protected override _updateRotation(options?: PlaceableObject.UpdateRotationOptions): number;
695
+
696
+ // _onCreate, _onUpdate, and _onDelete are overridden but with no signature changes.
697
+ // For type simplicity they are left off. These methods historically have been the source of a large amount of computation from tsc.
728
698
 
729
699
  /**
730
- * @privateRemarks _onDelete and _onUpdate are overridden but with no signature changes.
731
- * For type simplicity they are left off. These methods historically have been the source of a large amount of computation from tsc.
700
+ * Handle changes to Token behavior when a significant status effect is applied
701
+ * @param statusId - The status effect ID being applied, from `CONFIG.specialStatusEffects`
702
+ * @param active - Is the special status effect now active?
703
+ * @remarks Foundry marked `@internal`
732
704
  */
705
+ protected _onApplyStatusEffect(statusId: string, active: boolean): void;
733
706
 
734
707
  /**
735
- * Handle changes to Token behavior when a significant status effect is applied
736
- * @param statusId - The status effect ID being applied, from CONFIG.specialStatusEffects
708
+ * Add/Modify a filter effect on this token.
709
+ * @param statusId - The status effect ID being applied, from `CONFIG.specialStatusEffects`
737
710
  * @param active - Is the special status effect now active?
738
- * @internal
711
+ * @remarks Foundry marked `@internal`
712
+ */
713
+ protected _configureFilterEffect(statusId: string, active: boolean): void;
714
+
715
+ /**
716
+ * Update the filter effects depending on special status effects
717
+ * TODO: replace this method by something more convenient.
718
+ * @remarks Foundry marked `@internal`. The TODO is theirs.
719
+ */
720
+ protected _updateSpecialStatusFilterEffects(): void;
721
+
722
+ /**
723
+ * Remove all filter effects on this placeable.
724
+ * @remarks Foundry marked `@internal`
739
725
  */
740
- _onApplyStatusEffect(statusId: string, active: boolean): void;
726
+ protected _removeAllFilterEffects(): void;
727
+
728
+ protected override _onControl(options: Token.ControlOptions): void;
741
729
 
742
- protected override _onControl(options?: Token.ControlOptions): void;
730
+ protected override _onRelease(options: HandleEmptyObject<Token.ReleaseOptions>): void;
743
731
 
744
- protected override _onRelease(
745
- options: PlaceableObject.ReleaseOptions,
746
- ): Promise<TokenDocument.ConfiguredInstance> | undefined;
732
+ protected override _overlapsSelection(rectangle: PIXI.Rectangle): boolean;
747
733
 
748
- protected override _canControl(user?: User.ConfiguredInstance, event?: PIXI.FederatedEvent): boolean;
734
+ protected override _canControl(user: User.Implementation, event: PIXI.FederatedEvent): boolean;
749
735
 
750
- protected override _canHUD(user: User.ConfiguredInstance, event?: PIXI.FederatedEvent): boolean;
736
+ protected override _canHUD(user: User.Implementation, event: PIXI.FederatedEvent): boolean;
751
737
 
752
- protected override _canConfigure(user?: User.ConfiguredInstance, event?: PIXI.FederatedEvent): true;
738
+ protected override _canConfigure(user: User.Implementation, event: PIXI.FederatedEvent): true;
753
739
 
754
- protected override _canHover(user?: User.ConfiguredInstance, event?: PIXI.FederatedEvent): true;
740
+ protected override _canHover(user: User.Implementation, event: PIXI.FederatedEvent): true;
755
741
 
756
- protected override _canView(user?: User.ConfiguredInstance, event?: PIXI.FederatedEvent): boolean;
742
+ protected override _canView(user: User.Implementation, event: PIXI.FederatedEvent): boolean;
757
743
 
758
- protected override _canDrag(user: User.ConfiguredInstance, event: PIXI.FederatedEvent): boolean;
744
+ protected override _canDrag(user: User.Implementation, event: PIXI.FederatedEvent): boolean;
759
745
 
760
- protected override _onHoverIn(event: PIXI.FederatedEvent, options?: { hoverOutOthers?: boolean }): void;
746
+ // options: not null (destructured)
747
+ protected override _onHoverIn(event: PIXI.FederatedEvent, options?: PlaceableObject.HoverInOptions): void;
761
748
 
762
- protected override _onHoverOut(event: PIXI.FederatedEvent): false | void;
749
+ protected override _onHoverOut(event: PIXI.FederatedEvent): void;
763
750
 
764
751
  protected override _onClickLeft(event: PIXI.FederatedEvent): void;
765
752
 
753
+ protected override _propagateLeftClick(event: PIXI.FederatedEvent): boolean;
754
+
766
755
  protected override _onClickLeft2(event?: PIXI.FederatedEvent): void;
767
756
 
768
757
  protected override _onClickRight2(event: PIXI.FederatedEvent): void;
769
758
 
770
- protected override _onDragLeftDrop(event: PIXI.FederatedEvent): Promise<any>;
759
+ protected override _onDragLeftStart(event: PIXI.FederatedEvent): void;
760
+
761
+ protected override _prepareDragLeftDropUpdates(event: PIXI.FederatedEvent): Token.DragLeftDropUpdate[];
771
762
 
772
763
  protected override _onDragLeftMove(event: PIXI.FederatedEvent): void;
773
764
 
774
765
  protected override _onDragEnd(): void;
775
766
 
776
767
  /**
777
- * @remarks Not used
768
+ * @deprecated since v11, will be removed in v13
769
+ * @remarks "`Token#updatePosition` has been deprecated without replacement as it is no longer required."
778
770
  */
779
- controlIcon: null;
771
+ updatePosition(): void;
780
772
 
781
773
  /**
782
- * @deprecated since v10, will be removed in v12
783
- * @remarks `"Token#hasLimitedVisionAngle has been renamed to Token#hasLimitedSourceAngle"`
774
+ * @deprecated since v11, will be removed in v13
775
+ * @remarks "`Token#refreshHUD` is deprecated in favor of {@link RenderFlags.set | `token.renderFlags.set()`}"
784
776
  */
785
- get hasLimitedVisionAngle(): boolean;
777
+ // options: not null (destructured)
778
+ refreshHUD(options?: Token.RefreshHUDOptions): void;
786
779
 
787
780
  /**
788
- * @deprecated since v10, will be removed in v12
789
- * @remarks `"Token#getSightOrigin has been deprecated in favor of Token#getMovementAdjustedPoint"`
781
+ * Update the light and vision source objects associated with this Token
782
+ * @param options - Options which configure how perception sources are updated
783
+ * @deprecated since v12, until v14
784
+ * @remarks "`Token#updateSource` has been deprecated in favor of {@link Token.initializeSources | `Token#initializeSources`}"
790
785
  */
791
- getSightOrigin(): {
792
- x: number;
793
- y: number;
794
- };
786
+ // options: not null (destructured)
787
+ updateSource(options?: Token.InitializeSourcesOptions): void;
795
788
 
796
789
  /**
797
- * @deprecated since v10, will be removed in v12
798
- * @remarks `"Token#icon has been renamed to Token#mesh."`
790
+ * Get the center-point coordinate for a given grid position
791
+ * @param x - The grid x-coordinate that represents the top-left of the Token
792
+ * @param y - The grid y-coordinate that represents the top-left of the Token
793
+ * @returns The coordinate pair which represents the Token's center at position (x, y)
794
+ * @deprecated since v12, until v14
795
+ * @remarks "`Token#getCenter(x, y)` has been deprecated in favor of {@link Token.getCenterPoint | `Token#getCenterPoint(Point)`}."
799
796
  */
800
- get icon(): this["mesh"];
797
+ getCenter(x: number, y: number): Canvas.Point;
801
798
 
802
799
  /**
803
- * @deprecated since v11, will be removed in v13
804
- * @remarks `"Token#updatePosition has been deprecated without replacement as it is no longer required."`
800
+ * A convenient reference for whether the current User has full control over the Token document.
801
+ * @deprecated since v12, until v14
802
+ * @remarks "`Token#owner` has been deprecated. Use {@link Token.isOwner | `Token#isOwner`} instead."
805
803
  */
806
- updatePosition(): void;
804
+ get owner(): boolean;
807
805
 
808
806
  /**
809
- * @deprecated since v11, will be removed in v13
810
- * @remarks "Token#refreshHUD is deprecated in favor of token.renderFlags.set()"
807
+ * @deprecated since v12, until v14
808
+ * @remarks "`Token#toggleCombat` is deprecated in favor of {@link TokenDocument.toggleCombatant | `TokenDocument#toggleCombatant`},
809
+ * {@link TokenDocument.createCombatants | `TokenDocument.implementation.createCombatants`}, and
810
+ * {@link TokenDocument.deleteCombatants | `TokenDocument.implementation.deleteCombatants`}"
811
+ *
812
+ * The `combat` parameter is unused. Creates Combatants for every Token controlled, plus the Token this was called on if it wasn't already controlled
813
+ */
814
+ toggleCombat(combat?: Combat.Implementation): Promise<Combatant.Stored[]>;
815
+
816
+ /**
817
+ * @deprecated since v12, until v14
818
+ * @remarks "`Token#toggleEffect` is deprecated in favor of {@link Actor.toggleStatusEffect | `Actor#toggleStatusEffect`}"
819
+ */
820
+ // options: not null (destructured)
821
+ toggleEffect(
822
+ effect: CONFIG.StatusEffect,
823
+ options?: Actor.ToggleStatusEffectOptions,
824
+ ): Promise<ActiveEffect.Stored | boolean | undefined>;
825
+
826
+ /**
827
+ * @deprecated since v12, until v14
828
+ * @remarks "`Token#toggleVisibility` is deprecated without replacement in favor of updating the {@link TokenDocument.hidden | `hidden` field of the `TokenDocument`} directly."
829
+ */
830
+ toggleVisibility(): Promise<TokenDocument.Stored[]>;
831
+
832
+ /**
833
+ * @deprecated since v12 Stable 4, until v14
834
+ * @remarks "`Token#_recoverFromPreview` is deprecated without replacement in favor of recovering from preview directly into {@link TokenConfig._resetPreview | `TokenConfig#_resetPreview`}."
811
835
  */
812
- refreshHUD(options?: Token.ObjectHUD): void;
836
+ protected _recoverFromPreview(): void;
813
837
  }
814
838
 
815
839
  /**
816
840
  * A "secret" global to help debug attributes of the currently controlled Token.
817
841
  * This is only for debugging, and may be removed in the future, so it's not safe to use.
818
842
  */
819
- let _token: Token.ConfiguredInstance | null;
843
+ let _token: Token.Object | null;
844
+
845
+ namespace Token {
846
+ // eslint-disable-next-line no-restricted-syntax
847
+ interface ObjectClass extends ConfiguredObjectClassOrDefault<typeof Token> {}
848
+ interface Object extends FixedInstanceType<ObjectClass> {}
849
+
850
+ /**
851
+ * @deprecated {@link Token.ObjectClass | `Token.ObjectClass`}
852
+ */
853
+ type ConfiguredClass = ObjectClass;
854
+
855
+ /**
856
+ * @deprecated {@link Token.Object | `Token.Object`}
857
+ */
858
+ type ConfiguredInstance = Object;
859
+
860
+ /**
861
+ * This type will permanently exist but is marked deprecated. The reason it exists is because
862
+ * the confusion between `Token` (the `PlaceableObject` that appears on the canvas) and
863
+ * `TokenDocument` (the `Document` that represents the data for a `Token`) is so common that
864
+ * it is useful to have a type to forward to `TokenDocument`.
865
+ *
866
+ * @deprecated {@link TokenDocument.Implementation | `TokenDocument.Implementation`}
867
+ */
868
+ type Implementation = TokenDocument.Implementation;
869
+
870
+ /**
871
+ * This type will permanently exist but is marked deprecated. The reason it exists is because
872
+ * the confusion between `Token` (the `PlaceableObject` that appears on the canvas) and
873
+ * `TokenDocument` (the `Document` that represents the data for a `Token`) is so common that
874
+ * it is useful to have a type to forward to `TokenDocument`.
875
+ *
876
+ * @deprecated {@link TokenDocument.ImplementationClass | `TokenDocument.ImplementationClass`}
877
+ */
878
+ type ImplementationClass = TokenDocument.ImplementationClass;
879
+
880
+ type Schema = BaseToken.Schema;
881
+ type Parent = BaseToken.Parent;
882
+
883
+ type Metadata = BaseToken.Metadata;
884
+
885
+ export import SchemaField = BaseToken.SchemaField;
886
+ export import ConstructorData = BaseToken.ConstructorData;
887
+ export import UpdateData = BaseToken.UpdateData;
888
+ export import Properties = BaseToken.Properties;
889
+ export import Source = BaseToken.Source;
890
+
891
+ interface RENDER_FLAGS {
892
+ /** @defaultValue `{ propagate: ["refresh"] }` */
893
+ redraw: RenderFlag<this, "redraw">;
894
+
895
+ /** @defaultValue `{}` */
896
+ redrawEffects: RenderFlag<this, "redrawEffects">;
897
+
898
+ /** @defaultValue `{ propagate: ["refreshState", "refreshTransform", "refreshMesh", "refreshNameplate", "refreshElevation", "refreshRingVisuals"], alias: true }` */
899
+ refresh: RenderFlag<this, "refresh">;
900
+
901
+ /** @defaultValue `{ propagate: ["refreshVisibility", "refreshTarget"] }` */
902
+ refreshState: RenderFlag<this, "refreshState">;
903
+
904
+ /** @defaultValue `{}` */
905
+ refreshVisibility: RenderFlag<this, "refreshVisibility">;
906
+
907
+ /** @defaultValue `{ propagate: ["refreshPosition", "refreshRotation", "refreshSize"], alias: true }` */
908
+ refreshTransform: RenderFlag<this, "refreshTransform">;
909
+
910
+ /** @defaultValue `{}` */
911
+ refreshPosition: RenderFlag<this, "refreshPosition">;
912
+
913
+ /** @defaultValue `{}` */
914
+ refreshRotation: RenderFlag<this, "refreshRotation">;
915
+
916
+ /** @defaultValue `{ propagate: ["refreshPosition", "refreshShape", "refreshBars", "refreshEffects", "refreshNameplate", "refreshTarget", "refreshTooltip"] }` */
917
+ refreshSize: RenderFlag<this, "refreshSize">;
918
+
919
+ /** @defaultValue `{ propagate: ["refreshTooltip"] }` */
920
+ refreshElevation: RenderFlag<this, "refreshElevation">;
921
+
922
+ /** @defaultValue `{}` */
923
+ refreshMesh: RenderFlag<this, "refreshMesh">;
924
+
925
+ /** @defaultValue `{}` */
926
+ refreshShader: RenderFlag<this, "refreshShader">;
927
+
928
+ /** @defaultValue `{ propagate: ["refreshVisibility", "refreshPosition", "refreshBorder", "refreshEffects"] }` */
929
+ refreshShape: RenderFlag<this, "refreshShape">;
930
+
931
+ /** @defaultValue `{}` */
932
+ refreshBorder: RenderFlag<this, "refreshBorder">;
933
+
934
+ /** @defaultValue `{}` */
935
+ refreshBars: RenderFlag<this, "refreshBars">;
936
+
937
+ /** @defaultValue `{}` */
938
+ refreshEffects: RenderFlag<this, "refreshEffects">;
939
+
940
+ /** @defaultValue `{}` */
941
+ refreshNameplate: RenderFlag<this, "refreshNameplate">;
942
+
943
+ /** @defaultValue `{}` */
944
+ refreshTarget: RenderFlag<this, "refreshTarget">;
945
+
946
+ /** @defaultValue `{}` */
947
+ refreshTooltip: RenderFlag<this, "refreshTooltip">;
948
+
949
+ /** @defaultValue `{}` */
950
+ refreshRingVisuals: RenderFlag<this, "refreshRingVisuals">;
951
+ }
952
+
953
+ interface RenderFlags extends RenderFlagsMixin.ToBooleanFlags<RENDER_FLAGS> {}
954
+
955
+ interface Bars extends PIXI.Container {
956
+ bar1: PIXI.Graphics;
957
+ bar2: PIXI.Graphics;
958
+ }
959
+
960
+ /** @internal */
961
+ type _GetMovementAdjustedPointOffsets = NullishProps<{
962
+ /** @defaultValue `this.#priorMovement.ox` */
963
+ offsetX: number;
964
+
965
+ /** @defaultValue `this.#priorMovement.oy` */
966
+ offsetY: number;
967
+ }>;
968
+
969
+ interface GetMovementAdjustedPointOffsets extends _GetMovementAdjustedPointOffsets {}
970
+
971
+ interface DrawOptions extends PlaceableObject.DrawOptions {}
972
+
973
+ interface RefreshOptions extends PlaceableObject.RefreshOptions {}
974
+
975
+ /** @internal */
976
+ type _ControlOptions = NullishProps<{
977
+ /** @defaultValue `false` */
978
+ pan: boolean;
979
+ }>;
980
+
981
+ interface ControlOptions extends _ControlOptions, PlaceableObject.ControlOptions {}
982
+
983
+ interface ReleaseOptions extends PlaceableObject.ReleaseOptions {}
984
+
985
+ /**
986
+ * @remarks {@link Token._getLightSourceData | `Token#_getLightSourceData`} calls `mergeObject` on the return of
987
+ * {@link foundry.data.LightData.toObject | `LightData#toObject(false)`} and the enumerated properties below and
988
+ * returns the result. This gets passed to {@link foundry.canvas.sources.PointLightSource.initialize | `Token#light#initialize()`},
989
+ * so this is a `RequiredProps<IntentionalPartial<>>` rather than a `Pick<>`
990
+ */
991
+ type LightSourceData = foundry.data.fields.SchemaField.InitializedData<foundry.data.LightData.Schema> &
992
+ RequiredProps<
993
+ IntentionalPartial<foundry.canvas.sources.PointLightSource.SourceData>,
994
+ "x" | "y" | "elevation" | "rotation" | "dim" | "bright" | "externalRadius" | "seed" | "preview" | "disabled"
995
+ >;
996
+
997
+ /**
998
+ * @remarks The return of {@link Token._getVisionSourceData | `Token#_getVisionSourceData`}, which gets passed
999
+ * to {@link foundry.canvas.sources.PointVisionSource.initialize | `Token#vision#initialize()`}, so this is a
1000
+ * `RequiredProps<IntentionalPartial<>>` rather than a `Pick<>`
1001
+ */
1002
+ type VisionSourceData = RequiredProps<
1003
+ IntentionalPartial<foundry.canvas.sources.PointVisionSource.SourceData>,
1004
+ | "x"
1005
+ | "y"
1006
+ | "elevation"
1007
+ | "rotation"
1008
+ | "lightRadius"
1009
+ | "externalRadius"
1010
+ | "angle"
1011
+ | "contrast"
1012
+ | "saturation"
1013
+ | "brightness"
1014
+ | "attenuation"
1015
+ | "visionMode"
1016
+ | "color"
1017
+ | "preview"
1018
+ | "disabled"
1019
+ >;
1020
+
1021
+ // TODO: (LukeAbby) possible candidate for `-=` key handling
1022
+ interface BlindedStates extends Record<string, boolean> {
1023
+ blind: boolean;
1024
+ burrow: boolean;
1025
+ }
1026
+
1027
+ /** @internal */
1028
+ type _ReticuleOptions = NullishProps<{
1029
+ /**
1030
+ * The amount of margin between the targeting arrows and the token's bounding box, expressed as a fraction of an arrow's size.
1031
+ * @defaultValue `0`
1032
+ * @remarks This gets assigned to with `*=` before use, so `null` casting to the default of `0` is fine
1033
+ */
1034
+ margin: number;
1035
+
1036
+ /**
1037
+ * The color of the arrows.
1038
+ * @defaultValue `this._getBorderColor()` {@link Token._getBorderColor | `Token#_getBorderColor`}
1039
+ */
1040
+ color: number;
1041
+ }> &
1042
+ InexactPartial<{
1043
+ /**
1044
+ * The alpha value of the arrows.
1045
+ * @defaultValue `1`
1046
+ * @remarks Can't be `null` as it only has a parameter default
1047
+ */
1048
+ alpha: number;
1049
+
1050
+ /**
1051
+ * The size of the arrows as a proportion of grid size.
1052
+ * @defaultValue `0.15`
1053
+ * @remarks Can't be `null` as it only has a parameter default
1054
+ */
1055
+ size: number;
1056
+
1057
+ /**
1058
+ * The arrows' border style configuration.
1059
+ * @defaultValue see properties
1060
+ * @remarks Can't be `null` as it's destructured in signature
1061
+ */
1062
+ border: InexactPartial<{
1063
+ /**
1064
+ * The border color.
1065
+ * @defaultValue `0`
1066
+ * @remarks Can't be `null` as it only has a parameter default
1067
+ */
1068
+ color: number;
1069
+
1070
+ /**
1071
+ * The border width.
1072
+ * @defaultValue `2`
1073
+ * @remarks Can't be `null` as it only has a parameter default
1074
+ */
1075
+ width: number;
1076
+ }>;
1077
+ }>;
1078
+ interface ReticuleOptions extends _ReticuleOptions {}
1079
+
1080
+ /**
1081
+ * The return type of {@link Token.getRingColors | `Token#getRingColors`}. Core's implementation returns `{}`.
1082
+ * Values returned by subclasses should not be nullish, as they are `mergeObject`'d into the default color values
1083
+ * from {@link TokenRing.ConfiguredClass | `TokenRing.ConfiguredClass`}
1084
+ */
1085
+ interface RingColors {
1086
+ ring?: Color;
1087
+ background?: Color;
1088
+ }
1089
+
1090
+ /** @internal */
1091
+ type _AnimationData = Pick<TokenDocument.Implementation, "x" | "y" | "width" | "height" | "rotation" | "alpha"> & {
1092
+ /** The texture data. */
1093
+ texture: Pick<
1094
+ TokenDocument.Implementation["texture"],
1095
+ "src" | "anchorX" | "anchorY" | "scaleX" | "scaleY" | "tint"
1096
+ >;
1097
+ } & {
1098
+ /** The ring data. */
1099
+ ring: {
1100
+ /** The ring subject data */
1101
+ subject: Pick<TokenDocument.Implementation["ring"]["subject"], "texture" | "scale">;
1102
+ };
1103
+ };
1104
+
1105
+ /**
1106
+ * Token animation data.
1107
+ * @privateRemarks Implementing this interface like this does lose the specific (simplified, really)
1108
+ * property descriptions of the `TokenAnimationData` typedef, but it gains the ones from the document
1109
+ * schema, and since the values returned by {@link Token._getAnimationData | `Token#_getAnimationData`}
1110
+ * are pulled directly from the document, this is also the most accurate typing.
1111
+ */
1112
+ interface AnimationData extends _AnimationData {}
1113
+
1114
+ type PartialAnimationData = DeepPartial<AnimationData>;
1115
+
1116
+ interface AnimationDataForDuration extends RequiredProps<PartialAnimationData, "x" | "y" | "rotation"> {}
1117
+
1118
+ interface AnimationDataForRotation extends RequiredProps<PartialAnimationData, "rotation"> {}
1119
+
1120
+ /** @internal */
1121
+ type _GetAnimationDurationOptions = InexactPartial<{
1122
+ /**
1123
+ * A desired token movement speed in grid spaces per second
1124
+ * @defaultValue `6`
1125
+ * @remarks Can't be `null` as it only has a parameter default
1126
+ */
1127
+ movementSpeed: number;
1128
+ }>;
1129
+
1130
+ interface GetAnimationDurationOptions extends _GetAnimationDurationOptions {}
1131
+
1132
+ /** @internal */
1133
+ type _PrepareAnimationOptions = NullishProps<{
1134
+ /**
1135
+ * The desired texture transition type
1136
+ * @defaultValue `TextureTransitionFilter.TYPES.FADE` (`"fade"`)
1137
+ */
1138
+ transition: TextureTransitionFilter.TYPES;
1139
+ }>;
1140
+
1141
+ interface PrepareAnimationOptions extends _PrepareAnimationOptions {}
1142
+
1143
+ /** @internal */
1144
+ type _AnimateOptions = Pick<CanvasAnimation.AnimateOptions, "duration" | "easing" | "name" | "ontick">;
1145
+
1146
+ interface AnimateOptions extends _AnimateOptions, GetAnimationDurationOptions, PrepareAnimationOptions {}
1147
+
1148
+ /** @internal */
1149
+ type _StopAnimationOptions = NullishProps<{
1150
+ /**
1151
+ * Reset the TokenDocument?
1152
+ * @defaultValue `false`
1153
+ */
1154
+ reset: boolean;
1155
+ }>;
1156
+
1157
+ interface StopAnimationOptions extends _StopAnimationOptions {}
1158
+
1159
+ /** @internal */
1160
+ type _CheckCollisionOptions<Mode extends PointSourcePolygon.CollisionModes | undefined = undefined> =
1161
+ InexactPartial<{
1162
+ /**
1163
+ * The collision mode to test: "any", "all", or "closest"
1164
+ * @defaultValue `"any"`
1165
+ * @remarks Can't be `null` as it only has a parameter default
1166
+ */
1167
+ mode: Mode;
1168
+
1169
+ /**
1170
+ * The collision type
1171
+ * @defaultValue `"move"`
1172
+ * @remarks Can't be `null` as it only has a parameter default
1173
+ *
1174
+ * `"sound"` is a valid source type but explicitly throws if passed, so omitted here
1175
+ */
1176
+ type: "move" | "sight" | "light";
1177
+ }> &
1178
+ NullishProps<{
1179
+ /**
1180
+ * The origin to be used instead of the current origin
1181
+ */
1182
+ origin: Canvas.Point;
1183
+ }>;
1184
+
1185
+ interface CheckCollisionOptions<Mode extends PointSourcePolygon.CollisionModes | undefined = undefined>
1186
+ extends _CheckCollisionOptions<Mode> {}
1187
+
1188
+ /** Return type of {@link Token.getSize | `Token#getSize`} */
1189
+ interface Size {
1190
+ width: number;
1191
+ height: number;
1192
+ }
1193
+
1194
+ /**
1195
+ * @privateRemarks Foundry types this as `Point | (Point & {elevation: number}) | {elevation: number}`,
1196
+ * but this is misleading, as if an object is passed for the 2nd param of {@link Token.testInsideRegion | `Token#testInsideRegion`}
1197
+ * then it must contain `{x, y}` data, only if the value is nullish does the document's data get used.
1198
+ * Passing just `{elevation: number}` would result in `{x: undefined, y: undefined}`, causing
1199
+ * `PIXI.Rectangle#contains()` to always return false.
1200
+ *
1201
+ * Not reported, as `testInsideRegion` is deprecated and thus untyped in v13.
1202
+ */
1203
+ type TestablePosition = Canvas.Point & { elevation?: number };
1204
+
1205
+ type _InitializeSourcesOptions = NullishProps<{
1206
+ /**
1207
+ * Indicate that this source has been deleted.
1208
+ * @defaultValue `false`
1209
+ */
1210
+ deleted: boolean;
1211
+ }>;
1212
+
1213
+ interface InitializeSourcesOptions extends _InitializeSourcesOptions {}
1214
+
1215
+ /** @internal */
1216
+ type _TargetContext = NullishProps<{
1217
+ /**
1218
+ * Assign the token as a target for a specific User
1219
+ * @defaultValue `game.user`
1220
+ * @remarks `null` is the parameter default, but it's `||=`d with `game.user`
1221
+ */
1222
+ user: User.Implementation;
1223
+
1224
+ /**
1225
+ * Release other active targets for the same player?
1226
+ * @defaultValue `true`
1227
+ */
1228
+ releaseOthers: boolean;
1229
+
1230
+ /**
1231
+ * Is this target being set as part of a group selection workflow?
1232
+ * @defaultValue `false`
1233
+ */
1234
+ groupSelection: boolean;
1235
+ }>;
1236
+
1237
+ interface TargetContext extends _TargetContext {}
1238
+
1239
+ interface AnimationContext {
1240
+ /** The name of the animation */
1241
+ name: PropertyKey;
1242
+
1243
+ /**
1244
+ * The final animation state
1245
+ * @remarks This gets `mergeObject`ed with the return of {@link Token._getAnimationData | `Token#_getAnimationData`}
1246
+ */
1247
+ to: PartialAnimationData;
1248
+
1249
+ /** The duration of the animation */
1250
+ duration: number;
1251
+
1252
+ /** The current time of the animation */
1253
+ time: number;
1254
+
1255
+ /** Asynchronous functions that are executed before the animation starts */
1256
+ preAnimate: ((context: Token.AnimationContext) => Promise<void>)[];
1257
+
1258
+ /** Synchronous functions that are executed after the animation ended */
1259
+ postAnimate: ((context: Token.AnimationContext) => void)[];
1260
+
1261
+ /** Synchronous functions that are executed each frame after `ontick` and before {@link Token._onAnimationUpdate | `Token#_onAnimationUpdate`} */
1262
+ onAnimate: ((context: Token.AnimationContext) => void)[];
1263
+
1264
+ /**
1265
+ * The promise of the animation, which resolves to true if the animation
1266
+ * completed, to false if it was terminated, and rejects if an error occurred.
1267
+ * Undefined in the first frame (at time 0) of the animation.
1268
+ */
1269
+ promise?: Promise<boolean> | undefined;
1270
+ }
1271
+
1272
+ interface DragLeftDropUpdate {
1273
+ _id: string;
1274
+ x: number;
1275
+ y: number;
1276
+ }
1277
+
1278
+ /** @internal */
1279
+ type _RefreshHUDOptions = NullishProps<{
1280
+ bars: boolean;
1281
+ border: boolean;
1282
+ elevation: boolean;
1283
+ nameplate: boolean;
1284
+ effects: boolean;
1285
+ }>;
1286
+ interface RefreshHUDOptions extends _RefreshHUDOptions {}
1287
+ }
820
1288
  }