@likec4/core 0.19.0 → 0.20.1
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
|
|
3
|
-
export declare function computeElementView(view:
|
|
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,
|
|
3
|
-
export declare function computeView(view:
|
|
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,
|
|
7
|
+
views: Record<ViewID, V>;
|
|
8
8
|
};
|
|
9
|
-
|
|
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.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
6
6
|
"homepage": "https://likec4.dev",
|
|
@@ -25,35 +25,15 @@
|
|
|
25
25
|
"test:watch": "run -T vitest",
|
|
26
26
|
"clean": "run -T rimraf dist"
|
|
27
27
|
},
|
|
28
|
-
"module": "
|
|
29
|
-
"types": "
|
|
28
|
+
"module": "src/index.ts",
|
|
29
|
+
"types": "src/index.ts",
|
|
30
30
|
"type": "module",
|
|
31
31
|
"exports": {
|
|
32
|
-
".":
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"./types": {
|
|
38
|
-
"types": "./dist/types/index.d.ts",
|
|
39
|
-
"import": "./dist/types/index.js",
|
|
40
|
-
"default": "./dist/types/index.js"
|
|
41
|
-
},
|
|
42
|
-
"./colors": {
|
|
43
|
-
"types": "./dist/colors.d.ts",
|
|
44
|
-
"import": "./dist/colors.js",
|
|
45
|
-
"default": "./dist/colors.js"
|
|
46
|
-
},
|
|
47
|
-
"./utils": {
|
|
48
|
-
"types": "./dist/utils/index.d.ts",
|
|
49
|
-
"import": "./dist/utils/index.js",
|
|
50
|
-
"default": "./dist/utils/index.js"
|
|
51
|
-
},
|
|
52
|
-
"./compute-view": {
|
|
53
|
-
"types": "./dist/compute-view/index.d.ts",
|
|
54
|
-
"import": "./dist/compute-view/index.js",
|
|
55
|
-
"default": "./dist/compute-view/index.js"
|
|
56
|
-
}
|
|
32
|
+
".": "./src/index.ts",
|
|
33
|
+
"./colors": "./src/colors.ts",
|
|
34
|
+
"./types": "./src/types/index.ts",
|
|
35
|
+
"./utils": "./src/utils/index.ts",
|
|
36
|
+
"./compute-view": "./src/compute-view/index.ts"
|
|
57
37
|
},
|
|
58
38
|
"sideEffects": false,
|
|
59
39
|
"publishConfig": {
|
|
@@ -97,4 +77,4 @@
|
|
|
97
77
|
"devDependencies": {
|
|
98
78
|
"typescript": "^5.1.3"
|
|
99
79
|
}
|
|
100
|
-
}
|
|
80
|
+
}
|