sp-svg-diagram 1.2.4 → 1.2.6

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 (2) hide show
  1. package/index.d.ts +87 -0
  2. package/package.json +2 -1
package/index.d.ts ADDED
@@ -0,0 +1,87 @@
1
+ declare module 'sp-svg-diagram' {
2
+
3
+ function _compareSVG(a: string, b: string): boolean
4
+ const NODE_SHAPE_NONE: string
5
+ const NODE_SHAPE_CIRCLE: string
6
+ const NODE_SHAPE_DOUBLE_CIRCLE: string
7
+ const NODE_SHAPE_RECT: string
8
+ const NODE_SHAPE_ELLIPSE: string
9
+ const EDGE_SPLINES_LINE: string
10
+ const EDGE_SPLINES_SPLINE: string
11
+ const ARROW_SHAPE_NONE: string
12
+ const ARROW_SHAPE_NORMAL: string
13
+ const ARROW_SHAPE_EMPTY: string
14
+
15
+ export class SVGItem {
16
+ constructor()
17
+ setID(itemId: string): void
18
+ setLabel(label: string): void
19
+ setFixedSize(width: number, height: number): void
20
+ setTextSize(width: number, height: number): void
21
+ setMargin(x: number, y: number): void
22
+ setColor(color: string): void
23
+ setFillColor(color: string): void
24
+ setFontColor(color: string): void
25
+ setPenWidth(width: number): void
26
+ setFontName(name: string): void
27
+ setFontSize(size: number): void
28
+ setFont(name: string, size: number): void
29
+ setStyle(style: string): void
30
+ appendStyleSolid(): void
31
+ appendStyleDashed(): void
32
+ appendStyleDotted(): void
33
+ setGradientAngle(angle: number): void
34
+ delete(): void
35
+ }
36
+
37
+ export class SVGNode extends SVGItem {
38
+ constructor()
39
+ static SHAPE_NONE: string
40
+ static SHAPE_CIRCLE: string
41
+ static SHAPE_DOUBLE_CIRCLE: string
42
+ static SHAPE_RECT: string
43
+ static SHAPE_ELLIPSE: string
44
+ setCenter(cx: number, cy: number): void
45
+ setShape(shape: string): void
46
+ }
47
+
48
+ export class SVGEdge extends SVGItem {
49
+ constructor()
50
+ static SPLINES_LINE: string
51
+ static SPLINES_SPLINE: string
52
+ static ARROW_NONE: string
53
+ static ARROW_NORMAL: string
54
+ static ARROW_EMPTY: string
55
+ setConnection(nodeFromId: string, nodeToId: string): void
56
+ setSplines(splines: string): void
57
+ addConnectionPoint(x: number, y: number): void
58
+ setArrowHead(arrow?: string): void
59
+ setArrowTail(arrow?: string): void
60
+ _setArrowHead(arrow: string): void
61
+ _setArrowTail(arrow: string): void
62
+ }
63
+
64
+ export class SVGGraph extends SVGItem {
65
+ constructor()
66
+ defaultNodeAttributes(): SVGNode
67
+ defaultNodeAttributes(): SVGEdge
68
+ addNode(nodeId: string): SVGNode
69
+ addEdge(edgeId: string): SVGEdge
70
+ addSubgraph(graphId: string): SVGGraph
71
+ }
72
+
73
+ export class SVGDiagram {
74
+ constructor()
75
+ setBackgroundColor(color: string): void
76
+ setFixedViewBox(x: number, y: number, width: number, height: number): void
77
+ setRotation(angle: number): void
78
+ addNode(nodeId: string): SVGNode
79
+ addEdge(edgeId: string): SVGEdge
80
+ addSubgraph(graphId: string): SVGGraph
81
+ render(): string
82
+ }
83
+
84
+ export function createSVGNode(nodeId: string): SVGNode
85
+ export function createSVGEdge(edgeId: string): SVGEdge
86
+ export function createSVGGraph(graphId: string): SVGGraph
87
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "sp-svg-diagram",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "files": [
8
8
  "index.js",
9
+ "index.d.ts",
9
10
  "wasm/SVGDiagramWASM.js",
10
11
  "wasm/SVGDiagramWASM.wasm"
11
12
  ],