@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,148 @@
|
|
|
1
|
+
import Document from "./../../common/abstract/document.mjs";
|
|
2
|
+
import { COMPENDIUM_DOCUMENT_TYPES } from "./../../common/constants.mjs";
|
|
3
|
+
import {
|
|
4
|
+
Actor,
|
|
5
|
+
ActorUUID,
|
|
6
|
+
CompendiumDocument,
|
|
7
|
+
Item,
|
|
8
|
+
ItemUUID,
|
|
9
|
+
TokenDocument,
|
|
10
|
+
TokenDocumentUUID,
|
|
11
|
+
User,
|
|
12
|
+
UserUUID,
|
|
13
|
+
WorldDocumentUUID,
|
|
14
|
+
} from "./../documents/_module.mjs";
|
|
15
|
+
import { ClientDocument } from "./../documents/abstract/client-document.mjs";
|
|
16
|
+
import { CompendiumIndexData } from "./../documents/collections/compendium-collection.mjs";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Clean a provided HTML fragment, closing unbalanced tags and stripping some undesirable properties
|
|
20
|
+
* @param raw A raw HTML string
|
|
21
|
+
* @returns The cleaned HTML content
|
|
22
|
+
*/
|
|
23
|
+
export function cleanHTML(raw: string): string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Export data content to be saved to a local file
|
|
27
|
+
* @param data Data content converted to a string
|
|
28
|
+
* @param type The type of file
|
|
29
|
+
* @param filename The filename of the resulting download
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
export function saveDataToFile(data: string, type: string, filename: string): void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Read text data from a user provided File object
|
|
36
|
+
* @param file A File object
|
|
37
|
+
* @returns A Promise which resolves to the loaded text data
|
|
38
|
+
*/
|
|
39
|
+
export function readTextFromFile(file: File): Promise<string>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Retrieve a Document by its Universally Unique Identifier (uuid).
|
|
43
|
+
* @param uuid The uuid of the Document to retrieve.
|
|
44
|
+
* @param options Options to configure how a UUID is resolved.
|
|
45
|
+
* @param options.relative A Document to resolve relative UUIDs against.
|
|
46
|
+
* @param options.invalid Allow retrieving an invalid Document.
|
|
47
|
+
* @returns Returns the Document if it could be found, otherwise null.
|
|
48
|
+
*/
|
|
49
|
+
export function fromUuid(uuid: CompendiumUUID, relative?: Maybe<ClientDocument>): Promise<CompendiumDocument | null>;
|
|
50
|
+
export function fromUuid(uuid: ActorUUID, relative?: Maybe<ClientDocument>): Promise<Actor | null>;
|
|
51
|
+
export function fromUuid(uuid: ItemUUID, relative?: Maybe<ClientDocument>): Promise<Item | null>;
|
|
52
|
+
export function fromUuid(uuid: TokenDocumentUUID, relative?: Maybe<ClientDocument>): Promise<TokenDocument | null>;
|
|
53
|
+
export function fromUuid<TDocument extends ClientDocument>(uuid: string, relative?: Maybe<ClientDocument>): Promise<TDocument | null>;
|
|
54
|
+
|
|
55
|
+
export type CompendiumDocumentType = (typeof COMPENDIUM_DOCUMENT_TYPES)[number];
|
|
56
|
+
export type CompendiumUUID = `Compendium.${string}.${CompendiumDocumentType}.${string}`;
|
|
57
|
+
export type DocumentUUID = WorldDocumentUUID | CompendiumUUID | TokenDocumentUUID;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Retrieve a Document by its Universally Unique Identifier (uuid) synchronously. If the uuid resolves to a compendium
|
|
61
|
+
* document, that document's index entry will be returned instead.
|
|
62
|
+
* @param uuid The uuid of the Document to retrieve.
|
|
63
|
+
* @param options Options to configure how a UUID is resolved.
|
|
64
|
+
* @param options.relative A Document to resolve relative UUIDs against.
|
|
65
|
+
* @param options.invalid Allow retrieving an invalid Document.
|
|
66
|
+
* @param options.strict Throw an error if the UUID cannot be resolved synchronously.
|
|
67
|
+
* @returns The Document or its index entry if it resides in a Compendium, otherwise null.
|
|
68
|
+
* @throws If the uuid resolves to a Document that cannot be retrieved synchronously, and the strict option is true.
|
|
69
|
+
*/
|
|
70
|
+
export function fromUuidSync<TResult extends User = User>(
|
|
71
|
+
uuid: UserUUID,
|
|
72
|
+
options?: {
|
|
73
|
+
relative?: ClientDocument;
|
|
74
|
+
invalid?: boolean;
|
|
75
|
+
strict?: boolean;
|
|
76
|
+
},
|
|
77
|
+
): TResult | null;
|
|
78
|
+
export function fromUuidSync<TResult extends Actor | CompendiumIndexData = Actor | CompendiumIndexData>(
|
|
79
|
+
uuid: UserUUID,
|
|
80
|
+
options?: {
|
|
81
|
+
relative?: ClientDocument;
|
|
82
|
+
invalid?: boolean;
|
|
83
|
+
strict?: boolean;
|
|
84
|
+
},
|
|
85
|
+
): TResult | null;
|
|
86
|
+
export function fromUuidSync<TResult extends (Document & { name?: string }) | CompendiumIndexData = (ClientDocument & { name?: string }) | CompendiumIndexData>(
|
|
87
|
+
uuid: string,
|
|
88
|
+
options?: {
|
|
89
|
+
relative?: ClientDocument;
|
|
90
|
+
invalid?: boolean;
|
|
91
|
+
strict?: boolean;
|
|
92
|
+
},
|
|
93
|
+
): TResult | null;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Return a reference to the Document class implementation which is configured for use.
|
|
97
|
+
* @param documentName The canonical Document name, for example "Actor"
|
|
98
|
+
* @returns The configured Document class implementation
|
|
99
|
+
*/
|
|
100
|
+
export function getDocumentClass(documentName: string): typeof Document | undefined;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Given a source object to sort, a target to sort relative to, and an Array of siblings in the container:
|
|
104
|
+
* Determine the updated sort keys for the source object, or all siblings if a reindex is required.
|
|
105
|
+
* Return an Array of updates to perform, it is up to the caller to dispatch these updates.
|
|
106
|
+
* Each update is structured as:
|
|
107
|
+
* {
|
|
108
|
+
* target: object,
|
|
109
|
+
* update: {sortKey: sortValue}
|
|
110
|
+
* }
|
|
111
|
+
*
|
|
112
|
+
* @param source The source object being sorted
|
|
113
|
+
* @param options Options which modify the sort behavior
|
|
114
|
+
* @returns An Array of updates for the caller of the helper function to perform
|
|
115
|
+
*/
|
|
116
|
+
export function performIntegerSort<TObject extends object>(
|
|
117
|
+
source: TObject,
|
|
118
|
+
options?: SortOptions<TObject>,
|
|
119
|
+
): { target: TObject; update: Record<string, number> }[];
|
|
120
|
+
|
|
121
|
+
declare interface SortOptions<TObject extends object> {
|
|
122
|
+
/** The target object relative which to sort */
|
|
123
|
+
target?: TObject;
|
|
124
|
+
/** The Array of siblings which the source should be sorted within */
|
|
125
|
+
siblings?: TObject[];
|
|
126
|
+
/** The property name within the source object which defines the sort key */
|
|
127
|
+
sortKey?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Explicitly sort before (true) or sort after( false).
|
|
130
|
+
* If undefined the sort order will be automatically determined.
|
|
131
|
+
*/
|
|
132
|
+
sortBefore?: boolean;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Express a timestamp as a relative string.
|
|
137
|
+
* This helper internally uses GameTime#format using the relative formatter and the Earth calendar.
|
|
138
|
+
* @param timeStamp A timestamp string or Date object to be formatted as a relative time
|
|
139
|
+
* @returns A string expression for the relative time
|
|
140
|
+
*/
|
|
141
|
+
export function timeSince(timeStamp: Date | string): string;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Parse an HTML string, returning a processed HTMLElement or HTMLCollection.
|
|
145
|
+
* A single HTMLElement is returned if the provided string contains only a single top-level element.
|
|
146
|
+
* An HTMLCollection is returned if the provided string contains multiple top-level elements.
|
|
147
|
+
*/
|
|
148
|
+
export function parseHTML<THTML extends HTMLCollection | HTMLElement>(htmlString: string): THTML;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { TokenShape } from "./../client/canvas/placeables/token.mjs";
|
|
2
|
+
import { DataModelConstructionContext } from "./abstract/_types.mjs";
|
|
3
|
+
import Document from "./abstract/document.mjs";
|
|
4
|
+
import { GridOffset2D } from "./grid/_types.mjs";
|
|
5
|
+
import Color from "./utils/color.mjs";
|
|
6
|
+
|
|
7
|
+
/* ----------------------------------------- */
|
|
8
|
+
/* Data Model */
|
|
9
|
+
/* ----------------------------------------- */
|
|
10
|
+
|
|
11
|
+
export interface DocumentConstructionContext<TParent extends Document | null> extends DataModelConstructionContext<TParent> {
|
|
12
|
+
/** The compendium collection ID which contains this Document, if any */
|
|
13
|
+
pack?: string | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | symbol | null | undefined;
|
|
17
|
+
|
|
18
|
+
/* ----------------------------------------- */
|
|
19
|
+
/* Reusable Type Definitions */
|
|
20
|
+
/* ----------------------------------------- */
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Make all properties in T recursively readonly.
|
|
24
|
+
*/
|
|
25
|
+
type DeepReadonly<T> = {
|
|
26
|
+
readonly [K in keyof T]: T[K] extends undefined | null | boolean | number | string | symbol | bigint | Function
|
|
27
|
+
? T[K]
|
|
28
|
+
: T[K] extends Array<infer V>
|
|
29
|
+
? ReadonlyArray<DeepReadonly<V>>
|
|
30
|
+
: T[K] extends Map<infer K, infer V>
|
|
31
|
+
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
|
|
32
|
+
: T[K] extends Set<infer V>
|
|
33
|
+
? ReadonlySet<DeepReadonly<V>>
|
|
34
|
+
: DeepReadonly<T[K]>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A 2D point, expressed as an array [x, y].
|
|
39
|
+
*/
|
|
40
|
+
export interface Point {
|
|
41
|
+
/** The x-coordinate in pixels */
|
|
42
|
+
x: number;
|
|
43
|
+
/** The y-coordinate of the top-left corner */
|
|
44
|
+
y: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A single point, expressed as an array [x,y]
|
|
49
|
+
*/
|
|
50
|
+
export type PointArray = [x: number, y: number];
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A 3D point, expessed as {x, y, elevation}.
|
|
54
|
+
*/
|
|
55
|
+
export interface ElevatedPoint extends Point {
|
|
56
|
+
/** The elevation in grid units */
|
|
57
|
+
elevation: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* A standard rectangle interface.
|
|
62
|
+
*/
|
|
63
|
+
interface Rectangle {
|
|
64
|
+
/** The x-coordinate of the top-left corner */
|
|
65
|
+
x: number;
|
|
66
|
+
/** The y-coordinate of the top-left corner */
|
|
67
|
+
y: number;
|
|
68
|
+
/** The width */
|
|
69
|
+
width: number;
|
|
70
|
+
/** The height */
|
|
71
|
+
height: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
type BuiltinTypes = NumberConstructor | StringConstructor | BooleanConstructor;
|
|
75
|
+
|
|
76
|
+
type ColorSource = number | [red: number, green: number, blue: number] | string | Color;
|
|
77
|
+
|
|
78
|
+
/* ----------------------------------------- */
|
|
79
|
+
/* Socket Requests and Responses */
|
|
80
|
+
/* ----------------------------------------- */
|
|
81
|
+
|
|
82
|
+
export type RequestData = object | object[] | string | string[];
|
|
83
|
+
|
|
84
|
+
export interface SocketRequest {
|
|
85
|
+
/** The type of object being modified */
|
|
86
|
+
type?: string;
|
|
87
|
+
/** The server-side action being requested */
|
|
88
|
+
action?: string;
|
|
89
|
+
/** Data applied to the operation */
|
|
90
|
+
data?: RequestData;
|
|
91
|
+
query?: object;
|
|
92
|
+
/** The type of parent document */
|
|
93
|
+
parentType?: string;
|
|
94
|
+
/** The ID of a parent document */
|
|
95
|
+
parentId?: string;
|
|
96
|
+
/** A Compendium pack name */
|
|
97
|
+
pack?: string | null;
|
|
98
|
+
/** Additional options applied to the request */
|
|
99
|
+
options?: object;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface SocketResponse {
|
|
103
|
+
/** The initial request */
|
|
104
|
+
request: SocketRequest;
|
|
105
|
+
/** An error, if one occurred */
|
|
106
|
+
error?: Error;
|
|
107
|
+
/** The status of the request */
|
|
108
|
+
status?: string;
|
|
109
|
+
/** The ID of the requesting User */
|
|
110
|
+
userId?: string;
|
|
111
|
+
/** Data returned as a result of the request */
|
|
112
|
+
result: Record<string, unknown>[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* ----------------------------------------- */
|
|
116
|
+
/* Token Typedefs */
|
|
117
|
+
/* ----------------------------------------- */
|
|
118
|
+
|
|
119
|
+
interface TokenPosition extends ElevatedPoint {
|
|
120
|
+
/** The width in grid spaces (positive). */
|
|
121
|
+
width: number;
|
|
122
|
+
/** The height in grid spaces (positive). */
|
|
123
|
+
height: number;
|
|
124
|
+
/** The shape type (see {@link CONST.TOKEN_SHAPES}). */
|
|
125
|
+
shape: TokenShape;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type TokenDimensions = Pick<TokenPosition, "width" | "height" | "shape">;
|
|
129
|
+
|
|
130
|
+
interface TokenHexagonalOffsetsData {
|
|
131
|
+
/** The occupied offsets in an even grid in the 0th row/column */
|
|
132
|
+
even: GridOffset2D[];
|
|
133
|
+
/** The occupied offsets in an odd grid in the 0th row/column */
|
|
134
|
+
odd: GridOffset2D[];
|
|
135
|
+
/** The anchor in normalized coordiantes */
|
|
136
|
+
anchor: Point;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The hexagonal shape of a Token.
|
|
141
|
+
*/
|
|
142
|
+
interface TokenHexagonalShapeData {
|
|
143
|
+
/** The occupied offsets in even/odd rows/columns */
|
|
144
|
+
offsets: { even: GridOffset2D[]; odd: GridOffset2D[] };
|
|
145
|
+
/** The points in normalized coordinates */
|
|
146
|
+
points: number[];
|
|
147
|
+
/** The center of the shape in normalized coordiantes */
|
|
148
|
+
center: Point;
|
|
149
|
+
/** The snapping anchor in normalized coordiantes, i.e. the top-left grid hex center in the snapped position */
|
|
150
|
+
anchor: Point;
|
|
151
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./_types.mjs";
|
|
2
|
+
export { default as DatabaseBackend } from "./backend.mjs";
|
|
3
|
+
export { default as DataModel } from "./data.mjs";
|
|
4
|
+
export * from "./document.mjs";
|
|
5
|
+
export { default as Document } from "./document.mjs";
|
|
6
|
+
export { default as EmbeddedCollection } from "./embedded-collection.mjs";
|
|
7
|
+
export { default as DocumentSocketResponse } from "./socket.mjs";
|
|
8
|
+
export { default as TypeDataModel } from "./type-data.mjs";
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { DocumentUUID } from "./../../client/utils/helpers.mjs";
|
|
2
|
+
import { DataField } from "./../data/fields.mjs";
|
|
3
|
+
import { DataModel, Document } from "./_module.mjs";
|
|
4
|
+
|
|
5
|
+
export type DataSchema = { [K in string]: DataField<JSONValue, unknown> };
|
|
6
|
+
|
|
7
|
+
export interface DataModelValidationOptions {
|
|
8
|
+
/** Validate each individual field */
|
|
9
|
+
fields?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Perform joint validation on the full data model?
|
|
12
|
+
* Joint validation will be performed by default if no changes are passed.
|
|
13
|
+
* Joint validation will be disabled by default if changes are passed.
|
|
14
|
+
* Joint validation can be performed on a complete set of changes (for example
|
|
15
|
+
* testing a complete data model) by explicitly passing true.
|
|
16
|
+
*/
|
|
17
|
+
joint?: boolean;
|
|
18
|
+
/** A specific set of proposed changes to validate, rather than the full source data of the model. */
|
|
19
|
+
changes?: object;
|
|
20
|
+
/**
|
|
21
|
+
* If changes are provided, attempt to clean the changes before validating them? This option mutates the provided
|
|
22
|
+
* changes.
|
|
23
|
+
*/
|
|
24
|
+
clean?: boolean;
|
|
25
|
+
/** Throw an error if validation fails. */
|
|
26
|
+
strict?: boolean;
|
|
27
|
+
/** Allow replacement of invalid values with valid defaults? This option mutates the provided changes. */
|
|
28
|
+
fallback?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If true, invalid embedded documents will emit a warning and be placed in the invalidDocuments collection rather
|
|
31
|
+
* than causing the parent to be considered invalid. This option mutates the provided changes.
|
|
32
|
+
*/
|
|
33
|
+
dropInvalidEmbedded?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface DataModelConstructionContext<TParent extends DataModel | null> extends Pick<
|
|
37
|
+
DataModelValidationOptions,
|
|
38
|
+
"strict" | "fallback" | "dropInvalidEmbedded"
|
|
39
|
+
> {
|
|
40
|
+
/** A parent DataModel instance to which this DataModel belongs */
|
|
41
|
+
parent?: TParent;
|
|
42
|
+
/** Allow partial source data, ignoring absent fields? */
|
|
43
|
+
partial?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface DataModelUpdateOptions {
|
|
47
|
+
/** Do not finally apply the change, but instead simulate the update workflow */
|
|
48
|
+
dryRun?: boolean;
|
|
49
|
+
|
|
50
|
+
/** Allow automatic fallback to a valid initial value if the value provided for a field in the model is invalid. */
|
|
51
|
+
fallback?: boolean;
|
|
52
|
+
|
|
53
|
+
/** Apply changes to inner objects recursively rather than replacing the top-level object. */
|
|
54
|
+
recursive?: boolean;
|
|
55
|
+
|
|
56
|
+
/** An advanced option used specifically and internally by the ActorDelta model */
|
|
57
|
+
restoreDelta?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface DatabaseGetOperation<TParent extends Document | null> {
|
|
61
|
+
action: "get";
|
|
62
|
+
/** A query object which identifies the set of Documents retrieved */
|
|
63
|
+
query: Record<string, unknown>;
|
|
64
|
+
/** Get requests are never broadcast */
|
|
65
|
+
broadcast?: false;
|
|
66
|
+
/** Return indices only instead of full Document records */
|
|
67
|
+
index?: boolean;
|
|
68
|
+
/** An array of field identifiers which should be indexed */
|
|
69
|
+
indexFields?: string;
|
|
70
|
+
/** A compendium collection ID which contains the Documents */
|
|
71
|
+
pack?: string | null;
|
|
72
|
+
/** A parent Document within which Documents are embedded */
|
|
73
|
+
parent?: TParent;
|
|
74
|
+
/** A parent Document UUID provided when the parent instance is unavailable */
|
|
75
|
+
parentUuid?: DocumentUUID;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface DatabaseCreateOperation<TParent extends Document | null> {
|
|
79
|
+
action: "create";
|
|
80
|
+
/** Whether the database operation is broadcast to other connected clients */
|
|
81
|
+
broadcast: boolean;
|
|
82
|
+
/** An array of data objects from which to create Documents */
|
|
83
|
+
data: object[];
|
|
84
|
+
/** Retain the _id values of provided data instead of generating new ids */
|
|
85
|
+
keepId?: boolean;
|
|
86
|
+
/** Retain the _id values of embedded document data instead of generating new ids for each embedded document */
|
|
87
|
+
keepEmbeddedIds?: boolean;
|
|
88
|
+
/** The timestamp when the operation was performed */
|
|
89
|
+
modifiedTime?: number;
|
|
90
|
+
/** Block the dispatch of hooks related to this operation */
|
|
91
|
+
noHook?: boolean;
|
|
92
|
+
/** Re-render Applications whose display depends on the created Documents */
|
|
93
|
+
render?: boolean;
|
|
94
|
+
/** Render the sheet Application for any created Documents */
|
|
95
|
+
renderSheet?: boolean;
|
|
96
|
+
/** A parent Document within which Documents are embedded */
|
|
97
|
+
parent?: TParent;
|
|
98
|
+
/** A compendium collection ID which contains the Documents */
|
|
99
|
+
pack?: string | null;
|
|
100
|
+
/** A parent Document UUID provided when the parent instance is unavailable */
|
|
101
|
+
parentUuid?: DocumentUUID;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface DatabaseCreateCallbackOptions extends Omit<Partial<DatabaseCreateOperation<null>>, "action" | "data" | "pack" | "parent" | "noHook"> {}
|
|
105
|
+
|
|
106
|
+
export interface DatabaseUpdateOperation<TParent extends Document | null> {
|
|
107
|
+
action: "update";
|
|
108
|
+
/** Whether the database operation is broadcast to other connected clients */
|
|
109
|
+
broadcast: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* An array of data objects used to update existing Documents.
|
|
112
|
+
* Each update object must contain the _id of the target Document
|
|
113
|
+
*/
|
|
114
|
+
updates: object[];
|
|
115
|
+
/**
|
|
116
|
+
* Difference each update object against current Document data and only use differential data for the update
|
|
117
|
+
* operation
|
|
118
|
+
*/
|
|
119
|
+
diff?: boolean;
|
|
120
|
+
/** The timestamp when the operation was performed */
|
|
121
|
+
modifiedTime?: number;
|
|
122
|
+
/** Merge objects recursively. If false, inner objects will be replaced explicitly. Use with caution! */
|
|
123
|
+
recursive?: boolean;
|
|
124
|
+
/** Re-render Applications whose display depends on the created Documents */
|
|
125
|
+
render?: boolean;
|
|
126
|
+
/** Block the dispatch of hooks related to this operation */
|
|
127
|
+
noHook?: boolean;
|
|
128
|
+
/** A parent Document within which Documents are embedded */
|
|
129
|
+
parent?: TParent;
|
|
130
|
+
/** A compendium collection ID which contains the Documents */
|
|
131
|
+
pack?: string | null;
|
|
132
|
+
/** A parent Document UUID provided when the parent instance is unavailable */
|
|
133
|
+
parentUuid?: DocumentUUID;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface DatabaseUpdateCallbackOptions extends Omit<
|
|
137
|
+
Partial<DatabaseUpdateOperation<null>>,
|
|
138
|
+
"action" | "pack" | "parent" | "restoreDelta" | "noHook" | "updates"
|
|
139
|
+
> {}
|
|
140
|
+
|
|
141
|
+
export interface DatabaseDeleteOperation<TParent extends Document | null> {
|
|
142
|
+
action: "delete";
|
|
143
|
+
/** Whether the database operation is broadcast to other connected clients */
|
|
144
|
+
broadcast: boolean;
|
|
145
|
+
/** An array of Document ids which should be deleted */
|
|
146
|
+
ids: string[];
|
|
147
|
+
/** Delete all documents in the Collection, regardless of _id */
|
|
148
|
+
deleteAll?: boolean;
|
|
149
|
+
/** The timestamp when the operation was performed */
|
|
150
|
+
modifiedTime?: number;
|
|
151
|
+
/** Block the dispatch of hooks related to this operation */
|
|
152
|
+
noHook?: boolean;
|
|
153
|
+
/** Re-render Applications whose display depends on the created Documents */
|
|
154
|
+
render?: boolean;
|
|
155
|
+
/** A parent Document within which Documents are embedded */
|
|
156
|
+
parent?: TParent;
|
|
157
|
+
/** A compendium collection ID which contains the Documents */
|
|
158
|
+
pack?: string | null;
|
|
159
|
+
/** A parent Document UUID provided when the parent instance is unavailable */
|
|
160
|
+
parentUuid?: DocumentUUID;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface DatabaseDeleteCallbackOptions extends Omit<
|
|
164
|
+
Partial<DatabaseDeleteOperation<null>>,
|
|
165
|
+
"action" | "deleteAll" | "ids" | "pack" | "parent" | "noHook"
|
|
166
|
+
> {}
|
|
167
|
+
|
|
168
|
+
export type DatabaseAction = "get" | "create" | "update" | "delete";
|
|
169
|
+
|
|
170
|
+
export type DatabaseOperation<TParent extends Document | null> =
|
|
171
|
+
| DatabaseGetOperation<TParent>
|
|
172
|
+
| DatabaseCreateOperation<TParent>
|
|
173
|
+
| DatabaseUpdateOperation<TParent>
|
|
174
|
+
| DatabaseDeleteOperation<TParent>;
|
|
175
|
+
|
|
176
|
+
export interface DocumentSocketRequest {
|
|
177
|
+
/** The type of Document being transacted */
|
|
178
|
+
type: string;
|
|
179
|
+
/** The action of the request */
|
|
180
|
+
action: DatabaseAction;
|
|
181
|
+
/** Operation parameters for the request */
|
|
182
|
+
operation: DatabaseOperation<Document | null>;
|
|
183
|
+
/** The id of the requesting User */
|
|
184
|
+
userId: string;
|
|
185
|
+
/** Should the response be broadcast to other connected clients? */
|
|
186
|
+
broadcast: boolean;
|
|
187
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { CompendiumIndexData } from "./../../client/documents/collections/compendium-collection.mjs";
|
|
2
|
+
import BaseUser from "./../documents/user.mjs";
|
|
3
|
+
import { DatabaseCreateOperation, DatabaseDeleteOperation, DatabaseGetOperation, DatabaseOperation, DatabaseUpdateOperation, Document } from "./_module.mjs";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* An interface shared by both the client and server-side which defines how creation, update, and deletion operations are transacted.
|
|
7
|
+
*/
|
|
8
|
+
export default abstract class DatabaseBackend {
|
|
9
|
+
/* -------------------------------------------- */
|
|
10
|
+
/* Get Operations */
|
|
11
|
+
/* -------------------------------------------- */
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve Documents based on provided query parameters
|
|
15
|
+
* @param documentClass The Document class definition
|
|
16
|
+
* @param operation Parameters of the get operation
|
|
17
|
+
* @param [user] The requesting User
|
|
18
|
+
* @returns An array of retrieved Document instances or index objects
|
|
19
|
+
*/
|
|
20
|
+
get<TDocument extends Document>(
|
|
21
|
+
documentClass: ConstructorOf<TDocument>,
|
|
22
|
+
operation: DatabaseGetOperation<TDocument["parent"] | null>,
|
|
23
|
+
user?: BaseUser,
|
|
24
|
+
): Promise<CompendiumIndexData[] | TDocument[]>;
|
|
25
|
+
|
|
26
|
+
protected _getDocuments<TDocument extends Document>(
|
|
27
|
+
documentClass: AbstractConstructorOf<TDocument>,
|
|
28
|
+
operation: DatabaseGetOperation<TDocument["parent"]>,
|
|
29
|
+
user: BaseUser,
|
|
30
|
+
): Promise<TDocument[]>;
|
|
31
|
+
|
|
32
|
+
/* -------------------------------------------- */
|
|
33
|
+
/* Create Operations */
|
|
34
|
+
/* -------------------------------------------- */
|
|
35
|
+
|
|
36
|
+
create<TDocument extends Document>(
|
|
37
|
+
documentClass: ConstructorOf<TDocument>,
|
|
38
|
+
operation: DatabaseCreateOperation<TDocument["parent"]>,
|
|
39
|
+
user: BaseUser,
|
|
40
|
+
): Promise<TDocument[]>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Create Document instances using provided data and operation parameters.
|
|
44
|
+
* @param documentClass The Document class definition
|
|
45
|
+
* @param operation Parameters of the get operation
|
|
46
|
+
* @param user The requesting User
|
|
47
|
+
* @returns An array of retrieved Document instances or index objects
|
|
48
|
+
*/
|
|
49
|
+
protected abstract _createDocuments<TDocument extends Document>(
|
|
50
|
+
documentClass: ConstructorOf<TDocument>,
|
|
51
|
+
operation: DatabaseCreateOperation<TDocument["parent"]>,
|
|
52
|
+
user: BaseUser,
|
|
53
|
+
): Promise<(CompendiumIndexData | TDocument)[]>;
|
|
54
|
+
|
|
55
|
+
/* -------------------------------------------- */
|
|
56
|
+
/* Update Operations */
|
|
57
|
+
/* -------------------------------------------- */
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Update Documents using provided data and context.
|
|
61
|
+
* It is recommended to use {@link Document.updateDocuments} or {@link Document#update} rather than calling this
|
|
62
|
+
* method directly.
|
|
63
|
+
* @param documentClass The Document class definition
|
|
64
|
+
* @param operation Parameters of the update operation
|
|
65
|
+
* @param user The requesting User
|
|
66
|
+
* @returns An array of updated Document instances
|
|
67
|
+
*/
|
|
68
|
+
update<TDocument extends Document>(
|
|
69
|
+
documentClass: ConstructorOf<TDocument>,
|
|
70
|
+
operation: DatabaseUpdateOperation<TDocument["parent"]>,
|
|
71
|
+
user: BaseUser,
|
|
72
|
+
): Promise<TDocument[]>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Update Document instances using provided data and operation parameters.
|
|
76
|
+
* @param documentClass The Document class definition
|
|
77
|
+
* @param operation Parameters of the update operation
|
|
78
|
+
* @param user The requesting User
|
|
79
|
+
* @returns An array of updated Document instances
|
|
80
|
+
*/
|
|
81
|
+
protected abstract _updateDocuments<TDocument extends Document>(
|
|
82
|
+
documentClass: ConstructorOf<TDocument>,
|
|
83
|
+
operation: DatabaseUpdateOperation<TDocument["parent"]>,
|
|
84
|
+
user: BaseUser,
|
|
85
|
+
): Promise<TDocument[]>;
|
|
86
|
+
|
|
87
|
+
/* -------------------------------------------- */
|
|
88
|
+
/* Delete Operations */
|
|
89
|
+
/* -------------------------------------------- */
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Delete Documents using provided ids and context.
|
|
93
|
+
* It is recommended to use {@link Document.deleteDocuments} or {@link Document#delete} rather than calling this
|
|
94
|
+
* method directly.
|
|
95
|
+
* @param documentClass The Document class definition
|
|
96
|
+
* @param operation Parameters of the delete operation
|
|
97
|
+
* @param user The requesting User
|
|
98
|
+
* @returns An array of deleted Document instances
|
|
99
|
+
*/
|
|
100
|
+
delete<TDocument extends Document>(
|
|
101
|
+
documentClass: ConstructorOf<TDocument>,
|
|
102
|
+
operation: DatabaseDeleteOperation<TDocument["parent"]>,
|
|
103
|
+
user: BaseUser,
|
|
104
|
+
): Promise<TDocument[]>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Delete Document instances using provided ids and operation parameters.
|
|
108
|
+
* @param documentClass The Document class definition
|
|
109
|
+
* @param operation Parameters of the delete operation
|
|
110
|
+
* @param [user] The requesting User
|
|
111
|
+
* @returns An array of deleted Document instances
|
|
112
|
+
*/
|
|
113
|
+
protected abstract _deleteDocuments<TDocument extends Document>(
|
|
114
|
+
documentClass: ConstructorOf<TDocument>,
|
|
115
|
+
operation: DatabaseDeleteOperation<TDocument["parent"]>,
|
|
116
|
+
user: BaseUser,
|
|
117
|
+
): Promise<TDocument[]>;
|
|
118
|
+
|
|
119
|
+
/* -------------------------------------------- */
|
|
120
|
+
/* Helper Methods */
|
|
121
|
+
/* -------------------------------------------- */
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Get the parent Document (if any) associated with a request context.
|
|
125
|
+
* @param operation The requested database operation
|
|
126
|
+
* @returns The parent Document, or null
|
|
127
|
+
* @internal
|
|
128
|
+
*/
|
|
129
|
+
protected _getParent(operation: DatabaseOperation<Document | null>): Promise<Document | null>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Describe the scopes which are suitable as the namespace for a flag key
|
|
133
|
+
*/
|
|
134
|
+
abstract getFlagScopes(): string[];
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Describe the scopes which are suitable as the namespace for a flag key
|
|
138
|
+
*/
|
|
139
|
+
abstract getCompendiumScopes(): string[];
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Log a database operation for an embedded document, capturing the action taken and relevant IDs
|
|
143
|
+
* @param action The action performed
|
|
144
|
+
* @param type The document type
|
|
145
|
+
* @param documents The documents modified
|
|
146
|
+
* @param options
|
|
147
|
+
* @param options.level The logging level
|
|
148
|
+
* @param options.parent A parent document
|
|
149
|
+
* @param options.pack A compendium pack within which the operation occurred
|
|
150
|
+
*/
|
|
151
|
+
protected _logOperation(action: string, type: string, documents: Document[], options?: { level?: string; parent?: Document; pack: string }): void;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Construct a standardized error message given the context of an attempted operation
|
|
155
|
+
*/
|
|
156
|
+
protected _logError(user: BaseUser, action: string, subject: string, options?: { parent: Document; pack?: string }): string;
|
|
157
|
+
|
|
158
|
+
protected abstract _log(level: string, message: string): void;
|
|
159
|
+
}
|