@typespec/compiler 0.66.0-dev.2 → 0.66.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.js +2 -2
- package/dist/src/experimental/typekit/define-kit.d.ts +1 -0
- package/dist/src/experimental/typekit/define-kit.d.ts.map +1 -1
- package/dist/src/experimental/typekit/define-kit.js +14 -1
- package/dist/src/experimental/typekit/define-kit.js.map +1 -1
- package/dist/src/experimental/typekit/index.d.ts.map +1 -1
- package/dist/src/experimental/typekit/index.js +9 -3
- package/dist/src/experimental/typekit/index.js.map +1 -1
- package/dist/src/experimental/typekit/kits/array.d.ts +28 -0
- package/dist/src/experimental/typekit/kits/array.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/array.js +26 -0
- package/dist/src/experimental/typekit/kits/array.js.map +1 -0
- package/dist/src/experimental/typekit/kits/builtin.d.ts +117 -0
- package/dist/src/experimental/typekit/kits/builtin.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/builtin.js +81 -0
- package/dist/src/experimental/typekit/kits/builtin.js.map +1 -0
- package/dist/src/experimental/typekit/kits/enum-member.d.ts +52 -0
- package/dist/src/experimental/typekit/kits/enum-member.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/enum-member.js +22 -0
- package/dist/src/experimental/typekit/kits/enum-member.js.map +1 -0
- package/dist/src/experimental/typekit/kits/enum.d.ts +54 -0
- package/dist/src/experimental/typekit/kits/enum.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/enum.js +47 -0
- package/dist/src/experimental/typekit/kits/enum.js.map +1 -0
- package/dist/src/experimental/typekit/kits/index.d.ts +7 -0
- package/dist/src/experimental/typekit/kits/index.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/index.js +7 -0
- package/dist/src/experimental/typekit/kits/index.js.map +1 -1
- package/dist/src/experimental/typekit/kits/model-property.d.ts +29 -1
- package/dist/src/experimental/typekit/kits/model-property.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/model-property.js +11 -0
- package/dist/src/experimental/typekit/kits/model-property.js.map +1 -1
- package/dist/src/experimental/typekit/kits/model.d.ts +29 -4
- package/dist/src/experimental/typekit/kits/model.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/model.js +49 -2
- package/dist/src/experimental/typekit/kits/model.js.map +1 -1
- package/dist/src/experimental/typekit/kits/operation.d.ts +49 -0
- package/dist/src/experimental/typekit/kits/operation.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/operation.js +28 -0
- package/dist/src/experimental/typekit/kits/operation.js.map +1 -0
- package/dist/src/experimental/typekit/kits/record.d.ts +33 -0
- package/dist/src/experimental/typekit/kits/record.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/record.js +26 -0
- package/dist/src/experimental/typekit/kits/record.js.map +1 -0
- package/dist/src/experimental/typekit/kits/type.d.ts +93 -1
- package/dist/src/experimental/typekit/kits/type.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/type.js +67 -0
- package/dist/src/experimental/typekit/kits/type.js.map +1 -1
- package/dist/src/experimental/typekit/kits/union-variant.d.ts +5 -1
- package/dist/src/experimental/typekit/kits/union-variant.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/union-variant.js.map +1 -1
- package/dist/src/experimental/typekit/kits/union.d.ts +15 -1
- package/dist/src/experimental/typekit/kits/union.d.ts.map +1 -1
- package/dist/src/experimental/typekit/kits/union.js +7 -0
- package/dist/src/experimental/typekit/kits/union.js.map +1 -1
- package/dist/src/experimental/typekit/kits/value.d.ts +84 -0
- package/dist/src/experimental/typekit/kits/value.d.ts.map +1 -0
- package/dist/src/experimental/typekit/kits/value.js +81 -0
- package/dist/src/experimental/typekit/kits/value.js.map +1 -0
- package/dist/src/experimental/typekit/utils/get-plausible-name.d.ts +7 -0
- package/dist/src/experimental/typekit/utils/get-plausible-name.d.ts.map +1 -0
- package/dist/src/experimental/typekit/utils/get-plausible-name.js +17 -0
- package/dist/src/experimental/typekit/utils/get-plausible-name.js.map +1 -0
- package/dist/src/experimental/typekit/utils/index.d.ts +2 -0
- package/dist/src/experimental/typekit/utils/index.d.ts.map +1 -0
- package/dist/src/experimental/typekit/utils/index.js +2 -0
- package/dist/src/experimental/typekit/utils/index.js.map +1 -0
- package/dist/src/lib/decorators.d.ts.map +1 -1
- package/dist/src/lib/decorators.js +2 -1
- package/dist/src/lib/decorators.js.map +1 -1
- package/package.json +1 -1
- package/templates/scaffolding.json +4 -4
|
@@ -1,15 +1,42 @@
|
|
|
1
|
-
import type { Enum, EnumMember, ModelProperty, Type } from "../../../core/types.js";
|
|
1
|
+
import type { Enum, EnumMember, ModelProperty, Type, Value } from "../../../core/types.js";
|
|
2
2
|
import { EncodeData } from "../../../lib/decorators.js";
|
|
3
3
|
/**
|
|
4
|
+
* A descriptor for a model property.
|
|
4
5
|
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
export interface ModelPropertyDescriptor {
|
|
8
|
+
/**
|
|
9
|
+
* The name of the model property.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* The type of the model property.
|
|
14
|
+
*/
|
|
15
|
+
type: Type;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the model property is optional.
|
|
18
|
+
*/
|
|
19
|
+
optional?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Default value
|
|
22
|
+
*/
|
|
23
|
+
defaultValue?: Value | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
5
26
|
* Utilities for working with model properties.
|
|
6
27
|
*
|
|
7
28
|
* For many reflection operations, the metadata being asked for may be found
|
|
8
29
|
* on the model property or the type of the model property. In such cases,
|
|
9
30
|
* these operations will return the metadata from the model property if it
|
|
10
31
|
* exists, or the type of the model property if it exists.
|
|
32
|
+
* @experimental
|
|
11
33
|
*/
|
|
12
34
|
export interface ModelPropertyKit {
|
|
35
|
+
/**
|
|
36
|
+
* Creates a modelProperty type.
|
|
37
|
+
* @param desc The descriptor of the model property.
|
|
38
|
+
*/
|
|
39
|
+
create(desc: ModelPropertyDescriptor): ModelProperty;
|
|
13
40
|
/**
|
|
14
41
|
* Check if the given `type` is a model property.
|
|
15
42
|
*
|
|
@@ -43,6 +70,7 @@ interface TypekitExtension {
|
|
|
43
70
|
* on the model property or the type of the model property. In such cases,
|
|
44
71
|
* these operations will return the metadata from the model property if it
|
|
45
72
|
* exists, or the type of the model property if it exists.
|
|
73
|
+
* @experimental
|
|
46
74
|
*/
|
|
47
75
|
modelProperty: ModelPropertyKit;
|
|
48
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-property.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/model-property.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAU,IAAI,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"model-property.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/model-property.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,aAAa,EAAU,IAAI,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEnG,OAAO,EAAE,UAAU,EAAwB,MAAM,4BAA4B,CAAC;AAG9E;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;CAClC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,uBAAuB,GAAG,aAAa,CAAC;IACrD;;;;OAIG;IACH,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,aAAa,CAAC;IAEtC;;;;;OAKG;IACH,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;IAE7D;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAAC;IAEvD;;OAEG;IACH,qBAAqB,CAAC,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;CACxF;AAED,UAAU,gBAAgB;IACxB;;;;;;;;OAQG;IACH,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,OAAQ,SAAQ,gBAAgB;KAAG;CAC9C"}
|
|
@@ -15,6 +15,17 @@ defineKit({
|
|
|
15
15
|
getVisibilityForClass(property, visibilityClass) {
|
|
16
16
|
return getVisibilityForClass(this.program, property, visibilityClass);
|
|
17
17
|
},
|
|
18
|
+
create(desc) {
|
|
19
|
+
return this.program.checker.createType({
|
|
20
|
+
kind: "ModelProperty",
|
|
21
|
+
name: desc.name,
|
|
22
|
+
node: undefined,
|
|
23
|
+
type: desc.type,
|
|
24
|
+
optional: desc.optional ?? false,
|
|
25
|
+
decorators: [],
|
|
26
|
+
defaultValue: desc.defaultValue,
|
|
27
|
+
});
|
|
28
|
+
},
|
|
18
29
|
},
|
|
19
30
|
});
|
|
20
31
|
//# sourceMappingURL=model-property.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-property.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/model-property.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAc,SAAS,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"model-property.js","sourceRoot":"","sources":["../../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type } from "../../../core/types.js";
|
|
1
|
+
import type { Model, ModelIndexer, ModelProperty, RekeyableMap, SourceModel, Type } from "../../../core/types.js";
|
|
2
2
|
import { DecoratorArgs } from "../utils.js";
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A descriptor for creating a model.
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
export interface ModelDescriptor {
|
|
5
8
|
/**
|
|
6
9
|
* The name of the Model. If name is provided, it is a Model declaration.
|
|
7
10
|
* Otherwise, it is a Model expression.
|
|
@@ -23,6 +26,10 @@ interface ModelDescriptor {
|
|
|
23
26
|
* Models that this model extends.
|
|
24
27
|
*/
|
|
25
28
|
sourceModels?: SourceModel[];
|
|
29
|
+
/**
|
|
30
|
+
* The indexer property of the model.
|
|
31
|
+
*/
|
|
32
|
+
indexer?: ModelIndexer;
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
35
|
* Utilities for working with models.
|
|
@@ -41,6 +48,13 @@ export interface ModelKit {
|
|
|
41
48
|
* @param type The type to check.
|
|
42
49
|
*/
|
|
43
50
|
is(type: Type): type is Model;
|
|
51
|
+
/**
|
|
52
|
+
* Check this is an anonyous model. Specifically, this checks if the
|
|
53
|
+
* model has a name.
|
|
54
|
+
*
|
|
55
|
+
* @param type The model to check.
|
|
56
|
+
*/
|
|
57
|
+
isExpresion(type: Model): boolean;
|
|
44
58
|
/**
|
|
45
59
|
* If the input is anonymous (or the provided filter removes properties)
|
|
46
60
|
* and there exists a named model with the same set of properties
|
|
@@ -58,6 +72,18 @@ export interface ModelKit {
|
|
|
58
72
|
* properties.
|
|
59
73
|
*/
|
|
60
74
|
getEffectiveModel(model: Model, filter?: (property: ModelProperty) => boolean): Model;
|
|
75
|
+
/**
|
|
76
|
+
* Given a model, return the type that is spread
|
|
77
|
+
* @returns the type that is spread or undefined if no spread
|
|
78
|
+
*/
|
|
79
|
+
getSpreadType: (model: Model) => Type | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Gets all properties from a model, explicitly defined and implicitly defined.
|
|
82
|
+
* @param model model to get the properties from
|
|
83
|
+
*/
|
|
84
|
+
getProperties(model: Model, options?: {
|
|
85
|
+
includeExtended?: boolean;
|
|
86
|
+
}): RekeyableMap<string, ModelProperty>;
|
|
61
87
|
}
|
|
62
88
|
interface TypekitExtension {
|
|
63
89
|
/**
|
|
@@ -70,6 +96,5 @@ declare module "../define-kit.js" {
|
|
|
70
96
|
interface Typekit extends TypekitExtension {
|
|
71
97
|
}
|
|
72
98
|
}
|
|
73
|
-
export declare const ModelKit: void;
|
|
74
99
|
export {};
|
|
75
100
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,IAAI,EACL,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAiC,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAE7B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE1C;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,EAAE,CAAC;IAExB;;OAEG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG,KAAK,CAAC;IAErC;;;;OAIG;IACH,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,KAAK,CAAC;IAE9B;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;IAElC;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,OAAO,GAAG,KAAK,CAAC;IAEtF;;;OAGG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,SAAS,CAAC;IAClD;;;OAGG;IACH,aAAa,CACX,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE,GACtC,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACxC;AAED,UAAU,gBAAgB;IACxB;;;OAGG;IACH,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,OAAQ,SAAQ,gBAAgB;KAAG;CAC9C"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { getEffectiveModelType } from "../../../core/checker.js";
|
|
2
2
|
import { createRekeyableMap } from "../../../utils/misc.js";
|
|
3
3
|
import { defineKit } from "../define-kit.js";
|
|
4
|
-
import { decoratorApplication } from "../utils.js";
|
|
5
|
-
|
|
4
|
+
import { copyMap, decoratorApplication } from "../utils.js";
|
|
5
|
+
const spreadCache = new Map();
|
|
6
|
+
defineKit({
|
|
6
7
|
model: {
|
|
7
8
|
create(desc) {
|
|
8
9
|
const properties = createRekeyableMap(Array.from(Object.entries(desc.properties)));
|
|
@@ -15,6 +16,7 @@ export const ModelKit = defineKit({
|
|
|
15
16
|
node: undefined,
|
|
16
17
|
derivedModels: desc.derivedModels ?? [],
|
|
17
18
|
sourceModels: desc.sourceModels ?? [],
|
|
19
|
+
indexer: desc.indexer,
|
|
18
20
|
});
|
|
19
21
|
this.program.checker.finishType(model);
|
|
20
22
|
return model;
|
|
@@ -22,9 +24,54 @@ export const ModelKit = defineKit({
|
|
|
22
24
|
is(type) {
|
|
23
25
|
return type.kind === "Model";
|
|
24
26
|
},
|
|
27
|
+
isExpresion(type) {
|
|
28
|
+
return type.name === "";
|
|
29
|
+
},
|
|
25
30
|
getEffectiveModel(model, filter) {
|
|
26
31
|
return getEffectiveModelType(this.program, model, filter);
|
|
27
32
|
},
|
|
33
|
+
getSpreadType(model) {
|
|
34
|
+
if (spreadCache.has(model)) {
|
|
35
|
+
return spreadCache.get(model);
|
|
36
|
+
}
|
|
37
|
+
if (!model.indexer) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
if (model.indexer.key.name === "string") {
|
|
41
|
+
const record = this.record.create(model.indexer.value);
|
|
42
|
+
spreadCache.set(model, record);
|
|
43
|
+
return record;
|
|
44
|
+
}
|
|
45
|
+
if (model.indexer.key.name === "integer") {
|
|
46
|
+
const array = this.array.create(model.indexer.value);
|
|
47
|
+
spreadCache.set(model, array);
|
|
48
|
+
return array;
|
|
49
|
+
}
|
|
50
|
+
return model.indexer.value;
|
|
51
|
+
},
|
|
52
|
+
getProperties(model, options = {}) {
|
|
53
|
+
// Add explicitly defined properties
|
|
54
|
+
const properties = copyMap(model.properties);
|
|
55
|
+
// Add discriminator property if it exists
|
|
56
|
+
const discriminator = this.type.getDiscriminator(model);
|
|
57
|
+
if (discriminator) {
|
|
58
|
+
const discriminatorName = discriminator.propertyName;
|
|
59
|
+
properties.set(discriminatorName, this.modelProperty.create({ name: discriminatorName, type: this.builtin.string }));
|
|
60
|
+
}
|
|
61
|
+
if (options.includeExtended) {
|
|
62
|
+
let base = model.baseModel;
|
|
63
|
+
while (base) {
|
|
64
|
+
for (const [key, value] of base.properties) {
|
|
65
|
+
if (!properties.has(key)) {
|
|
66
|
+
properties.set(key, value);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
base = base.baseModel;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// TODO: Add Spread?
|
|
73
|
+
return properties;
|
|
74
|
+
},
|
|
28
75
|
},
|
|
29
76
|
});
|
|
30
77
|
//# sourceMappingURL=model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AASjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAiB,MAAM,aAAa,CAAC;AA8G3E,MAAM,WAAW,GAAG,IAAI,GAAG,EAAgB,CAAC;AAC5C,SAAS,CAAmB;IAC1B,KAAK,EAAE;QACL,MAAM,CAAC,IAAI;YACT,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACnF,MAAM,KAAK,GAAU,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBACnD,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;gBACrB,UAAU,EAAE,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC;gBACvD,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS;gBACnC,IAAI,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|
1
|
+
import { ModelProperty, Operation, Type } from "../../../core/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A descriptor for an operation.
|
|
4
|
+
* @experimental
|
|
5
|
+
*/
|
|
6
|
+
export interface OperationDescriptor {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the model property.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* The parameters to the model
|
|
13
|
+
*/
|
|
14
|
+
parameters: ModelProperty[];
|
|
15
|
+
/**
|
|
16
|
+
* The return type of the model
|
|
17
|
+
*/
|
|
18
|
+
returnType: Type;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Utilities for working with operation properties.
|
|
22
|
+
* @experimental
|
|
23
|
+
*/
|
|
24
|
+
export interface OperationKit {
|
|
25
|
+
/**
|
|
26
|
+
* Create an operation type.
|
|
27
|
+
*
|
|
28
|
+
* @param desc The descriptor of the operation.
|
|
29
|
+
*/
|
|
30
|
+
create(desc: OperationDescriptor): Operation;
|
|
31
|
+
/**
|
|
32
|
+
* Check if the type is an operation.
|
|
33
|
+
* @param type type to check
|
|
34
|
+
*/
|
|
35
|
+
is(type: Type): type is Operation;
|
|
36
|
+
}
|
|
37
|
+
interface TypekitExtension {
|
|
38
|
+
/**
|
|
39
|
+
* Utilities for working with operation properties.
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
42
|
+
operation: OperationKit;
|
|
43
|
+
}
|
|
44
|
+
declare module "../define-kit.js" {
|
|
45
|
+
interface Typekit extends TypekitExtension {
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGxE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,EAAE,aAAa,EAAE,CAAC;IAE5B;;OAEG;IACH,UAAU,EAAE,IAAI,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC7C;;;OAGG;IACH,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,SAAS,CAAC;CACnC;AAED,UAAU,gBAAgB;IACxB;;;OAGG;IACH,SAAS,EAAE,YAAY,CAAC;CACzB;AAED,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,OAAQ,SAAQ,gBAAgB;KAAG;CAC9C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineKit } from "../define-kit.js";
|
|
2
|
+
defineKit({
|
|
3
|
+
operation: {
|
|
4
|
+
is(type) {
|
|
5
|
+
return type.kind === "Operation";
|
|
6
|
+
},
|
|
7
|
+
create(desc) {
|
|
8
|
+
const parametersModel = this.model.create({
|
|
9
|
+
name: `${desc.name}Parameters`,
|
|
10
|
+
properties: desc.parameters.reduce((acc, property) => {
|
|
11
|
+
acc[property.name] = property;
|
|
12
|
+
return acc;
|
|
13
|
+
}, {}),
|
|
14
|
+
});
|
|
15
|
+
const operation = this.program.checker.createType({
|
|
16
|
+
kind: "Operation",
|
|
17
|
+
name: desc.name,
|
|
18
|
+
decorators: [],
|
|
19
|
+
parameters: parametersModel,
|
|
20
|
+
returnType: desc.returnType,
|
|
21
|
+
node: undefined,
|
|
22
|
+
});
|
|
23
|
+
this.program.checker.finishType(operation);
|
|
24
|
+
return operation;
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/operation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAqD7C,SAAS,CAAmB;IAC1B,SAAS,EAAE;QACT,EAAE,CAAC,IAAU;YACX,OAAO,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC;QACnC,CAAC;QACD,MAAM,CAAC,IAAI;YACT,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;gBACxC,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,YAAY;gBAC9B,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAChC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;oBAChB,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;oBAC9B,OAAO,GAAG,CAAC;gBACb,CAAC,EACD,EAAmC,CACpC;aACF,CAAC,CAAC;YACH,MAAM,SAAS,GAAc,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBAC3D,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,UAAU,EAAE,EAAE;gBACd,UAAU,EAAE,eAAe;gBAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,IAAI,EAAE,SAAgB;aACvB,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YAC3C,OAAO,SAAS,CAAC;QACnB,CAAC;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Model, Type } from "../../../core/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* RecordKit provides utilities for working with Record Model types.
|
|
4
|
+
* @experimental
|
|
5
|
+
*/
|
|
6
|
+
export interface RecordKit {
|
|
7
|
+
/**
|
|
8
|
+
* Check if the given `type` is a Record.
|
|
9
|
+
*
|
|
10
|
+
* @param type The type to check.
|
|
11
|
+
*/
|
|
12
|
+
is(type: Type): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Get the element type of a Record
|
|
15
|
+
* @param type a Record Model type
|
|
16
|
+
*/
|
|
17
|
+
getElementType(type: Model): Type;
|
|
18
|
+
/**
|
|
19
|
+
* Create a Record Model type
|
|
20
|
+
* @param elementType The type of the elements in the record
|
|
21
|
+
*/
|
|
22
|
+
create(elementType: Type): Model;
|
|
23
|
+
}
|
|
24
|
+
interface TypekitExtension {
|
|
25
|
+
/** @experimental */
|
|
26
|
+
record: RecordKit;
|
|
27
|
+
}
|
|
28
|
+
declare module "../define-kit.js" {
|
|
29
|
+
interface Typekit extends TypekitExtension {
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/record.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAGrD;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,MAAM,CAAC,WAAW,EAAE,IAAI,GAAG,KAAK,CAAC;CAClC;AAED,UAAU,gBAAgB;IACxB,oBAAoB;IACpB,MAAM,EAAE,SAAS,CAAC;CACnB;AAED,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,OAAQ,SAAQ,gBAAgB;KAAG;CAC9C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { isRecordModelType } from "../../../core/type-utils.js";
|
|
2
|
+
import { defineKit } from "../define-kit.js";
|
|
3
|
+
defineKit({
|
|
4
|
+
record: {
|
|
5
|
+
is(type) {
|
|
6
|
+
return (type.kind === "Model" && isRecordModelType(this.program, type) && type.properties.size === 0);
|
|
7
|
+
},
|
|
8
|
+
getElementType(type) {
|
|
9
|
+
if (!this.record.is(type)) {
|
|
10
|
+
throw new Error("Type is not a record.");
|
|
11
|
+
}
|
|
12
|
+
return type.indexer.value;
|
|
13
|
+
},
|
|
14
|
+
create(elementType) {
|
|
15
|
+
return this.model.create({
|
|
16
|
+
name: "Record",
|
|
17
|
+
properties: {},
|
|
18
|
+
indexer: {
|
|
19
|
+
key: this.builtin.string,
|
|
20
|
+
value: elementType,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAkC7C,SAAS,CAAmB;IAC1B,MAAM,EAAE;QACN,EAAE,CAAC,IAAI;YACL,OAAO,CACL,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,CAC7F,CAAC;QACJ,CAAC;QACD,cAAc,CAAC,IAAI;YACjB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,IAAI,CAAC,OAAQ,CAAC,KAAK,CAAC;QAC7B,CAAC;QACD,MAAM,CAAC,WAAW;YAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE;gBACd,OAAO,EAAE;oBACP,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;oBACxB,KAAK,EAAE,WAAW;iBACnB;aACF,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Discriminator } from "../../../core/intrinsic-type-state.js";
|
|
2
|
+
import { Enum, Model, Scalar, Union, type Type } from "../../../core/types.js";
|
|
2
3
|
/** @experimental */
|
|
3
4
|
export interface TypeTypekit {
|
|
4
5
|
/**
|
|
@@ -10,6 +11,97 @@ export interface TypeTypekit {
|
|
|
10
11
|
* Finishes a type, applying all the decorators.
|
|
11
12
|
*/
|
|
12
13
|
finishType(type: Type): void;
|
|
14
|
+
/**
|
|
15
|
+
* Checks if a type is decorated with @error
|
|
16
|
+
* @param type The type to check.
|
|
17
|
+
*/
|
|
18
|
+
isError(type: Type): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Get the name of this type in the specified encoding.
|
|
21
|
+
*/
|
|
22
|
+
getEncodedName(type: Type & {
|
|
23
|
+
name: string;
|
|
24
|
+
}, encoding: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the summary of this type as specified by the `@summary` decorator.
|
|
27
|
+
*
|
|
28
|
+
* @param type The type to get the summary for.
|
|
29
|
+
*/
|
|
30
|
+
getSummary(type: Type): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Get the documentation of this type as specified by the `@doc` decorator or
|
|
33
|
+
* the JSDoc comment.
|
|
34
|
+
*
|
|
35
|
+
* @param type The type to get the documentation for.
|
|
36
|
+
*/
|
|
37
|
+
getDoc(type: Type): string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Get the plausible name of a type. If the type has a name, it will use it otherwise it will try generate a name based on the context.
|
|
40
|
+
* If the type can't get a name, it will return an empty string.
|
|
41
|
+
* If the type is a TemplateInstance, it will prefix the name with the template arguments.
|
|
42
|
+
* @param type The scalar to get the name of.z
|
|
43
|
+
*/
|
|
44
|
+
getPlausibleName(type: Model | Union | Enum | Scalar): string;
|
|
45
|
+
/**
|
|
46
|
+
* Resolves a discriminated union for the given model or union.
|
|
47
|
+
* @param type Model or Union to resolve the discriminated union for.
|
|
48
|
+
*/
|
|
49
|
+
getDiscriminatedUnion(type: Model | Union): Union | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Resolves the discriminator for a discriminated union. Returns undefined if the type is not a discriminated union.
|
|
52
|
+
* @param type
|
|
53
|
+
*/
|
|
54
|
+
getDiscriminator(type: Model | Union): Discriminator | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Gets the maximum value for a numeric or model property type.
|
|
57
|
+
* @param type type to get the maximum value for
|
|
58
|
+
*/
|
|
59
|
+
maxValue(type: Type): number | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the minimum value for a numeric or model property type.
|
|
62
|
+
* @param type type to get the minimum value for
|
|
63
|
+
*/
|
|
64
|
+
minValue(type: Type): number | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Gets the maximum value this numeric type should be, exclusive of the given value.
|
|
67
|
+
* @param type
|
|
68
|
+
*/
|
|
69
|
+
maxValueExclusive(type: Type): number | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Gets the minimum value this numeric type should be, exclusive of the given value.
|
|
72
|
+
* @param type type to get the minimum value for
|
|
73
|
+
*/
|
|
74
|
+
minValueExclusive(type: Type): number | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Gets the maximum length for a string type.
|
|
77
|
+
* @param type type to get the maximum length for
|
|
78
|
+
*/
|
|
79
|
+
maxLength(type: Type): number | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Gets the minimum length for a string type.
|
|
82
|
+
* @param type type to get the minimum length for
|
|
83
|
+
*/
|
|
84
|
+
minLength(type: Type): number | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Gets the maximum number of items for an array type.
|
|
87
|
+
* @param type type to get the maximum number of items for
|
|
88
|
+
*/
|
|
89
|
+
maxItems(type: Type): number | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Gets the minimum number of items for an array type.
|
|
92
|
+
* @param type type to get the minimum number of items for
|
|
93
|
+
*/
|
|
94
|
+
minItems(type: Type): number | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Checks if the given type is a never type.
|
|
97
|
+
*/
|
|
98
|
+
isNever(type: Type): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Checks if the given type is a user defined type. Non-user defined types are defined in the compiler or other libraries imported by the spec.
|
|
101
|
+
* @param type The type to check.
|
|
102
|
+
* @returns True if the type is a user defined type, false otherwise.
|
|
103
|
+
*/
|
|
104
|
+
isUserDefined(type: Type): boolean;
|
|
13
105
|
}
|
|
14
106
|
interface TypekitExtension {
|
|
15
107
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/type.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAUd,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAO/E,qBAAqB;AACrB,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,KAAK,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IAClC;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;IAC7B;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,IA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AI,EAAE,IAAI,GAAG,OAAO,CAAC;IAC7B;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;CACpC;AAED,UAAU,gBAAgB;IACxB;;;OAGG;IACH,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,OAAQ,SAAQ,gBAAgB;KAAG;CAC9C"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { getDiscriminatedUnion } from "../../../core/helpers/discriminator-utils.js";
|
|
2
|
+
import { getLocationContext } from "../../../core/index.js";
|
|
3
|
+
import { getDiscriminator, getMaxItems, getMaxLength, getMaxValue, getMaxValueExclusive, getMinItems, getMinLength, getMinValue, getMinValueExclusive, } from "../../../core/intrinsic-type-state.js";
|
|
4
|
+
import { isErrorType, isNeverType } from "../../../core/type-utils.js";
|
|
5
|
+
import { getDoc, getSummary } from "../../../lib/decorators.js";
|
|
6
|
+
import { resolveEncodedName } from "../../../lib/encoded-names.js";
|
|
1
7
|
import { defineKit } from "../define-kit.js";
|
|
2
8
|
import { copyMap } from "../utils.js";
|
|
9
|
+
import { getPlausibleName } from "../utils/get-plausible-name.js";
|
|
3
10
|
defineKit({
|
|
4
11
|
type: {
|
|
5
12
|
finishType(type) {
|
|
@@ -79,6 +86,66 @@ defineKit({
|
|
|
79
86
|
this.realm.addType(clone);
|
|
80
87
|
return clone;
|
|
81
88
|
},
|
|
89
|
+
isError(type) {
|
|
90
|
+
return isErrorType(type);
|
|
91
|
+
},
|
|
92
|
+
getEncodedName(type, encoding) {
|
|
93
|
+
return resolveEncodedName(this.program, type, encoding);
|
|
94
|
+
},
|
|
95
|
+
getSummary(type) {
|
|
96
|
+
return getSummary(this.program, type);
|
|
97
|
+
},
|
|
98
|
+
getDoc(type) {
|
|
99
|
+
return getDoc(this.program, type);
|
|
100
|
+
},
|
|
101
|
+
getPlausibleName(type) {
|
|
102
|
+
return getPlausibleName(type);
|
|
103
|
+
},
|
|
104
|
+
getDiscriminator(type) {
|
|
105
|
+
return getDiscriminator(this.program, type);
|
|
106
|
+
},
|
|
107
|
+
getDiscriminatedUnion(type) {
|
|
108
|
+
const discriminator = getDiscriminator(this.program, type);
|
|
109
|
+
if (!discriminator) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
const [union] = getDiscriminatedUnion(type, discriminator);
|
|
113
|
+
const variants = Array.from(union.variants.entries()).map(([k, v]) => this.unionVariant.create({ name: k, type: v }));
|
|
114
|
+
return this.union.create({
|
|
115
|
+
name: union.propertyName,
|
|
116
|
+
variants,
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
maxValue(type) {
|
|
120
|
+
return getMaxValue(this.program, type);
|
|
121
|
+
},
|
|
122
|
+
minValue(type) {
|
|
123
|
+
return getMinValue(this.program, type);
|
|
124
|
+
},
|
|
125
|
+
maxLength(type) {
|
|
126
|
+
return getMaxLength(this.program, type);
|
|
127
|
+
},
|
|
128
|
+
minLength(type) {
|
|
129
|
+
return getMinLength(this.program, type);
|
|
130
|
+
},
|
|
131
|
+
maxItems(type) {
|
|
132
|
+
return getMaxItems(this.program, type);
|
|
133
|
+
},
|
|
134
|
+
maxValueExclusive(type) {
|
|
135
|
+
return getMaxValueExclusive(this.program, type);
|
|
136
|
+
},
|
|
137
|
+
minValueExclusive(type) {
|
|
138
|
+
return getMinValueExclusive(this.program, type);
|
|
139
|
+
},
|
|
140
|
+
minItems(type) {
|
|
141
|
+
return getMinItems(this.program, type);
|
|
142
|
+
},
|
|
143
|
+
isNever(type) {
|
|
144
|
+
return isNeverType(type);
|
|
145
|
+
},
|
|
146
|
+
isUserDefined(type) {
|
|
147
|
+
return getLocationContext(this.program, type).type === "project";
|
|
148
|
+
},
|
|
82
149
|
},
|
|
83
150
|
});
|
|
84
151
|
//# sourceMappingURL=type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAEL,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,oBAAoB,GACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEvE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAyHlE,SAAS,CAAmB;IAC1B,IAAI,EAAE;QACJ,UAAU,CAAC,IAAU;YACnB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC;QACD,KAAK,CAAiB,IAAO;YAC3B,IAAI,KAAQ,CAAC;YACb,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;gBAClB,KAAK,OAAO;oBACV,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;wBACtC,GAAG,IAAI;wBACP,UAAU,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;wBAChC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;wBACtC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;wBACpC,OAAO,E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CAAC,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Type, Union, UnionVariant } from "../../../core/types.js";
|
|
2
2
|
import { DecoratorArgs } from "../utils.js";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A descriptor for a union variant.
|
|
5
|
+
* @experimental
|
|
6
|
+
*/
|
|
7
|
+
export interface UnionVariantDescriptor {
|
|
4
8
|
/**
|
|
5
9
|
* The name of the union variant.
|
|
6
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union-variant.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/union-variant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAwB,aAAa,EAAE,MAAM,aAAa,CAAC;AAElE,
|
|
1
|
+
{"version":3,"file":"union-variant.d.ts","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/union-variant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,EAAwB,aAAa,EAAE,MAAM,aAAa,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEvB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAE7B;;OAEG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,YAAY,CAAC;IAEnD;;;;OAIG;IACH,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,YAAY,CAAC;CACtC;AAED,UAAU,gBAAgB;IACxB;;;OAGG;IACH,YAAY,EAAE,eAAe,CAAC;CAC/B;AAED,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,OAAQ,SAAQ,gBAAgB;KAAG;CAC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"union-variant.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/union-variant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAiB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"union-variant.js","sourceRoot":"","sources":["../../../../../src/experimental/typekit/kits/union-variant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAiB,MAAM,aAAa,CAAC;AAiElE,SAAS,CAAmB;IAC1B,YAAY,EAAE;QACZ,MAAM,CAAC,IAAI;YACT,MAAM,OAAO,GAAiB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBAC5D,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC;gBACjC,UAAU,EAAE,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC;gBACvD,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,SAAgB;gBACtB,KAAK,EAAE,IAAI,CAAC,KAAY;aACzB,CAAC,CAAC;YACH,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACzC,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,EAAE,CAAC,IAAI;YACL,OAAO,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC;QACtC,CAAC;KACF;CACF,CAAC,CAAC"}
|