@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.
Files changed (211) hide show
  1. package/dist/ShapesGraphToAstTransformer.d.ts +0 -8
  2. package/dist/ShapesGraphToAstTransformer.js +5 -85
  3. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +128 -160
  4. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +1 -1
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +0 -16
  6. package/dist/ast/AbstractCompoundType.d.ts +2 -1
  7. package/dist/ast/AbstractCompoundType.js +1 -1
  8. package/dist/ast/AbstractLazyObjectType.d.ts +0 -2
  9. package/dist/ast/Ast.d.ts +1 -3
  10. package/dist/ast/ListType.d.ts +1 -1
  11. package/dist/ast/ListType.js +1 -1
  12. package/dist/ast/ObjectType.d.ts +0 -12
  13. package/dist/ast/ObjectType.js +0 -78
  14. package/dist/generators/AstJsonGenerator.js +7 -3
  15. package/dist/generators/transformAstToLabeledPropertyGraph.js +59 -56
  16. package/dist/generators/ts/AbstractCollectionType.d.ts +5 -12
  17. package/dist/generators/ts/AbstractCollectionType.js +9 -68
  18. package/dist/generators/ts/AbstractContainerType.d.ts +4 -6
  19. package/dist/generators/ts/AbstractContainerType.js +5 -9
  20. package/dist/generators/ts/AbstractDateType.d.ts +6 -3
  21. package/dist/generators/ts/AbstractDateType.js +7 -2
  22. package/dist/generators/ts/AbstractIdentifierType.d.ts +4 -0
  23. package/dist/generators/ts/AbstractIdentifierType.js +3 -0
  24. package/dist/generators/ts/AbstractLazyObjectType.d.ts +9 -9
  25. package/dist/generators/ts/AbstractLazyObjectType.js +30 -19
  26. package/dist/generators/ts/AbstractLiteralType.d.ts +1 -0
  27. package/dist/generators/ts/AbstractNumericType.d.ts +1 -1
  28. package/dist/generators/ts/AbstractNumericType.js +9 -9
  29. package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
  30. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  31. package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -0
  32. package/dist/generators/ts/AbstractPrimitiveType.js +2 -2
  33. package/dist/generators/ts/AbstractTermType.d.ts +1 -2
  34. package/dist/generators/ts/AbstractTermType.js +3 -5
  35. package/dist/generators/ts/AbstractType.d.ts +61 -26
  36. package/dist/generators/ts/AbstractType.js +37 -17
  37. package/dist/generators/ts/BigDecimalType.d.ts +5 -1
  38. package/dist/generators/ts/BigDecimalType.js +6 -3
  39. package/dist/generators/ts/BigIntType.d.ts +3 -1
  40. package/dist/generators/ts/BigIntType.js +3 -3
  41. package/dist/generators/ts/BlankNodeType.d.ts +3 -3
  42. package/dist/generators/ts/BlankNodeType.js +13 -13
  43. package/dist/generators/ts/BooleanType.d.ts +5 -3
  44. package/dist/generators/ts/BooleanType.js +11 -6
  45. package/dist/generators/ts/DefaultValueType.d.ts +40 -2
  46. package/dist/generators/ts/DefaultValueType.js +14 -12
  47. package/dist/generators/ts/FloatType.d.ts +3 -1
  48. package/dist/generators/ts/FloatType.js +1 -1
  49. package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
  50. package/dist/generators/ts/GraphqlSchema.js +6 -6
  51. package/dist/generators/ts/IdentifierType.d.ts +3 -3
  52. package/dist/generators/ts/IdentifierType.js +19 -17
  53. package/dist/generators/ts/IntType.d.ts +3 -1
  54. package/dist/generators/ts/IntType.js +1 -1
  55. package/dist/generators/ts/IriType.d.ts +2 -2
  56. package/dist/generators/ts/IriType.js +21 -19
  57. package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -0
  58. package/dist/generators/ts/LazyObjectOptionType.js +14 -10
  59. package/dist/generators/ts/LazyObjectSetType.js +14 -8
  60. package/dist/generators/ts/LazyObjectType.js +9 -6
  61. package/dist/generators/ts/ListType.d.ts +13 -5
  62. package/dist/generators/ts/ListType.js +48 -12
  63. package/dist/generators/ts/LiteralType.d.ts +5 -1
  64. package/dist/generators/ts/LiteralType.js +11 -8
  65. package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +19 -34
  66. package/dist/generators/ts/ObjectType.js +282 -0
  67. package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
  68. package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +52 -60
  69. package/dist/generators/ts/OptionType.d.ts +6 -2
  70. package/dist/generators/ts/OptionType.js +20 -15
  71. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -11
  72. package/dist/generators/ts/SetType.d.ts +16 -1
  73. package/dist/generators/ts/SetType.js +80 -2
  74. package/dist/generators/ts/Snippets.d.ts +3 -1
  75. package/dist/generators/ts/Snippets.js +18 -4
  76. package/dist/generators/ts/SparqlObjectSetType.js +2 -2
  77. package/dist/generators/ts/StringType.d.ts +5 -3
  78. package/dist/generators/ts/StringType.js +15 -6
  79. package/dist/generators/ts/TermType.d.ts +6 -2
  80. package/dist/generators/ts/TermType.js +15 -12
  81. package/dist/generators/ts/TsGenerator.d.ts +1 -1
  82. package/dist/generators/ts/TsGenerator.js +60 -32
  83. package/dist/generators/ts/Type.d.ts +4 -5
  84. package/dist/generators/ts/TypeFactory.d.ts +7 -8
  85. package/dist/generators/ts/TypeFactory.js +62 -76
  86. package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +36 -11
  87. package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +296 -105
  88. package/dist/generators/ts/ZodGenerator.d.ts +1 -1
  89. package/dist/generators/ts/ZodGenerator.js +21 -16
  90. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +9 -6
  91. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +3 -3
  92. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +9 -13
  93. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +22 -39
  94. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +1 -5
  95. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +18 -13
  96. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
  97. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +44 -0
  98. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
  99. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +3 -7
  100. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
  101. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -6
  102. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
  103. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +2 -5
  104. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  105. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +2 -6
  106. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  107. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -24
  108. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  109. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +18 -0
  110. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  111. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js +51 -0
  112. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  113. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
  114. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
  115. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
  116. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
  117. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
  118. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
  119. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +41 -0
  120. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
  121. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +12 -0
  122. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
  123. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +20 -0
  124. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
  125. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
  126. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
  127. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +5 -11
  128. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
  129. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +9 -0
  130. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
  131. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -6
  132. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
  133. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
  134. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
  135. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +12 -0
  136. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
  137. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
  138. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
  139. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
  140. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
  141. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +20 -0
  142. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
  143. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
  144. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
  145. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +7 -14
  146. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  147. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  148. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  149. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
  150. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +12 -12
  151. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
  152. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.js +16 -0
  153. package/dist/generators/ts/_snippets/snippets_convertToArraySet.d.ts +3 -0
  154. package/dist/generators/ts/_snippets/snippets_convertToArraySet.js +8 -0
  155. package/dist/generators/ts/_snippets/snippets_convertToList.d.ts +3 -0
  156. package/dist/generators/ts/_snippets/snippets_convertToList.js +7 -0
  157. package/dist/generators/ts/_snippets/snippets_convertToScalarSet.d.ts +3 -0
  158. package/dist/generators/ts/_snippets/snippets_convertToScalarSet.js +15 -0
  159. package/dist/input/generated.d.ts +758 -117
  160. package/dist/input/generated.js +636 -128
  161. package/package.json +4 -6
  162. package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
  163. package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
  164. package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
  165. package/dist/generators/ts/AnonymousUnionType.js +0 -59
  166. package/dist/generators/ts/NamedObjectType.js +0 -342
  167. package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
  168. package/dist/generators/ts/NamedUnionType.d.ts +0 -11
  169. package/dist/generators/ts/NamedUnionType.js +0 -13
  170. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
  171. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.js +0 -65
  172. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
  173. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
  174. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
  175. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  176. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  177. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  178. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +0 -43
  179. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  180. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +0 -80
  181. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  182. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  183. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  184. package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  185. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
  186. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js +0 -45
  187. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
  188. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.js +0 -16
  189. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
  190. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js +0 -17
  191. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
  192. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  193. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  194. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +0 -16
  195. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  196. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
  197. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
  198. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
  199. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  200. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js +0 -41
  201. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  202. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
  203. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  204. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  205. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
  206. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.js +0 -25
  207. package/dist/generators/ts/_snippets/snippets_convertToArray.d.ts +0 -3
  208. package/dist/generators/ts/_snippets/snippets_convertToArray.js +0 -8
  209. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
  210. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
  211. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { AbstractType } from "./AbstractType.js";
3
- import type { NamedObjectType } from "./NamedObjectType.js";
4
- import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
3
+ import type { ObjectType } from "./ObjectType.js";
4
+ import type { ObjectUnionType } from "./ObjectUnionType.js";
5
5
  import type { OptionType } from "./OptionType.js";
6
6
  import type { SetType } from "./SetType.js";
7
7
  import { type Code } from "./ts-poet-wrapper.js";
@@ -17,24 +17,24 @@ export declare abstract class AbstractLazyObjectType<PartialTypeT extends Abstra
17
17
  readonly discriminantProperty: AbstractType["discriminantProperty"];
18
18
  readonly mutable = false;
19
19
  readonly referencesObjectType = true;
20
- readonly typeofs: "object"[];
21
20
  readonly validationFunction: Maybe<Code>;
22
21
  constructor({ partialType, resolveType, ...superParameters }: {
23
22
  partialType: PartialTypeT;
24
23
  resolveType: ResolveTypeT;
25
24
  } & ConstructorParameters<typeof AbstractType>[0]);
26
25
  get equalsFunction(): Code;
26
+ get expression(): Code;
27
27
  get filterFunction(): Code;
28
28
  get filterType(): Code;
29
29
  get graphqlType(): AbstractType.GraphqlType;
30
30
  get hashFunction(): Code;
31
- get name(): Code;
31
+ get jsTypes(): readonly AbstractType.JsType[];
32
32
  get recursive(): boolean;
33
- protected get schemaInitializers(): readonly Code[];
34
33
  get schemaType(): Code;
35
34
  get toRdfResourceValueTypes(): AbstractType["toRdfResourceValueTypes"];
36
35
  get valueSparqlConstructTriplesFunction(): Code;
37
36
  get valueSparqlWherePatternsFunction(): Code;
37
+ protected get schemaInitializers(): readonly Code[];
38
38
  jsonSchema(parameters: Parameters<AbstractType["jsonSchema"]>[0]): Code;
39
39
  jsonType(parameters?: Parameters<AbstractType["jsonType"]>[0]): AbstractType.JsonType;
40
40
  jsonUiSchemaElement(parameters: Parameters<AbstractType["jsonUiSchemaElement"]>[0]): Maybe<Code>;
@@ -45,16 +45,16 @@ export declare abstract class AbstractLazyObjectType<PartialTypeT extends Abstra
45
45
  partialType: ObjectTypeT;
46
46
  resolveType: ObjectTypeT;
47
47
  }): Code;
48
- protected resolvedNamedObjectUnionTypeToPartialNamedObjectUnionTypeConversion({ resolvedNamedObjectUnionType, partialNamedObjectUnionType, variables, }: {
49
- resolvedNamedObjectUnionType: NamedObjectUnionType;
50
- partialNamedObjectUnionType: NamedObjectUnionType;
48
+ protected resolvedObjectUnionTypeToPartialObjectUnionTypeConversion({ resolvedObjectUnionType, partialObjectUnionType, variables, }: {
49
+ resolvedObjectUnionType: ObjectUnionType;
50
+ partialObjectUnionType: ObjectUnionType;
51
51
  variables: {
52
52
  resolvedObjectUnion: Code;
53
53
  };
54
54
  }): Code;
55
55
  }
56
56
  export declare namespace AbstractLazyObjectType {
57
- type ObjectTypeConstraint = NamedObjectType | NamedObjectUnionType;
57
+ type ObjectTypeConstraint = ObjectType | ObjectUnionType;
58
58
  type PartialTypeConstraint = ObjectTypeConstraint | OptionType<ObjectTypeConstraint> | SetType<ObjectTypeConstraint>;
59
59
  type ResolveTypeConstraint = PartialTypeConstraint;
60
60
  type ConversionFunction = AbstractType.ConversionFunction;
@@ -16,7 +16,6 @@ export class AbstractLazyObjectType extends AbstractType {
16
16
  discriminantProperty = Maybe.empty();
17
17
  mutable = false;
18
18
  referencesObjectType = true;
19
- typeofs = ["object"];
20
19
  validationFunction = Maybe.empty();
21
20
  constructor({ partialType, resolveType, ...superParameters }) {
22
21
  super(superParameters);
@@ -26,8 +25,11 @@ export class AbstractLazyObjectType extends AbstractType {
26
25
  get equalsFunction() {
27
26
  return code `((left, right) => ${this.partialType.equalsFunction}(left.${this.runtimeClass.partialPropertyName}, right.${this.runtimeClass.partialPropertyName}))`;
28
27
  }
28
+ get expression() {
29
+ return this.runtimeClass.name;
30
+ }
29
31
  get filterFunction() {
30
- return code `((filter: ${this.filterType}, value: ${this.name}) => ${this.partialType.filterFunction}(filter, value.${this.runtimeClass.partialPropertyName}))`;
32
+ return code `((filter: ${this.filterType}, value: ${this.expression}) => ${this.partialType.filterFunction}(filter, value.${this.runtimeClass.partialPropertyName}))`;
31
33
  }
32
34
  get filterType() {
33
35
  return this.partialType.filterType;
@@ -38,15 +40,18 @@ export class AbstractLazyObjectType extends AbstractType {
38
40
  get hashFunction() {
39
41
  return code `((hasher, value) => ${this.partialType.hashFunction}(hasher, value.${this.runtimeClass.partialPropertyName}))`;
40
42
  }
41
- get name() {
42
- return this.runtimeClass.name;
43
+ get jsTypes() {
44
+ return [
45
+ {
46
+ className: this.runtimeClass.rawName,
47
+ instanceof: "class",
48
+ typeof: "object",
49
+ },
50
+ ];
43
51
  }
44
52
  get recursive() {
45
53
  return this.partialType.recursive;
46
54
  }
47
- get schemaInitializers() {
48
- return super.schemaInitializers.concat(code `get partialType() { return ${this.partialType.schema}; }`);
49
- }
50
55
  get schemaType() {
51
56
  return code `${{
52
57
  kind: this.kind,
@@ -62,6 +67,9 @@ export class AbstractLazyObjectType extends AbstractType {
62
67
  get valueSparqlWherePatternsFunction() {
63
68
  return code `(({ schema, ...otherParameters }) => ${this.partialType.valueSparqlWherePatternsFunction}({ ...otherParameters, schema: schema.partialType }))`;
64
69
  }
70
+ get schemaInitializers() {
71
+ return super.schemaInitializers.concat(code `get partialType() { return ${this.partialType.schema}; }`);
72
+ }
65
73
  jsonSchema(parameters) {
66
74
  return this.partialType.jsonSchema(parameters);
67
75
  }
@@ -94,26 +102,26 @@ export class AbstractLazyObjectType extends AbstractType {
94
102
  });
95
103
  }
96
104
  resolveToPartialFunction({ partialType, resolveType, }) {
97
- if (partialType.kind === "NamedObjectType") {
98
- return code `${partialType.name}.createUnsafe`;
105
+ if (partialType.kind === "Object") {
106
+ return code `${partialType.alias.unsafeCoerce()}.createUnsafe`;
99
107
  }
100
- invariant(partialType.kind === "NamedObjectUnion");
101
- invariant(resolveType.kind === "NamedObjectUnion");
108
+ invariant(partialType.kind === "ObjectUnion");
109
+ invariant(resolveType.kind === "ObjectUnion");
102
110
  invariant(partialType.members.length === resolveType.members.length);
103
111
  const caseBlocks = resolveType.members.map(({ discriminantValues }, memberI) => {
104
- return code `${discriminantValues.map((discriminantPropertyValue) => `case "${discriminantPropertyValue}":`).join("\n")} return ${partialType.members[memberI].type.name}.createUnsafe(resolved);`;
112
+ return code `${discriminantValues.map((discriminantPropertyValue) => `case "${discriminantPropertyValue}":`).join("\n")} return ${partialType.members[memberI].type.alias.unsafeCoerce()}.createUnsafe(resolved);`;
105
113
  });
106
114
  caseBlocks.push(code `default: resolved satisfies never; throw new Error("unrecognized type");`);
107
- return code `((resolved: ${resolveType.name}) => { switch (resolved.${resolveType.discriminantProperty.unsafeCoerce().name}) { ${joinCode(caseBlocks)} } })`;
115
+ return code `((resolved: ${resolveType.expression}) => { switch (resolved.${resolveType.discriminantProperty.unsafeCoerce().name}) { ${joinCode(caseBlocks)} } })`;
108
116
  }
109
- resolvedNamedObjectUnionTypeToPartialNamedObjectUnionTypeConversion({ resolvedNamedObjectUnionType, partialNamedObjectUnionType, variables, }) {
110
- invariant(resolvedNamedObjectUnionType.members.length ===
111
- partialNamedObjectUnionType.members.length);
112
- const caseBlocks = resolvedNamedObjectUnionType.members.map(({ discriminantValues }, memberI) => {
113
- return code `${discriminantValues.map((discriminantPropertyValue) => `case "${discriminantPropertyValue}":`).join("\n")} return ${partialNamedObjectUnionType.members[memberI].type.name}.create(${variables.resolvedObjectUnion});`;
117
+ resolvedObjectUnionTypeToPartialObjectUnionTypeConversion({ resolvedObjectUnionType, partialObjectUnionType, variables, }) {
118
+ invariant(resolvedObjectUnionType.members.length ===
119
+ partialObjectUnionType.members.length);
120
+ const caseBlocks = resolvedObjectUnionType.members.map(({ discriminantValues }, memberI) => {
121
+ return code `${discriminantValues.map((discriminantPropertyValue) => `case "${discriminantPropertyValue}":`).join("\n")} return ${partialObjectUnionType.members[memberI].type.alias.unsafeCoerce()}.create(${variables.resolvedObjectUnion});`;
114
122
  });
115
123
  caseBlocks.push(code `default: ${variables.resolvedObjectUnion} satisfies never; throw new Error("unrecognized type");`);
116
- return code `switch (${variables.resolvedObjectUnion}.${resolvedNamedObjectUnionType.discriminantProperty.unsafeCoerce().name}) { ${joinCode(caseBlocks)} }`;
124
+ return code `switch (${variables.resolvedObjectUnion}.${resolvedObjectUnionType.discriminantProperty.unsafeCoerce().name}) { ${joinCode(caseBlocks)} }`;
117
125
  }
118
126
  }
119
127
  __decorate([
@@ -125,6 +133,9 @@ __decorate([
125
133
  __decorate([
126
134
  Memoize()
127
135
  ], AbstractLazyObjectType.prototype, "hashFunction", null);
136
+ __decorate([
137
+ Memoize()
138
+ ], AbstractLazyObjectType.prototype, "jsTypes", null);
128
139
  __decorate([
129
140
  Memoize()
130
141
  ], AbstractLazyObjectType.prototype, "schemaType", null);
@@ -22,6 +22,7 @@ export declare namespace AbstractLiteralType {
22
22
  type DiscriminantProperty = AbstractTermType.DiscriminantProperty;
23
23
  const GraphqlType: typeof import("./AbstractType.js").AbstractType.GraphqlType;
24
24
  type GraphqlType = AbstractTermType.GraphqlType;
25
+ type JsType = AbstractTermType.JsType;
25
26
  const JsonType: typeof import("./AbstractType.js").AbstractType.JsonType;
26
27
  type JsonType = AbstractTermType.JsonType;
27
28
  }
@@ -8,7 +8,7 @@ export declare abstract class AbstractNumericType<ValueT extends bigint | number
8
8
  abstract readonly kind: "BigInt" | "Float" | "Int";
9
9
  get filterFunction(): Code;
10
10
  get filterType(): Code;
11
- get name(): Code | string;
11
+ get expression(): Code;
12
12
  get schemaType(): Code;
13
13
  get valueSparqlWherePatternsFunction(): Code;
14
14
  jsonSchema(_parameters: Parameters<AbstractPrimitiveType<ValueT>["jsonSchema"]>[0]): Code;
@@ -13,27 +13,27 @@ import { code, joinCode } from "./ts-poet-wrapper.js";
13
13
  export class AbstractNumericType extends AbstractPrimitiveType {
14
14
  hashFunction = code `${this.reusables.snippets.hashNumeric}`;
15
15
  get filterFunction() {
16
- return code `${this.reusables.snippets.filterNumeric}<${this.typeofs[0]}>`;
16
+ return code `${this.reusables.snippets.filterNumeric}<${this.jsTypes[0].typeof}>`;
17
17
  }
18
18
  get filterType() {
19
- return code `${this.reusables.snippets.NumericFilter}<${this.typeofs[0]}>`;
19
+ return code `${this.reusables.snippets.NumericFilter}<${this.jsTypes[0].typeof}>`;
20
20
  }
21
- get name() {
21
+ get expression() {
22
22
  if (this.primitiveIn.length > 0) {
23
23
  return code `${joinCode(this.primitiveIn.map((value) => this.literalExpression(value)), { on: " | " })}`;
24
24
  }
25
- return this.typeofs[0];
25
+ return code `${this.jsTypes[0].typeof}`;
26
26
  }
27
27
  get schemaType() {
28
- return code `${this.reusables.snippets.NumericSchema}<${this.typeofs[0]}>`;
28
+ return code `${this.reusables.snippets.NumericSchema}<${this.jsTypes[0].typeof}>`;
29
29
  }
30
30
  get valueSparqlWherePatternsFunction() {
31
- return code `${this.reusables.snippets.numericSparqlWherePatterns}<${this.typeofs[0]}>`;
31
+ return code `${this.reusables.snippets.numericSparqlWherePatterns}<${this.jsTypes[0].typeof}>`;
32
32
  }
33
33
  jsonSchema(_parameters) {
34
34
  switch (this.primitiveIn.length) {
35
35
  case 0:
36
- return code `${this.reusables.imports.z}.${this.typeofs[0]}()`;
36
+ return code `${this.reusables.imports.z}.${this.jsTypes[0].typeof}()`;
37
37
  case 1:
38
38
  return code `${this.reusables.imports.z}.literal(${this.literalExpression(this.primitiveIn[0])})`;
39
39
  default:
@@ -41,7 +41,7 @@ export class AbstractNumericType extends AbstractPrimitiveType {
41
41
  }
42
42
  }
43
43
  toRdfResourceValuesExpression({ variables, }) {
44
- return code `[${this.reusables.snippets.literalFactory}.${this.typeofs[0]}(${variables.value}, ${this.rdfjsTermExpression(this.datatype)})]`;
44
+ return code `[${this.reusables.snippets.literalFactory}.${this.jsTypes[0].typeof}(${variables.value}, ${this.rdfjsTermExpression(this.datatype)})]`;
45
45
  }
46
46
  fromRdfResourceValuesExpressionChain({ variables, }) {
47
47
  return {
@@ -62,7 +62,7 @@ __decorate([
62
62
  ], AbstractNumericType.prototype, "filterType", null);
63
63
  __decorate([
64
64
  Memoize()
65
- ], AbstractNumericType.prototype, "name", null);
65
+ ], AbstractNumericType.prototype, "expression", null);
66
66
  __decorate([
67
67
  Memoize()
68
68
  ], AbstractNumericType.prototype, "schemaType", null);
@@ -1,6 +1,7 @@
1
+ import type { Maybe } from "purify-ts";
1
2
  import type { Logger } from "ts-log";
2
- import type { NamedObjectType } from "./NamedObjectType.js";
3
- import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
3
+ import type { ObjectType } from "./ObjectType.js";
4
+ import type { ObjectUnionType } from "./ObjectUnionType.js";
4
5
  import type { Reusables } from "./Reusables.js";
5
6
  import type { TsGenerator } from "./TsGenerator.js";
6
7
  import { type Code } from "./ts-poet-wrapper.js";
@@ -8,25 +9,25 @@ export declare abstract class AbstractObjectSetType {
8
9
  protected readonly configuration: TsGenerator.Configuration;
9
10
  protected readonly logger: Logger;
10
11
  protected readonly reusables: Reusables;
11
- protected readonly namedObjectTypes: readonly NamedObjectType[];
12
- protected readonly namedObjectUnionTypes: readonly NamedObjectUnionType[];
12
+ protected readonly namedObjectTypes: readonly ObjectType[];
13
+ protected readonly namedObjectUnionTypes: readonly ObjectUnionType[];
13
14
  constructor({ configuration, logger, namedObjectTypes, namedObjectUnionTypes, reusables, }: {
14
15
  configuration: TsGenerator.Configuration;
15
16
  logger: Logger;
16
- namedObjectTypes: readonly NamedObjectType[];
17
- namedObjectUnionTypes: readonly NamedObjectUnionType[];
17
+ namedObjectTypes: readonly ObjectType[];
18
+ namedObjectUnionTypes: readonly ObjectUnionType[];
18
19
  reusables: Reusables;
19
20
  });
20
21
  abstract readonly declaration: Code;
21
22
  protected methodSignatures(namedObjectType: {
23
+ readonly alias: Maybe<string>;
22
24
  readonly filterType: Code;
23
25
  readonly identifierTypeAlias: Code;
24
- readonly objectSetMethodNames: NamedObjectType.ObjectSetMethodNames;
25
- readonly name: string;
26
+ readonly objectSetMethodNames: ObjectType.ObjectSetMethodNames;
26
27
  }, options?: {
27
28
  parameterNamePrefix?: string;
28
29
  queryT?: string;
29
- }): Readonly<Record<keyof NamedObjectType.ObjectSetMethodNames, {
30
+ }): Readonly<Record<keyof ObjectType.ObjectSetMethodNames, {
30
31
  readonly name: string;
31
32
  readonly parameters: Code;
32
33
  readonly returnType: Code;
@@ -21,7 +21,7 @@ export class AbstractObjectSetType {
21
21
  object: {
22
22
  name: methodNames.object,
23
23
  parameters: code `${parameterNamePrefix}identifier: ${namedObjectType.identifierTypeAlias}, options?: { preferredLanguages?: readonly string[]; }`,
24
- returnType: code `Promise<${this.reusables.imports.Either}<Error, ${namedObjectType.name}>>`,
24
+ returnType: code `Promise<${this.reusables.imports.Either}<Error, ${namedObjectType.alias.unsafeCoerce()}>>`,
25
25
  },
26
26
  objectCount: {
27
27
  name: methodNames.objectCount,
@@ -36,7 +36,7 @@ export class AbstractObjectSetType {
36
36
  objects: {
37
37
  name: methodNames.objects,
38
38
  parameters: code `${parameterNamePrefix}query?: ${queryT}<${namedObjectType.filterType}, ${namedObjectType.identifierTypeAlias}>`,
39
- returnType: code `Promise<${this.reusables.imports.Either}<Error, readonly ${namedObjectType.name}[]>>`,
39
+ returnType: code `Promise<${this.reusables.imports.Either}<Error, readonly ${namedObjectType.alias.unsafeCoerce()}[]>>`,
40
40
  },
41
41
  };
42
42
  }
@@ -23,6 +23,7 @@ export declare abstract class AbstractPrimitiveType<ValueT extends bigint | bool
23
23
  export declare namespace AbstractPrimitiveType {
24
24
  type ConversionFunction = AbstractLiteralType.ConversionFunction;
25
25
  type DiscriminantProperty = AbstractLiteralType.DiscriminantProperty;
26
+ type JsType = AbstractLiteralType.JsType;
26
27
  const GraphqlType: typeof import("./AbstractType.js").AbstractType.GraphqlType;
27
28
  type GraphqlType = AbstractLiteralType.GraphqlType;
28
29
  const JsonType: typeof import("./AbstractType.js").AbstractType.JsonType;
@@ -29,13 +29,13 @@ export class AbstractPrimitiveType extends AbstractLiteralType {
29
29
  return initializers;
30
30
  }
31
31
  fromJsonExpression({ variables, }) {
32
- return code `${this.reusables.imports.Either}.of<Error, ${this.name}>(${variables.value})`;
32
+ return code `${this.reusables.imports.Either}.of<Error, ${this.expression}>(${variables.value})`;
33
33
  }
34
34
  graphqlResolveExpression({ variables, }) {
35
35
  return variables.value;
36
36
  }
37
37
  jsonType() {
38
- return new AbstractLiteralType.JsonType(this.name);
38
+ return new AbstractLiteralType.JsonType(this.expression);
39
39
  }
40
40
  toJsonExpression({ variables, }) {
41
41
  return variables.value;
@@ -3,7 +3,6 @@ import { NodeKind } from "@shaclmate/shacl-ast";
3
3
  import { Maybe } from "purify-ts";
4
4
  import { AbstractType } from "./AbstractType.js";
5
5
  import type { Type } from "./Type.js";
6
- import type { Typeof } from "./Typeof.js";
7
6
  import { type Code } from "./ts-poet-wrapper.js";
8
7
  /**
9
8
  * Abstract base class for IdentifierType and LiteralType.
@@ -24,7 +23,6 @@ export declare abstract class AbstractTermType<ConstantTermT extends Literal | N
24
23
  abstract readonly nodeKinds: ReadonlySet<NodeKind>;
25
24
  readonly recursive = false;
26
25
  readonly referencesObjectType = false;
27
- readonly typeofs: readonly Typeof[];
28
26
  readonly validationFunction: Maybe<Code>;
29
27
  constructor({ hasValues, in_, ...superParameters }: {
30
28
  hasValues: readonly ConstantTermT[];
@@ -60,6 +58,7 @@ export declare namespace AbstractTermType {
60
58
  type DiscriminantProperty = AbstractType.DiscriminantProperty;
61
59
  const GraphqlType: typeof AbstractType.GraphqlType;
62
60
  type GraphqlType = AbstractType.GraphqlType;
61
+ type JsType = AbstractType.JsType;
63
62
  const JsonType: typeof AbstractType.JsonType;
64
63
  type JsonType = AbstractType.JsonType;
65
64
  }
@@ -27,7 +27,6 @@ export class AbstractTermType extends AbstractType {
27
27
  mutable = false;
28
28
  recursive = false;
29
29
  referencesObjectType = false;
30
- typeofs = ["object"];
31
30
  validationFunction = Maybe.empty();
32
31
  constructor({ hasValues, in_, ...superParameters }) {
33
32
  super(superParameters);
@@ -39,10 +38,9 @@ export class AbstractTermType extends AbstractType {
39
38
  }
40
39
  get discriminantProperty() {
41
40
  return Maybe.of({
42
- descendantValues: [],
43
41
  jsonName: "termType",
44
42
  name: "termType",
45
- ownValues: [...this.nodeKinds].map(NodeKind.toTermType),
43
+ values: [...this.nodeKinds].map(NodeKind.toTermType),
46
44
  type: "string",
47
45
  });
48
46
  }
@@ -95,11 +93,11 @@ export class AbstractTermType extends AbstractType {
95
93
  valueToExpression = code `value.toTerm([${joinCode(this.in_.map((in_) => this.rdfjsTermExpression(in_)), { on: ", " })}])`;
96
94
  }
97
95
  else if (this.nodeKinds.size < 3) {
98
- const eitherTypeParameters = code `<Error, ${this.name}>`;
96
+ const eitherTypeParameters = code `<Error, ${this.expression}>`;
99
97
  valueToExpression = code `value.toTerm().chain(term => {
100
98
  switch (term.termType) {
101
99
  ${[...this.nodeKinds].map((nodeKind) => `case "${NodeKind.toTermType(nodeKind)}":`).join("\n")} return ${this.reusables.imports.Either}.of${eitherTypeParameters}(term);
102
- default: return ${this.reusables.imports.Left}${eitherTypeParameters}(new ${this.reusables.imports.Resource}.MistypedTermValueError(${{ actualValue: code `term`, expectedValueType: code `${this.name}`.toCodeString([]), focusResource: variables.resource, propertyPath: variables.propertyPath }}));
100
+ default: return ${this.reusables.imports.Left}${eitherTypeParameters}(new ${this.reusables.imports.Resource}.MistypedTermValueError(${{ actualValue: code `term`, expectedValueType: code `${this.expression}`.toCodeString([]), focusResource: variables.resource, propertyPath: variables.propertyPath }}));
103
101
  }})`;
104
102
  }
105
103
  else {
@@ -3,7 +3,6 @@ import type { Logger } from "ts-log";
3
3
  import type { Reusables } from "./Reusables.js";
4
4
  import { rdfjsTermExpression } from "./rdfjsTermExpression.js";
5
5
  import type { TsGenerator } from "./TsGenerator.js";
6
- import type { Typeof } from "./Typeof.js";
7
6
  import { type Code } from "./ts-poet-wrapper.js";
8
7
  /**
9
8
  * Abstract base class all types.
@@ -12,6 +11,10 @@ export declare abstract class AbstractType {
12
11
  protected readonly configuration: TsGenerator.Configuration;
13
12
  protected readonly logger: Logger;
14
13
  protected readonly reusables: Reusables;
14
+ /**
15
+ * Alias for this type.
16
+ */
17
+ readonly alias: Maybe<string>;
15
18
  /**
16
19
  * Comment from rdfs:comment.
17
20
  */
@@ -39,6 +42,10 @@ export declare abstract class AbstractType {
39
42
  * $EqualsResult.
40
43
  */
41
44
  abstract readonly equalsFunction: Code;
45
+ /**
46
+ * TypeScript type expression.
47
+ */
48
+ abstract readonly expression: Code;
42
49
  /**
43
50
  * A function (reference or declaration) that takes a filter of filterType (below) and a value of this type
44
51
  * and returns true if the value passes the filter.
@@ -62,6 +69,10 @@ export declare abstract class AbstractType {
62
69
  * A function (reference or declaration) that takes a Hasher and a value of this type, calls hasher.update on the value, and returns the Hasher.
63
70
  */
64
71
  abstract readonly hashFunction: Code;
72
+ /**
73
+ * JavaScript type(s) the type.
74
+ */
75
+ abstract readonly jsTypes: readonly AbstractType.JsType[];
65
76
  /**
66
77
  * Type discriminant.
67
78
  */
@@ -74,10 +85,6 @@ export declare abstract class AbstractType {
74
85
  * Is a value of this type mutable?
75
86
  */
76
87
  abstract readonly mutable: boolean;
77
- /**
78
- * TypeScript name of the type.
79
- */
80
- abstract readonly name: Code | string;
81
88
  /**
82
89
  * Does this type directly or indirectly reference itself?
83
90
  */
@@ -94,10 +101,6 @@ export declare abstract class AbstractType {
94
101
  * The type(s) of the array elements produced by the toRdfResourceValuesExpression.
95
102
  */
96
103
  abstract readonly toRdfResourceValueTypes: ReadonlySet<"BlankNode" | "NamedNode" | "Literal">;
97
- /**
98
- * JavaScript typeof(s) the type.
99
- */
100
- abstract readonly typeofs: readonly Typeof[];
101
104
  /**
102
105
  * Function that takes
103
106
  * - a schema of this.schemaType
@@ -133,7 +136,8 @@ export declare abstract class AbstractType {
133
136
  * - variablePrefix: string prefix to use for new variables
134
137
  */
135
138
  abstract readonly valueSparqlWherePatternsFunction: Code;
136
- constructor({ comment, configuration, label, logger, reusables, }: {
139
+ constructor({ alias, comment, configuration, label, logger, reusables, }: {
140
+ alias: Maybe<string>;
137
141
  comment: Maybe<string>;
138
142
  configuration: TsGenerator.Configuration;
139
143
  label: Maybe<string>;
@@ -160,7 +164,7 @@ export declare abstract class AbstractType {
160
164
  * An expression that converts a Either<Error, rdfjsResource.Resource.Values> to a
161
165
  * Either<Error, rdfjsResource.Resource.Values<this type>>.
162
166
  *
163
- * These expressions are used to deserialize property values in an NamedObjectType, either directly (a property with this Type) or indirectly (a property with a Type like OptionType
167
+ * These expressions are used to deserialize property values in an ObjectType, either directly (a property with this Type) or indirectly (a property with a Type like OptionType
164
168
  * that has a type parameter of this Type).
165
169
  *
166
170
  * Some types need to filter on the set of all objects/values of a (subject, predicate). For example, all sh:hasValue values must be present in the set for any values
@@ -169,7 +173,7 @@ export declare abstract class AbstractType {
169
173
  * Values may also need to be sorted. For example, specifying preferredLanguages should sort the values in the order of the specified languages so that the first value
170
174
  * (if it exists) is always of the first preferred language.
171
175
  *
172
- * variables are runtime variables, most derived from the parameters of the NamedObjectType's fromRdf function:
176
+ * variables are runtime variables, most derived from the parameters of the ObjectType's fromRdf function:
173
177
  * context: unanticipated properties (...) passed to Object.fromRdf
174
178
  * graph: DefaultGraph | NamedNode | undefined to match (subject, predicate, object) triples in; if undefined, match triples in all graphs
175
179
  * ignoreRdfType: whether the RDF type of objects/object unions should be ignored
@@ -204,7 +208,7 @@ export declare abstract class AbstractType {
204
208
  * Zod schema for the JSON type of this type.
205
209
  *
206
210
  * This method is called in two contexts:
207
- * "property": from a ShaclProperty, while generating the z.object properties of an NamedObjectType
211
+ * "property": from a ShaclProperty, while generating the z.object properties of an ObjectType
208
212
  * "type": from another Type e.g., an OptionType or UnionType
209
213
  *
210
214
  * z.lazy() should only be returned for "property".
@@ -241,7 +245,7 @@ export declare abstract class AbstractType {
241
245
  * An expression that converts a property value of this type to a value or an array of values that can be .add'd to a Resource with
242
246
  * resource.add(predicate, convertedValue, graph)
243
247
  *
244
- * variables are runtime variables, most derived from the parameters of the NamedObjectType's fromRdf function:
248
+ * variables are runtime variables, most derived from the parameters of the ObjectType's fromRdf function:
245
249
  * graph: DefaultGraph | NamedNode | undefined to .add to; if undefined, add to the default graph
246
250
  * propertyPath: predicate path (NamedNode) or InversePath on a predicate path
247
251
  * resource: the Resource to .add to
@@ -271,15 +275,14 @@ export declare namespace AbstractType {
271
275
  interface ConversionFunction {
272
276
  readonly code: Code;
273
277
  readonly sourceTypes: {
274
- readonly name: Code | string;
275
- readonly typeof: Typeof;
278
+ readonly expression: Code;
279
+ readonly jsType: JsType;
276
280
  }[];
277
281
  }
278
282
  interface DiscriminantProperty {
279
- readonly descendantValues: readonly DiscriminantProperty.Value[];
280
283
  readonly jsonName: string;
281
284
  readonly name: string;
282
- readonly ownValues: readonly DiscriminantProperty.Value[];
285
+ readonly values: readonly DiscriminantProperty.Value[];
283
286
  }
284
287
  namespace DiscriminantProperty {
285
288
  type Value = number | string;
@@ -290,14 +293,46 @@ export declare namespace AbstractType {
290
293
  */
291
294
  readonly nullable: boolean;
292
295
  /**
293
- * The name of the type when it's nullable -- so it should never include "new graphql.GraphQLNonNull(...)" around it.
296
+ * The expression of the type when it's nullable -- so it should never include "new graphql.GraphQLNonNull(...)" around it.
294
297
  */
295
- readonly nullableName: Code;
298
+ readonly nullableExpression: Code;
296
299
  private readonly reusables;
297
- constructor(nullableName: Code, reusables: Reusables, options?: {
300
+ constructor(nullableExpression: Code, reusables: Reusables, options?: {
298
301
  nullable: boolean;
299
302
  });
300
- get name(): Code;
303
+ get expression(): Code;
304
+ }
305
+ type JsType = {
306
+ typeof: "bigint";
307
+ } | {
308
+ typeof: "boolean";
309
+ } | {
310
+ typeof: "function";
311
+ } | {
312
+ typeof: "number";
313
+ } | {
314
+ instanceof: "Array";
315
+ typeof: "object";
316
+ } | {
317
+ className: Code;
318
+ instanceof: "class";
319
+ typeof: "object";
320
+ } | {
321
+ instanceof: "Date";
322
+ typeof: "object";
323
+ } | {
324
+ instanceof: "Maybe";
325
+ typeof: "object";
326
+ } | {
327
+ instanceof: "Object";
328
+ typeof: "object";
329
+ } | {
330
+ typeof: "string";
331
+ } | {
332
+ typeof: "undefined";
333
+ };
334
+ namespace JsType {
335
+ function equals(left: JsType, right: JsType): boolean;
301
336
  }
302
337
  class JsonType {
303
338
  /**
@@ -305,13 +340,13 @@ export declare namespace AbstractType {
305
340
  */
306
341
  readonly optional: boolean;
307
342
  /**
308
- * The name of the type when it's required i.e. -- so it should never include "| undefined".
343
+ * The expression of the type when it's required i.e. -- so it should never include "| undefined".
309
344
  */
310
- readonly requiredName: Code | string;
311
- constructor(requiredName: Code | string, parameters?: {
345
+ readonly requiredExpression: Code;
346
+ constructor(requiredExpression: Code, parameters?: {
312
347
  optional: boolean;
313
348
  });
314
- get name(): Code | string;
349
+ get expression(): Code;
315
350
  }
316
351
  }
317
352
  //# sourceMappingURL=AbstractType.d.ts.map