diff options
Diffstat (limited to 'dist')
| -rw-r--r-- | dist/index.d.ts | 134 |
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; +}; |