@likec4/core 0.19.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.
@@ -1,4 +1,4 @@
1
1
  import type { ModelIndex } from '../model-index';
2
- import { type ElementView, type ComputedView } from '../types';
3
- export declare function computeElementView(view: ElementView, index: ModelIndex): ComputedView;
2
+ import { type ElementView, type ComputeResult } from '../types';
3
+ export declare function computeElementView<V extends ElementView>(view: V, index: ModelIndex): ComputeResult<V>;
4
4
  //# sourceMappingURL=compute-element-view.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { anyPass, filter, head, uniq, isNil } from 'rambdax';
2
- import { DefaultThemeColor, DefaultElementShape } from '../types';
2
+ import { DefaultThemeColor, DefaultElementShape, } from '../types';
3
3
  import * as Expression from '../types/expression';
4
4
  import { isViewRuleAutoLayout, isViewRuleExpression, isViewRuleStyle } from '../types/view';
5
5
  import { compareByFqnHierarchically, failExpectedNever, ignoreNeverInRuntime, isAncestor, isSameHierarchy, parentFqn, Relations } from '../utils';
@@ -1,11 +1,16 @@
1
1
  import { ModelIndex } from '../model-index';
2
- import type { Element, ElementView, Fqn, LikeC4Model, Relation, ComputedView, RelationID, ViewID } from '../types';
3
- export declare function computeView(view: ElementView, index: ModelIndex): ComputedView;
4
- type InputModel = {
2
+ import type { Element, ElementView, Fqn, Relation, RelationID, ViewID, ComputeResult } from '../types';
3
+ export declare function computeView<V extends ElementView>(view: V, index: ModelIndex): ComputeResult<V>;
4
+ type InputModel<V extends ElementView> = {
5
5
  elements: Record<Fqn, Element>;
6
6
  relations: Record<RelationID, Relation>;
7
- views: Record<ViewID, ElementView>;
7
+ views: Record<ViewID, V>;
8
8
  };
9
- export declare function computeViews(model: InputModel): LikeC4Model;
9
+ type OutputModel<V extends ElementView> = {
10
+ elements: Record<Fqn, Element>;
11
+ relations: Record<RelationID, Relation>;
12
+ views: Record<ViewID, ComputeResult<V>>;
13
+ };
14
+ export declare function computeViews<V extends ElementView>(model: InputModel<V>): OutputModel<V>;
10
15
  export {};
11
16
  //# sourceMappingURL=compute.d.ts.map
@@ -30,4 +30,5 @@ export interface ComputedView<Node extends ComputedNode = ComputedNode, Edge ext
30
30
  nodes: Node[];
31
31
  edges: Edge[];
32
32
  }
33
+ export type ComputeResult<V extends ElementView> = V & Pick<ComputedView, 'autoLayout' | 'nodes' | 'edges'>;
33
34
  //# sourceMappingURL=computed-view.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@likec4/core",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "license": "MIT",
5
5
  "bugs": "https://github.com/likec4/likec4/issues",
6
6
  "homepage": "https://likec4.dev",