@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,79 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface Number {
|
|
5
|
+
/**
|
|
6
|
+
* Test for near-equivalence of two numbers within some permitted epsilon
|
|
7
|
+
* @param n Some other number
|
|
8
|
+
* @param e Some permitted epsilon, by default 1e-8
|
|
9
|
+
* @returns Are the numbers almost equal?
|
|
10
|
+
*/
|
|
11
|
+
almostEqual(n: number, e?: number): boolean;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Transform a number to an ordinal string representation. i.e.
|
|
15
|
+
* 1 => 1st
|
|
16
|
+
* 2 => 2nd
|
|
17
|
+
* 3 => 3rd
|
|
18
|
+
*/
|
|
19
|
+
ordinalString(): string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Return a string front-padded by zeroes to reach a certain number of numeral characters
|
|
23
|
+
* @param digits The number of characters desired
|
|
24
|
+
* @returns The zero-padded number
|
|
25
|
+
*/
|
|
26
|
+
paddedString(digits: number): string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Return a string prefaced by the sign of the number (+) or (-)
|
|
30
|
+
* @returns The signed number as a string
|
|
31
|
+
*/
|
|
32
|
+
signedString(): string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Round a number to the nearest number which is a multiple of a given interval
|
|
36
|
+
* @param interval The interval to round the number to the nearest multiple of
|
|
37
|
+
* @param [method=round] The rounding method in: round, ceil, floor
|
|
38
|
+
* @returns The rounded number
|
|
39
|
+
*
|
|
40
|
+
* @example Round a number to the nearest step interval
|
|
41
|
+
* ```js
|
|
42
|
+
* let n = 17.18;
|
|
43
|
+
* n.toNearest(5); // 15
|
|
44
|
+
* n.toNearest(10); // 20
|
|
45
|
+
* n.toNearest(10, "floor"); // 10
|
|
46
|
+
* n.toNearest(10, "ceil"); // 20
|
|
47
|
+
* n.toNearest(0.25); // 17.25
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
toNearest(interval?: number, method?: "round" | "ceil" | "floor"): number;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A faster numeric between check which avoids type coercion to the Number object.
|
|
54
|
+
* Since this avoids coercion, if non-numbers are passed in unpredictable results will occur. Use with caution.
|
|
55
|
+
* @param a The lower-bound
|
|
56
|
+
* @param b The upper-bound
|
|
57
|
+
* @param [inclusive=true] Include the bounding values as a true result?
|
|
58
|
+
* @return Is the number between the two bounds?
|
|
59
|
+
*/
|
|
60
|
+
between(a: number, b: number, inclusive?: boolean): boolean;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface NumberConstructor {
|
|
64
|
+
/**
|
|
65
|
+
* Test whether a value is numeric.
|
|
66
|
+
* This is the highest performing algorithm currently available, per https://jsperf.com/isnan-vs-typeof/5
|
|
67
|
+
* @param n A value to test
|
|
68
|
+
* @return Is it a number?
|
|
69
|
+
*/
|
|
70
|
+
isNumeric(n: unknown): boolean;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Attempt to create a number from a user-provided string.
|
|
74
|
+
* @param n The value to convert; typically a string, but may already be a number.
|
|
75
|
+
* @return The number that the string represents, or NaN if no number could be determined.
|
|
76
|
+
*/
|
|
77
|
+
fromString(n: string | number): Number;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface RegExpConstructor {
|
|
5
|
+
/**
|
|
6
|
+
* Escape a given input string, prefacing special characters with backslashes for use in a regular expression
|
|
7
|
+
* @param string The un-escaped input string
|
|
8
|
+
* @returns The escaped string, suitable for use in regular expression
|
|
9
|
+
*/
|
|
10
|
+
escape(string: string): string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface Set<T> {
|
|
5
|
+
/**
|
|
6
|
+
* Return the difference of two sets.
|
|
7
|
+
* @param other Some other set to compare against
|
|
8
|
+
* @returns The difference defined as objects in this which are not present in other
|
|
9
|
+
*/
|
|
10
|
+
difference(other: Set<T>): Set<T>;
|
|
11
|
+
difference<U>(other: Set<U>): Set<T | U>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Return the symmetric difference of two sets.
|
|
15
|
+
* @param other Another set.
|
|
16
|
+
* @returns The set of elements that exist in this or other, but not both.
|
|
17
|
+
*/
|
|
18
|
+
symmetricDifference(other: Set<T>): Set<T>;
|
|
19
|
+
symmetricDifference<U>(other: Set<U>): Set<T | U>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Test whether this set is equal to some other set.
|
|
23
|
+
* Sets are equal if they share the same members, independent of order
|
|
24
|
+
* @param other Some other set to compare against
|
|
25
|
+
* @returns Are the sets equal?
|
|
26
|
+
*/
|
|
27
|
+
equals(other: Set<unknown>): boolean;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Return the first value from the set.
|
|
31
|
+
* @returns The first element in the set, or undefined
|
|
32
|
+
*/
|
|
33
|
+
first(): T | undefined;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Return the intersection of two sets.
|
|
37
|
+
* @param other Some other set to compare against
|
|
38
|
+
* @returns The intersection of both sets
|
|
39
|
+
*/
|
|
40
|
+
intersection(other: Set<T>): Set<T>;
|
|
41
|
+
intersection<U>(other: Set<U>): Set<T | U>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Test whether this set has an intersection with another set.
|
|
45
|
+
* @param other Another set to compare against
|
|
46
|
+
* @returns Do the sets intersect?
|
|
47
|
+
*/
|
|
48
|
+
intersects(other: Set<unknown>): boolean;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Return the union of two sets.
|
|
52
|
+
* @param other The other set.
|
|
53
|
+
*/
|
|
54
|
+
union(other: Set<T>): Set<T>;
|
|
55
|
+
union<U>(other: Set<U>): Set<T | U>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Test whether this set is a subset of some other set.
|
|
59
|
+
* A set is a subset if all its members are also present in the other set.
|
|
60
|
+
* @param other Some other set that may be a subset of this one
|
|
61
|
+
* @returns Is the other set a subset of this one?
|
|
62
|
+
*/
|
|
63
|
+
isSubset(other: Set<unknown>): boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Convert a set to a JSON object by mapping its contents to an array
|
|
67
|
+
* @returns The set elements as an array.
|
|
68
|
+
*/
|
|
69
|
+
toObject(): T[];
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Test whether every element in this Set satisfies a certain test criterion.
|
|
73
|
+
* @see Array#every
|
|
74
|
+
* @param test The test criterion to apply. Positional arguments are the value,
|
|
75
|
+
* the index of iteration, and the set being tested.
|
|
76
|
+
* @returns {boolean} Does every element in the set satisfy the test criterion?
|
|
77
|
+
*/
|
|
78
|
+
every<U extends T = T>(test: (value: T, index: number, set: Set<T>) => value is U): this is Set<U>;
|
|
79
|
+
every(test: (value: T, index: number, set: Set<T>) => boolean): boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Filter this set to create a subset of elements which satisfy a certain test criterion.
|
|
83
|
+
* @see Array#filter
|
|
84
|
+
* @param {function(*,number,Set): boolean} test The test criterion to apply. Positional arguments are the value,
|
|
85
|
+
* the index of iteration, and the set being filtered.
|
|
86
|
+
* @returns {Set} A new Set containing only elements which satisfy the test criterion.
|
|
87
|
+
*/
|
|
88
|
+
filter<U extends T = T>(test: (value: T, index: number, set: Set<T>) => value is U): Set<U>;
|
|
89
|
+
filter(test: (value: T, index: number, set: Set<T>) => boolean): Set<T>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Find the first element in this set which satisfies a certain test criterion.
|
|
93
|
+
* @see Array#find
|
|
94
|
+
* @param test The test criterion to apply. Positional arguments are the value, the index of iteration, and the set being searched.
|
|
95
|
+
* @returns The first element in the set which satisfies the test criterion, or undefined.
|
|
96
|
+
*/
|
|
97
|
+
find<U extends T = T>(test: (value: T, index: number, obj: Set<T>) => value is U): U | undefined;
|
|
98
|
+
find(test: (value: T, index: number, obj: Set<T>) => boolean): T | undefined;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Create a new Set where every element is modified by a provided transformation function.
|
|
102
|
+
* @see Array#map
|
|
103
|
+
* @param transform The transformation function to apply.Positional arguments are the value, the index of iteration,
|
|
104
|
+
* and the set being transformed.
|
|
105
|
+
* @returns A new Set of equal size containing transformed elements.
|
|
106
|
+
*/
|
|
107
|
+
map<U>(transform: (value: T, index: number, set: Set<T>) => U): Set<U>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Create a new Set with elements that are filtered and transformed by a provided reducer function.
|
|
111
|
+
* @see Array#reduce
|
|
112
|
+
* @param reducer A reducer function applied to each value. Positional arguments are the accumulator, the value,
|
|
113
|
+
* the index of iteration, and the set being reduced.
|
|
114
|
+
* @param accumulator The initial value of the returned accumulator.
|
|
115
|
+
* @returns The final value of the accumulator.
|
|
116
|
+
*/
|
|
117
|
+
reduce<U>(reducer: (previousValue: U, currentValue: T, currentIndex: number, set: Set<T>) => U, accumulator: U): U;
|
|
118
|
+
reduce(reducer: (previousValue: T, currentValue: T, currentIndex: number, set: Set<T>) => T, accumulator: T): T;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Test whether any element in this Set satisfies a certain test criterion.
|
|
122
|
+
* @see Array#some
|
|
123
|
+
* @param test The test criterion to apply. Positional arguments are the value, the index of iteration, and the set
|
|
124
|
+
* being tested.
|
|
125
|
+
* @returns Does any element in the set satisfy the test criterion?
|
|
126
|
+
*/
|
|
127
|
+
some(test: (value: T, index: number, set: Set<T>) => boolean): boolean;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface String {
|
|
5
|
+
/** Capitalize a string, transforming its first character to a capital letter. */
|
|
6
|
+
capitalize(): string;
|
|
7
|
+
|
|
8
|
+
/** Convert a string to Title Case where the first letter of each word is capitalized. */
|
|
9
|
+
titleCase(): string;
|
|
10
|
+
|
|
11
|
+
/** Strip any <script> tags which were included within a provided string */
|
|
12
|
+
stripScripts(): string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Transform any string into an url-viable slug string
|
|
16
|
+
* @param options Optional arguments which customize how the slugify operation is performed
|
|
17
|
+
* @param options.replacement The replacement character to separate terms, default is '-'
|
|
18
|
+
* @param options.strict Replace all non-alphanumeric characters, or allow them? Default false
|
|
19
|
+
* @param options.lowercase Lowercase the string.
|
|
20
|
+
* @returns The slugified input string
|
|
21
|
+
*/
|
|
22
|
+
slugify(options?: { replacement?: string; strict?: boolean; lowercase?: boolean }): string;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
// Not able to augment URL constructor
|
|
4
|
+
|
|
5
|
+
// declare interface URL {
|
|
6
|
+
// /**
|
|
7
|
+
// * Attempt to parse a URL without throwing an error.
|
|
8
|
+
// * @param url The string to parse.
|
|
9
|
+
// * @returns The parsed URL if successful, otherwise null.
|
|
10
|
+
// */
|
|
11
|
+
// parseSafe(url: string): URL | null;
|
|
12
|
+
// }
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** @module prosemirror */
|
|
2
|
+
|
|
3
|
+
import * as collab from "prosemirror-collab";
|
|
4
|
+
import { keymap } from "prosemirror-keymap";
|
|
5
|
+
import { DOMSerializer, Schema } from "prosemirror-model";
|
|
6
|
+
import { AllSelection, EditorState, Plugin, PluginKey, TextSelection } from "prosemirror-state";
|
|
7
|
+
import { Step } from "prosemirror-transform";
|
|
8
|
+
import { EditorView } from "prosemirror-view";
|
|
9
|
+
import ProseMirrorClickHandler from "./click-handler.mjs";
|
|
10
|
+
import ProseMirrorContentLinkPlugin from "./content-link-plugin.mjs";
|
|
11
|
+
import ProseMirrorDirtyPlugin from "./dirty-plugin.mjs";
|
|
12
|
+
import DOMParser from "./dom-parser.mjs";
|
|
13
|
+
import "./extensions.mjs";
|
|
14
|
+
import ProseMirrorHighlightMatchesPlugin from "./highlight-matches-plugin.mjs";
|
|
15
|
+
import ProseMirrorImagePlugin from "./image-plugin.mjs";
|
|
16
|
+
import ProseMirrorInputRules from "./input-rules.mjs";
|
|
17
|
+
import ProseMirrorKeyMaps from "./keymaps.mjs";
|
|
18
|
+
import ProseMirrorMenu from "./menu.mjs";
|
|
19
|
+
import ProseMirrorPlugin from "./plugin.mjs";
|
|
20
|
+
import { schema as defaultSchema } from "./schema.mjs";
|
|
21
|
+
import { parseHTMLString, serializeHTMLString } from "./util.mjs";
|
|
22
|
+
|
|
23
|
+
declare const dom: {
|
|
24
|
+
parser: DOMParser;
|
|
25
|
+
serializer: DOMSerializer;
|
|
26
|
+
parseString: typeof parseHTMLString;
|
|
27
|
+
serializeString: typeof serializeHTMLString;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
declare const defaultPlugins: {
|
|
31
|
+
inputRules: Plugin;
|
|
32
|
+
keyMaps: Plugin;
|
|
33
|
+
menu: Plugin;
|
|
34
|
+
isDirty: Plugin;
|
|
35
|
+
clickHandler: Plugin;
|
|
36
|
+
pasteTransformer: Plugin;
|
|
37
|
+
baseKeyMap: Plugin;
|
|
38
|
+
dropCursor: Plugin;
|
|
39
|
+
gapCursor: Plugin;
|
|
40
|
+
history: Plugin;
|
|
41
|
+
columnResizing: Plugin;
|
|
42
|
+
tables: Plugin;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export * as commands from "prosemirror-commands";
|
|
46
|
+
export * as input from "prosemirror-inputrules";
|
|
47
|
+
export * as list from "prosemirror-schema-list";
|
|
48
|
+
export * as state from "prosemirror-state";
|
|
49
|
+
export * as tables from "prosemirror-tables";
|
|
50
|
+
export * as transform from "prosemirror-transform";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
AllSelection,
|
|
54
|
+
collab,
|
|
55
|
+
defaultPlugins,
|
|
56
|
+
defaultSchema,
|
|
57
|
+
dom,
|
|
58
|
+
DOMParser,
|
|
59
|
+
DOMSerializer,
|
|
60
|
+
EditorState,
|
|
61
|
+
EditorView,
|
|
62
|
+
keymap,
|
|
63
|
+
Plugin,
|
|
64
|
+
PluginKey,
|
|
65
|
+
ProseMirrorClickHandler,
|
|
66
|
+
ProseMirrorContentLinkPlugin,
|
|
67
|
+
ProseMirrorDirtyPlugin,
|
|
68
|
+
ProseMirrorHighlightMatchesPlugin,
|
|
69
|
+
ProseMirrorImagePlugin,
|
|
70
|
+
ProseMirrorInputRules,
|
|
71
|
+
ProseMirrorKeyMaps,
|
|
72
|
+
ProseMirrorMenu,
|
|
73
|
+
ProseMirrorPlugin,
|
|
74
|
+
Schema,
|
|
75
|
+
Step,
|
|
76
|
+
TextSelection,
|
|
77
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { DOMOutputSpec, Mark, MarkType, Node, NodeType } from "prosemirror-model";
|
|
2
|
+
import { EditorState } from "prosemirror-state";
|
|
3
|
+
import { EditorView } from "prosemirror-view";
|
|
4
|
+
import Document from "./../abstract/document.mjs";
|
|
5
|
+
|
|
6
|
+
interface ProseMirrorContentLinkOptions {
|
|
7
|
+
/** The parent document housing this editor. */
|
|
8
|
+
document?: Document;
|
|
9
|
+
/** Whether to generate links relative to the parent document. */
|
|
10
|
+
relativeLinks?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ProseMirrorMenuOptions {
|
|
14
|
+
/** A function to call when the save button is pressed. */
|
|
15
|
+
onSave?: Function;
|
|
16
|
+
/** Whether this editor instance is intended to be destroyed when saved. */
|
|
17
|
+
destroyOnSave?: boolean;
|
|
18
|
+
/** Whether to display a more compact version of the menu. */
|
|
19
|
+
compact?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface ProseMirrorMenuItem {
|
|
23
|
+
/** A string identifier for this menu item. */
|
|
24
|
+
action: string;
|
|
25
|
+
/** The description of the menu item. */
|
|
26
|
+
title: string;
|
|
27
|
+
/** An optional class to apply to the menu item. */
|
|
28
|
+
class?: string;
|
|
29
|
+
/** An optional style to apply to the title text. */
|
|
30
|
+
style?: string;
|
|
31
|
+
/** The menu item's icon HTML. */
|
|
32
|
+
icon?: string;
|
|
33
|
+
/** The mark to apply to the selected text. */
|
|
34
|
+
mark?: MarkType;
|
|
35
|
+
/** The node to wrap the selected text in. */
|
|
36
|
+
node?: NodeType;
|
|
37
|
+
/** An object of attributes for the node or mark. */
|
|
38
|
+
attrs?: object;
|
|
39
|
+
/**
|
|
40
|
+
* Entries with the same group number will be grouped together in the drop-down. Lower-numbered groups appear higher
|
|
41
|
+
* in the list.
|
|
42
|
+
*/
|
|
43
|
+
group?: number;
|
|
44
|
+
/**
|
|
45
|
+
* A numeric priority which determines whether this item is displayed as the dropdown title. Lower priority takes
|
|
46
|
+
* precedence.
|
|
47
|
+
*/
|
|
48
|
+
priority?: number;
|
|
49
|
+
/** The command to run when the menu item is clicked. */
|
|
50
|
+
cmd?: ProseMirrorCommand;
|
|
51
|
+
/** Whether the current item is active under the given selection or cursor. */
|
|
52
|
+
active?: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface ProseMirrorDropDownEntry extends ProseMirrorMenuItem {
|
|
56
|
+
/** Any child entries. */
|
|
57
|
+
children?: ProseMirrorDropDownEntry[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface ProseMirrorDropDownConfig {
|
|
61
|
+
/** The default title of the drop-down. */
|
|
62
|
+
title: string;
|
|
63
|
+
/** The menu CSS class. */
|
|
64
|
+
cssClass: string;
|
|
65
|
+
/** An optional icon to use instead of a text label. */
|
|
66
|
+
icon?: string;
|
|
67
|
+
/** The drop-down entries. */
|
|
68
|
+
entries: ProseMirrorDropDownEntry[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type ProseMirrorCommand = (state: EditorState, dispatch: Function, view: EditorView) => boolean;
|
|
72
|
+
export type MenuToggleBlockWrapCommand = (node: NodeType, attrs?: object) => ProseMirrorCommand;
|
|
73
|
+
export type ProseMirrorNodeOutput = (node: Node) => DOMOutputSpec;
|
|
74
|
+
export type ProseMirrorMarkOutput = (mark: Mark, inline: boolean) => DOMOutputSpec;
|
|
75
|
+
export type ProseMirrorSliceTransformer = (node: Node) => Node | void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Schema } from "prosemirror-model";
|
|
2
|
+
import { Plugin } from "prosemirror-state";
|
|
3
|
+
import { EditorView } from "prosemirror-view";
|
|
4
|
+
import ProseMirrorPlugin from "./plugin.mjs";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A class responsible for managing click events inside a ProseMirror editor.
|
|
8
|
+
*/
|
|
9
|
+
export default class ProseMirrorClickHandler extends ProseMirrorPlugin {
|
|
10
|
+
static override build(schema: Schema, options?: object): Plugin;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Handle a click on the editor.
|
|
14
|
+
* @param view The ProseMirror editor view.
|
|
15
|
+
* @param pos The position in the ProseMirror document that the click occurred at.
|
|
16
|
+
* @param node The current ProseMirror Node that the click has bubbled to.
|
|
17
|
+
* @param nodePos The position of the click within this Node.
|
|
18
|
+
* @param event The click event.
|
|
19
|
+
* @param direct Whether this Node is the one that was directly clicked on.
|
|
20
|
+
* @returns A return value of true indicates the event has been handled, it will not propagate to other plugins, and
|
|
21
|
+
* ProseMirror will call preventDefault on it.
|
|
22
|
+
*/
|
|
23
|
+
protected _onClick(view: EditorView, pos: number, node: Node, nodePos: number, event: PointerEvent, direct: boolean): boolean | void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Schema, Slice } from "prosemirror-model";
|
|
2
|
+
import { Plugin } from "prosemirror-state";
|
|
3
|
+
import { EditorView } from "prosemirror-view";
|
|
4
|
+
import { ClientDocument } from "./../../client/documents/abstract/client-document.mjs";
|
|
5
|
+
import { ProseMirrorContentLinkOptions } from "./_types.mjs";
|
|
6
|
+
import ProseMirrorPlugin from "./plugin.mjs";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A class responsible for handling the dropping of Documents onto the editor and creating content links for them.
|
|
10
|
+
*/
|
|
11
|
+
export default class ProseMirrorContentLinkPlugin extends ProseMirrorPlugin {
|
|
12
|
+
/** The parent document housing this editor. */
|
|
13
|
+
document: Readonly<ClientDocument>;
|
|
14
|
+
|
|
15
|
+
/** Whether to generate links relative to the parent document. */
|
|
16
|
+
relativeLinks: boolean;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param schema The ProseMirror schema.
|
|
20
|
+
* @param options Additional options to configure the plugin's behaviour.
|
|
21
|
+
*/
|
|
22
|
+
constructor(schema: Schema, options?: ProseMirrorContentLinkOptions);
|
|
23
|
+
|
|
24
|
+
static override build(schema: Schema, options?: object): Plugin;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Handle a drop onto the editor.
|
|
28
|
+
* @param view The ProseMirror editor view.
|
|
29
|
+
* @param event The drop event.
|
|
30
|
+
* @param slice A slice of editor content.
|
|
31
|
+
* @param moved Whether the slice has been moved from a different part of the editor.
|
|
32
|
+
*/
|
|
33
|
+
protected _onDrop(view: EditorView, event: DragEvent, slice: Slice, moved: boolean): boolean | void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Schema } from "prosemirror-model";
|
|
2
|
+
import { Plugin } from "prosemirror-state";
|
|
3
|
+
import ProseMirrorPlugin from "./plugin.mjs";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A simple plugin that records the dirty state of the editor.
|
|
7
|
+
*/
|
|
8
|
+
export default class ProseMirrorDirtyPlugin extends ProseMirrorPlugin {
|
|
9
|
+
static override build(schema: Schema, options?: object): Plugin;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DOMParser as BaseDOMParser, ParseOptions, Node as ProseMirrorNode, Schema } from "prosemirror-model";
|
|
2
|
+
|
|
3
|
+
export default class DOMParser extends BaseDOMParser {
|
|
4
|
+
override parse(dom: Node, options?: ParseOptions): ProseMirrorNode;
|
|
5
|
+
|
|
6
|
+
static override fromSchema(schema: Schema): DOMParser;
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export class ProseMirrorDropDown {
|
|
2
|
+
/** The default title for this drop-down. */
|
|
3
|
+
title: string;
|
|
4
|
+
|
|
5
|
+
/** The items configured for this drop-down. */
|
|
6
|
+
items: ProseMirrorMenuItem[];
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A class responsible for rendering a menu drop-down.
|
|
10
|
+
* @param title The default title.
|
|
11
|
+
* @param items The configured menu items.
|
|
12
|
+
* @param [options]
|
|
13
|
+
* @param [options.cssClass] The menu CSS class name. Required if providing an action.
|
|
14
|
+
* @param [options.icon] Use an icon for the dropdown rather than a text label.
|
|
15
|
+
* @param [options.onAction] A callback to fire when a menu item is clicked.
|
|
16
|
+
*/
|
|
17
|
+
constructor(title: string, items: ProseMirrorMenuItem[], options?: { cssClass?: string; icon: string; onAction?: (event: PointerEvent) => void });
|
|
18
|
+
|
|
19
|
+
/** Attach event listeners. */
|
|
20
|
+
activateListeners(html: HTMLElement): void;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Construct the drop-down menu's HTML.
|
|
24
|
+
* @returns HTML contents as a string.
|
|
25
|
+
*/
|
|
26
|
+
render(): string;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Recurse through the menu structure and apply a function to each item in it.
|
|
30
|
+
* @param fn The function to call on each item. Return false to prevent
|
|
31
|
+
* iterating over any further items.
|
|
32
|
+
*/
|
|
33
|
+
forEachItem(fn: (item: ProseMirrorMenuItem) => boolean): void;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Render a list of drop-down menu items.
|
|
37
|
+
* @param entries The menu items.
|
|
38
|
+
* @returns HTML contents as a string.
|
|
39
|
+
*/
|
|
40
|
+
protected static _renderMenu(entries: ProseMirrorMenuItem[]): string;
|
|
41
|
+
|
|
42
|
+
/* -------------------------------------------- */
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Render an individual drop-down menu item.
|
|
46
|
+
* @param item The menu item.
|
|
47
|
+
* @returns HTML contents as a string.
|
|
48
|
+
*/
|
|
49
|
+
protected static _renderMenuItem(item: ProseMirrorMenuItem): string;
|
|
50
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Schema } from "prosemirror-model";
|
|
2
|
+
import { EditorState, Plugin } from "prosemirror-state";
|
|
3
|
+
import { EditorView } from "prosemirror-view";
|
|
4
|
+
import ProseMirrorPlugin from "./plugin.mjs";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A class responsible for handling the display of automated link recommendations when a user highlights text in a
|
|
8
|
+
* ProseMirror editor.
|
|
9
|
+
*/
|
|
10
|
+
export class PossibleMatchesTooltip {
|
|
11
|
+
/**
|
|
12
|
+
* @param view The editor view.
|
|
13
|
+
*/
|
|
14
|
+
constructor(view: EditorView);
|
|
15
|
+
|
|
16
|
+
/** A reference to any existing tooltip that has been generated as part of a highlight match. */
|
|
17
|
+
tooltip: HTMLElement;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Update the tooltip based on changes to the selected text.
|
|
21
|
+
* @param view The editor view.
|
|
22
|
+
* @param lastState The previous state of the document.
|
|
23
|
+
*/
|
|
24
|
+
update(view: EditorView, lastState: EditorState): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A ProseMirrorPlugin wrapper around the PossibleMatchesTooltip class.
|
|
29
|
+
*/
|
|
30
|
+
export default class ProseMirrorHighlightMatchesPlugin extends ProseMirrorPlugin {
|
|
31
|
+
/**
|
|
32
|
+
* @param schema The ProseMirror schema.
|
|
33
|
+
* @param [options] Additional options to configure the plugin's behaviour.
|
|
34
|
+
*/
|
|
35
|
+
constructor(schema: Schema, options?: ProseMirrorMenuOptions);
|
|
36
|
+
|
|
37
|
+
static override build(schema: Schema, options?: object): Plugin;
|
|
38
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Schema, Slice } from "prosemirror-model";
|
|
2
|
+
import { Plugin } from "prosemirror-state";
|
|
3
|
+
import { EditorView } from "prosemirror-view";
|
|
4
|
+
import { ClientDocument } from "./../../client/documents/abstract/client-document.mjs";
|
|
5
|
+
import ProseMirrorPlugin from "./plugin.mjs";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A class responsible for handle drag-and-drop and pasting of image content. Ensuring no base64 data is injected
|
|
9
|
+
* directly into the journal content and it is instead uploaded to the user's data directory.
|
|
10
|
+
*/
|
|
11
|
+
export default class ProseMirrorImagePlugin extends ProseMirrorPlugin {
|
|
12
|
+
/** The related Document to store extracted base64 images for. */
|
|
13
|
+
document: Readonly<ClientDocument>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param schema The ProseMirror schema.
|
|
17
|
+
* @param options Additional options to configure the plugin's behaviour.
|
|
18
|
+
* @param options.document A related Document to store extract base64 images for.
|
|
19
|
+
*/
|
|
20
|
+
constructor(schema: Schema, options: { document: ClientDocument });
|
|
21
|
+
|
|
22
|
+
static override build(schema: Schema, options?: object): Plugin;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Handle a drop onto the editor.
|
|
26
|
+
* @param view The ProseMirror editor view.
|
|
27
|
+
* @param event The drop event.
|
|
28
|
+
* @param slice A slice of editor content.
|
|
29
|
+
* @param moved Whether the slice has been moved from a different part of the editor.
|
|
30
|
+
*/
|
|
31
|
+
protected _onDrop(view: EditorView, event: DragEvent, slice: Slice, moved: boolean): boolean | void;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Handle a paste into the editor.
|
|
35
|
+
* @param view The ProseMirror editor view.
|
|
36
|
+
* @param event The paste event.
|
|
37
|
+
*/
|
|
38
|
+
protected _onPaste(view: EditorView, event: ClipboardEvent): boolean | void;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Upload any image files encountered in the drop.
|
|
42
|
+
* @param view The ProseMirror editor view.
|
|
43
|
+
* @param files The files to upload.
|
|
44
|
+
* @param [pos] The position in the document to insert at. If not provided, the current selection will be
|
|
45
|
+
* replaced instead.
|
|
46
|
+
*/
|
|
47
|
+
protected _uploadImages(view: EditorView, files: FileList, pos?: number): Promise<void>;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Capture any base64-encoded images embedded in the rich text paste and upload them.
|
|
51
|
+
* @param view The ProseMirror editor view.
|
|
52
|
+
* @param html The HTML data as a string.
|
|
53
|
+
* @param images An array of extracted base64 image data.
|
|
54
|
+
*/
|
|
55
|
+
protected _replaceBase64Images(view: EditorView, html: string, images: [string, string, string][]): Promise<void>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Detect base64 image data embedded in an HTML string and extract it.
|
|
59
|
+
* @param html The HTML data as a string.
|
|
60
|
+
*/
|
|
61
|
+
protected _extractBase64Images(html: string): [string, string, string][];
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Convert a base64 string into a File object.
|
|
65
|
+
* @param data Base64 encoded data.
|
|
66
|
+
* @param filename The filename.
|
|
67
|
+
* @param mimetype The file's mimetype.
|
|
68
|
+
*/
|
|
69
|
+
static base64ToFile(data: string, filename: string, mimetype: string): File;
|
|
70
|
+
}
|