@shaclmate/compiler 4.0.39 → 4.0.41
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/dist/ShapesGraphToAstTransformer.d.ts +0 -8
- package/dist/ShapesGraphToAstTransformer.js +5 -85
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +128 -160
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +0 -16
- package/dist/ast/AbstractCompoundType.d.ts +2 -1
- package/dist/ast/AbstractCompoundType.js +1 -1
- package/dist/ast/AbstractLazyObjectType.d.ts +0 -2
- package/dist/ast/Ast.d.ts +1 -3
- package/dist/ast/ListType.d.ts +1 -1
- package/dist/ast/ListType.js +1 -1
- package/dist/ast/ObjectType.d.ts +0 -12
- package/dist/ast/ObjectType.js +0 -78
- package/dist/generators/AstJsonGenerator.js +7 -3
- package/dist/generators/transformAstToLabeledPropertyGraph.js +59 -56
- package/dist/generators/ts/AbstractCollectionType.d.ts +5 -12
- package/dist/generators/ts/AbstractCollectionType.js +9 -68
- package/dist/generators/ts/AbstractContainerType.d.ts +4 -6
- package/dist/generators/ts/AbstractContainerType.js +5 -9
- package/dist/generators/ts/AbstractDateType.d.ts +6 -3
- package/dist/generators/ts/AbstractDateType.js +7 -2
- package/dist/generators/ts/AbstractIdentifierType.d.ts +4 -0
- package/dist/generators/ts/AbstractIdentifierType.js +3 -0
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +9 -9
- package/dist/generators/ts/AbstractLazyObjectType.js +30 -19
- package/dist/generators/ts/AbstractLiteralType.d.ts +1 -0
- package/dist/generators/ts/AbstractNumericType.d.ts +1 -1
- package/dist/generators/ts/AbstractNumericType.js +9 -9
- package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
- package/dist/generators/ts/AbstractObjectSetType.js +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -0
- package/dist/generators/ts/AbstractPrimitiveType.js +2 -2
- package/dist/generators/ts/AbstractTermType.d.ts +1 -2
- package/dist/generators/ts/AbstractTermType.js +3 -5
- package/dist/generators/ts/AbstractType.d.ts +61 -26
- package/dist/generators/ts/AbstractType.js +37 -17
- package/dist/generators/ts/BigDecimalType.d.ts +5 -1
- package/dist/generators/ts/BigDecimalType.js +6 -3
- package/dist/generators/ts/BigIntType.d.ts +3 -1
- package/dist/generators/ts/BigIntType.js +3 -3
- package/dist/generators/ts/BlankNodeType.d.ts +3 -3
- package/dist/generators/ts/BlankNodeType.js +13 -13
- package/dist/generators/ts/BooleanType.d.ts +5 -3
- package/dist/generators/ts/BooleanType.js +11 -6
- package/dist/generators/ts/DefaultValueType.d.ts +40 -2
- package/dist/generators/ts/DefaultValueType.js +14 -12
- package/dist/generators/ts/FloatType.d.ts +3 -1
- package/dist/generators/ts/FloatType.js +1 -1
- package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
- package/dist/generators/ts/GraphqlSchema.js +6 -6
- package/dist/generators/ts/IdentifierType.d.ts +3 -3
- package/dist/generators/ts/IdentifierType.js +19 -17
- package/dist/generators/ts/IntType.d.ts +3 -1
- package/dist/generators/ts/IntType.js +1 -1
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +21 -19
- package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -0
- package/dist/generators/ts/LazyObjectOptionType.js +14 -10
- package/dist/generators/ts/LazyObjectSetType.js +14 -8
- package/dist/generators/ts/LazyObjectType.js +9 -6
- package/dist/generators/ts/ListType.d.ts +13 -5
- package/dist/generators/ts/ListType.js +48 -12
- package/dist/generators/ts/LiteralType.d.ts +5 -1
- package/dist/generators/ts/LiteralType.js +11 -8
- package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +19 -34
- package/dist/generators/ts/ObjectType.js +282 -0
- package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
- package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +52 -60
- package/dist/generators/ts/OptionType.d.ts +6 -2
- package/dist/generators/ts/OptionType.js +20 -15
- package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -11
- package/dist/generators/ts/SetType.d.ts +16 -1
- package/dist/generators/ts/SetType.js +80 -2
- package/dist/generators/ts/Snippets.d.ts +3 -1
- package/dist/generators/ts/Snippets.js +18 -4
- package/dist/generators/ts/SparqlObjectSetType.js +2 -2
- package/dist/generators/ts/StringType.d.ts +5 -3
- package/dist/generators/ts/StringType.js +15 -6
- package/dist/generators/ts/TermType.d.ts +6 -2
- package/dist/generators/ts/TermType.js +15 -12
- package/dist/generators/ts/TsGenerator.d.ts +1 -1
- package/dist/generators/ts/TsGenerator.js +60 -32
- package/dist/generators/ts/Type.d.ts +4 -5
- package/dist/generators/ts/TypeFactory.d.ts +7 -8
- package/dist/generators/ts/TypeFactory.js +62 -76
- package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +36 -11
- package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +296 -105
- package/dist/generators/ts/ZodGenerator.d.ts +1 -1
- package/dist/generators/ts/ZodGenerator.js +21 -16
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +9 -6
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +3 -3
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +9 -13
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +22 -39
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +1 -5
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +18 -13
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +44 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +3 -7
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -6
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +2 -5
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +2 -6
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -24
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js +51 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +41 -0
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +5 -11
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +9 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -6
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +12 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +7 -14
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +12 -12
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.js +16 -0
- package/dist/generators/ts/_snippets/snippets_convertToArraySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToArraySet.js +8 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.js +7 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.js +15 -0
- package/dist/input/generated.d.ts +758 -117
- package/dist/input/generated.js +636 -128
- package/package.json +4 -6
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
- package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
- package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
- package/dist/generators/ts/AnonymousUnionType.js +0 -59
- package/dist/generators/ts/NamedObjectType.js +0 -342
- package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
- package/dist/generators/ts/NamedUnionType.d.ts +0 -11
- package/dist/generators/ts/NamedUnionType.js +0 -13
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.js +0 -65
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +0 -43
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +0 -80
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js +0 -45
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.js +0 -16
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js +0 -17
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +0 -16
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js +0 -41
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.js +0 -25
- package/dist/generators/ts/_snippets/snippets_convertToArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToArray.js +0 -8
- /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
- /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
- /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { AnonymousUnionType } from "./AnonymousUnionType.js";
|
|
2
1
|
import type { BigDecimalType } from "./BigDecimalType.js";
|
|
3
2
|
import type { BigIntType } from "./BigIntType.js";
|
|
4
3
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
@@ -15,12 +14,12 @@ import type { LazyObjectSetType } from "./LazyObjectSetType.js";
|
|
|
15
14
|
import type { LazyObjectType } from "./LazyObjectType.js";
|
|
16
15
|
import type { ListType } from "./ListType.js";
|
|
17
16
|
import type { LiteralType } from "./LiteralType.js";
|
|
18
|
-
import type {
|
|
19
|
-
import type {
|
|
20
|
-
import type { NamedUnionType } from "./NamedUnionType.js";
|
|
17
|
+
import type { ObjectType } from "./ObjectType.js";
|
|
18
|
+
import type { ObjectUnionType } from "./ObjectUnionType.js";
|
|
21
19
|
import type { OptionType } from "./OptionType.js";
|
|
22
20
|
import type { SetType } from "./SetType.js";
|
|
23
21
|
import type { StringType } from "./StringType.js";
|
|
24
22
|
import type { TermType } from "./TermType.js";
|
|
25
|
-
|
|
23
|
+
import type { UnionType } from "./UnionType.js";
|
|
24
|
+
export type Type = BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | DefaultValueType<DefaultValueType.ItemType> | FloatType | IdentifierType | IntType | IriType | LazyObjectOptionType | LazyObjectSetType | LazyObjectType | ListType<ListType.ItemType> | LiteralType | ObjectUnionType | ObjectType | OptionType<OptionType.ItemType> | SetType<SetType.ItemType> | StringType | TermType | UnionType<Type>;
|
|
26
25
|
//# sourceMappingURL=Type.d.ts.map
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import type { Literal, NamedNode } from "@rdfjs/types";
|
|
2
2
|
import type { Logger } from "ts-log";
|
|
3
3
|
import * as ast from "../../ast/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { NamedObjectUnionType } from "./NamedObjectUnionType.js";
|
|
7
|
-
import { NamedUnionType } from "./NamedUnionType.js";
|
|
4
|
+
import { ObjectType } from "./ObjectType.js";
|
|
5
|
+
import { ObjectUnionType } from "./ObjectUnionType.js";
|
|
8
6
|
import type { Reusables } from "./Reusables.js";
|
|
9
7
|
import type { TsGenerator } from "./TsGenerator.js";
|
|
10
8
|
import type { Type } from "./Type.js";
|
|
9
|
+
import { UnionType } from "./UnionType.js";
|
|
11
10
|
export declare class TypeFactory {
|
|
12
11
|
private readonly configuration;
|
|
13
12
|
private readonly logger;
|
|
14
13
|
private readonly reusables;
|
|
15
|
-
private
|
|
14
|
+
private cachedObjectUnionTypesByShapeIdentifier;
|
|
16
15
|
private cachedObjectTypePropertiesByShapeIdentifier;
|
|
17
16
|
private cachedObjectTypesByShapeIdentifier;
|
|
18
17
|
constructor({ configuration, logger, reusables, }: {
|
|
@@ -20,12 +19,12 @@ export declare class TypeFactory {
|
|
|
20
19
|
logger: Logger;
|
|
21
20
|
reusables: Reusables;
|
|
22
21
|
});
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
createObjectType(astType: ast.ObjectType): ObjectType;
|
|
23
|
+
createObjectUnionType(astType: ast.ObjectUnionType): ObjectUnionType;
|
|
25
24
|
createType(astType: ast.Type, parameters?: {
|
|
26
25
|
defaultValue?: Literal | NamedNode;
|
|
27
26
|
}): Type;
|
|
28
|
-
createUnionType(astType: ast.UnionType):
|
|
27
|
+
createUnionType(astType: ast.UnionType): ObjectUnionType | UnionType<Type>;
|
|
29
28
|
private createBlankNodeType;
|
|
30
29
|
private createDefaultValueType;
|
|
31
30
|
private createIdentifierType;
|
|
@@ -7,7 +7,6 @@ import { Maybe } from "purify-ts";
|
|
|
7
7
|
import reservedTsIdentifiers_ from "reserved-identifiers";
|
|
8
8
|
import { invariant } from "ts-invariant";
|
|
9
9
|
import * as ast from "../../ast/index.js";
|
|
10
|
-
import { AnonymousUnionType } from "./AnonymousUnionType.js";
|
|
11
10
|
import { BigDecimalType } from "./BigDecimalType.js";
|
|
12
11
|
import { BigIntType } from "./BigIntType.js";
|
|
13
12
|
import { BlankNodeType } from "./BlankNodeType.js";
|
|
@@ -24,19 +23,18 @@ import { LazyObjectSetType } from "./LazyObjectSetType.js";
|
|
|
24
23
|
import { LazyObjectType } from "./LazyObjectType.js";
|
|
25
24
|
import { ListType } from "./ListType.js";
|
|
26
25
|
import { LiteralType } from "./LiteralType.js";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { NamedUnionType } from "./NamedUnionType.js";
|
|
26
|
+
import { ObjectType } from "./ObjectType.js";
|
|
27
|
+
import { ObjectUnionType } from "./ObjectUnionType.js";
|
|
30
28
|
import { OptionType } from "./OptionType.js";
|
|
31
29
|
import { SetType } from "./SetType.js";
|
|
32
30
|
import { StringType } from "./StringType.js";
|
|
33
31
|
import { TermType } from "./TermType.js";
|
|
34
|
-
import {
|
|
32
|
+
import { UnionType } from "./UnionType.js";
|
|
35
33
|
export class TypeFactory {
|
|
36
34
|
configuration;
|
|
37
35
|
logger;
|
|
38
36
|
reusables;
|
|
39
|
-
|
|
37
|
+
cachedObjectUnionTypesByShapeIdentifier = new TermMap();
|
|
40
38
|
cachedObjectTypePropertiesByShapeIdentifier = new TermMap();
|
|
41
39
|
cachedObjectTypesByShapeIdentifier = new TermMap();
|
|
42
40
|
constructor({ configuration, logger, reusables, }) {
|
|
@@ -44,48 +42,32 @@ export class TypeFactory {
|
|
|
44
42
|
this.logger = logger;
|
|
45
43
|
this.reusables = reusables;
|
|
46
44
|
}
|
|
47
|
-
|
|
45
|
+
createObjectType(astType) {
|
|
48
46
|
{
|
|
49
47
|
const cachedObjectType = this.cachedObjectTypesByShapeIdentifier.get(astType.shapeIdentifier);
|
|
50
48
|
if (cachedObjectType) {
|
|
51
49
|
return cachedObjectType;
|
|
52
50
|
}
|
|
53
51
|
}
|
|
52
|
+
const discriminantProperty = astType.name.map((name) => new ObjectType.DiscriminantProperty({
|
|
53
|
+
configuration: this.configuration,
|
|
54
|
+
logger: this.logger,
|
|
55
|
+
name: `${this.configuration.syntheticNamePrefix}type`,
|
|
56
|
+
objectType: { alias: astType.name },
|
|
57
|
+
reusables: this.reusables,
|
|
58
|
+
value: name,
|
|
59
|
+
}));
|
|
54
60
|
const identifierType = this.createIdentifierType(astType.identifierType);
|
|
55
|
-
const
|
|
56
|
-
synthetic: astType.synthetic,
|
|
57
|
-
|
|
58
|
-
const namedObjectType = new NamedObjectType({
|
|
61
|
+
const objectType = new ObjectType({
|
|
62
|
+
alias: astType.name.map((name) => this.tsName(name, { synthetic: astType.synthetic })),
|
|
63
|
+
discriminantProperty,
|
|
59
64
|
comment: astType.comment,
|
|
60
65
|
configuration: this.configuration,
|
|
61
66
|
extern: astType.extern,
|
|
62
67
|
fromRdfType: astType.fromRdfType,
|
|
63
68
|
identifierType,
|
|
64
69
|
label: astType.label,
|
|
65
|
-
|
|
66
|
-
lazyChildObjectTypes: () => astType.childObjectTypes.map((astType) => this.createNamedObjectType(astType)),
|
|
67
|
-
lazyDescendantObjectTypes: () => astType.descendantObjectTypes.map((astType) => this.createNamedObjectType(astType)),
|
|
68
|
-
lazyDiscriminantProperty: (namedObjectType) => {
|
|
69
|
-
// Discriminant property
|
|
70
|
-
const discriminantDescendantValues = new Set();
|
|
71
|
-
for (const descendantObjectType of namedObjectType.descendantObjectTypes) {
|
|
72
|
-
discriminantDescendantValues.add(descendantObjectType.discriminantValue);
|
|
73
|
-
}
|
|
74
|
-
return new NamedObjectType.DiscriminantProperty({
|
|
75
|
-
configuration: this.configuration,
|
|
76
|
-
logger: this.logger,
|
|
77
|
-
name: `${this.configuration.syntheticNamePrefix}type`,
|
|
78
|
-
namedObjectType,
|
|
79
|
-
reusables: this.reusables,
|
|
80
|
-
type: new NamedObjectType.DiscriminantProperty.Type({
|
|
81
|
-
descendantValues: [...discriminantDescendantValues].sort(),
|
|
82
|
-
mutable: false,
|
|
83
|
-
ownValues: [namedObjectType.discriminantValue],
|
|
84
|
-
}),
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
lazyParentObjectTypes: () => astType.parentObjectTypes.map((astType) => this.createNamedObjectType(astType)),
|
|
88
|
-
lazyProperties: (namedObjectType) => {
|
|
70
|
+
lazyProperties: (objectType) => {
|
|
89
71
|
const properties = astType.properties
|
|
90
72
|
.toSorted((left, right) => {
|
|
91
73
|
if (left.order < right.order) {
|
|
@@ -98,54 +80,54 @@ export class TypeFactory {
|
|
|
98
80
|
})
|
|
99
81
|
.map((astProperty) => this.createObjectTypeProperty({
|
|
100
82
|
astObjectTypeProperty: astProperty,
|
|
101
|
-
|
|
83
|
+
objectType,
|
|
102
84
|
}));
|
|
103
|
-
|
|
104
|
-
|
|
85
|
+
discriminantProperty.ifJust((discriminantProperty) => {
|
|
86
|
+
properties.splice(0, 0, discriminantProperty);
|
|
87
|
+
});
|
|
88
|
+
properties.splice(0, 0, new ObjectType.IdentifierProperty({
|
|
105
89
|
configuration: this.configuration,
|
|
106
90
|
logger: this.logger,
|
|
107
91
|
name: `${this.configuration.syntheticNamePrefix}identifier`,
|
|
108
|
-
|
|
92
|
+
objectType,
|
|
109
93
|
reusables: this.reusables,
|
|
110
94
|
type: identifierType,
|
|
111
|
-
typeAlias: code `${name}.Identifier`,
|
|
112
95
|
}));
|
|
113
96
|
return properties;
|
|
114
97
|
},
|
|
115
98
|
logger: this.logger,
|
|
116
|
-
name,
|
|
117
99
|
recursive: astType.recursive,
|
|
118
100
|
reusables: this.reusables,
|
|
119
101
|
synthetic: astType.synthetic,
|
|
120
102
|
toRdfTypes: astType.toRdfTypes,
|
|
121
103
|
});
|
|
122
|
-
this.cachedObjectTypesByShapeIdentifier.set(astType.shapeIdentifier,
|
|
123
|
-
return
|
|
104
|
+
this.cachedObjectTypesByShapeIdentifier.set(astType.shapeIdentifier, objectType);
|
|
105
|
+
return objectType;
|
|
124
106
|
}
|
|
125
|
-
|
|
107
|
+
createObjectUnionType(astType) {
|
|
126
108
|
{
|
|
127
|
-
const
|
|
128
|
-
if (
|
|
129
|
-
return
|
|
109
|
+
const cachedObjectUnionType = this.cachedObjectUnionTypesByShapeIdentifier.get(astType.shapeIdentifier);
|
|
110
|
+
if (cachedObjectUnionType) {
|
|
111
|
+
return cachedObjectUnionType;
|
|
130
112
|
}
|
|
131
113
|
}
|
|
132
|
-
const
|
|
114
|
+
const objectUnionType = new ObjectUnionType({
|
|
115
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
133
116
|
comment: astType.comment,
|
|
134
117
|
configuration: this.configuration,
|
|
135
|
-
identifierType: this.createIdentifierType(ast.ObjectCompoundType.identifierType(astType)),
|
|
118
|
+
identifierType: Maybe.of(this.createIdentifierType(ast.ObjectCompoundType.identifierType(astType))),
|
|
136
119
|
label: astType.label,
|
|
137
120
|
logger: this.logger,
|
|
138
121
|
members: ast.ObjectCompoundType.memberObjectTypes(astType).map((namedObjectType) => ({
|
|
139
122
|
discriminantValue: Maybe.empty(),
|
|
140
|
-
type: this.
|
|
123
|
+
type: this.createObjectType(namedObjectType),
|
|
141
124
|
})),
|
|
142
|
-
name: this.tsName(astType.name.unsafeCoerce()),
|
|
143
125
|
recursive: astType.recursive,
|
|
144
126
|
reusables: this.reusables,
|
|
145
127
|
synthetic: astType.synthetic,
|
|
146
128
|
});
|
|
147
|
-
this.
|
|
148
|
-
return
|
|
129
|
+
this.cachedObjectUnionTypesByShapeIdentifier.set(astType.shapeIdentifier, objectUnionType);
|
|
130
|
+
return objectUnionType;
|
|
149
131
|
}
|
|
150
132
|
createType(astType, parameters) {
|
|
151
133
|
switch (astType.kind) {
|
|
@@ -170,7 +152,7 @@ export class TypeFactory {
|
|
|
170
152
|
case "Literal":
|
|
171
153
|
return this.createLiteralType(astType, parameters);
|
|
172
154
|
case "Object":
|
|
173
|
-
return this.
|
|
155
|
+
return this.createObjectType(astType);
|
|
174
156
|
case "Option":
|
|
175
157
|
return this.createOptionType(astType);
|
|
176
158
|
case "Set":
|
|
@@ -183,10 +165,10 @@ export class TypeFactory {
|
|
|
183
165
|
}
|
|
184
166
|
createUnionType(astType) {
|
|
185
167
|
if (astType.isObjectUnionType()) {
|
|
186
|
-
return this.
|
|
168
|
+
return this.createObjectUnionType(astType);
|
|
187
169
|
}
|
|
188
|
-
return
|
|
189
|
-
.map((name) =>
|
|
170
|
+
return new UnionType({
|
|
171
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
190
172
|
comment: astType.comment,
|
|
191
173
|
configuration: this.configuration,
|
|
192
174
|
identifierType: Maybe.empty(),
|
|
@@ -196,26 +178,14 @@ export class TypeFactory {
|
|
|
196
178
|
discriminantValue: member.discriminantValue,
|
|
197
179
|
type: this.createType(member.type),
|
|
198
180
|
})),
|
|
199
|
-
name,
|
|
200
181
|
recursive: astType.recursive,
|
|
201
182
|
reusables: this.reusables,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
comment: astType.comment,
|
|
205
|
-
configuration: this.configuration,
|
|
206
|
-
label: astType.label,
|
|
207
|
-
identifierType: Maybe.empty(),
|
|
208
|
-
logger: this.logger,
|
|
209
|
-
members: astType.members.map((member) => ({
|
|
210
|
-
discriminantValue: member.discriminantValue,
|
|
211
|
-
type: this.createType(member.type),
|
|
212
|
-
})),
|
|
213
|
-
recursive: astType.recursive,
|
|
214
|
-
reusables: this.reusables,
|
|
215
|
-
}));
|
|
183
|
+
synthetic: astType.synthetic,
|
|
184
|
+
});
|
|
216
185
|
}
|
|
217
186
|
createBlankNodeType(astType) {
|
|
218
187
|
return new BlankNodeType({
|
|
188
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
219
189
|
comment: astType.comment,
|
|
220
190
|
configuration: this.configuration,
|
|
221
191
|
label: astType.label,
|
|
@@ -229,6 +199,7 @@ export class TypeFactory {
|
|
|
229
199
|
});
|
|
230
200
|
invariant(DefaultValueType.isItemType(itemType));
|
|
231
201
|
return new DefaultValueType({
|
|
202
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
232
203
|
comment: astType.comment,
|
|
233
204
|
configuration: this.configuration,
|
|
234
205
|
defaultValue: astType.defaultValue,
|
|
@@ -244,6 +215,7 @@ export class TypeFactory {
|
|
|
244
215
|
return this.createBlankNodeType(astType);
|
|
245
216
|
case "Identifier":
|
|
246
217
|
return new IdentifierType({
|
|
218
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
247
219
|
comment: astType.comment,
|
|
248
220
|
configuration: this.configuration,
|
|
249
221
|
label: astType.label,
|
|
@@ -256,6 +228,7 @@ export class TypeFactory {
|
|
|
256
228
|
}
|
|
257
229
|
createIriType(astType) {
|
|
258
230
|
return new IriType({
|
|
231
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
259
232
|
comment: astType.comment,
|
|
260
233
|
configuration: this.configuration,
|
|
261
234
|
hasValues: astType.hasValues,
|
|
@@ -267,6 +240,7 @@ export class TypeFactory {
|
|
|
267
240
|
}
|
|
268
241
|
createLazyObjectOptionType(astType) {
|
|
269
242
|
return new LazyObjectOptionType({
|
|
243
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
270
244
|
comment: astType.comment,
|
|
271
245
|
configuration: this.configuration,
|
|
272
246
|
label: astType.label,
|
|
@@ -278,6 +252,7 @@ export class TypeFactory {
|
|
|
278
252
|
}
|
|
279
253
|
createLazyObjectSetType(astType) {
|
|
280
254
|
return new LazyObjectSetType({
|
|
255
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
281
256
|
comment: astType.comment,
|
|
282
257
|
configuration: this.configuration,
|
|
283
258
|
label: astType.label,
|
|
@@ -289,6 +264,7 @@ export class TypeFactory {
|
|
|
289
264
|
}
|
|
290
265
|
createLazyObjectType(astType) {
|
|
291
266
|
return new LazyObjectType({
|
|
267
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
292
268
|
comment: astType.comment,
|
|
293
269
|
configuration: this.configuration,
|
|
294
270
|
label: astType.label,
|
|
@@ -302,13 +278,13 @@ export class TypeFactory {
|
|
|
302
278
|
const itemType = this.createType(astType.itemType);
|
|
303
279
|
invariant(ListType.isItemType(itemType));
|
|
304
280
|
return new ListType({
|
|
281
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
305
282
|
comment: astType.comment,
|
|
306
283
|
configuration: this.configuration,
|
|
307
284
|
identifierNodeKind: astType.identifierNodeKind,
|
|
308
285
|
itemType,
|
|
309
286
|
label: astType.label,
|
|
310
287
|
logger: this.logger,
|
|
311
|
-
minCount: 0n,
|
|
312
288
|
mutable: astType.mutable,
|
|
313
289
|
reusables: this.reusables,
|
|
314
290
|
toRdfTypes: astType.toRdfTypes,
|
|
@@ -339,6 +315,7 @@ export class TypeFactory {
|
|
|
339
315
|
switch (datatypeDefinition.kind) {
|
|
340
316
|
case "bigdecimal":
|
|
341
317
|
return new BigDecimalType({
|
|
318
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
342
319
|
comment: astType.comment,
|
|
343
320
|
configuration: this.configuration,
|
|
344
321
|
hasValues: astType.hasValues,
|
|
@@ -350,6 +327,7 @@ export class TypeFactory {
|
|
|
350
327
|
});
|
|
351
328
|
case "bigint":
|
|
352
329
|
return new BigIntType({
|
|
330
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
353
331
|
comment: astType.comment,
|
|
354
332
|
configuration: this.configuration,
|
|
355
333
|
datatype,
|
|
@@ -363,6 +341,7 @@ export class TypeFactory {
|
|
|
363
341
|
});
|
|
364
342
|
case "boolean":
|
|
365
343
|
return new BooleanType({
|
|
344
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
366
345
|
comment: astType.comment,
|
|
367
346
|
configuration: this.configuration,
|
|
368
347
|
datatype,
|
|
@@ -377,6 +356,7 @@ export class TypeFactory {
|
|
|
377
356
|
case "date":
|
|
378
357
|
case "datetime":
|
|
379
358
|
return new (datatypeDefinition.kind === "date" ? DateType : DateTimeType)({
|
|
359
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
380
360
|
comment: astType.comment,
|
|
381
361
|
configuration: this.configuration,
|
|
382
362
|
datatype,
|
|
@@ -393,6 +373,7 @@ export class TypeFactory {
|
|
|
393
373
|
case "float":
|
|
394
374
|
case "int":
|
|
395
375
|
return new (datatypeDefinition.kind === "float" ? FloatType : IntType)({
|
|
376
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
396
377
|
comment: astType.comment,
|
|
397
378
|
configuration: this.configuration,
|
|
398
379
|
datatype,
|
|
@@ -409,6 +390,7 @@ export class TypeFactory {
|
|
|
409
390
|
case "string":
|
|
410
391
|
if (!datatype.equals(rdf.langString)) {
|
|
411
392
|
return new StringType({
|
|
393
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
412
394
|
comment: astType.comment,
|
|
413
395
|
configuration: this.configuration,
|
|
414
396
|
datatype,
|
|
@@ -438,6 +420,7 @@ export class TypeFactory {
|
|
|
438
420
|
// // this.logger.debug("literal type has no datatypes");
|
|
439
421
|
// }
|
|
440
422
|
return new LiteralType({
|
|
423
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
441
424
|
comment: astType.comment,
|
|
442
425
|
configuration: this.configuration,
|
|
443
426
|
hasValues: astType.hasValues,
|
|
@@ -448,14 +431,14 @@ export class TypeFactory {
|
|
|
448
431
|
reusables: this.reusables,
|
|
449
432
|
});
|
|
450
433
|
}
|
|
451
|
-
createObjectTypeProperty({ astObjectTypeProperty,
|
|
434
|
+
createObjectTypeProperty({ astObjectTypeProperty, objectType, }) {
|
|
452
435
|
{
|
|
453
436
|
const cachedProperty = this.cachedObjectTypePropertiesByShapeIdentifier.get(astObjectTypeProperty.shapeIdentifier);
|
|
454
437
|
if (cachedProperty) {
|
|
455
438
|
return cachedProperty;
|
|
456
439
|
}
|
|
457
440
|
}
|
|
458
|
-
const property = new
|
|
441
|
+
const property = new ObjectType.ShaclProperty({
|
|
459
442
|
comment: astObjectTypeProperty.comment,
|
|
460
443
|
configuration: this.configuration,
|
|
461
444
|
description: astObjectTypeProperty.description,
|
|
@@ -463,7 +446,7 @@ export class TypeFactory {
|
|
|
463
446
|
label: astObjectTypeProperty.label,
|
|
464
447
|
logger: this.logger,
|
|
465
448
|
mutable: astObjectTypeProperty.mutable,
|
|
466
|
-
|
|
449
|
+
objectType,
|
|
467
450
|
name: this.tsName(astObjectTypeProperty.name),
|
|
468
451
|
path: astObjectTypeProperty.path,
|
|
469
452
|
recursive: !!astObjectTypeProperty.recursive,
|
|
@@ -477,6 +460,7 @@ export class TypeFactory {
|
|
|
477
460
|
const itemType = this.createType(astType.itemType);
|
|
478
461
|
invariant(OptionType.isItemType(itemType));
|
|
479
462
|
return new OptionType({
|
|
463
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
480
464
|
comment: astType.comment,
|
|
481
465
|
configuration: this.configuration,
|
|
482
466
|
itemType,
|
|
@@ -489,6 +473,7 @@ export class TypeFactory {
|
|
|
489
473
|
const itemType = this.createType(astType.itemType);
|
|
490
474
|
invariant(SetType.isItemType(itemType));
|
|
491
475
|
return new SetType({
|
|
476
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
492
477
|
comment: astType.comment,
|
|
493
478
|
configuration: this.configuration,
|
|
494
479
|
itemType,
|
|
@@ -501,6 +486,7 @@ export class TypeFactory {
|
|
|
501
486
|
}
|
|
502
487
|
createTermType(astType) {
|
|
503
488
|
return new TermType({
|
|
489
|
+
alias: astType.name.map((name) => this.tsName(name)),
|
|
504
490
|
comment: astType.comment,
|
|
505
491
|
configuration: this.configuration,
|
|
506
492
|
hasValues: astType.hasValues,
|
|
@@ -6,26 +6,41 @@ import type { IriType } from "./IriType.js";
|
|
|
6
6
|
import type { Type } from "./Type.js";
|
|
7
7
|
import type { Typeof } from "./Typeof.js";
|
|
8
8
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
9
|
-
export declare
|
|
9
|
+
export declare class UnionType<MemberTypeT extends Type> extends AbstractType {
|
|
10
10
|
private readonly discriminant;
|
|
11
|
-
|
|
11
|
+
readonly graphqlArgs: AbstractType["graphqlArgs"];
|
|
12
|
+
readonly identifierType: Maybe<BlankNodeType | IdentifierType | IriType>;
|
|
13
|
+
readonly kind: "ObjectUnion" | "Union";
|
|
12
14
|
readonly recursive: boolean;
|
|
15
|
+
readonly synthetic: boolean;
|
|
13
16
|
readonly validationFunction: Maybe<Code>;
|
|
14
|
-
constructor({ identifierType, members, recursive, ...superParameters }: {
|
|
17
|
+
constructor({ identifierType, members, recursive, synthetic, ...superParameters }: {
|
|
15
18
|
identifierType: Maybe<BlankNodeType | IdentifierType | IriType>;
|
|
16
19
|
members: readonly (Pick<AbstractUnionType.Member<MemberTypeT>, "type"> & {
|
|
17
20
|
readonly discriminantValue: Maybe<number | string>;
|
|
18
21
|
})[];
|
|
19
22
|
recursive: boolean;
|
|
23
|
+
synthetic: boolean;
|
|
20
24
|
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
21
25
|
get conversionFunction(): Maybe<AbstractType.ConversionFunction>;
|
|
26
|
+
get declaration(): Maybe<Code>;
|
|
22
27
|
get discriminantProperty(): Maybe<AbstractType.DiscriminantProperty>;
|
|
28
|
+
get equalsFunction(): Code;
|
|
29
|
+
get filterFunction(): Code;
|
|
30
|
+
get filterType(): Code;
|
|
31
|
+
get graphqlType(): AbstractType.GraphqlType;
|
|
32
|
+
get hashFunction(): Code;
|
|
33
|
+
get jsonSchemaFunctionDeclaration(): Code;
|
|
34
|
+
get jsonTypeAliasDeclaration(): Code;
|
|
23
35
|
get members(): readonly AbstractUnionType.Member<MemberTypeT>[];
|
|
24
36
|
get mutable(): boolean;
|
|
37
|
+
get expression(): Code;
|
|
25
38
|
get referencesObjectType(): boolean;
|
|
26
39
|
get schemaType(): Code;
|
|
27
40
|
get toRdfResourceValueTypes(): AbstractType["toRdfResourceValueTypes"];
|
|
28
|
-
get
|
|
41
|
+
get jsTypes(): AbstractType["jsTypes"];
|
|
42
|
+
get valueSparqlConstructTriplesFunction(): Code;
|
|
43
|
+
get valueSparqlWherePatternsFunction(): Code;
|
|
29
44
|
protected get inlineEqualsFunction(): Code;
|
|
30
45
|
protected get inlineFilterFunction(): Code;
|
|
31
46
|
protected get inlineFilterType(): Code;
|
|
@@ -34,14 +49,27 @@ export declare abstract class AbstractUnionType<MemberTypeT extends Type> extend
|
|
|
34
49
|
protected get inlineHashFunction(): Code;
|
|
35
50
|
protected get inlineJsonSchema(): Code;
|
|
36
51
|
protected get inlineJsonType(): AbstractType.JsonType;
|
|
37
|
-
protected get
|
|
52
|
+
protected get inlineExpression(): Code;
|
|
38
53
|
protected get inlineToJsonFunction(): Code;
|
|
39
54
|
protected get inlineToRdfResourceValuesFunction(): Code;
|
|
40
55
|
protected get inlineToStringFunction(): Code;
|
|
41
56
|
protected get inlineValueSparqlConstructTriplesFunction(): Code;
|
|
42
57
|
protected get inlineValueSparqlWherePatternsFunction(): Code;
|
|
43
58
|
protected get schemaInitializers(): readonly Code[];
|
|
59
|
+
protected get staticModuleDeclarations(): Record<string, Code>;
|
|
60
|
+
fromJsonExpression({ variables, }: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
|
|
61
|
+
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["fromRdfResourceValuesExpression"]>[0]): Code;
|
|
62
|
+
graphqlResolveExpression({ variables, }: {
|
|
63
|
+
variables: {
|
|
64
|
+
value: Code;
|
|
65
|
+
};
|
|
66
|
+
}): Code;
|
|
67
|
+
jsonSchema({ context, }: Parameters<AbstractType["jsonSchema"]>[0]): Code;
|
|
68
|
+
jsonType(): AbstractType.JsonType;
|
|
44
69
|
jsonUiSchemaElement(): Maybe<Code>;
|
|
70
|
+
toJsonExpression({ variables, }: Parameters<AbstractType["toJsonExpression"]>[0]): Code;
|
|
71
|
+
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["toRdfResourceValuesExpression"]>[0]): Code;
|
|
72
|
+
toStringExpression({ variables, }: Parameters<AbstractType["toStringExpression"]>[0]): Code;
|
|
45
73
|
private readonly lazyMembers;
|
|
46
74
|
}
|
|
47
75
|
type Discriminant = ExtrinsicDiscriminant | HybridDiscriminant | IntrinsicDiscriminant | TypeofDiscriminant;
|
|
@@ -56,17 +84,14 @@ type HybridDiscriminant = {
|
|
|
56
84
|
readonly kind: "Hybrid";
|
|
57
85
|
readonly memberValues: readonly {
|
|
58
86
|
readonly kind: "Extrinsic" | "Intrinsic";
|
|
59
|
-
readonly
|
|
87
|
+
readonly values: readonly AbstractType.DiscriminantProperty.Value[];
|
|
60
88
|
}[];
|
|
61
89
|
readonly name: string;
|
|
62
90
|
};
|
|
63
91
|
type IntrinsicDiscriminant = {
|
|
64
92
|
readonly jsonName: string;
|
|
65
93
|
readonly kind: "Intrinsic";
|
|
66
|
-
readonly memberValues: readonly
|
|
67
|
-
readonly descendantValues: readonly AbstractType.DiscriminantProperty.Value[];
|
|
68
|
-
readonly ownValues: readonly AbstractType.DiscriminantProperty.Value[];
|
|
69
|
-
}[];
|
|
94
|
+
readonly memberValues: readonly AbstractType.DiscriminantProperty.Value[];
|
|
70
95
|
readonly name: string;
|
|
71
96
|
};
|
|
72
97
|
type TypeofDiscriminant = {
|
|
@@ -93,4 +118,4 @@ export declare namespace AbstractUnionType {
|
|
|
93
118
|
}
|
|
94
119
|
}
|
|
95
120
|
export {};
|
|
96
|
-
//# sourceMappingURL=
|
|
121
|
+
//# sourceMappingURL=UnionType.d.ts.map
|