@shaclmate/compiler 2.0.13 → 2.0.15
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/Compiler.d.ts +15 -0
- package/Compiler.js +20 -0
- package/ShapesGraphToAstTransformer.d.ts +18 -23
- package/ShapesGraphToAstTransformer.js +21 -447
- package/_ShapesGraphToAstTransformer/NodeShapeAstType.d.ts +3 -0
- package/_ShapesGraphToAstTransformer/NodeShapeAstType.js +2 -0
- package/_ShapesGraphToAstTransformer/index.d.ts +10 -0
- package/_ShapesGraphToAstTransformer/index.js +10 -0
- package/_ShapesGraphToAstTransformer/pickLiteral.d.ts +4 -0
- package/_ShapesGraphToAstTransformer/pickLiteral.js +18 -0
- package/_ShapesGraphToAstTransformer/propertyShapeNodeKinds.d.ts +4 -0
- package/_ShapesGraphToAstTransformer/propertyShapeNodeKinds.js +26 -0
- package/_ShapesGraphToAstTransformer/shapeAstName.d.ts +5 -0
- package/_ShapesGraphToAstTransformer/shapeAstName.js +28 -0
- package/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.d.ts +6 -0
- package/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.js +178 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstCompositeType.d.ts +13 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstCompositeType.js +200 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstIdentifierType.d.ts +12 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstIdentifierType.js +29 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstLiteralType.d.ts +12 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstLiteralType.js +43 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.d.ts +6 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +31 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstTermType.d.ts +14 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstTermType.js +21 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstType.d.ts +16 -0
- package/_ShapesGraphToAstTransformer/transformPropertyShapeToAstType.js +58 -0
- package/ast/Ast.d.ts +5 -0
- package/ast/CompositeType.d.ts +13 -0
- package/ast/CompositeType.js +2 -0
- package/ast/IdentifierType.d.ts +3 -6
- package/ast/IntersectionType.d.ts +2 -2
- package/ast/ListType.d.ts +53 -0
- package/ast/ListType.js +2 -0
- package/ast/LiteralType.d.ts +4 -3
- package/ast/Name.d.ts +1 -0
- package/ast/ObjectCompositeType.d.ts +22 -0
- package/ast/ObjectCompositeType.js +2 -0
- package/ast/ObjectIntersectionType.d.ts +8 -0
- package/ast/ObjectIntersectionType.js +2 -0
- package/ast/ObjectType.d.ts +91 -19
- package/ast/ObjectType.js +26 -1
- package/ast/ObjectUnionType.d.ts +19 -0
- package/ast/ObjectUnionType.js +2 -0
- package/ast/PlaceholderType.d.ts +7 -0
- package/ast/PlaceholderType.js +2 -0
- package/ast/SetType.d.ts +1 -1
- package/ast/TermType.d.ts +11 -0
- package/ast/TermType.js +2 -0
- package/ast/Type.d.ts +11 -3
- package/ast/UnionType.d.ts +3 -3
- package/ast/index.d.ts +6 -3
- package/ast/index.js +6 -3
- package/enums/MintingStrategy.d.ts +5 -0
- package/enums/MintingStrategy.js +2 -0
- package/enums/PropertyVisibility.d.ts +2 -0
- package/enums/PropertyVisibility.js +2 -0
- package/enums/TsFeature.d.ts +5 -0
- package/enums/TsFeature.js +16 -0
- package/enums/TsObjectDeclarationType.d.ts +5 -0
- package/enums/TsObjectDeclarationType.js +2 -0
- package/enums/index.d.ts +5 -0
- package/enums/index.js +5 -0
- package/generators/Generator.d.ts +5 -0
- package/generators/Generator.js +2 -0
- package/generators/index.d.ts +2 -2
- package/generators/index.js +2 -2
- package/generators/json/AstJsonGenerator.d.ts +4 -5
- package/generators/json/AstJsonGenerator.js +31 -22
- package/generators/ts/BooleanType.d.ts +7 -3
- package/generators/ts/BooleanType.js +58 -4
- package/generators/ts/DateTimeType.d.ts +19 -0
- package/generators/ts/DateTimeType.js +66 -0
- package/generators/ts/DeclaredType.d.ts +17 -0
- package/generators/ts/DeclaredType.js +10 -0
- package/generators/ts/IdentifierType.d.ts +7 -17
- package/generators/ts/IdentifierType.js +69 -60
- package/generators/ts/Import.d.ts +17 -0
- package/generators/ts/Import.js +54 -0
- package/generators/ts/ListType.d.ts +19 -8
- package/generators/ts/ListType.js +206 -44
- package/generators/ts/LiteralType.d.ts +13 -11
- package/generators/ts/LiteralType.js +36 -51
- package/generators/ts/NumberType.d.ts +7 -3
- package/generators/ts/NumberType.js +55 -4
- package/generators/ts/ObjectType.d.ts +48 -25
- package/generators/ts/ObjectType.js +234 -50
- package/generators/ts/ObjectUnionType.d.ts +58 -0
- package/generators/ts/ObjectUnionType.js +450 -0
- package/generators/ts/OptionType.d.ts +14 -4
- package/generators/ts/OptionType.js +70 -20
- package/generators/ts/PrimitiveType.d.ts +15 -5
- package/generators/ts/PrimitiveType.js +27 -31
- package/generators/ts/SetType.d.ts +14 -4
- package/generators/ts/SetType.js +108 -30
- package/generators/ts/SnippetDeclarations.d.ts +11 -0
- package/generators/ts/SnippetDeclarations.js +215 -0
- package/generators/ts/StringType.d.ts +8 -3
- package/generators/ts/StringType.js +57 -3
- package/generators/ts/TermType.d.ts +54 -0
- package/generators/ts/TermType.js +242 -0
- package/generators/ts/TsGenerator.d.ts +4 -12
- package/generators/ts/TsGenerator.js +57 -99
- package/generators/ts/Type.d.ts +117 -46
- package/generators/ts/Type.js +93 -59
- package/generators/ts/TypeFactory.d.ts +4 -5
- package/generators/ts/TypeFactory.js +224 -91
- package/generators/ts/UnionType.d.ts +20 -6
- package/generators/ts/UnionType.js +230 -120
- package/generators/ts/_ObjectType/IdentifierProperty.d.ts +27 -8
- package/generators/ts/_ObjectType/IdentifierProperty.js +153 -32
- package/generators/ts/_ObjectType/Property.d.ts +139 -9
- package/generators/ts/_ObjectType/Property.js +26 -3
- package/generators/ts/_ObjectType/ShaclProperty.d.ts +24 -5
- package/generators/ts/_ObjectType/ShaclProperty.js +103 -26
- package/generators/ts/_ObjectType/TypeDiscriminatorProperty.d.ts +23 -7
- package/generators/ts/_ObjectType/TypeDiscriminatorProperty.js +83 -14
- package/generators/ts/_ObjectType/classDeclaration.d.ts +2 -1
- package/generators/ts/_ObjectType/classDeclaration.js +79 -111
- package/generators/ts/_ObjectType/createFunctionDeclaration.d.ts +5 -0
- package/generators/ts/_ObjectType/createFunctionDeclaration.js +60 -0
- package/generators/ts/_ObjectType/equalsFunctionDeclaration.d.ts +2 -1
- package/generators/ts/_ObjectType/equalsFunctionDeclaration.js +12 -20
- package/generators/ts/_ObjectType/equalsFunctionOrMethodDeclaration.d.ts +11 -0
- package/generators/ts/_ObjectType/equalsFunctionOrMethodDeclaration.js +70 -0
- package/generators/ts/_ObjectType/fromJsonFunctionDeclarations.d.ts +4 -0
- package/generators/ts/_ObjectType/fromJsonFunctionDeclarations.js +78 -0
- package/generators/ts/_ObjectType/fromRdfFunctionDeclarations.d.ts +4 -0
- package/generators/ts/_ObjectType/fromRdfFunctionDeclarations.js +91 -0
- package/generators/ts/_ObjectType/hashFunctionDeclaration.d.ts +3 -3
- package/generators/ts/_ObjectType/hashFunctionDeclaration.js +11 -55
- package/generators/ts/_ObjectType/hashFunctionOrMethodDeclaration.d.ts +11 -0
- package/generators/ts/_ObjectType/hashFunctionOrMethodDeclaration.js +64 -0
- package/generators/ts/_ObjectType/index.d.ts +8 -2
- package/generators/ts/_ObjectType/index.js +8 -2
- package/generators/ts/_ObjectType/interfaceDeclaration.d.ts +3 -2
- package/generators/ts/_ObjectType/interfaceDeclaration.js +11 -2
- package/generators/ts/_ObjectType/jsonSchemaFunctionDeclaration.d.ts +5 -0
- package/generators/ts/_ObjectType/jsonSchemaFunctionDeclaration.js +19 -0
- package/generators/ts/_ObjectType/jsonUiSchemaFunctionDeclaration.d.ts +5 -0
- package/generators/ts/_ObjectType/jsonUiSchemaFunctionDeclaration.js +31 -0
- package/generators/ts/_ObjectType/jsonZodSchemaFunctionDeclaration.d.ts +5 -0
- package/generators/ts/_ObjectType/jsonZodSchemaFunctionDeclaration.js +37 -0
- package/generators/ts/_ObjectType/rdfjsTermExpression.d.ts +6 -0
- package/generators/ts/{rdfjsTermExpression.js → _ObjectType/rdfjsTermExpression.js} +3 -1
- package/generators/ts/_ObjectType/sparqlConstructQueryFunctionDeclaration.d.ts +5 -0
- package/generators/ts/_ObjectType/sparqlConstructQueryFunctionDeclaration.js +21 -0
- package/generators/ts/_ObjectType/sparqlConstructQueryStringFunctionDeclaration.d.ts +5 -0
- package/generators/ts/_ObjectType/sparqlConstructQueryStringFunctionDeclaration.js +20 -0
- package/generators/ts/_ObjectType/sparqlFunctionDeclarations.d.ts +4 -0
- package/generators/ts/_ObjectType/sparqlFunctionDeclarations.js +78 -0
- package/generators/ts/_ObjectType/toJsonFunctionDeclaration.d.ts +5 -0
- package/generators/ts/_ObjectType/toJsonFunctionDeclaration.js +19 -0
- package/generators/ts/_ObjectType/toJsonFunctionOrMethodDeclaration.d.ts +10 -0
- package/generators/ts/_ObjectType/toJsonFunctionOrMethodDeclaration.js +59 -0
- package/generators/ts/_ObjectType/toJsonReturnType.d.ts +3 -0
- package/generators/ts/_ObjectType/toJsonReturnType.js +19 -0
- package/generators/ts/_ObjectType/toRdfFunctionDeclaration.d.ts +3 -2
- package/generators/ts/_ObjectType/toRdfFunctionDeclaration.js +11 -45
- package/generators/ts/_ObjectType/toRdfFunctionOrMethodDeclaration.d.ts +10 -0
- package/generators/ts/_ObjectType/toRdfFunctionOrMethodDeclaration.js +67 -0
- package/generators/ts/objectInitializer.d.ts +2 -0
- package/generators/ts/objectInitializer.js +14 -0
- package/generators/ts/tsComment.d.ts +5 -0
- package/generators/ts/tsComment.js +11 -0
- package/generators/ts/tsName.d.ts +1 -1
- package/generators/ts/tsName.js +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/input/NodeShape.d.ts +46 -0
- package/input/NodeShape.js +165 -0
- package/input/Ontology.d.ts +13 -0
- package/input/Ontology.js +30 -0
- package/input/PropertyShape.d.ts +15 -0
- package/input/PropertyShape.js +34 -0
- package/input/Shape.d.ts +4 -0
- package/input/Shape.js +2 -0
- package/input/ShapesGraph.d.ts +9 -0
- package/input/ShapesGraph.js +50 -0
- package/input/ancestorClassIris.d.ts +4 -0
- package/input/ancestorClassIris.js +21 -0
- package/input/descendantClassIris.d.ts +4 -0
- package/input/descendantClassIris.js +21 -0
- package/input/generated.d.ts +275 -0
- package/input/generated.js +1436 -0
- package/input/index.d.ts +7 -0
- package/input/index.js +7 -0
- package/input/tsFeatures.d.ts +10 -0
- package/input/tsFeatures.js +46 -0
- package/package.json +15 -9
- package/ast/MintingStrategy.d.ts +0 -8
- package/ast/MintingStrategy.js +0 -9
- package/generators/ts/Configuration.d.ts +0 -29
- package/generators/ts/Configuration.js +0 -40
- package/generators/ts/IntersectionType.d.ts +0 -14
- package/generators/ts/IntersectionType.js +0 -26
- package/generators/ts/RdfjsTermType.d.ts +0 -25
- package/generators/ts/RdfjsTermType.js +0 -46
- package/generators/ts/_ObjectType/fromRdfFunctionDeclaration.d.ts +0 -4
- package/generators/ts/_ObjectType/fromRdfFunctionDeclaration.js +0 -72
- package/generators/ts/_ObjectType/sparqlGraphPatternsClassDeclaration.d.ts +0 -4
- package/generators/ts/_ObjectType/sparqlGraphPatternsClassDeclaration.js +0 -46
- package/generators/ts/rdfjsTermExpression.d.ts +0 -5
- package/vocabularies/dashDataset.d.ts +0 -3
- package/vocabularies/dashDataset.js +0 -2370
- package/vocabularies/index.d.ts +0 -2
- package/vocabularies/index.js +0 -2
- package/vocabularies/shaclmate.d.ts +0 -15
- package/vocabularies/shaclmate.js +0 -6
package/generators/ts/Type.js
CHANGED
|
@@ -1,83 +1,117 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
|
+
import { invariant } from "ts-invariant";
|
|
3
|
+
import { rdfjsTermExpression } from "./_ObjectType/rdfjsTermExpression.js";
|
|
4
|
+
import { objectInitializer } from "./objectInitializer.js";
|
|
5
|
+
/**
|
|
6
|
+
* Abstract base class for generating TypeScript expressions and statemenst in the TypeScript generator.
|
|
7
|
+
*
|
|
8
|
+
* Subclasses are used for both property types (c.f., property* methods) and node/object types.
|
|
9
|
+
*/
|
|
2
10
|
export class Type {
|
|
3
|
-
constructor({
|
|
4
|
-
this.
|
|
11
|
+
constructor({ dataFactoryVariable, }) {
|
|
12
|
+
this.dataFactoryVariable = dataFactoryVariable;
|
|
5
13
|
}
|
|
6
14
|
/**
|
|
7
|
-
*
|
|
15
|
+
* A property that discriminates sub-types of this type e.g., termType on RDF/JS terms.
|
|
8
16
|
*/
|
|
9
|
-
get
|
|
10
|
-
return
|
|
11
|
-
{
|
|
12
|
-
conversionExpression: (value) => value,
|
|
13
|
-
sourceTypeName: this.name,
|
|
14
|
-
},
|
|
15
|
-
];
|
|
17
|
+
get discriminatorProperty() {
|
|
18
|
+
return Maybe.empty();
|
|
16
19
|
}
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
21
|
+
* Element object for a JSON Forms UI schema.
|
|
19
22
|
*/
|
|
20
|
-
|
|
23
|
+
jsonUiSchemaElement(_parameters) {
|
|
21
24
|
return Maybe.empty();
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
|
-
*
|
|
27
|
+
* Reusable function, type, and other declarations that are not particular to this type but that type-specific code
|
|
28
|
+
* relies on. For example, the equals function/method of ObjectType has a custom return type that's the same across all
|
|
29
|
+
* ObjectType's. Instead of re-declaring the return type anonymously on every equals function, declare a named type
|
|
30
|
+
* as a snippet and reference it.
|
|
31
|
+
*
|
|
32
|
+
* The generator deduplicates snippet declarations across all types before adding them to the source.
|
|
25
33
|
*/
|
|
26
|
-
|
|
34
|
+
snippetDeclarations(_features) {
|
|
27
35
|
return [];
|
|
28
36
|
}
|
|
29
37
|
/**
|
|
30
|
-
* An
|
|
38
|
+
* An array of SPARQL.js CONSTRUCT template triples for a value of this type, as strings (so they can incorporate runtime calls).
|
|
39
|
+
*
|
|
40
|
+
* This method is called in two contexts:
|
|
41
|
+
* (1) By an ObjectType.Property. The property expects a basic graph pattern (subject, property path, property object). The property calls this method to get additional triples in which the propertyObject is the subject. For example, if the type is a nested object, it would include (propertyObject, nestedPredicate, nestedObject) triples.
|
|
42
|
+
* (2) By another Type. For example, ListType calls this method to with the item variable as a subject in order to chain additional patterns on items.
|
|
31
43
|
*
|
|
32
|
-
*
|
|
33
|
-
* method will return nothing.
|
|
44
|
+
* Term types with no additional properties should return an empty array.
|
|
34
45
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
sparqlConstructTemplateTriples({ context, variables, }) {
|
|
47
|
+
switch (context) {
|
|
48
|
+
case "property": {
|
|
49
|
+
const objectPrefix = `${this.dataFactoryVariable}.variable!(`;
|
|
50
|
+
const objectSuffix = ")";
|
|
51
|
+
invariant(variables.object.startsWith(objectPrefix));
|
|
52
|
+
invariant(variables.object.endsWith(objectSuffix));
|
|
53
|
+
return [
|
|
54
|
+
objectInitializer({
|
|
55
|
+
object: variables.object,
|
|
56
|
+
predicate: variables.predicate,
|
|
57
|
+
subject: variables.subject,
|
|
58
|
+
}),
|
|
59
|
+
].concat(this.sparqlConstructTemplateTriples({
|
|
60
|
+
context: "type",
|
|
61
|
+
variables: {
|
|
62
|
+
subject: variables.object,
|
|
63
|
+
variablePrefix: variables.object.substring(objectPrefix.length, variables.object.length - objectSuffix.length),
|
|
64
|
+
},
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
case "type":
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
37
70
|
}
|
|
38
71
|
/**
|
|
39
|
-
* An
|
|
72
|
+
* An array of SPARQL.js where patterns for a value of this type, as strings (so they can incorporate runtime calls).
|
|
73
|
+
*
|
|
74
|
+
* See note in sparqlConstructTemplateTriples re: how this method is used.
|
|
40
75
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
76
|
+
sparqlWherePatterns({ context, variables, }) {
|
|
77
|
+
switch (context) {
|
|
78
|
+
case "property": {
|
|
79
|
+
const objectPrefix = `${this.dataFactoryVariable}.variable!(`;
|
|
80
|
+
const objectSuffix = ")";
|
|
81
|
+
invariant(variables.object.startsWith(objectPrefix));
|
|
82
|
+
invariant(variables.object.endsWith(objectSuffix));
|
|
83
|
+
return [
|
|
84
|
+
objectInitializer({
|
|
85
|
+
triples: `[${objectInitializer({
|
|
86
|
+
object: variables.object,
|
|
87
|
+
predicate: variables.predicate,
|
|
88
|
+
subject: variables.subject,
|
|
89
|
+
})}]`,
|
|
90
|
+
type: '"bgp"',
|
|
91
|
+
}),
|
|
92
|
+
].concat(this.sparqlWherePatterns({
|
|
93
|
+
context: "type",
|
|
94
|
+
variables: {
|
|
95
|
+
subject: variables.object,
|
|
96
|
+
variablePrefix: variables.object.substring(objectPrefix.length, variables.object.length - objectSuffix.length),
|
|
97
|
+
},
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
case "type":
|
|
101
|
+
return [];
|
|
64
102
|
}
|
|
65
103
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
toSparqlGraphPatternExpression() {
|
|
72
|
-
return new SparqlGraphPatternExpression(`sparqlBuilder.GraphPattern.group(${this.value})`);
|
|
73
|
-
}
|
|
74
|
-
toSparqlGraphPatternsExpression() {
|
|
75
|
-
return this;
|
|
76
|
-
}
|
|
77
|
-
toString() {
|
|
78
|
-
return this.value;
|
|
79
|
-
}
|
|
104
|
+
/**
|
|
105
|
+
* Imports necessary to use this type.
|
|
106
|
+
*/
|
|
107
|
+
useImports(_features) {
|
|
108
|
+
return [];
|
|
80
109
|
}
|
|
81
|
-
|
|
82
|
-
|
|
110
|
+
rdfjsTermExpression(rdfjsTerm) {
|
|
111
|
+
return rdfjsTermExpression({
|
|
112
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
113
|
+
rdfjsTerm,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
83
117
|
//# sourceMappingURL=Type.js.map
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type * as ast from "../../ast";
|
|
2
|
-
import type { Configuration } from "./Configuration";
|
|
1
|
+
import type * as ast from "../../ast/index.js";
|
|
3
2
|
import type { Type } from "./Type.js";
|
|
4
3
|
export declare class TypeFactory {
|
|
5
4
|
private cachedObjectTypePropertiesByIdentifier;
|
|
6
5
|
private cachedObjectTypesByIdentifier;
|
|
7
|
-
private readonly
|
|
8
|
-
constructor({
|
|
9
|
-
|
|
6
|
+
private readonly dataFactoryVariable;
|
|
7
|
+
constructor({ dataFactoryVariable }: {
|
|
8
|
+
dataFactoryVariable: string;
|
|
10
9
|
});
|
|
11
10
|
createTypeFromAstType(astType: ast.Type): Type;
|
|
12
11
|
private createObjectTypeFromAstType;
|
|
@@ -1,101 +1,204 @@
|
|
|
1
1
|
import TermMap from "@rdfjs/term-map";
|
|
2
|
-
import
|
|
3
|
-
import { xsd } from "@tpluscode/rdf-ns-builders";
|
|
2
|
+
import TermSet from "@rdfjs/term-set";
|
|
3
|
+
import { rdf, xsd } from "@tpluscode/rdf-ns-builders";
|
|
4
4
|
import { Maybe } from "purify-ts";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { fromRdf } from "rdf-literal";
|
|
6
|
+
import { logger } from "../../logger.js";
|
|
7
|
+
import { BooleanType } from "./BooleanType.js";
|
|
8
|
+
import { DateTimeType } from "./DateTimeType.js";
|
|
9
|
+
import { IdentifierType } from "./IdentifierType.js";
|
|
8
10
|
import { ListType } from "./ListType.js";
|
|
9
11
|
import { LiteralType } from "./LiteralType.js";
|
|
10
12
|
import { NumberType } from "./NumberType.js";
|
|
11
13
|
import { ObjectType } from "./ObjectType.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
+
import { ObjectUnionType } from "./ObjectUnionType.js";
|
|
15
|
+
import { OptionType } from "./OptionType.js";
|
|
16
|
+
import { SetType } from "./SetType.js";
|
|
14
17
|
import { StringType } from "./StringType.js";
|
|
15
|
-
import {
|
|
18
|
+
import { TermType } from "./TermType.js";
|
|
19
|
+
import { UnionType } from "./UnionType.js";
|
|
16
20
|
import { tsName } from "./tsName.js";
|
|
17
21
|
export class TypeFactory {
|
|
18
|
-
constructor({
|
|
22
|
+
constructor({ dataFactoryVariable }) {
|
|
19
23
|
this.cachedObjectTypePropertiesByIdentifier = new TermMap();
|
|
20
24
|
this.cachedObjectTypesByIdentifier = new TermMap();
|
|
21
|
-
this.
|
|
25
|
+
this.dataFactoryVariable = dataFactoryVariable;
|
|
22
26
|
}
|
|
23
27
|
createTypeFromAstType(astType) {
|
|
24
28
|
switch (astType.kind) {
|
|
25
29
|
case "IdentifierType":
|
|
26
30
|
return new IdentifierType({
|
|
27
|
-
|
|
31
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
28
32
|
defaultValue: astType.defaultValue,
|
|
29
|
-
|
|
33
|
+
hasValues: astType.hasValues,
|
|
34
|
+
in_: astType.in_,
|
|
30
35
|
nodeKinds: astType.nodeKinds,
|
|
31
36
|
});
|
|
32
37
|
case "IntersectionType":
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
throw new Error("not implemented");
|
|
39
|
+
case "ListType": {
|
|
40
|
+
return new ListType({
|
|
41
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
42
|
+
identifierNodeKind: astType.identifierNodeKind,
|
|
43
|
+
itemType: this.createTypeFromAstType(astType.itemType),
|
|
44
|
+
mutable: astType.mutable.orDefault(false),
|
|
45
|
+
mintingStrategy: astType.mintingStrategy,
|
|
46
|
+
toRdfTypes: astType.toRdfTypes,
|
|
36
47
|
});
|
|
48
|
+
}
|
|
37
49
|
case "LiteralType": {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
// Look at sh:datatype as well as sh:defaultValue/sh:hasValue/sh:in term datatypes
|
|
51
|
+
// If there's one common datatype than we can refine the type
|
|
52
|
+
// Otherwise default to rdfjs.Literal
|
|
53
|
+
const datatypes = new TermSet();
|
|
54
|
+
astType.datatype.ifJust((datatype) => datatypes.add(datatype));
|
|
55
|
+
astType.defaultValue.ifJust((defaultValue) => datatypes.add(defaultValue.datatype));
|
|
56
|
+
for (const hasValue of astType.hasValues) {
|
|
57
|
+
datatypes.add(hasValue.datatype);
|
|
58
|
+
}
|
|
59
|
+
for (const value of astType.in_) {
|
|
60
|
+
datatypes.add(value.datatype);
|
|
61
|
+
}
|
|
62
|
+
if (datatypes.size === 1) {
|
|
63
|
+
const datatype = [...datatypes][0];
|
|
43
64
|
if (datatype.equals(xsd.boolean)) {
|
|
44
65
|
return new BooleanType({
|
|
45
|
-
|
|
66
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
46
67
|
defaultValue: astType.defaultValue,
|
|
47
|
-
|
|
68
|
+
hasValues: astType.hasValues,
|
|
69
|
+
languageIn: [],
|
|
70
|
+
in_: astType.in_,
|
|
71
|
+
primitiveDefaultValue: astType.defaultValue
|
|
72
|
+
.map((value) => fromRdf(value, true))
|
|
73
|
+
.filter((value) => typeof value === "boolean"),
|
|
74
|
+
primitiveIn: astType.in_
|
|
75
|
+
.map((value) => fromRdf(value, true))
|
|
76
|
+
.filter((value) => typeof value === "boolean"),
|
|
48
77
|
});
|
|
49
78
|
}
|
|
50
|
-
if (datatype.equals(xsd.
|
|
51
|
-
return new
|
|
52
|
-
|
|
79
|
+
if (datatype.equals(xsd.dateTime)) {
|
|
80
|
+
return new DateTimeType({
|
|
81
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
53
82
|
defaultValue: astType.defaultValue,
|
|
54
|
-
|
|
83
|
+
hasValues: astType.hasValues,
|
|
84
|
+
in_: astType.in_,
|
|
85
|
+
languageIn: [],
|
|
86
|
+
primitiveDefaultValue: astType.defaultValue
|
|
87
|
+
.map((value) => fromRdf(value, true))
|
|
88
|
+
.filter((value) => typeof value === "object" && value instanceof Date),
|
|
89
|
+
primitiveIn: astType.in_
|
|
90
|
+
.map((value) => fromRdf(value, true))
|
|
91
|
+
.filter((value) => typeof value === "object" && value instanceof Date),
|
|
55
92
|
});
|
|
56
93
|
}
|
|
94
|
+
for (const numberDatatype of [
|
|
95
|
+
// Integers
|
|
96
|
+
xsd.byte,
|
|
97
|
+
xsd.int,
|
|
98
|
+
xsd.integer,
|
|
99
|
+
xsd.long,
|
|
100
|
+
xsd.negativeInteger,
|
|
101
|
+
xsd.nonNegativeInteger,
|
|
102
|
+
xsd.nonPositiveInteger,
|
|
103
|
+
xsd.positiveInteger,
|
|
104
|
+
xsd.short,
|
|
105
|
+
xsd.unsignedByte,
|
|
106
|
+
xsd.unsignedInt,
|
|
107
|
+
xsd.unsignedLong,
|
|
108
|
+
xsd.unsignedShort,
|
|
109
|
+
// Floating point
|
|
110
|
+
xsd.decimal,
|
|
111
|
+
xsd.double,
|
|
112
|
+
xsd.float,
|
|
113
|
+
]) {
|
|
114
|
+
if (datatype.equals(numberDatatype)) {
|
|
115
|
+
return new NumberType({
|
|
116
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
117
|
+
defaultValue: astType.defaultValue,
|
|
118
|
+
hasValues: astType.hasValues,
|
|
119
|
+
in_: astType.in_,
|
|
120
|
+
languageIn: [],
|
|
121
|
+
primitiveDefaultValue: astType.defaultValue
|
|
122
|
+
.map((value) => fromRdf(value, true))
|
|
123
|
+
.filter((value) => typeof value === "number"),
|
|
124
|
+
primitiveIn: astType.in_
|
|
125
|
+
.map((value) => fromRdf(value, true))
|
|
126
|
+
.filter((value) => typeof value === "number"),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
57
130
|
if (datatype.equals(xsd.anyURI) || datatype.equals(xsd.string)) {
|
|
58
131
|
return new StringType({
|
|
59
|
-
|
|
132
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
60
133
|
defaultValue: astType.defaultValue,
|
|
61
|
-
|
|
134
|
+
hasValues: astType.hasValues,
|
|
135
|
+
languageIn: [],
|
|
136
|
+
in_: astType.in_,
|
|
137
|
+
primitiveDefaultValue: astType.defaultValue.map((value) => value.value),
|
|
138
|
+
primitiveIn: astType.in_.map((value) => value.value),
|
|
62
139
|
});
|
|
63
140
|
}
|
|
141
|
+
if (datatype.equals(rdf.langString)) {
|
|
142
|
+
// Drop down
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
logger.warn("unrecognized literal datatype: %s", datatype.value);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else if (datatypes.size > 0) {
|
|
149
|
+
logger.warn("literal type has multiple datatypes: %s", JSON.stringify([...datatypes].map((datatype) => datatype.value)));
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
logger.debug("literal type has no datatypes");
|
|
64
153
|
}
|
|
65
154
|
return new LiteralType({
|
|
66
|
-
|
|
155
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
67
156
|
defaultValue: astType.defaultValue,
|
|
68
|
-
|
|
157
|
+
hasValues: astType.hasValues,
|
|
158
|
+
in_: astType.in_,
|
|
159
|
+
languageIn: astType.languageIn,
|
|
69
160
|
});
|
|
70
161
|
}
|
|
71
|
-
case "
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
configuration: this.configuration,
|
|
75
|
-
identifierNodeKind: astType.nodeKinds.has(NodeKind.BLANK_NODE)
|
|
76
|
-
? NodeKind.BLANK_NODE
|
|
77
|
-
: NodeKind.IRI,
|
|
78
|
-
itemType: this.createTypeFromAstType(astType.listItemType.unsafeCoerce()),
|
|
79
|
-
mintingStrategy: astType.mintingStrategy,
|
|
80
|
-
rdfType: astType.rdfType,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
162
|
+
case "ObjectIntersectionType":
|
|
163
|
+
throw new Error("not implemented");
|
|
164
|
+
case "ObjectType":
|
|
83
165
|
return this.createObjectTypeFromAstType(astType);
|
|
84
|
-
|
|
166
|
+
case "ObjectUnionType":
|
|
167
|
+
return new ObjectUnionType({
|
|
168
|
+
comment: astType.comment,
|
|
169
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
170
|
+
export_: astType.export,
|
|
171
|
+
features: astType.tsFeatures,
|
|
172
|
+
label: astType.label,
|
|
173
|
+
memberTypes: astType.memberTypes
|
|
174
|
+
.map((astType) => this.createTypeFromAstType(astType))
|
|
175
|
+
.filter((memberType) => memberType instanceof ObjectType),
|
|
176
|
+
name: tsName(astType.name),
|
|
177
|
+
});
|
|
85
178
|
case "OptionType":
|
|
86
179
|
return new OptionType({
|
|
87
|
-
|
|
180
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
88
181
|
itemType: this.createTypeFromAstType(astType.itemType),
|
|
89
182
|
});
|
|
183
|
+
case "PlaceholderType":
|
|
184
|
+
throw new Error(astType.kind);
|
|
90
185
|
case "SetType":
|
|
91
186
|
return new SetType({
|
|
92
|
-
|
|
187
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
93
188
|
itemType: this.createTypeFromAstType(astType.itemType),
|
|
94
189
|
minCount: astType.minCount,
|
|
95
190
|
});
|
|
191
|
+
case "TermType":
|
|
192
|
+
return new TermType({
|
|
193
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
194
|
+
defaultValue: astType.defaultValue,
|
|
195
|
+
hasValues: astType.hasValues,
|
|
196
|
+
in_: astType.in_,
|
|
197
|
+
nodeKinds: astType.nodeKinds,
|
|
198
|
+
});
|
|
96
199
|
case "UnionType":
|
|
97
200
|
return new UnionType({
|
|
98
|
-
|
|
201
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
99
202
|
memberTypes: astType.memberTypes.map((astType) => this.createTypeFromAstType(astType)),
|
|
100
203
|
});
|
|
101
204
|
}
|
|
@@ -108,29 +211,60 @@ export class TypeFactory {
|
|
|
108
211
|
}
|
|
109
212
|
}
|
|
110
213
|
const identifierType = new IdentifierType({
|
|
111
|
-
|
|
214
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
112
215
|
defaultValue: Maybe.empty(),
|
|
113
|
-
|
|
216
|
+
hasValues: [],
|
|
217
|
+
in_: [],
|
|
114
218
|
nodeKinds: astType.nodeKinds,
|
|
115
219
|
});
|
|
116
220
|
const objectType = new ObjectType({
|
|
117
221
|
abstract: astType.abstract,
|
|
118
|
-
|
|
222
|
+
comment: astType.comment,
|
|
223
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
224
|
+
declarationType: astType.tsObjectDeclarationType,
|
|
119
225
|
export_: astType.export,
|
|
120
|
-
|
|
226
|
+
extern: astType.extern,
|
|
227
|
+
features: astType.tsFeatures,
|
|
228
|
+
fromRdfType: astType.fromRdfType,
|
|
229
|
+
imports: astType.tsImports,
|
|
230
|
+
label: astType.label,
|
|
121
231
|
lazyAncestorObjectTypes: () => astType.ancestorObjectTypes.map((astType) => this.createObjectTypeFromAstType(astType)),
|
|
122
232
|
lazyDescendantObjectTypes: () => astType.descendantObjectTypes.map((astType) => this.createObjectTypeFromAstType(astType)),
|
|
123
233
|
lazyParentObjectTypes: () => astType.parentObjectTypes.map((astType) => this.createObjectTypeFromAstType(astType)),
|
|
124
234
|
lazyProperties: () => {
|
|
125
|
-
const properties = astType.properties.map((astProperty) => this.createObjectTypePropertyFromAstProperty(astProperty));
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
235
|
+
const properties = astType.properties.map((astProperty) => this.createObjectTypePropertyFromAstProperty(astType, astProperty));
|
|
236
|
+
let identifierPropertyClassDeclarationVisibility;
|
|
237
|
+
if (astType.abstract) {
|
|
238
|
+
// If the type is abstract, don't declare a property.
|
|
239
|
+
identifierPropertyClassDeclarationVisibility = Maybe.empty();
|
|
240
|
+
}
|
|
241
|
+
else if (astType.ancestorObjectTypes.some((ancestorObjectType) => !ancestorObjectType.abstract)) {
|
|
242
|
+
// If the type has a non-abstract ancestor, that ancestor will declare the identifier property
|
|
243
|
+
identifierPropertyClassDeclarationVisibility = Maybe.empty();
|
|
244
|
+
}
|
|
245
|
+
else if (astType.descendantObjectTypes.some((descendantObjectType) => !descendantObjectType.abstract)) {
|
|
246
|
+
// If the type has a non-abstract descendant, declare the identifier property for it
|
|
247
|
+
identifierPropertyClassDeclarationVisibility = Maybe.of("protected");
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
identifierPropertyClassDeclarationVisibility = Maybe.of("private");
|
|
251
|
+
}
|
|
252
|
+
const identifierProperty = new ObjectType.IdentifierProperty({
|
|
253
|
+
abstract: astType.abstract,
|
|
254
|
+
classDeclarationVisibility: identifierPropertyClassDeclarationVisibility,
|
|
255
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
256
|
+
mintingStrategy: astType.mintingStrategy,
|
|
257
|
+
name: astType.tsIdentifierPropertyName,
|
|
258
|
+
lazyObjectTypeMutable: () => properties.some((property) => property.mutable || property.type.mutable),
|
|
259
|
+
objectType: {
|
|
260
|
+
declarationType: astType.tsObjectDeclarationType,
|
|
261
|
+
features: astType.tsFeatures,
|
|
262
|
+
},
|
|
263
|
+
override: astType.parentObjectTypes.length > 0,
|
|
264
|
+
type: identifierType,
|
|
265
|
+
visibility: "public",
|
|
266
|
+
});
|
|
267
|
+
properties.push(identifierProperty);
|
|
134
268
|
// Type discriminator property
|
|
135
269
|
const typeDiscriminatorValues = new Set();
|
|
136
270
|
if (!astType.abstract) {
|
|
@@ -141,55 +275,54 @@ export class TypeFactory {
|
|
|
141
275
|
typeDiscriminatorValues.add(descendantObjectType.discriminatorValue);
|
|
142
276
|
}
|
|
143
277
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
278
|
+
if (typeDiscriminatorValues.size > 0) {
|
|
279
|
+
properties.push(new ObjectType.TypeDiscriminatorProperty({
|
|
280
|
+
abstract: astType.abstract,
|
|
281
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
282
|
+
name: astType.tsTypeDiscriminatorPropertyName,
|
|
283
|
+
objectType: {
|
|
284
|
+
declarationType: astType.tsObjectDeclarationType,
|
|
285
|
+
features: astType.tsFeatures,
|
|
286
|
+
},
|
|
287
|
+
override: objectType.parentObjectTypes.length > 0,
|
|
288
|
+
type: new ObjectType.TypeDiscriminatorProperty.Type({
|
|
289
|
+
mutable: false,
|
|
290
|
+
values: [...typeDiscriminatorValues].sort(),
|
|
291
|
+
}),
|
|
292
|
+
visibility: "public",
|
|
293
|
+
value: objectType.discriminatorValue,
|
|
294
|
+
}));
|
|
295
|
+
}
|
|
158
296
|
return properties.sort((left, right) => left.name.localeCompare(right.name));
|
|
159
297
|
},
|
|
160
298
|
mintingStrategy: astType.mintingStrategy,
|
|
161
299
|
name: tsName(astType.name),
|
|
162
|
-
|
|
300
|
+
toRdfTypes: astType.toRdfTypes,
|
|
163
301
|
});
|
|
164
302
|
this.cachedObjectTypesByIdentifier.set(astType.name.identifier, objectType);
|
|
165
303
|
return objectType;
|
|
166
304
|
}
|
|
167
|
-
createObjectTypePropertyFromAstProperty(astObjectTypeProperty) {
|
|
305
|
+
createObjectTypePropertyFromAstProperty(astObjectType, astObjectTypeProperty) {
|
|
168
306
|
{
|
|
169
307
|
const cachedProperty = this.cachedObjectTypePropertiesByIdentifier.get(astObjectTypeProperty.name.identifier);
|
|
170
308
|
if (cachedProperty) {
|
|
171
309
|
return cachedProperty;
|
|
172
310
|
}
|
|
173
311
|
}
|
|
174
|
-
let type;
|
|
175
|
-
if (astObjectTypeProperty.type.kind === "ObjectType" &&
|
|
176
|
-
!astObjectTypeProperty.inline) {
|
|
177
|
-
// Non-inlined object type = its identifier
|
|
178
|
-
type = new IdentifierType({
|
|
179
|
-
configuration: this.configuration,
|
|
180
|
-
defaultValue: Maybe.empty(),
|
|
181
|
-
hasValue: Maybe.empty(),
|
|
182
|
-
nodeKinds: astObjectTypeProperty.type.nodeKinds,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
type = this.createTypeFromAstType(astObjectTypeProperty.type);
|
|
187
|
-
}
|
|
188
312
|
const property = new ObjectType.ShaclProperty({
|
|
189
|
-
|
|
313
|
+
comment: astObjectTypeProperty.comment,
|
|
314
|
+
dataFactoryVariable: this.dataFactoryVariable,
|
|
315
|
+
description: astObjectTypeProperty.description,
|
|
316
|
+
label: astObjectTypeProperty.label,
|
|
317
|
+
mutable: astObjectTypeProperty.mutable.orDefault(false),
|
|
318
|
+
objectType: {
|
|
319
|
+
declarationType: astObjectType.tsObjectDeclarationType,
|
|
320
|
+
features: astObjectType.tsFeatures,
|
|
321
|
+
},
|
|
190
322
|
name: tsName(astObjectTypeProperty.name),
|
|
191
323
|
path: astObjectTypeProperty.path.iri,
|
|
192
|
-
type,
|
|
324
|
+
type: this.createTypeFromAstType(astObjectTypeProperty.type),
|
|
325
|
+
visibility: astObjectTypeProperty.visibility,
|
|
193
326
|
});
|
|
194
327
|
this.cachedObjectTypePropertiesByIdentifier.set(astObjectTypeProperty.name.identifier, property);
|
|
195
328
|
return property;
|
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { TsFeature } from "../../enums/index.js";
|
|
3
|
+
import type { Import } from "./Import.js";
|
|
2
4
|
import { Type } from "./Type.js";
|
|
3
5
|
export declare class UnionType extends Type {
|
|
4
6
|
readonly kind = "UnionType";
|
|
5
7
|
readonly memberTypes: readonly Type[];
|
|
6
|
-
constructor({ memberTypes, ...superParameters }: ConstructorParameters<typeof Type>[0] & {
|
|
8
|
+
constructor({ memberTypes, name, ...superParameters }: ConstructorParameters<typeof Type>[0] & {
|
|
7
9
|
memberTypes: readonly Type[];
|
|
10
|
+
name?: string;
|
|
8
11
|
});
|
|
9
|
-
|
|
12
|
+
private _name?;
|
|
10
13
|
get name(): string;
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
get conversions(): readonly Type.Conversion[];
|
|
15
|
+
get discriminatorProperty(): Maybe<Type.DiscriminatorProperty>;
|
|
16
|
+
get equalsFunction(): string;
|
|
17
|
+
get jsonName(): string;
|
|
18
|
+
get mutable(): boolean;
|
|
19
|
+
private get _discriminatorProperty();
|
|
20
|
+
private get memberTypeTraits();
|
|
21
|
+
fromJsonExpression({ variables, }: Parameters<Type["fromJsonExpression"]>[0]): string;
|
|
13
22
|
fromRdfExpression(parameters: Parameters<Type["fromRdfExpression"]>[0]): string;
|
|
14
|
-
hashStatements({ variables, }: Parameters<Type["hashStatements"]>[0]): readonly string[];
|
|
15
|
-
|
|
23
|
+
hashStatements({ depth, variables, }: Parameters<Type["hashStatements"]>[0]): readonly string[];
|
|
24
|
+
jsonZodSchema({ variables, }: Parameters<Type["jsonZodSchema"]>[0]): ReturnType<Type["jsonZodSchema"]>;
|
|
25
|
+
sparqlConstructTemplateTriples(parameters: Parameters<Type["sparqlConstructTemplateTriples"]>[0]): readonly string[];
|
|
26
|
+
sparqlWherePatterns(parameters: Parameters<Type["sparqlWherePatterns"]>[0]): readonly string[];
|
|
27
|
+
toJsonExpression({ variables, }: Parameters<Type["toJsonExpression"]>[0]): string;
|
|
16
28
|
toRdfExpression({ variables, }: Parameters<Type["toRdfExpression"]>[0]): string;
|
|
29
|
+
useImports(features: Set<TsFeature>): readonly Import[];
|
|
30
|
+
private ternaryExpression;
|
|
17
31
|
}
|
|
18
32
|
//# sourceMappingURL=UnionType.d.ts.map
|