@shaclmate/compiler 4.0.98 → 4.0.99

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 (88) hide show
  1. package/dist/generators/ts/AbstractCollectionType.d.ts +2 -1
  2. package/dist/generators/ts/AbstractCollectionType.js +10 -5
  3. package/dist/generators/ts/AbstractCompoundType.d.ts +11 -8
  4. package/dist/generators/ts/AbstractCompoundType.js +5 -2
  5. package/dist/generators/ts/AbstractContainerType.d.ts +11 -11
  6. package/dist/generators/ts/AbstractContainerType.js +21 -15
  7. package/dist/generators/ts/AbstractDateType.d.ts +7 -6
  8. package/dist/generators/ts/AbstractDateType.js +16 -6
  9. package/dist/generators/ts/AbstractDiscriminatedUnionType.d.ts +2 -3
  10. package/dist/generators/ts/AbstractDiscriminatedUnionType.js +25 -7
  11. package/dist/generators/ts/AbstractIntersectionType.d.ts +2 -2
  12. package/dist/generators/ts/AbstractIntersectionType.js +19 -8
  13. package/dist/generators/ts/AbstractLazyType.d.ts +23 -23
  14. package/dist/generators/ts/AbstractLazyType.js +21 -19
  15. package/dist/generators/ts/AbstractNumericType.d.ts +4 -3
  16. package/dist/generators/ts/AbstractNumericType.js +12 -7
  17. package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -2
  18. package/dist/generators/ts/AbstractPrimitiveType.js +4 -4
  19. package/dist/generators/ts/AbstractTermType.d.ts +17 -16
  20. package/dist/generators/ts/AbstractTermType.js +21 -11
  21. package/dist/generators/ts/AbstractType.d.ts +6 -15
  22. package/dist/generators/ts/AbstractType.js +14 -33
  23. package/dist/generators/ts/AbstractTypedLiteralType.d.ts +2 -1
  24. package/dist/generators/ts/AbstractTypedLiteralType.js +20 -2
  25. package/dist/generators/ts/BigDecimalType.d.ts +12 -11
  26. package/dist/generators/ts/BigDecimalType.js +28 -11
  27. package/dist/generators/ts/BigIntType.js +6 -6
  28. package/dist/generators/ts/BlankNodeType.d.ts +11 -10
  29. package/dist/generators/ts/BlankNodeType.js +27 -10
  30. package/dist/generators/ts/BooleanType.d.ts +6 -5
  31. package/dist/generators/ts/BooleanType.js +18 -8
  32. package/dist/generators/ts/Callable.d.ts +2 -2
  33. package/dist/generators/ts/DateTimeType.d.ts +6 -6
  34. package/dist/generators/ts/DateTimeType.js +6 -6
  35. package/dist/generators/ts/DateType.d.ts +6 -6
  36. package/dist/generators/ts/DateType.js +6 -6
  37. package/dist/generators/ts/DefaultValueType.d.ts +2 -2
  38. package/dist/generators/ts/DefaultValueType.js +18 -8
  39. package/dist/generators/ts/FloatType.js +4 -4
  40. package/dist/generators/ts/IdentifierType.d.ts +11 -10
  41. package/dist/generators/ts/IdentifierType.js +27 -10
  42. package/dist/generators/ts/IntType.js +4 -4
  43. package/dist/generators/ts/IriType.d.ts +5 -5
  44. package/dist/generators/ts/IriType.js +27 -22
  45. package/dist/generators/ts/LangStringType.d.ts +10 -10
  46. package/dist/generators/ts/LangStringType.js +21 -13
  47. package/dist/generators/ts/ListType.js +7 -7
  48. package/dist/generators/ts/LiteralType.d.ts +10 -10
  49. package/dist/generators/ts/LiteralType.js +21 -13
  50. package/dist/generators/ts/ObjectType.d.ts +13 -15
  51. package/dist/generators/ts/ObjectType.js +32 -9
  52. package/dist/generators/ts/OptionType.d.ts +2 -1
  53. package/dist/generators/ts/OptionType.js +16 -11
  54. package/dist/generators/ts/SetType.d.ts +2 -1
  55. package/dist/generators/ts/SetType.js +22 -10
  56. package/dist/generators/ts/Snippets.d.ts +1 -0
  57. package/dist/generators/ts/Snippets.js +7 -0
  58. package/dist/generators/ts/StringType.d.ts +6 -6
  59. package/dist/generators/ts/StringType.js +20 -17
  60. package/dist/generators/ts/TermType.d.ts +7 -7
  61. package/dist/generators/ts/TermType.js +18 -13
  62. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js +1 -1
  63. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.d.ts +39 -16
  64. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.js +49 -33
  65. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.js +1 -1
  66. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.js +1 -1
  67. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.d.ts +4 -7
  68. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.js +1 -3
  69. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.d.ts +0 -1
  70. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.js +0 -1
  71. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.d.ts +3 -2
  72. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.js +30 -10
  73. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.d.ts +3 -2
  74. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.js +26 -10
  75. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.d.ts +3 -2
  76. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.js +46 -22
  77. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.js +1 -1
  78. package/package.json +2 -2
  79. package/dist/generators/ts/AbstractStructuredType.d.ts +0 -71
  80. package/dist/generators/ts/AbstractStructuredType.js +0 -273
  81. package/dist/generators/ts/ReferenceCallable.d.ts +0 -14
  82. package/dist/generators/ts/ReferenceCallable.js +0 -16
  83. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.d.ts +0 -5
  84. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.js +0 -11
  85. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +0 -4
  86. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +0 -15
  87. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +0 -4
  88. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +0 -15
@@ -1,71 +0,0 @@
1
- import { AbstractType } from "./AbstractType.js";
2
- import type { Callable } from "./Callable.js";
3
- import type { CodeThunk } from "./CodeThunk.js";
4
- import { type Code } from "./ts-poet-wrapper.js";
5
- /**
6
- * Abstract base class for AbstractCompoundType and StructType.
7
- */
8
- export declare abstract class AbstractStructuredType extends AbstractType {
9
- get equalsFunction(): Callable;
10
- get filterFunction(): Callable;
11
- get filterType(): Code;
12
- get fromJsonValueFunction(): Callable;
13
- get fromJsonObjectFunction(): Callable;
14
- get fromRdfResourceValuesFunction(): Callable;
15
- get hashFunction(): Callable;
16
- get schemaType(): Code;
17
- get toJsonValueFunction(): Callable;
18
- get toJsonObjectFunction(): Callable;
19
- get toLoggableFunction(): Callable;
20
- get toRdfResourceValuesFunction(): Callable;
21
- get toStringFunction(): Callable;
22
- get valueSparqlConstructTriplesFunction(): Callable;
23
- get valueSparqlWherePatternsFunction(): Callable;
24
- protected get toRdfResourceValueTypesExpression(): Code;
25
- graphqlResolveExpression({ variables, }: {
26
- variables: {
27
- value: Code;
28
- };
29
- }): Code;
30
- toLoggableExpression({ variables, }: Parameters<AbstractType["toLoggableExpression"]>[0]): Code;
31
- toRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["toRdfResourceValuesExpression"]>[0]): Code;
32
- toStringExpression({ variables, }: Parameters<AbstractType["toStringExpression"]>[0]): Code;
33
- protected _function({ type, unannotatedExpression, unqualifiedName, }: {
34
- type: CodeThunk;
35
- unannotatedExpression: CodeThunk;
36
- unqualifiedName: string;
37
- }): Callable;
38
- protected abstract equalsFunctionExpression(): Code;
39
- protected equalsFunctionType(): Code;
40
- protected abstract filterFunctionExpression(): Code;
41
- protected filterFunctionType(): Code;
42
- protected abstract filterTypeExpression(): Code;
43
- protected abstract fromJsonObjectFunctionExpression(): Code;
44
- protected fromJsonObjectFunctionType(): Code;
45
- protected abstract fromRdfResourceValuesFunctionExpression(): Code;
46
- protected fromRdfResourceValuesFunctionType(): Code;
47
- protected abstract hashFunctionExpression(): Code;
48
- protected hashFunctionType(): Code;
49
- protected abstract schemaTypeExpression(): Code;
50
- protected staticModuleDeclarations(name: string): Record<string, Code>;
51
- protected abstract toJsonObjectFunctionExpression(): Code;
52
- protected toJsonObjectFunctionType(): Code;
53
- protected abstract toLoggableFunctionExpression(): Code;
54
- protected toLoggableFunctionType(): Code;
55
- protected abstract toRdfResourceValuesFunctionExpression(): Code;
56
- protected toRdfResourceValuesFunctionType(): Code;
57
- protected abstract toStringFunctionExpression(): Code;
58
- protected toStringFunctionType(): Code;
59
- protected abstract valueSparqlConstructTriplesFunctionExpression(): Code;
60
- protected valueSparqlConstructTriplesType(): Code;
61
- protected abstract valueSparqlWherePatternsFunctionExpression(): Code;
62
- protected valueSparqlWherePatternsFunctionType(): Code;
63
- }
64
- export declare namespace AbstractStructuredType {
65
- type ConversionFunction = AbstractType.ConversionFunction;
66
- type DiscriminatedType = AbstractType.DiscriminatedType;
67
- type GraphqlType = AbstractType.GraphqlType;
68
- type JsonType = AbstractType.JsonType;
69
- type JsType = AbstractType.JsType;
70
- }
71
- //# sourceMappingURL=AbstractStructuredType.d.ts.map
@@ -1,273 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { invariant } from "ts-invariant";
8
- import { Memoize } from "typescript-memoize";
9
- import { AbstractType } from "./AbstractType.js";
10
- import { DeclaredCallable } from "./DeclaredCallable.js";
11
- import { InlineCallable } from "./InlineCallable.js";
12
- import { code, joinCode } from "./ts-poet-wrapper.js";
13
- /**
14
- * Abstract base class for AbstractCompoundType and StructType.
15
- */
16
- export class AbstractStructuredType extends AbstractType {
17
- get equalsFunction() {
18
- return this._function({
19
- type: () => this.equalsFunctionType(),
20
- unannotatedExpression: () => this.equalsFunctionExpression(),
21
- unqualifiedName: "equals",
22
- });
23
- }
24
- get filterFunction() {
25
- return this._function({
26
- type: () => this.filterFunctionType(),
27
- unannotatedExpression: () => this.filterFunctionExpression(),
28
- unqualifiedName: "filter",
29
- });
30
- }
31
- get filterType() {
32
- return this.name
33
- .map((name) => code `${name}.Filter`)
34
- .orDefaultLazy(() => this.filterTypeExpression());
35
- }
36
- get fromJsonValueFunction() {
37
- return this.fromJsonObjectFunction;
38
- }
39
- get fromJsonObjectFunction() {
40
- return this._function({
41
- type: () => this.fromJsonObjectFunctionType(),
42
- unannotatedExpression: () => this.fromJsonObjectFunctionExpression(),
43
- unqualifiedName: "fromJson",
44
- });
45
- }
46
- get fromRdfResourceValuesFunction() {
47
- return this._function({
48
- type: () => this.fromRdfResourceValuesFunctionType(),
49
- unannotatedExpression: () => this.fromRdfResourceValuesFunctionExpression(),
50
- unqualifiedName: "fromRdfResourceValues",
51
- });
52
- }
53
- get hashFunction() {
54
- return this._function({
55
- type: () => this.hashFunctionType(),
56
- unannotatedExpression: () => this.hashFunctionExpression(),
57
- unqualifiedName: "hash",
58
- });
59
- }
60
- get schemaType() {
61
- return this.name
62
- .map((name) => code `${name}.Schema`)
63
- .orDefaultLazy(() => this.schemaTypeExpression());
64
- }
65
- get toJsonValueFunction() {
66
- return this.toJsonObjectFunction;
67
- }
68
- get toJsonObjectFunction() {
69
- return this._function({
70
- type: () => this.toJsonObjectFunctionType(),
71
- unannotatedExpression: () => this.toJsonObjectFunctionExpression(),
72
- unqualifiedName: "toJson",
73
- });
74
- }
75
- get toLoggableFunction() {
76
- return this._function({
77
- type: () => this.toLoggableFunctionType(),
78
- unannotatedExpression: () => this.toLoggableFunctionExpression(),
79
- unqualifiedName: "toLoggable",
80
- });
81
- }
82
- get toRdfResourceValuesFunction() {
83
- return this._function({
84
- type: () => this.toRdfResourceValuesFunctionType(),
85
- unannotatedExpression: () => this.toRdfResourceValuesFunctionExpression(),
86
- unqualifiedName: "toRdfResourceValues",
87
- });
88
- }
89
- get toStringFunction() {
90
- return this._function({
91
- type: () => this.toStringFunctionType(),
92
- unannotatedExpression: () => this.toStringFunctionExpression(),
93
- unqualifiedName: `${this.configuration.syntheticNamePrefix}toString`,
94
- });
95
- }
96
- get valueSparqlConstructTriplesFunction() {
97
- return this._function({
98
- type: () => this.valueSparqlConstructTriplesType(),
99
- unannotatedExpression: () => this.valueSparqlConstructTriplesFunctionExpression(),
100
- unqualifiedName: "valueSparqlConstructTriples",
101
- });
102
- }
103
- get valueSparqlWherePatternsFunction() {
104
- return this._function({
105
- type: () => this.valueSparqlWherePatternsFunctionType(),
106
- unannotatedExpression: () => this.valueSparqlWherePatternsFunctionExpression(),
107
- unqualifiedName: "valueSparqlWherePatterns",
108
- });
109
- }
110
- get toRdfResourceValueTypesExpression() {
111
- return joinCode([...this.toRdfResourceValueTypes].map((toRdfResourceValueType) => {
112
- switch (toRdfResourceValueType) {
113
- case "BlankNode":
114
- return code `${this.reusables.imports.BlankNode}`;
115
- case "Literal":
116
- return code `${this.reusables.imports.Literal}`;
117
- case "NamedNode":
118
- return code `${this.reusables.imports.NamedNode}`;
119
- default:
120
- toRdfResourceValueType;
121
- throw new Error();
122
- }
123
- }), { on: " | " });
124
- }
125
- graphqlResolveExpression({ variables, }) {
126
- return variables.value;
127
- }
128
- toLoggableExpression({ variables, }) {
129
- return code `${this.toLoggableFunction.unannotatedUsage}(${variables.value})`;
130
- }
131
- toRdfResourceValuesExpression({ variables, }) {
132
- const { value: valueVariable, ...otherVariables } = variables;
133
- return code `${this.toRdfResourceValuesFunction.unannotatedUsage}(${valueVariable}, ${otherVariables})`;
134
- }
135
- toStringExpression({ variables, }) {
136
- return code `${this.toStringFunction.unannotatedUsage}(${variables.value})`;
137
- }
138
- _function({ type, unannotatedExpression, unqualifiedName, }) {
139
- return this.name
140
- .map((name) => new DeclaredCallable({
141
- qualifiedName: [name, unqualifiedName],
142
- type,
143
- unannotatedExpression,
144
- }))
145
- .orDefault(new InlineCallable(unannotatedExpression, { type }));
146
- }
147
- equalsFunctionType() {
148
- return code `${this.reusables.snippets.EqualsFunction}<${this.expression}>`;
149
- }
150
- filterFunctionType() {
151
- return code `${this.reusables.snippets.FilterFunction}<${this.filterType}, ${this.expression}>`;
152
- }
153
- fromJsonObjectFunctionType() {
154
- return code `${this.reusables.snippets.FromJsonFunction}<${this.jsonObjectType.expression}, ${this.expression}, undefined>`;
155
- }
156
- fromRdfResourceValuesFunctionType() {
157
- return code `${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.expression}, ${this.schemaType}>`;
158
- }
159
- hashFunctionType() {
160
- return code `${this.reusables.snippets.HashFunction}<${this.expression}>`;
161
- }
162
- staticModuleDeclarations(name) {
163
- const staticModuleDeclarations = {
164
- ...super.staticModuleDeclarations(name),
165
- };
166
- function addFunctionDeclaration(function_) {
167
- invariant(function_ instanceof DeclaredCallable);
168
- staticModuleDeclarations[function_.unqualifiedName] =
169
- code `export ${function_.declaration}`;
170
- }
171
- if (this.configuration.features.has("Object.equals")) {
172
- addFunctionDeclaration(this.equalsFunction);
173
- }
174
- if (this.configuration.features.has("Object.filter")) {
175
- staticModuleDeclarations["Filter"] =
176
- code `export type Filter = ${this.filterTypeExpression()};`;
177
- addFunctionDeclaration(this.filterFunction);
178
- }
179
- if (this.configuration.features.has("Object.hash")) {
180
- // Hash functions take a generic parameter and const declaration like this can't have type parameters.
181
- addFunctionDeclaration(this.hashFunction);
182
- }
183
- if (this.configuration.features.has("Object.JSON.type")) {
184
- this.jsonObjectType.declaration.ifJust((jsonTypeDeclaration) => {
185
- staticModuleDeclarations["JSON"] = jsonTypeDeclaration;
186
- });
187
- }
188
- if (this.configuration.features.has("Object.fromJson")) {
189
- addFunctionDeclaration(this.fromJsonObjectFunction);
190
- }
191
- if (this.configuration.features.has("Object.fromRdf")) {
192
- addFunctionDeclaration(this.fromRdfResourceValuesFunction);
193
- }
194
- if (this.configuration.features.has("Object.SPARQL")) {
195
- addFunctionDeclaration(this.valueSparqlConstructTriplesFunction);
196
- addFunctionDeclaration(this.valueSparqlWherePatternsFunction);
197
- }
198
- if (this.configuration.features.has("Object.toJson")) {
199
- addFunctionDeclaration(this.toJsonObjectFunction);
200
- }
201
- if (this.configuration.features.has("Object.toLoggable")) {
202
- addFunctionDeclaration(this.toLoggableFunction);
203
- }
204
- if (this.configuration.features.has("Object.toRdf")) {
205
- addFunctionDeclaration(this.toRdfResourceValuesFunction);
206
- }
207
- if (this.configuration.features.has("Object.toString")) {
208
- addFunctionDeclaration(this.toStringFunction);
209
- }
210
- return staticModuleDeclarations;
211
- }
212
- toJsonObjectFunctionType() {
213
- return code `${this.reusables.snippets.ToJsonFunction}<${this.expression}, ${this.jsonObjectType.expression}>`;
214
- }
215
- toLoggableFunctionType() {
216
- return code `${this.reusables.snippets.ToLoggableFunction}<${this.expression}>`;
217
- }
218
- toRdfResourceValuesFunctionType() {
219
- return code `${this.reusables.snippets.ToRdfResourceValuesFunction}<${this.expression}, ${this.toRdfResourceValueTypesExpression}>`;
220
- }
221
- toStringFunctionType() {
222
- return code `${this.reusables.snippets.ToStringFunction}<${this.expression}>`;
223
- }
224
- valueSparqlConstructTriplesType() {
225
- return code `${this.reusables.snippets.ValueSparqlConstructTriplesFunction}<${this.filterType}, ${this.schemaType}>`;
226
- }
227
- valueSparqlWherePatternsFunctionType() {
228
- return code `${this.reusables.snippets.ValueSparqlWherePatternsFunction}<${this.filterType}, ${this.schemaType}>`;
229
- }
230
- }
231
- __decorate([
232
- Memoize()
233
- ], AbstractStructuredType.prototype, "equalsFunction", null);
234
- __decorate([
235
- Memoize()
236
- ], AbstractStructuredType.prototype, "filterFunction", null);
237
- __decorate([
238
- Memoize()
239
- ], AbstractStructuredType.prototype, "filterType", null);
240
- __decorate([
241
- Memoize()
242
- ], AbstractStructuredType.prototype, "fromJsonObjectFunction", null);
243
- __decorate([
244
- Memoize()
245
- ], AbstractStructuredType.prototype, "fromRdfResourceValuesFunction", null);
246
- __decorate([
247
- Memoize()
248
- ], AbstractStructuredType.prototype, "hashFunction", null);
249
- __decorate([
250
- Memoize()
251
- ], AbstractStructuredType.prototype, "schemaType", null);
252
- __decorate([
253
- Memoize()
254
- ], AbstractStructuredType.prototype, "toJsonObjectFunction", null);
255
- __decorate([
256
- Memoize()
257
- ], AbstractStructuredType.prototype, "toLoggableFunction", null);
258
- __decorate([
259
- Memoize()
260
- ], AbstractStructuredType.prototype, "toRdfResourceValuesFunction", null);
261
- __decorate([
262
- Memoize()
263
- ], AbstractStructuredType.prototype, "toStringFunction", null);
264
- __decorate([
265
- Memoize()
266
- ], AbstractStructuredType.prototype, "valueSparqlConstructTriplesFunction", null);
267
- __decorate([
268
- Memoize()
269
- ], AbstractStructuredType.prototype, "valueSparqlWherePatternsFunction", null);
270
- __decorate([
271
- Memoize()
272
- ], AbstractStructuredType.prototype, "toRdfResourceValueTypesExpression", null);
273
- //# sourceMappingURL=AbstractStructuredType.js.map
@@ -1,14 +0,0 @@
1
- import { AbstractCallable } from "./AbstractCallable.js";
2
- import type { Snippet } from "./Snippet.js";
3
- import { type Code } from "./ts-poet-wrapper.js";
4
- /**
5
- * A callable that's a reference to a snippet, an import, or a global function.
6
- *
7
- * Callers assume the referent carries its own type annotations, so there's no distinction between annotated and unannotated usage.
8
- */
9
- export declare class ReferenceCallable extends AbstractCallable {
10
- readonly annotatedUsage: Code;
11
- readonly unannotatedUsage: Code;
12
- constructor(reference: Code | Snippet);
13
- }
14
- //# sourceMappingURL=ReferenceCallable.d.ts.map
@@ -1,16 +0,0 @@
1
- import { AbstractCallable } from "./AbstractCallable.js";
2
- import { code } from "./ts-poet-wrapper.js";
3
- /**
4
- * A callable that's a reference to a snippet, an import, or a global function.
5
- *
6
- * Callers assume the referent carries its own type annotations, so there's no distinction between annotated and unannotated usage.
7
- */
8
- export class ReferenceCallable extends AbstractCallable {
9
- annotatedUsage;
10
- unannotatedUsage;
11
- constructor(reference) {
12
- super();
13
- this.annotatedUsage = this.unannotatedUsage = code `${reference}`;
14
- }
15
- }
16
- //# sourceMappingURL=ReferenceCallable.js.map
@@ -1,5 +0,0 @@
1
- import type { AbstractDiscriminatedUnionType } from "../AbstractDiscriminatedUnionType.js";
2
- import type { Type } from "../Type.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function AbstractDiscriminatedUnionType_schemaTypeExpression<MemberTypeT extends Type>(this: AbstractDiscriminatedUnionType<MemberTypeT>): Code;
5
- //# sourceMappingURL=AbstractDiscriminatedUnionType_schemaTypeExpression.d.ts.map
@@ -1,11 +0,0 @@
1
- import { code, joinCode, literalOf } from "../ts-poet-wrapper.js";
2
- export function AbstractDiscriminatedUnionType_schemaTypeExpression() {
3
- return code `${{
4
- kind: this.kind,
5
- members: code `{ ${joinCode(this.members.map(({ type, primaryDiscriminantValue }) => code `readonly ${literalOf(primaryDiscriminantValue)}: ${{
6
- discriminantValues: code `readonly (number | string)[]`,
7
- type: type.schemaType,
8
- }}`), { on: ";" })} }`,
9
- }}`;
10
- }
11
- //# sourceMappingURL=AbstractDiscriminatedUnionType_schemaTypeExpression.js.map
@@ -1,4 +0,0 @@
1
- import type { ObjectType } from "../ObjectType.js";
2
- import { type Code } from "../ts-poet-wrapper.js";
3
- export declare function ObjectType_schemaExpression(this: ObjectType): Code;
4
- //# sourceMappingURL=ObjectType_schemaExpression.d.ts.map
@@ -1,15 +0,0 @@
1
- import { invariant } from "ts-invariant";
2
- import { code } from "../ts-poet-wrapper.js";
3
- export function ObjectType_schemaExpression() {
4
- const schema = {};
5
- const properties = {};
6
- for (const property of this.properties) {
7
- property.schema.ifJust((propertySchema) => {
8
- properties[property.name] = propertySchema;
9
- });
10
- }
11
- invariant(Object.keys(properties).length > 0);
12
- schema["properties"] = properties;
13
- return code `${schema} as const`;
14
- }
15
- //# sourceMappingURL=ObjectType_schemaExpression.js.map
@@ -1,4 +0,0 @@
1
- import type { ObjectType } from "../ObjectType.js";
2
- import { type Code } from "../ts-poet-wrapper.js";
3
- export declare function ObjectType_schemaTypeExpression(this: ObjectType): Code;
4
- //# sourceMappingURL=ObjectType_schemaTypeExpression.d.ts.map
@@ -1,15 +0,0 @@
1
- import { invariant } from "ts-invariant";
2
- import { code } from "../ts-poet-wrapper.js";
3
- export function ObjectType_schemaTypeExpression() {
4
- const schemaType = {};
5
- const properties = {};
6
- for (const property of this.properties) {
7
- property.schemaType.ifJust((propertySchemaType) => {
8
- properties[property.name] = propertySchemaType;
9
- });
10
- }
11
- invariant(Object.keys(properties).length > 0);
12
- schemaType["properties"] = properties;
13
- return code `${schemaType}`;
14
- }
15
- //# sourceMappingURL=ObjectType_schemaTypeExpression.js.map