@avis-studio/engine 0.0.0-stage → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -2
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/dist/a11y/focus.d.ts +60 -0
- package/dist/a11y/focus.js +222 -0
- package/dist/a11y/index.d.ts +2 -0
- package/dist/a11y/index.js +4 -0
- package/dist/a11y/semantics.d.ts +37 -0
- package/dist/a11y/semantics.js +88 -0
- package/dist/commands/builtins.d.ts +88 -0
- package/dist/commands/builtins.js +362 -0
- package/dist/commands/command.d.ts +23 -0
- package/dist/commands/command.js +20 -0
- package/dist/commands/draft.d.ts +33 -0
- package/dist/commands/draft.js +96 -0
- package/dist/commands/history.d.ts +34 -0
- package/dist/commands/history.js +80 -0
- package/dist/commands/index.d.ts +6 -0
- package/dist/commands/index.js +6 -0
- package/dist/commands/patch.d.ts +24 -0
- package/dist/commands/patch.js +44 -0
- package/dist/commands/transaction.d.ts +16 -0
- package/dist/commands/transaction.js +39 -0
- package/dist/core/diagnostics.d.ts +23 -0
- package/dist/core/diagnostics.js +23 -0
- package/dist/core/disposable.d.ts +14 -0
- package/dist/core/disposable.js +51 -0
- package/dist/core/engine.d.ts +108 -0
- package/dist/core/engine.js +323 -0
- package/dist/core/event-bus.d.ts +10 -0
- package/dist/core/event-bus.js +33 -0
- package/dist/core/ids.d.ts +13 -0
- package/dist/core/ids.js +6 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.js +7 -0
- package/dist/core/plugin.d.ts +20 -0
- package/dist/core/plugin.js +47 -0
- package/dist/core/services.d.ts +14 -0
- package/dist/core/services.js +20 -0
- package/dist/devtools/index.d.ts +1 -0
- package/dist/devtools/index.js +2 -0
- package/dist/devtools/panel.d.ts +39 -0
- package/dist/devtools/panel.js +100 -0
- package/dist/dom/a11y-layer.d.ts +32 -0
- package/dist/dom/a11y-layer.js +358 -0
- package/dist/dom/anchor.d.ts +34 -0
- package/dist/dom/anchor.js +35 -0
- package/dist/dom/index.d.ts +6 -0
- package/dist/dom/index.js +8 -0
- package/dist/dom/menu.d.ts +24 -0
- package/dist/dom/menu.js +122 -0
- package/dist/dom/overlays.d.ts +29 -0
- package/dist/dom/overlays.js +82 -0
- package/dist/dom/paint/collect.d.ts +8 -0
- package/dist/dom/paint/collect.js +589 -0
- package/dist/dom/paint/css.d.ts +86 -0
- package/dist/dom/paint/css.js +526 -0
- package/dist/dom/paint/draw.d.ts +16 -0
- package/dist/dom/paint/draw.js +413 -0
- package/dist/dom/paint/ghost.d.ts +2 -0
- package/dist/dom/paint/ghost.js +8 -0
- package/dist/dom/paint/index.d.ts +6 -0
- package/dist/dom/paint/index.js +9 -0
- package/dist/dom/paint/text.d.ts +26 -0
- package/dist/dom/paint/text.js +209 -0
- package/dist/dom/paint/types.d.ts +174 -0
- package/dist/dom/paint/types.js +7 -0
- package/dist/dom/paint/watch.d.ts +10 -0
- package/dist/dom/paint/watch.js +109 -0
- package/dist/dom/position.d.ts +37 -0
- package/dist/dom/position.js +125 -0
- package/dist/dom/text-editor.d.ts +27 -0
- package/dist/dom/text-editor.js +128 -0
- package/dist/events/event.d.ts +122 -0
- package/dist/events/event.js +130 -0
- package/dist/events/eventer.d.ts +24 -0
- package/dist/events/eventer.js +83 -0
- package/dist/events/index.d.ts +3 -0
- package/dist/events/index.js +3 -0
- package/dist/events/interaction.d.ts +43 -0
- package/dist/events/interaction.js +203 -0
- package/dist/geometry/anchors.d.ts +14 -0
- package/dist/geometry/anchors.js +13 -0
- package/dist/geometry/bounds.d.ts +16 -0
- package/dist/geometry/bounds.js +42 -0
- package/dist/geometry/curves.d.ts +39 -0
- package/dist/geometry/curves.js +68 -0
- package/dist/geometry/index.d.ts +6 -0
- package/dist/geometry/index.js +6 -0
- package/dist/geometry/matrix.d.ts +22 -0
- package/dist/geometry/matrix.js +56 -0
- package/dist/geometry/spaces.d.ts +22 -0
- package/dist/geometry/spaces.js +28 -0
- package/dist/geometry/vec2.d.ts +12 -0
- package/dist/geometry/vec2.js +10 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +22 -0
- package/dist/interaction/behaviors.d.ts +10 -0
- package/dist/interaction/behaviors.js +744 -0
- package/dist/interaction/controller.d.ts +180 -0
- package/dist/interaction/controller.js +269 -0
- package/dist/interaction/hit-test.d.ts +45 -0
- package/dist/interaction/hit-test.js +119 -0
- package/dist/interaction/index.d.ts +4 -0
- package/dist/interaction/index.js +7 -0
- package/dist/interaction/web-input.d.ts +13 -0
- package/dist/interaction/web-input.js +172 -0
- package/dist/layout/index.d.ts +1 -0
- package/dist/layout/index.js +2 -0
- package/dist/layout/layout.d.ts +27 -0
- package/dist/layout/layout.js +266 -0
- package/dist/react/canvas/graph.d.ts +83 -0
- package/dist/react/canvas/graph.js +89 -0
- package/dist/react/canvas/hooks.d.ts +42 -0
- package/dist/react/canvas/hooks.js +78 -0
- package/dist/react/canvas/index.d.ts +35 -0
- package/dist/react/canvas/index.js +8 -0
- package/dist/react/components.d.ts +55 -0
- package/dist/react/components.js +197 -0
- package/dist/react/context.d.ts +4 -0
- package/dist/react/context.js +9 -0
- package/dist/react/flow/api/LICENSE +21 -0
- package/dist/react/flow/api/externals.d.ts +12 -0
- package/dist/react/flow/api/react/additional-components/Background/Background.d.ts +7 -0
- package/dist/react/flow/api/react/additional-components/Background/Patterns.d.ts +17 -0
- package/dist/react/flow/api/react/additional-components/Background/index.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/Background/types.d.ts +25 -0
- package/dist/react/flow/api/react/additional-components/Controls/ControlButton.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/Controls/Controls.d.ts +7 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/FitView.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/Lock.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/Minus.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/Plus.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/Icons/Unlock.d.ts +1 -0
- package/dist/react/flow/api/react/additional-components/Controls/index.d.ts +3 -0
- package/dist/react/flow/api/react/additional-components/Controls/types.d.ts +20 -0
- package/dist/react/flow/api/react/additional-components/EdgeToolbar/EdgeToolbar.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/EdgeToolbar/index.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/EdgeToolbar/types.d.ts +6 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/MiniMap.d.ts +8 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/MiniMapNode.d.ts +4 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/MiniMapNodes.d.ts +5 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/index.d.ts +3 -0
- package/dist/react/flow/api/react/additional-components/MiniMap/types.d.ts +44 -0
- package/dist/react/flow/api/react/additional-components/NodeResizer/NodeResizeControl.d.ts +5 -0
- package/dist/react/flow/api/react/additional-components/NodeResizer/NodeResizer.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/NodeResizer/index.d.ts +3 -0
- package/dist/react/flow/api/react/additional-components/NodeResizer/types.d.ts +32 -0
- package/dist/react/flow/api/react/additional-components/NodeToolbar/NodeToolbar.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/NodeToolbar/NodeToolbarPortal.d.ts +4 -0
- package/dist/react/flow/api/react/additional-components/NodeToolbar/index.d.ts +2 -0
- package/dist/react/flow/api/react/additional-components/NodeToolbar/types.d.ts +9 -0
- package/dist/react/flow/api/react/additional-components/index.d.ts +6 -0
- package/dist/react/flow/api/react/components/A11yDescriptions/index.d.ts +7 -0
- package/dist/react/flow/api/react/components/Attribution/index.d.ts +8 -0
- package/dist/react/flow/api/react/components/BatchProvider/index.d.ts +10 -0
- package/dist/react/flow/api/react/components/BatchProvider/types.d.ts +6 -0
- package/dist/react/flow/api/react/components/BatchProvider/useQueue.d.ts +2 -0
- package/dist/react/flow/api/react/components/ConnectionLine/index.d.ts +11 -0
- package/dist/react/flow/api/react/components/EdgeLabelRenderer/index.d.ts +5 -0
- package/dist/react/flow/api/react/components/EdgeWrapper/EdgeUpdateAnchors.d.ts +14 -0
- package/dist/react/flow/api/react/components/EdgeWrapper/index.d.ts +5 -0
- package/dist/react/flow/api/react/components/EdgeWrapper/utils.d.ts +11 -0
- package/dist/react/flow/api/react/components/Edges/BaseEdge.d.ts +2 -0
- package/dist/react/flow/api/react/components/Edges/BezierEdge.d.ts +4 -0
- package/dist/react/flow/api/react/components/Edges/EdgeAnchor.d.ts +13 -0
- package/dist/react/flow/api/react/components/Edges/EdgeText.d.ts +7 -0
- package/dist/react/flow/api/react/components/Edges/SimpleBezierEdge.d.ts +20 -0
- package/dist/react/flow/api/react/components/Edges/SmoothStepEdge.d.ts +4 -0
- package/dist/react/flow/api/react/components/Edges/StepEdge.d.ts +4 -0
- package/dist/react/flow/api/react/components/Edges/StraightEdge.d.ts +4 -0
- package/dist/react/flow/api/react/components/Edges/index.d.ts +5 -0
- package/dist/react/flow/api/react/components/Handle/index.d.ts +8 -0
- package/dist/react/flow/api/react/components/NodeWrapper/index.d.ts +4 -0
- package/dist/react/flow/api/react/components/NodeWrapper/useNodeObserver.d.ts +7 -0
- package/dist/react/flow/api/react/components/NodeWrapper/utils.d.ts +8 -0
- package/dist/react/flow/api/react/components/Nodes/DefaultNode.d.ts +2 -0
- package/dist/react/flow/api/react/components/Nodes/GroupNode.d.ts +1 -0
- package/dist/react/flow/api/react/components/Nodes/InputNode.d.ts +2 -0
- package/dist/react/flow/api/react/components/Nodes/OutputNode.d.ts +2 -0
- package/dist/react/flow/api/react/components/Nodes/utils.d.ts +12 -0
- package/dist/react/flow/api/react/components/NodesSelection/index.d.ts +8 -0
- package/dist/react/flow/api/react/components/Panel/index.d.ts +8 -0
- package/dist/react/flow/api/react/components/ReactFlowProvider/index.d.ts +20 -0
- package/dist/react/flow/api/react/components/SelectionListener/index.d.ts +6 -0
- package/dist/react/flow/api/react/components/StoreUpdater/index.d.ts +67 -0
- package/dist/react/flow/api/react/components/UserSelection/index.d.ts +1 -0
- package/dist/react/flow/api/react/components/ViewportPortal/index.d.ts +4 -0
- package/dist/react/flow/api/react/container/EdgeRenderer/MarkerDefinitions.d.ts +9 -0
- package/dist/react/flow/api/react/container/EdgeRenderer/MarkerSymbols.d.ts +8 -0
- package/dist/react/flow/api/react/container/EdgeRenderer/index.d.ts +12 -0
- package/dist/react/flow/api/react/container/FlowRenderer/index.d.ts +13 -0
- package/dist/react/flow/api/react/container/GraphView/index.d.ts +10 -0
- package/dist/react/flow/api/react/container/GraphView/useNodeOrEdgeTypesWarning.d.ts +3 -0
- package/dist/react/flow/api/react/container/GraphView/useStylesLoadedWarning.d.ts +1 -0
- package/dist/react/flow/api/react/container/NodeRenderer/index.d.ts +9 -0
- package/dist/react/flow/api/react/container/NodeRenderer/useResizeObserver.d.ts +1 -0
- package/dist/react/flow/api/react/container/Pane/index.d.ts +10 -0
- package/dist/react/flow/api/react/container/ReactFlow/Wrapper.d.ts +19 -0
- package/dist/react/flow/api/react/container/ReactFlow/index.d.ts +3 -0
- package/dist/react/flow/api/react/container/ReactFlow/init-values.d.ts +3 -0
- package/dist/react/flow/api/react/container/Viewport/index.d.ts +6 -0
- package/dist/react/flow/api/react/container/ZoomPane/index.d.ts +7 -0
- package/dist/react/flow/api/react/contexts/HandleConfigContext.d.ts +11 -0
- package/dist/react/flow/api/react/contexts/NodeIdContext.d.ts +5 -0
- package/dist/react/flow/api/react/contexts/StoreContext.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useColorModeClass.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useConnection.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useDrag.d.ts +12 -0
- package/dist/react/flow/api/react/hooks/useEdges.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useGlobalKeyHandler.d.ts +5 -0
- package/dist/react/flow/api/react/hooks/useHandleConnections.d.ts +10 -0
- package/dist/react/flow/api/react/hooks/useInternalNode.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useIsomorphicLayoutEffect.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useKeyPress.d.ts +7 -0
- package/dist/react/flow/api/react/hooks/useMoveSelectedNodes.d.ts +5 -0
- package/dist/react/flow/api/react/hooks/useNodeConnections.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useNodes.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useNodesData.d.ts +4 -0
- package/dist/react/flow/api/react/hooks/useNodesEdgesState.d.ts +12 -0
- package/dist/react/flow/api/react/hooks/useNodesInitialized.d.ts +4 -0
- package/dist/react/flow/api/react/hooks/useOnEdgesChangeMiddleware.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useOnInitHandler.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useOnNodesChangeMiddleware.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useOnSelectionChange.d.ts +5 -0
- package/dist/react/flow/api/react/hooks/useOnViewportChange.d.ts +7 -0
- package/dist/react/flow/api/react/hooks/useReactFlow.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useResizeHandler.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useStore.d.ts +8 -0
- package/dist/react/flow/api/react/hooks/useUpdateNodeInternals.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useViewport.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useViewportHelper.d.ts +3 -0
- package/dist/react/flow/api/react/hooks/useViewportSync.d.ts +2 -0
- package/dist/react/flow/api/react/hooks/useVisibleEdgeIds.d.ts +1 -0
- package/dist/react/flow/api/react/hooks/useVisibleNodeIds.d.ts +1 -0
- package/dist/react/flow/api/react/index.d.ts +41 -0
- package/dist/react/flow/api/react/store/index.d.ts +18 -0
- package/dist/react/flow/api/react/store/initialState.d.ts +18 -0
- package/dist/react/flow/api/react/styles/utils.d.ts +2 -0
- package/dist/react/flow/api/react/types/component-props.d.ts +127 -0
- package/dist/react/flow/api/react/types/edges.d.ts +111 -0
- package/dist/react/flow/api/react/types/general.d.ts +53 -0
- package/dist/react/flow/api/react/types/index.d.ts +6 -0
- package/dist/react/flow/api/react/types/instance.d.ts +64 -0
- package/dist/react/flow/api/react/types/nodes.d.ts +41 -0
- package/dist/react/flow/api/react/types/store.d.ts +114 -0
- package/dist/react/flow/api/react/utils/changes.d.ts +15 -0
- package/dist/react/flow/api/react/utils/edges.d.ts +3 -0
- package/dist/react/flow/api/react/utils/general.d.ts +5 -0
- package/dist/react/flow/api/react/utils/index.d.ts +3 -0
- package/dist/react/flow/api/system/constants.d.ts +43 -0
- package/dist/react/flow/api/system/index.d.ts +8 -0
- package/dist/react/flow/api/system/types/changes.d.ts +48 -0
- package/dist/react/flow/api/system/types/edges.d.ts +72 -0
- package/dist/react/flow/api/system/types/general.d.ts +175 -0
- package/dist/react/flow/api/system/types/handles.d.ts +21 -0
- package/dist/react/flow/api/system/types/index.d.ts +7 -0
- package/dist/react/flow/api/system/types/nodes.d.ts +89 -0
- package/dist/react/flow/api/system/types/panzoom.d.ts +58 -0
- package/dist/react/flow/api/system/types/utils.d.ts +46 -0
- package/dist/react/flow/api/system/utils/attribution.d.ts +1 -0
- package/dist/react/flow/api/system/utils/connections.d.ts +4 -0
- package/dist/react/flow/api/system/utils/dom.d.ts +20 -0
- package/dist/react/flow/api/system/utils/edge-toolbar.d.ts +1 -0
- package/dist/react/flow/api/system/utils/edges/bezier-edge.d.ts +40 -0
- package/dist/react/flow/api/system/utils/edges/general.d.ts +44 -0
- package/dist/react/flow/api/system/utils/edges/index.d.ts +5 -0
- package/dist/react/flow/api/system/utils/edges/positions.d.ts +16 -0
- package/dist/react/flow/api/system/utils/edges/smoothstep-edge.d.ts +21 -0
- package/dist/react/flow/api/system/utils/edges/straight-edge.d.ts +13 -0
- package/dist/react/flow/api/system/utils/general.d.ts +56 -0
- package/dist/react/flow/api/system/utils/graph.d.ts +45 -0
- package/dist/react/flow/api/system/utils/index.d.ts +12 -0
- package/dist/react/flow/api/system/utils/marker.d.ts +8 -0
- package/dist/react/flow/api/system/utils/node-toolbar.d.ts +2 -0
- package/dist/react/flow/api/system/utils/shallow-node-data.d.ts +4 -0
- package/dist/react/flow/api/system/utils/store.d.ts +33 -0
- package/dist/react/flow/api/system/utils/types.d.ts +7 -0
- package/dist/react/flow/api/system/xydrag/XYDrag.d.ts +56 -0
- package/dist/react/flow/api/system/xydrag/index.d.ts +1 -0
- package/dist/react/flow/api/system/xydrag/utils.d.ts +22 -0
- package/dist/react/flow/api/system/xyhandle/XYHandle.d.ts +2 -0
- package/dist/react/flow/api/system/xyhandle/index.d.ts +1 -0
- package/dist/react/flow/api/system/xyhandle/types.d.ts +49 -0
- package/dist/react/flow/api/system/xyhandle/utils.d.ts +9 -0
- package/dist/react/flow/api/system/xyminimap/index.d.ts +27 -0
- package/dist/react/flow/api/system/xypanzoom/XYPanZoom.d.ts +11 -0
- package/dist/react/flow/api/system/xypanzoom/eventhandler.d.ts +45 -0
- package/dist/react/flow/api/system/xypanzoom/filter.d.ts +15 -0
- package/dist/react/flow/api/system/xypanzoom/index.d.ts +1 -0
- package/dist/react/flow/api/system/xypanzoom/utils.d.ts +8 -0
- package/dist/react/flow/api/system/xyresizer/XYResizer.d.ts +51 -0
- package/dist/react/flow/api/system/xyresizer/index.d.ts +2 -0
- package/dist/react/flow/api/system/xyresizer/types.d.ts +26 -0
- package/dist/react/flow/api/system/xyresizer/utils.d.ts +41 -0
- package/dist/react/flow/components.d.ts +148 -0
- package/dist/react/flow/components.js +526 -0
- package/dist/react/flow/configuration.d.ts +6 -0
- package/dist/react/flow/configuration.js +27 -0
- package/dist/react/flow/drag.d.ts +14 -0
- package/dist/react/flow/drag.js +273 -0
- package/dist/react/flow/extras.d.ts +155 -0
- package/dist/react/flow/extras.js +317 -0
- package/dist/react/flow/handle.d.ts +21 -0
- package/dist/react/flow/handle.js +149 -0
- package/dist/react/flow/hooks.d.ts +47 -0
- package/dist/react/flow/hooks.js +131 -0
- package/dist/react/flow/index.d.ts +78 -0
- package/dist/react/flow/index.js +73 -0
- package/dist/react/flow/queries.d.ts +20 -0
- package/dist/react/flow/queries.js +30 -0
- package/dist/react/flow/react-flow.d.ts +73 -0
- package/dist/react/flow/react-flow.js +1445 -0
- package/dist/react/flow/resize.d.ts +30 -0
- package/dist/react/flow/resize.js +49 -0
- package/dist/react/flow/store.d.ts +412 -0
- package/dist/react/flow/store.js +713 -0
- package/dist/react/flow/style.css +630 -0
- package/dist/react/flow/style.css.d.ts +2 -0
- package/dist/react/flow/system.d.ts +146 -0
- package/dist/react/flow/system.js +300 -0
- package/dist/react/flow/types.d.ts +131 -0
- package/dist/react/flow/types.js +1 -0
- package/dist/react/flow/utils.d.ts +77 -0
- package/dist/react/flow/utils.js +285 -0
- package/dist/react/hooks.d.ts +14 -0
- package/dist/react/hooks.js +44 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.js +5 -0
- package/dist/render/backend.d.ts +26 -0
- package/dist/render/backend.js +5 -0
- package/dist/render/canvas2d/backend.d.ts +7 -0
- package/dist/render/canvas2d/backend.js +122 -0
- package/dist/render/canvas2d/index.d.ts +1 -0
- package/dist/render/canvas2d/index.js +2 -0
- package/dist/render/color.d.ts +9 -0
- package/dist/render/color.js +69 -0
- package/dist/render/commands.d.ts +69 -0
- package/dist/render/commands.js +1 -0
- package/dist/render/display-list.d.ts +65 -0
- package/dist/render/display-list.js +316 -0
- package/dist/render/images.d.ts +35 -0
- package/dist/render/images.js +83 -0
- package/dist/render/index.d.ts +14 -0
- package/dist/render/index.js +16 -0
- package/dist/render/painters.d.ts +35 -0
- package/dist/render/painters.js +109 -0
- package/dist/render/renderer.d.ts +70 -0
- package/dist/render/renderer.js +162 -0
- package/dist/render/scene-index.d.ts +21 -0
- package/dist/render/scene-index.js +64 -0
- package/dist/render/text.d.ts +8 -0
- package/dist/render/text.js +100 -0
- package/dist/render/theme.d.ts +21 -0
- package/dist/render/theme.js +33 -0
- package/dist/render/ui.d.ts +63 -0
- package/dist/render/ui.js +188 -0
- package/dist/render/webgl2/atlas.d.ts +36 -0
- package/dist/render/webgl2/atlas.js +93 -0
- package/dist/render/webgl2/backend.d.ts +19 -0
- package/dist/render/webgl2/backend.js +338 -0
- package/dist/render/webgl2/index.d.ts +2 -0
- package/dist/render/webgl2/index.js +3 -0
- package/dist/render/webgl2/shaders.d.ts +6 -0
- package/dist/render/webgl2/shaders.js +112 -0
- package/dist/render/webgpu/index.d.ts +1 -0
- package/dist/render/webgpu/index.js +3 -0
- package/dist/scene/builtins.d.ts +25 -0
- package/dist/scene/builtins.js +60 -0
- package/dist/scene/dirty.d.ts +11 -0
- package/dist/scene/dirty.js +10 -0
- package/dist/scene/index.d.ts +5 -0
- package/dist/scene/index.js +5 -0
- package/dist/scene/record.d.ts +40 -0
- package/dist/scene/record.js +12 -0
- package/dist/scene/scene-graph.d.ts +58 -0
- package/dist/scene/scene-graph.js +178 -0
- package/dist/scene/schema.d.ts +27 -0
- package/dist/scene/schema.js +32 -0
- package/dist/sdk/create-avis.d.ts +109 -0
- package/dist/sdk/create-avis.js +162 -0
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +2 -0
- package/dist/serialization/format.d.ts +46 -0
- package/dist/serialization/format.js +20 -0
- package/dist/serialization/index.d.ts +3 -0
- package/dist/serialization/index.js +3 -0
- package/dist/serialization/migrate.d.ts +7 -0
- package/dist/serialization/migrate.js +54 -0
- package/dist/serialization/serialize.d.ts +10 -0
- package/dist/serialization/serialize.js +114 -0
- package/dist/state/index.d.ts +2 -0
- package/dist/state/index.js +2 -0
- package/dist/state/selector.d.ts +6 -0
- package/dist/state/selector.js +29 -0
- package/dist/state/store.d.ts +91 -0
- package/dist/state/store.js +102 -0
- package/dist/style/computed.d.ts +84 -0
- package/dist/style/computed.js +296 -0
- package/dist/style/index.d.ts +6 -0
- package/dist/style/index.js +8 -0
- package/dist/style/style-engine.d.ts +33 -0
- package/dist/style/style-engine.js +113 -0
- package/dist/style/tokens.d.ts +49 -0
- package/dist/style/tokens.js +142 -0
- package/dist/style/utilities.d.ts +34 -0
- package/dist/style/utilities.js +341 -0
- package/dist/style/values.d.ts +30 -0
- package/dist/style/values.js +361 -0
- package/dist/style/variants.d.ts +38 -0
- package/dist/style/variants.js +55 -0
- package/dist/sync/index.d.ts +2 -0
- package/dist/sync/index.js +1 -0
- package/dist/sync/save-queue.d.ts +24 -0
- package/dist/sync/save-queue.js +88 -0
- package/dist/wasm/index.d.ts +2 -0
- package/dist/wasm/index.js +2 -0
- package/dist/wasm/load.d.ts +7 -0
- package/dist/wasm/load.js +47 -0
- package/dist/wasm/pkg/avis_engine_wasm.d.ts +84 -0
- package/dist/wasm/pkg/avis_engine_wasm.js +339 -0
- package/dist/wasm/pkg/avis_engine_wasm_bg.wasm +0 -0
- package/dist/wasm/reference.d.ts +38 -0
- package/dist/wasm/reference.js +174 -0
- package/package.json +76 -4
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Undo and redo, from the patches each transaction committed. Entries with
|
|
3
|
+
* the same merge key close together (a drag's moves) become one; a batch
|
|
4
|
+
* makes one entry of everything inside it.
|
|
5
|
+
*/
|
|
6
|
+
import { invertPatches } from "./patch.js";
|
|
7
|
+
export class History {
|
|
8
|
+
entries = [];
|
|
9
|
+
index = 0;
|
|
10
|
+
group = null;
|
|
11
|
+
depth = 0;
|
|
12
|
+
capacity;
|
|
13
|
+
mergeWindow;
|
|
14
|
+
now;
|
|
15
|
+
constructor(options = {}) {
|
|
16
|
+
this.capacity = options.capacity ?? 200;
|
|
17
|
+
this.mergeWindow = options.mergeWindow ?? 500;
|
|
18
|
+
this.now = options.now ?? (() => Date.now());
|
|
19
|
+
}
|
|
20
|
+
get canUndo() {
|
|
21
|
+
return this.index > 0;
|
|
22
|
+
}
|
|
23
|
+
get canRedo() {
|
|
24
|
+
return this.index < this.entries.length;
|
|
25
|
+
}
|
|
26
|
+
get size() {
|
|
27
|
+
return this.entries.length;
|
|
28
|
+
}
|
|
29
|
+
record(entry) {
|
|
30
|
+
if (!entry.patches.length)
|
|
31
|
+
return;
|
|
32
|
+
if (this.group) {
|
|
33
|
+
this.group.patches.push(...entry.patches);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// A new change drops what could be redone.
|
|
37
|
+
this.entries.length = this.index;
|
|
38
|
+
const last = this.entries[this.entries.length - 1];
|
|
39
|
+
if (last &&
|
|
40
|
+
entry.mergeKey &&
|
|
41
|
+
last.mergeKey === entry.mergeKey &&
|
|
42
|
+
entry.time - last.time <= this.mergeWindow) {
|
|
43
|
+
last.patches.push(...entry.patches);
|
|
44
|
+
last.time = entry.time;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.entries.push({ ...entry, patches: [...entry.patches] });
|
|
48
|
+
if (this.entries.length > this.capacity)
|
|
49
|
+
this.entries.shift();
|
|
50
|
+
this.index = this.entries.length;
|
|
51
|
+
}
|
|
52
|
+
/** Everything recorded inside becomes one entry. */
|
|
53
|
+
beginGroup(label) {
|
|
54
|
+
if (this.depth++ === 0)
|
|
55
|
+
this.group = { label, patches: [], time: this.now() };
|
|
56
|
+
}
|
|
57
|
+
endGroup() {
|
|
58
|
+
if (--this.depth > 0)
|
|
59
|
+
return;
|
|
60
|
+
const group = this.group;
|
|
61
|
+
this.group = null;
|
|
62
|
+
if (group?.patches.length)
|
|
63
|
+
this.record(group);
|
|
64
|
+
}
|
|
65
|
+
/** The patches that undo the last entry (and move back one), or null. */
|
|
66
|
+
undo() {
|
|
67
|
+
if (!this.canUndo)
|
|
68
|
+
return null;
|
|
69
|
+
return invertPatches(this.entries[--this.index].patches);
|
|
70
|
+
}
|
|
71
|
+
redo() {
|
|
72
|
+
if (!this.canRedo)
|
|
73
|
+
return null;
|
|
74
|
+
return [...this.entries[this.index++].patches];
|
|
75
|
+
}
|
|
76
|
+
clear() {
|
|
77
|
+
this.entries = [];
|
|
78
|
+
this.index = 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { NodeId } from "../core/ids.js";
|
|
2
|
+
import type { DocumentState, NodeRecord, RelationRecord } from "../scene/record.js";
|
|
3
|
+
export type Patch = {
|
|
4
|
+
collection: "nodes";
|
|
5
|
+
id: string;
|
|
6
|
+
before?: NodeRecord;
|
|
7
|
+
after?: NodeRecord;
|
|
8
|
+
} | {
|
|
9
|
+
collection: "relations";
|
|
10
|
+
id: string;
|
|
11
|
+
before?: RelationRecord;
|
|
12
|
+
after?: RelationRecord;
|
|
13
|
+
} | {
|
|
14
|
+
collection: "roots";
|
|
15
|
+
id: "roots";
|
|
16
|
+
before: readonly NodeId[];
|
|
17
|
+
after: readonly NodeId[];
|
|
18
|
+
};
|
|
19
|
+
/** The patches that undo `patches` (reversed, before and after swapped). */
|
|
20
|
+
export declare function invertPatches(patches: readonly Patch[]): Patch[];
|
|
21
|
+
/** A document with the patches applied, sharing what they didn't touch. */
|
|
22
|
+
export declare function applyPatches(document: DocumentState, patches: readonly Patch[]): DocumentState;
|
|
23
|
+
/** The node ids a set of patches touched. */
|
|
24
|
+
export declare function touchedNodeIds(patches: readonly Patch[]): Set<string>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** The patches that undo `patches` (reversed, before and after swapped). */
|
|
2
|
+
export function invertPatches(patches) {
|
|
3
|
+
return [...patches]
|
|
4
|
+
.reverse()
|
|
5
|
+
.map((patch) => ({ ...patch, before: patch.after, after: patch.before }));
|
|
6
|
+
}
|
|
7
|
+
/** A document with the patches applied, sharing what they didn't touch. */
|
|
8
|
+
export function applyPatches(document, patches) {
|
|
9
|
+
let nodes = null;
|
|
10
|
+
let relations = null;
|
|
11
|
+
let rootIds = document.rootIds;
|
|
12
|
+
for (const patch of patches) {
|
|
13
|
+
if (patch.collection === "roots") {
|
|
14
|
+
rootIds = patch.after;
|
|
15
|
+
}
|
|
16
|
+
else if (patch.collection === "nodes") {
|
|
17
|
+
nodes ??= { ...document.nodes };
|
|
18
|
+
if (patch.after)
|
|
19
|
+
nodes[patch.id] = patch.after;
|
|
20
|
+
else
|
|
21
|
+
delete nodes[patch.id];
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
relations ??= { ...document.relations };
|
|
25
|
+
if (patch.after)
|
|
26
|
+
relations[patch.id] = patch.after;
|
|
27
|
+
else
|
|
28
|
+
delete relations[patch.id];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
nodes: nodes ?? document.nodes,
|
|
33
|
+
relations: relations ?? document.relations,
|
|
34
|
+
rootIds,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** The node ids a set of patches touched. */
|
|
38
|
+
export function touchedNodeIds(patches) {
|
|
39
|
+
const ids = new Set();
|
|
40
|
+
for (const patch of patches)
|
|
41
|
+
if (patch.collection === "nodes")
|
|
42
|
+
ids.add(patch.id);
|
|
43
|
+
return ids;
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Diagnostic } from "../core/diagnostics.js";
|
|
2
|
+
import type { CommandContext, CommandRegistry } from "./command.js";
|
|
3
|
+
import type { DocumentDraft } from "./draft.js";
|
|
4
|
+
export declare class TransactionAbort extends Error {
|
|
5
|
+
readonly diagnostics: Diagnostic[];
|
|
6
|
+
constructor(diagnostics: Diagnostic[]);
|
|
7
|
+
}
|
|
8
|
+
export declare class Transaction {
|
|
9
|
+
readonly warnings: Diagnostic[];
|
|
10
|
+
readonly draft: DocumentDraft;
|
|
11
|
+
private readonly commands;
|
|
12
|
+
private readonly context;
|
|
13
|
+
constructor(draft: DocumentDraft, commands: CommandRegistry, context: CommandContext);
|
|
14
|
+
/** Runs a command in this transaction; an error aborts the transaction. */
|
|
15
|
+
run<R = unknown>(id: string, params?: unknown): R;
|
|
16
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A transaction: commands run against a draft; the first error-level
|
|
3
|
+
* diagnostic (or exception) throws it all away. Nothing reaches the store
|
|
4
|
+
* until the whole transaction succeeds.
|
|
5
|
+
*/
|
|
6
|
+
import { error, hasErrors } from "../core/diagnostics.js";
|
|
7
|
+
export class TransactionAbort extends Error {
|
|
8
|
+
diagnostics;
|
|
9
|
+
constructor(diagnostics) {
|
|
10
|
+
super(diagnostics.map((diagnostic) => diagnostic.message).join("; "));
|
|
11
|
+
this.name = "TransactionAbort";
|
|
12
|
+
this.diagnostics = diagnostics;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class Transaction {
|
|
16
|
+
warnings = [];
|
|
17
|
+
draft;
|
|
18
|
+
commands;
|
|
19
|
+
context;
|
|
20
|
+
constructor(draft, commands, context) {
|
|
21
|
+
this.draft = draft;
|
|
22
|
+
this.commands = commands;
|
|
23
|
+
this.context = context;
|
|
24
|
+
}
|
|
25
|
+
/** Runs a command in this transaction; an error aborts the transaction. */
|
|
26
|
+
run(id, params) {
|
|
27
|
+
const command = this.commands.get(id);
|
|
28
|
+
if (!command) {
|
|
29
|
+
throw new TransactionAbort([
|
|
30
|
+
error("command.unknown", `Unknown command "${id}"`, { source: id }),
|
|
31
|
+
]);
|
|
32
|
+
}
|
|
33
|
+
const diagnostics = (command.validate?.(params, this.draft, this.context) ?? []).map((diagnostic) => ({ source: id, ...diagnostic }));
|
|
34
|
+
if (hasErrors(diagnostics))
|
|
35
|
+
throw new TransactionAbort(diagnostics);
|
|
36
|
+
this.warnings.push(...diagnostics);
|
|
37
|
+
return command.run(params, this.draft, this.context);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type DiagnosticLevel = "error" | "warning" | "info";
|
|
2
|
+
export type Diagnostic = {
|
|
3
|
+
code: string;
|
|
4
|
+
level: DiagnosticLevel;
|
|
5
|
+
message: string;
|
|
6
|
+
/** Where it came from: a command id, a plugin, a file. */
|
|
7
|
+
source?: string;
|
|
8
|
+
data?: unknown;
|
|
9
|
+
};
|
|
10
|
+
export declare const error: (code: string, message: string, extra?: Omit<Diagnostic, "code" | "level" | "message">) => Diagnostic;
|
|
11
|
+
export declare const warning: (code: string, message: string, extra?: Omit<Diagnostic, "code" | "level" | "message">) => Diagnostic;
|
|
12
|
+
export declare const hasErrors: (diagnostics: readonly Diagnostic[]) => boolean;
|
|
13
|
+
/** Collected diagnostics, with listeners. */
|
|
14
|
+
export declare class DiagnosticsSink {
|
|
15
|
+
private items;
|
|
16
|
+
private listeners;
|
|
17
|
+
report(diagnostic: Diagnostic): void;
|
|
18
|
+
get all(): readonly Diagnostic[];
|
|
19
|
+
clear(): void;
|
|
20
|
+
subscribe(listener: (diagnostic: Diagnostic) => void): {
|
|
21
|
+
dispose: () => undefined;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const error = (code, message, extra = {}) => ({ code, level: "error", message, ...extra });
|
|
2
|
+
export const warning = (code, message, extra = {}) => ({ code, level: "warning", message, ...extra });
|
|
3
|
+
export const hasErrors = (diagnostics) => diagnostics.some((diagnostic) => diagnostic.level === "error");
|
|
4
|
+
/** Collected diagnostics, with listeners. */
|
|
5
|
+
export class DiagnosticsSink {
|
|
6
|
+
items = [];
|
|
7
|
+
listeners = new Set();
|
|
8
|
+
report(diagnostic) {
|
|
9
|
+
this.items.push(diagnostic);
|
|
10
|
+
for (const listener of this.listeners)
|
|
11
|
+
listener(diagnostic);
|
|
12
|
+
}
|
|
13
|
+
get all() {
|
|
14
|
+
return this.items;
|
|
15
|
+
}
|
|
16
|
+
clear() {
|
|
17
|
+
this.items = [];
|
|
18
|
+
}
|
|
19
|
+
subscribe(listener) {
|
|
20
|
+
this.listeners.add(listener);
|
|
21
|
+
return { dispose: () => void this.listeners.delete(listener) };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Something that releases what it holds; safe to call more than once. */
|
|
2
|
+
export type Disposable = {
|
|
3
|
+
dispose(): void;
|
|
4
|
+
};
|
|
5
|
+
export type Cleanup = Disposable | (() => void) | void | undefined;
|
|
6
|
+
export declare function toDisposable(cleanup: Cleanup): Disposable;
|
|
7
|
+
/** Disposables released last in, first out, once. */
|
|
8
|
+
export declare class DisposableStack implements Disposable {
|
|
9
|
+
private items;
|
|
10
|
+
private done;
|
|
11
|
+
get disposed(): boolean;
|
|
12
|
+
use<T extends Cleanup>(cleanup: T): T;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export function toDisposable(cleanup) {
|
|
2
|
+
if (!cleanup)
|
|
3
|
+
return { dispose() { } };
|
|
4
|
+
if (typeof cleanup === "function") {
|
|
5
|
+
let done = false;
|
|
6
|
+
return {
|
|
7
|
+
dispose() {
|
|
8
|
+
if (done)
|
|
9
|
+
return;
|
|
10
|
+
done = true;
|
|
11
|
+
cleanup();
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return cleanup;
|
|
16
|
+
}
|
|
17
|
+
/** Disposables released last in, first out, once. */
|
|
18
|
+
export class DisposableStack {
|
|
19
|
+
items = [];
|
|
20
|
+
done = false;
|
|
21
|
+
get disposed() {
|
|
22
|
+
return this.done;
|
|
23
|
+
}
|
|
24
|
+
use(cleanup) {
|
|
25
|
+
if (this.done) {
|
|
26
|
+
toDisposable(cleanup).dispose();
|
|
27
|
+
return cleanup;
|
|
28
|
+
}
|
|
29
|
+
this.items.push(toDisposable(cleanup));
|
|
30
|
+
return cleanup;
|
|
31
|
+
}
|
|
32
|
+
dispose() {
|
|
33
|
+
if (this.done)
|
|
34
|
+
return;
|
|
35
|
+
this.done = true;
|
|
36
|
+
const errors = [];
|
|
37
|
+
for (const item of this.items.reverse()) {
|
|
38
|
+
try {
|
|
39
|
+
item.dispose();
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
errors.push(error);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
this.items = [];
|
|
46
|
+
if (errors.length === 1)
|
|
47
|
+
throw errors[0];
|
|
48
|
+
if (errors.length)
|
|
49
|
+
throw new AggregateError(errors, "dispose failed");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Transaction, type Command, type CreateNodeParams, type HistoryOptions, type Patch } from "../commands/index.js";
|
|
2
|
+
import { type Camera, type ScreenPoint, type WorldPoint } from "../geometry/spaces.js";
|
|
3
|
+
import { SceneGraph } from "../scene/scene-graph.js";
|
|
4
|
+
import { SchemaRegistry, type NodeType } from "../scene/schema.js";
|
|
5
|
+
import { type AvisDocumentJSON } from "../serialization/index.js";
|
|
6
|
+
import { type Store, type ViewportState } from "../state/store.js";
|
|
7
|
+
import { DiagnosticsSink, type Diagnostic } from "./diagnostics.js";
|
|
8
|
+
import { type Disposable } from "./disposable.js";
|
|
9
|
+
import { EventBus } from "./event-bus.js";
|
|
10
|
+
import { type IdFactory, type NodeId } from "./ids.js";
|
|
11
|
+
import { type Plugin } from "./plugin.js";
|
|
12
|
+
import { ServiceRegistry } from "./services.js";
|
|
13
|
+
export type EngineEvents = {
|
|
14
|
+
"document:change": {
|
|
15
|
+
patches: Patch[];
|
|
16
|
+
origin: string;
|
|
17
|
+
label: string;
|
|
18
|
+
};
|
|
19
|
+
"history:change": {
|
|
20
|
+
canUndo: boolean;
|
|
21
|
+
canRedo: boolean;
|
|
22
|
+
};
|
|
23
|
+
diagnostic: Diagnostic;
|
|
24
|
+
dispose: undefined;
|
|
25
|
+
};
|
|
26
|
+
export type TransactOptions = {
|
|
27
|
+
mergeKey?: string;
|
|
28
|
+
/** Who made the change: "user", "undo", "redo", "load", a plugin… */
|
|
29
|
+
origin?: string;
|
|
30
|
+
/** Kept in the history (false for loads and remote changes). */
|
|
31
|
+
record?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type TransactResult<T> = {
|
|
34
|
+
ok: true;
|
|
35
|
+
value: T;
|
|
36
|
+
patches: Patch[];
|
|
37
|
+
warnings: Diagnostic[];
|
|
38
|
+
} | {
|
|
39
|
+
ok: false;
|
|
40
|
+
diagnostics: Diagnostic[];
|
|
41
|
+
};
|
|
42
|
+
export type EngineOptions = {
|
|
43
|
+
schemas?: readonly NodeType[];
|
|
44
|
+
plugins?: Plugin<Engine>[];
|
|
45
|
+
ids?: IdFactory;
|
|
46
|
+
history?: HistoryOptions;
|
|
47
|
+
};
|
|
48
|
+
/** The engine's public API (vanilla TypeScript; adapters build on it). */
|
|
49
|
+
export interface Engine {
|
|
50
|
+
readonly store: Store;
|
|
51
|
+
readonly scene: SceneGraph;
|
|
52
|
+
readonly schemas: SchemaRegistry;
|
|
53
|
+
readonly services: ServiceRegistry;
|
|
54
|
+
readonly diagnostics: DiagnosticsSink;
|
|
55
|
+
readonly bus: EventBus<EngineEvents>;
|
|
56
|
+
transact<T>(label: string, run: (tx: Transaction) => T, options?: TransactOptions): TransactResult<T>;
|
|
57
|
+
batch<T>(label: string, run: () => T): T;
|
|
58
|
+
readonly commands: {
|
|
59
|
+
execute<R = unknown>(id: string, params?: unknown, options?: TransactOptions): TransactResult<R>;
|
|
60
|
+
register<P, R>(command: Command<P, R>): Disposable;
|
|
61
|
+
has(id: string): boolean;
|
|
62
|
+
readonly ids: string[];
|
|
63
|
+
};
|
|
64
|
+
readonly history: {
|
|
65
|
+
undo(): boolean;
|
|
66
|
+
redo(): boolean;
|
|
67
|
+
readonly canUndo: boolean;
|
|
68
|
+
readonly canRedo: boolean;
|
|
69
|
+
readonly size: number;
|
|
70
|
+
clear(): void;
|
|
71
|
+
};
|
|
72
|
+
createNode(params: CreateNodeParams): NodeId;
|
|
73
|
+
readonly selection: {
|
|
74
|
+
get(): readonly NodeId[];
|
|
75
|
+
select(ids: readonly NodeId[]): void;
|
|
76
|
+
clear(): void;
|
|
77
|
+
};
|
|
78
|
+
readonly viewport: {
|
|
79
|
+
get(): ViewportState;
|
|
80
|
+
setCamera(camera: Partial<Camera>): void;
|
|
81
|
+
/** Zooms (clamped) keeping a screen point over the same world point. */
|
|
82
|
+
zoomAt(screen: ScreenPoint, zoom: number): void;
|
|
83
|
+
zoomTo(zoom: number): void;
|
|
84
|
+
panBy(dx: number, dy: number): void;
|
|
85
|
+
/** Frames nodes (all by default) with a padding share of the view. */
|
|
86
|
+
fitView(options?: {
|
|
87
|
+
ids?: readonly string[];
|
|
88
|
+
padding?: number;
|
|
89
|
+
maxZoom?: number;
|
|
90
|
+
}): boolean;
|
|
91
|
+
toWorld(screen: ScreenPoint): WorldPoint;
|
|
92
|
+
toScreen(world: WorldPoint): ScreenPoint;
|
|
93
|
+
};
|
|
94
|
+
serialize(meta?: Record<string, unknown>): AvisDocumentJSON;
|
|
95
|
+
toJSON(meta?: Record<string, unknown>): string;
|
|
96
|
+
load(input: string | Record<string, unknown>): {
|
|
97
|
+
ok: boolean;
|
|
98
|
+
diagnostics: Diagnostic[];
|
|
99
|
+
};
|
|
100
|
+
use(...plugins: Plugin<Engine>[]): Engine;
|
|
101
|
+
readonly plugins: readonly string[];
|
|
102
|
+
readonly disposed: boolean;
|
|
103
|
+
dispose(): void;
|
|
104
|
+
}
|
|
105
|
+
export declare class EngineDisposed extends Error {
|
|
106
|
+
constructor();
|
|
107
|
+
}
|
|
108
|
+
export declare function createEngine(options?: EngineOptions): Engine;
|