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