@agilewallaby/c4-model 2.7.0 → 2.8.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.
@@ -0,0 +1,3 @@
1
+ import { Model } from './model';
2
+ import { Views } from './views';
3
+ export declare function validateModel(model: Model, views: Views): Promise<void>;
package/src/views.d.ts CHANGED
@@ -6,33 +6,94 @@ interface ViewDefinition<T extends Element> {
6
6
  description: string;
7
7
  title?: string;
8
8
  }
9
+ export type AutoLayoutDirection = 'tb' | 'bt' | 'lr' | 'rl';
10
+ export interface AutoLayout {
11
+ direction?: AutoLayoutDirection;
12
+ rankSeparation?: number;
13
+ nodeSeparation?: number;
14
+ }
15
+ export type ElementShape = 'Box' | 'RoundedBox' | 'Circle' | 'Ellipse' | 'Hexagon' | 'Diamond' | 'Cylinder' | 'Bucket' | 'Pipe' | 'Person' | 'Robot' | 'Folder' | 'WebBrowser' | 'Window' | 'Terminal' | 'Shell' | 'MobileDevicePortrait' | 'MobileDeviceLandscape' | 'Component';
16
+ export interface ElementStyleDefinition {
17
+ shape?: ElementShape;
18
+ icon?: string;
19
+ width?: number;
20
+ height?: number;
21
+ background?: string;
22
+ color?: string;
23
+ stroke?: string;
24
+ strokeWidth?: number;
25
+ fontSize?: number;
26
+ border?: 'solid' | 'dashed' | 'dotted';
27
+ opacity?: number;
28
+ metadata?: boolean;
29
+ description?: boolean;
30
+ }
31
+ export interface RelationshipStyleDefinition {
32
+ thickness?: number;
33
+ color?: string;
34
+ style?: 'solid' | 'dashed' | 'dotted';
35
+ routing?: 'Direct' | 'Orthogonal' | 'Curved';
36
+ fontSize?: number;
37
+ width?: number;
38
+ position?: number;
39
+ opacity?: number;
40
+ }
41
+ export interface ElementStyleEntry {
42
+ tag: string;
43
+ definition: ElementStyleDefinition;
44
+ }
45
+ export interface RelationshipStyleEntry {
46
+ tag: string;
47
+ definition: RelationshipStyleDefinition;
48
+ }
9
49
  export declare class View<T extends Element> {
10
50
  readonly key: string;
11
51
  readonly subject?: T;
12
52
  readonly description: string;
13
53
  readonly title?: string;
14
54
  private _scopes;
55
+ private _autoLayout?;
56
+ private _isDefault;
57
+ private _properties;
15
58
  constructor(key: string, viewDefinition: ViewDefinition<T>);
16
59
  includeAll(): void;
17
- includeElement(element: T): void;
60
+ includeElement(element: Element): void;
18
61
  includeExpression(expression: string): void;
19
62
  excludeAll(): void;
20
- excludeElement(element: T): void;
63
+ excludeElement(element: Element): void;
21
64
  excludeExpression(expression: string): void;
65
+ autoLayout(direction?: AutoLayoutDirection, rankSeparation?: number, nodeSeparation?: number): void;
66
+ setDefault(): void;
67
+ addProperty(name: string, value: string): void;
22
68
  get scopes(): ReadonlyArray<string>;
69
+ get autoLayoutConfig(): AutoLayout | undefined;
70
+ get isDefault(): boolean;
71
+ get properties(): ReadonlyMap<string, string>;
23
72
  }
24
73
  export declare class Views {
25
74
  private readonly _systemLandscapeViews;
26
75
  private readonly _systemContextViews;
27
76
  private readonly _containerViews;
28
77
  private readonly _componentViews;
78
+ private _elementStyles;
79
+ private _relationshipStyles;
80
+ private _themes;
81
+ private _properties;
29
82
  addSystemLandscapeView(key: string, definition: ViewDefinition<Element>): View<Element>;
30
83
  addSystemContextView(key: string, definition: ViewDefinition<SoftwareSystem>): View<SoftwareSystem>;
31
84
  addContainerView(key: string, definition: ViewDefinition<SoftwareSystem>): View<SoftwareSystem>;
32
85
  addComponentView(key: string, definition: ViewDefinition<Container>): View<Container>;
86
+ addElementStyle(tag: string, definition: ElementStyleDefinition): void;
87
+ addRelationshipStyle(tag: string, definition: RelationshipStyleDefinition): void;
88
+ addTheme(url: string): void;
89
+ addProperty(name: string, value: string): void;
33
90
  get systemLandscapeViews(): ReadonlyArray<View<Element>>;
34
91
  get systemContextViews(): ReadonlyArray<View<SoftwareSystem>>;
35
92
  get containerViews(): ReadonlyArray<View<SoftwareSystem>>;
36
93
  get componentViews(): ReadonlyArray<View<Container>>;
94
+ get elementStyles(): ReadonlyArray<ElementStyleEntry>;
95
+ get relationshipStyles(): ReadonlyArray<RelationshipStyleEntry>;
96
+ get themes(): ReadonlyArray<string>;
97
+ get properties(): ReadonlyMap<string, string>;
37
98
  }
38
99
  export {};