@7h3laughingman/foundry-types 13.351.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +3 -0
- package/package.json +76 -0
- package/src/client/_module.d.mts +103 -0
- package/src/client/_types.d.mts +900 -0
- package/src/client/applications/_module.d.mts +27 -0
- package/src/client/applications/_types.d.mts +192 -0
- package/src/client/applications/api/_module.d.mts +8 -0
- package/src/client/applications/api/application.d.mts +456 -0
- package/src/client/applications/api/category-browser.d.mts +78 -0
- package/src/client/applications/api/dialog.d.mts +213 -0
- package/src/client/applications/api/document-sheet.d.mts +148 -0
- package/src/client/applications/api/handlebars-application.d.mts +120 -0
- package/src/client/applications/apps/_module.d.mts +10 -0
- package/src/client/applications/apps/av/_module.d.mts +2 -0
- package/src/client/applications/apps/av/camera-popout.d.mts +53 -0
- package/src/client/applications/apps/av/cameras.d.mts +235 -0
- package/src/client/applications/apps/combat-tracker-config.d.mts +27 -0
- package/src/client/applications/apps/compendium-art-config.d.mts +17 -0
- package/src/client/applications/apps/document-ownership.d.mts +17 -0
- package/src/client/applications/apps/document-sheet-config.d.mts +144 -0
- package/src/client/applications/apps/file-picker.d.mts +321 -0
- package/src/client/applications/apps/grid-config.d.mts +33 -0
- package/src/client/applications/apps/image-popout.d.mts +92 -0
- package/src/client/applications/apps/permission-config.d.mts +24 -0
- package/src/client/applications/dice/_module.d.mts +1 -0
- package/src/client/applications/dice/roll-resolver.d.mts +92 -0
- package/src/client/applications/elements/_module.d.mts +19 -0
- package/src/client/applications/elements/codemirror/element.d.mts +73 -0
- package/src/client/applications/elements/color-picker.d.mts +14 -0
- package/src/client/applications/elements/document-embed.d.mts +14 -0
- package/src/client/applications/elements/document-tags.d.mts +50 -0
- package/src/client/applications/elements/enriched-content.d.mts +31 -0
- package/src/client/applications/elements/file-picker.d.mts +59 -0
- package/src/client/applications/elements/form-element.d.mts +105 -0
- package/src/client/applications/elements/hue-slider.d.mts +35 -0
- package/src/client/applications/elements/multi-select.d.mts +89 -0
- package/src/client/applications/elements/prosemirror-editor.d.mts +32 -0
- package/src/client/applications/elements/range-picker.d.mts +23 -0
- package/src/client/applications/elements/secret-block.d.mts +28 -0
- package/src/client/applications/elements/string-tags.d.mts +50 -0
- package/src/client/applications/forms/fields.d.mts +132 -0
- package/src/client/applications/handlebars.d.mts +303 -0
- package/src/client/applications/hud/_module.d.mts +5 -0
- package/src/client/applications/hud/container.d.mts +38 -0
- package/src/client/applications/hud/drawing-hud.d.mts +14 -0
- package/src/client/applications/hud/placeable-hud.d.mts +72 -0
- package/src/client/applications/hud/tile-hud.d.mts +21 -0
- package/src/client/applications/hud/token-hud.d.mts +69 -0
- package/src/client/applications/settings/_module.d.mts +2 -0
- package/src/client/applications/settings/config.d.mts +38 -0
- package/src/client/applications/settings/menus/_module.d.mts +6 -0
- package/src/client/applications/settings/menus/av-config.d.mts +37 -0
- package/src/client/applications/settings/menus/default-sheets-config.d.mts +23 -0
- package/src/client/applications/settings/menus/dice-config.d.mts +23 -0
- package/src/client/applications/settings/menus/font-config.d.mts +145 -0
- package/src/client/applications/settings/menus/prototype-overrides.d.mts +20 -0
- package/src/client/applications/settings/menus/ui-config.d.mts +40 -0
- package/src/client/applications/sheets/_module.d.mts +9 -0
- package/src/client/applications/sheets/combatant-config.d.mts +21 -0
- package/src/client/applications/sheets/item-sheet.d.mts +13 -0
- package/src/client/applications/sheets/scene-config.d.mts +50 -0
- package/src/client/applications/sheets/template-config.d.mts +19 -0
- package/src/client/applications/sheets/token/mixin.mts +182 -0
- package/src/client/applications/sheets/token/prototype-config.d.mts +75 -0
- package/src/client/applications/sheets/token/token-config.d.mts +62 -0
- package/src/client/applications/sheets/user-config.d.mts +27 -0
- package/src/client/applications/sidebar/_module.d.mts +5 -0
- package/src/client/applications/sidebar/apps/_module.d.mts +9 -0
- package/src/client/applications/sidebar/apps/chat-popout.d.mts +45 -0
- package/src/client/applications/sidebar/apps/compendium.d.mts +65 -0
- package/src/client/applications/sidebar/apps/controls-config.d.mts +29 -0
- package/src/client/applications/sidebar/apps/folder-export.d.mts +11 -0
- package/src/client/applications/sidebar/apps/invitation-links.d.mts +10 -0
- package/src/client/applications/sidebar/apps/module-management.d.mts +65 -0
- package/src/client/applications/sidebar/apps/support-details.d.mts +72 -0
- package/src/client/applications/sidebar/apps/tours-management.d.mts +16 -0
- package/src/client/applications/sidebar/apps/world-config.d.mts +38 -0
- package/src/client/applications/sidebar/document-directory.d.mts +327 -0
- package/src/client/applications/sidebar/sidebar-tab.d.mts +89 -0
- package/src/client/applications/sidebar/sidebar.d.mts +93 -0
- package/src/client/applications/sidebar/tabs/_module.d.mts +14 -0
- package/src/client/applications/sidebar/tabs/actor-directory.d.mts +26 -0
- package/src/client/applications/sidebar/tabs/cards-directory.d.mts +19 -0
- package/src/client/applications/sidebar/tabs/chat.d.mts +271 -0
- package/src/client/applications/sidebar/tabs/combat-tracker.d.mts +198 -0
- package/src/client/applications/sidebar/tabs/compendium-directory.d.mts +289 -0
- package/src/client/applications/sidebar/tabs/item-directory.d.mts +24 -0
- package/src/client/applications/sidebar/tabs/journal-directory.d.mts +19 -0
- package/src/client/applications/sidebar/tabs/macro-directory.d.mts +12 -0
- package/src/client/applications/sidebar/tabs/playlist-directory.d.mts +267 -0
- package/src/client/applications/sidebar/tabs/roll-table-directory.d.mts +19 -0
- package/src/client/applications/sidebar/tabs/scene-directory.d.mts +26 -0
- package/src/client/applications/sidebar/tabs/settings.d.mts +16 -0
- package/src/client/applications/ui/_module.d.mts +9 -0
- package/src/client/applications/ui/game-pause.d.mts +15 -0
- package/src/client/applications/ui/hotbar.d.mts +86 -0
- package/src/client/applications/ui/main-menu.d.mts +48 -0
- package/src/client/applications/ui/notifications.d.mts +168 -0
- package/src/client/applications/ui/players.d.mts +92 -0
- package/src/client/applications/ui/region-legend.d.mts +47 -0
- package/src/client/applications/ui/scene-controls.d.mts +138 -0
- package/src/client/applications/ui/scene-navigation.d.mts +61 -0
- package/src/client/applications/ux/_module.d.mts +11 -0
- package/src/client/applications/ux/context-menu.d.mts +202 -0
- package/src/client/applications/ux/drag-drop.d.mts +131 -0
- package/src/client/applications/ux/draggable.d.mts +108 -0
- package/src/client/applications/ux/form-data-extended.d.mts +76 -0
- package/src/client/applications/ux/html-secret.d.mts +61 -0
- package/src/client/applications/ux/prosemirror-editor.d.mts +173 -0
- package/src/client/applications/ux/search-filter.d.mts +119 -0
- package/src/client/applications/ux/tabs.d.mts +94 -0
- package/src/client/applications/ux/text-editor.d.mts +329 -0
- package/src/client/appv1/_module.d.mts +2 -0
- package/src/client/appv1/api/_module.d.mts +8 -0
- package/src/client/appv1/api/application-v1.d.mts +388 -0
- package/src/client/appv1/api/dialog-v1.d.mts +191 -0
- package/src/client/appv1/api/document-sheet-v1.d.mts +96 -0
- package/src/client/appv1/api/form-application-v1.d.mts +203 -0
- package/src/client/appv1/sheets/_module.d.mts +9 -0
- package/src/client/appv1/sheets/actor-sheet.d.mts +129 -0
- package/src/client/appv1/sheets/adventure-importer.d.mts +43 -0
- package/src/client/appv1/sheets/item-sheet.d.mts +42 -0
- package/src/client/appv1/sheets/journal-page-sheet.d.mts +100 -0
- package/src/client/appv1/sheets/journal-sheet.d.mts +262 -0
- package/src/client/audio/_module.d.mts +9 -0
- package/src/client/audio/_types.d.mts +121 -0
- package/src/client/audio/biquad.d.mts +29 -0
- package/src/client/audio/cache.d.mts +58 -0
- package/src/client/audio/convolver.d.mts +50 -0
- package/src/client/audio/helper.d.mts +306 -0
- package/src/client/audio/sound.d.mts +289 -0
- package/src/client/audio/timeout.d.mts +71 -0
- package/src/client/av/_module.d.mts +7 -0
- package/src/client/av/client.d.mts +167 -0
- package/src/client/av/clients/_module.d.mts +1 -0
- package/src/client/av/clients/simplepeer.d.mts +123 -0
- package/src/client/av/master.d.mts +128 -0
- package/src/client/av/settings.d.mts +100 -0
- package/src/client/canvas/_module.d.mts +20 -0
- package/src/client/canvas/animation/_module.d.mts +5 -0
- package/src/client/canvas/animation/_types.d.mts +73 -0
- package/src/client/canvas/animation/canvas-animation.d.mts +114 -0
- package/src/client/canvas/animation/chat-bubbles.d.mts +58 -0
- package/src/client/canvas/animation/smooth-noise.d.mts +34 -0
- package/src/client/canvas/board.d.mts +413 -0
- package/src/client/canvas/containers/_module.d.mts +20 -0
- package/src/client/canvas/containers/_types.d.mts +21 -0
- package/src/client/canvas/containers/advanced/cached-container.d.mts +108 -0
- package/src/client/canvas/containers/advanced/full-canvas-mixin.d.mts +12 -0
- package/src/client/canvas/containers/advanced/full-container-mixin.d.mts +12 -0
- package/src/client/canvas/containers/advanced/unbound-container.d.mts +12 -0
- package/src/client/canvas/containers/elements/control-icon.d.mts +40 -0
- package/src/client/canvas/containers/elements/cursor.d.mts +37 -0
- package/src/client/canvas/containers/elements/door-control.d.mts +66 -0
- package/src/client/canvas/containers/elements/door-mesh.d.mts +127 -0
- package/src/client/canvas/containers/elements/grid-highlight.d.mts +25 -0
- package/src/client/canvas/containers/elements/grid-mesh.d.mts +34 -0
- package/src/client/canvas/containers/elements/particles/leaves.d.mts +15 -0
- package/src/client/canvas/containers/elements/particles/particle-effect.d.mts +45 -0
- package/src/client/canvas/containers/elements/point-source-mesh.d.mts +29 -0
- package/src/client/canvas/containers/elements/precise-text.d.mts +18 -0
- package/src/client/canvas/containers/elements/quad-mesh.d.mts +41 -0
- package/src/client/canvas/containers/elements/resize-handle.d.mts +61 -0
- package/src/client/canvas/containers/elements/sprite-mesh.d.mts +319 -0
- package/src/client/canvas/extensions/_module.d.mts +4 -0
- package/src/client/canvas/extensions/circle-extension.d.mts +4 -0
- package/src/client/canvas/extensions/graphics-extension.d.mts +5 -0
- package/src/client/canvas/extensions/polygon-extension.d.mts +4 -0
- package/src/client/canvas/extensions/rectangle-extension.d.mts +4 -0
- package/src/client/canvas/framebuffer-snapshot.d.mts +20 -0
- package/src/client/canvas/geometry/_module.d.mts +12 -0
- package/src/client/canvas/geometry/_types.d.mts +90 -0
- package/src/client/canvas/geometry/clockwise-sweep.d.mts +129 -0
- package/src/client/canvas/geometry/edges/_module.d.mts +5 -0
- package/src/client/canvas/geometry/edges/collision.d.mts +58 -0
- package/src/client/canvas/geometry/edges/edge.d.mts +144 -0
- package/src/client/canvas/geometry/edges/edges.d.mts +14 -0
- package/src/client/canvas/geometry/edges/vertex.d.mts +85 -0
- package/src/client/canvas/geometry/observable-transform.d.mts +28 -0
- package/src/client/canvas/geometry/quad-tree.d.mts +150 -0
- package/src/client/canvas/geometry/shapes/limited-angle-polygon.d.mts +69 -0
- package/src/client/canvas/geometry/shapes/polygon-mesher.d.mts +50 -0
- package/src/client/canvas/geometry/shapes/ray.d.mts +126 -0
- package/src/client/canvas/geometry/shapes/source-polygon.d.mts +161 -0
- package/src/client/canvas/geometry/unbound-transform.d.mts +9 -0
- package/src/client/canvas/geometry/weiler-atherton-clipping.d.mts +120 -0
- package/src/client/canvas/groups/_module.d.mts +10 -0
- package/src/client/canvas/groups/canvas-group-mixin.mts +95 -0
- package/src/client/canvas/groups/effects.d.mts +118 -0
- package/src/client/canvas/groups/environment.d.mts +79 -0
- package/src/client/canvas/groups/hidden.d.mts +42 -0
- package/src/client/canvas/groups/interface.d.mts +31 -0
- package/src/client/canvas/groups/overlay.d.mts +11 -0
- package/src/client/canvas/groups/primary.d.mts +223 -0
- package/src/client/canvas/groups/rendered.d.mts +7 -0
- package/src/client/canvas/groups/visibility.d.mts +154 -0
- package/src/client/canvas/interaction/_module.d.mts +15 -0
- package/src/client/canvas/interaction/_types.d.mts +67 -0
- package/src/client/canvas/interaction/mouse-handler.d.mts +231 -0
- package/src/client/canvas/interaction/ping/alert.d.mts +16 -0
- package/src/client/canvas/interaction/ping/arrow.d.mts +16 -0
- package/src/client/canvas/interaction/ping/chevron.d.mts +25 -0
- package/src/client/canvas/interaction/ping/ping.d.mts +35 -0
- package/src/client/canvas/interaction/ping/pulse.d.mts +28 -0
- package/src/client/canvas/interaction/render-flags.d.mts +69 -0
- package/src/client/canvas/interaction/ruler/base-ruler.d.mts +179 -0
- package/src/client/canvas/interaction/ruler/ruler.d.mts +56 -0
- package/src/client/canvas/layers/_module.d.mts +31 -0
- package/src/client/canvas/layers/_types.d.mts +89 -0
- package/src/client/canvas/layers/base/canvas-layer.d.mts +71 -0
- package/src/client/canvas/layers/base/interaction-layer.d.mts +176 -0
- package/src/client/canvas/layers/base/placeables-layer.d.mts +410 -0
- package/src/client/canvas/layers/controls.d.mts +181 -0
- package/src/client/canvas/layers/drawings.d.mts +75 -0
- package/src/client/canvas/layers/effects/background-effects.d.mts +32 -0
- package/src/client/canvas/layers/effects/coloration-effects.d.mts +23 -0
- package/src/client/canvas/layers/effects/darkness-effects.d.mts +14 -0
- package/src/client/canvas/layers/effects/illumination-effects.d.mts +72 -0
- package/src/client/canvas/layers/effects/weather-effects.d.mts +137 -0
- package/src/client/canvas/layers/grid.d.mts +112 -0
- package/src/client/canvas/layers/lighting.d.mts +59 -0
- package/src/client/canvas/layers/masks/depth.d.mts +53 -0
- package/src/client/canvas/layers/masks/occlusion.d.mts +84 -0
- package/src/client/canvas/layers/masks/vision.d.mts +44 -0
- package/src/client/canvas/layers/notes.d.mts +59 -0
- package/src/client/canvas/layers/regions.d.mts +70 -0
- package/src/client/canvas/layers/sounds.d.mts +190 -0
- package/src/client/canvas/layers/templates.d.mts +41 -0
- package/src/client/canvas/layers/tiles.d.mts +66 -0
- package/src/client/canvas/layers/tokens.d.mts +171 -0
- package/src/client/canvas/layers/walls.d.mts +99 -0
- package/src/client/canvas/loader.d.mts +135 -0
- package/src/client/canvas/perception/_module.d.mts +13 -0
- package/src/client/canvas/perception/_types.d.mts +61 -0
- package/src/client/canvas/perception/detection-mode.d.mts +122 -0
- package/src/client/canvas/perception/detection-modes/darkvision.d.mts +11 -0
- package/src/client/canvas/perception/detection-modes/invisibility-perception.d.mts +15 -0
- package/src/client/canvas/perception/detection-modes/light-perception.d.mts +18 -0
- package/src/client/canvas/perception/detection-modes/super-perception.d.mts +13 -0
- package/src/client/canvas/perception/detection-modes/tremor-perception.d.mts +13 -0
- package/src/client/canvas/perception/fog.d.mts +65 -0
- package/src/client/canvas/perception/perception-manager.d.mts +72 -0
- package/src/client/canvas/perception/vision-mode.d.mts +133 -0
- package/src/client/canvas/placeables/_module.d.mts +15 -0
- package/src/client/canvas/placeables/_types.d.mts +29 -0
- package/src/client/canvas/placeables/drawing.d.mts +106 -0
- package/src/client/canvas/placeables/light.d.mts +155 -0
- package/src/client/canvas/placeables/note.d.mts +61 -0
- package/src/client/canvas/placeables/placeable-object.d.mts +415 -0
- package/src/client/canvas/placeables/region.d.mts +129 -0
- package/src/client/canvas/placeables/regions/_module.d.mts +2 -0
- package/src/client/canvas/placeables/regions/geometry.d.mts +19 -0
- package/src/client/canvas/placeables/regions/mesh.d.mts +72 -0
- package/src/client/canvas/placeables/sound.d.mts +93 -0
- package/src/client/canvas/placeables/template.d.mts +164 -0
- package/src/client/canvas/placeables/tile.d.mts +189 -0
- package/src/client/canvas/placeables/token.d.mts +675 -0
- package/src/client/canvas/placeables/tokens/_module.d.mts +8 -0
- package/src/client/canvas/placeables/tokens/base-ruler.d.mts +68 -0
- package/src/client/canvas/placeables/tokens/ring-config.d.mts +201 -0
- package/src/client/canvas/placeables/tokens/ring-data.d.mts +56 -0
- package/src/client/canvas/placeables/tokens/ring.d.mts +194 -0
- package/src/client/canvas/placeables/tokens/ruler.d.mts +96 -0
- package/src/client/canvas/placeables/tokens/targets.d.mts +22 -0
- package/src/client/canvas/placeables/tokens/turn-marker-data.d.mts +52 -0
- package/src/client/canvas/placeables/tokens/turn-marker.d.mts +45 -0
- package/src/client/canvas/placeables/wall.d.mts +155 -0
- package/src/client/canvas/primary/_module.d.mts +7 -0
- package/src/client/canvas/primary/primary-canvas-container.d.mts +40 -0
- package/src/client/canvas/primary/primary-canvas-object.mts +215 -0
- package/src/client/canvas/primary/primary-graphics.d.mts +22 -0
- package/src/client/canvas/primary/primary-occludable-object.mts +139 -0
- package/src/client/canvas/primary/primary-particle-effect.d.mts +50 -0
- package/src/client/canvas/primary/primary-sprite-mesh.d.mts +127 -0
- package/src/client/canvas/rendering/_module.d.mts +5 -0
- package/src/client/canvas/rendering/batching/_module.d.mts +2 -0
- package/src/client/canvas/rendering/batching/batch-renderer.d.mts +71 -0
- package/src/client/canvas/rendering/batching/batch-shader-generator.d.mts +13 -0
- package/src/client/canvas/rendering/blend-modes.d.mts +37 -0
- package/src/client/canvas/rendering/filters/_module.d.mts +13 -0
- package/src/client/canvas/rendering/filters/base-filter.d.mts +28 -0
- package/src/client/canvas/rendering/filters/base-mask-filter.d.mts +14 -0
- package/src/client/canvas/rendering/filters/blur.d.mts +152 -0
- package/src/client/canvas/rendering/filters/effects-masking.d.mts +84 -0
- package/src/client/canvas/rendering/filters/environment.d.mts +22 -0
- package/src/client/canvas/rendering/filters/glow-overlay.d.mts +41 -0
- package/src/client/canvas/rendering/filters/invisibility.d.mts +11 -0
- package/src/client/canvas/rendering/filters/outline-overlay.d.mts +43 -0
- package/src/client/canvas/rendering/filters/smaa/_module.d.mts +4 -0
- package/src/client/canvas/rendering/filters/smaa/blend.d.mts +6 -0
- package/src/client/canvas/rendering/filters/smaa/edges.d.mts +11 -0
- package/src/client/canvas/rendering/filters/smaa/smaa.d.mts +102 -0
- package/src/client/canvas/rendering/filters/smaa/weights.d.mts +11 -0
- package/src/client/canvas/rendering/filters/transition.d.mts +97 -0
- package/src/client/canvas/rendering/filters/visibility.d.mts +46 -0
- package/src/client/canvas/rendering/filters/vision-mask-filter.d.mts +15 -0
- package/src/client/canvas/rendering/filters/void.d.mts +6 -0
- package/src/client/canvas/rendering/filters/weather-occlusion-mask.d.mts +30 -0
- package/src/client/canvas/rendering/mixins/_module.d.mts +2 -0
- package/src/client/canvas/rendering/mixins/base-shader-mixin.d.mts +118 -0
- package/src/client/canvas/rendering/mixins/fragment-channel-mixin.d.mts +21 -0
- package/src/client/canvas/rendering/shaders/_module.d.mts +80 -0
- package/src/client/canvas/rendering/shaders/_types.d.mts +98 -0
- package/src/client/canvas/rendering/shaders/base-shader.d.mts +58 -0
- package/src/client/canvas/rendering/shaders/graphics/dash-line.d.mts +13 -0
- package/src/client/canvas/rendering/shaders/grid/grid.d.mts +99 -0
- package/src/client/canvas/rendering/shaders/lighting/background-lighting.d.mts +50 -0
- package/src/client/canvas/rendering/shaders/lighting/base-lighting.d.mts +164 -0
- package/src/client/canvas/rendering/shaders/lighting/coloration-lighting.d.mts +48 -0
- package/src/client/canvas/rendering/shaders/lighting/darkness-lighting.d.mts +45 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/bewitching-wave.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/black-hole.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/chroma.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/emanation.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/energy-field.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/fairy-light.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/flame.d.mts +75 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/fog.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/force-grid.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/ghost-light.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/hexa-dome.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/light-dome.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/magical-gloom.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/pulse.d.mts +41 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/radial-rainbow.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/revolving-light.d.mts +38 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/roiling-mass.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/siren-light.d.mts +80 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/smoke-patch.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/star-light.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/sunburst.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/swirling-rainbow.d.mts +5 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/torch.d.mts +41 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/vortex.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/effects/wave.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/lighting/illumination-lighting.d.mts +51 -0
- package/src/client/canvas/rendering/shaders/region/adjust-darkness-level.d.mts +58 -0
- package/src/client/canvas/rendering/shaders/region/base.d.mts +20 -0
- package/src/client/canvas/rendering/shaders/region/highlight.d.mts +18 -0
- package/src/client/canvas/rendering/shaders/samplers/amplification.d.mts +30 -0
- package/src/client/canvas/rendering/shaders/samplers/base-sampler.d.mts +141 -0
- package/src/client/canvas/rendering/shaders/samplers/baseline-illumination.d.mts +15 -0
- package/src/client/canvas/rendering/shaders/samplers/color-adjustments.d.mts +36 -0
- package/src/client/canvas/rendering/shaders/samplers/colorize-brightness.d.mts +17 -0
- package/src/client/canvas/rendering/shaders/samplers/fog-of-war.d.mts +9 -0
- package/src/client/canvas/rendering/shaders/samplers/primary/depth.d.mts +66 -0
- package/src/client/canvas/rendering/shaders/samplers/primary/occlusion.d.mts +77 -0
- package/src/client/canvas/rendering/shaders/samplers/primary/primary.d.mts +28 -0
- package/src/client/canvas/rendering/shaders/samplers/primary/token-ring.d.mts +33 -0
- package/src/client/canvas/rendering/shaders/vision/background-vision.d.mts +47 -0
- package/src/client/canvas/rendering/shaders/vision/base-vision.d.mts +11 -0
- package/src/client/canvas/rendering/shaders/vision/coloration-vision.d.mts +43 -0
- package/src/client/canvas/rendering/shaders/vision/effects/amplification.d.mts +35 -0
- package/src/client/canvas/rendering/shaders/vision/effects/wave.d.mts +10 -0
- package/src/client/canvas/rendering/shaders/vision/illumination-vision.d.mts +45 -0
- package/src/client/canvas/rendering/shaders/weather/base-weather.d.mts +87 -0
- package/src/client/canvas/rendering/shaders/weather/effect.d.mts +27 -0
- package/src/client/canvas/rendering/shaders/weather/fog.d.mts +26 -0
- package/src/client/canvas/rendering/shaders/weather/rain.d.mts +16 -0
- package/src/client/canvas/rendering/shaders/weather/snow.d.mts +12 -0
- package/src/client/canvas/scene-manager.d.mts +101 -0
- package/src/client/canvas/sources/_module.d.mts +10 -0
- package/src/client/canvas/sources/base-effect-source.d.mts +179 -0
- package/src/client/canvas/sources/base-light-source.d.mts +141 -0
- package/src/client/canvas/sources/global-light-source.d.mts +36 -0
- package/src/client/canvas/sources/point-darkness-source.d.mts +87 -0
- package/src/client/canvas/sources/point-effect-source.d.mts +105 -0
- package/src/client/canvas/sources/point-light-source.d.mts +54 -0
- package/src/client/canvas/sources/point-movement-source.d.mts +10 -0
- package/src/client/canvas/sources/point-sound-source.d.mts +29 -0
- package/src/client/canvas/sources/point-vision-source.d.mts +151 -0
- package/src/client/canvas/sources/rendered-effect-source.d.mts +214 -0
- package/src/client/canvas/texture-extractor.d.mts +98 -0
- package/src/client/canvas/workers/_module.d.mts +1 -0
- package/src/client/canvas/workers/texture-worker.d.mts +73 -0
- package/src/client/client.d.mts +15 -0
- package/src/client/config.d.mts +868 -0
- package/src/client/data/_module.d.mts +11 -0
- package/src/client/data/_types.d.mts +97 -0
- package/src/client/data/calendar.d.mts +175 -0
- package/src/client/data/client-backend.d.mts +82 -0
- package/src/client/data/combat-config.d.mts +84 -0
- package/src/client/data/region-behaviors/_module.d.mts +9 -0
- package/src/client/data/region-behaviors/adjust-darkness-level.d.mts +29 -0
- package/src/client/data/region-behaviors/base.d.mts +70 -0
- package/src/client/data/region-behaviors/execute-macro.d.mts +17 -0
- package/src/client/data/region-behaviors/execute-script.d.mts +15 -0
- package/src/client/data/region-behaviors/increase-movement-cost.d.mts +36 -0
- package/src/client/data/region-behaviors/pause-game.d.mts +15 -0
- package/src/client/data/region-behaviors/suppress-weather.d.mts +13 -0
- package/src/client/data/region-behaviors/teleport-token.d.mts +27 -0
- package/src/client/data/region-behaviors/toggle-behavior.d.mts +19 -0
- package/src/client/data/region-shapes/_module.d.mts +2 -0
- package/src/client/data/region-shapes/polygon-tree.d.mts +101 -0
- package/src/client/data/region-shapes/shape.d.mts +97 -0
- package/src/client/data/terrain-data.d.mts +70 -0
- package/src/client/dice/_module.d.mts +14 -0
- package/src/client/dice/_types.d.mts +89 -0
- package/src/client/dice/parser.d.mts +83 -0
- package/src/client/dice/roll.d.mts +542 -0
- package/src/client/dice/terms/_module.d.mts +16 -0
- package/src/client/dice/terms/_types.d.mts +10 -0
- package/src/client/dice/terms/coin.d.mts +35 -0
- package/src/client/dice/terms/dice.d.mts +263 -0
- package/src/client/dice/terms/die.d.mts +199 -0
- package/src/client/dice/terms/fate.d.mts +22 -0
- package/src/client/dice/terms/function.d.mts +60 -0
- package/src/client/dice/terms/numeric.d.mts +39 -0
- package/src/client/dice/terms/operator.d.mts +28 -0
- package/src/client/dice/terms/parenthetical.d.mts +70 -0
- package/src/client/dice/terms/pool.d.mts +170 -0
- package/src/client/dice/terms/string.d.mts +23 -0
- package/src/client/dice/terms/term.d.mts +135 -0
- package/src/client/dice/twister.d.mts +87 -0
- package/src/client/documents/_module.d.mts +70 -0
- package/src/client/documents/_types.d.mts +736 -0
- package/src/client/documents/abstract/_module.d.mts +6 -0
- package/src/client/documents/abstract/canvas-document.d.mts +65 -0
- package/src/client/documents/abstract/client-document.d.mts +545 -0
- package/src/client/documents/abstract/directory-collection-mixin.d.mts +79 -0
- package/src/client/documents/abstract/document-collection.d.mts +124 -0
- package/src/client/documents/abstract/world-collection.d.mts +157 -0
- package/src/client/documents/active-effect.d.mts +203 -0
- package/src/client/documents/actor-delta.d.mts +76 -0
- package/src/client/documents/actor.d.mts +269 -0
- package/src/client/documents/adventure.d.mts +38 -0
- package/src/client/documents/ambient-light.d.mts +34 -0
- package/src/client/documents/ambient-sound.d.mts +16 -0
- package/src/client/documents/card.d.mts +102 -0
- package/src/client/documents/cards.d.mts +38 -0
- package/src/client/documents/chat-message.d.mts +190 -0
- package/src/client/documents/collections/_module.d.mts +19 -0
- package/src/client/documents/collections/actors.d.mts +28 -0
- package/src/client/documents/collections/card-stacks.d.mts +14 -0
- package/src/client/documents/collections/chat-messages.d.mts +29 -0
- package/src/client/documents/collections/combat-encounters.d.mts +32 -0
- package/src/client/documents/collections/compendium-collection.d.mts +170 -0
- package/src/client/documents/collections/compendium-folders.d.mts +30 -0
- package/src/client/documents/collections/compendium-packs.d.mts +23 -0
- package/src/client/documents/collections/fog-explorations.d.mts +19 -0
- package/src/client/documents/collections/folders.d.mts +20 -0
- package/src/client/documents/collections/items.d.mts +13 -0
- package/src/client/documents/collections/journal.d.mts +24 -0
- package/src/client/documents/collections/macros.d.mts +15 -0
- package/src/client/documents/collections/playlists.d.mts +28 -0
- package/src/client/documents/collections/roll-tables.d.mts +20 -0
- package/src/client/documents/collections/scenes.d.mts +60 -0
- package/src/client/documents/collections/users.d.mts +57 -0
- package/src/client/documents/collections/world-settings.d.mts +34 -0
- package/src/client/documents/combat.d.mts +371 -0
- package/src/client/documents/combatant-group.d.mts +42 -0
- package/src/client/documents/combatant.d.mts +125 -0
- package/src/client/documents/drawing.d.mts +27 -0
- package/src/client/documents/fog-exploration.d.mts +30 -0
- package/src/client/documents/folder.d.mts +124 -0
- package/src/client/documents/item.d.mts +73 -0
- package/src/client/documents/journal-entry-category.d.mts +15 -0
- package/src/client/documents/journal-entry-page.d.mts +77 -0
- package/src/client/documents/journal-entry.d.mts +78 -0
- package/src/client/documents/macro.d.mts +56 -0
- package/src/client/documents/measured-template.d.mts +41 -0
- package/src/client/documents/note.d.mts +28 -0
- package/src/client/documents/playlist-sound.d.mts +107 -0
- package/src/client/documents/playlist.d.mts +163 -0
- package/src/client/documents/region-behavior.d.mts +55 -0
- package/src/client/documents/region.d.mts +98 -0
- package/src/client/documents/roll-table.d.mts +172 -0
- package/src/client/documents/scene.d.mts +282 -0
- package/src/client/documents/setting.d.mts +35 -0
- package/src/client/documents/table-result.d.mts +35 -0
- package/src/client/documents/tile.d.mts +22 -0
- package/src/client/documents/token.d.mts +621 -0
- package/src/client/documents/user.d.mts +148 -0
- package/src/client/documents/wall.d.mts +20 -0
- package/src/client/game.d.mts +231 -0
- package/src/client/global.d.mts +28 -0
- package/src/client/helpers/_module.d.mts +13 -0
- package/src/client/helpers/_types.d.mts +26 -0
- package/src/client/helpers/client-issues.d.mts +90 -0
- package/src/client/helpers/client-settings.d.mts +191 -0
- package/src/client/helpers/document-index.d.mts +81 -0
- package/src/client/helpers/hooks.d.mts +210 -0
- package/src/client/helpers/interaction/_module.d.mts +6 -0
- package/src/client/helpers/interaction/client-keybindings.d.mts +143 -0
- package/src/client/helpers/interaction/clipboard-helper.d.mts +14 -0
- package/src/client/helpers/interaction/gamepad-manager.d.mts +15 -0
- package/src/client/helpers/interaction/keyboard-manager.d.mts +189 -0
- package/src/client/helpers/interaction/mouse-manager.d.mts +20 -0
- package/src/client/helpers/interaction/tooltip-manager.d.mts +227 -0
- package/src/client/helpers/localization.d.mts +143 -0
- package/src/client/helpers/media/_module.d.mts +3 -0
- package/src/client/helpers/media/compendium-art.d.mts +29 -0
- package/src/client/helpers/media/image-helper.d.mts +116 -0
- package/src/client/helpers/media/video-helper.d.mts +113 -0
- package/src/client/helpers/socket-interface.d.mts +14 -0
- package/src/client/helpers/time.d.mts +92 -0
- package/src/client/helpers/workers.d.mts +92 -0
- package/src/client/nue/_module.d.mts +13 -0
- package/src/client/nue/nue-manager.d.mts +13 -0
- package/src/client/nue/tour.d.mts +283 -0
- package/src/client/nue/tours/_module.d.mts +1 -0
- package/src/client/nue/tours-collection.d.mts +23 -0
- package/src/client/packages/_module.d.mts +19 -0
- package/src/client/packages/_types.d.mts +12 -0
- package/src/client/packages/client-package.mts +145 -0
- package/src/client/packages/module.d.mts +12 -0
- package/src/client/packages/system.d.mts +9 -0
- package/src/client/packages/world.d.mts +28 -0
- package/src/client/ui.d.mts +86 -0
- package/src/client/utils/_module.d.mts +4 -0
- package/src/client/utils/helpers.d.mts +148 -0
- package/src/common/_types.d.mts +151 -0
- package/src/common/abstract/_module.d.mts +8 -0
- package/src/common/abstract/_types.d.mts +187 -0
- package/src/common/abstract/backend.d.mts +159 -0
- package/src/common/abstract/data.d.mts +213 -0
- package/src/common/abstract/document.d.mts +700 -0
- package/src/common/abstract/embedded-collection.d.mts +141 -0
- package/src/common/abstract/socket.d.mts +35 -0
- package/src/common/abstract/type-data.d.mts +163 -0
- package/src/common/config.d.mts +147 -0
- package/src/common/constants.d.mts +2184 -0
- package/src/common/data/_module.d.mts +6 -0
- package/src/common/data/_types.d.mts +329 -0
- package/src/common/data/data.d.mts +390 -0
- package/src/common/data/fields.d.mts +1377 -0
- package/src/common/data/validation-failure.d.mts +127 -0
- package/src/common/data/validators.d.mts +35 -0
- package/src/common/documents/_module.d.mts +64 -0
- package/src/common/documents/_types.d.mts +1 -0
- package/src/common/documents/active-effect.d.mts +87 -0
- package/src/common/documents/actor-delta.d.mts +81 -0
- package/src/common/documents/actor.d.mts +105 -0
- package/src/common/documents/adventure.d.mts +105 -0
- package/src/common/documents/ambient-light.d.mts +49 -0
- package/src/common/documents/ambient-sound.d.mts +72 -0
- package/src/common/documents/card.d.mts +98 -0
- package/src/common/documents/cards.d.mts +89 -0
- package/src/common/documents/chat-message.d.mts +107 -0
- package/src/common/documents/combat.d.mts +55 -0
- package/src/common/documents/combatant-group.d.mts +45 -0
- package/src/common/documents/combatant.d.mts +48 -0
- package/src/common/documents/drawing.d.mts +101 -0
- package/src/common/documents/fog-exploration.d.mts +50 -0
- package/src/common/documents/folder.d.mts +65 -0
- package/src/common/documents/item.d.mts +86 -0
- package/src/common/documents/journal-entry-category.d.mts +32 -0
- package/src/common/documents/journal-entry-page.d.mts +76 -0
- package/src/common/documents/journal-entry.d.mts +50 -0
- package/src/common/documents/macro.d.mts +87 -0
- package/src/common/documents/measured-template.d.mts +72 -0
- package/src/common/documents/note.d.mts +82 -0
- package/src/common/documents/playlist-sound.d.mts +53 -0
- package/src/common/documents/playlist.d.mts +48 -0
- package/src/common/documents/region-behavior.d.mts +49 -0
- package/src/common/documents/region.d.mts +61 -0
- package/src/common/documents/roll-table.d.mts +70 -0
- package/src/common/documents/scene.d.mts +237 -0
- package/src/common/documents/setting.d.mts +49 -0
- package/src/common/documents/table-result.d.mts +61 -0
- package/src/common/documents/tile.d.mts +88 -0
- package/src/common/documents/token.d.mts +213 -0
- package/src/common/documents/user.d.mts +82 -0
- package/src/common/documents/wall.d.mts +72 -0
- package/src/common/grid/_module.d.mts +6 -0
- package/src/common/grid/_types.d.mts +250 -0
- package/src/common/grid/base.d.mts +266 -0
- package/src/common/grid/grid-hex.d.mts +53 -0
- package/src/common/grid/gridless.d.mts +85 -0
- package/src/common/grid/hexagonal.d.mts +191 -0
- package/src/common/grid/square.d.mts +90 -0
- package/src/common/packages/_module.d.mts +6 -0
- package/src/common/packages/_types.d.mts +7 -0
- package/src/common/packages/base-module.d.mts +32 -0
- package/src/common/packages/base-package.d.mts +297 -0
- package/src/common/packages/base-system.d.mts +42 -0
- package/src/common/packages/base-world.d.mts +51 -0
- package/src/common/packages/sub-types.d.mts +12 -0
- package/src/common/primitives/_module.d.mts +10 -0
- package/src/common/primitives/array.d.mts +58 -0
- package/src/common/primitives/date.d.mts +24 -0
- package/src/common/primitives/math.d.mts +70 -0
- package/src/common/primitives/number.d.mts +79 -0
- package/src/common/primitives/regexp.d.mts +12 -0
- package/src/common/primitives/set.d.mts +129 -0
- package/src/common/primitives/string.d.mts +24 -0
- package/src/common/primitives/url.d.mts +12 -0
- package/src/common/prosemirror/_module.d.mts +77 -0
- package/src/common/prosemirror/_types.d.mts +75 -0
- package/src/common/prosemirror/click-handler.d.mts +24 -0
- package/src/common/prosemirror/content-link-plugin.d.mts +34 -0
- package/src/common/prosemirror/dirty-plugin.d.mts +10 -0
- package/src/common/prosemirror/dom-parser.d.mts +7 -0
- package/src/common/prosemirror/dropdown.d.mts +50 -0
- package/src/common/prosemirror/highlight-matches-plugin.d.mts +38 -0
- package/src/common/prosemirror/image-plugin.d.mts +70 -0
- package/src/common/prosemirror/input-rules.d.mts +24 -0
- package/src/common/prosemirror/keymaps.d.mts +27 -0
- package/src/common/prosemirror/menu.d.mts +206 -0
- package/src/common/prosemirror/paste-transformer.d.mts +10 -0
- package/src/common/prosemirror/plugin.d.mts +21 -0
- package/src/common/prosemirror/schema/_types.d.mts +15 -0
- package/src/common/prosemirror/schema/attribute-capture.d.mts +13 -0
- package/src/common/prosemirror/schema/core.d.mts +58 -0
- package/src/common/prosemirror/schema/image-link-node.d.mts +27 -0
- package/src/common/prosemirror/schema/image-node.d.mts +17 -0
- package/src/common/prosemirror/schema/link-mark.d.mts +29 -0
- package/src/common/prosemirror/schema/lists.d.mts +71 -0
- package/src/common/prosemirror/schema/marks.d.mts +49 -0
- package/src/common/prosemirror/schema/other.d.mts +161 -0
- package/src/common/prosemirror/schema/schema-definition.d.mts +43 -0
- package/src/common/prosemirror/schema/secret-node.d.mts +25 -0
- package/src/common/prosemirror/schema/tables.d.mts +161 -0
- package/src/common/prosemirror/schema/utils.d.mts +37 -0
- package/src/common/prosemirror/schema.d.mts +7 -0
- package/src/common/prosemirror/string-serializer.d.mts +84 -0
- package/src/common/prosemirror/util.d.mts +32 -0
- package/src/common/utils/_module.d.mts +19 -0
- package/src/common/utils/_types.d.mts +83 -0
- package/src/common/utils/bitmask.d.mts +122 -0
- package/src/common/utils/collection.d.mts +148 -0
- package/src/common/utils/color.d.mts +308 -0
- package/src/common/utils/event-emitter.d.mts +36 -0
- package/src/common/utils/geometry.d.mts +94 -0
- package/src/common/utils/helpers.d.mts +396 -0
- package/src/common/utils/http.d.mts +40 -0
- package/src/common/utils/iterable-weak-map.d.mts +26 -0
- package/src/common/utils/iterable-weak-set.d.mts +1 -0
- package/src/common/utils/logging.d.mts +25 -0
- package/src/common/utils/semaphore.d.mts +59 -0
- package/src/common/utils/string-tree.d.mts +60 -0
- package/src/common/utils/word-tree.d.mts +34 -0
- package/src/global-external.d.mts +48 -0
- package/src/index.d.ts +87 -0
- package/src/public/scripts/clipper.d.mts +920 -0
- package/src/tinymce-stub.d.mts +123 -0
- package/src/util.d.mts +67 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { KeybindingAction, KeyboardEventContext, ModifierKey } from "./../../_types.mjs";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A set of helpers and management functions for dealing with user input from keyboard events.
|
|
5
|
+
* {@link https://keycode.info/}
|
|
6
|
+
* @see {@link foundry.Game#keyboard}
|
|
7
|
+
*/
|
|
8
|
+
export default class KeyboardManager {
|
|
9
|
+
constructor();
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Begin listening to keyboard events.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
_activateListeners(): void;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The set of key codes which are currently depressed (down)
|
|
19
|
+
*/
|
|
20
|
+
downKeys: Set<string>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The set of movement keys which were recently pressed
|
|
24
|
+
*/
|
|
25
|
+
moveKeys: Set<string>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Allowed modifier keys.
|
|
29
|
+
*/
|
|
30
|
+
static MODIFIER_KEYS: {
|
|
31
|
+
CONTROL: "Control";
|
|
32
|
+
SHIFT: "Shift";
|
|
33
|
+
ALT: "Alt";
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Track which KeyboardEvent#code presses associate with each modifier.
|
|
38
|
+
*/
|
|
39
|
+
static MODIFIER_CODES: {
|
|
40
|
+
Alt: ["AltLeft", "AltRight"];
|
|
41
|
+
Control: ["ControlLeft", "ControlRight", "MetaLeft", "MetaRight", "Meta", "OsLeft", "OsRight"];
|
|
42
|
+
Shift: ["ShiftLeft", "ShiftRight"];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Key codes which are "protected" and should not be used because they are reserved for browser-level actions.
|
|
47
|
+
*/
|
|
48
|
+
static PROTECTED_KEYS: ["F5", "F11", "F12", "PrintScreen", "ScrollLock", "NumLock", "CapsLock"];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The OS-specific string display for what their Command key is
|
|
52
|
+
*/
|
|
53
|
+
static CONTROL_KEY_STRING: "⌘" | "Control";
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A special mapping of how special KeyboardEvent#code values should map to displayed strings or symbols.
|
|
57
|
+
* Values in this configuration object override any other display formatting rules which may be applied.
|
|
58
|
+
* @type {Record<string, string>}
|
|
59
|
+
*/
|
|
60
|
+
static KEYCODE_DISPLAY_MAPPING: {
|
|
61
|
+
ArrowLeft: "⬅";
|
|
62
|
+
ArrowRight: "➡";
|
|
63
|
+
ArrowUp: "⬆";
|
|
64
|
+
ArrowDown: "⬇";
|
|
65
|
+
Backquote: "`";
|
|
66
|
+
Backslash: "\\";
|
|
67
|
+
BracketLeft: "[";
|
|
68
|
+
BracketRight: "]";
|
|
69
|
+
Comma: ",";
|
|
70
|
+
Control: typeof KeyboardManager.CONTROL_KEY_STRING;
|
|
71
|
+
Equal: "=";
|
|
72
|
+
Meta: "⌘" | "⊞";
|
|
73
|
+
MetaLeft: "⌘" | "⊞";
|
|
74
|
+
MetaRight: "⌘" | "⊞";
|
|
75
|
+
OsLeft: "⌘" | "⊞";
|
|
76
|
+
OsRight: "⌘" | "⊞";
|
|
77
|
+
Minus: "-";
|
|
78
|
+
NumpadAdd: "Numpad+";
|
|
79
|
+
NumpadSubtract: "Numpad-";
|
|
80
|
+
Period: ".";
|
|
81
|
+
Quote: "'";
|
|
82
|
+
Semicolon: ";";
|
|
83
|
+
Slash: "/";
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Determines whether an `HTMLElement` currently has focus, which may influence keybinding actions.
|
|
88
|
+
*
|
|
89
|
+
* An element is considered to have focus if:
|
|
90
|
+
* 1. It has a `dataset.keyboardFocus` attribute explicitly set to `"true"` or an empty string (`""`).
|
|
91
|
+
* 2. It is an `<input>`, `<select>`, or `<textarea>` element, all of which inherently accept keyboard input.
|
|
92
|
+
* 3. It has the `isContentEditable` property set to `true`, meaning it is an editable element.
|
|
93
|
+
* 4. It is a `<button>` element inside a `<form>`, which suggests interactive use.
|
|
94
|
+
*
|
|
95
|
+
* An element is considered **not** focused if:
|
|
96
|
+
* 1. There is no currently active element (`document.activeElement` is not an `HTMLElement`).
|
|
97
|
+
* 2. It has a `dataset.keyboardFocus` attribute explicitly set to `"false"`.
|
|
98
|
+
*
|
|
99
|
+
* If none of these conditions are met, the element is assumed to be unfocused.
|
|
100
|
+
*/
|
|
101
|
+
get hasFocus(): boolean;
|
|
102
|
+
|
|
103
|
+
/* -------------------------------------------- */
|
|
104
|
+
/* Methods */
|
|
105
|
+
/* -------------------------------------------- */
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Emulates a key being pressed, triggering the Keyboard event workflow.
|
|
109
|
+
* @param up If True, emulates the `keyup` Event. Else, the `keydown` event
|
|
110
|
+
* @param code The KeyboardEvent#code which is being pressed
|
|
111
|
+
* @param options Additional options to configure behavior.
|
|
112
|
+
* @param options.altKey Emulate the ALT modifier as pressed
|
|
113
|
+
* @param options.ctrlKey Emulate the CONTROL modifier as pressed
|
|
114
|
+
* @param options.shiftKey Emulate the SHIFT modifier as pressed
|
|
115
|
+
* @param options.repeat Emulate this as a repeat event
|
|
116
|
+
* @param options.force Force the event to be handled.
|
|
117
|
+
*/
|
|
118
|
+
static emulateKeypress(
|
|
119
|
+
up: boolean,
|
|
120
|
+
code: string,
|
|
121
|
+
options?: { altKey?: boolean; ctrlKey?: boolean; shiftKey?: boolean; repeat?: boolean; force?: boolean },
|
|
122
|
+
): KeyboardEventContext;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Format a KeyboardEvent#code into a displayed string.
|
|
126
|
+
* @param code The input code
|
|
127
|
+
* @returns The displayed string for this code
|
|
128
|
+
*/
|
|
129
|
+
static getKeycodeDisplayString(code: string): string;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Get a standardized keyboard context for a given event.
|
|
133
|
+
* Every individual keypress is uniquely identified using the KeyboardEvent#code property.
|
|
134
|
+
* A list of possible key codes is documented here: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values
|
|
135
|
+
*
|
|
136
|
+
* @param event The originating keypress event
|
|
137
|
+
* @param up A flag for whether the key is down or up
|
|
138
|
+
* @returns The standardized context of the event
|
|
139
|
+
*/
|
|
140
|
+
static getKeyboardEventContext(event: KeyboardEvent, up?: boolean): KeyboardEventContext;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Report whether a modifier in KeyboardManager.MODIFIER_KEYS is currently actively depressed.
|
|
144
|
+
* @param modifier A modifier in MODIFIER_KEYS
|
|
145
|
+
* @returns Is this modifier key currently down (active)?
|
|
146
|
+
*/
|
|
147
|
+
isModifierActive(modifier: ModifierKey): boolean;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Report whether a core action key is currently actively depressed.
|
|
151
|
+
* @param action The core action to verify (ex: "target")
|
|
152
|
+
* @returns Is this core action key currently down (active)?
|
|
153
|
+
*/
|
|
154
|
+
isCoreActionKeyActive(action: string): boolean;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Given a standardized pressed key, find all matching registered Keybind Actions.
|
|
158
|
+
* @param context A standardized keyboard event context
|
|
159
|
+
* @returns The matched Keybind Actions. May be empty.
|
|
160
|
+
* @internal
|
|
161
|
+
*/
|
|
162
|
+
static _getMatchingActions(context: KeyboardEventContext): KeybindingAction[];
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Processes a keyboard event context, checking it against registered keybinding actions
|
|
166
|
+
* @param context The keyboard event context
|
|
167
|
+
* @param options Additional options to configure behavior.
|
|
168
|
+
* @param options.force Force the event to be handled.
|
|
169
|
+
*/
|
|
170
|
+
protected _processKeyboardContext(context: KeyboardEventContext, options?: { force?: boolean }): void;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Emulate a key-up event for any currently down keys. When emulating, we go backwards such that combinations such as
|
|
174
|
+
* "CONTROL + S" emulate the "S" first in order to capture modifiers.
|
|
175
|
+
* @param options Options to configure behavior.
|
|
176
|
+
* @param options.force Force the keyup events to be handled.
|
|
177
|
+
*/
|
|
178
|
+
releaseKeys({ force }?: { force?: boolean }): void;
|
|
179
|
+
|
|
180
|
+
/* -------------------------------------------- */
|
|
181
|
+
/* Event Listeners and Handlers */
|
|
182
|
+
/* -------------------------------------------- */
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Release any down keys when focusing a form element.
|
|
186
|
+
* @param event The focus event.
|
|
187
|
+
*/
|
|
188
|
+
protected _onFocusIn(event: FocusEvent): void;
|
|
189
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Management class for Mouse events.
|
|
3
|
+
* @see {@link foundry.Game#mouse}
|
|
4
|
+
*/
|
|
5
|
+
export default class MouseManager {
|
|
6
|
+
constructor();
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Specify a rate limit for mouse wheel to gate repeated scrolling.
|
|
10
|
+
* This is especially important for continuous scrolling mice which emit hundreds of events per second.
|
|
11
|
+
* This designates a minimum number of milliseconds which must pass before another wheel event is handled
|
|
12
|
+
*/
|
|
13
|
+
static MOUSE_WHEEL_RATE_LIMIT: number;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Begin listening to mouse events.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
_activateListeners(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A singleton Tooltip Manager class responsible for rendering and positioning a dynamic tooltip element which is
|
|
3
|
+
* accessible as `game.tooltip`.
|
|
4
|
+
*
|
|
5
|
+
* @see {@link foundry.Game#tooltip}
|
|
6
|
+
*
|
|
7
|
+
* @example API Usage
|
|
8
|
+
* ```js
|
|
9
|
+
* game.tooltip.activate(htmlElement, {text: "Some tooltip text", direction: "UP"});
|
|
10
|
+
* game.tooltip.deactivate();
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @example HTML Usage
|
|
14
|
+
* ```html
|
|
15
|
+
* <span data-tooltip="Some Tooltip" data-tooltip-direction="LEFT">I have a tooltip</span>
|
|
16
|
+
* <ol data-tooltip-direction="RIGHT">
|
|
17
|
+
* <li data-tooltip="The First One">One</li>
|
|
18
|
+
* <li data-tooltip="The Second One">Two</li>
|
|
19
|
+
* <li data-tooltip="The Third One">Three</li>
|
|
20
|
+
* </ol>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export default class TooltipManager {
|
|
24
|
+
constructor();
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A cached reference to the global tooltip element
|
|
28
|
+
*/
|
|
29
|
+
tooltip: HTMLElement;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A reference to the HTML element which is currently tool-tipped, if any.
|
|
33
|
+
*/
|
|
34
|
+
element: HTMLElement | null;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* An amount of margin which is used to offset tooltips from their anchored element.
|
|
38
|
+
*/
|
|
39
|
+
static TOOLTIP_MARGIN_PX: number;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The number of milliseconds delay which activates a tooltip on a "long hover".
|
|
43
|
+
*/
|
|
44
|
+
static TOOLTIP_ACTIVATION_MS: number;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The directions in which a tooltip can extend, relative to its tool-tipped element.
|
|
48
|
+
*/
|
|
49
|
+
static TOOLTIP_DIRECTIONS: Readonly<{
|
|
50
|
+
UP: "UP";
|
|
51
|
+
DOWN: "DOWN";
|
|
52
|
+
LEFT: "LEFT";
|
|
53
|
+
RIGHT: "RIGHT";
|
|
54
|
+
CENTER: "CENTER";
|
|
55
|
+
}>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The number of pixels buffer around a locked tooltip zone before they should be dismissed.
|
|
59
|
+
*/
|
|
60
|
+
static LOCKED_TOOLTIP_BUFFER_PX: number;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Activate interactivity by listening for hover events on HTML elements which have a data-tooltip defined.
|
|
64
|
+
*/
|
|
65
|
+
activateEventListeners(): void;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Activate the tooltip for a hovered HTML element which defines a tooltip localization key.
|
|
69
|
+
* @param element The HTML element being hovered.
|
|
70
|
+
* @param options Additional options which can override tooltip behavior.
|
|
71
|
+
* @param options.text Explicit tooltip text to display. If this is not provided the tooltip text is acquired from
|
|
72
|
+
* the element's `data-tooltip-text` attribute if present and otherwise from its `data-tooltip`
|
|
73
|
+
* attribute. The `data-tooltip` text will be automatically localized. If `data-tooltip` is not
|
|
74
|
+
* a localization string, the text is rendered as HTML (cleaned). Both `options.text` and
|
|
75
|
+
* `data-tooltip-text` do not support HTML. It is not recommended to use `data-tooltip` for
|
|
76
|
+
* plain text and HTML as it could cause an unintentional localization. Instead use
|
|
77
|
+
* `data-tooltip-text` and `data-tooltip-html`, respectively.
|
|
78
|
+
* @param options.direction An explicit tooltip expansion direction. If this is not provided, the direction is
|
|
79
|
+
* acquired from the `data-tooltip-direction` attribute of the element or one of its
|
|
80
|
+
* parents.
|
|
81
|
+
* @param options.cssClass An optional, space-separated list of CSS classes to apply to the activated tooltip. If
|
|
82
|
+
* this is not provided, the CSS classes are acquired from the `data-tooltip-class`
|
|
83
|
+
* attribute of the element or one of its parents.
|
|
84
|
+
* @param options.locked An optional boolean to lock the tooltip after creation. Defaults to false.
|
|
85
|
+
* @param options.html Explicit HTML to inject into the tooltip rather than using tooltip text. If passed as a
|
|
86
|
+
* string, the HTML string is cleaned with {@link foundry.utils.cleanHTML}. An explicit HTML
|
|
87
|
+
* string may also be set with the `data-tooltip-html` attribute on the element.
|
|
88
|
+
*/
|
|
89
|
+
activate(element: HTMLElement, options?: TooltipActivationOptions): void;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Deactivate the tooltip from a previously hovered HTML element.
|
|
93
|
+
*/
|
|
94
|
+
deactivate(): void;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Clear any pending activation workflow.
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
clearPending(): void;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Lock the current tooltip.
|
|
104
|
+
*/
|
|
105
|
+
lockTooltip(): HTMLElement;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Handle a request to lock the current tooltip.
|
|
109
|
+
* @param event The click event.
|
|
110
|
+
*/
|
|
111
|
+
protected _onLockTooltip(event: PointerEvent): void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Handle dismissing a locked tooltip.
|
|
115
|
+
* @param event The click event.
|
|
116
|
+
*/
|
|
117
|
+
protected _onLockedTooltipDismiss(event: PointerEvent): void;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Dismiss a given locked tooltip.
|
|
121
|
+
* @param element The locked tooltip to dismiss.
|
|
122
|
+
*/
|
|
123
|
+
dismissLockedTooltip(element: HTMLElement): void;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Dismiss the set of active locked tooltips.
|
|
127
|
+
*/
|
|
128
|
+
dismissLockedTooltips(): void;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Create a locked tooltip at the given position.
|
|
132
|
+
* @param position A position object with coordinates for where the tooltip should be placed
|
|
133
|
+
* @param position.top Explicit top position for the tooltip
|
|
134
|
+
* @param position.right Explicit right position for the tooltip
|
|
135
|
+
* @param position.bottom Explicit bottom position for the tooltip
|
|
136
|
+
* @param position.left Explicit left position for the tooltip
|
|
137
|
+
* @param text Explicit tooltip text or HTML to display.
|
|
138
|
+
* @param options Additional options which can override tooltip behavior.
|
|
139
|
+
* @param options.cssClass An optional, space-separated list of CSS classes to apply to the activated tooltip.
|
|
140
|
+
*/
|
|
141
|
+
createLockedTooltip(position: { top: string; right: string; bottom: string; left: string }, text: string, options?: { cssClass?: string }): HTMLElement;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* If an explicit tooltip expansion direction was not specified, figure out a valid direction based on the bounds
|
|
145
|
+
* of the target element and the screen.
|
|
146
|
+
*/
|
|
147
|
+
protected _determineDirection(): "UP" | "DOWN";
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Set tooltip position relative to an HTML element using an explicitly provided data-tooltip-direction.
|
|
151
|
+
* @param direction The tooltip expansion direction specified by the element or a parent element.
|
|
152
|
+
*/
|
|
153
|
+
protected _setAnchor(direction: TooltipDirection): void;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Apply inline styling rules to the tooltip for positioning and text alignment.
|
|
157
|
+
* @param position An object of positioning data, supporting top, right, bottom, left, and textAlign
|
|
158
|
+
*/
|
|
159
|
+
protected _setStyle(position?: {
|
|
160
|
+
top?: number | null;
|
|
161
|
+
right?: number | null;
|
|
162
|
+
button?: number | null;
|
|
163
|
+
left?: number | null;
|
|
164
|
+
textAlign?: string | null;
|
|
165
|
+
}): void;
|
|
166
|
+
|
|
167
|
+
/* -------------------------------------------- */
|
|
168
|
+
/* Factory Methods */
|
|
169
|
+
/* -------------------------------------------- */
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Retrieve the configured TooltipManager implementation.
|
|
173
|
+
*/
|
|
174
|
+
static get implementation(): typeof TooltipManager;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Activate the tooltip for a hovered HTML element which defines a tooltip localization key.
|
|
179
|
+
* @param {HTMLElement} element The HTML element being hovered.
|
|
180
|
+
* @param {object} [options={}] Additional options which can override tooltip behavior.
|
|
181
|
+
* @param {string} [options.text]
|
|
182
|
+
* @param {TooltipDirection} [options.direction] An explicit tooltip expansion direction. If this
|
|
183
|
+
* is not provided, the direction is acquired from the `data-tooltip-direction`
|
|
184
|
+
* attribute of the element or one of its parents.
|
|
185
|
+
* @param {string} [options.cssClass] An optional, space-separated list of CSS classes to apply to the activated
|
|
186
|
+
* tooltip. If this is not provided, the CSS classes are acquired from the
|
|
187
|
+
* `data-tooltip-class` attribute of the element or one of its parents.
|
|
188
|
+
* @param {boolean} [options.locked=false] An optional boolean to lock the tooltip after creation. Defaults to false.
|
|
189
|
+
* @param {HTMLElement|string} [options.html] Explicit HTML to inject into the tooltip rather than using
|
|
190
|
+
* tooltip text. If passed as a string, the HTML string is cleaned with
|
|
191
|
+
* {@link foundry.utils.cleanHTML}. An explicit HTML string may also
|
|
192
|
+
* be set with the `data-tooltip-html` attribute on the element.
|
|
193
|
+
*/
|
|
194
|
+
|
|
195
|
+
declare interface TooltipActivationOptions {
|
|
196
|
+
/**
|
|
197
|
+
* Explicit tooltip text to display. If this is not provided the tooltip text is acquired from the element's
|
|
198
|
+
* `data-tooltip-text` attribute if present and otherwise from its `data-tooltip` attribute. The `data-tooltip`
|
|
199
|
+
* text will be automatically localized. If `data-tooltip` is not a localization string, the text is rendered as
|
|
200
|
+
* HTML (cleaned). Both `options.text` and `data-tooltip-text` do not support HTML. It is not recommended to use
|
|
201
|
+
* `data-tooltip` for plain text and HTML as it could cause an unintentional localization. Instead use
|
|
202
|
+
* `data-tooltip-text` and `data-tooltip-html`, respectively.
|
|
203
|
+
*/
|
|
204
|
+
text?: string;
|
|
205
|
+
/**
|
|
206
|
+
* An explicit tooltip expansion direction. If this is not provided, the direction is acquired from the
|
|
207
|
+
* `data-tooltip-direction` attribute of the element or one of its parents.
|
|
208
|
+
*/
|
|
209
|
+
direction?: TooltipDirection;
|
|
210
|
+
/**
|
|
211
|
+
* An optional, space-separated list of CSS classes to apply to the activated tooltip. If this is not provided, the CSS
|
|
212
|
+
* classes are acquired from the `data-tooltip-class` attribute of the element or one of its parents.
|
|
213
|
+
*/
|
|
214
|
+
cssClass?: string;
|
|
215
|
+
/** An optional boolean to lock the tooltip after creation. Defaults to false. */
|
|
216
|
+
locked?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Explicit HTML to inject into the tooltip rather than using tooltip text. If passed as a string, the HTML string
|
|
219
|
+
* is cleaned with {@link foundry.utils.cleanHTML}. An explicit HTML string may also be set with the
|
|
220
|
+
* `data-tooltip-html` attribute on the element.
|
|
221
|
+
*/
|
|
222
|
+
html?: HTMLElement | string;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export type TooltipDirection = keyof typeof TooltipManager.TOOLTIP_DIRECTIONS;
|
|
226
|
+
|
|
227
|
+
export {};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import DataModel from "./../../common/abstract/data.mjs";
|
|
2
|
+
import { DataField, SchemaField } from "./../../common/data/fields.mjs";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A helper class which assists with localization and string translation
|
|
6
|
+
*/
|
|
7
|
+
export default class Localization {
|
|
8
|
+
/**
|
|
9
|
+
* The target language for localization
|
|
10
|
+
*/
|
|
11
|
+
lang: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The translation dictionary for the target language
|
|
15
|
+
*/
|
|
16
|
+
translations: Record<string, TranslationDictionaryValue>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Fallback translations if the target keys are not found
|
|
20
|
+
*/
|
|
21
|
+
_fallback: Record<string, TranslationDictionaryValue>;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param serverLanguage The default language configuration setting for the server
|
|
25
|
+
*/
|
|
26
|
+
constructor(serverLanguage: string);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Initialize the Localization module
|
|
30
|
+
* Discover available language translations and apply the current language setting
|
|
31
|
+
*/
|
|
32
|
+
initialize(): Promise<void>;
|
|
33
|
+
|
|
34
|
+
/* -------------------------------------------- */
|
|
35
|
+
/* Data Model Localization */
|
|
36
|
+
/* -------------------------------------------- */
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Perform one-time localization of the fields in a DataModel schema, translating their label and hint properties.
|
|
40
|
+
* @param {typeof DataModel} model The DataModel class to localize
|
|
41
|
+
* @param {object} options Options which configure how localization is performed
|
|
42
|
+
* @param {string[]} [options.prefixes] An array of localization key prefixes to use. If not specified, prefixes
|
|
43
|
+
* are learned from the DataModel.LOCALIZATION_PREFIXES static property.
|
|
44
|
+
* @param {string} [options.prefixPath] A localization path prefix used to prefix all field names within this
|
|
45
|
+
* model. This is generally not required.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* JavaScript class definition and localization call.
|
|
49
|
+
* ```js
|
|
50
|
+
* class MyDataModel extends foundry.abstract.DataModel {
|
|
51
|
+
* static defineSchema() {
|
|
52
|
+
* return {
|
|
53
|
+
* foo: new foundry.data.fields.StringField(),
|
|
54
|
+
* bar: new foundry.data.fields.NumberField()
|
|
55
|
+
* };
|
|
56
|
+
* }
|
|
57
|
+
* static LOCALIZATION_PREFIXES = ["MYMODULE.MYDATAMODEL"];
|
|
58
|
+
* }
|
|
59
|
+
*
|
|
60
|
+
* Hooks.on("i18nInit", () => {
|
|
61
|
+
* Localization.localizeDataModel(MyDataModel);
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* JSON localization file
|
|
66
|
+
* ```json
|
|
67
|
+
* {
|
|
68
|
+
* "MYMODULE": {
|
|
69
|
+
* "MYDATAMODEL": {
|
|
70
|
+
* "FIELDS" : {
|
|
71
|
+
* "foo": {
|
|
72
|
+
* "label": "Foo",
|
|
73
|
+
* "hint": "Instructions for foo"
|
|
74
|
+
* },
|
|
75
|
+
* "bar": {
|
|
76
|
+
* "label": "Bar",
|
|
77
|
+
* "hint": "Instructions for bar"
|
|
78
|
+
* }
|
|
79
|
+
* }
|
|
80
|
+
* }
|
|
81
|
+
* }
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
static localizeDataModel(model: AbstractConstructorOf<DataModel>, options?: { prefixes?: string[]; prefixPath?: string }): void;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Localize the "label" and "hint" properties for all fields in a data schema.
|
|
89
|
+
|
|
90
|
+
*/
|
|
91
|
+
static localizeSchema(schema: SchemaField, prefixes?: string[], options?: { prefixPath?: string; seenFields?: Set<DataField> }): void;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Set a language as the active translation source for the session
|
|
95
|
+
* @param lang A language string in CONFIG.supportedLanguages
|
|
96
|
+
* @returns A Promise which resolves once the translations for the requested language are ready
|
|
97
|
+
*/
|
|
98
|
+
setLanguage(lang: string): Promise<void>;
|
|
99
|
+
|
|
100
|
+
/* -------------------------------------------- */
|
|
101
|
+
/* Localization API */
|
|
102
|
+
/* -------------------------------------------- */
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Return whether a certain string has a known translation defined.
|
|
106
|
+
* @param stringId The string key being translated
|
|
107
|
+
* @param fallback Allow fallback translations to count?
|
|
108
|
+
*/
|
|
109
|
+
has(stringId: string, fallback?: boolean): boolean;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Localize a string by drawing a translation from the available translations dictionary, if available
|
|
113
|
+
* If a translation is not available, the original string is returned
|
|
114
|
+
* @param stringId The string ID to translate
|
|
115
|
+
* @return The translated string
|
|
116
|
+
*/
|
|
117
|
+
localize(stringId: string): string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Localize a string including variable formatting for input arguments.
|
|
121
|
+
* Provide a string ID which defines the localized template.
|
|
122
|
+
* Variables can be included in the template enclosed in braces and will be substituted using those named keys.
|
|
123
|
+
*
|
|
124
|
+
* @param stringId The string ID to translate
|
|
125
|
+
* @param data Provided input data
|
|
126
|
+
* @return The translated and formatted string
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* const stringId = "MY_TEST_STRING"; // "Your name is {name}"
|
|
130
|
+
* game.i18n.format("MY_TEST_STRING", {name: "Andrew"}); // Produces "Your name is Andrew"
|
|
131
|
+
*/
|
|
132
|
+
format(stringId: string, data?: Record<string, Maybe<string | number | boolean>>): string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Retrieve list formatter configured to the world's language setting.
|
|
136
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat}
|
|
137
|
+
* @param options.style The list formatter style, either "long", "short", or "narrow".
|
|
138
|
+
* @param options.type The list formatter type, either "conjunction", "disjunction", or "unit".
|
|
139
|
+
*/
|
|
140
|
+
getListFormatter(options?: { style?: Intl.ListFormatStyle; type?: Intl.ListFormatType }): Intl.ListFormat;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
type TranslationDictionaryValue = string | { [key: string]: TranslationDictionaryValue };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CompendiumArtDescriptor, CompendiumArtInfo } from "../_types.mjs";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A class responsible for managing package-provided art and applying it to Documents in compendium packs.
|
|
5
|
+
*/
|
|
6
|
+
export default class CompendiumArt extends Map<string, CompendiumArtInfo> {
|
|
7
|
+
constructor(entries: readonly (readonly [string, CompendiumArtInfo])[] | null);
|
|
8
|
+
|
|
9
|
+
/** The key for the package manifest flag used to store the mapping information. */
|
|
10
|
+
FLAG: "compendiumArtMappings";
|
|
11
|
+
|
|
12
|
+
/** The key for the setting used to store the World's art preferences. */
|
|
13
|
+
SETTING: "compendiumArtConfiguration";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Whether art application is enabled. This should be switched off when performing client-side compendium migrations
|
|
17
|
+
* in order to avoid persisting injected data.
|
|
18
|
+
*/
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
|
|
21
|
+
/** Retrieve all active packages that provide art mappings in priority order. */
|
|
22
|
+
getPackages(): CompendiumArtDescriptor[];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Collate Document art mappings from active packages.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
_registerArt(): Promise<void>;
|
|
29
|
+
}
|