umlimator 0.18.0 → 0.20.0

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.
@@ -48,7 +48,9 @@ export interface MapNode {
48
48
  /** A typed element in schema version 2's envelope (docs/diagrams/model.md §1): a node, a member, a typed edge, a
49
49
  * fragment. Nodes, edges, members and fragments share one id space; an id never contains "->". A typed edge is an
50
50
  * Element with `from` and `to`, which may name a member. A typed view is a MapView with `diagram` (uml.class), and may
51
- * have `subject`, `direction` ('right' | 'down'), `notation`, `present`, `fragments` and `timeline`. umlimator/all draws `uml.class` (0.18.0); other types draw as plain cards. */
51
+ * have `subject`, `direction` ('right' | 'down'), `notation`, `present`, `fragments` and `timeline`. umlimator/all draws `uml.class` (0.18.0), `uml.object` and `uml.package` (0.19.0), `uml.sequence` and `uml.communication` (0.20.0); other types draw as plain cards.
52
+ * From 0.19.0 the class, object and package types draw a shown package that owns something the view shows as a box holding it (`parent`), and
53
+ * qualify names (`sales::Order`) from the nearest shown owner, the view's `subject`, or the top. */
52
54
  export interface Element {
53
55
  id: string; type: string; label?: string; parent?: string; props?: Record<string, unknown>; members?: Element[];
54
56
  [key: string]: unknown;
@@ -75,9 +77,55 @@ export interface UmlOperationProps {
75
77
  export interface UmlAssociationEnd { role?: string; multiplicity?: string; aggregation?: 'none' | 'shared' | 'composite'; navigable?: boolean }
76
78
  /** A line's props: an association's two ends, and stereotypes («use» on a dependency). */
77
79
  export interface UmlLineProps { ends?: { from?: UmlAssociationEnd; to?: UmlAssociationEnd }; stereotypes?: string[]; [key: string]: unknown }
80
+ /** The object diagram's vocabulary (a view with `diagram: 'uml.object'`, umlimator/all from 0.19.0;
81
+ * docs/conformance/uml-object.md). An instance with no `label` is anonymous (drawn `: Order`); a slot's `label` is the
82
+ * feature it gives a value. A classifier node an object view shows is drawn as in a class view. */
83
+ export type UmlObjectElementType = 'uml.InstanceSpecification' | 'uml.Package' | 'uml.Comment';
84
+ export type UmlObjectMemberType = 'uml.Slot';
85
+ export type UmlObjectLineType = 'uml.Link' | 'uml.CommentLink';
86
+ /** An instance's props: its classifier by name or qualified name, as text (docs/diagrams/risks.md M8). */
87
+ export interface UmlInstanceProps { classifier?: string; stereotypes?: string[]; [key: string]: unknown }
88
+ /** A slot's props: its value as text; with none, the slot is drawn by its feature alone. */
89
+ export interface UmlSlotProps { value?: string; [key: string]: unknown }
90
+ /** A link's props: the association it is an instance of, by name, and the roles at its ends. */
91
+ export interface UmlLinkProps { association?: string; ends?: { from?: { role?: string }; to?: { role?: string } }; stereotypes?: string[]; [key: string]: unknown }
92
+ /** The package diagram's vocabulary (a view with `diagram: 'uml.package'`, umlimator/all from 0.19.0;
93
+ * docs/conformance/uml-package.md): packages and the class diagram's classifiers, drawn by their names. An import or
94
+ * a merge runs from the importing or merging package. */
95
+ export type UmlPackageElementType = 'uml.Package' | 'uml.Class' | 'uml.Interface' | 'uml.Enumeration' | 'uml.DataType' | 'uml.PrimitiveType' | 'uml.Comment';
96
+ export type UmlPackageLineType = 'uml.PackageImport' | 'uml.PackageMerge' | 'uml.Dependency' | 'uml.CommentLink';
97
+ /** A package import's props: public (the default) is drawn «import», private «access». */
98
+ export interface UmlPackageImportProps { visibility?: 'public' | 'private'; stereotypes?: string[]; [key: string]: unknown }
78
99
  /** What a typed view shows of one element, in its `present` by the element's id: compartments not drawn, divider and
79
100
  * all, and at most `rows` rows in each, then "+k more". */
80
101
  export interface UmlPresent { collapsed?: ('attributes' | 'operations' | 'literals')[]; rows?: number }
102
+ /** The sequence diagram's vocabulary (a view with `diagram: 'uml.sequence'`, umlimator/all from 0.20.0;
103
+ * docs/conformance/uml-sequence.md). Lifelines are model nodes the view lists in `nodeIds`, left to right. Messages and
104
+ * interaction uses are inline in the view's `edges`, in time order; a fragment's content is one run there, operand by
105
+ * operand. Combined fragments are in the view's `fragments`, each with its operands as `members`; an occurrence's or a
106
+ * fragment's `parent` is the operand that holds it. Activations and message numbers are derived, never stored. */
107
+ export type UmlSequenceElementType = 'uml.Lifeline' | 'uml.InteractionUse' | 'uml.CombinedFragment';
108
+ export type UmlSequenceMemberType = 'uml.InteractionOperand';
109
+ export type UmlSequenceLineType = 'uml.Message';
110
+ /** A lifeline's props: what it represents, by name, as text (drawn `name : Type`); stereotype `actor` draws «actor». */
111
+ export interface UmlLifelineProps { represents?: string; stereotypes?: string[]; [key: string]: unknown }
112
+ /** A message's kind: a call (filled arrow, the default), async (open arrow), reply (dashed, open), create (dashed, open;
113
+ * the receiver's head is lowered to it) or delete (the receiver's stem ends in a cross). */
114
+ export type UmlMessageSort = 'call' | 'async' | 'reply' | 'create' | 'delete';
115
+ /** A message's props: its sort; a reply's `replyTo`, the id of the earlier call it answers. */
116
+ export interface UmlMessageProps { sort?: UmlMessageSort; replyTo?: string; stereotypes?: string[]; [key: string]: unknown }
117
+ /** An interaction use's props: the lifelines it covers (next to each other in `nodeIds`), and the view it refers to. */
118
+ export interface UmlInteractionUseProps { covers?: string[]; refersTo?: string; [key: string]: unknown }
119
+ /** A combined fragment's operator; any other is drawn by its name, with a warning. opt, loop and break have one operand,
120
+ * whose `label` is its guard. */
121
+ export type UmlInteractionOperator = 'alt' | 'opt' | 'loop' | 'par' | 'break';
122
+ export interface UmlCombinedFragmentProps { operator?: UmlInteractionOperator; [key: string]: unknown }
123
+ /** The communication diagram's vocabulary (a view with `diagram: 'uml.communication'`, umlimator/all from 0.20.0;
124
+ * docs/conformance/uml-communication.md): lifelines; connectors and messages are model edges the view's `edges` lists,
125
+ * connectors first. Only the messages' order means anything; their numbers (1, 1.1, 1.1.2) are derived. A message's
126
+ * props are UmlMessageProps; a message needs a connector between its two lifelines. */
127
+ export type UmlCommunicationElementType = 'uml.Lifeline';
128
+ export type UmlCommunicationLineType = 'uml.Connector' | 'uml.Message';
81
129
  /** What a line means, drawn as its colour: calls (the default), feeds (hands work on), triggers (suggests, offers, fires),
82
130
  * state (reads or writes a file, board or config: a thinner line, a muted label, no flow) and guard (a hook steps in).
83
131
  * Colours are --um-w-<kind>. An edge's `style` (emphasis, dashed, security) wins over its kind's colour. */
@@ -118,7 +166,8 @@ export interface MapEdge {
118
166
  }
119
167
  export interface MapView {
120
168
  id: string; parent?: string | null; title?: string; nodeIds: string[];
121
- edges?: (string | MapEdge)[]; layout?: Record<string, [number, number]>; repair?: boolean;
169
+ /** Model line ids or lines of its own; in a sequence view (0.20.0) its messages and interaction uses (Elements), in time order. */
170
+ edges?: (string | MapEdge | Element)[]; layout?: Record<string, [number, number]>; repair?: boolean;
122
171
  /** Cards 80 px tall that show their sub-line and then their chips (`verbs`) on a third line. Default: 64 px, and a card's
123
172
  * chips take its sub-line's place. A script card (no kind) shows no sub-line either way. */
124
173
  subAndChips?: boolean;