lecom-modeler 0.1.13 → 0.1.15

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/lib/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Node, Edge } from '@xyflow/react';
2
3
 
3
4
  declare enum GatewayVariant {
4
5
  EXCLUSIVE = "EXCLUSIVE",
@@ -62,26 +63,21 @@ interface GatewayElement {
62
63
  targets?: Element[];
63
64
  }
64
65
  type Element = ActivityElement | RoutingElement | GatewayElement;
66
+ interface ElementSelectionAPI {
67
+ highlightElement: (elementId: string, type?: "node" | "edge") => boolean;
68
+ clearSelection: () => void;
69
+ getSelectedElements: () => {
70
+ nodes: Node[];
71
+ edges: Edge[];
72
+ };
73
+ }
65
74
  interface ModelerProps {
66
75
  mode?: EditorMode;
67
76
  locale?: string;
68
77
  onConfigureElement?: (element: Element) => void;
69
- onHighlightMethods?: (methods: {
70
- highlightElement: (elementId: string) => void;
71
- highlightElements: (elementIds: string[]) => void;
72
- clearHighlight: () => void;
73
- isElementHighlighted: (elementId: string) => boolean;
74
- getHighlightedElements: () => string[];
75
- }) => void;
78
+ onSelectionAPIReady?: (api: ElementSelectionAPI) => void;
76
79
  }
77
80
 
78
81
  declare const Modeler: (props: ModelerProps) => react_jsx_runtime.JSX.Element;
79
- interface HighlightMethods {
80
- highlightElement: (elementId: string) => void;
81
- highlightElements: (elementIds: string[]) => void;
82
- clearHighlight: () => void;
83
- isElementHighlighted: (elementId: string) => boolean;
84
- getHighlightedElements: () => string[];
85
- }
86
82
 
87
- export { ActivityVariant, ComplexVariant, EditorMode, type Element, ElementType, ExclusiveVariant, GatewayVariant, type HighlightMethods, Modeler, type ModelerProps, RoutingVariant };
83
+ export { ActivityVariant, ComplexVariant, EditorMode, type Element, type ElementSelectionAPI, ElementType, ExclusiveVariant, GatewayVariant, Modeler, type ModelerProps, RoutingVariant };
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Node, Edge } from '@xyflow/react';
2
3
 
3
4
  declare enum GatewayVariant {
4
5
  EXCLUSIVE = "EXCLUSIVE",
@@ -62,26 +63,21 @@ interface GatewayElement {
62
63
  targets?: Element[];
63
64
  }
64
65
  type Element = ActivityElement | RoutingElement | GatewayElement;
66
+ interface ElementSelectionAPI {
67
+ highlightElement: (elementId: string, type?: "node" | "edge") => boolean;
68
+ clearSelection: () => void;
69
+ getSelectedElements: () => {
70
+ nodes: Node[];
71
+ edges: Edge[];
72
+ };
73
+ }
65
74
  interface ModelerProps {
66
75
  mode?: EditorMode;
67
76
  locale?: string;
68
77
  onConfigureElement?: (element: Element) => void;
69
- onHighlightMethods?: (methods: {
70
- highlightElement: (elementId: string) => void;
71
- highlightElements: (elementIds: string[]) => void;
72
- clearHighlight: () => void;
73
- isElementHighlighted: (elementId: string) => boolean;
74
- getHighlightedElements: () => string[];
75
- }) => void;
78
+ onSelectionAPIReady?: (api: ElementSelectionAPI) => void;
76
79
  }
77
80
 
78
81
  declare const Modeler: (props: ModelerProps) => react_jsx_runtime.JSX.Element;
79
- interface HighlightMethods {
80
- highlightElement: (elementId: string) => void;
81
- highlightElements: (elementIds: string[]) => void;
82
- clearHighlight: () => void;
83
- isElementHighlighted: (elementId: string) => boolean;
84
- getHighlightedElements: () => string[];
85
- }
86
82
 
87
- export { ActivityVariant, ComplexVariant, EditorMode, type Element, ElementType, ExclusiveVariant, GatewayVariant, type HighlightMethods, Modeler, type ModelerProps, RoutingVariant };
83
+ export { ActivityVariant, ComplexVariant, EditorMode, type Element, type ElementSelectionAPI, ElementType, ExclusiveVariant, GatewayVariant, Modeler, type ModelerProps, RoutingVariant };