@lionweb/core 0.6.13-beta.7 → 0.7.0-alpha.10
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/CHANGELOG.md +29 -7
- package/dist/deserializer.d.ts +18 -9
- package/dist/deserializer.d.ts.map +1 -1
- package/dist/deserializer.js +40 -43
- package/dist/deserializer.js.map +1 -1
- package/dist/dynamic-facade.d.ts +15 -6
- package/dist/dynamic-facade.d.ts.map +1 -1
- package/dist/dynamic-facade.js +13 -5
- package/dist/dynamic-facade.js.map +1 -1
- package/dist/extraction.d.ts +15 -0
- package/dist/extraction.d.ts.map +1 -0
- package/dist/extraction.js +17 -0
- package/dist/extraction.js.map +1 -0
- package/dist/functions.d.ts +4 -3
- package/dist/functions.d.ts.map +1 -1
- package/dist/functions.js +1 -1
- package/dist/functions.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/m1/reference-utils.d.ts +7 -7
- package/dist/m1/reference-utils.d.ts.map +1 -1
- package/dist/m1/reference-utils.js +10 -10
- package/dist/m1/reference-utils.js.map +1 -1
- package/dist/m3/builtins.d.ts +38 -17
- package/dist/m3/builtins.d.ts.map +1 -1
- package/dist/m3/builtins.js +66 -44
- package/dist/m3/builtins.js.map +1 -1
- package/dist/m3/constraints.d.ts.map +1 -1
- package/dist/m3/constraints.js +10 -5
- package/dist/m3/constraints.js.map +1 -1
- package/dist/m3/deserializer.d.ts +3 -3
- package/dist/m3/deserializer.d.ts.map +1 -1
- package/dist/m3/deserializer.js +4 -4
- package/dist/m3/deserializer.js.map +1 -1
- package/dist/m3/facade.d.ts +13 -4
- package/dist/m3/facade.d.ts.map +1 -1
- package/dist/m3/facade.js +17 -9
- package/dist/m3/facade.js.map +1 -1
- package/dist/m3/factory.d.ts +2 -2
- package/dist/m3/factory.d.ts.map +1 -1
- package/dist/m3/factory.js.map +1 -1
- package/dist/m3/functions.d.ts +33 -12
- package/dist/m3/functions.d.ts.map +1 -1
- package/dist/m3/functions.js +32 -14
- package/dist/m3/functions.js.map +1 -1
- package/dist/m3/index.d.ts +1 -0
- package/dist/m3/index.d.ts.map +1 -1
- package/dist/m3/index.js +1 -0
- package/dist/m3/index.js.map +1 -1
- package/dist/m3/lioncore.d.ts +2 -0
- package/dist/m3/lioncore.d.ts.map +1 -1
- package/dist/m3/lioncore.js +25 -60
- package/dist/m3/lioncore.js.map +1 -1
- package/dist/m3/reference-checker.d.ts.map +1 -1
- package/dist/m3/reference-checker.js +2 -2
- package/dist/m3/reference-checker.js.map +1 -1
- package/dist/m3/serializer.d.ts +2 -2
- package/dist/m3/serializer.d.ts.map +1 -1
- package/dist/m3/serializer.js +3 -3
- package/dist/m3/serializer.js.map +1 -1
- package/dist/m3/types.d.ts +26 -21
- package/dist/m3/types.d.ts.map +1 -1
- package/dist/m3/types.js +9 -4
- package/dist/m3/types.js.map +1 -1
- package/dist/reading.d.ts +45 -0
- package/dist/reading.d.ts.map +1 -0
- package/dist/reading.js +2 -0
- package/dist/reading.js.map +1 -0
- package/dist/references.d.ts +3 -3
- package/dist/references.d.ts.map +1 -1
- package/dist/serializer.d.ts +31 -10
- package/dist/serializer.d.ts.map +1 -1
- package/dist/serializer.js +111 -109
- package/dist/serializer.js.map +1 -1
- package/dist/symbol-table.d.ts +15 -15
- package/dist/symbol-table.d.ts.map +1 -1
- package/dist/symbol-table.js +2 -9
- package/dist/symbol-table.js.map +1 -1
- package/dist/types.d.ts +2 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -6
- package/dist/types.js.map +1 -1
- package/dist/writing.d.ts +49 -0
- package/dist/writing.d.ts.map +1 -0
- package/dist/writing.js +30 -0
- package/dist/writing.js.map +1 -0
- package/package.json +13 -7
- package/dist/facade.d.ts +0 -84
- package/dist/facade.d.ts.map +0 -1
- package/dist/facade.js +0 -41
- package/dist/facade.js.map +0 -1
- package/dist/serialization.d.ts +0 -52
- package/dist/serialization.d.ts.map +0 -1
- package/dist/serialization.js +0 -7
- package/dist/serialization.js.map +0 -1
- package/dist/utils/array-helpers.d.ts +0 -14
- package/dist/utils/array-helpers.d.ts.map +0 -1
- package/dist/utils/array-helpers.js +0 -15
- package/dist/utils/array-helpers.js.map +0 -1
- package/dist/utils/cycles.d.ts +0 -8
- package/dist/utils/cycles.d.ts.map +0 -1
- package/dist/utils/cycles.js +0 -26
- package/dist/utils/cycles.js.map +0 -1
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -7
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/map-helpers.d.ts +0 -26
- package/dist/utils/map-helpers.d.ts.map +0 -1
- package/dist/utils/map-helpers.js +0 -41
- package/dist/utils/map-helpers.js.map +0 -1
- package/dist/utils/recursion.d.ts +0 -13
- package/dist/utils/recursion.d.ts.map +0 -1
- package/dist/utils/recursion.js +0 -21
- package/dist/utils/recursion.js.map +0 -1
- package/dist/utils/sorting.d.ts +0 -7
- package/dist/utils/sorting.d.ts.map +0 -1
- package/dist/utils/sorting.js +0 -7
- package/dist/utils/sorting.js.map +0 -1
- package/dist/utils/string-mapping.d.ts +0 -6
- package/dist/utils/string-mapping.d.ts.map +0 -1
- package/dist/utils/string-mapping.js +0 -10
- package/dist/utils/string-mapping.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.7.0
|
|
4
4
|
|
|
5
5
|
* Fix [bug #203](https://github.com/LionWeb-io/lionweb-typescript/issues/203).
|
|
6
6
|
* (Fix that running setup on the test package for a second time fails.)
|
|
7
|
-
|
|
7
|
+
* Extract utility functions to `@lionweb/ts-utils`, and `Id` (as `LionWebId`) to `@lionweb/json`.
|
|
8
|
+
* Errors thrown by the built-in `DefaultPrimitiveTypeDeserializer` and `DefaultPrimitiveTypeSerializer` are improved to say what `Property` they pertain to.
|
|
9
|
+
* Fix that `PrimitiveTypeSerializer.serializeValue` returns `undefined` instead of `null` – which is according to spec – for an empty property value.
|
|
10
|
+
* Fix misspellings of “data type” including camel-cased versions, particularly:
|
|
11
|
+
* Classes `Datatype[Register]` → `DataType[Register]`, which are part of the LionCore built-ins or the infrastructure around that.
|
|
12
|
+
The original class `Datatype` is kept in a backward compatible way (by extending from the renamed class), and is to be deprecated and removed at some point.
|
|
13
|
+
* Members `{string|boolean|integer|json}Datatype` of `builtinPrimitives` → `<*>DataType` with the former kept as aliases – to be deprecated and removed at some point.
|
|
14
|
+
* Remove type `BuiltinPrimitive` that couldn't really be used sensibly anywhere.
|
|
15
|
+
* Introduce interface `PropertyValueSerializer` that will replace `PrimitiveTypeSerializer` – which is kept for backward compatibility, for now – in the next major release.
|
|
16
|
+
This includes:
|
|
17
|
+
* Introduce class `BuiltinsPropertyValueSerializer` as a future replacement for `DefaultPrimitiveTypeSerializer`.
|
|
18
|
+
* Introduce field `SerializationOptions.propertyValueSerializer` as a future replacement for `SerializationOptions.primitiveTypeSerializer`.
|
|
19
|
+
* Introduce interface `PropertyValueDeserializer` that will replace `PrimitiveTypeDeserializer` – which is kept for backward compatibility, for now – in the next major release.
|
|
20
|
+
This includes introducing class `BuiltinsPropertyValueDeserializer` as a future replacement for `DefaultPrimitiveTypeDeserializer`.
|
|
21
|
+
* Introduce a function `nodeSerializer` that takes configuration consisting of an `ExtractionFacade` instance and an optional configuration object, and returns a function that takes (an array of) nodes and returns a serialization chunk.
|
|
22
|
+
**Note** that this function is essentially experimental, and that its signature might change in the near future!
|
|
23
|
+
* Rename `ExtractionFacade` (and its instances) to `Reader`, keeping aliases for backward compatibility, to be deprecated and removed later.
|
|
24
|
+
* Rename `InstantiationFacade` (and its instances) to `Writer`, keeping aliases for backward compatibility, to be deprecated and removed later.
|
|
25
|
+
* Expose `classifier` and `ikeyed` through `metaConcepts`, and expose `lioncoreReader` and `lioncoreWriter` as well.
|
|
26
|
+
* Added a type parameter `PNT` to the `Writer` interface, which is the type for the parent node passed to the `.nodeFor(...)` method (as its first argument), and which equals the `NT` type parameter by default.
|
|
27
|
+
* Expose functions `areSameClassifiers` and `areSameLanguages` that compare two given classifiers, resp., languages by their meta-pointers.
|
|
28
|
+
* Rename `inheritsFrom` → `inheritsDirectlyFrom`, and `inheritedCycleWith` → `inheritanceCycleWith` for more naming clarity, keeping aliases for backward compatibility, to be deprecated and removed later.
|
|
29
|
+
* Add function `isPartition`.
|
|
8
30
|
|
|
9
31
|
## 0.6.12
|
|
10
32
|
|
|
@@ -31,9 +53,9 @@
|
|
|
31
53
|
|
|
32
54
|
* Add `featureMetaType` function and `FeatureMetaType` type.
|
|
33
55
|
|
|
34
|
-
* Expose `metaPointerFor` function that computes the `
|
|
56
|
+
* Expose `metaPointerFor` function that computes the `LionWebJsonMetaPointer` for a `Feature`.
|
|
35
57
|
|
|
36
|
-
* Expose `IdOrUnresolved` type that expresses a value is either an `
|
|
58
|
+
* Expose `IdOrUnresolved` type that expresses a value is either an `LionWebId` or a value to indicate that resolution to a node previously failed.
|
|
37
59
|
|
|
38
60
|
* Expose `isMultiple` function that determines whether a `Feature` is multi-valued.
|
|
39
61
|
|
|
@@ -49,8 +71,8 @@
|
|
|
49
71
|
|
|
50
72
|
## 0.6.10
|
|
51
73
|
|
|
52
|
-
* Make `DefaultPrimitiveTypeDeserializer` and `DefaultPrimitiveTypeSerializer` be able to deal with duplicate definitions of
|
|
53
|
-
* Expose a function `shouldBeIdentical` that determines whether two
|
|
74
|
+
* Make `DefaultPrimitiveTypeDeserializer` and `DefaultPrimitiveTypeSerializer` be able to deal with duplicate definitions of data types.
|
|
75
|
+
* Expose a function `shouldBeIdentical` that determines whether two data types should be structurally equal based on equality of: meta type, key, and language's key.
|
|
54
76
|
* Make serializer more resilient against unresolved (i.e., `null`-valued) children.
|
|
55
77
|
* Fix that `resolveInfo` of a serialized reference must be `null`, not `undefined`.
|
|
56
78
|
|
|
@@ -75,7 +97,7 @@
|
|
|
75
97
|
* Fix a bug w.r.t. enumeration literals — deserializing changed the keys of enumeration literals in the language's definition.
|
|
76
98
|
* Deserialization doesn't throw on unresolvable references, but warns on the console and returns `null` (which means “unresolved”).
|
|
77
99
|
* Export `byIdMap` function, which computes a map id → thing from an array of things with an `id`, from the package.
|
|
78
|
-
* Make `
|
|
100
|
+
* Make `LionWebJsonProperty.value` `null`-able, to align with the specification.
|
|
79
101
|
|
|
80
102
|
|
|
81
103
|
## 0.6.7
|
package/dist/deserializer.d.ts
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { LionWebJsonChunk } from "@lionweb/json";
|
|
2
|
+
import { Writer } from "./writing.js";
|
|
3
3
|
import { SimplisticHandler } from "./handler.js";
|
|
4
|
-
import {
|
|
4
|
+
import { BuiltinPropertyValueDeserializer } from "./m3/builtins.js";
|
|
5
5
|
import { Language, Property } from "./m3/types.js";
|
|
6
|
-
|
|
6
|
+
import { Node } from "./types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Interface for objects that expose a method to deserialize a property's value.
|
|
9
|
+
*/
|
|
10
|
+
export interface PropertyValueDeserializer {
|
|
7
11
|
deserializeValue(value: string | undefined, property: Property): unknown | undefined;
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
|
-
*
|
|
14
|
+
* Misspelled alias of {@link PropertyValueDeserializer}, kept for backward compatibility, and to be deprecated and removed later.
|
|
15
|
+
*/
|
|
16
|
+
export interface PrimitiveTypeDeserializer extends PropertyValueDeserializer {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @return a deserialization of a {@link LionWebJsonChunk}
|
|
11
20
|
*
|
|
12
21
|
* @param serializationChunk - a {@link SerializedModel model} from its LionWeb serialization JSON format
|
|
13
|
-
* @param
|
|
22
|
+
* @param writer - a {@link Writer} that is used to instantiate nodes and set values on them
|
|
14
23
|
* @param languages - a {@link Language language} that the serialized model is expected to conform to
|
|
15
24
|
* @param dependentNodes - a collection of nodes from dependent models against which all references in the serialized model are supposed to resolve against
|
|
16
|
-
* @param
|
|
25
|
+
* @param propertyValueDeserializer - a deserializer for values of properties (by default a {@link BuiltinPropertyValueDeserializer})
|
|
17
26
|
* @param problemHandler - a handler for reporting problems (by default a {@link defaultSimplisticHandler})
|
|
18
27
|
*/
|
|
19
|
-
export declare const deserializeSerializationChunk: <NT extends Node>(serializationChunk:
|
|
28
|
+
export declare const deserializeSerializationChunk: <NT extends Node>(serializationChunk: LionWebJsonChunk, writer: Writer<NT, NT>, languages: Language[], dependentNodes: Node[], propertyValueDeserializer?: BuiltinPropertyValueDeserializer, problemHandler?: SimplisticHandler) => NT[];
|
|
20
29
|
/**
|
|
21
30
|
* Alias for {@link deserializeSerializationChunk}.
|
|
22
31
|
*/
|
|
23
|
-
export declare const deserializeChunk: <NT extends Node>(serializationChunk:
|
|
32
|
+
export declare const deserializeChunk: <NT extends Node>(serializationChunk: LionWebJsonChunk, writer: Writer<NT, NT>, languages: Language[], dependentNodes: Node[], propertyValueDeserializer?: BuiltinPropertyValueDeserializer, problemHandler?: SimplisticHandler) => NT[];
|
|
24
33
|
//# sourceMappingURL=deserializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deserializer.d.ts","sourceRoot":"","sources":["../src/deserializer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"deserializer.d.ts","sourceRoot":"","sources":["../src/deserializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,gBAAgB,EAGnB,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAA4B,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAA;AAEnE,OAAO,EAAwC,QAAQ,EAAiB,QAAQ,EAAa,MAAM,eAAe,CAAA;AAGlH,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;CACvF;AAED;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,yBAAyB;CAAG;AAE/E;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,wCAClB,gBAAgB,qCAEzB,QAAQ,EAAE,kBAEL,IAAI,EAAE,8BAEK,gCAAgC,mBAC3C,iBAAiB,SA0KpC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,wCAtLL,gBAAgB,qCAEzB,QAAQ,EAAE,kBAEL,IAAI,EAAE,8BAEK,gCAAgC,mBAC3C,iBAAiB,SA+KwB,CAAA"}
|
package/dist/deserializer.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
+
import { currentSerializationFormatVersion } from "@lionweb/json";
|
|
2
|
+
import { byIdMap, groupBy } from "@lionweb/ts-utils";
|
|
1
3
|
import { defaultSimplisticHandler } from "./handler.js";
|
|
4
|
+
import { BuiltinPropertyValueDeserializer } from "./m3/builtins.js";
|
|
5
|
+
import { allFeaturesOf } from "./m3/functions.js";
|
|
6
|
+
import { Classifier, Containment, Enumeration, PrimitiveType, Property, Reference } from "./m3/types.js";
|
|
2
7
|
import { unresolved } from "./references.js";
|
|
3
|
-
import { currentSerializationFormatVersion } from "./serialization.js";
|
|
4
8
|
import { MemoisingSymbolTable } from "./symbol-table.js";
|
|
5
|
-
import { DefaultPrimitiveTypeDeserializer } from "./m3/builtins.js";
|
|
6
|
-
import { Classifier, Containment, Enumeration, PrimitiveType, Property, Reference } from "./m3/types.js";
|
|
7
|
-
import { allFeaturesOf } from "./m3/functions.js";
|
|
8
|
-
import { byIdMap, groupBy } from "./utils/map-helpers.js";
|
|
9
9
|
/**
|
|
10
|
-
* @return a deserialization of a {@link
|
|
10
|
+
* @return a deserialization of a {@link LionWebJsonChunk}
|
|
11
11
|
*
|
|
12
12
|
* @param serializationChunk - a {@link SerializedModel model} from its LionWeb serialization JSON format
|
|
13
|
-
* @param
|
|
13
|
+
* @param writer - a {@link Writer} that is used to instantiate nodes and set values on them
|
|
14
14
|
* @param languages - a {@link Language language} that the serialized model is expected to conform to
|
|
15
15
|
* @param dependentNodes - a collection of nodes from dependent models against which all references in the serialized model are supposed to resolve against
|
|
16
|
-
* @param
|
|
16
|
+
* @param propertyValueDeserializer - a deserializer for values of properties (by default a {@link BuiltinPropertyValueDeserializer})
|
|
17
17
|
* @param problemHandler - a handler for reporting problems (by default a {@link defaultSimplisticHandler})
|
|
18
18
|
*/
|
|
19
|
-
export const deserializeSerializationChunk = (serializationChunk,
|
|
19
|
+
export const deserializeSerializationChunk = (serializationChunk, writer, languages,
|
|
20
20
|
// TODO facades <--> languages, so it's weird that it looks split up like this
|
|
21
21
|
dependentNodes,
|
|
22
|
-
// TODO (#13) see if you can turn this into [nodes: Node[],
|
|
23
|
-
|
|
22
|
+
// TODO (#13) see if you can turn this into [nodes: Node[], writer: Writer<Node>][] after all
|
|
23
|
+
propertyValueDeserializer = new BuiltinPropertyValueDeserializer(), problemHandler = defaultSimplisticHandler) => {
|
|
24
24
|
if (serializationChunk.serializationFormatVersion !== currentSerializationFormatVersion) {
|
|
25
25
|
problemHandler.reportProblem(`can't deserialize from serialization format other than version "${currentSerializationFormatVersion}" - assuming that version`);
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ primitiveTypeDeserializer = new DefaultPrimitiveTypeDeserializer(), problemHandl
|
|
|
29
29
|
const serializedNodeById = byIdMap(serializedNodes);
|
|
30
30
|
const deserializedNodeById = {};
|
|
31
31
|
/**
|
|
32
|
-
* Instantiates a {@link Node} from the given {@link
|
|
32
|
+
* Instantiates a {@link Node} from the given {@link LionWebJsonNode},
|
|
33
33
|
* and stores it under its ID so references to it can be resolved.
|
|
34
34
|
* For every serialized node, only one instance will ever be constructed (through memoisation).
|
|
35
35
|
*/
|
|
@@ -46,7 +46,7 @@ primitiveTypeDeserializer = new DefaultPrimitiveTypeDeserializer(), problemHandl
|
|
|
46
46
|
const referencesToInstall = [];
|
|
47
47
|
const tryInstantiate = (parent, classifier, id, propertySettings) => {
|
|
48
48
|
try {
|
|
49
|
-
return
|
|
49
|
+
return writer.nodeFor(parent, classifier, id, propertySettings);
|
|
50
50
|
}
|
|
51
51
|
catch (e) {
|
|
52
52
|
problemHandler.reportProblem(`error occurred during instantiation of a node for classifier ${classifier.name} with meta-pointer (${classifier.language.key}, ${classifier.language.version}, ${classifier.key}); reason:`);
|
|
@@ -55,7 +55,7 @@ primitiveTypeDeserializer = new DefaultPrimitiveTypeDeserializer(), problemHandl
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
/**
|
|
58
|
-
* Instantiates a {@link Node} from its {@link
|
|
58
|
+
* Instantiates a {@link Node} from its {@link LionWebJsonNode serialization}.
|
|
59
59
|
*/
|
|
60
60
|
const instantiate = ({ id, classifier: classifierMetaPointer, properties, containments, references, annotations }, parent) => {
|
|
61
61
|
const classifier = symbolTable.entityMatching(classifierMetaPointer);
|
|
@@ -65,22 +65,23 @@ primitiveTypeDeserializer = new DefaultPrimitiveTypeDeserializer(), problemHandl
|
|
|
65
65
|
}
|
|
66
66
|
const allFeatures = allFeaturesOf(classifier);
|
|
67
67
|
const propertySettings = {};
|
|
68
|
-
const serializedPropertiesPerKey = properties === undefined ? {} : groupBy(properties,
|
|
68
|
+
const serializedPropertiesPerKey = properties === undefined ? {} : groupBy(properties, sp => sp.property.key); // (this assumes no duplicate keys among properties!)
|
|
69
69
|
if (properties !== undefined) {
|
|
70
70
|
allFeatures
|
|
71
|
-
.filter(
|
|
72
|
-
.map(
|
|
73
|
-
.forEach(
|
|
71
|
+
.filter(feature => feature instanceof Property)
|
|
72
|
+
.map(feature => feature)
|
|
73
|
+
.forEach(property => {
|
|
74
74
|
if (property.key in serializedPropertiesPerKey) {
|
|
75
75
|
const value = serializedPropertiesPerKey[property.key][0].value;
|
|
76
76
|
if (property.type instanceof PrimitiveType) {
|
|
77
|
-
propertySettings[property.key] =
|
|
77
|
+
propertySettings[property.key] =
|
|
78
|
+
value === null ? undefined : propertyValueDeserializer.deserializeValue(value, property);
|
|
78
79
|
return;
|
|
79
80
|
}
|
|
80
81
|
if (property.type instanceof Enumeration) {
|
|
81
|
-
const literal = property.type.literals.find(
|
|
82
|
+
const literal = property.type.literals.find(literal => literal.key === value);
|
|
82
83
|
if (literal !== undefined) {
|
|
83
|
-
propertySettings[property.key] =
|
|
84
|
+
propertySettings[property.key] = writer.encodingOf(literal);
|
|
84
85
|
}
|
|
85
86
|
return;
|
|
86
87
|
}
|
|
@@ -92,20 +93,18 @@ primitiveTypeDeserializer = new DefaultPrimitiveTypeDeserializer(), problemHandl
|
|
|
92
93
|
if (node === null) {
|
|
93
94
|
return null;
|
|
94
95
|
}
|
|
95
|
-
const serializedContainmentsPerKey = containments === undefined ? {} : groupBy(containments,
|
|
96
|
-
const serializedReferencesPerKey = references === undefined ? {} : groupBy(references,
|
|
97
|
-
allFeatures
|
|
98
|
-
.forEach((feature) => {
|
|
96
|
+
const serializedContainmentsPerKey = containments === undefined ? {} : groupBy(containments, sp => sp.containment.key); // (this assumes no duplicate keys among containments!)
|
|
97
|
+
const serializedReferencesPerKey = references === undefined ? {} : groupBy(references, sp => sp.reference.key); // (this assumes no duplicate keys among references!)
|
|
98
|
+
allFeatures.forEach(feature => {
|
|
99
99
|
if (feature instanceof Property && properties !== undefined && feature.key in serializedPropertiesPerKey) {
|
|
100
|
-
|
|
100
|
+
writer.setFeatureValue(node, feature, propertySettings[feature.key]);
|
|
101
101
|
}
|
|
102
102
|
else if (feature instanceof Containment && containments !== undefined && feature.key in serializedContainmentsPerKey) {
|
|
103
|
-
const childIds = serializedContainmentsPerKey[feature.key].flatMap(
|
|
103
|
+
const childIds = serializedContainmentsPerKey[feature.key].flatMap(serChildren => serChildren.children);
|
|
104
104
|
if (feature.multiple) {
|
|
105
|
-
childIds
|
|
106
|
-
.forEach((childId) => {
|
|
105
|
+
childIds.forEach(childId => {
|
|
107
106
|
if (childId in serializedNodeById) {
|
|
108
|
-
|
|
107
|
+
writer.setFeatureValue(node, feature, instantiateMemoised(serializedNodeById[childId], node));
|
|
109
108
|
}
|
|
110
109
|
});
|
|
111
110
|
}
|
|
@@ -114,30 +113,28 @@ primitiveTypeDeserializer = new DefaultPrimitiveTypeDeserializer(), problemHandl
|
|
|
114
113
|
// just set the 1st one:
|
|
115
114
|
const firstChildId = childIds[0];
|
|
116
115
|
if (firstChildId in serializedNodeById) {
|
|
117
|
-
|
|
116
|
+
writer.setFeatureValue(node, feature, instantiateMemoised(serializedNodeById[firstChildId], node));
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
120
|
}
|
|
122
121
|
else if (feature instanceof Reference && references !== undefined && feature.key in serializedReferencesPerKey) {
|
|
123
|
-
const serRefs = (serializedReferencesPerKey[feature.key] ?? []).flatMap(
|
|
124
|
-
referencesToInstall.push(...(
|
|
125
|
-
.filter((serRef) => typeof serRef === "string")
|
|
126
|
-
.map((refId) => [node, feature, refId])));
|
|
122
|
+
const serRefs = (serializedReferencesPerKey[feature.key] ?? []).flatMap(serReferences => serReferences.targets.map(t => t.reference));
|
|
123
|
+
referencesToInstall.push(...serRefs.filter(serRef => typeof serRef === "string").map(refId => [node, feature, refId]));
|
|
127
124
|
}
|
|
128
125
|
});
|
|
129
126
|
node.annotations = annotations
|
|
130
|
-
.filter(
|
|
131
|
-
.map(
|
|
132
|
-
.filter(
|
|
133
|
-
.map(
|
|
127
|
+
.filter(annotationId => annotationId in serializedNodeById)
|
|
128
|
+
.map(annotationId => instantiateMemoised(serializedNodeById[annotationId]))
|
|
129
|
+
.filter(annotationOrNull => annotationOrNull !== null)
|
|
130
|
+
.map(annotation => annotation);
|
|
134
131
|
return node;
|
|
135
132
|
};
|
|
136
133
|
const rootLikeNodes = serializedNodes
|
|
137
134
|
.filter(({ parent }) => parent === null || !(parent in serializedNodeById))
|
|
138
|
-
.map(
|
|
139
|
-
.filter(
|
|
140
|
-
.map(
|
|
135
|
+
.map(serializedNode => instantiateMemoised(serializedNode))
|
|
136
|
+
.filter(nodeOrNull => nodeOrNull !== null)
|
|
137
|
+
.map(node => node);
|
|
141
138
|
const dependentNodesById = byIdMap(dependentNodes);
|
|
142
139
|
referencesToInstall.forEach(([node, reference, refId]) => {
|
|
143
140
|
const target = deserializedNodeById[refId] ?? dependentNodesById[refId];
|
|
@@ -149,7 +146,7 @@ primitiveTypeDeserializer = new DefaultPrimitiveTypeDeserializer(), problemHandl
|
|
|
149
146
|
}
|
|
150
147
|
return target;
|
|
151
148
|
})();
|
|
152
|
-
|
|
149
|
+
writer.setFeatureValue(node, reference, value);
|
|
153
150
|
});
|
|
154
151
|
return rootLikeNodes;
|
|
155
152
|
};
|
package/dist/deserializer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deserializer.js","sourceRoot":"","sources":["../src/deserializer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deserializer.js","sourceRoot":"","sources":["../src/deserializer.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iCAAiC,EAKpC,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,wBAAwB,EAAqB,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAY,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAClH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,oBAA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6BAA6B,CAAA"}
|
package/dist/dynamic-facade.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Node } from "./types.js";
|
|
2
|
-
import { ExtractionFacade, InstantiationFacade } from "./facade.js";
|
|
3
1
|
import { Classifier } from "./m3/types.js";
|
|
2
|
+
import { Reader } from "./reading.js";
|
|
3
|
+
import { Node } from "./types.js";
|
|
4
|
+
import { Writer } from "./writing.js";
|
|
4
5
|
/**
|
|
5
6
|
* Type definition for "dynamic nodes" that are not backed by specific types (e.g. classes).
|
|
6
7
|
*/
|
|
@@ -9,11 +10,19 @@ export type DynamicNode = Node & {
|
|
|
9
10
|
settings: Record<string, unknown>;
|
|
10
11
|
};
|
|
11
12
|
/**
|
|
12
|
-
* An implementation of {@link
|
|
13
|
+
* An implementation of {@link Reader} for {@link DynamicNode dynamic nodes}.
|
|
14
|
+
*/
|
|
15
|
+
export declare const dynamicReader: Reader<DynamicNode>;
|
|
16
|
+
/**
|
|
17
|
+
* Alias for {@link Reader}, kept for backward compatibility, and to be deprecated and removed later.
|
|
18
|
+
*/
|
|
19
|
+
export declare const dynamicExtractionFacade: Reader<DynamicNode>;
|
|
20
|
+
/**
|
|
21
|
+
* An implementation of {@link Writer} for {@link DynamicNode dynamic nodes}.
|
|
13
22
|
*/
|
|
14
|
-
export declare const
|
|
23
|
+
export declare const dynamicWriter: Writer<DynamicNode>;
|
|
15
24
|
/**
|
|
16
|
-
*
|
|
25
|
+
* Alias for {@link Reader}, kept for backward compatibility, and to be deprecated and removed later.
|
|
17
26
|
*/
|
|
18
|
-
export declare const dynamicInstantiationFacade:
|
|
27
|
+
export declare const dynamicInstantiationFacade: Reader<DynamicNode>;
|
|
19
28
|
//# sourceMappingURL=dynamic-facade.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-facade.d.ts","sourceRoot":"","sources":["../src/dynamic-facade.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamic-facade.d.ts","sourceRoot":"","sources":["../src/dynamic-facade.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAsB,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAA0B,MAAM,EAAE,MAAM,cAAc,CAAA;AAG7D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG;IAC7B,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC,CAAA;AAUD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,WAAW,CAS5C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,qBAAgB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,WAAW,CAU5C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,qBAAgB,CAAA"}
|
package/dist/dynamic-facade.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { builtinFeatures } from "./m3/builtins.js";
|
|
2
|
-
import { updateSettingsKeyBased } from "./
|
|
2
|
+
import { updateSettingsKeyBased } from "./writing.js";
|
|
3
3
|
// TODO could also have properties, containments, references - mimicking the serialization
|
|
4
4
|
const propertyGetterFor = (key) => (node) => (key in node.settings && typeof node.settings[key] === "string")
|
|
5
5
|
? node.settings[key] // FIXME type cast shouldn't be necessary
|
|
6
6
|
: undefined;
|
|
7
7
|
/**
|
|
8
|
-
* An implementation of {@link
|
|
8
|
+
* An implementation of {@link Reader} for {@link DynamicNode dynamic nodes}.
|
|
9
9
|
*/
|
|
10
|
-
export const
|
|
10
|
+
export const dynamicReader = ({
|
|
11
11
|
classifierOf: (node) => node.classifier,
|
|
12
12
|
getFeatureValue: (node, feature) =>
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -17,9 +17,13 @@ export const dynamicExtractionFacade = ({
|
|
|
17
17
|
resolveInfoFor: propertyGetterFor(builtinFeatures.inamed_name.key)
|
|
18
18
|
});
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Alias for {@link Reader}, kept for backward compatibility, and to be deprecated and removed later.
|
|
21
21
|
*/
|
|
22
|
-
export const
|
|
22
|
+
export const dynamicExtractionFacade = dynamicReader;
|
|
23
|
+
/**
|
|
24
|
+
* An implementation of {@link Writer} for {@link DynamicNode dynamic nodes}.
|
|
25
|
+
*/
|
|
26
|
+
export const dynamicWriter = ({
|
|
23
27
|
nodeFor: (_parent, classifier, id, _propertySettings) => ({
|
|
24
28
|
id,
|
|
25
29
|
classifier,
|
|
@@ -30,4 +34,8 @@ export const dynamicInstantiationFacade = ({
|
|
|
30
34
|
},
|
|
31
35
|
encodingOf: ({ key }) => key
|
|
32
36
|
});
|
|
37
|
+
/**
|
|
38
|
+
* Alias for {@link Reader}, kept for backward compatibility, and to be deprecated and removed later.
|
|
39
|
+
*/
|
|
40
|
+
export const dynamicInstantiationFacade = dynamicReader;
|
|
33
41
|
//# sourceMappingURL=dynamic-facade.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamic-facade.js","sourceRoot":"","sources":["../src/dynamic-facade.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"dynamic-facade.js","sourceRoot":"","sources":["../src/dynamic-facade.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,EAAE,sBAAsB,EAAU,MAAM,cAAc,CAAA;AAU7D,2FAA2F;AAG3F,MAAM,iBAAiB,GAAG,CAAC,GAAe,EAAmC,EAAE,CAC3E,CAAC,IAAI,EAAE,EAAE,CACL,CAAC,GAAG,IAAI,IAAI,CAAC,QAAQ,IAAI,OAAO,IAAI,CAAC,QAAQ,C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CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Reader } from "./reading.js";
|
|
2
|
+
import { Node } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Type def. for functions that extract {@link Node nodes} from a given one.
|
|
5
|
+
*/
|
|
6
|
+
export type NodesExtractor<NT extends Node> = (node: NT) => NT[];
|
|
7
|
+
/**
|
|
8
|
+
* @return A function that extracts the children from a given node.
|
|
9
|
+
*/
|
|
10
|
+
export declare const childrenExtractorUsing: <NT extends Node>(reader: Reader<NT>) => NodesExtractor<NT>;
|
|
11
|
+
/**
|
|
12
|
+
* @return a function that extracts *all* nodes from a given start node - usually a root node.
|
|
13
|
+
*/
|
|
14
|
+
export declare const nodesExtractorUsing: <NT extends Node>(reader: Reader<NT>) => NodesExtractor<NT>;
|
|
15
|
+
//# sourceMappingURL=extraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../src/extraction.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAGjC;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,EAAE,SAAS,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,sBAAsB,6DAOtB,CAAA;AAGb;;GAEG;AACH,eAAO,MAAM,mBAAmB,6DACqD,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { flatMapNonCyclingFollowing, trivialFlatMapper } from "@lionweb/ts-utils";
|
|
2
|
+
import { allFeaturesOf, isContainment } from "./m3/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* @return A function that extracts the children from a given node.
|
|
5
|
+
*/
|
|
6
|
+
export const childrenExtractorUsing = (reader) => (node) => [
|
|
7
|
+
...(allFeaturesOf(reader.classifierOf(node))
|
|
8
|
+
.filter(isContainment)
|
|
9
|
+
.flatMap((containment) => reader.getFeatureValue(node, containment) ?? [])),
|
|
10
|
+
// FIXME there's NO guarantee about the result of reader.getFeatureValue(node, containment) !!!
|
|
11
|
+
...node.annotations
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* @return a function that extracts *all* nodes from a given start node - usually a root node.
|
|
15
|
+
*/
|
|
16
|
+
export const nodesExtractorUsing = (reader) => flatMapNonCyclingFollowing(trivialFlatMapper, childrenExtractorUsing(reader));
|
|
17
|
+
//# sourceMappingURL=extraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extraction.js","sourceRoot":"","sources":["../src/extraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAEjF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAU5D;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAkB,MAAkB,EAAsB,EAAE,CAC9F,CAAC,IAAQ,EAAQ,EAAE,CAAC;IAChB,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SACvC,MAAM,CAAC,aAAa,CAAC;SACrB,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;IACvF,gGAAgG;IACxF,GAAG,IAAI,CAAC,WAAW;CACd,CAAA;AAGb;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAkB,MAAkB,EAAsB,EAAE,CAC3F,0BAA0B,CAAC,iBAAiB,EAAE,sBAAsB,CAAK,MAAM,CAAC,CAAC,CAAA"}
|
package/dist/functions.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LionWebId } from "@lionweb/json";
|
|
2
|
+
import { Node } from "./types.js";
|
|
2
3
|
/**
|
|
3
4
|
* @return a list of itself and the ancestors of the given {@link Node node}, in anti-chronological order.
|
|
4
5
|
*/
|
|
@@ -7,9 +8,9 @@ export declare const containmentChain: (node: Node) => Node[];
|
|
|
7
8
|
* Maps an array of {@link Node AST nodes} or `null`s to their IDs.
|
|
8
9
|
* These `null`s might be the result of unresolved children.
|
|
9
10
|
*/
|
|
10
|
-
export declare const asIds: (nodeOrNulls: (Node | null)[]) => (
|
|
11
|
+
export declare const asIds: (nodeOrNulls: (Node | null)[]) => (LionWebId | null)[];
|
|
11
12
|
/**
|
|
12
13
|
* @return the id of the given {@link Node node}.
|
|
13
14
|
*/
|
|
14
|
-
export declare const idOf: <T extends Node>({ id }: T) =>
|
|
15
|
+
export declare const idOf: <T extends Node>({ id }: T) => LionWebId;
|
|
15
16
|
//# sourceMappingURL=functions.d.ts.map
|
package/dist/functions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAGjC;;GAEG;AACH,eAAO,MAAM,gBAAgB,SAAU,IAAI,KAAG,IAAI,EAGjD,CAAA;AAGD;;;GAGG;AACH,eAAO,MAAM,KAAK,gBAAiB,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,KAAG,CAAC,SAAS,GAAG,IAAI,CAAC,EACQ,CAAA;AAG/E;;GAEG;AACH,eAAO,MAAM,IAAI,iCAA8B,SACzC,CAAA"}
|
package/dist/functions.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flatMapNonCyclingFollowing, trivialFlatMapper } from "
|
|
1
|
+
import { flatMapNonCyclingFollowing, trivialFlatMapper } from "@lionweb/ts-utils";
|
|
2
2
|
/**
|
|
3
3
|
* @return a list of itself and the ancestors of the given {@link Node node}, in anti-chronological order.
|
|
4
4
|
*/
|
package/dist/functions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAIjF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAU,EAAE;IACnD,MAAM,SAAS,GAAG,CAAC,CAAO,EAAU,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IAC/E,OAAO,0BAA0B,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,CAAA;AACzE,CAAC,CAAA;AAGD;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,WAA4B,EAAwB,EAAE,CACxE,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;AAG/E;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAiB,EAAC,EAAE,EAAI,EAAa,EAAE,CACvD,EAAE,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export * from "./deserializer.js";
|
|
2
2
|
export * from "./dynamic-facade.js";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./extraction.js";
|
|
4
4
|
export * from "./handler.js";
|
|
5
5
|
export * from "./functions.js";
|
|
6
|
+
export * from "./reading.js";
|
|
6
7
|
export * from "./references.js";
|
|
7
8
|
export * from "./serializer.js";
|
|
8
|
-
export * from "./serialization.js";
|
|
9
9
|
export * from "./symbol-table.js";
|
|
10
10
|
export * from "./types.js";
|
|
11
|
-
export * from "./utils/index.js";
|
|
12
11
|
export * from "./version.js";
|
|
13
|
-
export * from "./
|
|
12
|
+
export * from "./writing.js";
|
|
14
13
|
export * from "./m1/reference-utils.js";
|
|
14
|
+
export * from "./m3/index.js";
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,eAAe,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export * from "./deserializer.js";
|
|
2
2
|
export * from "./dynamic-facade.js";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./extraction.js";
|
|
4
4
|
export * from "./handler.js";
|
|
5
5
|
export * from "./functions.js";
|
|
6
|
+
export * from "./reading.js";
|
|
6
7
|
export * from "./references.js";
|
|
7
8
|
export * from "./serializer.js";
|
|
8
|
-
export * from "./serialization.js";
|
|
9
9
|
export * from "./symbol-table.js";
|
|
10
10
|
export * from "./types.js";
|
|
11
|
-
export * from "./utils/index.js";
|
|
12
11
|
export * from "./version.js";
|
|
13
|
-
export * from "./
|
|
12
|
+
export * from "./writing.js";
|
|
14
13
|
export * from "./m1/reference-utils.js";
|
|
14
|
+
export * from "./m3/index.js";
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,eAAe,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Reader } from "../reading.js";
|
|
1
2
|
import { Reference } from "../m3/index.js";
|
|
2
|
-
import { ExtractionFacade } from "../facade.js";
|
|
3
3
|
import { Node } from "../types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Represents information about a source and target node related through a {@link Reference}.
|
|
@@ -21,10 +21,10 @@ export declare class ReferenceValue<NT extends Node> {
|
|
|
21
21
|
* even if the scope passed contains duplicate nodes.
|
|
22
22
|
*
|
|
23
23
|
* @param scope - the {@link Node nodes} that are searched for references
|
|
24
|
-
* @param
|
|
24
|
+
* @param reader - a {@link Reader} to reflect on nodes.
|
|
25
25
|
* _Note_ that it's assumed that its {@link getFeatureValue} function doesn't throw.
|
|
26
26
|
*/
|
|
27
|
-
export declare const referenceValues: <NT extends Node>(scope: NT[],
|
|
27
|
+
export declare const referenceValues: <NT extends Node>(scope: NT[], reader: Reader<NT>) => ReferenceValue<NT>[];
|
|
28
28
|
/**
|
|
29
29
|
* Finds all references coming into the given target node or any of the given target nodes,
|
|
30
30
|
* within the given scope, as {@link ReferenceValue reference values}.
|
|
@@ -36,10 +36,10 @@ export declare const referenceValues: <NT extends Node>(scope: NT[], extractionF
|
|
|
36
36
|
*
|
|
37
37
|
* @param targetNodeOrNodes - one or more target {@link Node nodes} for which the incoming references are searched
|
|
38
38
|
* @param scope - the {@link Node nodes} that are searched for references
|
|
39
|
-
* @param
|
|
39
|
+
* @param reader - a {@link Reader} to reflect on nodes.
|
|
40
40
|
* _Note_ that it's assumed that its {@link getFeatureValue} function doesn't throw.
|
|
41
41
|
*/
|
|
42
|
-
export declare const incomingReferences: <NT extends Node>(targetNodeOrNodes: NT | NT[], scope: NT[],
|
|
42
|
+
export declare const incomingReferences: <NT extends Node>(targetNodeOrNodes: NT | NT[], scope: NT[], reader: Reader<NT>) => ReferenceValue<NT>[];
|
|
43
43
|
/**
|
|
44
44
|
* Finds all references to nodes that are not in the given scope, as {@link ReferenceValue reference values}.
|
|
45
45
|
* To search within all nodes under a collection of root nodes,
|
|
@@ -49,8 +49,8 @@ export declare const incomingReferences: <NT extends Node>(targetNodeOrNodes: NT
|
|
|
49
49
|
* even if the given scope contains duplicate nodes.
|
|
50
50
|
*
|
|
51
51
|
* @param scope - the {@link Node nodes} that form the scope of “reachable” nodes
|
|
52
|
-
* @param
|
|
52
|
+
* @param reader - a {@link Reader} to reflect on nodes.
|
|
53
53
|
* _Note_ that it's assumed that its {@link getFeatureValue} function doesn't throw.
|
|
54
54
|
*/
|
|
55
|
-
export declare const referencesToOutOfScopeNodes: <NT extends Node>(scope: NT[],
|
|
55
|
+
export declare const referencesToOutOfScopeNodes: <NT extends Node>(scope: NT[], reader: Reader<NT>) => ReferenceValue<NT>[];
|
|
56
56
|
//# sourceMappingURL=reference-utils.d.ts.map
|