@visuallyjs/browser-ui 1.0.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.
Files changed (427) hide show
  1. package/css/visuallyjs-theme.css +148 -0
  2. package/css/visuallyjs.css +1879 -0
  3. package/js/visuallyjs.browser-ui.cjs.js +143 -0
  4. package/js/visuallyjs.browser-ui.esm.js +143 -0
  5. package/package.json +16 -0
  6. package/types/browser-ui/base-dom-ui-layout-adapter.d.ts +14 -0
  7. package/types/browser-ui/browser-ui.d.ts +95 -0
  8. package/types/browser-ui/browser-util.d.ts +233 -0
  9. package/types/browser-ui/browser-visuallyjs-instance.d.ts +881 -0
  10. package/types/browser-ui/canvas-layout-adapter.d.ts +15 -0
  11. package/types/browser-ui/collicat.d.ts +245 -0
  12. package/types/browser-ui/components/controls/controls-component.d.ts +137 -0
  13. package/types/browser-ui/components/controls/copy-paste-controls-component.d.ts +9 -0
  14. package/types/browser-ui/components/controls/css-classes.d.ts +79 -0
  15. package/types/browser-ui/components/controls/index.d.ts +4 -0
  16. package/types/browser-ui/components/controls/svg-export-component.d.ts +60 -0
  17. package/types/browser-ui/components/edge-type-picker/edge-type-picker.d.ts +37 -0
  18. package/types/browser-ui/components/edge-type-picker/index.d.ts +1 -0
  19. package/types/browser-ui/components/index.d.ts +4 -0
  20. package/types/browser-ui/components/inspector/color-picker-tag.d.ts +32 -0
  21. package/types/browser-ui/components/inspector/definitions.d.ts +114 -0
  22. package/types/browser-ui/components/inspector/edge-type-tag.d.ts +15 -0
  23. package/types/browser-ui/components/inspector/index.d.ts +6 -0
  24. package/types/browser-ui/components/inspector/inspector.d.ts +138 -0
  25. package/types/browser-ui/components/inspector/shape-type-inspector.d.ts +43 -0
  26. package/types/browser-ui/components/inspector/vanilla-inspector.d.ts +39 -0
  27. package/types/browser-ui/components/palette/index.d.ts +2 -0
  28. package/types/browser-ui/components/palette/palette-content-generator.d.ts +14 -0
  29. package/types/browser-ui/components/palette/palette-options.d.ts +159 -0
  30. package/types/browser-ui/components/palette/palette.d.ts +126 -0
  31. package/types/browser-ui/connector-editor.d.ts +65 -0
  32. package/types/browser-ui/connector-editors/anchors.d.ts +31 -0
  33. package/types/browser-ui/connector-editors/css-constants.d.ts +33 -0
  34. package/types/browser-ui/connector-editors/definitions.d.ts +74 -0
  35. package/types/browser-ui/connector-editors/editor-base.d.ts +177 -0
  36. package/types/browser-ui/connector-editors/index.d.ts +52 -0
  37. package/types/browser-ui/connector-editors/util.d.ts +33 -0
  38. package/types/browser-ui/connector-editors-bezier/bezier-editor.d.ts +82 -0
  39. package/types/browser-ui/connector-editors-bezier/css-constants.d.ts +42 -0
  40. package/types/browser-ui/connector-editors-bezier/index.d.ts +9 -0
  41. package/types/browser-ui/connector-editors-orthogonal/css-constants.d.ts +28 -0
  42. package/types/browser-ui/connector-editors-orthogonal/index.d.ts +9 -0
  43. package/types/browser-ui/connector-editors-orthogonal/orthogonal-editor.d.ts +86 -0
  44. package/types/browser-ui/connector-editors-straight/auto-split-mode.d.ts +24 -0
  45. package/types/browser-ui/connector-editors-straight/click-split-mode.d.ts +20 -0
  46. package/types/browser-ui/connector-editors-straight/css-constants.d.ts +30 -0
  47. package/types/browser-ui/connector-editors-straight/definitions.d.ts +69 -0
  48. package/types/browser-ui/connector-editors-straight/index.d.ts +11 -0
  49. package/types/browser-ui/connector-editors-straight/straight-editor.d.ts +42 -0
  50. package/types/browser-ui/constants.d.ts +79 -0
  51. package/types/browser-ui/copy-paste/clipboard.d.ts +34 -0
  52. package/types/browser-ui/copy-paste/index.d.ts +2 -0
  53. package/types/browser-ui/copy-paste/transformer.d.ts +14 -0
  54. package/types/browser-ui/css-constants.d.ts +436 -0
  55. package/types/browser-ui/d.d.ts +2 -0
  56. package/types/browser-ui/definitions.d.ts +442 -0
  57. package/types/browser-ui/dialogs/binder.d.ts +49 -0
  58. package/types/browser-ui/dialogs/constants.d.ts +51 -0
  59. package/types/browser-ui/dialogs/dialogs.d.ts +30 -0
  60. package/types/browser-ui/dialogs/index.d.ts +3 -0
  61. package/types/browser-ui/drag-manager-2.d.ts +54 -0
  62. package/types/browser-ui/edge-handler-base.d.ts +168 -0
  63. package/types/browser-ui/edge-input-handler.d.ts +116 -0
  64. package/types/browser-ui/edge-mappings/flowchart-basic.d.ts +22 -0
  65. package/types/browser-ui/edge-mappings/index.d.ts +1 -0
  66. package/types/browser-ui/edge-relocate-handler.d.ts +51 -0
  67. package/types/browser-ui/element-drag-handler-2.d.ts +254 -0
  68. package/types/browser-ui/element-dragger.d.ts +45 -0
  69. package/types/browser-ui/element-facade.d.ts +11 -0
  70. package/types/browser-ui/event-manager.d.ts +50 -0
  71. package/types/browser-ui/fixed-layer.d.ts +107 -0
  72. package/types/browser-ui/group-layout-adapter.d.ts +19 -0
  73. package/types/browser-ui/html-element-overlay.d.ts +32 -0
  74. package/types/browser-ui/icons/definitions.d.ts +59 -0
  75. package/types/browser-ui/icons/icon-renderer.d.ts +43 -0
  76. package/types/browser-ui/icons/index.d.ts +2 -0
  77. package/types/browser-ui/index.d.ts +48 -0
  78. package/types/browser-ui/pan-zoom-options.d.ts +262 -0
  79. package/types/browser-ui/pan-zoom.d.ts +674 -0
  80. package/types/browser-ui/paper-renderer/definitions.d.ts +83 -0
  81. package/types/browser-ui/paper-renderer/index.d.ts +2 -0
  82. package/types/browser-ui/paper-renderer/paper.d.ts +50 -0
  83. package/types/browser-ui/pinch-listener.d.ts +33 -0
  84. package/types/browser-ui/plugins/background/available-backgrounds.d.ts +12 -0
  85. package/types/browser-ui/plugins/background/background-options.d.ts +62 -0
  86. package/types/browser-ui/plugins/background/background-plugin.d.ts +62 -0
  87. package/types/browser-ui/plugins/background/generated-grid-background.d.ts +230 -0
  88. package/types/browser-ui/plugins/background/index.d.ts +6 -0
  89. package/types/browser-ui/plugins/background/simple-background.d.ts +33 -0
  90. package/types/browser-ui/plugins/background/tiled-background.d.ts +118 -0
  91. package/types/browser-ui/plugins/browser-ui-plugin.d.ts +90 -0
  92. package/types/browser-ui/plugins/edge-routing/index.d.ts +66 -0
  93. package/types/browser-ui/plugins/index.d.ts +5 -0
  94. package/types/browser-ui/plugins/selected-edge-highlight/index.d.ts +1 -0
  95. package/types/browser-ui/plugins/selected-edge-highlight/selected-edge-highlight-plugin.d.ts +36 -0
  96. package/types/browser-ui/plugins/ui-states/index.d.ts +2 -0
  97. package/types/browser-ui/plugins/ui-states/ui-state.d.ts +14 -0
  98. package/types/browser-ui/plugins/ui-states/ui-states-plugin.d.ts +69 -0
  99. package/types/browser-ui/positioning-and-sizing-utils.d.ts +103 -0
  100. package/types/browser-ui/shape-library/index.d.ts +4 -0
  101. package/types/browser-ui/shape-library/shape-library-definitions.d.ts +243 -0
  102. package/types/browser-ui/shape-library/shape-library.d.ts +266 -0
  103. package/types/browser-ui/shape-library/shapes-basic.d.ts +7 -0
  104. package/types/browser-ui/shape-library/shapes-flowchart.d.ts +7 -0
  105. package/types/browser-ui/storage.d.ts +8 -0
  106. package/types/browser-ui/surface-renderer/anim/anim.d.ts +64 -0
  107. package/types/browser-ui/surface-renderer/anim/constants.d.ts +74 -0
  108. package/types/browser-ui/surface-renderer/anim/definitions.d.ts +134 -0
  109. package/types/browser-ui/surface-renderer/anim/index.d.ts +4 -0
  110. package/types/browser-ui/surface-renderer/anim/path-transport.d.ts +23 -0
  111. package/types/browser-ui/surface-renderer/css-classes.d.ts +64 -0
  112. package/types/browser-ui/surface-renderer/decorators.d.ts +162 -0
  113. package/types/browser-ui/surface-renderer/definitions.d.ts +83 -0
  114. package/types/browser-ui/surface-renderer/diagrams/constants.d.ts +28 -0
  115. package/types/browser-ui/surface-renderer/diagrams/definitions.d.ts +528 -0
  116. package/types/browser-ui/surface-renderer/diagrams/diagram-cell.d.ts +123 -0
  117. package/types/browser-ui/surface-renderer/diagrams/diagram-link.d.ts +116 -0
  118. package/types/browser-ui/surface-renderer/diagrams/diagram-palette.d.ts +11 -0
  119. package/types/browser-ui/surface-renderer/diagrams/diagram-tools.d.ts +112 -0
  120. package/types/browser-ui/surface-renderer/diagrams/diagram.d.ts +221 -0
  121. package/types/browser-ui/surface-renderer/diagrams/index.d.ts +25 -0
  122. package/types/browser-ui/surface-renderer/diagrams/mediator.d.ts +59 -0
  123. package/types/browser-ui/surface-renderer/diagrams/util.d.ts +15 -0
  124. package/types/browser-ui/surface-renderer/elastic-group-manager.d.ts +102 -0
  125. package/types/browser-ui/surface-renderer/index.d.ts +34 -0
  126. package/types/browser-ui/surface-renderer/params.d.ts +175 -0
  127. package/types/browser-ui/surface-renderer/plugins/controls/controls-plugin.d.ts +26 -0
  128. package/types/browser-ui/surface-renderer/plugins/controls/index.d.ts +1 -0
  129. package/types/browser-ui/surface-renderer/plugins/drag-groups/drag-groups-plugin.d.ts +78 -0
  130. package/types/browser-ui/surface-renderer/plugins/drag-groups/index.d.ts +1 -0
  131. package/types/browser-ui/surface-renderer/plugins/export-controls/export-controls-plugin.d.ts +25 -0
  132. package/types/browser-ui/surface-renderer/plugins/export-controls/index.d.ts +1 -0
  133. package/types/browser-ui/surface-renderer/plugins/index.d.ts +10 -0
  134. package/types/browser-ui/surface-renderer/plugins/lasso/index.d.ts +2 -0
  135. package/types/browser-ui/surface-renderer/plugins/lasso/lasso-plugin.d.ts +78 -0
  136. package/types/browser-ui/surface-renderer/plugins/lasso/lasso.d.ts +74 -0
  137. package/types/browser-ui/surface-renderer/plugins/miniview/index.d.ts +1 -0
  138. package/types/browser-ui/surface-renderer/plugins/miniview/miniview-plugin.d.ts +235 -0
  139. package/types/browser-ui/surface-renderer/plugins/palette/index.d.ts +1 -0
  140. package/types/browser-ui/surface-renderer/plugins/palette/palette-plugin.d.ts +17 -0
  141. package/types/browser-ui/surface-renderer/plugins/pan-buttons/index.d.ts +1 -0
  142. package/types/browser-ui/surface-renderer/plugins/pan-buttons/pan-buttons-plugin.d.ts +55 -0
  143. package/types/browser-ui/surface-renderer/plugins/resizing-tools/border-drag-handlers.d.ts +3 -0
  144. package/types/browser-ui/surface-renderer/plugins/resizing-tools/definitions.d.ts +411 -0
  145. package/types/browser-ui/surface-renderer/plugins/resizing-tools/drag-handlers.d.ts +3 -0
  146. package/types/browser-ui/surface-renderer/plugins/resizing-tools/handle-gen.d.ts +15 -0
  147. package/types/browser-ui/surface-renderer/plugins/resizing-tools/index.d.ts +4 -0
  148. package/types/browser-ui/surface-renderer/plugins/resizing-tools/resizing-tools-plugin.d.ts +185 -0
  149. package/types/browser-ui/surface-renderer/plugins/resizing-tools/util.d.ts +16 -0
  150. package/types/browser-ui/surface-renderer/plugins/snaplines/index.d.ts +1 -0
  151. package/types/browser-ui/surface-renderer/plugins/snaplines/snaplines-plugin.d.ts +128 -0
  152. package/types/browser-ui/surface-renderer/plugins/vertex-drawing/definitions.d.ts +90 -0
  153. package/types/browser-ui/surface-renderer/plugins/vertex-drawing/index.d.ts +2 -0
  154. package/types/browser-ui/surface-renderer/plugins/vertex-drawing/vertex-drawing-plugin.d.ts +64 -0
  155. package/types/browser-ui/surface-renderer/shape-palette-options.d.ts +127 -0
  156. package/types/browser-ui/surface-renderer/shape-palette.d.ts +55 -0
  157. package/types/browser-ui/surface-renderer/surface-decorator.d.ts +35 -0
  158. package/types/browser-ui/surface-renderer/surface-events.d.ts +9 -0
  159. package/types/browser-ui/surface-renderer/surface-render-options.d.ts +125 -0
  160. package/types/browser-ui/surface-renderer/surface.d.ts +665 -0
  161. package/types/browser-ui/svg-component.d.ts +6 -0
  162. package/types/browser-ui/svg-element-connector.d.ts +16 -0
  163. package/types/browser-ui/svg-element-overlay.d.ts +55 -0
  164. package/types/browser-ui/svg-export/definitions.d.ts +153 -0
  165. package/types/browser-ui/svg-export/image-export-ui.d.ts +20 -0
  166. package/types/browser-ui/svg-export/image-exporter.d.ts +15 -0
  167. package/types/browser-ui/svg-export/index.d.ts +6 -0
  168. package/types/browser-ui/svg-export/svg-export-ui.d.ts +11 -0
  169. package/types/browser-ui/svg-export/svg-exporter.d.ts +8 -0
  170. package/types/browser-ui/svg-export/util.d.ts +23 -0
  171. package/types/browser-ui/svg-util.d.ts +27 -0
  172. package/types/browser-ui/templating/browser-ui-recado.d.ts +48 -0
  173. package/types/browser-ui/templating/custom-tag-definition.d.ts +32 -0
  174. package/types/browser-ui/templating/index.d.ts +11 -0
  175. package/types/browser-ui/templating/recado-template-renderer.d.ts +69 -0
  176. package/types/browser-ui/ui-path.d.ts +57 -0
  177. package/types/browser-ui/util.d.ts +4 -0
  178. package/types/browser-ui/wheel-listener.d.ts +2 -0
  179. package/types/charts/area/area-chart.d.ts +85 -0
  180. package/types/charts/area/index.d.ts +1 -0
  181. package/types/charts/bar-and-column/bar-chart.d.ts +34 -0
  182. package/types/charts/bar-and-column/bar-plot.d.ts +90 -0
  183. package/types/charts/bar-and-column/column-chart.d.ts +35 -0
  184. package/types/charts/bar-and-column/index.d.ts +3 -0
  185. package/types/charts/base-chart.d.ts +395 -0
  186. package/types/charts/base-xy-chart.d.ts +224 -0
  187. package/types/charts/bubble/bubble-chart.d.ts +30 -0
  188. package/types/charts/bubble/definitions.d.ts +32 -0
  189. package/types/charts/bubble/index.d.ts +2 -0
  190. package/types/charts/category-value-chart.d.ts +146 -0
  191. package/types/charts/chart-exporter.d.ts +38 -0
  192. package/types/charts/chart-zoom-controls.d.ts +23 -0
  193. package/types/charts/constants.d.ts +16 -0
  194. package/types/charts/css-classes.d.ts +312 -0
  195. package/types/charts/datasource.d.ts +61 -0
  196. package/types/charts/definitions.d.ts +261 -0
  197. package/types/charts/domain_scale_utilities.d.ts +72 -0
  198. package/types/charts/dual-value-chart.d.ts +60 -0
  199. package/types/charts/gauge/definitions.d.ts +108 -0
  200. package/types/charts/gauge/gauge-chart.d.ts +91 -0
  201. package/types/charts/gauge/index.d.ts +2 -0
  202. package/types/charts/index.d.ts +25 -0
  203. package/types/charts/legend.d.ts +120 -0
  204. package/types/charts/line/index.d.ts +1 -0
  205. package/types/charts/line/line-chart.d.ts +79 -0
  206. package/types/charts/markers.d.ts +13 -0
  207. package/types/charts/pie/index.d.ts +1 -0
  208. package/types/charts/pie/pie-chart.d.ts +146 -0
  209. package/types/charts/plot.d.ts +75 -0
  210. package/types/charts/sankey/index.d.ts +1 -0
  211. package/types/charts/sankey/preprocessor.d.ts +37 -0
  212. package/types/charts/sankey/sankey.d.ts +208 -0
  213. package/types/charts/scatter/definitions.d.ts +6 -0
  214. package/types/charts/scatter/index.d.ts +2 -0
  215. package/types/charts/scatter/scatter-chart.d.ts +16 -0
  216. package/types/charts/series/array-based-series.d.ts +95 -0
  217. package/types/charts/series/collation-series.d.ts +24 -0
  218. package/types/charts/series/definitions.d.ts +52 -0
  219. package/types/charts/series/dual-value-chart-series.d.ts +26 -0
  220. package/types/charts/series/index.d.ts +7 -0
  221. package/types/charts/series/record-based-series.d.ts +58 -0
  222. package/types/charts/series/series.d.ts +66 -0
  223. package/types/charts/series/summing-collation-series.d.ts +31 -0
  224. package/types/charts/series/summing-series.d.ts +19 -0
  225. package/types/charts/series-based-chart.d.ts +59 -0
  226. package/types/charts/tooltip.d.ts +167 -0
  227. package/types/charts/util.d.ts +149 -0
  228. package/types/core/astar/astar-path-finder.d.ts +37 -0
  229. package/types/core/astar/astar-util.d.ts +100 -0
  230. package/types/core/astar/candidate-finder.d.ts +16 -0
  231. package/types/core/astar/candidate-sorter.d.ts +10 -0
  232. package/types/core/astar/definitions.d.ts +185 -0
  233. package/types/core/astar/index.d.ts +3 -0
  234. package/types/core/astar/path-to-segments.d.ts +45 -0
  235. package/types/core/autosaver.d.ts +67 -0
  236. package/types/core/color-generator.d.ts +66 -0
  237. package/types/core/constants.d.ts +181 -0
  238. package/types/core/csv-loader.d.ts +84 -0
  239. package/types/core/datamodel/data-model.d.ts +23 -0
  240. package/types/core/datamodel/vertex-definition.d.ts +40 -0
  241. package/types/core/datasource.d.ts +87 -0
  242. package/types/core/event-constants.d.ts +308 -0
  243. package/types/core/event-generator.d.ts +102 -0
  244. package/types/core/filterable-dataset.d.ts +38 -0
  245. package/types/core/geom.d.ts +278 -0
  246. package/types/core/index.d.ts +39 -0
  247. package/types/core/io.d.ts +106 -0
  248. package/types/core/layout/absolute-layout.d.ts +91 -0
  249. package/types/core/layout/abstract-layout-adapter.d.ts +17 -0
  250. package/types/core/layout/abstract-layout.d.ts +192 -0
  251. package/types/core/layout/circular/circular-layout.d.ts +31 -0
  252. package/types/core/layout/circular/index.d.ts +1 -0
  253. package/types/core/layout/empty-layout.d.ts +17 -0
  254. package/types/core/layout/force-directed/force-directed-layout.d.ts +148 -0
  255. package/types/core/layout/force-directed/index.d.ts +1 -0
  256. package/types/core/layout/grid/definitions.d.ts +81 -0
  257. package/types/core/layout/grid/grid-layout.d.ts +60 -0
  258. package/types/core/layout/grid/index.d.ts +2 -0
  259. package/types/core/layout/hierarchical/abstract-hierarchical-layout.d.ts +90 -0
  260. package/types/core/layout/hierarchical/balloon-layout.d.ts +62 -0
  261. package/types/core/layout/hierarchical/definitions.d.ts +45 -0
  262. package/types/core/layout/hierarchical/hierarchical-layout.d.ts +102 -0
  263. package/types/core/layout/hierarchical/index.d.ts +5 -0
  264. package/types/core/layout/hierarchical/parent-relative-placement.d.ts +96 -0
  265. package/types/core/layout/hierarchy/assign-layers-stage.d.ts +26 -0
  266. package/types/core/layout/hierarchy/crossing-stage.d.ts +78 -0
  267. package/types/core/layout/hierarchy/definitions.d.ts +261 -0
  268. package/types/core/layout/hierarchy/edge-routing.d.ts +25 -0
  269. package/types/core/layout/hierarchy/hierarchy-layout-stage.d.ts +9 -0
  270. package/types/core/layout/hierarchy/hierarchy-layout.d.ts +87 -0
  271. package/types/core/layout/hierarchy/index.d.ts +11 -0
  272. package/types/core/layout/hierarchy/model.d.ts +167 -0
  273. package/types/core/layout/hierarchy/parent-relative-placement.d.ts +69 -0
  274. package/types/core/layout/hierarchy/placement-stage.d.ts +82 -0
  275. package/types/core/layout/hierarchy/util.d.ts +13 -0
  276. package/types/core/layout/hierarchy/vertex-set.d.ts +45 -0
  277. package/types/core/layout/index.d.ts +10 -0
  278. package/types/core/layout/layouts.d.ts +10 -0
  279. package/types/core/magnetizer.d.ts +232 -0
  280. package/types/core/model/anchor.d.ts +38 -0
  281. package/types/core/model/cluster.d.ts +19 -0
  282. package/types/core/model/defs.d.ts +8 -0
  283. package/types/core/model/djikstra.d.ts +26 -0
  284. package/types/core/model/floyd-warshall.d.ts +15 -0
  285. package/types/core/model/graph.d.ts +1166 -0
  286. package/types/core/model/path.d.ts +227 -0
  287. package/types/core/params.d.ts +476 -0
  288. package/types/core/renderer.d.ts +74 -0
  289. package/types/core/router/common.d.ts +104 -0
  290. package/types/core/router/direct-router.d.ts +12 -0
  291. package/types/core/router/index.d.ts +3 -0
  292. package/types/core/router/orthogonal-router.d.ts +46 -0
  293. package/types/core/rtree/definitions.d.ts +24 -0
  294. package/types/core/rtree/hilbert.d.ts +9 -0
  295. package/types/core/rtree/index.d.ts +4 -0
  296. package/types/core/rtree/rtree.d.ts +102 -0
  297. package/types/core/rtree/util.d.ts +55 -0
  298. package/types/core/search/index.d.ts +1 -0
  299. package/types/core/search/visuallyjs-search.d.ts +167 -0
  300. package/types/core/selection.d.ts +394 -0
  301. package/types/core/templates/abstract-entry.d.ts +19 -0
  302. package/types/core/templates/comment-entry.d.ts +11 -0
  303. package/types/core/templates/core.d.ts +162 -0
  304. package/types/core/templates/custom-tag.d.ts +74 -0
  305. package/types/core/templates/defs.d.ts +123 -0
  306. package/types/core/templates/each-entry.d.ts +23 -0
  307. package/types/core/templates/element-entry.d.ts +18 -0
  308. package/types/core/templates/elements.d.ts +14 -0
  309. package/types/core/templates/executions.d.ts +100 -0
  310. package/types/core/templates/expressions.d.ts +47 -0
  311. package/types/core/templates/fake-dom.d.ts +42 -0
  312. package/types/core/templates/headless.d.ts +15 -0
  313. package/types/core/templates/if-entry.d.ts +25 -0
  314. package/types/core/templates/index.d.ts +14 -0
  315. package/types/core/templates/parser.d.ts +84 -0
  316. package/types/core/templates/text-entry.d.ts +17 -0
  317. package/types/core/templates/tmpl-entry.d.ts +13 -0
  318. package/types/core/toolkit.d.ts +1314 -0
  319. package/types/core/undo-redo/compound-action.d.ts +19 -0
  320. package/types/core/undo-redo/edge-action.d.ts +62 -0
  321. package/types/core/undo-redo/group-action.d.ts +60 -0
  322. package/types/core/undo-redo/move-action.d.ts +18 -0
  323. package/types/core/undo-redo/node-group-action.d.ts +62 -0
  324. package/types/core/undo-redo/port-action.d.ts +29 -0
  325. package/types/core/undo-redo/renderer-vertex-removed-action.d.ts +17 -0
  326. package/types/core/undo-redo/set-type-action.d.ts +14 -0
  327. package/types/core/undo-redo/undo-redo.d.ts +203 -0
  328. package/types/core/undo-redo/update-action.d.ts +20 -0
  329. package/types/core/undo-redo/vertex-update-action.d.ts +12 -0
  330. package/types/core/util.d.ts +661 -0
  331. package/types/index.d.ts +16 -0
  332. package/types/l.d.ts +2 -0
  333. package/types/test-support/index.d.ts +1 -0
  334. package/types/test-support/test-support.d.ts +833 -0
  335. package/types/ui/common/abstract-segment.d.ts +88 -0
  336. package/types/ui/common/anchor.d.ts +280 -0
  337. package/types/ui/common/connector.d.ts +106 -0
  338. package/types/ui/common/index.d.ts +5 -0
  339. package/types/ui/common/overlay.d.ts +117 -0
  340. package/types/ui/common/paint-style.d.ts +33 -0
  341. package/types/ui/connector-bezier/abstract-bezier-connector.d.ts +68 -0
  342. package/types/ui/connector-bezier/bezier-connector.d.ts +34 -0
  343. package/types/ui/connector-bezier/bezier-segment.d.ts +31 -0
  344. package/types/ui/connector-bezier/bezier.d.ts +129 -0
  345. package/types/ui/connector-bezier/index.d.ts +6 -0
  346. package/types/ui/connector-bezier/operations.d.ts +18 -0
  347. package/types/ui/connector-bezier/quadratic-bezier-connector.d.ts +35 -0
  348. package/types/ui/connector-orthogonal/default-orthogonal-path-compute.d.ts +11 -0
  349. package/types/ui/connector-orthogonal/definitions.d.ts +120 -0
  350. package/types/ui/connector-orthogonal/index.d.ts +7 -0
  351. package/types/ui/connector-orthogonal/modern-source-target-relocator.d.ts +37 -0
  352. package/types/ui/connector-orthogonal/operations.d.ts +49 -0
  353. package/types/ui/connector-orthogonal/stub-calculators.d.ts +12 -0
  354. package/types/ui/connector-orthogonal/utils.d.ts +134 -0
  355. package/types/ui/connector-orthogonal/vertex-avoidance.d.ts +29 -0
  356. package/types/ui/connector-straight/index.d.ts +2 -0
  357. package/types/ui/connector-straight/operations.d.ts +55 -0
  358. package/types/ui/connector-straight/straight-connector.d.ts +121 -0
  359. package/types/ui/copy-paste/clipboard.d.ts +45 -0
  360. package/types/ui/copy-paste/copy-data.d.ts +93 -0
  361. package/types/ui/copy-paste/index.d.ts +2 -0
  362. package/types/ui/core/callbacks.d.ts +48 -0
  363. package/types/ui/core/component/component.d.ts +115 -0
  364. package/types/ui/core/connector/abstract-connector.d.ts +66 -0
  365. package/types/ui/core/connector/arc-segment.d.ts +39 -0
  366. package/types/ui/core/connector/connection-impl.d.ts +81 -0
  367. package/types/ui/core/connector/connections.d.ts +113 -0
  368. package/types/ui/core/connector/connectors.d.ts +205 -0
  369. package/types/ui/core/connector/operations.d.ts +0 -0
  370. package/types/ui/core/connector/segments.d.ts +24 -0
  371. package/types/ui/core/connector/straight-segment.d.ts +32 -0
  372. package/types/ui/core/constants.d.ts +181 -0
  373. package/types/ui/core/context.d.ts +26 -0
  374. package/types/ui/core/core-events.d.ts +7 -0
  375. package/types/ui/core/core.d.ts +1734 -0
  376. package/types/ui/core/css-constants.d.ts +149 -0
  377. package/types/ui/core/defaults.d.ts +242 -0
  378. package/types/ui/core/definitions.d.ts +540 -0
  379. package/types/ui/core/event-constants.d.ts +510 -0
  380. package/types/ui/core/factory/anchor-record-factory.d.ts +17 -0
  381. package/types/ui/core/factory/continuous-anchors.d.ts +27 -0
  382. package/types/ui/core/factory/overlay-factory.d.ts +8 -0
  383. package/types/ui/core/grid-profile.d.ts +28 -0
  384. package/types/ui/core/group-collapse-expand.d.ts +23 -0
  385. package/types/ui/core/group-sizer.d.ts +9 -0
  386. package/types/ui/core/index.d.ts +45 -0
  387. package/types/ui/core/magnetize-profile.d.ts +82 -0
  388. package/types/ui/core/overlay/arrow-overlay.d.ts +34 -0
  389. package/types/ui/core/overlay/custom-overlay.d.ts +38 -0
  390. package/types/ui/core/overlay/diamond-overlay.d.ts +14 -0
  391. package/types/ui/core/overlay/dot-overlay.d.ts +54 -0
  392. package/types/ui/core/overlay/ellipse-overlay.d.ts +60 -0
  393. package/types/ui/core/overlay/label-overlay.d.ts +37 -0
  394. package/types/ui/core/overlay/overlay.d.ts +131 -0
  395. package/types/ui/core/overlay/plain-arrow-overlay.d.ts +15 -0
  396. package/types/ui/core/overlay/rectangle-overlay.d.ts +66 -0
  397. package/types/ui/core/params.d.ts +223 -0
  398. package/types/ui/core/router/astar-path-finder.d.ts +29 -0
  399. package/types/ui/core/router/base-router.d.ts +100 -0
  400. package/types/ui/core/router/default-router.d.ts +38 -0
  401. package/types/ui/core/router/index.d.ts +5 -0
  402. package/types/ui/core/router/router-utils.d.ts +118 -0
  403. package/types/ui/core/router/router.d.ts +30 -0
  404. package/types/ui/core/type-descriptors.d.ts +83 -0
  405. package/types/ui/core/ui-model.d.ts +65 -0
  406. package/types/ui/core/view/common-options.d.ts +15 -0
  407. package/types/ui/core/view/edge-options.d.ts +126 -0
  408. package/types/ui/core/view/events.d.ts +159 -0
  409. package/types/ui/core/view/group-options.d.ts +75 -0
  410. package/types/ui/core/view/index.d.ts +35 -0
  411. package/types/ui/core/view/node-options.d.ts +20 -0
  412. package/types/ui/core/view/node-or-port-options.d.ts +28 -0
  413. package/types/ui/core/view/port-options.d.ts +51 -0
  414. package/types/ui/core/view/vertex-options.d.ts +28 -0
  415. package/types/ui/core/viewport.d.ts +297 -0
  416. package/types/ui/index.d.ts +9 -0
  417. package/types/ui/plugins/definitions.d.ts +118 -0
  418. package/types/ui/plugins/index.d.ts +2 -0
  419. package/types/ui/plugins/plugins.d.ts +7 -0
  420. package/types/ui/property-mappings/definitions.d.ts +28 -0
  421. package/types/ui/property-mappings/index.d.ts +2 -0
  422. package/types/ui/property-mappings/property-mapper.d.ts +16 -0
  423. package/types/ui/util/index.d.ts +3 -0
  424. package/types/ui/util/property-tracker.d.ts +8 -0
  425. package/types/ui/util/svg-constants.d.ts +111 -0
  426. package/types/ui/util/util.d.ts +69 -0
  427. package/types/version.d.ts +1 -0
@@ -0,0 +1,833 @@
1
+ import { Edge, Group, ObjectData, Node, Vertex, Port, VisuallyJsModel, ModelOptions, LoadOptions, ObjectInfo, PointXY } from "../core";
2
+ import { Surface, SurfaceOptions, MiniviewPlugin, MiniviewPluginOptions, BrowserUIModel, TemplateRenderer, BrowserElement, EventManager, SurfaceAnimator, Palette } from "../browser-ui";
3
+ import { Connection } from "../ui";
4
+ import { ConnectReason } from "../core";
5
+ /**
6
+ * @internal
7
+ */
8
+ interface TestHarnessMiniviewPluginOptions extends MiniviewPluginOptions {
9
+ width?: number;
10
+ height?: number;
11
+ }
12
+ declare function _addDiv(id: string, parent?: HTMLElement, className?: string, styles?: Record<string, string>): any;
13
+ declare function _addDivs(ids: Array<string>, parent?: HTMLElement): void;
14
+ declare function _cleanup(): void;
15
+ /**
16
+ * Tests that the two values are no further than `amount` apart.
17
+ * @param v1 First value to compare
18
+ * @param v2 Second value to compare
19
+ * @param amount Optional, defaults to 0.0005.
20
+ * @returns
21
+ */
22
+ declare function delta(v1: string | number, v2: string | number, amount: number): boolean;
23
+ declare function getEdgeCanvas(connection: Connection<Element>): any;
24
+ /**
25
+ * Make an event for the given element. Events use page coordinates so we just use the getBoundingClientRect()
26
+ * method on the given element. The event is positioned on the center of the given element.
27
+ * @param el
28
+ * @returns a SynthesizedEvent
29
+ * @internal
30
+ */
31
+ declare function _makeEvt(el: Element, data?: Record<string, any>, locationOnTarget?: PointXY): SynthesizedEvent;
32
+ /**
33
+ * An object conforming to enough of the Event interface to be used to trigger events in the DOM by the TestHarness.
34
+ * @group Test Support
35
+ */
36
+ export interface SynthesizedEvent {
37
+ clientX: number;
38
+ clientY: number;
39
+ screenX: number;
40
+ screenY: number;
41
+ pageX: number;
42
+ pageY: number;
43
+ }
44
+ /**
45
+ * Callbacks you can provide to connection drag methods in the TestHarness to interrupt the process
46
+ * and inspect what's going on.
47
+ * @group Test Support
48
+ */
49
+ export interface ConnectionDragEventHandlers {
50
+ start?: Function;
51
+ down?: Function;
52
+ move?: Function;
53
+ up?: Function;
54
+ }
55
+ /**
56
+ * Handlers you can pass as an argument to various element drag methods in the TestHarness, to
57
+ * interrupt the drag and inspect what's going on.
58
+ * @group Test Support
59
+ */
60
+ export interface DragEventHandlers {
61
+ afterDown?: Function;
62
+ afterMove?: Function;
63
+ afterUp?: Function;
64
+ }
65
+ /**
66
+ * Synthesize an event
67
+ * @param l
68
+ * @param t
69
+ * @returns a SynthesizedEvent
70
+ * @internal
71
+ */
72
+ declare function _evt(l: number, t: number, values?: Record<string, any>): SynthesizedEvent;
73
+ declare function _nudgeEvent(evt: SynthesizedEvent, dx: number, dy: number): SynthesizedEvent;
74
+ /**
75
+ * @internal
76
+ */
77
+ export interface ContainerOptions {
78
+ width?: number;
79
+ height?: number;
80
+ }
81
+ declare function lasso(surface: Surface, start: PointXY, end: PointXY, callbacks?: ConnectionDragEventHandlers): void;
82
+ declare function lassoOnElement(surface: Surface, downEventElement: BrowserElement, start: PointXY, end: PointXY, callbacks?: ConnectionDragEventHandlers): void;
83
+ /**
84
+ * @internal
85
+ */
86
+ export declare const VisuallyJsTestSupport: {
87
+ addDiv: typeof _addDiv;
88
+ addDivs: typeof _addDivs;
89
+ cleanup: typeof _cleanup;
90
+ delta: typeof delta;
91
+ DOWN_EVENT: string;
92
+ UP_EVENT: string;
93
+ MOVE_EVENT: string;
94
+ isTouchDevice: boolean;
95
+ makeEvent: typeof _makeEvt;
96
+ makeEventAt: typeof _evt;
97
+ nudgeEvent: typeof _nudgeEvent;
98
+ getEdgeCanvas: typeof getEdgeCanvas;
99
+ defaultEventManager: EventManager;
100
+ /**
101
+ * Drag any DOM element around, not just elements managed by the surface.
102
+ * @param el
103
+ * @param dx
104
+ * @param dy
105
+ */
106
+ dragElementBy: (el: Element, dx: number, dy: number, eventHandlers?: DragEventHandlers) => void;
107
+ attachToSurface: (surface: Surface) => TestHarness;
108
+ create: (modelOptions: ModelOptions, renderParams: SurfaceOptions, containerParams?: ContainerOptions, templateRenderer?: TemplateRenderer<any>) => TestHarness;
109
+ trigger: (m: EventManager, el: Element, evt: string, x: number, y: number) => void;
110
+ getTransform: (el: HTMLElement) => {
111
+ translateX: number;
112
+ translateY: number;
113
+ scale: number;
114
+ };
115
+ lasso: typeof lasso;
116
+ lassoOnElement: typeof lassoOnElement;
117
+ withinTolerance: (val: number, target: number, tolerance: number) => boolean;
118
+ };
119
+ /**
120
+ * Provides a set of methods you can use in your unit/component tests to simulate a user interacting with a UI rendered
121
+ * by VisuallyJs.
122
+ * @group Test Support
123
+ */
124
+ export declare class TestHarness {
125
+ model: BrowserUIModel;
126
+ /**
127
+ * @internal
128
+ */
129
+ eventManager: EventManager;
130
+ /**
131
+ * @internal
132
+ */
133
+ surface: Surface;
134
+ /**
135
+ * @internal
136
+ */
137
+ undoManager: any;
138
+ /**
139
+ * @internal
140
+ */
141
+ _edgePathEditor: any;
142
+ /**
143
+ * @internal
144
+ */
145
+ consoleOutput: string;
146
+ constructor(model: BrowserUIModel, surface?: Surface);
147
+ /**
148
+ * @internal
149
+ */
150
+ get container(): any;
151
+ get canvas(): any;
152
+ /**
153
+ * @internal
154
+ */
155
+ get edgePathEditor(): any;
156
+ /**
157
+ * Destroy the underlying Surface and remove the test harness container from the DOM.
158
+ *
159
+ */
160
+ destroy(): void;
161
+ /**
162
+ * Start editing the given Edge. Your surface must be configured for editable edge paths for this method to have
163
+ * any effect.
164
+ * @param edge - Edge to edit
165
+ * @param params - Optional editor params. The type of this object depends on the type of the edge that is to be
166
+ * edited.
167
+ *
168
+ */
169
+ startEditing(edge: Edge, params?: any): void;
170
+ /**
171
+ * Stop editing an Edge. Your surface must be configured for editable edge paths for this method to have any effect.
172
+ *
173
+ */
174
+ stopEditing(): void;
175
+ /**
176
+ * Render the current model to a Surface. Used by internal tests; not part of the public API.
177
+ * @internal
178
+ * @param renderParams
179
+ * @param containerParams
180
+ */
181
+ render(renderParams: SurfaceOptions, containerParams?: any): Surface;
182
+ /**
183
+ * Execute `querySelectorAll(...)` on the current container and return the results.
184
+ * @param selector
185
+ *
186
+ * @return A NodeList of matching elements.
187
+ */
188
+ querySelectorAll(selector: string): any;
189
+ /**
190
+ * Execute `querySelector(...)` on the current container and return the results.
191
+ * @param selector
192
+ *
193
+ * @return A matching DOM element, or null
194
+ */
195
+ querySelector(selector: string): any;
196
+ /**
197
+ * Randomly drag a node/group around. Can be useful to ensure the model is being updated, or you're getting
198
+ * callbacks you expect, etc. We use this internally when we just want a node to move and we don't care where
199
+ * it moves to.
200
+ * @param obj Either a Node/Group, or the ID of a Node/Group, or the DOM element representing some Node/Group
201
+ * @param callbacks Optional set of event handlers to invoke during the drag.
202
+ *
203
+ * @return void
204
+ */
205
+ dragANodeAround(obj: Element | string | Node | Group, callbacks?: ConnectionDragEventHandlers): void;
206
+ /**
207
+ * Randomly drag a DOM element around.
208
+ * @param el Some DOM element. Doesn't need to be an element that represents a vertex in your model.
209
+ *
210
+ * @return void
211
+ */
212
+ dragAnElementAround(el: BrowserElement): void;
213
+ /**
214
+ * Shortcut to the underlying `load` method of the model.
215
+ * @param options
216
+ *
217
+ */
218
+ load(options: LoadOptions): VisuallyJsModel;
219
+ getEdgeCanvas(e: Edge): any;
220
+ /**
221
+ * Run a function and capture the console output. Used internally by JsPlumb's unit tests; included in the
222
+ * public API on the off chance it will be useful for others.
223
+ * @param fn
224
+ *
225
+ */
226
+ withConsole(fn: Function): void;
227
+ /**
228
+ * Shortcut to the underlying `clear` method of the model.
229
+ *
230
+ */
231
+ clear(): VisuallyJsModel;
232
+ /**
233
+ * For the given argument, find and return the corresponding DOM element.
234
+ * @param obj A node/group/port id, or node/group/port, or a DOM element.
235
+ *
236
+ */
237
+ getRenderedElement(obj: Element | string | Node | Group | ObjectData): Element;
238
+ /**
239
+ * For the given edge id, find and return the underlying Connection used to render it.
240
+ * @param edgeId An edge ID
241
+ *
242
+ */
243
+ getRenderedConnection(edgeId: string): Connection<Element>;
244
+ /**
245
+ * Drag the given vertex into the given group.
246
+ * @param vertex Vertex id, Node, Group, or DOM element.
247
+ * @param group Group id, Group, or DOM element.
248
+ *
249
+ */
250
+ dragVertexIntoGroup(vertex: string | Node | Group | Element, group: string | Group | Element): void;
251
+ /**
252
+ * Drag the given vertex out of its current group. The element is placed [50,50] to the left and above
253
+ * @param vertex Vertex id, Node, Group, or DOM element
254
+ *
255
+ */
256
+ dragVertexOutOfGroup(vertex: string | Node | Group | Element, dragFarFarAway?: boolean): void;
257
+ /**
258
+ * Gets a Group from the underlying model.
259
+ * @param obj Group Id or DOM element representing the Group
260
+ *
261
+ */
262
+ getGroup(obj: Element | string): ObjectInfo<Group>;
263
+ /**
264
+ * Gets a Node from the underlying model.
265
+ * @param obj Node Id or DOM element representing the node.
266
+ *
267
+ */
268
+ getNode(obj: Element | string): ObjectInfo<Node>;
269
+ /**
270
+ * Find the corresponding model object for the given input.
271
+ * @param obj A string representing an ID, a DOM element, a connection, or an existing model object.
272
+ * @returns an object containing the given model object, plus its id, and type etc.
273
+ *
274
+ */
275
+ getModelObject<T = any>(obj: Element | Connection<Element> | string | Node | Group | Edge | ObjectData): ObjectInfo<T>;
276
+ /**
277
+ * Drag the given Node/Group to the given [x,y], which are CANVAS coordinates.
278
+ * @param obj Node id, group, node, or DOM element.
279
+ * @param x Location on canvas in X axis to position top left corner of the node.
280
+ * @param y Location on canvas in Y axis to position top left corner of the node.
281
+ *
282
+ */
283
+ dragVertexTo(obj: string | Node | Group | Element, x: number, y: number, eventHandlers?: DragEventHandlers): void;
284
+ /**
285
+ * Drag the given Node/Group to the given [x,y], which are PAGE coordinates.
286
+ * @param obj Node id, node, group, or DOM element.
287
+ * @param x Location on canvas in X axis to position top left corner of the node.
288
+ * @param y Location on canvas in Y axis to position top left corner of the node.
289
+ *
290
+ */
291
+ dragVertexToPageLocation(obj: string | Node | Group | Element, x: number, y: number, eventHandlers?: DragEventHandlers): void;
292
+ /**
293
+ * Drag the given Node/Group by the given x/y amounts. This is CANVAS coordinates.
294
+ * @param obj Node/Group id, node, group or DOM element.
295
+ * @param x Amount to move in X axis
296
+ * @param y Amount to move in Y axis
297
+ * @param eventHandlers Optional callbacks to invoke at various points in the drag lifecycle.
298
+ * @param metaKeys Optional map of meta keys to set on the events used to model the drag.
299
+ *
300
+ */
301
+ dragVertexBy(obj: string | Node | Group | Element, x: number, y: number, eventHandlers?: DragEventHandlers, metaKeys?: Record<string, boolean>): void;
302
+ /**
303
+ * Drag the given Node/Group by the given x/y amounts. This is PAGE coordinates.
304
+ * @param obj Node/Group id, node, group or DOM element.
305
+ * @param x Amount to move in X axis
306
+ * @param y Amount to move in Y axis
307
+ * @param eventHandlers Optional callbacks to invoke at various points in the drag lifecycle.
308
+ * @param metaKeys Optional map of meta keys to set on the events used to model the drag.
309
+ *
310
+ */
311
+ dragVertexByPageDelta(obj: string | Node | Group | Element, x: number, y: number, eventHandlers?: DragEventHandlers, metaKeys?: Record<string, boolean>): void;
312
+ /**
313
+ * Drag the given DOM element by the given x/y amounts. This is PAGE coordinates.
314
+ * @param el DOM element to drag.
315
+ * @param x Amount to move in X axis
316
+ * @param y Amount to move in Y axis
317
+ * @param eventHandlers Optional callbacks to invoke at various points in the drag lifecycle.
318
+ * @param metaKeys Optional map of meta keys to set on the events used to model the drag.
319
+ *
320
+ */
321
+ dragElementBy(el: BrowserElement, x: number, y: number, eventHandlers?: DragEventHandlers, metaKeys?: Record<string, boolean>): void;
322
+ /**
323
+ * Drag a DOM element over a number of stages, advancing a little each time. This is PAGE coordinates.
324
+ * @param el DOM element to drag.
325
+ * @param x Amount to move in X axis
326
+ * @param y Amount to move in Y axis
327
+ * @param stages How many stages to break the drag up into.
328
+ * @param eventHandlers Optional callbacks to invoke at various points in the drag lifecycle. If you provide an
329
+ * `afterMove` callback, it will be invoked after each step of the drag.
330
+ * @param metaKeys Optional map of meta keys to set on the events used to model the drag.
331
+ *
332
+ */
333
+ dragElementByInStages(el: BrowserElement, x: number, y: number, stages?: number, eventHandlers?: DragEventHandlers, metaKeys?: Record<string, boolean>): void;
334
+ /**
335
+ * Drag a Node/Group over a number of stages, advancing a little each time.
336
+ * @param obj Node/Group id, node, group or DOM element.
337
+ * @param x Amount to move in X axis
338
+ * @param y Amount to move in Y axis
339
+ * @param stages How many stages to break the drag up into.
340
+ * @param eventHandlers Optional callbacks to invoke at various points in the drag lifecycle. If you provide an
341
+ * `afterMove` callback, it will be invoked after each step of the drag.
342
+ * @param metaKeys Optional map of meta keys to set on the events used to model the drag.
343
+ *
344
+ */
345
+ dragVertexByInStages(obj: string | Node | Group | BrowserElement, x: number, y: number, stages?: number, eventHandlers?: DragEventHandlers, metaKeys?: Record<string, boolean>): void;
346
+ /**
347
+ * Connect the given source and target via a call on the model, ie. without using the mouse. If you want
348
+ * to simulate mouse activity being used to establish an edge, use `dragConnection`.
349
+ * @param source Node/Port/Group id, node/port/group, or DOM element.
350
+ * @param target Node/Port/Group id, node/port/group, or DOM element.
351
+ * @param data Optional data for the edge.
352
+ *
353
+ * @return an Edge.
354
+ */
355
+ connect(source: string | Node | Port | Group | BrowserElement, target: string | Node | Port | Group | BrowserElement, data?: ObjectData, reason?: ConnectReason): Edge;
356
+ private _resolveElement;
357
+ private _resolveSourceAndTarget;
358
+ /**
359
+ * Drags a connection between two vertices. You can pass in a variety of arguments to this method for both source
360
+ * and target: a DOM element, a node/group/port ID, or a combination of vertex id + css selector. We use this last
361
+ * variant in VisuallyJs's own test suite to ensure that connections can be dragged from specific parts of some
362
+ * element, or that a connection source on an element does not cause the element to be dragged, etc.
363
+ * @param source Either a DOM element, the ID of some node/group, or a node/group ID and an associated CSS3
364
+ * selector identifying a part of the vertex's element that should be the source of the drag.
365
+ * @param target Either a DOM element, the ID of some node/group, or a node/group ID and an associated CSS3
366
+ * selector identifying a part of the vertex's element that should be the target of the drag.
367
+ * @param callbacks Optional callbacks to invoke during the connection drag
368
+ * @param locationOnTarget Optional spec for exactly where on the target element to drop the connection. Values in
369
+ * this object are expressed as ratios of the width/height of the element. We use this in VisuallyJs when we're
370
+ * testing scenarios in which a given vertex has multiple anchor locations assigned to it.
371
+ *
372
+ * @return a Connection. You can access the underlying edge via the `.edge` property of the connection.
373
+ */
374
+ dragConnection(source: BrowserElement | string | [string, string], target: BrowserElement | string | [string, string], callbacks?: ConnectionDragEventHandlers, locationOnTarget?: PointXY): Connection<BrowserElement>;
375
+ /**
376
+ * Drag a connection in a way that activates the snap to target functionality, ie. it fires mouse events close to
377
+ * the target but not over it.
378
+ * @param source
379
+ * @param target
380
+ * @param xMargin
381
+ * @param yMargin
382
+ * @param callbacks
383
+ */
384
+ dragSnapConnection(source: BrowserElement | string | [string, string], target: BrowserElement | string | [string, string], xMargin: number, yMargin: number, callbacks?: ConnectionDragEventHandlers): Connection<BrowserElement>;
385
+ dragDetachedConnection(source: BrowserElement | string | [string, string], target: PointXY, callbacks?: ConnectionDragEventHandlers): Connection<BrowserElement>;
386
+ dragDiagramConnection(source: string, target: string, callbacks?: ConnectionDragEventHandlers): Connection<BrowserElement>;
387
+ dragDiagramSnapConnection(source: string, target: string, xMargin: number, yMargin: number, callbacks?: ConnectionDragEventHandlers): Connection<BrowserElement>;
388
+ /**
389
+ * Use the mouse to drag the source of the given edge and drop it on distant whitespace, causing the edge to be
390
+ * detached.
391
+ * @param edge
392
+ *
393
+ */
394
+ detachEdge(edge: Edge, pointToDropAt?: PointXY): PointXY;
395
+ detachEdgeBySource(edge: Edge, pointToDropAt?: PointXY): PointXY;
396
+ /**
397
+ * Use the mouse to drag the target of the given edge and drop it on distant whitespace, causing the edge to be
398
+ * detached.
399
+ * @param edge
400
+ *
401
+ */
402
+ detachEdgeByTarget(edge: Edge, pointToDropAt?: PointXY): PointXY;
403
+ /**
404
+ * Drag the given edge's target relocator and drop it on some other vertex/element.
405
+ * @param edge
406
+ * @param target
407
+ * @param callbacks
408
+ * @param locationOnTarget
409
+ */
410
+ relocateEdgeTarget(edge: Edge, target: string | Node | Port | Group | BrowserElement, callbacks?: ConnectionDragEventHandlers, locationOnTarget?: PointXY): void;
411
+ /**
412
+ * Drag the given edge's source relocator and drop it on some other vertex/element.
413
+ * @param edge
414
+ * @param source
415
+ * @param callbacks
416
+ * @param locationOnTarget
417
+ */
418
+ relocateEdgeSource(edge: Edge, source: string | Node | Port | Group | BrowserElement, callbacks?: ConnectionDragEventHandlers, locationOnTarget?: PointXY): void;
419
+ /**
420
+ * Trigger the event with the given name on the given object. By default the event will occur in the middle of the
421
+ * DOM element representing the object.
422
+ * @param obj Node/Port/Group id, node/port/group, or DOM element.
423
+ * @param eventName eg 'click', 'mouseover'
424
+ * @param evt Optional, an event you previously created via #makeEvent. Sometimes you want to control the specific
425
+ * location of the event.
426
+ *
427
+ */
428
+ trigger(obj: Node | Port | Group | string | BrowserElement, eventName: string, evt: any): void;
429
+ /**
430
+ * Trigger the provided event on the given DOM element.
431
+ * @param el Element to trigger the event on
432
+ * @param eventName Name of the event to trigger
433
+ * @param data Optional data to set on the created event. Any values in this object are copied
434
+ * into the created event via `Object.assign`.
435
+ * @deprecated Use triggerEvent instead
436
+ *
437
+ */
438
+ triggerEventOnElement(el: HTMLElement, eventName: string, data?: Record<string, any>, x?: number, y?: number): void;
439
+ /**
440
+ * Trigger the provided event on the given DOM element.
441
+ * @param el Element to trigger the event on
442
+ * @param eventName Name of the event to trigger
443
+ * @param data Optional data to set on the created event. Any values in this object are copied
444
+ * into the created event via `Object.assign`.
445
+ *
446
+ */
447
+ triggerEvent(el: HTMLElement, eventName: string, data?: Record<string, any>, x?: number, y?: number): void;
448
+ /**
449
+ * Triggers the given event at the given offset from the origin of the given element.
450
+ * @param el
451
+ * @param eventName
452
+ * @param x
453
+ * @param y
454
+ * @param data
455
+ */
456
+ triggerEventAt(el: HTMLElement, eventName: string, x: number, y: number, data?: Record<string, any>): void;
457
+ /**
458
+ * Synthesize an event for the given object. This method is used by other parts of the test harness class
459
+ * and is not something a user of the API will necessarily need to make use of.
460
+ * @param obj Node/Port/Group id, node/port/group, or DOM element.
461
+ * @param dx Optional offset from the center of the x axis of the related DOM element to position the event.
462
+ * @param dy Optional offset from the center of the y axis of the related DOM element to position the event.
463
+ * @returns a SynthesizedEvent
464
+ *
465
+ */
466
+ makeEvent(obj: Node | Port | Group | string | BrowserElement, dx: number, dy: number): SynthesizedEvent;
467
+ /**
468
+ * Make an event at the given page location.
469
+ * @param x
470
+ * @param y
471
+ *
472
+ */
473
+ makeEventAt(x: number, y: number): SynthesizedEvent;
474
+ /**
475
+ * Gets an Edge.
476
+ * @param obj Edge ID, or Edge object.
477
+ *
478
+ */
479
+ getEdge(obj: any): Edge;
480
+ /**
481
+ * Updates an Edge.
482
+ * @param edge Edge, or edge ID.
483
+ * @param data Data to update the edge with.
484
+ *
485
+ */
486
+ updateEdge(edge: any, data: any): void;
487
+ /**
488
+ * Gets all edges in the underlying model.
489
+ *
490
+ */
491
+ getAllEdges(): Array<Edge>;
492
+ /**
493
+ * Gets the DOM element that was rendered for some port. May be null.
494
+ * @param obj Port, or port ID.
495
+ *
496
+ */
497
+ getRenderedPort(obj: string): Element;
498
+ /**
499
+ * Add a Node to the model. A convenience wrapper around the same method on the underlying model.
500
+ * @param data Data for the Node.
501
+ *
502
+ */
503
+ addNode(data: ObjectData): Node;
504
+ /**
505
+ * Update a Node in to the model. A convenience wrapper around the same method on the underlying model.
506
+ * @param obj Node, or Node Id.
507
+ * @param data Data for the Node.
508
+ *
509
+ */
510
+ updateNode(obj: string | Node, data: ObjectData): void;
511
+ /**
512
+ * Add a Group to the model. A convenience wrapper around the same method on the underlying model.
513
+ * @param data Data for the Group.
514
+ *
515
+ */
516
+ addGroup(data: ObjectData): Group;
517
+ /**
518
+ * Update a Group in the model. A convenience wrapper around the same method on the underlying model.
519
+ * @param obj Group, or Group Id.
520
+ * @param data Data for the Group.
521
+ *
522
+ */
523
+ updateGroup(obj: string | Group, data: ObjectData): void;
524
+ /**
525
+ * Update a Vertex in the model. A convenience wrapper around the same method on the underlying model.
526
+ * @param obj vertex, or vertex Id.
527
+ * @param data Data for the Vertex update.
528
+ *
529
+ */
530
+ updateVertex(obj: string | Vertex, data: ObjectData): void;
531
+ /**
532
+ * Clicks on the group with the given ID.
533
+ * @param groupId ID of the group to click on.
534
+ *
535
+ */
536
+ clickOnGroup(groupId: string): void;
537
+ /**
538
+ * Clicks on the node with the given ID.
539
+ * @param nodeId ID of the group to click on.
540
+ *
541
+ */
542
+ clickOnNode(nodeId: string): void;
543
+ /**
544
+ * Clicks on the node/group with the given ID.
545
+ * @param nodeOrGroupId ID of the node/group to click on.
546
+ *
547
+ */
548
+ clickOnVertex(nodeOrGroupId: string): void;
549
+ /**
550
+ * Double clicks on the node/group with the given ID.
551
+ * @param nodeOrGroupId ID of the node/group to click on.
552
+ *
553
+ */
554
+ dblClickOnVertex(nodeOrGroupId: string): void;
555
+ /**
556
+ * Right-clicks on the node/group with the given ID.
557
+ * @param nodeOrGroupId ID of the node/group to click on.
558
+ *
559
+ */
560
+ rightClickOnVertex(nodeOrGroupId: string): void;
561
+ /**
562
+ * Simulates a tap event on the node/group with the given id - a tap event is a mousedown followed by a mouseup
563
+ * whose page coordinates are identical to the mousedown event's page coordinates.
564
+ * @param nodeOrGroupId ID of the node/group to tap on.
565
+ *
566
+ */
567
+ tapOnVertex(nodeOrGroupId: string): void;
568
+ /**
569
+ * Simulates a tap event on the node with the given id - a tap event is a mousedown followed by a mouseup whose
570
+ * page coordinates are identical to the mousedown event's page coordinates.
571
+ * @param nodeId ID of the node to tap on.
572
+ *
573
+ */
574
+ tapOnNode(nodeId: string): void;
575
+ /**
576
+ * Simulates a tap event on the group with the given id - a tap event is a mousedown followed by a mouseup whose
577
+ * page coordinates are identical to the mousedown event's page coordinates.
578
+ * @param groupId ID of the group to tap on.
579
+ *
580
+ */
581
+ tapOnGroup(groupId: string): void;
582
+ /**
583
+ * Simulates a double tap event on the node/group with the given id - a tap event is a mousedown followed by a
584
+ * mouseup whose page coordinates are identical to the mousedown event's page coordinates.
585
+ * @param nodeOrGroupId ID of the node/group to double tap on.
586
+ */
587
+ dblTapOnVertex(nodeOrGroupId: string): void;
588
+ /**
589
+ * Simulates a double tap event on the node with the given id - a tap event is a mousedown followed by a mouseup
590
+ * whose page coordinates are identical to the mousedown event's page coordinates.
591
+ * @param nodeId ID of the node/group to double tap on.
592
+ */
593
+ dblTapOnNode(nodeId: string): void;
594
+ /**
595
+ * Simulates a double tap event on the group with the given id - a tap event is a mousedown followed by a mouseup
596
+ * whose page coordinates are identical to the mousedown event's page coordinates.
597
+ * @param groupId ID of the node/group to double tap on.
598
+ */
599
+ dblTapOnGroup(groupId: string): void;
600
+ /**
601
+ * Simulates a mousemove event on the node/group with the given id
602
+ * @param nodeOrGroupId ID of the node/group to simulate mousemove on.
603
+ */
604
+ mousemoveOnVertex(nodeOrGroupId: string, locationOnTarget?: PointXY): void;
605
+ /**
606
+ * Simulates a mouseover event on the node/group with the given id
607
+ * @param nodeOrGroupId ID of the node/group to simulate mouseover on.
608
+ */
609
+ mouseoverOnVertex(nodeOrGroupId: string, locationOnTarget?: PointXY): void;
610
+ /**
611
+ * Simulates a mouseout event on the node/group with the given id
612
+ * @param nodeOrGroupId ID of the node/group to simulate mouseout on.
613
+ */
614
+ mouseoutOnVertex(nodeOrGroupId: string, locationOnTarget?: PointXY): void;
615
+ /**
616
+ * Simulates a mouseup event on the node/group with the given id
617
+ * @param nodeOrGroupId ID of the node/group to simulate mouseup on.
618
+ */
619
+ /**
620
+ * Simulates a mouseup event on the node/group with the given id
621
+ * @param nodeOrGroupId ID of the node/group to simulate mouseup on.
622
+ */
623
+ /**
624
+ * Simulates a right-click event on the node/group with the given id
625
+ * @param nodeOrGroupId ID of the node/group to simulate right-click on.
626
+ */
627
+ contextmenuOnVertex(nodeOrGroupId: string, locationOnTarget?: PointXY): void;
628
+ /**
629
+ * Simulates a click on the canvas
630
+ * @param clickCount How any clicks to simulate. Defaults to 1.
631
+ * @param button Which button to simulate. Defaults to 1 - the left button. 2 is right button.
632
+ *
633
+ */
634
+ clickOnCanvas(clickCount?: number, button?: number): void;
635
+ /**
636
+ * Simulates a click on the canvas at the given x,y
637
+ * @param x X location to click at
638
+ * @param y Y location to click at
639
+ * @param button Which button to simulate. Defaults to 1 - the left button. 2 is right button.
640
+ *
641
+ */
642
+ clickOnCanvasAt(x: number, y: number, button?: number): void;
643
+ /**
644
+ * Simulates a mouse move event on the canvas at the given x,y
645
+ * @param x
646
+ * @param y
647
+ */
648
+ mousemoveOnCanvasAt(x: number, y: number): void;
649
+ mousedownOnCanvasAt(x: number, y: number): void;
650
+ mouseupOnCanvasAt(x: number, y: number): void;
651
+ /**
652
+ * Drag a lasso on the canvas from the given start to the given end, which should be provided in pixel values,
653
+ * relative to the surface canvas origin.
654
+ * @param start
655
+ * @param end
656
+ */
657
+ lasso(start: PointXY, end: PointXY, callbacks?: ConnectionDragEventHandlers): void;
658
+ /**
659
+ * Drag a lasso on the given el from the given start to the given end, which should be provided in pixel values,
660
+ * relative to the surface canvas origin.
661
+ * @param el
662
+ * @param start
663
+ * @param end
664
+ * @param callbacks
665
+ */
666
+ lassoOnElement(el: BrowserElement, start: PointXY, end: PointXY, callbacks?: ConnectionDragEventHandlers): void;
667
+ /**
668
+ * Right-clicks on the canvas.
669
+ * @param clickCount How any clicks to simulate. Defaults to 1.
670
+ *
671
+ */
672
+ rightClickOnCanvas(clickCount?: number): void;
673
+ /**
674
+ * Clicks on a DOM element
675
+ *
676
+ */
677
+ clickOnElement(el: BrowserElement): void;
678
+ /**
679
+ * Clicks on an element inside the node/group with the given ID.
680
+ * @param nodeOrGroupId ID of the node/group to click on.
681
+ * @param selector CSS selector identifying the child element to click on.
682
+ *
683
+ */
684
+ clickOnElementInsideVertex(nodeOrGroupId: string, selector: string): void;
685
+ /**
686
+ * Double clicks on an element inside the node/group with the given ID.
687
+ * @param nodeOrGroupId ID of the node/group to double click on.
688
+ * @param selector CSS selector identifying the child element to click on.
689
+ *
690
+ */
691
+ dblClickOnElementInsideVertex(nodeOrGroupId: string, selector: string): void;
692
+ /**
693
+ * Taps on a DOM element (mousedown followed by mouseup)
694
+ *
695
+ */
696
+ tapOnElement(el: BrowserElement): void;
697
+ /**
698
+ * Taps on a DOM element inside the node/group with the given ID.
699
+ * @param nodeOrGroupId ID of the node/group to tap on.
700
+ * @param selector CSS selector identifying the child element to click on.
701
+ *
702
+ */
703
+ tapOnElementInsideVertex(nodeOrGroupId: string, selector: string): void;
704
+ /**
705
+ * Double taps on an element inside the node/group with the given ID.
706
+ * @param nodeOrGroupId ID of the node to tap on.
707
+ * @param selector CSS selector identifying the child element to click on.
708
+ *
709
+ */
710
+ dblTapOnElementInsideVertex(nodeOrGroupId: string, selector: string): void;
711
+ /**
712
+ * Creates a mousedown event on the given element and dispatches it.
713
+ * @param el
714
+ */
715
+ mousedownOnElement(el: BrowserElement): void;
716
+ /**
717
+ * Clicks on the given edge
718
+ * @param edgeId ID of the edge to click on
719
+ *
720
+ */
721
+ clickOnEdge(edgeId: string): void;
722
+ /**
723
+ * Double clicks on the given edge
724
+ * @param edgeId ID of the edge
725
+ *
726
+ */
727
+ dblClickOnEdge(edgeId: string): void;
728
+ /**
729
+ * Taps on the given edge
730
+ * @param edgeOrEdgeId Edge, or ID of the edge
731
+ *
732
+ */
733
+ tapOnEdge(edgeOrEdgeId: string | Edge): void;
734
+ /**
735
+ * Double taps on the given edge
736
+ *
737
+ * @param edgeOrEdgeId
738
+ */
739
+ dblTapOnEdge(edgeOrEdgeId: string | Edge): void;
740
+ private _addFromPalette;
741
+ dragFromPalette(palette: Palette<any>, selector: string, options?: any): void;
742
+ tapFromPalette(palette: Palette<any>, selector: string, options?: any): void;
743
+ /**
744
+ * Trigger a mousedown event on the edge with the given id.
745
+ * @param edgeId
746
+ *
747
+ */
748
+ mousedownOnEdge(edgeId: string): void;
749
+ /**
750
+ * Trigger a mouseup event on the edge with the given id.
751
+ * @param edgeId
752
+ *
753
+ */
754
+ mouseupOnEdge(edgeId: string): void;
755
+ /**
756
+ * Trigger a mouseover event on the edge with the given id.
757
+ * @param edgeId
758
+ *
759
+ */
760
+ mouseoverOnEdge(edgeId: string): void;
761
+ /**
762
+ * Trigger a mouseout event on the edge with the given id.
763
+ * @param edgeId
764
+ *
765
+ */
766
+ mouseoutOnEdge(edgeId: string): void;
767
+ /**
768
+ * Trigger a right click event on the edge with the given id.
769
+ * @param edgeId
770
+ *
771
+ */
772
+ contextmenuOnEdge(edgeId: string): void;
773
+ /**
774
+ * Clicks on the overlay with the given ID, on the given Edge.
775
+ * @param edgeId ID of the Edge
776
+ * @param overlayId ID of the overlay to click on.
777
+ *
778
+ */
779
+ clickOnOverlay(edgeId: string, overlayId: string): void;
780
+ /**
781
+ * Clicks on the port with the given ID on the node with given node id.
782
+ * @param nodeId ID of the node containing the port
783
+ * @param portId ID of the port to click on.
784
+ *
785
+ */
786
+ clickOnPort(nodeId: string, portId: string): void;
787
+ /**
788
+ * Returns the count of Edges in the underlying model.
789
+ *
790
+ */
791
+ getEdgeCount(): number;
792
+ /**
793
+ * Drag the given element onto the canvas, optionally at a specific x,y. Use this when you want to test drag/drop
794
+ * from some palette.
795
+ * @param el Element to drop onto the canvas.
796
+ * @param x Optional, defaults to 250.
797
+ * @param y Optional, defaults to 250.
798
+ *
799
+ */
800
+ dragElementToCanvas(el: BrowserElement, x: number, y: number): void;
801
+ /**
802
+ * Add a miniview to this test harness.
803
+ * @param miniviewOptions Options for the miniview.
804
+ * @internal
805
+ */
806
+ addMiniview(miniviewOptions: TestHarnessMiniviewPluginOptions): MiniviewPlugin;
807
+ /**
808
+ * Gets the position in the DOM of the element representing the given Node or Group
809
+ * @param v
810
+ *
811
+ */
812
+ getDOMPosition(v: string | Node | Group): PointXY;
813
+ /**
814
+ * Returns whether or not the DOM element representing the given vertex is at the given point `p`.
815
+ * @param v node/group or id of node/group
816
+ * @param x x location to test
817
+ * @param y y location to test
818
+ *
819
+ */
820
+ isAtPosition(v: string | Node | Group, x: number, y: number): boolean;
821
+ /**
822
+ * Attaches a SurfaceAnimator to the surface, and returns it.
823
+ * @internal
824
+ */
825
+ attachAnimator(): SurfaceAnimator;
826
+ /**
827
+ * Helper to test that a value is the same as some target, within our tolerance (0.00000000001).
828
+ * In rare instances the trigonometry stuff needs a little bit of leeway.
829
+ * @internal
830
+ */
831
+ within(val: number, target: number, _ok: Function, msg: string): void;
832
+ }
833
+ export {};