umlimator 0.17.0 → 0.19.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.
- package/README.md +47 -7
- package/lib/umlimator-all.js +3630 -347
- package/lib/umlimator.d.ts +54 -4
- package/lib/umlimator.js +302 -347
- package/lib/umlimator.schema.json +218 -9
- package/package.json +1 -1
package/lib/umlimator.d.ts
CHANGED
|
@@ -48,11 +48,57 @@ 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`.
|
|
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); other types draw as plain cards.
|
|
52
|
+
* From 0.19.0 those three 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;
|
|
55
57
|
}
|
|
58
|
+
/** The class diagram's vocabulary (a view with `diagram: 'uml.class'`, drawn by umlimator/all from 0.18.0;
|
|
59
|
+
* docs/conformance/uml-class.md). These describe what `type` and `props` hold; validate() reports what breaks the type's
|
|
60
|
+
* rules, and a field written otherwise is kept as it is. */
|
|
61
|
+
export type UmlClassElementType = 'uml.Class' | 'uml.Interface' | 'uml.Enumeration' | 'uml.DataType' | 'uml.PrimitiveType' | 'uml.Package' | 'uml.Comment';
|
|
62
|
+
export type UmlClassMemberType = 'uml.Property' | 'uml.Operation' | 'uml.EnumerationLiteral';
|
|
63
|
+
/** From the client to the supplier: a generalization from the specific to the general, a realization to the interface,
|
|
64
|
+
* a comment link from the comment. */
|
|
65
|
+
export type UmlClassLineType = 'uml.Association' | 'uml.Generalization' | 'uml.InterfaceRealization' | 'uml.Dependency' | 'uml.CommentLink';
|
|
66
|
+
export type UmlVisibility = 'public' | 'private' | 'protected' | 'package';
|
|
67
|
+
/** A classifier's or a package's props. Stereotypes are drawn «in guillemets»; any UML element or line may have them. */
|
|
68
|
+
export interface UmlClassifierProps { isAbstract?: boolean; stereotypes?: string[]; [key: string]: unknown }
|
|
69
|
+
/** An attribute's props: its UML text `+ {static} /total: Money [1] = 0` as fields. Types and defaults are text. */
|
|
70
|
+
export interface UmlPropertyProps { visibility?: UmlVisibility; valueType?: string; multiplicity?: string; default?: string; isStatic?: boolean; isDerived?: boolean; stereotypes?: string[]; [key: string]: unknown }
|
|
71
|
+
/** An operation's props: `+ {static} place(at: Date, in qty: Int): Order` as fields. */
|
|
72
|
+
export interface UmlOperationProps {
|
|
73
|
+
visibility?: UmlVisibility; parameters?: { name: string; valueType?: string; direction?: 'in' | 'out' | 'inout' | 'return' }[];
|
|
74
|
+
returnType?: string; isStatic?: boolean; isAbstract?: boolean; stereotypes?: string[]; [key: string]: unknown;
|
|
75
|
+
}
|
|
76
|
+
/** One end of an association. A multiplicity is 1, *, n..m or n..*, kept as written; a composite end's is at most 1. */
|
|
77
|
+
export interface UmlAssociationEnd { role?: string; multiplicity?: string; aggregation?: 'none' | 'shared' | 'composite'; navigable?: boolean }
|
|
78
|
+
/** A line's props: an association's two ends, and stereotypes («use» on a dependency). */
|
|
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 }
|
|
99
|
+
/** What a typed view shows of one element, in its `present` by the element's id: compartments not drawn, divider and
|
|
100
|
+
* all, and at most `rows` rows in each, then "+k more". */
|
|
101
|
+
export interface UmlPresent { collapsed?: ('attributes' | 'operations' | 'literals')[]; rows?: number }
|
|
56
102
|
/** What a line means, drawn as its colour: calls (the default), feeds (hands work on), triggers (suggests, offers, fires),
|
|
57
103
|
* state (reads or writes a file, board or config: a thinner line, a muted label, no flow) and guard (a hook steps in).
|
|
58
104
|
* Colours are --um-w-<kind>. An edge's `style` (emphasis, dashed, security) wins over its kind's colour. */
|
|
@@ -371,7 +417,9 @@ export function migrate<M extends MapModel>(model: M): M;
|
|
|
371
417
|
export type Command =
|
|
372
418
|
| { op: 'set'; id: string; path: string | string[]; value: unknown }
|
|
373
419
|
| { op: 'set'; view: string; path: string | string[]; value: unknown }
|
|
374
|
-
| { op: 'add'; element: { id: string; [key: string]: unknown }; owner?: string; index?: number; view?: string }
|
|
420
|
+
| { op: 'add'; element: { id: string; [key: string]: unknown }; owner?: string; index?: number; view?: string; in?: 'model' }
|
|
421
|
+
/** 0.18.0: into the view's own list for its kind: a line or an item in `edges`, a node in `nodes`, else `fragments` */
|
|
422
|
+
| { op: 'add'; element: { id: string; [key: string]: unknown }; view: string; index?: number; in: 'view'; owner?: never }
|
|
375
423
|
| { op: 'move'; id: string; index: number; owner?: string; view?: never }
|
|
376
424
|
| { op: 'move'; id: string; view: string; index: number; owner?: never }
|
|
377
425
|
| { op: 'hide'; id: string; view: string }
|
|
@@ -380,11 +428,13 @@ export type Command =
|
|
|
380
428
|
/** The model after a transaction: one command, or a list run in order, on a copy (0.17.0). A command that cannot run
|
|
381
429
|
* throws, and none of the transaction is applied. `delete` takes with it the element's members, what it owns, the lines
|
|
382
430
|
* to them and every place that names them (references()); one already gone in the same transaction is passed over.
|
|
383
|
-
* `hide` takes it out of one view with all the view says of it. Undo is the model before: keep it with history().
|
|
431
|
+
* `hide` takes it out of one view with all the view says of it. Undo is the model before: keep it with history().
|
|
432
|
+
* From 0.18.0 `delete` gives what the element held and that stays its nearest owner left, and a diagram type's declared
|
|
433
|
+
* references cascade (a reply with its call) or drop (an id out of a list). */
|
|
384
434
|
export function apply<M extends MapModel>(model: M, commands: Command | Command[]): M;
|
|
385
435
|
/** Where a model names an element, other than the element itself (0.17.0): the keys from the model down to the place
|
|
386
436
|
* (['views', 0, 'nodeIds', 2]) and what it is: 'end', 'parent', 'part', 'view', 'pin', 'present', 'override',
|
|
387
|
-
* 'subject', 'story', 'lens' or '
|
|
437
|
+
* 'subject', 'story', 'lens', 'rule' or (0.18.0) 'prop', a property a diagram type declares; later releases may add kinds. */
|
|
388
438
|
export interface Reference { path: (string | number)[]; kind: string }
|
|
389
439
|
export function references(model: MapModel, id: string): Reference[];
|
|
390
440
|
/** One issue of the layout check: its message, as the page's check words it, and the cards, lines and boxes it is about
|