blob: bff2dc254ebe3aa4ed48b8227d05dc69b6fbf600 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
/**
* wmap format Wardley Map parser.
* @param {string} source - The wmap source code to parse
* @returns {Map} - Parsed map with separate arrays for each entity type
*/
export function parse(source: string): Map;
/**
* A parsed wardley map.
*/
export type Map = {
/**
* - List of components
*/
components: Component[];
/**
* - List of dependencies
*/
dependencies: Dependency[];
/**
* - List of notes
*/
notes: Note[];
/**
* - List of stages
*/
stages: Stage[];
/**
* - List of groups
*/
groups: Group[];
/**
* - List of inertias
*/
inertias: Inertia[];
/**
* - List of evolutions
*/
evolutions: Evolution[];
};
/**
* Any of the potential shapes in a component.
*/
export type Shape = "x" | "square" | "triangle" | "circle";
/**
* A component in the map.
*/
export type Component = {
/**
* - Component label
*/
label: string;
/**
* - X and Y coordinates
*/
coordinates: [number, number];
/**
* - Shape of the component
*/
shape: Shape;
};
/**
* A dependency between two components.
*/
export type Dependency = {
/**
* - Source component label
*/
from: string;
/**
* - Target component label
*/
to: string;
/**
* - Whether the dependency is directed (->) or undirected (--)
*/
isDirected: boolean;
};
/**
* A note.
*/
export type Note = {
/**
* - X and Y coordinates
*/
coordinates: [number, number];
/**
* - Note text content
*/
text: string;
};
/**
* An override for the width of an evolution stage.
*/
export type Stage = {
/**
* - Stage number (i, ii, iii, iv)
*/
stage: string;
/**
* - Stage value
*/
value: number;
};
/**
* A group of components.
*/
export type Group = {
/**
* - Array of component labels in the group
*/
components: string[];
};
/**
* Inertia associated with a component.
*/
export type Inertia = {
/**
* - Component label with inertia
*/
component: string;
};
/**
* Evolution associated with a component.
*/
export type Evolution = {
/**
* - Component label
*/
component: string;
/**
* - Evolution value
*/
value: number;
};
|