@lionweb/core 0.8.0-beta.3 → 0.8.0-beta.4
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 +7 -0
- package/dist/deserializer.d.ts +43 -6
- package/dist/deserializer.d.ts.map +1 -1
- package/dist/deserializer.js +142 -129
- package/dist/deserializer.js.map +1 -1
- package/dist/functions.d.ts +6 -1
- package/dist/functions.d.ts.map +1 -1
- package/dist/functions.js +11 -0
- package/dist/functions.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/m3/builtins.js +3 -3
- package/dist/m3/builtins.js.map +1 -1
- package/dist/m3/deserializer.d.ts +7 -3
- package/dist/m3/deserializer.d.ts.map +1 -1
- package/dist/m3/deserializer.js +14 -6
- package/dist/m3/deserializer.js.map +1 -1
- package/dist/m3/functions.d.ts +2 -2
- package/dist/m3/functions.d.ts.map +1 -1
- package/dist/m3/functions.js.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.map +1 -1
- package/dist/m3/serializer.js +2 -2
- package/dist/m3/serializer.js.map +1 -1
- package/dist/m3/types.d.ts.map +1 -1
- package/dist/m3/types.js +4 -4
- package/dist/m3/types.js.map +1 -1
- package/dist/reading.d.ts +5 -4
- package/dist/reading.d.ts.map +1 -1
- package/dist/references.d.ts +14 -1
- package/dist/references.d.ts.map +1 -1
- package/dist/references.js +9 -0
- package/dist/references.js.map +1 -1
- package/dist/reporter.d.ts +49 -0
- package/dist/reporter.d.ts.map +1 -0
- package/dist/{handler.js → reporter.js} +15 -7
- package/dist/reporter.js.map +1 -0
- package/dist/serializer.d.ts +29 -7
- package/dist/serializer.d.ts.map +1 -1
- package/dist/serializer.js +14 -15
- package/dist/serializer.js.map +1 -1
- package/package.json +3 -3
- package/src/deserializer.ts +223 -168
- package/src/functions.ts +15 -1
- package/src/index.ts +1 -1
- package/src/m3/builtins.ts +3 -3
- package/src/m3/deserializer.ts +17 -12
- package/src/m3/functions.ts +2 -2
- package/src/m3/reference-checker.ts +2 -2
- package/src/m3/serializer.ts +2 -2
- package/src/m3/types.ts +4 -4
- package/src/reading.ts +5 -4
- package/src/references.ts +20 -1
- package/src/reporter.ts +78 -0
- package/src/serializer.ts +39 -23
- package/dist/handler.d.ts +0 -33
- package/dist/handler.d.ts.map +0 -1
- package/dist/handler.js.map +0 -1
- package/src/handler.ts +0 -57
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
* The `NT` type parameter of `SingleRef<NT>` now extends the `Node` base type.
|
|
6
6
|
* Move `IdOrUnresolved` type to the `class-core` package, as it was used only there and in `delta-protocol-common`.
|
|
7
7
|
* Remove the `serializedRef` function as it was a duplicate of `idFrom` in `class-core`.
|
|
8
|
+
* To be able to introduce multiple LionWeb versions explicitly:
|
|
9
|
+
* Introduce `Serializer` and `SerializerConfiguration` types, and `serializerWith` function as a replacement (keeping an alias for backward compatibility) for the `nodeSerializer` function with a better API (using the Parameter Object pattern).
|
|
10
|
+
* Introduce `Deserializer` and `DeserializerConfiguration` types, and a `deserializerWith` function as a replacement (keeping an alias for backward compatibility) for the `deserializeSerializationChunk` function with a better API (using the Parameter Object pattern).
|
|
11
|
+
* Rename `SimplisticHandler` interface to `ProblemReporter`, and propagate that renaming, keeping alias for backward compatibility.
|
|
12
|
+
* Introduce an explicit `UnresolvedReference` type, a corresponding `isUnresolvedReference` type function, and a `referenceToSet` function to produce reference (target) placeholders, and propagate their use throughout the codebase.
|
|
13
|
+
* Add a 2nd argument to the `ResolveInfoDeducer` function type, to also pass the containing reference.
|
|
14
|
+
*Note* that this is technically a breaking change, but the `ResolveInfoDeducer` type is essentially part of the internal API.
|
|
8
15
|
|
|
9
16
|
|
|
10
17
|
## 0.7.2
|
package/dist/deserializer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LionWebJsonChunk } from "@lionweb/json";
|
|
2
2
|
import { Writer } from "./writing.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ProblemReporter } from "./reporter.js";
|
|
4
4
|
import { Language, Property } from "./m3/types.js";
|
|
5
5
|
import { Node } from "./types.js";
|
|
6
6
|
/**
|
|
@@ -15,18 +15,55 @@ export interface PropertyValueDeserializer {
|
|
|
15
15
|
export interface PrimitiveTypeDeserializer extends PropertyValueDeserializer {
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Type definition for functions that deserialize a given {@link LionWebJsonChunk serialization chunk},
|
|
19
|
+
* being able to link to the given `dependentNodes` (as children/containments or reference targets).
|
|
20
|
+
*/
|
|
21
|
+
export type Deserializer<NT extends Node> = (serializationChunk: LionWebJsonChunk, dependentNodes?: Node[]) => NT[];
|
|
22
|
+
/**
|
|
23
|
+
* Configuration parameters for a deserializer that are unchanging per invocation of the deserializer
|
|
24
|
+
* (and partially optional).
|
|
25
|
+
*/
|
|
26
|
+
export type DeserializerConfiguration<NT extends Node> = {
|
|
27
|
+
/**
|
|
28
|
+
* A {@link Writer} that is used to instantiate nodes (with classifiers coming from the `languages` property) and set values on them.
|
|
29
|
+
*/
|
|
30
|
+
writer: Writer<NT>;
|
|
31
|
+
/**
|
|
32
|
+
* An array of {@link Language languages} that the serialization chunk is expected to conform to.
|
|
33
|
+
*/
|
|
34
|
+
languages: Language[];
|
|
35
|
+
/**
|
|
36
|
+
* A deserializer for values of properties.
|
|
37
|
+
* Default: {@link builtinPropertyValueDeserializer}.
|
|
38
|
+
*/
|
|
39
|
+
propertyValueDeserializer?: PropertyValueDeserializer;
|
|
40
|
+
/**
|
|
41
|
+
* An object for reporting problems to.
|
|
42
|
+
* Default: {@link consoleProblemReporter}.
|
|
43
|
+
*/
|
|
44
|
+
problemReporter?: ProblemReporter;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @return a {@link Deserializer} function.
|
|
48
|
+
*
|
|
49
|
+
* @param configuration - a {@link DeserializerConfiguration} object to configure the deserializer to return with.
|
|
50
|
+
*/
|
|
51
|
+
export declare const deserializerWith: <NT extends Node>(configuration: DeserializerConfiguration<NT>) => Deserializer<NT>;
|
|
52
|
+
/**
|
|
53
|
+
* @return a deserialization of a {@link LionWebJsonChunk}.
|
|
19
54
|
*
|
|
20
55
|
* @param serializationChunk - a {@link SerializedModel model} from its LionWeb serialization JSON format
|
|
21
56
|
* @param writer - a {@link Writer} that is used to instantiate nodes and set values on them
|
|
22
|
-
* @param languages -
|
|
57
|
+
* @param languages - {@link Language languages} that the serialized model is expected to conform to
|
|
23
58
|
* @param dependentNodes - a collection of nodes from dependent models against which all references in the serialized model are supposed to resolve against
|
|
24
59
|
* @param propertyValueDeserializer - a deserializer for values of properties (by default a {@link BuiltinPropertyValueDeserializer})
|
|
25
|
-
* @param
|
|
60
|
+
* @param problemReporter - an object for reporting problems (by default a {@link consoleProblemReporter})
|
|
61
|
+
*
|
|
62
|
+
* This is a legacy variant of {@link deserializerWith}, kept for backward compatibility, and to be deprecated and removed later.
|
|
26
63
|
*/
|
|
27
|
-
export declare const deserializeSerializationChunk: <NT extends Node>(serializationChunk: LionWebJsonChunk, writer: Writer<NT>, languages: Language[], dependentNodes: Node[], propertyValueDeserializer?: PropertyValueDeserializer,
|
|
64
|
+
export declare const deserializeSerializationChunk: <NT extends Node>(serializationChunk: LionWebJsonChunk, writer: Writer<NT>, languages: Language[], dependentNodes: Node[], propertyValueDeserializer?: PropertyValueDeserializer, problemReporter?: ProblemReporter) => NT[];
|
|
28
65
|
/**
|
|
29
66
|
* Alias for {@link deserializeSerializationChunk}.
|
|
30
67
|
*/
|
|
31
|
-
export declare const deserializeChunk: <NT extends Node>(serializationChunk: LionWebJsonChunk, writer: Writer<NT>, languages: Language[], dependentNodes: Node[], propertyValueDeserializer?: PropertyValueDeserializer,
|
|
68
|
+
export declare const deserializeChunk: <NT extends Node>(serializationChunk: LionWebJsonChunk, writer: Writer<NT>, languages: Language[], dependentNodes: Node[], propertyValueDeserializer?: PropertyValueDeserializer, problemReporter?: ProblemReporter) => NT[];
|
|
32
69
|
//# sourceMappingURL=deserializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EAA0B,eAAe,EAAE,MAAM,eAAe,CAAA;AAGvE,OAAO,EAAwC,QAAQ,EAAiB,QAAQ,EAAa,MAAM,eAAe,CAAA;AAElH,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;AAG/E;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,EAAE,SAAS,IAAI,IAAI,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAA;AAGnH;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,EAAE,SAAS,IAAI,IAAI;IACrD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;IACnB;;OAEG;IACH,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,CAAA;CACpC,CAAA;AAGD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,EAAE,SAAS,IAAI,EAAE,eAAe,yBAAyB,CAAC,EAAE,CAAC,KAAG,YAAY,CAAC,EAAE,CAyL/G,CAAA;AAGD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,6BAA6B,GAAI,EAAE,SAAS,IAAI,EACzD,oBAAoB,gBAAgB,EACpC,QAAQ,MAAM,CAAC,EAAE,CAAC,EAClB,WAAW,QAAQ,EAAE,EAErB,gBAAgB,IAAI,EAAE,EAEtB,4BAA2B,yBAA4D,EACvF,kBAAiB,eAAwC,KAC1D,EAAE,EAA8I,CAAA;AAEnJ;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAdiB,EAAE,SAAS,IAAI,sBACrC,gBAAgB,UAC5B,MAAM,CAAC,EAAE,CAAC,aACP,QAAQ,EAAE,kBAEL,IAAI,EAAE,8BAEK,yBAAyB,oBACnC,eAAe,KACjC,EAAE,EAKwD,CAAA"}
|
package/dist/deserializer.js
CHANGED
|
@@ -1,152 +1,165 @@
|
|
|
1
1
|
import { currentSerializationFormatVersion } from "@lionweb/json";
|
|
2
2
|
import { byIdMap, groupBy, keepDefineds } from "@lionweb/ts-utils";
|
|
3
|
-
import {
|
|
3
|
+
import { consoleProblemReporter } from "./reporter.js";
|
|
4
4
|
import { builtinPropertyValueDeserializer } from "./m3/builtins.js";
|
|
5
5
|
import { MemoisingSymbolTable } from "./m3/symbol-table.js";
|
|
6
6
|
import { Classifier, Containment, Enumeration, PrimitiveType, Property, Reference } from "./m3/types.js";
|
|
7
7
|
import { unresolved } from "./references.js";
|
|
8
8
|
/**
|
|
9
|
-
* @return a
|
|
9
|
+
* @return a {@link Deserializer} function.
|
|
10
10
|
*
|
|
11
|
-
* @param
|
|
12
|
-
* @param writer - a {@link Writer} that is used to instantiate nodes and set values on them
|
|
13
|
-
* @param languages - a {@link Language language} that the serialized model is expected to conform to
|
|
14
|
-
* @param dependentNodes - a collection of nodes from dependent models against which all references in the serialized model are supposed to resolve against
|
|
15
|
-
* @param propertyValueDeserializer - a deserializer for values of properties (by default a {@link BuiltinPropertyValueDeserializer})
|
|
16
|
-
* @param problemHandler - a handler for reporting problems (by default a {@link defaultSimplisticHandler})
|
|
11
|
+
* @param configuration - a {@link DeserializerConfiguration} object to configure the deserializer to return with.
|
|
17
12
|
*/
|
|
18
|
-
export const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const symbolTable = new MemoisingSymbolTable(languages);
|
|
27
|
-
const { nodes: serializedNodes } = serializationChunk;
|
|
28
|
-
const serializedNodeById = byIdMap(serializedNodes);
|
|
29
|
-
const deserializedNodeById = {};
|
|
30
|
-
/**
|
|
31
|
-
* Instantiates a {@link Node} from the given {@link LionWebJsonNode},
|
|
32
|
-
* and stores it under its ID so references to it can be resolved.
|
|
33
|
-
* For every serialized node, only one instance will ever be constructed (through memoisation).
|
|
34
|
-
*/
|
|
35
|
-
const instantiateMemoised = (serNode, parent) => {
|
|
36
|
-
if (serNode.id in deserializedNodeById) {
|
|
37
|
-
return deserializedNodeById[serNode.id];
|
|
38
|
-
}
|
|
39
|
-
const node = instantiate(serNode, parent);
|
|
40
|
-
if (node !== null) {
|
|
41
|
-
deserializedNodeById[node.id] = node;
|
|
42
|
-
}
|
|
43
|
-
return node;
|
|
44
|
-
};
|
|
45
|
-
const referencesToInstall = [];
|
|
46
|
-
const tryInstantiate = (parent, classifier, id, propertySettings) => {
|
|
47
|
-
try {
|
|
48
|
-
return writer.nodeFor(parent, classifier, id, propertySettings);
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
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:`);
|
|
52
|
-
problemHandler.reportProblem(e.toString());
|
|
53
|
-
return null;
|
|
13
|
+
export const deserializerWith = (configuration) => {
|
|
14
|
+
const symbolTable = new MemoisingSymbolTable(configuration.languages);
|
|
15
|
+
const { writer } = configuration;
|
|
16
|
+
const propertyValueDeserializer = configuration.propertyValueDeserializer ?? builtinPropertyValueDeserializer;
|
|
17
|
+
const problemReporter = configuration.problemReporter ?? consoleProblemReporter;
|
|
18
|
+
return (serializationChunk, dependentNodes = []) => {
|
|
19
|
+
if (serializationChunk.serializationFormatVersion !== currentSerializationFormatVersion) {
|
|
20
|
+
problemReporter.reportProblem(`can't deserialize from serialization format other than version "${currentSerializationFormatVersion}" - assuming that version`);
|
|
54
21
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
22
|
+
const { nodes: serializedNodes } = serializationChunk;
|
|
23
|
+
const serializedNodeById = byIdMap(serializedNodes);
|
|
24
|
+
const deserializedNodeById = {};
|
|
25
|
+
/**
|
|
26
|
+
* Instantiates a {@link Node} from the given {@link LionWebJsonNode},
|
|
27
|
+
* and stores it under its ID so references to it can be resolved.
|
|
28
|
+
* For every serialized node, only one instance will ever be constructed (through memoisation).
|
|
29
|
+
*/
|
|
30
|
+
const instantiateMemoised = (serNode, parent) => {
|
|
31
|
+
if (serNode.id in deserializedNodeById) {
|
|
32
|
+
return deserializedNodeById[serNode.id];
|
|
33
|
+
}
|
|
34
|
+
const node = instantiate(serNode, parent);
|
|
35
|
+
if (node !== null) {
|
|
36
|
+
deserializedNodeById[node.id] = node;
|
|
37
|
+
}
|
|
38
|
+
return node;
|
|
39
|
+
};
|
|
40
|
+
const referencesToInstall = [];
|
|
41
|
+
const tryInstantiate = (parent, classifier, id, propertySettings) => {
|
|
42
|
+
try {
|
|
43
|
+
return writer.nodeFor(parent, classifier, id, propertySettings);
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
problemReporter.reportProblem(`error occurred during instantiation of a node for classifier ${classifier.name} with meta-pointer (${classifier.language.key}, ${classifier.language.version}, ${classifier.key}); reason:`);
|
|
47
|
+
problemReporter.reportProblem(e.toString());
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Instantiates a {@link Node} from its {@link LionWebJsonNode serialization}.
|
|
53
|
+
*/
|
|
54
|
+
const instantiate = ({ id, classifier: classifierMetaPointer, properties, containments, references, annotations }, parent) => {
|
|
55
|
+
const classifier = symbolTable.entityMatching(classifierMetaPointer);
|
|
56
|
+
if (classifier === undefined || !(classifier instanceof Classifier)) {
|
|
57
|
+
problemReporter.reportProblem(`can't deserialize node with id=${id}: can't find the classifier with key ${classifierMetaPointer.key} in language (${classifierMetaPointer.language}, ${classifierMetaPointer.version})`);
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const allFeatures = symbolTable.allFeaturesOfEntityMatching(classifierMetaPointer);
|
|
61
|
+
const propertySettings = {};
|
|
62
|
+
const serializedPropertiesPerKey = properties === undefined ? {} : groupBy(properties, sp => sp.property.key); // (this assumes no duplicate keys among properties!)
|
|
63
|
+
if (properties !== undefined) {
|
|
64
|
+
allFeatures
|
|
65
|
+
.filter(feature => feature instanceof Property)
|
|
66
|
+
.map(feature => feature)
|
|
67
|
+
.forEach(property => {
|
|
68
|
+
if (property.key in serializedPropertiesPerKey) {
|
|
69
|
+
const value = serializedPropertiesPerKey[property.key][0].value;
|
|
70
|
+
if (property.type instanceof PrimitiveType) {
|
|
71
|
+
propertySettings[property.key] =
|
|
72
|
+
value === null ? undefined : propertyValueDeserializer.deserializeValue(value, property);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (property.type instanceof Enumeration) {
|
|
76
|
+
const literal = property.type.literals.find(literal => literal.key === value);
|
|
77
|
+
if (literal !== undefined) {
|
|
78
|
+
propertySettings[property.key] = writer.encodingOf(literal);
|
|
79
|
+
}
|
|
80
|
+
return;
|
|
84
81
|
}
|
|
85
|
-
|
|
82
|
+
problemReporter.reportProblem(`property ${property.name} on classifier ${classifier.name} is not handled, because its type is neither a primitive type nor an enumeration`);
|
|
86
83
|
}
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
const node = tryInstantiate(parent, classifier, id, propertySettings);
|
|
92
|
-
if (node === null) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
const serializedContainmentsPerKey = containments === undefined ? {} : groupBy(containments, sp => sp.containment.key); // (this assumes no duplicate keys among containments!)
|
|
96
|
-
const serializedReferencesPerKey = references === undefined ? {} : groupBy(references, sp => sp.reference.key); // (this assumes no duplicate keys among references!)
|
|
97
|
-
allFeatures.forEach(feature => {
|
|
98
|
-
if (feature instanceof Property && properties !== undefined && feature.key in serializedPropertiesPerKey) {
|
|
99
|
-
writer.setFeatureValue(node, feature, propertySettings[feature.key]);
|
|
84
|
+
});
|
|
100
85
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
86
|
+
const node = tryInstantiate(parent, classifier, id, propertySettings);
|
|
87
|
+
if (node === null) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const serializedContainmentsPerKey = containments === undefined ? {} : groupBy(containments, sp => sp.containment.key); // (this assumes no duplicate keys among containments!)
|
|
91
|
+
const serializedReferencesPerKey = references === undefined ? {} : groupBy(references, sp => sp.reference.key); // (this assumes no duplicate keys among references!)
|
|
92
|
+
allFeatures.forEach(feature => {
|
|
93
|
+
if (feature instanceof Property && properties !== undefined && feature.key in serializedPropertiesPerKey) {
|
|
94
|
+
writer.setFeatureValue(node, feature, propertySettings[feature.key]);
|
|
109
95
|
}
|
|
110
|
-
else {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
96
|
+
else if (feature instanceof Containment && containments !== undefined && feature.key in serializedContainmentsPerKey) {
|
|
97
|
+
const childIds = serializedContainmentsPerKey[feature.key].flatMap(serChildren => serChildren.children);
|
|
98
|
+
if (feature.multiple) {
|
|
99
|
+
childIds.forEach(childId => {
|
|
100
|
+
if (childId in serializedNodeById) {
|
|
101
|
+
writer.setFeatureValue(node, feature, instantiateMemoised(serializedNodeById[childId], node));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
if (childIds.length > 0) {
|
|
107
|
+
// just set the 1st one:
|
|
108
|
+
const firstChildId = childIds[0];
|
|
109
|
+
if (firstChildId in serializedNodeById) {
|
|
110
|
+
writer.setFeatureValue(node, feature, instantiateMemoised(serializedNodeById[firstChildId], node));
|
|
111
|
+
}
|
|
116
112
|
}
|
|
117
113
|
}
|
|
118
114
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
115
|
+
else if (feature instanceof Reference && references !== undefined && feature.key in serializedReferencesPerKey) {
|
|
116
|
+
const serRefs = (serializedReferencesPerKey[feature.key] ?? []).flatMap(serReferences => serReferences.targets.map(t => t.reference));
|
|
117
|
+
referencesToInstall.push(...serRefs.filter(serRef => typeof serRef === "string").map(refId => [node, feature, refId]));
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
node.annotations = keepDefineds(annotations
|
|
121
|
+
.filter(annotationId => annotationId in serializedNodeById)
|
|
122
|
+
.map(annotationId => instantiateMemoised(serializedNodeById[annotationId])))
|
|
123
|
+
.map(annotation => annotation);
|
|
124
|
+
return node;
|
|
125
|
+
};
|
|
126
|
+
const rootLikeNodes = keepDefineds(serializedNodes
|
|
127
|
+
.filter(({ parent }) => parent === null || !(parent in serializedNodeById))
|
|
128
|
+
.map(serializedNode => instantiateMemoised(serializedNode)))
|
|
129
|
+
.map(node => node);
|
|
130
|
+
const dependentNodesById = byIdMap(dependentNodes);
|
|
131
|
+
referencesToInstall.forEach(([node, reference, refId]) => {
|
|
132
|
+
const target = deserializedNodeById[refId] ?? dependentNodesById[refId];
|
|
133
|
+
const value = (() => {
|
|
134
|
+
if (target === undefined) {
|
|
135
|
+
const metaTypeMessage = "concept" in node ? ` and (meta-)type ${node.concept}` : "";
|
|
136
|
+
problemReporter.reportProblem(`couldn't resolve the target with id=${refId} of a "${reference.name}" reference on the node with id=${node.id}${metaTypeMessage}`);
|
|
137
|
+
return unresolved;
|
|
138
|
+
}
|
|
139
|
+
return target;
|
|
140
|
+
})();
|
|
141
|
+
writer.setFeatureValue(node, reference, value);
|
|
124
142
|
});
|
|
125
|
-
|
|
126
|
-
.filter(annotationId => annotationId in serializedNodeById)
|
|
127
|
-
.map(annotationId => instantiateMemoised(serializedNodeById[annotationId])))
|
|
128
|
-
.map(annotation => annotation);
|
|
129
|
-
return node;
|
|
143
|
+
return rootLikeNodes;
|
|
130
144
|
};
|
|
131
|
-
const rootLikeNodes = keepDefineds(serializedNodes
|
|
132
|
-
.filter(({ parent }) => parent === null || !(parent in serializedNodeById))
|
|
133
|
-
.map(serializedNode => instantiateMemoised(serializedNode)))
|
|
134
|
-
.map(node => node);
|
|
135
|
-
const dependentNodesById = byIdMap(dependentNodes);
|
|
136
|
-
referencesToInstall.forEach(([node, reference, refId]) => {
|
|
137
|
-
const target = deserializedNodeById[refId] ?? dependentNodesById[refId];
|
|
138
|
-
const value = (() => {
|
|
139
|
-
if (target === undefined) {
|
|
140
|
-
const metaTypeMessage = "concept" in node ? ` and (meta-)type ${node.concept}` : "";
|
|
141
|
-
problemHandler.reportProblem(`couldn't resolve the target with id=${refId} of a "${reference.name}" reference on the node with id=${node.id}${metaTypeMessage}`);
|
|
142
|
-
return unresolved;
|
|
143
|
-
}
|
|
144
|
-
return target;
|
|
145
|
-
})();
|
|
146
|
-
writer.setFeatureValue(node, reference, value);
|
|
147
|
-
});
|
|
148
|
-
return rootLikeNodes;
|
|
149
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* @return a deserialization of a {@link LionWebJsonChunk}.
|
|
148
|
+
*
|
|
149
|
+
* @param serializationChunk - a {@link SerializedModel model} from its LionWeb serialization JSON format
|
|
150
|
+
* @param writer - a {@link Writer} that is used to instantiate nodes and set values on them
|
|
151
|
+
* @param languages - {@link Language languages} that the serialized model is expected to conform to
|
|
152
|
+
* @param dependentNodes - a collection of nodes from dependent models against which all references in the serialized model are supposed to resolve against
|
|
153
|
+
* @param propertyValueDeserializer - a deserializer for values of properties (by default a {@link BuiltinPropertyValueDeserializer})
|
|
154
|
+
* @param problemReporter - an object for reporting problems (by default a {@link consoleProblemReporter})
|
|
155
|
+
*
|
|
156
|
+
* This is a legacy variant of {@link deserializerWith}, kept for backward compatibility, and to be deprecated and removed later.
|
|
157
|
+
*/
|
|
158
|
+
export const deserializeSerializationChunk = (serializationChunk, writer, languages,
|
|
159
|
+
// TODO facades <--> languages, so it's weird that it looks split up like this
|
|
160
|
+
dependentNodes,
|
|
161
|
+
// TODO (#13) see if you can turn this into [nodes: Node[], writer: Writer<Node>][] after all
|
|
162
|
+
propertyValueDeserializer = builtinPropertyValueDeserializer, problemReporter = consoleProblemReporter) => deserializerWith({ writer, languages, propertyValueDeserializer, problemReporter: problemReporter })(serializationChunk, dependentNodes);
|
|
150
163
|
/**
|
|
151
164
|
* Alias for {@link deserializeSerializationChunk}.
|
|
152
165
|
*/
|
package/dist/deserializer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,
|
|
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,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,sBAAsB,EAAmB,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,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;AAiD5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAkB,aAA4C,EAAoB,EAAE;IAEhH,MAAM,WAAW,GAAG,IAAI,oBAAoB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA;IACrE,MAAM,EAAE,MAAM,EAAE,GAAG,aAAa,CAAA;IAEhC,MAAM,yBAAyB,GAAG,aAAa,CAAC,yBAAyB,IAAI,gCAAgC,CAAA;IAC7G,MAAM,eAAe,GAAG,aAAa,CAAC,eAAe,IAAI,sBAAsB,CAAA;IAE/E,OAAO,CAAC,kBAAkB,EAAE,cAAc,GAAG,EAAE,EAAE,EAAE;QAE/C,IAAI,kBAAkB,CAAC,0BAA0B,KAAK,iCAAiC,EAAE,CAAC;YACtF,eAAe,CAAC,aAAa,CACzB,mEAAmE,iCA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HANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LionWebId } from "@lionweb/json";
|
|
1
|
+
import { LionWebId, LionWebJsonMetaPointer } from "@lionweb/json";
|
|
2
2
|
import { Node } from "./types.js";
|
|
3
|
+
import { Feature } from "./m3/index.js";
|
|
3
4
|
/**
|
|
4
5
|
* @return a list of itself and the ancestors of the given {@link Node node}, in anti-chronological order.
|
|
5
6
|
*/
|
|
@@ -13,4 +14,8 @@ export declare const asIds: (nodeOrNulls: (Node | null)[]) => (LionWebId | null)
|
|
|
13
14
|
* @return the id of the given {@link Node node}.
|
|
14
15
|
*/
|
|
15
16
|
export declare const idOf: <T extends Node>({ id }: T) => LionWebId;
|
|
17
|
+
/**
|
|
18
|
+
* @return the {@link LionWebJsonMetaPointer} for the given {@link Feature}.
|
|
19
|
+
*/
|
|
20
|
+
export declare const metaPointerFor: (feature: Feature) => LionWebJsonMetaPointer;
|
|
16
21
|
//# 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,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAEjE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,IAAI,KAAG,IAAI,EAGjD,CAAA;AAGD;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,aAAa,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,KAAG,CAAC,SAAS,GAAG,IAAI,CAAC,EACQ,CAAA;AAG/E;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,IAAI,EAAE,QAAM,CAAC,KAAG,SACzC,CAAA;AAGN;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,OAAO,KAAG,sBAOjD,CAAA"}
|
package/dist/functions.js
CHANGED
|
@@ -15,4 +15,15 @@ export const asIds = (nodeOrNulls) => nodeOrNulls.map((nodeOrNull) => nodeOrNull
|
|
|
15
15
|
* @return the id of the given {@link Node node}.
|
|
16
16
|
*/
|
|
17
17
|
export const idOf = ({ id }) => id;
|
|
18
|
+
/**
|
|
19
|
+
* @return the {@link LionWebJsonMetaPointer} for the given {@link Feature}.
|
|
20
|
+
*/
|
|
21
|
+
export const metaPointerFor = (feature) => {
|
|
22
|
+
const { language } = feature.classifier;
|
|
23
|
+
return {
|
|
24
|
+
language: language.key,
|
|
25
|
+
version: language.version,
|
|
26
|
+
key: feature.key
|
|
27
|
+
};
|
|
28
|
+
};
|
|
18
29
|
//# sourceMappingURL=functions.js.map
|
package/dist/functions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../src/functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAKjF;;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;AAGN;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAgB,EAA0B,EAAE;IACvE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAA;IACvC,OAAO;QACH,QAAQ,EAAE,QAAQ,CAAC,GAAG;QACtB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,GAAG,EAAE,OAAO,CAAC,GAAG;KACnB,CAAA;AACL,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from "./deserializer.js";
|
|
2
2
|
export * from "./dynamic-facade.js";
|
|
3
3
|
export * from "./extraction.js";
|
|
4
|
-
export * from "./handler.js";
|
|
5
4
|
export * from "./functions.js";
|
|
6
5
|
export * from "./reading.js";
|
|
7
6
|
export * from "./references.js";
|
|
7
|
+
export * from "./reporter.js";
|
|
8
8
|
export * from "./serializer.js";
|
|
9
9
|
export * from "./types.js";
|
|
10
10
|
export * from "./version.js";
|
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,iBAAiB,CAAA;AAC/B,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,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,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,10 +1,10 @@
|
|
|
1
1
|
export * from "./deserializer.js";
|
|
2
2
|
export * from "./dynamic-facade.js";
|
|
3
3
|
export * from "./extraction.js";
|
|
4
|
-
export * from "./handler.js";
|
|
5
4
|
export * from "./functions.js";
|
|
6
5
|
export * from "./reading.js";
|
|
7
6
|
export * from "./references.js";
|
|
7
|
+
export * from "./reporter.js";
|
|
8
8
|
export * from "./serializer.js";
|
|
9
9
|
export * from "./types.js";
|
|
10
10
|
export * from "./version.js";
|
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,iBAAiB,CAAA;AAC/B,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,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,yBAAyB,CAAA;AACvC,cAAc,eAAe,CAAA"}
|
package/dist/m3/builtins.js
CHANGED
|
@@ -2,7 +2,7 @@ import { asMinimalJsonString } from "@lionweb/ts-utils";
|
|
|
2
2
|
import { currentReleaseVersion } from "../version.js";
|
|
3
3
|
import { LanguageFactory } from "./factory.js";
|
|
4
4
|
import { Concept, lioncoreBuiltinsKey } from "./types.js";
|
|
5
|
-
import {
|
|
5
|
+
import { isUnresolvedReference } from "../references.js";
|
|
6
6
|
const lioncoreBuiltinsIdAndKeyGenerator = (...names) => [lioncoreBuiltinsKey, ...names.slice(1)].join("-");
|
|
7
7
|
const factory = new LanguageFactory("LionCore_builtins", currentReleaseVersion, lioncoreBuiltinsIdAndKeyGenerator, lioncoreBuiltinsIdAndKeyGenerator);
|
|
8
8
|
/*
|
|
@@ -100,7 +100,7 @@ export class BuiltinPropertyValueDeserializer extends DataTypeRegister {
|
|
|
100
100
|
throw new Error(`can't deserialize undefined as the value of required property "${property.name}" (on classifier "${property.classifier.name}" in language "${property.classifier.language.name}")`);
|
|
101
101
|
}
|
|
102
102
|
const { type } = property;
|
|
103
|
-
if (type
|
|
103
|
+
if (isUnresolvedReference(type)) {
|
|
104
104
|
throw new Error(`can't deserialize property "${property.name}" (on classifier "${property.classifier.name}" in language "${property.classifier.language.name}") with unspecified type`);
|
|
105
105
|
}
|
|
106
106
|
const specificDeserializer = this.byType(type);
|
|
@@ -140,7 +140,7 @@ export class BuiltinPropertyValueSerializer extends DataTypeRegister {
|
|
|
140
140
|
throw new Error(`can't serialize undefined as the value of required property "${property.name}" (on classifier "${property.classifier.name}" in language "${property.classifier.language.name}")`);
|
|
141
141
|
}
|
|
142
142
|
const { type } = property;
|
|
143
|
-
if (type
|
|
143
|
+
if (isUnresolvedReference(type)) {
|
|
144
144
|
throw new Error(`can't serialize property "${property.name}" (on classifier "${property.classifier.name}" in language "${property.classifier.language.name}") with unspecified type`);
|
|
145
145
|
}
|
|
146
146
|
const specificSerializer = this.byType(type);
|
package/dist/m3/builtins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins.js","sourceRoot":"","sources":["../../src/m3/builtins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAiB,MAAM,mBAAmB,CAAA;AAGtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAc,OAAO,EAAY,mBAAmB,EAAY,MAAM,YAAY,CAAA;AACzF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"builtins.js","sourceRoot":"","sources":["../../src/m3/builtins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAiB,MAAM,mBAAmB,CAAA;AAGtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAc,OAAO,EAAY,mBAAmB,EAAY,MAAM,YAAY,CAAA;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAExD,MAAM,iCAAiC,GAAkB,CAAC,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,mBAAmB,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAEzH,MAAM,OAAO,GAAG,IAAI,eAAe,CAC/B,mBAAmB,EACnB,qBAAqB,EACrB,iCAAiC,EACjC,iCAAiC,CACpC,CAAA;AACD;;GAEG;AAEH;;GAEG;AACH,MAAM,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAA;AAEzC,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;AACtD,MAAM,eAAe,GAAG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kBAAkB,IAAI,SAAS,EAAE,CAAC;YAClC,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAA;QACpC,CAAC;aAAM,CAAC;YACJ,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,CAAC,IAAI,qBAAqB,QAAQ,CAAC,UAAU,CAAC,IAAI,kBAAkB,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,eAAe,IAAK,CAAC,IAAI,MAAM,KAAK,EAAE,CAAC,CAAA;QAC9M,CAAC;IACL,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,8BAA8B,EAAE,CAAC,MAAM,EAAE,CAAA;AAE3F;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,8BAA8B;CAAG;AAErF,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LionWebJsonChunk } from "@lionweb/json";
|
|
2
|
-
import {
|
|
2
|
+
import { ProblemReporter } from "../reporter.js";
|
|
3
3
|
import { Language } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Deserializes languages that have been serialized into the LionWeb serialization JSON format
|
|
@@ -9,7 +9,11 @@ export declare const deserializeLanguages: (serializationChunk: LionWebJsonChunk
|
|
|
9
9
|
/**
|
|
10
10
|
* Deserializes languages that have been serialized into the LionWeb serialization JSON format
|
|
11
11
|
* as an instance of the LionCore metametamodel, using {@link _M3Concept these type definitions}.
|
|
12
|
-
* This function takes a
|
|
12
|
+
* This function takes a {@link ProblemReporter} to be able to see what problems occurred.
|
|
13
13
|
*/
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const deserializeLanguagesWithReporter: (serializationChunk: LionWebJsonChunk, problemReporter: ProblemReporter, ...dependentLanguages: Language[]) => Language[];
|
|
15
|
+
/**
|
|
16
|
+
* Legacy alias for {@link deserializeLanguagesWithReporter}, kept for backward compatibility, and to be deprecated and removed later.
|
|
17
|
+
*/
|
|
18
|
+
export declare const deserializeLanguagesWithHandler: (serializationChunk: LionWebJsonChunk, problemReporter: ProblemReporter, ...dependentLanguages: Language[]) => Language[];
|
|
15
19
|
//# sourceMappingURL=deserializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deserializer.d.ts","sourceRoot":"","sources":["../../src/m3/deserializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAGhD,OAAO,
|
|
1
|
+
{"version":3,"file":"deserializer.d.ts","sourceRoot":"","sources":["../../src/m3/deserializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAGhD,OAAO,EAA0B,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAIxE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,oBAAoB,gBAAgB,EAAE,GAAG,oBAAoB,QAAQ,EAAE,KAAG,QAAQ,EAChB,CAAA;AAEvG;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,GACzC,oBAAoB,gBAAgB,EACpC,iBAAiB,eAAe,EAChC,GAAG,oBAAoB,QAAQ,EAAE,KAClC,QAAQ,EAU0E,CAAA;AAErF;;GAEG;AACH,eAAO,MAAM,+BAA+B,uBAlBpB,gBAAgB,mBACnB,eAAe,yBACT,QAAQ,EAAE,KAClC,QAAQ,EAeoE,CAAA"}
|