@teambit/semantics.entities.semantic-schema 0.0.46 → 0.0.48
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/api-schema.ts +5 -5
- package/class-transformers/schema-obj-to-class.ts +1 -0
- package/dist/api-schema.d.ts +3 -3
- package/dist/api-schema.js +2 -2
- package/dist/api-schema.js.map +1 -1
- package/dist/class-transformers/schema-obj-to-class.js.map +1 -1
- package/dist/schema-node.d.ts +1 -0
- package/dist/schema-node.js.map +1 -1
- package/dist/schemas/class.d.ts +7 -2
- package/dist/schemas/class.js +7 -3
- package/dist/schemas/class.js.map +1 -1
- package/dist/schemas/constructor.d.ts +2 -1
- package/dist/schemas/constructor.js +2 -1
- package/dist/schemas/constructor.js.map +1 -1
- package/dist/schemas/docs/property-like-tag.d.ts +2 -2
- package/dist/schemas/docs/property-like-tag.js +3 -3
- package/dist/schemas/docs/property-like-tag.js.map +1 -1
- package/dist/schemas/enum-member.d.ts +11 -0
- package/dist/schemas/enum-member.js +32 -0
- package/dist/schemas/enum-member.js.map +1 -0
- package/dist/schemas/enum.d.ts +3 -2
- package/dist/schemas/enum.js +6 -2
- package/dist/schemas/enum.js.map +1 -1
- package/dist/schemas/expression-with-arguments.d.ts +9 -0
- package/dist/schemas/expression-with-arguments.js +32 -0
- package/dist/schemas/expression-with-arguments.js.map +1 -0
- package/dist/schemas/index.d.ts +9 -1
- package/dist/schemas/index.js +13 -2
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/inference-type.js +1 -1
- package/dist/schemas/inference-type.js.map +1 -1
- package/dist/schemas/interface.d.ts +5 -1
- package/dist/schemas/interface.js +4 -1
- package/dist/schemas/interface.js.map +1 -1
- package/dist/schemas/module.d.ts +1 -1
- package/dist/schemas/module.js +5 -5
- package/dist/schemas/module.js.map +1 -1
- package/dist/schemas/named-tuple.d.ts +8 -0
- package/dist/schemas/named-tuple.js +17 -0
- package/dist/schemas/named-tuple.js.map +1 -0
- package/dist/schemas/parameter.d.ts +2 -1
- package/dist/schemas/parameter.js +6 -1
- package/dist/schemas/parameter.js.map +1 -1
- package/dist/schemas/type-operator.d.ts +2 -2
- package/dist/schemas/type-operator.js +3 -3
- package/dist/schemas/type-operator.js.map +1 -1
- package/dist/schemas/type-predicate.d.ts +2 -2
- package/dist/schemas/type-predicate.js +3 -3
- package/dist/schemas/type-predicate.js.map +1 -1
- package/dist/schemas/unknown-schema.d.ts +2 -2
- package/dist/schemas/unknown-schema.js +3 -3
- package/dist/schemas/unknown-schema.js.map +1 -1
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.48.tgz +0 -0
- package/package.json +2 -2
- package/{preview-1667706059705.js → preview-1668051814135.js} +1 -1
- package/schema-node.ts +1 -0
- package/schemas/class.ts +12 -2
- package/schemas/constructor.ts +1 -1
- package/schemas/docs/property-like-tag.ts +2 -2
- package/schemas/enum-member.ts +25 -0
- package/schemas/enum.ts +11 -2
- package/schemas/expression-with-arguments.ts +21 -0
- package/schemas/index.ts +9 -1
- package/schemas/inference-type.ts +1 -1
- package/schemas/interface.ts +10 -1
- package/schemas/module.ts +2 -2
- package/schemas/named-tuple.ts +11 -0
- package/schemas/parameter.ts +7 -1
- package/schemas/type-operator.ts +2 -2
- package/schemas/type-predicate.ts +2 -2
- package/schemas/unknown-schema.ts +2 -2
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.46.tgz +0 -0
package/api-schema.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
EnumSchema,
|
|
7
7
|
FunctionLikeSchema,
|
|
8
8
|
InterfaceSchema,
|
|
9
|
-
|
|
9
|
+
ModuleSchema,
|
|
10
10
|
TypeRefSchema,
|
|
11
11
|
TypeSchema,
|
|
12
12
|
UnresolvedSchema,
|
|
@@ -18,12 +18,12 @@ import { componentIdTransformer } from './class-transformers/comp-id-transformer
|
|
|
18
18
|
|
|
19
19
|
export class APISchema extends SchemaNode {
|
|
20
20
|
@Transform(schemaObjToInstance)
|
|
21
|
-
readonly module:
|
|
21
|
+
readonly module: ModuleSchema;
|
|
22
22
|
|
|
23
23
|
@Transform(componentIdTransformer)
|
|
24
24
|
readonly componentId: ComponentID;
|
|
25
25
|
|
|
26
|
-
constructor(readonly location: Location, module:
|
|
26
|
+
constructor(readonly location: Location, module: ModuleSchema, componentId: ComponentID) {
|
|
27
27
|
super();
|
|
28
28
|
this.module = module;
|
|
29
29
|
this.componentId = componentId;
|
|
@@ -50,7 +50,7 @@ export class APISchema extends SchemaNode {
|
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
52
|
title +
|
|
53
|
-
getSection(
|
|
53
|
+
getSection(ModuleSchema, 'Namespaces') +
|
|
54
54
|
getSection(ClassSchema, 'Classes') +
|
|
55
55
|
getSection(InterfaceSchema, 'Interfaces') +
|
|
56
56
|
getSection(FunctionLikeSchema, 'Functions') +
|
|
@@ -73,7 +73,7 @@ export class APISchema extends SchemaNode {
|
|
|
73
73
|
static empty(componentId: ComponentID) {
|
|
74
74
|
return new APISchema(
|
|
75
75
|
{ filePath: '', line: 0, character: 0 },
|
|
76
|
-
new
|
|
76
|
+
new ModuleSchema({ filePath: '', line: 0, character: 0 }, []),
|
|
77
77
|
componentId
|
|
78
78
|
);
|
|
79
79
|
}
|
|
@@ -36,6 +36,7 @@ function transformFromObjectToInstance(obj: Record<string, any>): SchemaNode {
|
|
|
36
36
|
// for backward and forward compatibility, to not break the users, it's better to return an unknown schema than throwing.
|
|
37
37
|
return new UnknownSchema(obj.location || { path: '', line: 0, character: 0 }, obj.__schema, obj);
|
|
38
38
|
}
|
|
39
|
+
|
|
39
40
|
return plainToInstance(SchemaClass, obj);
|
|
40
41
|
}
|
|
41
42
|
|
package/dist/api-schema.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ComponentID } from '@teambit/component-id';
|
|
2
|
-
import {
|
|
2
|
+
import { ModuleSchema } from './schemas';
|
|
3
3
|
import { Location, SchemaNode } from './schema-node';
|
|
4
4
|
export declare class APISchema extends SchemaNode {
|
|
5
5
|
readonly location: Location;
|
|
6
|
-
readonly module:
|
|
6
|
+
readonly module: ModuleSchema;
|
|
7
7
|
readonly componentId: ComponentID;
|
|
8
|
-
constructor(location: Location, module:
|
|
8
|
+
constructor(location: Location, module: ModuleSchema, componentId: ComponentID);
|
|
9
9
|
toString(): string;
|
|
10
10
|
toStringPerType(): string;
|
|
11
11
|
listSignatures(): string[];
|
package/dist/api-schema.js
CHANGED
|
@@ -36,7 +36,7 @@ class APISchema extends schema_node_1.SchemaNode {
|
|
|
36
36
|
return `${chalk_1.default.green.bold(sectionName)}\n${objects.map((c) => c.toString()).join('\n')}\n\n`;
|
|
37
37
|
};
|
|
38
38
|
return (title +
|
|
39
|
-
getSection(schemas_1.
|
|
39
|
+
getSection(schemas_1.ModuleSchema, 'Namespaces') +
|
|
40
40
|
getSection(schemas_1.ClassSchema, 'Classes') +
|
|
41
41
|
getSection(schemas_1.InterfaceSchema, 'Interfaces') +
|
|
42
42
|
getSection(schemas_1.FunctionLikeSchema, 'Functions') +
|
|
@@ -53,7 +53,7 @@ class APISchema extends schema_node_1.SchemaNode {
|
|
|
53
53
|
return (0, class_transformer_1.plainToInstance)(APISchema, obj);
|
|
54
54
|
}
|
|
55
55
|
static empty(componentId) {
|
|
56
|
-
return new APISchema({ filePath: '', line: 0, character: 0 }, new schemas_1.
|
|
56
|
+
return new APISchema({ filePath: '', line: 0, character: 0 }, new schemas_1.ModuleSchema({ filePath: '', line: 0, character: 0 }, []), componentId);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
__decorate([
|
package/dist/api-schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-schema.js","sourceRoot":"","sources":["../api-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA+D;AAC/D,kDAA0B;AAE1B,uCAUmB;AACnB,+CAAqD;AACrD,6DAA2D;AAC3D,kFAAkF;AAElF,MAAa,SAAU,SAAQ,wBAAU;IAOvC,YAAqB,QAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"api-schema.js","sourceRoot":"","sources":["../api-schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA+D;AAC/D,kDAA0B;AAE1B,uCAUmB;AACnB,+CAAqD;AACrD,6DAA2D;AAC3D,kFAAkF;AAElF,MAAa,SAAU,SAAQ,wBAAU;IAOvC,YAAqB,QAAkB,EAAE,MAAoB,EAAE,WAAwB;QACrF,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAErC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,SAAS,CACnB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,EAChD,SAAS,EACT,CAAC,CACF,CAAC;IACJ,CAAC;IAED,eAAe;QACb,MAAM,KAAK,GAAG,eAAK,CAAC,OAAO,CAAC,iBAAiB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9E,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,WAAmB,EAAE,EAAE;YACnD,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,YAAY,QAAQ,CAAC,CAAC;YAC7E,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;gBACnB,OAAO,EAAE,CAAC;aACX;YAED,OAAO,GAAG,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAChG,CAAC,CAAC;QAEF,OAAO,CACL,KAAK;YACL,UAAU,CAAC,sBAAY,EAAE,YAAY,CAAC;YACtC,UAAU,CAAC,qBAAW,EAAE,SAAS,CAAC;YAClC,UAAU,CAAC,yBAAe,EAAE,YAAY,CAAC;YACzC,UAAU,CAAC,4BAAkB,EAAE,WAAW,CAAC;YAC3C,UAAU,CAAC,4BAAkB,EAAE,WAAW,CAAC;YAC3C,UAAU,CAAC,oBAAU,EAAE,OAAO,CAAC;YAC/B,UAAU,CAAC,oBAAU,EAAE,OAAO,CAAC;YAC/B,UAAU,CAAC,uBAAa,EAAE,gBAAgB,CAAC;YAC3C,UAAU,CAAC,0BAAgB,EAAE,YAAY,CAAC,CAC3C,CAAC;IACJ,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAwB;QACxC,OAAO,IAAA,mCAAe,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,WAAwB;QACnC,OAAO,IAAI,SAAS,CAClB,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EACvC,IAAI,sBAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAC7D,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AA3DC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;yCACD;AAG9B;IADC,IAAA,6BAAS,EAAC,4CAAsB,CAAC;8CACA;AALpC,8BA6DC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-obj-to-class.js","sourceRoot":"","sources":["../../class-transformers/schema-obj-to-class.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA0F;AAC1F,mCAAiC;AAEjC,oDAAsC;AACtC,8DAA0D;AAE1D,SAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAqD;IAC1G,IAAI,IAAI,KAAK,sCAAkB,CAAC,cAAc,EAAE;QAC9C,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE,CAAC;AALD,8DAKC;AAED,SAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,IAAI,GAIL;IACC,IAAI,IAAI,KAAK,sCAAkB,CAAC,cAAc,EAAE;QAC9C,OAAO,KAAK,CAAC;KACd;IACD,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,6BAA6B,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAdD,kDAcC;AAED,SAAS,6BAA6B,CAAC,GAAwB;IAC7D,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,mFAAmF,CAAC,CAAC;KACtG;IACD,MAAM,WAAW,GAAG,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,CAAC,WAAW,EAAE;QAChB,yHAAyH;QACzH,OAAO,IAAI,8BAAa,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;KAClG;
|
|
1
|
+
{"version":3,"file":"schema-obj-to-class.js","sourceRoot":"","sources":["../../class-transformers/schema-obj-to-class.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA0F;AAC1F,mCAAiC;AAEjC,oDAAsC;AACtC,8DAA0D;AAE1D,SAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAqD;IAC1G,IAAI,IAAI,KAAK,sCAAkB,CAAC,cAAc,EAAE;QAC9C,OAAO,KAAK,CAAC;KACd;IACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC,CAAC;AAChE,CAAC;AALD,8DAKC;AAED,SAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,IAAI,GAIL;IACC,IAAI,IAAI,KAAK,sCAAkB,CAAC,cAAc,EAAE;QAC9C,OAAO,KAAK,CAAC;KACd;IACD,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,6BAA6B,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAdD,kDAcC;AAED,SAAS,6BAA6B,CAAC,GAAwB;IAC7D,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;QACjB,MAAM,IAAI,KAAK,CAAC,mFAAmF,CAAC,CAAC;KACtG;IACD,MAAM,WAAW,GAAG,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,CAAC,WAAW,EAAE;QAChB,yHAAyH;QACzH,OAAO,IAAI,8BAAa,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;KAClG;IAED,OAAO,IAAA,mCAAe,EAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,oBAAoB,CAAC,UAAkB;IAC9C,MAAM,cAAc,GAAG,IAAA,gBAAO,EAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,MAAM,WAAW,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;IAChF,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/dist/schema-node.d.ts
CHANGED
package/dist/schema-node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-node.js","sourceRoot":"","sources":["../schema-node.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AAGpD;;;;GAIG;AACH,MAAsB,UAAU;IAAhC;QACW,aAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"schema-node.js","sourceRoot":"","sources":["../schema-node.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AAGpD;;;;GAIG;AACH,MAAsB,UAAU;IAAhC;QACW,aAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAW5C,CAAC;IAHC,QAAQ;QACN,OAAO,IAAA,mCAAe,EAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AAZD,gCAYC"}
|
package/dist/schemas/class.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { Location, SchemaNode } from '../schema-node';
|
|
2
2
|
import { DocSchema } from './docs';
|
|
3
|
+
import { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';
|
|
3
4
|
export declare class ClassSchema extends SchemaNode {
|
|
4
|
-
readonly
|
|
5
|
+
readonly name: string;
|
|
5
6
|
readonly location: Location;
|
|
7
|
+
readonly signature: string;
|
|
8
|
+
readonly typeParams?: string[];
|
|
9
|
+
readonly extendsNodes?: ExpressionWithTypeArgumentsSchema[];
|
|
10
|
+
readonly implementNodes?: ExpressionWithTypeArgumentsSchema[];
|
|
6
11
|
readonly members: SchemaNode[];
|
|
7
12
|
readonly doc?: DocSchema;
|
|
8
|
-
constructor(
|
|
13
|
+
constructor(name: string, members: SchemaNode[], location: Location, signature: string, doc?: DocSchema, typeParams?: string[], extendsNodes?: ExpressionWithTypeArgumentsSchema[], implementNodes?: ExpressionWithTypeArgumentsSchema[]);
|
|
9
14
|
toString(): string;
|
|
10
15
|
}
|
package/dist/schemas/class.js
CHANGED
|
@@ -15,16 +15,20 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
15
15
|
const schema_node_1 = require("../schema-node");
|
|
16
16
|
const class_transformers_1 = require("../class-transformers");
|
|
17
17
|
class ClassSchema extends schema_node_1.SchemaNode {
|
|
18
|
-
constructor(
|
|
18
|
+
constructor(name, members, location, signature, doc, typeParams, extendsNodes, implementNodes) {
|
|
19
19
|
super();
|
|
20
|
-
this.
|
|
20
|
+
this.name = name;
|
|
21
21
|
this.location = location;
|
|
22
|
+
this.signature = signature;
|
|
23
|
+
this.typeParams = typeParams;
|
|
24
|
+
this.extendsNodes = extendsNodes;
|
|
25
|
+
this.implementNodes = implementNodes;
|
|
22
26
|
this.members = members;
|
|
23
27
|
this.doc = doc;
|
|
24
28
|
}
|
|
25
29
|
toString() {
|
|
26
30
|
const membersStr = this.members.map((m) => `* ${m.toString()}`).join('\n');
|
|
27
|
-
return `${chalk_1.default.bold.underline(this.
|
|
31
|
+
return `${chalk_1.default.bold.underline(this.name)}\n${membersStr}`;
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../schemas/class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAAuF;
|
|
1
|
+
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../schemas/class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAAuF;AAIvF,MAAa,WAAY,SAAQ,wBAAU;IAOzC,YACW,IAAY,EACrB,OAAqB,EACZ,QAAkB,EAClB,SAAiB,EAC1B,GAAe,EACN,UAAqB,EACrB,YAAkD,EAClD,cAAoD;QAE7D,KAAK,EAAE,CAAC;QATC,SAAI,GAAJ,IAAI,CAAQ;QAEZ,aAAQ,GAAR,QAAQ,CAAU;QAClB,cAAS,GAAT,SAAS,CAAQ;QAEjB,eAAU,GAAV,UAAU,CAAW;QACrB,iBAAY,GAAZ,YAAY,CAAsC;QAClD,mBAAc,GAAd,cAAc,CAAsC;QAG7D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,QAAQ;QACN,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3E,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;IAC7D,CAAC;CACF;AAxBC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;4CACN;AAG/B;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;wCACN;AAL3B,kCA0BC"}
|
|
@@ -2,7 +2,8 @@ import { Location, SchemaNode } from '../schema-node';
|
|
|
2
2
|
import { ParameterSchema } from './parameter';
|
|
3
3
|
export declare class ConstructorSchema extends SchemaNode {
|
|
4
4
|
readonly location: Location;
|
|
5
|
+
readonly signature?: string;
|
|
5
6
|
readonly params: ParameterSchema[];
|
|
6
|
-
constructor(location: Location, params: ParameterSchema[]);
|
|
7
|
+
constructor(location: Location, params: ParameterSchema[], signature?: string);
|
|
7
8
|
toString(): string;
|
|
8
9
|
}
|
|
@@ -15,9 +15,10 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
15
15
|
const schema_node_1 = require("../schema-node");
|
|
16
16
|
const class_transformers_1 = require("../class-transformers");
|
|
17
17
|
class ConstructorSchema extends schema_node_1.SchemaNode {
|
|
18
|
-
constructor(location, params) {
|
|
18
|
+
constructor(location, params, signature) {
|
|
19
19
|
super();
|
|
20
20
|
this.location = location;
|
|
21
|
+
this.signature = signature;
|
|
21
22
|
this.params = params;
|
|
22
23
|
}
|
|
23
24
|
toString() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructor.js","sourceRoot":"","sources":["../../schemas/constructor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AAEtD,8DAAkE;AAElE,MAAa,iBAAkB,SAAQ,wBAAU;IAG/C,YAAqB,QAAkB,EAAE,MAAyB;
|
|
1
|
+
{"version":3,"file":"constructor.js","sourceRoot":"","sources":["../../schemas/constructor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AAEtD,8DAAkE;AAElE,MAAa,iBAAkB,SAAQ,wBAAU;IAG/C,YAAqB,QAAkB,EAAE,MAAyB,EAAW,SAAkB;QAC7F,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAsC,cAAS,GAAT,SAAS,CAAS;QAE7F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,QAAQ;QACN,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1E,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,SAAS,GAAG,CAAC;IACtD,CAAC;CACF;AAVC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;iDACF;AAFrC,8CAYC"}
|
|
@@ -5,9 +5,9 @@ import { TagSchema } from './tag';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class PropertyLikeTagSchema extends TagSchema {
|
|
7
7
|
readonly location: Location;
|
|
8
|
-
readonly
|
|
8
|
+
readonly name: string;
|
|
9
9
|
readonly comment?: string;
|
|
10
10
|
readonly type?: SchemaNode;
|
|
11
|
-
constructor(location: Location,
|
|
11
|
+
constructor(location: Location, name: string, comment?: string, type?: SchemaNode);
|
|
12
12
|
toString(): string;
|
|
13
13
|
}
|
|
@@ -14,17 +14,17 @@ const class_transformers_1 = require("../../class-transformers");
|
|
|
14
14
|
* e.g. `@param myParam {string} some comment`
|
|
15
15
|
*/
|
|
16
16
|
class PropertyLikeTagSchema extends tag_1.TagSchema {
|
|
17
|
-
constructor(location,
|
|
17
|
+
constructor(location, name, comment, type) {
|
|
18
18
|
super(location, tag_1.TagName.parameter, comment);
|
|
19
19
|
this.location = location;
|
|
20
|
-
this.
|
|
20
|
+
this.name = name;
|
|
21
21
|
this.comment = comment;
|
|
22
22
|
this.type = type;
|
|
23
23
|
}
|
|
24
24
|
toString() {
|
|
25
25
|
const comment = this.comment ? ` ${this.comment}` : '';
|
|
26
26
|
const type = this.type ? ` {${this.type.toString()}} ` : '';
|
|
27
|
-
return `@${this.tagName} ${this.
|
|
27
|
+
return `@${this.tagName} ${this.name}${type} ${comment}`;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-like-tag.js","sourceRoot":"","sources":["../../../schemas/docs/property-like-tag.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAE9C,+BAA2C;AAC3C,iEAA+D;AAE/D;;GAEG;AACH,MAAa,qBAAsB,SAAQ,eAAS;IAGlD,YAAqB,QAAkB,EAAW,
|
|
1
|
+
{"version":3,"file":"property-like-tag.js","sourceRoot":"","sources":["../../../schemas/docs/property-like-tag.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAE9C,+BAA2C;AAC3C,iEAA+D;AAE/D;;GAEG;AACH,MAAa,qBAAsB,SAAQ,eAAS;IAGlD,YAAqB,QAAkB,EAAW,IAAY,EAAW,OAAgB,EAAE,IAAiB;QAC1G,KAAK,CAAC,QAAQ,EAAE,aAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QADzB,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAAW,YAAO,GAAP,OAAO,CAAS;QAEvF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC;IAC3D,CAAC;CACF;AAXC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;mDACJ;AAF7B,sDAaC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
import { DocSchema } from './docs';
|
|
3
|
+
export declare class EnumMemberSchema extends SchemaNode {
|
|
4
|
+
readonly location: Location;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly signature: string;
|
|
7
|
+
readonly value?: string;
|
|
8
|
+
readonly doc?: DocSchema;
|
|
9
|
+
constructor(location: Location, name: string, signature: string, value?: string, doc?: DocSchema);
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.EnumMemberSchema = void 0;
|
|
10
|
+
const class_transformer_1 = require("class-transformer");
|
|
11
|
+
const class_transformers_1 = require("../class-transformers");
|
|
12
|
+
const schema_node_1 = require("../schema-node");
|
|
13
|
+
class EnumMemberSchema extends schema_node_1.SchemaNode {
|
|
14
|
+
constructor(location, name, signature, value, doc) {
|
|
15
|
+
super();
|
|
16
|
+
this.location = location;
|
|
17
|
+
this.name = name;
|
|
18
|
+
this.signature = signature;
|
|
19
|
+
this.value = value;
|
|
20
|
+
this.doc = doc;
|
|
21
|
+
}
|
|
22
|
+
toString() {
|
|
23
|
+
if (!this.value)
|
|
24
|
+
return this.name;
|
|
25
|
+
return `${this.name}=${this.value}`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
30
|
+
], EnumMemberSchema.prototype, "doc", void 0);
|
|
31
|
+
exports.EnumMemberSchema = EnumMemberSchema;
|
|
32
|
+
//# sourceMappingURL=enum-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum-member.js","sourceRoot":"","sources":["../../schemas/enum-member.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,8DAA4D;AAC5D,gDAAsD;AAGtD,MAAa,gBAAiB,SAAQ,wBAAU;IAI9C,YACW,QAAkB,EAClB,IAAY,EACZ,SAAiB,EACjB,KAAc,EACvB,GAAe;QAEf,KAAK,EAAE,CAAC;QANC,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAQ;QACjB,UAAK,GAAL,KAAK,CAAS;QAIvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC;QAClC,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;IACtC,CAAC;CACF;AAjBC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;6CACN;AAF3B,4CAmBC"}
|
package/dist/schemas/enum.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { DocSchema } from './docs';
|
|
|
3
3
|
export declare class EnumSchema extends SchemaNode {
|
|
4
4
|
readonly location: Location;
|
|
5
5
|
readonly name: string;
|
|
6
|
-
readonly
|
|
6
|
+
readonly signature: string;
|
|
7
7
|
readonly doc?: DocSchema;
|
|
8
|
-
|
|
8
|
+
readonly members: SchemaNode[];
|
|
9
|
+
constructor(location: Location, name: string, members: SchemaNode[], signature: string, doc?: DocSchema);
|
|
9
10
|
toString(): string;
|
|
10
11
|
}
|
package/dist/schemas/enum.js
CHANGED
|
@@ -15,12 +15,13 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
15
15
|
const class_transformers_1 = require("../class-transformers");
|
|
16
16
|
const schema_node_1 = require("../schema-node");
|
|
17
17
|
class EnumSchema extends schema_node_1.SchemaNode {
|
|
18
|
-
constructor(location, name, members, doc) {
|
|
18
|
+
constructor(location, name, members, signature, doc) {
|
|
19
19
|
super();
|
|
20
20
|
this.location = location;
|
|
21
21
|
this.name = name;
|
|
22
|
-
this.
|
|
22
|
+
this.signature = signature;
|
|
23
23
|
this.doc = doc;
|
|
24
|
+
this.members = members;
|
|
24
25
|
}
|
|
25
26
|
toString() {
|
|
26
27
|
const membersStr = this.members.map((m) => `* ${m.toString()}`).join('\n');
|
|
@@ -30,5 +31,8 @@ class EnumSchema extends schema_node_1.SchemaNode {
|
|
|
30
31
|
__decorate([
|
|
31
32
|
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
32
33
|
], EnumSchema.prototype, "doc", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
|
|
36
|
+
], EnumSchema.prototype, "members", void 0);
|
|
33
37
|
exports.EnumSchema = EnumSchema;
|
|
34
38
|
//# sourceMappingURL=enum.js.map
|
package/dist/schemas/enum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../schemas/enum.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../schemas/enum.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,8DAAuF;AACvF,gDAAsD;AAGtD,MAAa,UAAW,SAAQ,wBAAU;IAMxC,YACW,QAAkB,EAClB,IAAY,EACrB,OAAqB,EACZ,SAAiB,EAC1B,GAAe;QAEf,KAAK,EAAE,CAAC;QANC,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAQ;QAEZ,cAAS,GAAT,SAAS,CAAQ;QAI1B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,QAAQ;QACN,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3E,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;IAC7D,CAAC;CACF;AApBC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;uCACN;AAEzB;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;2CACN;AAJjC,gCAsBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
export declare class ExpressionWithTypeArgumentsSchema extends SchemaNode {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly location: Location;
|
|
5
|
+
readonly typeArgs: SchemaNode[];
|
|
6
|
+
readonly expression: SchemaNode;
|
|
7
|
+
constructor(typeArgs: SchemaNode[], expression: SchemaNode, name: string, location: Location);
|
|
8
|
+
toString(): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.ExpressionWithTypeArgumentsSchema = void 0;
|
|
10
|
+
const class_transformer_1 = require("class-transformer");
|
|
11
|
+
const schema_node_1 = require("../schema-node");
|
|
12
|
+
const class_transformers_1 = require("../class-transformers");
|
|
13
|
+
class ExpressionWithTypeArgumentsSchema extends schema_node_1.SchemaNode {
|
|
14
|
+
constructor(typeArgs, expression, name, location) {
|
|
15
|
+
super();
|
|
16
|
+
this.name = name;
|
|
17
|
+
this.location = location;
|
|
18
|
+
this.typeArgs = typeArgs;
|
|
19
|
+
this.expression = expression;
|
|
20
|
+
}
|
|
21
|
+
toString() {
|
|
22
|
+
return this.name;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
|
|
27
|
+
], ExpressionWithTypeArgumentsSchema.prototype, "typeArgs", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
30
|
+
], ExpressionWithTypeArgumentsSchema.prototype, "expression", void 0);
|
|
31
|
+
exports.ExpressionWithTypeArgumentsSchema = ExpressionWithTypeArgumentsSchema;
|
|
32
|
+
//# sourceMappingURL=expression-with-arguments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expression-with-arguments.js","sourceRoot":"","sources":["../../schemas/expression-with-arguments.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAAuF;AAEvF,MAAa,iCAAkC,SAAQ,wBAAU;IAO/D,YAAY,QAAsB,EAAE,UAAsB,EAAW,IAAY,EAAW,QAAkB;QAC5G,KAAK,EAAE,CAAC;QAD2D,SAAI,GAAJ,IAAI,CAAQ;QAAW,aAAQ,GAAR,QAAQ,CAAU;QAE5G,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AAdC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;mEACL;AAGhC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;qEACC;AALlC,8EAgBC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Ensure that any new Schema class ends with the word 'Schema'
|
|
3
|
+
* This will make sure that the Class Name is not minimized during prod bundling process
|
|
4
|
+
* and the schemaObjToClass can match and instantiate the Schema Class correctly
|
|
5
|
+
*/
|
|
6
|
+
export { ModuleSchema } from './module';
|
|
2
7
|
export { FunctionLikeSchema, Modifier } from './function-like';
|
|
3
8
|
export { TypeRefSchema } from './type-ref';
|
|
4
9
|
export { VariableLikeSchema } from './variable-like';
|
|
@@ -21,6 +26,7 @@ export { TypeOperatorSchema } from './type-operator';
|
|
|
21
26
|
export { TupleTypeSchema } from './tuple-type';
|
|
22
27
|
export { ParameterSchema } from './parameter';
|
|
23
28
|
export { EnumSchema } from './enum';
|
|
29
|
+
export { EnumMemberSchema } from './enum-member';
|
|
24
30
|
export { ParenthesizedTypeSchema } from './parenthesized-type';
|
|
25
31
|
export { TypePredicateSchema } from './type-predicate';
|
|
26
32
|
export { IndexedAccessSchema } from './indexed-access-type';
|
|
@@ -30,5 +36,7 @@ export { ThisTypeSchema } from './this-type';
|
|
|
30
36
|
export { UnknownSchema } from './unknown-schema';
|
|
31
37
|
export { UnresolvedSchema } from './unresolved-schema';
|
|
32
38
|
export { ConditionalTypeSchema } from './conditional-type';
|
|
39
|
+
export { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';
|
|
40
|
+
export { NamedTupleSchema } from './named-tuple';
|
|
33
41
|
export { UnImplementedSchema } from './unimplemented-schema';
|
|
34
42
|
export * from './docs';
|
package/dist/schemas/index.js
CHANGED
|
@@ -14,9 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.UnImplementedSchema = exports.ConditionalTypeSchema = exports.UnresolvedSchema = exports.UnknownSchema = exports.ThisTypeSchema = exports.TemplateLiteralTypeSpanSchema = exports.TemplateLiteralTypeSchema = exports.IndexedAccessSchema = exports.TypePredicateSchema = exports.ParenthesizedTypeSchema = exports.EnumSchema = exports.ParameterSchema = exports.TupleTypeSchema = exports.TypeOperatorSchema = exports.TypeArraySchema = exports.KeywordTypeSchema = exports.LiteralTypeSchema = exports.InferenceTypeSchema = exports.TypeQuerySchema = exports.SetAccessorSchema = exports.GetAccessorSchema = exports.InterfaceSchema = exports.IndexSignatureSchema = exports.TypeLiteralSchema = exports.TypeUnionSchema = exports.TypeIntersectionSchema = exports.TypeSchema = exports.ConstructorSchema = exports.ClassSchema = exports.VariableLikeSchema = exports.TypeRefSchema = exports.FunctionLikeSchema = exports.
|
|
17
|
+
exports.UnImplementedSchema = exports.NamedTupleSchema = exports.ExpressionWithTypeArgumentsSchema = exports.ConditionalTypeSchema = exports.UnresolvedSchema = exports.UnknownSchema = exports.ThisTypeSchema = exports.TemplateLiteralTypeSpanSchema = exports.TemplateLiteralTypeSchema = exports.IndexedAccessSchema = exports.TypePredicateSchema = exports.ParenthesizedTypeSchema = exports.EnumMemberSchema = exports.EnumSchema = exports.ParameterSchema = exports.TupleTypeSchema = exports.TypeOperatorSchema = exports.TypeArraySchema = exports.KeywordTypeSchema = exports.LiteralTypeSchema = exports.InferenceTypeSchema = exports.TypeQuerySchema = exports.SetAccessorSchema = exports.GetAccessorSchema = exports.InterfaceSchema = exports.IndexSignatureSchema = exports.TypeLiteralSchema = exports.TypeUnionSchema = exports.TypeIntersectionSchema = exports.TypeSchema = exports.ConstructorSchema = exports.ClassSchema = exports.VariableLikeSchema = exports.TypeRefSchema = exports.FunctionLikeSchema = exports.ModuleSchema = void 0;
|
|
18
|
+
/**
|
|
19
|
+
* Ensure that any new Schema class ends with the word 'Schema'
|
|
20
|
+
* This will make sure that the Class Name is not minimized during prod bundling process
|
|
21
|
+
* and the schemaObjToClass can match and instantiate the Schema Class correctly
|
|
22
|
+
*/
|
|
18
23
|
var module_1 = require("./module");
|
|
19
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "ModuleSchema", { enumerable: true, get: function () { return module_1.ModuleSchema; } });
|
|
20
25
|
var function_like_1 = require("./function-like");
|
|
21
26
|
Object.defineProperty(exports, "FunctionLikeSchema", { enumerable: true, get: function () { return function_like_1.FunctionLikeSchema; } });
|
|
22
27
|
var type_ref_1 = require("./type-ref");
|
|
@@ -61,6 +66,8 @@ var parameter_1 = require("./parameter");
|
|
|
61
66
|
Object.defineProperty(exports, "ParameterSchema", { enumerable: true, get: function () { return parameter_1.ParameterSchema; } });
|
|
62
67
|
var enum_1 = require("./enum");
|
|
63
68
|
Object.defineProperty(exports, "EnumSchema", { enumerable: true, get: function () { return enum_1.EnumSchema; } });
|
|
69
|
+
var enum_member_1 = require("./enum-member");
|
|
70
|
+
Object.defineProperty(exports, "EnumMemberSchema", { enumerable: true, get: function () { return enum_member_1.EnumMemberSchema; } });
|
|
64
71
|
var parenthesized_type_1 = require("./parenthesized-type");
|
|
65
72
|
Object.defineProperty(exports, "ParenthesizedTypeSchema", { enumerable: true, get: function () { return parenthesized_type_1.ParenthesizedTypeSchema; } });
|
|
66
73
|
var type_predicate_1 = require("./type-predicate");
|
|
@@ -79,6 +86,10 @@ var unresolved_schema_1 = require("./unresolved-schema");
|
|
|
79
86
|
Object.defineProperty(exports, "UnresolvedSchema", { enumerable: true, get: function () { return unresolved_schema_1.UnresolvedSchema; } });
|
|
80
87
|
var conditional_type_1 = require("./conditional-type");
|
|
81
88
|
Object.defineProperty(exports, "ConditionalTypeSchema", { enumerable: true, get: function () { return conditional_type_1.ConditionalTypeSchema; } });
|
|
89
|
+
var expression_with_arguments_1 = require("./expression-with-arguments");
|
|
90
|
+
Object.defineProperty(exports, "ExpressionWithTypeArgumentsSchema", { enumerable: true, get: function () { return expression_with_arguments_1.ExpressionWithTypeArgumentsSchema; } });
|
|
91
|
+
var named_tuple_1 = require("./named-tuple");
|
|
92
|
+
Object.defineProperty(exports, "NamedTupleSchema", { enumerable: true, get: function () { return named_tuple_1.NamedTupleSchema; } });
|
|
82
93
|
var unimplemented_schema_1 = require("./unimplemented-schema");
|
|
83
94
|
Object.defineProperty(exports, "UnImplementedSchema", { enumerable: true, get: function () { return unimplemented_schema_1.UnImplementedSchema; } });
|
|
84
95
|
__exportStar(require("./docs"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AACrB,iDAA+D;AAAtD,mHAAA,kBAAkB,OAAA;AAC3B,uCAA2C;AAAlC,yGAAA,aAAa,OAAA;AACtB,iDAAqD;AAA5C,mHAAA,kBAAkB,OAAA;AAC3B,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AACpB,6CAAkD;AAAzC,gHAAA,iBAAiB,OAAA;AAC1B,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,yDAA6D;AAApD,2HAAA,sBAAsB,OAAA;AAC/B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,qDAAyD;AAAhD,uHAAA,oBAAoB,OAAA;AAC7B,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,mDAAuD;AAA9C,qHAAA,mBAAmB,OAAA;AAC5B,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,iDAAqD;AAA5C,mHAAA,kBAAkB,OAAA;AAC3B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,6CAAiD;AAAxC,+GAAA,gBAAgB,OAAA;AACzB,2DAA+D;AAAtD,6HAAA,uBAAuB,OAAA;AAChC,mDAAuD;AAA9C,qHAAA,mBAAmB,OAAA;AAC5B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,iEAAoE;AAA3D,kIAAA,yBAAyB,OAAA;AAClC,2EAA6E;AAApE,2IAAA,6BAA6B,OAAA;AACtC,yCAA6C;AAApC,2GAAA,cAAc,OAAA;AACvB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AACtB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,uDAA2D;AAAlD,yHAAA,qBAAqB,OAAA;AAC9B,yEAAgF;AAAvE,8IAAA,iCAAiC,OAAA;AAC1C,6CAAiD;AAAxC,+GAAA,gBAAgB,OAAA;AACzB,+DAA6D;AAApD,2HAAA,mBAAmB,OAAA;AAC5B,yCAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inference-type.js","sourceRoot":"","sources":["../../schemas/inference-type.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AAEtD;;GAEG;AACH,MAAa,mBAAoB,SAAQ,wBAAU;IACjD,YAAqB,QAAkB,EAAW,IAAY,EAAW,IAAa;QACpF,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAAW,SAAI,GAAJ,IAAI,CAAS;IAEtF,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"inference-type.js","sourceRoot":"","sources":["../../schemas/inference-type.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AAEtD;;GAEG;AACH,MAAa,mBAAoB,SAAQ,wBAAU;IACjD,YAAqB,QAAkB,EAAW,IAAY,EAAW,IAAa;QACpF,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAAW,SAAI,GAAJ,IAAI,CAAS;IAEtF,CAAC;IAED,QAAQ;QACN,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;YACxC,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;SACrC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AAXD,kDAWC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Location, SchemaNode } from '../schema-node';
|
|
2
2
|
import { DocSchema } from './docs';
|
|
3
|
+
import { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';
|
|
3
4
|
export declare class InterfaceSchema extends SchemaNode {
|
|
4
5
|
readonly location: Location;
|
|
5
6
|
readonly name: string;
|
|
7
|
+
readonly signature: string;
|
|
8
|
+
readonly extendsNodes: ExpressionWithTypeArgumentsSchema[];
|
|
9
|
+
readonly typeParams?: string[];
|
|
6
10
|
readonly members: SchemaNode[];
|
|
7
11
|
readonly doc?: DocSchema;
|
|
8
|
-
constructor(location: Location, name: string, members: SchemaNode[], doc?: DocSchema);
|
|
12
|
+
constructor(location: Location, name: string, signature: string, extendsNodes: ExpressionWithTypeArgumentsSchema[], members: SchemaNode[], doc?: DocSchema, typeParams?: string[]);
|
|
9
13
|
toString(): string;
|
|
10
14
|
}
|
|
@@ -15,10 +15,13 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
15
15
|
const schema_node_1 = require("../schema-node");
|
|
16
16
|
const class_transformers_1 = require("../class-transformers");
|
|
17
17
|
class InterfaceSchema extends schema_node_1.SchemaNode {
|
|
18
|
-
constructor(location, name, members, doc) {
|
|
18
|
+
constructor(location, name, signature, extendsNodes, members, doc, typeParams) {
|
|
19
19
|
super();
|
|
20
20
|
this.location = location;
|
|
21
21
|
this.name = name;
|
|
22
|
+
this.signature = signature;
|
|
23
|
+
this.extendsNodes = extendsNodes;
|
|
24
|
+
this.typeParams = typeParams;
|
|
22
25
|
this.members = members;
|
|
23
26
|
this.doc = doc;
|
|
24
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../schemas/interface.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAAuF;
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../schemas/interface.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAAuF;AAIvF,MAAa,eAAgB,SAAQ,wBAAU;IAO7C,YACW,QAAkB,EAClB,IAAY,EACZ,SAAiB,EACjB,YAAiD,EAC1D,OAAqB,EACrB,GAAe,EACN,UAAqB;QAE9B,KAAK,EAAE,CAAC;QARC,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAQ;QACjB,iBAAY,GAAZ,YAAY,CAAqC;QAGjD,eAAU,GAAV,UAAU,CAAW;QAG9B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,QAAQ;QACN,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3E,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,UAAU,EAAE,CAAC;IAC7D,CAAC;CACF;AAvBC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;gDACN;AAG/B;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;4CACN;AAL3B,0CAyBC"}
|
package/dist/schemas/module.d.ts
CHANGED
package/dist/schemas/module.js
CHANGED
|
@@ -9,12 +9,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.ModuleSchema = void 0;
|
|
13
13
|
const chalk_1 = __importDefault(require("chalk"));
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const schema_node_1 = require("../schema-node");
|
|
16
16
|
const class_transformers_1 = require("../class-transformers");
|
|
17
|
-
class
|
|
17
|
+
class ModuleSchema extends schema_node_1.SchemaNode {
|
|
18
18
|
constructor(location, exports) {
|
|
19
19
|
super();
|
|
20
20
|
this.location = location;
|
|
@@ -29,7 +29,7 @@ class Module extends schema_node_1.SchemaNode {
|
|
|
29
29
|
}
|
|
30
30
|
flatExportsRecursively() {
|
|
31
31
|
this.exports = this.exports.reduce((acc, exp) => {
|
|
32
|
-
if (exp instanceof
|
|
32
|
+
if (exp instanceof ModuleSchema) {
|
|
33
33
|
exp.flatExportsRecursively();
|
|
34
34
|
if (exp.namespace)
|
|
35
35
|
return [...acc, exp];
|
|
@@ -47,6 +47,6 @@ class Module extends schema_node_1.SchemaNode {
|
|
|
47
47
|
}
|
|
48
48
|
__decorate([
|
|
49
49
|
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
|
|
50
|
-
],
|
|
51
|
-
exports.
|
|
50
|
+
], ModuleSchema.prototype, "exports", void 0);
|
|
51
|
+
exports.ModuleSchema = ModuleSchema;
|
|
52
52
|
//# sourceMappingURL=module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../schemas/module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA0B;AAC1B,yDAA8C;AAC9C,gDAAsD;AACtD,8DAAkE;AAElE,MAAa,
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../schemas/module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA0B;AAC1B,yDAA8C;AAC9C,gDAAsD;AACtD,8DAAkE;AAElE,MAAa,YAAa,SAAQ,wBAAU;IAI1C,YAAqB,QAAkB,EAAE,OAAqB;QAC5D,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAErC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,QAAQ;QACN,OAAO;YACL,eAAe,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI;YACtC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;SACnD,CAAC;IACJ,CAAC;IAED,sBAAsB;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC9C,IAAI,GAAG,YAAY,YAAY,EAAE;gBAC/B,GAAG,CAAC,sBAAsB,EAAE,CAAC;gBAC7B,IAAI,GAAG,CAAC,SAAS;oBAAE,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;gBACxC,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;aACjC;YACD,OAAO,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;QACvB,CAAC,EAAE,EAAkB,CAAC,CAAC;IACzB,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,IAAI,CAAC,SAAS;YACjB,MAAM,IAAI,KAAK,CACb,kHAAkH,CACnH,CAAC;QACJ,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3E,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,UAAU,EAAE,CAAC;IAClE,CAAC;CACF;AAlCC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;6CACf;AAFxB,oCAoCC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
export declare class NamedTupleSchema extends SchemaNode {
|
|
3
|
+
readonly location: Location;
|
|
4
|
+
readonly type: SchemaNode;
|
|
5
|
+
readonly name?: string;
|
|
6
|
+
constructor(location: Location, type: SchemaNode, name?: string);
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NamedTupleSchema = void 0;
|
|
4
|
+
const schema_node_1 = require("../schema-node");
|
|
5
|
+
class NamedTupleSchema extends schema_node_1.SchemaNode {
|
|
6
|
+
constructor(location, type, name) {
|
|
7
|
+
super();
|
|
8
|
+
this.location = location;
|
|
9
|
+
this.type = type;
|
|
10
|
+
this.name = name;
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
return `${this.name}: ${this.type.toString()}`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.NamedTupleSchema = NamedTupleSchema;
|
|
17
|
+
//# sourceMappingURL=named-tuple.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"named-tuple.js","sourceRoot":"","sources":["../../schemas/named-tuple.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AAEtD,MAAa,gBAAiB,SAAQ,wBAAU;IAC9C,YAAqB,QAAkB,EAAW,IAAgB,EAAW,IAAa;QACxF,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAY;QAAW,SAAI,GAAJ,IAAI,CAAS;IAE1F,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IACjD,CAAC;CACF;AARD,4CAQC"}
|
|
@@ -6,6 +6,7 @@ export declare class ParameterSchema extends SchemaNode {
|
|
|
6
6
|
readonly defaultValue?: any;
|
|
7
7
|
readonly description?: string;
|
|
8
8
|
readonly type: SchemaNode;
|
|
9
|
-
|
|
9
|
+
readonly objectBindingNodes?: SchemaNode[];
|
|
10
|
+
constructor(location: Location, name: string, type: SchemaNode, isOptional: boolean, defaultValue?: any, description?: string, objectBindingNodes?: SchemaNode[]);
|
|
10
11
|
toString(): string;
|
|
11
12
|
}
|
|
@@ -10,8 +10,9 @@ exports.ParameterSchema = void 0;
|
|
|
10
10
|
const class_transformer_1 = require("class-transformer");
|
|
11
11
|
const schema_node_1 = require("../schema-node");
|
|
12
12
|
const class_transformers_1 = require("../class-transformers");
|
|
13
|
+
const schema_obj_to_class_1 = require("../class-transformers/schema-obj-to-class");
|
|
13
14
|
class ParameterSchema extends schema_node_1.SchemaNode {
|
|
14
|
-
constructor(location, name, type, isOptional, defaultValue, description) {
|
|
15
|
+
constructor(location, name, type, isOptional, defaultValue, description, objectBindingNodes) {
|
|
15
16
|
super();
|
|
16
17
|
this.location = location;
|
|
17
18
|
this.name = name;
|
|
@@ -19,6 +20,7 @@ class ParameterSchema extends schema_node_1.SchemaNode {
|
|
|
19
20
|
this.defaultValue = defaultValue;
|
|
20
21
|
this.description = description;
|
|
21
22
|
this.type = type;
|
|
23
|
+
this.objectBindingNodes = objectBindingNodes;
|
|
22
24
|
}
|
|
23
25
|
toString() {
|
|
24
26
|
return `${this.name}${this.isOptional ? '?' : ''}: ${this.type.toString()}`;
|
|
@@ -27,5 +29,8 @@ class ParameterSchema extends schema_node_1.SchemaNode {
|
|
|
27
29
|
__decorate([
|
|
28
30
|
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
29
31
|
], ParameterSchema.prototype, "type", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, class_transformer_1.Transform)(schema_obj_to_class_1.schemaObjArrayToInstances)
|
|
34
|
+
], ParameterSchema.prototype, "objectBindingNodes", void 0);
|
|
30
35
|
exports.ParameterSchema = ParameterSchema;
|
|
31
36
|
//# sourceMappingURL=parameter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameter.js","sourceRoot":"","sources":["../../schemas/parameter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;
|
|
1
|
+
{"version":3,"file":"parameter.js","sourceRoot":"","sources":["../../schemas/parameter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;AAC5D,mFAAsF;AAEtF,MAAa,eAAgB,SAAQ,wBAAU;IAM7C,YACW,QAAkB,EAClB,IAAY,EACrB,IAAgB,EACP,UAAmB,EACnB,YAAkB,EAClB,WAAoB,EAC7B,kBAAiC;QAEjC,KAAK,EAAE,CAAC;QARC,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAQ;QAEZ,eAAU,GAAV,UAAU,CAAS;QACnB,iBAAY,GAAZ,YAAY,CAAM;QAClB,gBAAW,GAAX,WAAW,CAAS;QAI7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC9E,CAAC;CACF;AArBC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;6CACL;AAE1B;IADC,IAAA,6BAAS,EAAC,+CAAyB,CAAC;2DACM;AAJ7C,0CAuBC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Location, SchemaNode } from '../schema-node';
|
|
2
2
|
export declare class TypeOperatorSchema extends SchemaNode {
|
|
3
3
|
readonly location: Location;
|
|
4
|
-
readonly
|
|
4
|
+
readonly name: string;
|
|
5
5
|
type: SchemaNode;
|
|
6
|
-
constructor(location: Location,
|
|
6
|
+
constructor(location: Location, name: string, type: SchemaNode);
|
|
7
7
|
toString(): string;
|
|
8
8
|
}
|
|
@@ -11,14 +11,14 @@ const class_transformer_1 = require("class-transformer");
|
|
|
11
11
|
const schema_node_1 = require("../schema-node");
|
|
12
12
|
const class_transformers_1 = require("../class-transformers");
|
|
13
13
|
class TypeOperatorSchema extends schema_node_1.SchemaNode {
|
|
14
|
-
constructor(location,
|
|
14
|
+
constructor(location, name, type) {
|
|
15
15
|
super();
|
|
16
16
|
this.location = location;
|
|
17
|
-
this.
|
|
17
|
+
this.name = name;
|
|
18
18
|
this.type = type;
|
|
19
19
|
}
|
|
20
20
|
toString() {
|
|
21
|
-
return `${this.
|
|
21
|
+
return `${this.name} ${this.type.toString()}`;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-operator.js","sourceRoot":"","sources":["../../schemas/type-operator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;AAE5D,MAAa,kBAAmB,SAAQ,wBAAU;IAGhD,YAAqB,QAAkB,EAAW,
|
|
1
|
+
{"version":3,"file":"type-operator.js","sourceRoot":"","sources":["../../schemas/type-operator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;AAE5D,MAAa,kBAAmB,SAAQ,wBAAU;IAGhD,YAAqB,QAAkB,EAAW,IAAY,EAAE,IAAgB;QAC9E,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAE5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAChD,CAAC;CACF;AATC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;gDACd;AAFnB,gDAWC"}
|
|
@@ -14,9 +14,9 @@ import { Location, SchemaNode } from '../schema-node';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class TypePredicateSchema extends SchemaNode {
|
|
16
16
|
readonly location: Location;
|
|
17
|
-
readonly
|
|
17
|
+
readonly name: string;
|
|
18
18
|
readonly hasAssertsModifier: boolean;
|
|
19
19
|
readonly type?: SchemaNode;
|
|
20
|
-
constructor(location: Location,
|
|
20
|
+
constructor(location: Location, name: string, type?: SchemaNode, hasAssertsModifier?: boolean);
|
|
21
21
|
toString(): string;
|
|
22
22
|
}
|
|
@@ -24,17 +24,17 @@ const class_transformers_1 = require("../class-transformers");
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
class TypePredicateSchema extends schema_node_1.SchemaNode {
|
|
27
|
-
constructor(location,
|
|
27
|
+
constructor(location, name, type, hasAssertsModifier = false) {
|
|
28
28
|
super();
|
|
29
29
|
this.location = location;
|
|
30
|
-
this.
|
|
30
|
+
this.name = name;
|
|
31
31
|
this.hasAssertsModifier = hasAssertsModifier;
|
|
32
32
|
this.type = type;
|
|
33
33
|
}
|
|
34
34
|
toString() {
|
|
35
35
|
const assertsKeyword = this.hasAssertsModifier ? 'asserts ' : '';
|
|
36
36
|
const typeStr = this.type ? ` is ${this.type.toString()}` : '';
|
|
37
|
-
return assertsKeyword + this.
|
|
37
|
+
return assertsKeyword + this.name + typeStr;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-predicate.js","sourceRoot":"","sources":["../../schemas/type-predicate.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAa,mBAAoB,SAAQ,wBAAU;IAGjD,YACW,QAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"type-predicate.js","sourceRoot":"","sources":["../../schemas/type-predicate.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;AAE5D;;;;;;;;;;;;GAYG;AACH,MAAa,mBAAoB,SAAQ,wBAAU;IAGjD,YACW,QAAkB,EAClB,IAAY,EACrB,IAAiB,EACR,qBAAqB,KAAK;QAEnC,KAAK,EAAE,CAAC;QALC,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAQ;QAEZ,uBAAkB,GAAlB,kBAAkB,CAAQ;QAGnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QACjE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,OAAO,cAAc,GAAG,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;IAC9C,CAAC;CACF;AAhBC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;iDACJ;AAF7B,kDAkBC"}
|
|
@@ -6,8 +6,8 @@ import { Location, SchemaNode } from '../schema-node';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class UnknownSchema extends SchemaNode {
|
|
8
8
|
readonly location: Location;
|
|
9
|
-
readonly
|
|
9
|
+
readonly name: string;
|
|
10
10
|
readonly schemaObj: Record<string, any>;
|
|
11
|
-
constructor(location: Location,
|
|
11
|
+
constructor(location: Location, name: string, schemaObj: Record<string, any>);
|
|
12
12
|
toString(): string;
|
|
13
13
|
}
|
|
@@ -8,14 +8,14 @@ const schema_node_1 = require("../schema-node");
|
|
|
8
8
|
* wrapped in this class.
|
|
9
9
|
*/
|
|
10
10
|
class UnknownSchema extends schema_node_1.SchemaNode {
|
|
11
|
-
constructor(location,
|
|
11
|
+
constructor(location, name, schemaObj) {
|
|
12
12
|
super();
|
|
13
13
|
this.location = location;
|
|
14
|
-
this.
|
|
14
|
+
this.name = name;
|
|
15
15
|
this.schemaObj = schemaObj;
|
|
16
16
|
}
|
|
17
17
|
toString() {
|
|
18
|
-
return `<<unknown schema ${this.
|
|
18
|
+
return `<<unknown schema ${this.name}>>`;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.UnknownSchema = UnknownSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unknown-schema.js","sourceRoot":"","sources":["../../schemas/unknown-schema.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AAEtD;;;;GAIG;AACH,MAAa,aAAc,SAAQ,wBAAU;IAC3C,YAAqB,QAAkB,EAAW,
|
|
1
|
+
{"version":3,"file":"unknown-schema.js","sourceRoot":"","sources":["../../schemas/unknown-schema.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AAEtD;;;;GAIG;AACH,MAAa,aAAc,SAAQ,wBAAU;IAC3C,YAAqB,QAAkB,EAAW,IAAY,EAAW,SAA8B;QACrG,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAAW,cAAS,GAAT,SAAS,CAAqB;IAEvG,CAAC;IAED,QAAQ;QACN,OAAO,oBAAoB,IAAI,CAAC,IAAI,IAAI,CAAC;IAC3C,CAAC;CACF;AARD,sCAQC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/semantics.entities.semantic-schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.48",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/semantics/entities/semantic-schema",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.semantics",
|
|
8
8
|
"name": "entities/semantic-schema",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.48"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
;
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.48/dist/semantic-schema.docs.md';
|
|
3
3
|
|
|
4
4
|
export const compositions = [];
|
|
5
5
|
export const overview = [overview_0];
|
package/schema-node.ts
CHANGED
package/schemas/class.ts
CHANGED
|
@@ -3,6 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
4
|
import { schemaObjArrayToInstances, schemaObjToInstance } from '../class-transformers';
|
|
5
5
|
import { DocSchema } from './docs';
|
|
6
|
+
import { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';
|
|
6
7
|
|
|
7
8
|
export class ClassSchema extends SchemaNode {
|
|
8
9
|
@Transform(schemaObjArrayToInstances)
|
|
@@ -11,7 +12,16 @@ export class ClassSchema extends SchemaNode {
|
|
|
11
12
|
@Transform(schemaObjToInstance)
|
|
12
13
|
readonly doc?: DocSchema;
|
|
13
14
|
|
|
14
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
readonly name: string,
|
|
17
|
+
members: SchemaNode[],
|
|
18
|
+
readonly location: Location,
|
|
19
|
+
readonly signature: string,
|
|
20
|
+
doc?: DocSchema,
|
|
21
|
+
readonly typeParams?: string[],
|
|
22
|
+
readonly extendsNodes?: ExpressionWithTypeArgumentsSchema[],
|
|
23
|
+
readonly implementNodes?: ExpressionWithTypeArgumentsSchema[]
|
|
24
|
+
) {
|
|
15
25
|
super();
|
|
16
26
|
this.members = members;
|
|
17
27
|
this.doc = doc;
|
|
@@ -19,6 +29,6 @@ export class ClassSchema extends SchemaNode {
|
|
|
19
29
|
|
|
20
30
|
toString() {
|
|
21
31
|
const membersStr = this.members.map((m) => `* ${m.toString()}`).join('\n');
|
|
22
|
-
return `${chalk.bold.underline(this.
|
|
32
|
+
return `${chalk.bold.underline(this.name)}\n${membersStr}`;
|
|
23
33
|
}
|
|
24
34
|
}
|
package/schemas/constructor.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { schemaObjArrayToInstances } from '../class-transformers';
|
|
|
7
7
|
export class ConstructorSchema extends SchemaNode {
|
|
8
8
|
@Transform(schemaObjArrayToInstances)
|
|
9
9
|
readonly params: ParameterSchema[];
|
|
10
|
-
constructor(readonly location: Location, params: ParameterSchema[]) {
|
|
10
|
+
constructor(readonly location: Location, params: ParameterSchema[], readonly signature?: string) {
|
|
11
11
|
super();
|
|
12
12
|
this.params = params;
|
|
13
13
|
}
|
|
@@ -9,7 +9,7 @@ import { schemaObjToInstance } from '../../class-transformers';
|
|
|
9
9
|
export class PropertyLikeTagSchema extends TagSchema {
|
|
10
10
|
@Transform(schemaObjToInstance)
|
|
11
11
|
readonly type?: SchemaNode;
|
|
12
|
-
constructor(readonly location: Location, readonly
|
|
12
|
+
constructor(readonly location: Location, readonly name: string, readonly comment?: string, type?: SchemaNode) {
|
|
13
13
|
super(location, TagName.parameter, comment);
|
|
14
14
|
this.type = type;
|
|
15
15
|
}
|
|
@@ -17,6 +17,6 @@ export class PropertyLikeTagSchema extends TagSchema {
|
|
|
17
17
|
toString() {
|
|
18
18
|
const comment = this.comment ? ` ${this.comment}` : '';
|
|
19
19
|
const type = this.type ? ` {${this.type.toString()}} ` : '';
|
|
20
|
-
return `@${this.tagName} ${this.
|
|
20
|
+
return `@${this.tagName} ${this.name}${type} ${comment}`;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
2
|
+
import { schemaObjToInstance } from '../class-transformers';
|
|
3
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
4
|
+
import { DocSchema } from './docs';
|
|
5
|
+
|
|
6
|
+
export class EnumMemberSchema extends SchemaNode {
|
|
7
|
+
@Transform(schemaObjToInstance)
|
|
8
|
+
readonly doc?: DocSchema;
|
|
9
|
+
|
|
10
|
+
constructor(
|
|
11
|
+
readonly location: Location,
|
|
12
|
+
readonly name: string,
|
|
13
|
+
readonly signature: string,
|
|
14
|
+
readonly value?: string,
|
|
15
|
+
doc?: DocSchema
|
|
16
|
+
) {
|
|
17
|
+
super();
|
|
18
|
+
this.doc = doc;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
toString() {
|
|
22
|
+
if (!this.value) return this.name;
|
|
23
|
+
return `${this.name}=${this.value}`;
|
|
24
|
+
}
|
|
25
|
+
}
|
package/schemas/enum.ts
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import { schemaObjToInstance } from '../class-transformers';
|
|
3
|
+
import { schemaObjArrayToInstances, schemaObjToInstance } from '../class-transformers';
|
|
4
4
|
import { Location, SchemaNode } from '../schema-node';
|
|
5
5
|
import { DocSchema } from './docs';
|
|
6
6
|
|
|
7
7
|
export class EnumSchema extends SchemaNode {
|
|
8
8
|
@Transform(schemaObjToInstance)
|
|
9
9
|
readonly doc?: DocSchema;
|
|
10
|
+
@Transform(schemaObjArrayToInstances)
|
|
11
|
+
readonly members: SchemaNode[];
|
|
10
12
|
|
|
11
|
-
constructor(
|
|
13
|
+
constructor(
|
|
14
|
+
readonly location: Location,
|
|
15
|
+
readonly name: string,
|
|
16
|
+
members: SchemaNode[],
|
|
17
|
+
readonly signature: string,
|
|
18
|
+
doc?: DocSchema
|
|
19
|
+
) {
|
|
12
20
|
super();
|
|
13
21
|
this.doc = doc;
|
|
22
|
+
this.members = members;
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
toString() {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
2
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
3
|
+
import { schemaObjArrayToInstances, schemaObjToInstance } from '../class-transformers';
|
|
4
|
+
|
|
5
|
+
export class ExpressionWithTypeArgumentsSchema extends SchemaNode {
|
|
6
|
+
@Transform(schemaObjArrayToInstances)
|
|
7
|
+
readonly typeArgs: SchemaNode[];
|
|
8
|
+
|
|
9
|
+
@Transform(schemaObjToInstance)
|
|
10
|
+
readonly expression: SchemaNode;
|
|
11
|
+
|
|
12
|
+
constructor(typeArgs: SchemaNode[], expression: SchemaNode, readonly name: string, readonly location: Location) {
|
|
13
|
+
super();
|
|
14
|
+
this.typeArgs = typeArgs;
|
|
15
|
+
this.expression = expression;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
toString() {
|
|
19
|
+
return this.name;
|
|
20
|
+
}
|
|
21
|
+
}
|
package/schemas/index.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Ensure that any new Schema class ends with the word 'Schema'
|
|
3
|
+
* This will make sure that the Class Name is not minimized during prod bundling process
|
|
4
|
+
* and the schemaObjToClass can match and instantiate the Schema Class correctly
|
|
5
|
+
*/
|
|
6
|
+
export { ModuleSchema } from './module';
|
|
2
7
|
export { FunctionLikeSchema, Modifier } from './function-like';
|
|
3
8
|
export { TypeRefSchema } from './type-ref';
|
|
4
9
|
export { VariableLikeSchema } from './variable-like';
|
|
@@ -21,6 +26,7 @@ export { TypeOperatorSchema } from './type-operator';
|
|
|
21
26
|
export { TupleTypeSchema } from './tuple-type';
|
|
22
27
|
export { ParameterSchema } from './parameter';
|
|
23
28
|
export { EnumSchema } from './enum';
|
|
29
|
+
export { EnumMemberSchema } from './enum-member';
|
|
24
30
|
export { ParenthesizedTypeSchema } from './parenthesized-type';
|
|
25
31
|
export { TypePredicateSchema } from './type-predicate';
|
|
26
32
|
export { IndexedAccessSchema } from './indexed-access-type';
|
|
@@ -30,5 +36,7 @@ export { ThisTypeSchema } from './this-type';
|
|
|
30
36
|
export { UnknownSchema } from './unknown-schema';
|
|
31
37
|
export { UnresolvedSchema } from './unresolved-schema';
|
|
32
38
|
export { ConditionalTypeSchema } from './conditional-type';
|
|
39
|
+
export { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';
|
|
40
|
+
export { NamedTupleSchema } from './named-tuple';
|
|
33
41
|
export { UnImplementedSchema } from './unimplemented-schema';
|
|
34
42
|
export * from './docs';
|
package/schemas/interface.ts
CHANGED
|
@@ -3,6 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
4
|
import { schemaObjArrayToInstances, schemaObjToInstance } from '../class-transformers';
|
|
5
5
|
import { DocSchema } from './docs';
|
|
6
|
+
import { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';
|
|
6
7
|
|
|
7
8
|
export class InterfaceSchema extends SchemaNode {
|
|
8
9
|
@Transform(schemaObjArrayToInstances)
|
|
@@ -11,7 +12,15 @@ export class InterfaceSchema extends SchemaNode {
|
|
|
11
12
|
@Transform(schemaObjToInstance)
|
|
12
13
|
readonly doc?: DocSchema;
|
|
13
14
|
|
|
14
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
readonly location: Location,
|
|
17
|
+
readonly name: string,
|
|
18
|
+
readonly signature: string,
|
|
19
|
+
readonly extendsNodes: ExpressionWithTypeArgumentsSchema[],
|
|
20
|
+
members: SchemaNode[],
|
|
21
|
+
doc?: DocSchema,
|
|
22
|
+
readonly typeParams?: string[]
|
|
23
|
+
) {
|
|
15
24
|
super();
|
|
16
25
|
this.members = members;
|
|
17
26
|
this.doc = doc;
|
package/schemas/module.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Transform } from 'class-transformer';
|
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
4
|
import { schemaObjArrayToInstances } from '../class-transformers';
|
|
5
5
|
|
|
6
|
-
export class
|
|
6
|
+
export class ModuleSchema extends SchemaNode {
|
|
7
7
|
@Transform(schemaObjArrayToInstances)
|
|
8
8
|
exports: SchemaNode[];
|
|
9
9
|
namespace?: string;
|
|
@@ -22,7 +22,7 @@ export class Module extends SchemaNode {
|
|
|
22
22
|
|
|
23
23
|
flatExportsRecursively() {
|
|
24
24
|
this.exports = this.exports.reduce((acc, exp) => {
|
|
25
|
-
if (exp instanceof
|
|
25
|
+
if (exp instanceof ModuleSchema) {
|
|
26
26
|
exp.flatExportsRecursively();
|
|
27
27
|
if (exp.namespace) return [...acc, exp];
|
|
28
28
|
return [...acc, ...exp.exports];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
|
|
3
|
+
export class NamedTupleSchema extends SchemaNode {
|
|
4
|
+
constructor(readonly location: Location, readonly type: SchemaNode, readonly name?: string) {
|
|
5
|
+
super();
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
toString() {
|
|
9
|
+
return `${this.name}: ${this.type.toString()}`;
|
|
10
|
+
}
|
|
11
|
+
}
|
package/schemas/parameter.ts
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import { Location, SchemaNode } from '../schema-node';
|
|
3
3
|
import { schemaObjToInstance } from '../class-transformers';
|
|
4
|
+
import { schemaObjArrayToInstances } from '../class-transformers/schema-obj-to-class';
|
|
4
5
|
|
|
5
6
|
export class ParameterSchema extends SchemaNode {
|
|
6
7
|
@Transform(schemaObjToInstance)
|
|
7
8
|
readonly type: SchemaNode;
|
|
9
|
+
@Transform(schemaObjArrayToInstances)
|
|
10
|
+
readonly objectBindingNodes?: SchemaNode[];
|
|
11
|
+
|
|
8
12
|
constructor(
|
|
9
13
|
readonly location: Location,
|
|
10
14
|
readonly name: string,
|
|
11
15
|
type: SchemaNode,
|
|
12
16
|
readonly isOptional: boolean,
|
|
13
17
|
readonly defaultValue?: any,
|
|
14
|
-
readonly description?: string
|
|
18
|
+
readonly description?: string,
|
|
19
|
+
objectBindingNodes?: SchemaNode[]
|
|
15
20
|
) {
|
|
16
21
|
super();
|
|
17
22
|
this.type = type;
|
|
23
|
+
this.objectBindingNodes = objectBindingNodes;
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
toString() {
|
package/schemas/type-operator.ts
CHANGED
|
@@ -5,12 +5,12 @@ import { schemaObjToInstance } from '../class-transformers';
|
|
|
5
5
|
export class TypeOperatorSchema extends SchemaNode {
|
|
6
6
|
@Transform(schemaObjToInstance)
|
|
7
7
|
type: SchemaNode;
|
|
8
|
-
constructor(readonly location: Location, readonly
|
|
8
|
+
constructor(readonly location: Location, readonly name: string, type: SchemaNode) {
|
|
9
9
|
super();
|
|
10
10
|
this.type = type;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
toString() {
|
|
14
|
-
return `${this.
|
|
14
|
+
return `${this.name} ${this.type.toString()}`;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -20,7 +20,7 @@ export class TypePredicateSchema extends SchemaNode {
|
|
|
20
20
|
readonly type?: SchemaNode;
|
|
21
21
|
constructor(
|
|
22
22
|
readonly location: Location,
|
|
23
|
-
readonly
|
|
23
|
+
readonly name: string,
|
|
24
24
|
type?: SchemaNode,
|
|
25
25
|
readonly hasAssertsModifier = false
|
|
26
26
|
) {
|
|
@@ -31,6 +31,6 @@ export class TypePredicateSchema extends SchemaNode {
|
|
|
31
31
|
toString() {
|
|
32
32
|
const assertsKeyword = this.hasAssertsModifier ? 'asserts ' : '';
|
|
33
33
|
const typeStr = this.type ? ` is ${this.type.toString()}` : '';
|
|
34
|
-
return assertsKeyword + this.
|
|
34
|
+
return assertsKeyword + this.name + typeStr;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -6,11 +6,11 @@ import { Location, SchemaNode } from '../schema-node';
|
|
|
6
6
|
* wrapped in this class.
|
|
7
7
|
*/
|
|
8
8
|
export class UnknownSchema extends SchemaNode {
|
|
9
|
-
constructor(readonly location: Location, readonly
|
|
9
|
+
constructor(readonly location: Location, readonly name: string, readonly schemaObj: Record<string, any>) {
|
|
10
10
|
super();
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
toString() {
|
|
14
|
-
return `<<unknown schema ${this.
|
|
14
|
+
return `<<unknown schema ${this.name}>>`;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
Binary file
|