aboutsummaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorRuben Beltran del Rio <jj@r.bdr.sh>2025-12-15 12:04:57 +0100
committerRuben Beltran del Rio <jj@r.bdr.sh>2025-12-15 22:16:29 +0100
commit8daa7da7acc6809056249261ad50cd3896625886 (patch)
tree8f81dfc4f2b0c33a953622e97c18a5712dddb8ba /dist
parentcd3d83d8a852d98e934ebc13b067e0971e30a995 (diff)
Add types, update license style, and readme links
Diffstat (limited to 'dist')
-rw-r--r--dist/index.d.ts134
1 files changed, 134 insertions, 0 deletions
diff --git a/dist/index.d.ts b/dist/index.d.ts
new file mode 100644
index 0000000..bff2dc2
--- /dev/null
+++ b/dist/index.d.ts
@@ -0,0 +1,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;
+};