@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,127 @@
|
|
|
1
|
+
import { ElementValidationFailure } from "./_types.mjs";
|
|
2
|
+
|
|
3
|
+
/** A class responsible for recording information about a validation failure. */
|
|
4
|
+
export class DataModelValidationFailure {
|
|
5
|
+
/**
|
|
6
|
+
* @param [invalidValue] The value that failed validation for this field.
|
|
7
|
+
* @param [fallback] The value it was replaced by, if any.
|
|
8
|
+
* @param [dropped] Whether the value was dropped from some parent collection.
|
|
9
|
+
* @param [message] The validation error message.
|
|
10
|
+
* @param [unresolved] Whether this failure was unresolved
|
|
11
|
+
*/
|
|
12
|
+
constructor({
|
|
13
|
+
invalidValue,
|
|
14
|
+
fallback,
|
|
15
|
+
dropped,
|
|
16
|
+
message,
|
|
17
|
+
unresolved,
|
|
18
|
+
}?: {
|
|
19
|
+
invalidValue?: unknown;
|
|
20
|
+
fallback?: boolean;
|
|
21
|
+
dropped?: boolean;
|
|
22
|
+
message?: string;
|
|
23
|
+
unresolved?: boolean;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
/** The value that failed validation for this field. */
|
|
27
|
+
invalidValue: unknown;
|
|
28
|
+
|
|
29
|
+
/** The value it was replaced by, if any. */
|
|
30
|
+
fallback: unknown;
|
|
31
|
+
|
|
32
|
+
/** Whether the value was dropped from some parent collection. */
|
|
33
|
+
dropped: boolean;
|
|
34
|
+
|
|
35
|
+
/** The validation error message. */
|
|
36
|
+
message?: string;
|
|
37
|
+
|
|
38
|
+
/** If this field contains other fields that are validated as part of its validation, their results are recorded here. */
|
|
39
|
+
fields: Record<string, DataModelValidationFailure>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* If this field contains a list of elements that are validated as part of its validation, their results are recorded
|
|
43
|
+
* here.
|
|
44
|
+
*/
|
|
45
|
+
elements: ElementValidationFailure[];
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Record whether a validation failure is unresolved.
|
|
49
|
+
* This reports as true if validation for this field or any hierarchically contained field is unresolved.
|
|
50
|
+
* A failure is unresolved if the value was invalid and there was no valid fallback value available.
|
|
51
|
+
*/
|
|
52
|
+
unresolved: boolean;
|
|
53
|
+
|
|
54
|
+
/** Return this validation failure as an Error object. */
|
|
55
|
+
asError(): DataModelValidationError;
|
|
56
|
+
|
|
57
|
+
/** Whether this failure contains other sub-failures. */
|
|
58
|
+
isEmpty(): boolean;
|
|
59
|
+
|
|
60
|
+
/** Return the base properties of this failure, omitting any nested failures. */
|
|
61
|
+
toObject(): {
|
|
62
|
+
invalidValue: unknown;
|
|
63
|
+
fallback: unknown;
|
|
64
|
+
dropped: boolean;
|
|
65
|
+
message: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** Represent the DataModelValidationFailure as a string. */
|
|
69
|
+
toString(): string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** A specialised Error to indicate a model validation failure. */
|
|
73
|
+
export class DataModelValidationError extends Error {
|
|
74
|
+
/**
|
|
75
|
+
* @param failure The failure that triggered this error or an error message
|
|
76
|
+
* @param [params] Additional Error constructor parameters
|
|
77
|
+
*/
|
|
78
|
+
constructor(failure: DataModelValidationFailure | string, params?: ErrorOptions);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Retrieve the root failure that caused this error, or a specific sub-failure via a path.
|
|
82
|
+
* @param path The property path to the failure.
|
|
83
|
+
*
|
|
84
|
+
* @example Retrieving a failure.
|
|
85
|
+
* ```js
|
|
86
|
+
* const changes = {
|
|
87
|
+
* "foo.bar": "validValue",
|
|
88
|
+
* "foo.baz": "invalidValue"
|
|
89
|
+
* };
|
|
90
|
+
* try {
|
|
91
|
+
* doc.validate(expandObject(changes));
|
|
92
|
+
* } catch ( err ) {
|
|
93
|
+
* const failure = err.getFailure("foo.baz");
|
|
94
|
+
* console.log(failure.invalidValue); // "invalidValue"
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
getFailure(path?: string): DataModelValidationFailure;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Retrieve a flattened object of all the properties that failed validation as part of this error.
|
|
102
|
+
*
|
|
103
|
+
* @example Removing invalid changes from an update delta.
|
|
104
|
+
* ```js
|
|
105
|
+
* const changes = {
|
|
106
|
+
* "foo.bar": "validValue",
|
|
107
|
+
* "foo.baz": "invalidValue"
|
|
108
|
+
* };
|
|
109
|
+
* try {
|
|
110
|
+
* doc.validate(expandObject(changes));
|
|
111
|
+
* } catch ( err ) {
|
|
112
|
+
* const failures = err.getAllFailures();
|
|
113
|
+
* if ( failures ) {
|
|
114
|
+
* for ( const prop in failures ) delete changes[prop];
|
|
115
|
+
* doc.validate(expandObject(changes));
|
|
116
|
+
* }
|
|
117
|
+
* }
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
getAllFailures(): Record<string, DataModelValidationFailure>;
|
|
121
|
+
|
|
122
|
+
/** Log the validation error as a table. */
|
|
123
|
+
logAsTable(): void;
|
|
124
|
+
|
|
125
|
+
/** Generate a nested tree view of the error as an HTML string. */
|
|
126
|
+
asHTML(): string;
|
|
127
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { HexColorString } from "./../constants.mjs";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Test whether a string is a valid 16 character UID
|
|
5
|
+
* @param id
|
|
6
|
+
*/
|
|
7
|
+
export function isValidId(id: string): boolean;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Test whether a file path has an extension in a list of provided extensions
|
|
11
|
+
* @param path
|
|
12
|
+
* @param extensions
|
|
13
|
+
*/
|
|
14
|
+
export function hasFileExtension(path: string, extensions: string[]): path is `${string}.${string}`;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Test whether a string data blob contains base64 data, optionally of a specific type or types
|
|
18
|
+
* @param data The candidate string data
|
|
19
|
+
* @param [types] An array of allowed mime types to test
|
|
20
|
+
*/
|
|
21
|
+
export function isBase64Data(data: string, types?: string[]): boolean;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Test whether an input represents a valid 6-character color string
|
|
25
|
+
* @param color The input string to test
|
|
26
|
+
* @return Is the string a valid color?
|
|
27
|
+
*/
|
|
28
|
+
export function isColorString(color: string): color is HexColorString;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Assert that the given value parses as a valid JSON string
|
|
32
|
+
* @param val The value to test
|
|
33
|
+
* @return Is the String valid JSON?
|
|
34
|
+
*/
|
|
35
|
+
export function isJSON(val: string): boolean;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { WorldDocumentType } from "./../constants.mjs";
|
|
2
|
+
|
|
3
|
+
export { ActiveEffectSource, default as BaseActiveEffect } from "./active-effect.mjs";
|
|
4
|
+
export { default as BaseActorDelta } from "./actor-delta.mjs";
|
|
5
|
+
export { ActorSource, default as BaseActor } from "./actor.mjs";
|
|
6
|
+
export { AdventureSource, default as BaseAdventure } from "./adventure.mjs";
|
|
7
|
+
export { default as BaseAmbientLight } from "./ambient-light.mjs";
|
|
8
|
+
export { AmbientSoundSource, default as BaseAmbientSound } from "./ambient-sound.mjs";
|
|
9
|
+
export { default as BaseCard, CardFaceData } from "./card.mjs";
|
|
10
|
+
export { default as BaseCards } from "./cards.mjs";
|
|
11
|
+
export { default as BaseChatMessage, ChatMessageFlags, ChatMessageSource, ChatSpeakerData } from "./chat-message.mjs";
|
|
12
|
+
export { default as BaseCombat, CombatSource } from "./combat.mjs";
|
|
13
|
+
export { default as BaseCombatantGroup } from "./combatant-group.mjs";
|
|
14
|
+
export { default as BaseCombatant, CombatantSource } from "./combatant.mjs";
|
|
15
|
+
export { default as BaseDrawing, DrawingSource } from "./drawing.mjs";
|
|
16
|
+
export { default as BaseFogExploration, FogExplorationSource } from "./fog-exploration.mjs";
|
|
17
|
+
export { default as BaseFolder, FolderSource } from "./folder.mjs";
|
|
18
|
+
export { default as BaseItem, ItemSchema, ItemSource } from "./item.mjs";
|
|
19
|
+
export { default as BaseJournalEntryCategory, JournalEntryCategorySource } from "./journal-entry-category.mjs";
|
|
20
|
+
export { default as BaseJournalEntryPage } from "./journal-entry-page.mjs";
|
|
21
|
+
export { default as BaseJournalEntry, JournalEntrySource } from "./journal-entry.mjs";
|
|
22
|
+
export { default as BaseMacro, MacroSource } from "./macro.mjs";
|
|
23
|
+
export { default as BaseMeasuredTemplate, MeasuredTemplateSource } from "./measured-template.mjs";
|
|
24
|
+
export { default as BaseNote, NoteSource } from "./note.mjs";
|
|
25
|
+
export { default as BasePlaylistSound, PlaylistSoundSource } from "./playlist-sound.mjs";
|
|
26
|
+
export { default as BasePlaylist } from "./playlist.mjs";
|
|
27
|
+
export { default as BaseRegionBehavior } from "./region-behavior.mjs";
|
|
28
|
+
export { default as BaseRegion, RegionSource } from "./region.mjs";
|
|
29
|
+
export { default as BaseRollTable, RollTableSource } from "./roll-table.mjs";
|
|
30
|
+
export { default as BaseScene, SceneSource } from "./scene.mjs";
|
|
31
|
+
export { default as BaseSetting } from "./setting.mjs";
|
|
32
|
+
export { default as BaseTableResult, TableResultSource } from "./table-result.mjs";
|
|
33
|
+
export { default as BaseTile, TileSource } from "./tile.mjs";
|
|
34
|
+
export { default as BaseToken, TokenSource } from "./token.mjs";
|
|
35
|
+
export { default as BaseUser, UserSource } from "./user.mjs";
|
|
36
|
+
export { default as BaseWall, WallSource } from "./wall.mjs";
|
|
37
|
+
|
|
38
|
+
export type ActorUUID = `Actor.${string}` | `${TokenDocumentUUID}.Actor.${string}` | CompendiumActorUUID;
|
|
39
|
+
export type CardsUUID = `Cards.${string}`;
|
|
40
|
+
export type ChatMessageUUID = `ChatMessage.${string}`;
|
|
41
|
+
export type CombatUUID = `Combat.${string}`;
|
|
42
|
+
export type CompendiumActorUUID = `Compendium.${string}.Actor.${string}`;
|
|
43
|
+
export type CompendiumAdventureUUID = `Compendium.${string}.Adventure.${string}`;
|
|
44
|
+
export type CompendiumCardsUUID = `Compendium.${string}.Cards.${string}`;
|
|
45
|
+
export type CompendiumItemUUID = `Compendium.${string}.Item.${string}`;
|
|
46
|
+
export type CompendiumJournalEntryUUID = `Compendium.${string}.JournalEntry.${string}`;
|
|
47
|
+
export type CompendiumMacroUUID = `Compendium.${string}.Macro.${string}`;
|
|
48
|
+
export type CompendiumPlaylistUUID = `Compendium.${string}.Playlist.${string}`;
|
|
49
|
+
export type CompendiumRollTableUUID = `Compendium.${string}.RollTable.${string}`;
|
|
50
|
+
export type CompendiumSceneUUID = `Compendium.${string}.Scene.${string}`;
|
|
51
|
+
export type EmbeddedItemUUID = `${ActorUUID}.Item.${string}`;
|
|
52
|
+
export type FogExplorationUUID = `FogExploration.${string}`;
|
|
53
|
+
export type FolderUUID = `Folder.${string}`;
|
|
54
|
+
export type ItemUUID = WorldItemUUID | EmbeddedItemUUID | CompendiumItemUUID;
|
|
55
|
+
export type JournalEntryUUID = `JournalEntry.${string}`;
|
|
56
|
+
export type MacroUUID = `Macro.${string}`;
|
|
57
|
+
export type PlaylistUUID = `Playlist.${string}`;
|
|
58
|
+
export type RollTableUUID = `RollTable.${string}`;
|
|
59
|
+
export type SceneUUID = `Scene.${string}`;
|
|
60
|
+
export type SettingUUID = `Setting.${string}`;
|
|
61
|
+
export type TokenDocumentUUID = `Scene.${string}.Token.${string}`;
|
|
62
|
+
export type UserUUID = `User.${string}`;
|
|
63
|
+
export type WorldDocumentUUID = `${WorldDocumentType}.${string}`;
|
|
64
|
+
export type WorldItemUUID = `Item.${string}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Document, DocumentMetadata } from "../abstract/_module.mjs";
|
|
2
|
+
import * as fields from "../data/fields.mjs";
|
|
3
|
+
import { DatabaseCreateCallbackOptions } from "./../abstract/_types.mjs";
|
|
4
|
+
import { ActiveEffectChangeMode, DocumentOwnershipLevel, DocumentOwnershipString, ImageFilePath, UserAction } from "./../constants.mjs";
|
|
5
|
+
import { ActorUUID, BaseActor, BaseItem, BaseUser, ItemUUID } from "./_module.mjs";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The ActiveEffect document model.
|
|
9
|
+
* @param data Initial data from which to construct the document.
|
|
10
|
+
* @param context Construction context options
|
|
11
|
+
*/
|
|
12
|
+
export default class BaseActiveEffect<TParent extends BaseActor | BaseItem<BaseActor | null> | null> extends Document<TParent, ActiveEffectSchema> {
|
|
13
|
+
/* -------------------------------------------- */
|
|
14
|
+
/* Model Configuration */
|
|
15
|
+
/* -------------------------------------------- */
|
|
16
|
+
|
|
17
|
+
static override get metadata(): ActiveEffectMetadata;
|
|
18
|
+
|
|
19
|
+
static override defineSchema(): ActiveEffectSchema;
|
|
20
|
+
|
|
21
|
+
/* -------------------------------------------- */
|
|
22
|
+
/* Model Methods */
|
|
23
|
+
/* -------------------------------------------- */
|
|
24
|
+
|
|
25
|
+
override canUserModify(user: BaseUser, action: UserAction, data?: object): boolean;
|
|
26
|
+
|
|
27
|
+
override testUserPermission(user: BaseUser, permission: DocumentOwnershipString | DocumentOwnershipLevel, { exact }?: { exact?: boolean }): boolean;
|
|
28
|
+
|
|
29
|
+
/* -------------------------------------------- */
|
|
30
|
+
/* Database Event Handlers */
|
|
31
|
+
/* -------------------------------------------- */
|
|
32
|
+
|
|
33
|
+
protected override _preCreate(data: DeepPartial<this["_source"]>, options: DatabaseCreateCallbackOptions, user: BaseUser): Promise<boolean | void>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default interface BaseActiveEffect<TParent extends BaseActor | BaseItem<BaseActor | null> | null>
|
|
37
|
+
extends Document<TParent, ActiveEffectSchema>, fields.ModelPropsFromSchema<ActiveEffectSchema> {
|
|
38
|
+
get documentName(): ActiveEffectMetadata["name"];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ActiveEffectMetadata extends DocumentMetadata {
|
|
42
|
+
name: "ActiveEffect";
|
|
43
|
+
collection: "effects";
|
|
44
|
+
label: "DOCUMENT.ActiveEffect";
|
|
45
|
+
isEmbedded: true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type ActiveEffectSchema = {
|
|
49
|
+
_id: fields.DocumentIdField;
|
|
50
|
+
name: fields.StringField<string, string, true, false, false>;
|
|
51
|
+
changes: fields.ArrayField<fields.SchemaField<EffectChangeSchema>>;
|
|
52
|
+
system: fields.TypeDataField;
|
|
53
|
+
type: fields.StringField<string, string, false, true, true>;
|
|
54
|
+
disabled: fields.BooleanField;
|
|
55
|
+
duration: fields.SchemaField<EffectDurationSchema>;
|
|
56
|
+
description: fields.HTMLField;
|
|
57
|
+
img: fields.FilePathField<ImageFilePath>;
|
|
58
|
+
origin: fields.StringField<ActorUUID | ItemUUID, ActorUUID | ItemUUID, false, true, true>;
|
|
59
|
+
tint: fields.ColorField;
|
|
60
|
+
transfer: fields.BooleanField;
|
|
61
|
+
statuses: fields.SetField<fields.StringField<string, string, true, false, false>>;
|
|
62
|
+
flags: fields.DocumentFlagsField;
|
|
63
|
+
_stats: fields.DocumentStatsField;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
type EffectChangeSchema = {
|
|
67
|
+
key: fields.StringField<string, string, true, false, false>;
|
|
68
|
+
value: fields.StringField<string, string, true, false, false>;
|
|
69
|
+
mode: fields.NumberField<ActiveEffectChangeMode, ActiveEffectChangeMode, false, false, true>;
|
|
70
|
+
priority: fields.NumberField;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
type EffectDurationSchema = {
|
|
74
|
+
startTime: fields.NumberField<number, number, false, true, true>;
|
|
75
|
+
seconds: fields.NumberField;
|
|
76
|
+
combat: fields.ForeignDocumentField;
|
|
77
|
+
rounds: fields.NumberField;
|
|
78
|
+
turns: fields.NumberField;
|
|
79
|
+
startRound: fields.NumberField;
|
|
80
|
+
startTurn: fields.NumberField;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type ActiveEffectSource = fields.SourceFromSchema<ActiveEffectSchema>;
|
|
84
|
+
|
|
85
|
+
export type EffectChangeData = fields.SourceFromSchema<EffectChangeSchema>;
|
|
86
|
+
export type EffectDurationSource = fields.SourceFromSchema<EffectDurationSchema>;
|
|
87
|
+
export type EffectDurationData = BaseActiveEffect<null>["duration"];
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { DocumentConstructionContext } from "../_types.mjs";
|
|
2
|
+
import * as abstract from "../abstract/_module.mjs";
|
|
3
|
+
import { TombstoneDataSchema } from "../data/data.mjs";
|
|
4
|
+
import * as fields from "../data/fields.mjs";
|
|
5
|
+
import Collection from "../utils/collection.mjs";
|
|
6
|
+
import { DocumentOwnershipLevel, DocumentOwnershipString, ImageFilePath, UserAction } from "./../constants.mjs";
|
|
7
|
+
import { BaseActiveEffect, BaseActor, BaseItem, BaseToken, BaseUser } from "./_module.mjs";
|
|
8
|
+
import { ItemSchema } from "./item.mjs";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The Document definition for an ActorDelta.
|
|
12
|
+
* Defines the DataSchema and common behaviors for an ActorDelta which are shared between both client and server.
|
|
13
|
+
* ActorDeltas store a delta that can be applied to a particular Actor in order to produce a new Actor.
|
|
14
|
+
*
|
|
15
|
+
* @param data Initial data used to construct the ActorDelta.
|
|
16
|
+
* @param context Construction context options.
|
|
17
|
+
*/
|
|
18
|
+
export default class BaseActorDelta<TParent extends BaseToken | null> extends abstract.Document<TParent, ActorDeltaSchema> {
|
|
19
|
+
/* -------------------------------------------- */
|
|
20
|
+
/* Model Configuration */
|
|
21
|
+
/* -------------------------------------------- */
|
|
22
|
+
|
|
23
|
+
static override readonly metadata: ActorDeltaMetadata;
|
|
24
|
+
|
|
25
|
+
static override defineSchema(): ActorDeltaSchema;
|
|
26
|
+
|
|
27
|
+
override canUserModify(user: BaseUser, action: UserAction, data?: Record<string, unknown>): boolean;
|
|
28
|
+
|
|
29
|
+
override testUserPermission(user: BaseUser, permission: DocumentOwnershipString | DocumentOwnershipLevel, { exact }?: { exact?: boolean }): boolean;
|
|
30
|
+
|
|
31
|
+
/* -------------------------------------------- */
|
|
32
|
+
/* Methods */
|
|
33
|
+
/* -------------------------------------------- */
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve the base actor's collection, if it exists.
|
|
37
|
+
* @param collectionName The collection name.
|
|
38
|
+
*/
|
|
39
|
+
getBaseCollection(collectionName: string): Collection<string, BaseActor> | undefined;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Apply an ActorDelta to an Actor and return the resultant synthetic Actor.
|
|
43
|
+
* @param {ActorDelta} delta The ActorDelta.
|
|
44
|
+
* @param {Actor} baseActor The base Actor.
|
|
45
|
+
* @param {object} [context] Context to supply to synthetic Actor instantiation.
|
|
46
|
+
* @returns {Actor|null}
|
|
47
|
+
*/
|
|
48
|
+
static applyDelta(delta: BaseActorDelta<BaseToken | null>, baseActor: BaseActor, context?: DocumentConstructionContext<BaseToken | null>): BaseActor;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default interface BaseActorDelta<TParent extends BaseToken | null>
|
|
52
|
+
extends abstract.Document<TParent, ActorDeltaSchema>, fields.ModelPropsFromSchema<ActorDeltaSchema> {}
|
|
53
|
+
|
|
54
|
+
interface ActorDeltaMetadata extends abstract.DocumentMetadata {
|
|
55
|
+
name: "ActorDelta";
|
|
56
|
+
collection: "delta";
|
|
57
|
+
label: "DOCUMENT.ActorDelta";
|
|
58
|
+
labelPlural: "DOCUMENT.ActorDeltas";
|
|
59
|
+
isEmbedded: true;
|
|
60
|
+
embedded: {
|
|
61
|
+
Item: "items";
|
|
62
|
+
ActiveEffect: "effects";
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type ActorDeltaSchema = {
|
|
67
|
+
_id: fields.DocumentIdField;
|
|
68
|
+
name: fields.StringField<string, string, false, true, true>;
|
|
69
|
+
type: fields.StringField<string, string, false, true, true>;
|
|
70
|
+
img: fields.FilePathField<ImageFilePath, ImageFilePath, false, true, true>;
|
|
71
|
+
system: fields.ObjectField<object, object, true, true, true>;
|
|
72
|
+
items: fields.EmbeddedCollectionDeltaField<
|
|
73
|
+
BaseItem<BaseActor>,
|
|
74
|
+
(fields.DocumentSourceFromSchema<ItemSchema, true> | fields.SourceFromSchema<TombstoneDataSchema>)[]
|
|
75
|
+
>;
|
|
76
|
+
effects: fields.EmbeddedCollectionDeltaField<BaseActiveEffect<BaseActor>>;
|
|
77
|
+
ownership: fields.DocumentOwnershipField;
|
|
78
|
+
flags: fields.DocumentFlagsField;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type ActorDeltaSource = fields.SourceFromSchema<ActorDeltaSchema>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { DocumentConstructionContext } from "../_types.mjs";
|
|
2
|
+
import { DatabaseCreateCallbackOptions, DatabaseUpdateCallbackOptions, Document, DocumentMetadata, EmbeddedCollection } from "../abstract/_module.mjs";
|
|
3
|
+
import * as data from "../data/data.mjs";
|
|
4
|
+
import * as fields from "../data/fields.mjs";
|
|
5
|
+
import { ImageFilePath, VideoFilePath } from "./../constants.mjs";
|
|
6
|
+
import { ActorUUID, BaseActiveEffect, BaseFolder, BaseItem, BaseToken, BaseUser, ItemSource } from "./_module.mjs";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The Document definition for an Actor.
|
|
10
|
+
* Defines the DataSchema and common behaviors for an Actor which are shared between both client and server.
|
|
11
|
+
* @memberof documents
|
|
12
|
+
*
|
|
13
|
+
* @param data Initial data from which to construct the Actor
|
|
14
|
+
* @param context Construction context options
|
|
15
|
+
*/
|
|
16
|
+
export default class BaseActor<TParent extends BaseToken | null = BaseToken | null> extends Document<TParent, ActorSchema> {
|
|
17
|
+
/* -------------------------------------------- */
|
|
18
|
+
/* Model Configuration */
|
|
19
|
+
/* -------------------------------------------- */
|
|
20
|
+
|
|
21
|
+
static override get metadata(): ActorMetadata;
|
|
22
|
+
|
|
23
|
+
static override defineSchema(): ActorSchema;
|
|
24
|
+
|
|
25
|
+
/** The default icon used for newly created Actor documents */
|
|
26
|
+
static DEFAULT_ICON: ImageFilePath;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Determine default artwork based on the provided actor data.
|
|
30
|
+
* @param actorData The source actor data.
|
|
31
|
+
* @returns Candidate actor image and prototype token artwork.
|
|
32
|
+
*/
|
|
33
|
+
static getDefaultArtwork(actorData: ActorSource): {
|
|
34
|
+
img: ImageFilePath;
|
|
35
|
+
texture: { src: ImageFilePath | VideoFilePath };
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** The allowed set of Actor types which may exist. */
|
|
39
|
+
static get TYPES(): string[];
|
|
40
|
+
|
|
41
|
+
protected override _initializeSource(data: Record<string, unknown>, options?: DocumentConstructionContext<TParent>): this["_source"];
|
|
42
|
+
|
|
43
|
+
static override canUserCreate(user: BaseUser): boolean;
|
|
44
|
+
|
|
45
|
+
protected override _preCreate(data: DeepPartial<this["_source"]>, options: DatabaseCreateCallbackOptions, user: BaseUser): Promise<boolean | void>;
|
|
46
|
+
|
|
47
|
+
protected override _preUpdate(changed: DeepPartial<this["_source"]>, options: DatabaseUpdateCallbackOptions, user: BaseUser): Promise<boolean | void>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default interface BaseActor<TParent extends BaseToken | null = BaseToken | null>
|
|
51
|
+
extends Document<TParent, ActorSchema>, fields.ModelPropsFromSchema<ActorSchema> {
|
|
52
|
+
readonly items: EmbeddedCollection<BaseItem<this>>;
|
|
53
|
+
readonly effects: EmbeddedCollection<BaseActiveEffect<this>>;
|
|
54
|
+
|
|
55
|
+
prototypeToken: data.PrototypeToken<this>;
|
|
56
|
+
|
|
57
|
+
get documentName(): ActorMetadata["name"];
|
|
58
|
+
|
|
59
|
+
get folder(): BaseFolder | null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ActorMetadata extends DocumentMetadata {
|
|
63
|
+
name: "Actor";
|
|
64
|
+
collection: "actors";
|
|
65
|
+
indexed: true;
|
|
66
|
+
compendiumIndexFields: ["_id", "name", "img", "type", "sort", "folder"];
|
|
67
|
+
embedded: { ActiveEffect: "effects"; Item: "items" };
|
|
68
|
+
label: "DOCUMENT.Actor";
|
|
69
|
+
labelPlural: "DOCUMENT.Actors";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
type ActorSchema<TType extends string = string, TSystemSource extends object = object, TItemSource extends ItemSource = ItemSource> = {
|
|
73
|
+
/** The _id which uniquely identifies this Actor document */
|
|
74
|
+
_id: fields.DocumentIdField;
|
|
75
|
+
/** The name of this Actor */
|
|
76
|
+
name: fields.StringField<string, string, true, false, false>;
|
|
77
|
+
/** An Actor subtype which configures the system data model applied */
|
|
78
|
+
type: fields.StringField<TType, TType, true, false, false>;
|
|
79
|
+
/** An image file path which provides the artwork for this Actor */
|
|
80
|
+
img: fields.FilePathField<ImageFilePath, ImageFilePath, false, false, true>;
|
|
81
|
+
/** The system data object which is defined by the system template.json model */
|
|
82
|
+
system: fields.TypeDataField<TSystemSource>;
|
|
83
|
+
/** Default Token settings which are used for Tokens created from this Actor */
|
|
84
|
+
prototypeToken: fields.EmbeddedDataField<data.PrototypeToken<BaseActor>>;
|
|
85
|
+
/** A Collection of Item embedded Documents */
|
|
86
|
+
items: fields.EmbeddedCollectionField<BaseItem<BaseActor<BaseToken | null>>, TItemSource[]>;
|
|
87
|
+
/** A Collection of ActiveEffect embedded Documents */
|
|
88
|
+
effects: fields.EmbeddedCollectionField<BaseActiveEffect<BaseActor<BaseToken | null>>>;
|
|
89
|
+
/** The _id of a Folder which contains this Actor */
|
|
90
|
+
folder: fields.ForeignDocumentField<BaseFolder>;
|
|
91
|
+
/** The numeric sort value which orders this Actor relative to its siblings */
|
|
92
|
+
sort: fields.IntegerSortField;
|
|
93
|
+
/** An object which configures ownership of this Actor */
|
|
94
|
+
ownership: fields.DocumentOwnershipField;
|
|
95
|
+
/** An object of optional key/value flags */
|
|
96
|
+
flags: fields.DocumentFlagsField;
|
|
97
|
+
/** An object of creation and access information. */
|
|
98
|
+
_stats: fields.DocumentStatsField<ActorUUID>;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type ActorSource<
|
|
102
|
+
TType extends string = string,
|
|
103
|
+
TSystemSource extends object = object,
|
|
104
|
+
TItemSource extends foundry.documents.ItemSource = foundry.documents.ItemSource,
|
|
105
|
+
> = fields.SourceFromSchema<ActorSchema<TType, TSystemSource, TItemSource>>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Document, DocumentMetadata } from "../abstract/_module.mjs";
|
|
2
|
+
import * as fields from "../data/fields.mjs";
|
|
3
|
+
import { DocumentOwnershipLevel, ImageFilePath, UserAction, UserPermission, UserRole, UserRoleName } from "./../constants.mjs";
|
|
4
|
+
import * as documents from "./_module.mjs";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Document definition for an Adventure.
|
|
8
|
+
* Defines the DataSchema and common behaviors for an Adventure which are shared between both client and server.
|
|
9
|
+
* @memberof documents
|
|
10
|
+
*
|
|
11
|
+
* @param data Initial data from which to construct the Actor
|
|
12
|
+
* @param context Construction context options
|
|
13
|
+
*/
|
|
14
|
+
export default class BaseAdventure extends Document<null, AdventureSchema> {
|
|
15
|
+
static override get metadata(): AdventureMetadata;
|
|
16
|
+
|
|
17
|
+
static override defineSchema(): AdventureSchema;
|
|
18
|
+
|
|
19
|
+
/* ---------------------------------------- */
|
|
20
|
+
/* Permissions */
|
|
21
|
+
/* ---------------------------------------- */
|
|
22
|
+
|
|
23
|
+
/** Test whether the User has a GAMEMASTER or ASSISTANT role in this World? */
|
|
24
|
+
get isGM(): boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Test whether the User is able to perform a certain permission action.
|
|
28
|
+
* The provided permission string may pertain to an explicit permission setting or a named user role.
|
|
29
|
+
* Alternatively, Gamemaster users are assumed to be allowed to take all actions.
|
|
30
|
+
*
|
|
31
|
+
* @param action The action to test
|
|
32
|
+
* @return Does the user have the ability to perform this action?
|
|
33
|
+
*/
|
|
34
|
+
can(action: UserAction): boolean;
|
|
35
|
+
|
|
36
|
+
getUserLevel(user: documents.BaseUser): DocumentOwnershipLevel;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Test whether the User has at least a specific permission
|
|
40
|
+
* @param permission The permission name from USER_PERMISSIONS to test
|
|
41
|
+
* @return Does the user have at least this permission
|
|
42
|
+
*/
|
|
43
|
+
hasPermission(permission: UserPermission): boolean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Test whether the User has at least the permission level of a certain role
|
|
47
|
+
* @param role The role name from USER_ROLES to test
|
|
48
|
+
* @param [exact] Require the role match to be exact
|
|
49
|
+
* @return Does the user have at this role level (or greater)?
|
|
50
|
+
*/
|
|
51
|
+
hasRole(role: UserRole | UserRoleName, { exact }?: { exact: boolean }): boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default interface BaseAdventure extends Document<null, AdventureSchema>, fields.ModelPropsFromSchema<AdventureSchema> {
|
|
55
|
+
get documentName(): AdventureMetadata["name"];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface AdventureMetadata extends DocumentMetadata {
|
|
59
|
+
name: "Adventure";
|
|
60
|
+
collection: "Adventures";
|
|
61
|
+
label: "DOCUMENT.Adventure";
|
|
62
|
+
isPrimary: true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type AdventureSchema = {
|
|
66
|
+
/** The _id which uniquely identifies this Adventure document */
|
|
67
|
+
_id: fields.DocumentIdField;
|
|
68
|
+
/** The human-readable name of the Adventure */
|
|
69
|
+
name: fields.StringField<string, string, true, false, false>;
|
|
70
|
+
/** The human-readable name of the Adventure*/
|
|
71
|
+
img: fields.FilePathField<ImageFilePath>;
|
|
72
|
+
/** A string caption displayed under the primary image banner */
|
|
73
|
+
caption: fields.HTMLField;
|
|
74
|
+
/** An HTML text description for the adventure */
|
|
75
|
+
description: fields.HTMLField;
|
|
76
|
+
/** An array of Actor documents which are included in the adventure */
|
|
77
|
+
actors: fields.SetField<fields.EmbeddedDataField<documents.BaseActor<null>>>;
|
|
78
|
+
/** An array of Combat documents which are included in the adventure */
|
|
79
|
+
combats: fields.SetField<fields.EmbeddedDataField<documents.BaseCombat>>;
|
|
80
|
+
/** An array of Item documents which are included in the adventure */
|
|
81
|
+
items: fields.SetField<fields.EmbeddedDataField<documents.BaseItem<null>>>;
|
|
82
|
+
/** An array of JournalEntry documents which are included in the adventure */
|
|
83
|
+
journal: fields.SetField<fields.EmbeddedDataField<documents.BaseJournalEntry>>;
|
|
84
|
+
/** An array of Scene documents which are included in the adventure */
|
|
85
|
+
scenes: fields.SetField<fields.EmbeddedDataField<documents.BaseScene>>;
|
|
86
|
+
/** An array of RollTable documents which are included in the adventure */
|
|
87
|
+
tables: fields.SetField<fields.EmbeddedDataField<documents.BaseRollTable>>;
|
|
88
|
+
/** An array of Macro documents which are included in the adventure */
|
|
89
|
+
macros: fields.SetField<fields.EmbeddedDataField<documents.BaseMacro>>;
|
|
90
|
+
/** An array of Cards documents which are included in the adventure */
|
|
91
|
+
cards: fields.SetField<fields.EmbeddedDataField<documents.BaseCards>>;
|
|
92
|
+
/** An array of Playlist documents which are included in the adventure */
|
|
93
|
+
playlists: fields.SetField<fields.EmbeddedDataField<documents.BasePlaylist>>;
|
|
94
|
+
/** An array of Folder documents which are included in the adventure */
|
|
95
|
+
folders: fields.SetField<fields.EmbeddedDataField<documents.BaseFolder>>;
|
|
96
|
+
folder: fields.ForeignDocumentField<documents.BaseFolder>;
|
|
97
|
+
/** The sort order of this adventure relative to its siblings */
|
|
98
|
+
sort: fields.IntegerSortField;
|
|
99
|
+
/** An object of optional key/value flags */
|
|
100
|
+
flags: fields.DocumentFlagsField;
|
|
101
|
+
/** An object of creation and access information */
|
|
102
|
+
_stats: fields.DocumentStatsField;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type AdventureSource = fields.SourceFromSchema<AdventureSchema>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Document, DocumentMetadata } from "../abstract/_module.mjs";
|
|
2
|
+
import * as data from "../data/data.mjs";
|
|
3
|
+
import * as fields from "../data/fields.mjs";
|
|
4
|
+
import BaseScene from "./scene.mjs";
|
|
5
|
+
|
|
6
|
+
/** The AmbientLight embedded document model. */
|
|
7
|
+
export default class BaseAmbientLight<TParent extends BaseScene | null> extends Document<TParent, AmbientLightSchema> {
|
|
8
|
+
static override get metadata(): AmbientLightMetadata;
|
|
9
|
+
|
|
10
|
+
static override defineSchema(): AmbientLightSchema;
|
|
11
|
+
|
|
12
|
+
protected override _initialize(): void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default interface BaseAmbientLight<TParent extends BaseScene | null>
|
|
16
|
+
extends Document<TParent, AmbientLightSchema>, fields.ModelPropsFromSchema<AmbientLightSchema> {}
|
|
17
|
+
|
|
18
|
+
interface AmbientLightMetadata extends DocumentMetadata {
|
|
19
|
+
name: "AmbientLight";
|
|
20
|
+
collection: "lights";
|
|
21
|
+
label: "DOCUMENT.AmbientLight";
|
|
22
|
+
isEmbedded: true;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type AmbientLightSchema = {
|
|
26
|
+
/** The _id which uniquely identifies this BaseAmbientLight embedded document */
|
|
27
|
+
_id: fields.DocumentIdField;
|
|
28
|
+
/** The x-coordinate position of the origin of the light */
|
|
29
|
+
x: fields.NumberField<number, number, true, false, true>;
|
|
30
|
+
/** The y-coordinate position of the origin of the light */
|
|
31
|
+
y: fields.NumberField<number, number, true, false, true>;
|
|
32
|
+
elevation: fields.NumberField<number, number, true, false, true>;
|
|
33
|
+
/** The angle of rotation for the tile between 0 and 360 */
|
|
34
|
+
rotation: fields.AngleField;
|
|
35
|
+
/** Whether or not this light source is constrained by Walls */
|
|
36
|
+
walls: fields.BooleanField;
|
|
37
|
+
/** Whether or not this light source provides a source of vision */
|
|
38
|
+
vision: fields.BooleanField;
|
|
39
|
+
/** Light configuration data */
|
|
40
|
+
config: fields.EmbeddedDataField<data.LightData<BaseAmbientLight<BaseScene | null>>>;
|
|
41
|
+
/** Is the light source currently hidden? */
|
|
42
|
+
hidden: fields.BooleanField;
|
|
43
|
+
/** An object of optional key/value flags */
|
|
44
|
+
flags: fields.DocumentFlagsField;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type AmbientLightSource = fields.SourceFromSchema<AmbientLightSchema>;
|
|
48
|
+
|
|
49
|
+
export {};
|