@teambit/semantics.entities.semantic-schema 0.0.19 → 0.0.22
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 +3 -1
- package/class-transformers/schema-obj-to-class.ts +1 -1
- package/dist/api-schema.js +2 -1
- package/dist/api-schema.js.map +1 -1
- package/dist/class-transformers/schema-obj-to-class.js +1 -1
- package/dist/schema-node.d.ts +4 -1
- package/dist/schemas/conditional-type.d.ts +14 -0
- package/dist/schemas/conditional-type.js +43 -0
- package/dist/schemas/conditional-type.js.map +1 -0
- package/dist/schemas/docs/doc.d.ts +2 -1
- package/dist/schemas/docs/doc.js +2 -1
- package/dist/schemas/docs/doc.js.map +1 -1
- package/dist/schemas/docs/index.d.ts +1 -0
- package/dist/schemas/docs/index.js +3 -1
- package/dist/schemas/docs/index.js.map +1 -1
- package/dist/schemas/docs/property-like-tag.d.ts +13 -0
- package/dist/schemas/docs/property-like-tag.js +34 -0
- package/dist/schemas/docs/property-like-tag.js.map +1 -0
- package/dist/schemas/docs/return-tag.d.ts +2 -3
- package/dist/schemas/docs/return-tag.js +13 -3
- package/dist/schemas/docs/return-tag.js.map +1 -1
- package/dist/schemas/enum.d.ts +3 -1
- package/dist/schemas/enum.js +13 -1
- package/dist/schemas/enum.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +5 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/interface.d.ts +3 -1
- package/dist/schemas/interface.js +5 -1
- package/dist/schemas/interface.js.map +1 -1
- package/dist/schemas/type.d.ts +3 -1
- package/dist/schemas/type.js +5 -1
- package/dist/schemas/type.js.map +1 -1
- package/dist/schemas/unresolved-schema.d.ts +11 -0
- package/dist/schemas/unresolved-schema.js +20 -0
- package/dist/schemas/unresolved-schema.js.map +1 -0
- package/dist/schemas/variable-like.d.ts +3 -1
- package/dist/schemas/variable-like.js +5 -1
- package/dist/schemas/variable-like.js.map +1 -1
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.22.tgz +0 -0
- package/package.json +2 -2
- package/{preview-1654745302834.js → preview-1655522887639.js} +1 -1
- package/schema-node.ts +8 -1
- package/schemas/conditional-type.ts +38 -0
- package/schemas/docs/doc.ts +1 -1
- package/schemas/docs/index.ts +1 -0
- package/schemas/docs/property-like-tag.ts +22 -0
- package/schemas/docs/return-tag.ts +7 -7
- package/schemas/enum.ts +8 -1
- package/schemas/index.ts +2 -0
- package/schemas/interface.ts +8 -2
- package/schemas/type.ts +13 -1
- package/schemas/unresolved-schema.ts +15 -0
- package/schemas/variable-like.ts +7 -1
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.19.tgz +0 -0
package/api-schema.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
Module,
|
|
10
10
|
TypeRefSchema,
|
|
11
11
|
TypeSchema,
|
|
12
|
+
UnresolvedSchema,
|
|
12
13
|
VariableLikeSchema,
|
|
13
14
|
} from './schemas';
|
|
14
15
|
import { Location, SchemaNode } from './schema-node';
|
|
@@ -56,7 +57,8 @@ export class APISchema extends SchemaNode {
|
|
|
56
57
|
getSection(VariableLikeSchema, 'Variables') +
|
|
57
58
|
getSection(TypeSchema, 'Types') +
|
|
58
59
|
getSection(EnumSchema, 'Enums') +
|
|
59
|
-
getSection(TypeRefSchema, 'TypeReferences')
|
|
60
|
+
getSection(TypeRefSchema, 'TypeReferences') +
|
|
61
|
+
getSection(UnresolvedSchema, 'Unresolved')
|
|
60
62
|
);
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -34,7 +34,7 @@ function transformFromObjectToInstance(obj: Record<string, any>): SchemaNode {
|
|
|
34
34
|
const SchemaClass = getClassBySchemaName(obj.__schema);
|
|
35
35
|
if (!SchemaClass) {
|
|
36
36
|
// for backward and forward compatibility, to not break the users, it's better to return an unknown schema than throwing.
|
|
37
|
-
return new UnknownSchema(obj.location || {
|
|
37
|
+
return new UnknownSchema(obj.location || { path: '', line: 0, character: 0 }, obj.__schema, obj);
|
|
38
38
|
}
|
|
39
39
|
return plainToInstance(SchemaClass, obj);
|
|
40
40
|
}
|
package/dist/api-schema.js
CHANGED
|
@@ -43,7 +43,8 @@ class APISchema extends schema_node_1.SchemaNode {
|
|
|
43
43
|
getSection(schemas_1.VariableLikeSchema, 'Variables') +
|
|
44
44
|
getSection(schemas_1.TypeSchema, 'Types') +
|
|
45
45
|
getSection(schemas_1.EnumSchema, 'Enums') +
|
|
46
|
-
getSection(schemas_1.TypeRefSchema, 'TypeReferences')
|
|
46
|
+
getSection(schemas_1.TypeRefSchema, 'TypeReferences') +
|
|
47
|
+
getSection(schemas_1.UnresolvedSchema, 'Unresolved'));
|
|
47
48
|
}
|
|
48
49
|
listSignatures() {
|
|
49
50
|
return this.module.exports.map((exp) => exp.signature);
|
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,
|
|
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,MAAc,EAAE,WAAwB;QAC/E,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,E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,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAwB;QACxC,OAAO,IAAA,mCAAe,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;CACF;AAnDC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;yCACP;AAGxB;IADC,IAAA,6BAAS,EAAC,4CAAsB,CAAC;8CACA;AALpC,8BAqDC"}
|
|
@@ -48,7 +48,7 @@ function transformFromObjectToInstance(obj) {
|
|
|
48
48
|
const SchemaClass = getClassBySchemaName(obj.__schema);
|
|
49
49
|
if (!SchemaClass) {
|
|
50
50
|
// for backward and forward compatibility, to not break the users, it's better to return an unknown schema than throwing.
|
|
51
|
-
return new unknown_schema_1.UnknownSchema(obj.location || {
|
|
51
|
+
return new unknown_schema_1.UnknownSchema(obj.location || { path: '', line: 0, character: 0 }, obj.__schema, obj);
|
|
52
52
|
}
|
|
53
53
|
return (0, class_transformer_1.plainToInstance)(SchemaClass, obj);
|
|
54
54
|
}
|
package/dist/schema-node.d.ts
CHANGED
|
@@ -13,7 +13,10 @@ export declare abstract class SchemaNode {
|
|
|
13
13
|
toObject(): Record<string, any>;
|
|
14
14
|
}
|
|
15
15
|
export declare type Location = {
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* file-path relative to the component root-dir. normalized to Linux.
|
|
18
|
+
*/
|
|
19
|
+
filePath: string;
|
|
17
20
|
line: number;
|
|
18
21
|
character: number;
|
|
19
22
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
/**
|
|
3
|
+
* e.g. `T extends U ? Y : N`
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare class ConditionalTypeSchema extends SchemaNode {
|
|
7
|
+
readonly location: Location;
|
|
8
|
+
readonly checkType: SchemaNode;
|
|
9
|
+
readonly extendsType: SchemaNode;
|
|
10
|
+
readonly trueType: SchemaNode;
|
|
11
|
+
readonly falseType: SchemaNode;
|
|
12
|
+
constructor(location: Location, checkType: SchemaNode, extendsType: SchemaNode, trueType: SchemaNode, falseType: SchemaNode);
|
|
13
|
+
toString(): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.ConditionalTypeSchema = 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
|
+
/**
|
|
14
|
+
* e.g. `T extends U ? Y : N`
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
class ConditionalTypeSchema extends schema_node_1.SchemaNode {
|
|
18
|
+
constructor(location, checkType, extendsType, trueType, falseType) {
|
|
19
|
+
super();
|
|
20
|
+
this.location = location;
|
|
21
|
+
this.checkType = checkType;
|
|
22
|
+
this.extendsType = extendsType;
|
|
23
|
+
this.trueType = trueType;
|
|
24
|
+
this.falseType = falseType;
|
|
25
|
+
}
|
|
26
|
+
toString() {
|
|
27
|
+
return `${this.checkType.toString()} extends ${this.extendsType.toString()} ? ${this.trueType.toString()} : ${this.falseType.toString()}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
32
|
+
], ConditionalTypeSchema.prototype, "checkType", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
35
|
+
], ConditionalTypeSchema.prototype, "extendsType", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
38
|
+
], ConditionalTypeSchema.prototype, "trueType", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
41
|
+
], ConditionalTypeSchema.prototype, "falseType", void 0);
|
|
42
|
+
exports.ConditionalTypeSchema = ConditionalTypeSchema;
|
|
43
|
+
//# sourceMappingURL=conditional-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditional-type.js","sourceRoot":"","sources":["../../schemas/conditional-type.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,gDAAsD;AACtD,8DAA4D;AAE5D;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,wBAAU;IAYnD,YACW,QAAkB,EAC3B,SAAqB,EACrB,WAAuB,EACvB,QAAoB,EACpB,SAAqB;QAErB,KAAK,EAAE,CAAC;QANC,aAAQ,GAAR,QAAQ,CAAU;QAO3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC5I,CAAC;CACF;AA3BC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;wDACA;AAG/B;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;0DACE;AAGjC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;uDACD;AAG9B;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;wDACA;AAXjC,sDA6BC"}
|
|
@@ -2,9 +2,10 @@ import { Location, SchemaNode } from '../../schema-node';
|
|
|
2
2
|
import { TagName, TagSchema } from './tag';
|
|
3
3
|
export declare class DocSchema extends SchemaNode {
|
|
4
4
|
readonly location: Location;
|
|
5
|
+
readonly raw: string;
|
|
5
6
|
readonly comment?: string;
|
|
6
7
|
readonly tags?: TagSchema[];
|
|
7
|
-
constructor(location: Location, comment?: string, tags?: TagSchema[]);
|
|
8
|
+
constructor(location: Location, raw: string, comment?: string, tags?: TagSchema[]);
|
|
8
9
|
toString(): string;
|
|
9
10
|
hasTag(tagName: TagName): boolean;
|
|
10
11
|
findTag(tagName: TagName): TagSchema;
|
package/dist/schemas/docs/doc.js
CHANGED
|
@@ -11,9 +11,10 @@ const class_transformer_1 = require("class-transformer");
|
|
|
11
11
|
const class_transformers_1 = require("../../class-transformers");
|
|
12
12
|
const schema_node_1 = require("../../schema-node");
|
|
13
13
|
class DocSchema extends schema_node_1.SchemaNode {
|
|
14
|
-
constructor(location, comment, tags) {
|
|
14
|
+
constructor(location, raw, comment, tags) {
|
|
15
15
|
super();
|
|
16
16
|
this.location = location;
|
|
17
|
+
this.raw = raw;
|
|
17
18
|
this.comment = comment;
|
|
18
19
|
this.tags = tags;
|
|
19
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc.js","sourceRoot":"","sources":["../../../schemas/docs/doc.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAC9C,iEAAqE;AACrE,mDAAyD;AAGzD,MAAa,SAAU,SAAQ,wBAAU;IAGvC,YAAqB,QAAk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ict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReturnTagSchema = exports.TagSchema = exports.DocSchema = void 0;
|
|
3
|
+
exports.PropertyLikeTagSchema = exports.ReturnTagSchema = exports.TagSchema = exports.DocSchema = void 0;
|
|
4
4
|
var doc_1 = require("./doc");
|
|
5
5
|
Object.defineProperty(exports, "DocSchema", { enumerable: true, get: function () { return doc_1.DocSchema; } });
|
|
6
6
|
var tag_1 = require("./tag");
|
|
7
7
|
Object.defineProperty(exports, "TagSchema", { enumerable: true, get: function () { return tag_1.TagSchema; } });
|
|
8
8
|
var return_tag_1 = require("./return-tag");
|
|
9
9
|
Object.defineProperty(exports, "ReturnTagSchema", { enumerable: true, get: function () { return return_tag_1.ReturnTagSchema; } });
|
|
10
|
+
var property_like_tag_1 = require("./property-like-tag");
|
|
11
|
+
Object.defineProperty(exports, "PropertyLikeTagSchema", { enumerable: true, get: function () { return property_like_tag_1.PropertyLikeTagSchema; } });
|
|
10
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schemas/docs/index.ts"],"names":[],"mappings":";;;AAAA,6BAAkC;AAAzB,gGAAA,SAAS,OAAA;AAClB,6BAAkC;AAAzB,gGAAA,SAAS,OAAA;AAClB,2CAA+C;AAAtC,6GAAA,eAAe,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schemas/docs/index.ts"],"names":[],"mappings":";;;AAAA,6BAAkC;AAAzB,gGAAA,SAAS,OAAA;AAClB,6BAAkC;AAAzB,gGAAA,SAAS,OAAA;AAClB,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,yDAA4D;AAAnD,0HAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../../schema-node';
|
|
2
|
+
import { TagSchema } from './tag';
|
|
3
|
+
/**
|
|
4
|
+
* e.g. `@param myParam {string} some comment`
|
|
5
|
+
*/
|
|
6
|
+
export declare class PropertyLikeTagSchema extends TagSchema {
|
|
7
|
+
readonly location: Location;
|
|
8
|
+
readonly paramName: string;
|
|
9
|
+
readonly comment?: string;
|
|
10
|
+
readonly type?: SchemaNode;
|
|
11
|
+
constructor(location: Location, paramName: string, comment?: string, type?: SchemaNode);
|
|
12
|
+
toString(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.PropertyLikeTagSchema = void 0;
|
|
10
|
+
const class_transformer_1 = require("class-transformer");
|
|
11
|
+
const tag_1 = require("./tag");
|
|
12
|
+
const class_transformers_1 = require("../../class-transformers");
|
|
13
|
+
/**
|
|
14
|
+
* e.g. `@param myParam {string} some comment`
|
|
15
|
+
*/
|
|
16
|
+
class PropertyLikeTagSchema extends tag_1.TagSchema {
|
|
17
|
+
constructor(location, paramName, comment, type) {
|
|
18
|
+
super(location, tag_1.TagName.parameter, comment);
|
|
19
|
+
this.location = location;
|
|
20
|
+
this.paramName = paramName;
|
|
21
|
+
this.comment = comment;
|
|
22
|
+
this.type = type;
|
|
23
|
+
}
|
|
24
|
+
toString() {
|
|
25
|
+
const comment = this.comment ? ` ${this.comment}` : '';
|
|
26
|
+
const type = this.type ? ` {${this.type.toString()}} ` : '';
|
|
27
|
+
return `@${this.tagName} ${this.paramName}${type} ${comment}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
32
|
+
], PropertyLikeTagSchema.prototype, "type", void 0);
|
|
33
|
+
exports.PropertyLikeTagSchema = PropertyLikeTagSchema;
|
|
34
|
+
//# sourceMappingURL=property-like-tag.js.map
|
|
@@ -0,0 +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,SAAiB,EAAW,OAAgB,EAAE,IAAiB;QAC/G,KAAK,CAAC,QAAQ,EAAE,aAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QADzB,aAAQ,GAAR,QAAQ,CAAU;QAAW,cAAS,GAAT,SAAS,CAAQ;QAAW,YAAO,GAAP,OAAO,CAAS;QAE5F,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,SAAS,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC;IAChE,CAAC;CACF;AAXC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;mDACJ;AAF7B,sDAaC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Location, SchemaNode } from '../../schema-node';
|
|
2
|
-
import {
|
|
2
|
+
import { TagSchema } from './tag';
|
|
3
3
|
/**
|
|
4
4
|
* e.g. `@return {string} some comment`
|
|
5
5
|
*/
|
|
6
6
|
export declare class ReturnTagSchema extends TagSchema {
|
|
7
7
|
readonly location: Location;
|
|
8
|
-
readonly tagName: TagName;
|
|
9
8
|
readonly comment?: string;
|
|
10
9
|
readonly type?: SchemaNode;
|
|
11
|
-
constructor(location: Location,
|
|
10
|
+
constructor(location: Location, comment?: string, type?: SchemaNode);
|
|
12
11
|
toString(): string;
|
|
13
12
|
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
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
|
+
};
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.ReturnTagSchema = void 0;
|
|
10
|
+
const class_transformer_1 = require("class-transformer");
|
|
4
11
|
const tag_1 = require("./tag");
|
|
12
|
+
const class_transformers_1 = require("../../class-transformers");
|
|
5
13
|
/**
|
|
6
14
|
* e.g. `@return {string} some comment`
|
|
7
15
|
*/
|
|
8
16
|
class ReturnTagSchema extends tag_1.TagSchema {
|
|
9
|
-
constructor(location,
|
|
10
|
-
super(location,
|
|
17
|
+
constructor(location, comment, type) {
|
|
18
|
+
super(location, tag_1.TagName.return, comment);
|
|
11
19
|
this.location = location;
|
|
12
|
-
this.tagName = tagName;
|
|
13
20
|
this.comment = comment;
|
|
14
21
|
this.type = type;
|
|
15
22
|
}
|
|
@@ -18,5 +25,8 @@ class ReturnTagSchema extends tag_1.TagSchema {
|
|
|
18
25
|
return `@${this.tagName}${comment}`;
|
|
19
26
|
}
|
|
20
27
|
}
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
30
|
+
], ReturnTagSchema.prototype, "type", void 0);
|
|
21
31
|
exports.ReturnTagSchema = ReturnTagSchema;
|
|
22
32
|
//# sourceMappingURL=return-tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"return-tag.js","sourceRoot":"","sources":["../../../schemas/docs/return-tag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"return-tag.js","sourceRoot":"","sources":["../../../schemas/docs/return-tag.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yDAA8C;AAE9C,+BAA2C;AAC3C,iEAA+D;AAE/D;;GAEG;AACH,MAAa,eAAgB,SAAQ,eAAS;IAG5C,YAAqB,QAAkB,EAAW,OAAgB,EAAE,IAAiB;QACnF,KAAK,CAAC,QAAQ,EAAE,aAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QADtB,aAAQ,GAAR,QAAQ,CAAU;QAAW,YAAO,GAAP,OAAO,CAAS;QAEhE,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,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,OAAO,EAAE,CAAC;IACtC,CAAC;CACF;AAVC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;6CACJ;AAF7B,0CAYC"}
|
package/dist/schemas/enum.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
import { DocSchema } from './docs';
|
|
2
3
|
export declare class EnumSchema extends SchemaNode {
|
|
3
4
|
readonly location: Location;
|
|
4
5
|
readonly name: string;
|
|
5
6
|
readonly members: string[];
|
|
6
|
-
|
|
7
|
+
readonly doc?: DocSchema;
|
|
8
|
+
constructor(location: Location, name: string, members: string[], doc?: DocSchema);
|
|
7
9
|
toString(): string;
|
|
8
10
|
}
|
package/dist/schemas/enum.js
CHANGED
|
@@ -1,22 +1,34 @@
|
|
|
1
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
|
+
};
|
|
2
8
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
10
|
};
|
|
5
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
12
|
exports.EnumSchema = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
7
14
|
const chalk_1 = __importDefault(require("chalk"));
|
|
15
|
+
const class_transformers_1 = require("../class-transformers");
|
|
8
16
|
const schema_node_1 = require("../schema-node");
|
|
9
17
|
class EnumSchema extends schema_node_1.SchemaNode {
|
|
10
|
-
constructor(location, name, members) {
|
|
18
|
+
constructor(location, name, members, doc) {
|
|
11
19
|
super();
|
|
12
20
|
this.location = location;
|
|
13
21
|
this.name = name;
|
|
14
22
|
this.members = members;
|
|
23
|
+
this.doc = doc;
|
|
15
24
|
}
|
|
16
25
|
toString() {
|
|
17
26
|
const membersStr = this.members.map((m) => `* ${m.toString()}`).join('\n');
|
|
18
27
|
return `${chalk_1.default.bold.underline(this.name)}\n${membersStr}`;
|
|
19
28
|
}
|
|
20
29
|
}
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
32
|
+
], EnumSchema.prototype, "doc", void 0);
|
|
21
33
|
exports.EnumSchema = EnumSchema;
|
|
22
34
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../schemas/enum.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,8DAA4D;AAC5D,gDAAsD;AAGtD,MAAa,UAAW,SAAQ,wBAAU;IAIxC,YAAqB,QAAkB,EAAW,IAAY,EAAW,OAAiB,EAAE,GAAe;QACzG,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAAW,YAAO,GAAP,OAAO,CAAU;QAExF,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;AAXC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;uCACN;AAF3B,gCAaC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -28,4 +28,6 @@ export { TemplateLiteralTypeSchema } from './template-literal-type';
|
|
|
28
28
|
export { TemplateLiteralTypeSpanSchema } from './template-literal-type-span';
|
|
29
29
|
export { ThisTypeSchema } from './this-type';
|
|
30
30
|
export { UnknownSchema } from './unknown-schema';
|
|
31
|
+
export { UnresolvedSchema } from './unresolved-schema';
|
|
32
|
+
export { ConditionalTypeSchema } from './conditional-type';
|
|
31
33
|
export * from './docs';
|
package/dist/schemas/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
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.Module = void 0;
|
|
13
|
+
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.Module = void 0;
|
|
14
14
|
var module_1 = require("./module");
|
|
15
15
|
Object.defineProperty(exports, "Module", { enumerable: true, get: function () { return module_1.Module; } });
|
|
16
16
|
var function_like_1 = require("./function-like");
|
|
@@ -71,5 +71,9 @@ var this_type_1 = require("./this-type");
|
|
|
71
71
|
Object.defineProperty(exports, "ThisTypeSchema", { enumerable: true, get: function () { return this_type_1.ThisTypeSchema; } });
|
|
72
72
|
var unknown_schema_1 = require("./unknown-schema");
|
|
73
73
|
Object.defineProperty(exports, "UnknownSchema", { enumerable: true, get: function () { return unknown_schema_1.UnknownSchema; } });
|
|
74
|
+
var unresolved_schema_1 = require("./unresolved-schema");
|
|
75
|
+
Object.defineProperty(exports, "UnresolvedSchema", { enumerable: true, get: function () { return unresolved_schema_1.UnresolvedSchema; } });
|
|
76
|
+
var conditional_type_1 = require("./conditional-type");
|
|
77
|
+
Object.defineProperty(exports, "ConditionalTypeSchema", { enumerable: true, get: function () { return conditional_type_1.ConditionalTypeSchema; } });
|
|
74
78
|
__exportStar(require("./docs"), exports);
|
|
75
79
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,iDAA+D;AAAtD,mHAAA,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AA;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,yCAAuB"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
import { DocSchema } from './docs';
|
|
2
3
|
export declare class InterfaceSchema extends SchemaNode {
|
|
3
4
|
readonly location: Location;
|
|
4
5
|
readonly name: string;
|
|
5
6
|
readonly members: SchemaNode[];
|
|
6
|
-
|
|
7
|
+
readonly doc?: DocSchema;
|
|
8
|
+
constructor(location: Location, name: string, members: SchemaNode[], doc?: DocSchema);
|
|
7
9
|
toString(): string;
|
|
8
10
|
}
|
|
@@ -15,11 +15,12 @@ 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) {
|
|
18
|
+
constructor(location, name, members, doc) {
|
|
19
19
|
super();
|
|
20
20
|
this.location = location;
|
|
21
21
|
this.name = name;
|
|
22
22
|
this.members = members;
|
|
23
|
+
this.doc = doc;
|
|
23
24
|
}
|
|
24
25
|
toString() {
|
|
25
26
|
const membersStr = this.members.map((m) => `* ${m.toString()}`).join('\n');
|
|
@@ -29,5 +30,8 @@ class InterfaceSchema extends schema_node_1.SchemaNode {
|
|
|
29
30
|
__decorate([
|
|
30
31
|
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjArrayToInstances)
|
|
31
32
|
], InterfaceSchema.prototype, "members", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
35
|
+
], InterfaceSchema.prototype, "doc", void 0);
|
|
32
36
|
exports.InterfaceSchema = InterfaceSchema;
|
|
33
37
|
//# sourceMappingURL=interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../schemas/interface.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../schemas/interface.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAAuF;AAGvF,MAAa,eAAgB,SAAQ,wBAAU;IAO7C,YAAqB,QAAkB,EAAW,IAAY,EAAE,OAAqB,EAAE,GAAe;QACpG,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;QAE5D,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;AAfC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;gDACN;AAG/B;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;4CACN;AAL3B,0CAiBC"}
|
package/dist/schemas/type.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
import { DocSchema } from './docs';
|
|
2
3
|
export declare class TypeSchema extends SchemaNode {
|
|
3
4
|
readonly location: Location;
|
|
4
5
|
readonly name: string;
|
|
5
6
|
readonly signature: string;
|
|
6
7
|
readonly type: SchemaNode;
|
|
7
|
-
|
|
8
|
+
readonly doc?: DocSchema;
|
|
9
|
+
constructor(location: Location, name: string, type: SchemaNode, signature: string, doc?: DocSchema);
|
|
8
10
|
toString(): string;
|
|
9
11
|
}
|
package/dist/schemas/type.js
CHANGED
|
@@ -15,12 +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 TypeSchema extends schema_node_1.SchemaNode {
|
|
18
|
-
constructor(location, name, type, signature) {
|
|
18
|
+
constructor(location, name, type, signature, doc) {
|
|
19
19
|
super();
|
|
20
20
|
this.location = location;
|
|
21
21
|
this.name = name;
|
|
22
22
|
this.signature = signature;
|
|
23
23
|
this.type = type;
|
|
24
|
+
this.doc = doc;
|
|
24
25
|
}
|
|
25
26
|
toString() {
|
|
26
27
|
return `${chalk_1.default.bold(this.name)}: ${this.type.toString()}`;
|
|
@@ -29,5 +30,8 @@ class TypeSchema extends schema_node_1.SchemaNode {
|
|
|
29
30
|
__decorate([
|
|
30
31
|
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
31
32
|
], TypeSchema.prototype, "type", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
35
|
+
], TypeSchema.prototype, "doc", void 0);
|
|
32
36
|
exports.TypeSchema = TypeSchema;
|
|
33
37
|
//# sourceMappingURL=type.js.map
|
package/dist/schemas/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../schemas/type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAA4D;
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../schemas/type.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAA4D;AAG5D,MAAa,UAAW,SAAQ,wBAAU;IAOxC,YACW,QAAkB,EAClB,IAAY,EACrB,IAAgB,EACP,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,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC7D,CAAC;CACF;AApBC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;wCACL;AAG1B;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;uCACN;AAL3B,gCAsBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
/**
|
|
3
|
+
* needed for cases when the exported entity could not be resolved.
|
|
4
|
+
* e.g. exporting mdx variables in the main index.ts file.
|
|
5
|
+
*/
|
|
6
|
+
export declare class UnresolvedSchema extends SchemaNode {
|
|
7
|
+
readonly location: Location;
|
|
8
|
+
readonly name: string;
|
|
9
|
+
constructor(location: Location, name: string);
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UnresolvedSchema = void 0;
|
|
4
|
+
const schema_node_1 = require("../schema-node");
|
|
5
|
+
/**
|
|
6
|
+
* needed for cases when the exported entity could not be resolved.
|
|
7
|
+
* e.g. exporting mdx variables in the main index.ts file.
|
|
8
|
+
*/
|
|
9
|
+
class UnresolvedSchema extends schema_node_1.SchemaNode {
|
|
10
|
+
constructor(location, name) {
|
|
11
|
+
super();
|
|
12
|
+
this.location = location;
|
|
13
|
+
this.name = name;
|
|
14
|
+
}
|
|
15
|
+
toString() {
|
|
16
|
+
return this.name;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.UnresolvedSchema = UnresolvedSchema;
|
|
20
|
+
//# sourceMappingURL=unresolved-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unresolved-schema.js","sourceRoot":"","sources":["../../schemas/unresolved-schema.ts"],"names":[],"mappings":";;;AAAA,gDAAsD;AAEtD;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,wBAAU;IAC9C,YAAqB,QAAkB,EAAW,IAAY;QAC5D,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAU;QAAW,SAAI,GAAJ,IAAI,CAAQ;IAE9D,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF;AARD,4CAQC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
import { DocSchema } from './docs';
|
|
2
3
|
/**
|
|
3
4
|
* can be also a property or property-signature
|
|
4
5
|
*/
|
|
@@ -8,6 +9,7 @@ export declare class VariableLikeSchema extends SchemaNode {
|
|
|
8
9
|
readonly signature: string;
|
|
9
10
|
readonly isOptional: boolean;
|
|
10
11
|
type: SchemaNode;
|
|
11
|
-
|
|
12
|
+
readonly doc?: DocSchema;
|
|
13
|
+
constructor(location: Location, name: string, signature: string, type: SchemaNode, isOptional: boolean, doc?: DocSchema);
|
|
12
14
|
toString(): string;
|
|
13
15
|
}
|
|
@@ -18,13 +18,14 @@ const class_transformers_1 = require("../class-transformers");
|
|
|
18
18
|
* can be also a property or property-signature
|
|
19
19
|
*/
|
|
20
20
|
class VariableLikeSchema extends schema_node_1.SchemaNode {
|
|
21
|
-
constructor(location, name, signature, type, isOptional) {
|
|
21
|
+
constructor(location, name, signature, type, isOptional, doc) {
|
|
22
22
|
super();
|
|
23
23
|
this.location = location;
|
|
24
24
|
this.name = name;
|
|
25
25
|
this.signature = signature;
|
|
26
26
|
this.isOptional = isOptional;
|
|
27
27
|
this.type = type;
|
|
28
|
+
this.doc = doc;
|
|
28
29
|
}
|
|
29
30
|
toString() {
|
|
30
31
|
return `${chalk_1.default.bold(this.name)}${this.isOptional ? '?' : ''}: ${this.type.toString()}`;
|
|
@@ -33,5 +34,8 @@ class VariableLikeSchema extends schema_node_1.SchemaNode {
|
|
|
33
34
|
__decorate([
|
|
34
35
|
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
35
36
|
], VariableLikeSchema.prototype, "type", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, class_transformer_1.Transform)(class_transformers_1.schemaObjToInstance)
|
|
39
|
+
], VariableLikeSchema.prototype, "doc", void 0);
|
|
36
40
|
exports.VariableLikeSchema = VariableLikeSchema;
|
|
37
41
|
//# sourceMappingURL=variable-like.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable-like.js","sourceRoot":"","sources":["../../schemas/variable-like.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAA4D;
|
|
1
|
+
{"version":3,"file":"variable-like.js","sourceRoot":"","sources":["../../schemas/variable-like.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAA4D;AAG5D;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAAU;IAMhD,YACW,QAAkB,EAClB,IAAY,EACZ,SAAiB,EAC1B,IAAgB,EACP,UAAmB,EAC5B,GAAe;QAEf,KAAK,EAAE,CAAC;QAPC,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAQ;QAEjB,eAAU,GAAV,UAAU,CAAS;QAI5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC1F,CAAC;CACF;AApBC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;gDACd;AAGjB;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;+CACN;AAL3B,gDAsBC"}
|
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.22",
|
|
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.22"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.
|
|
1
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.22/dist/semantic-schema.docs.md')]
|
package/schema-node.ts
CHANGED
|
@@ -19,4 +19,11 @@ export abstract class SchemaNode {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export type Location = {
|
|
22
|
+
export type Location = {
|
|
23
|
+
/**
|
|
24
|
+
* file-path relative to the component root-dir. normalized to Linux.
|
|
25
|
+
*/
|
|
26
|
+
filePath: string;
|
|
27
|
+
line: number;
|
|
28
|
+
character: number;
|
|
29
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
2
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
3
|
+
import { schemaObjToInstance } from '../class-transformers';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* e.g. `T extends U ? Y : N`
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export class ConditionalTypeSchema extends SchemaNode {
|
|
10
|
+
@Transform(schemaObjToInstance)
|
|
11
|
+
readonly checkType: SchemaNode;
|
|
12
|
+
|
|
13
|
+
@Transform(schemaObjToInstance)
|
|
14
|
+
readonly extendsType: SchemaNode;
|
|
15
|
+
|
|
16
|
+
@Transform(schemaObjToInstance)
|
|
17
|
+
readonly trueType: SchemaNode;
|
|
18
|
+
|
|
19
|
+
@Transform(schemaObjToInstance)
|
|
20
|
+
readonly falseType: SchemaNode;
|
|
21
|
+
constructor(
|
|
22
|
+
readonly location: Location,
|
|
23
|
+
checkType: SchemaNode,
|
|
24
|
+
extendsType: SchemaNode,
|
|
25
|
+
trueType: SchemaNode,
|
|
26
|
+
falseType: SchemaNode
|
|
27
|
+
) {
|
|
28
|
+
super();
|
|
29
|
+
this.checkType = checkType;
|
|
30
|
+
this.extendsType = extendsType;
|
|
31
|
+
this.trueType = trueType;
|
|
32
|
+
this.falseType = falseType;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
toString() {
|
|
36
|
+
return `${this.checkType.toString()} extends ${this.extendsType.toString()} ? ${this.trueType.toString()} : ${this.falseType.toString()}`;
|
|
37
|
+
}
|
|
38
|
+
}
|
package/schemas/docs/doc.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { TagName, TagSchema } from './tag';
|
|
|
6
6
|
export class DocSchema extends SchemaNode {
|
|
7
7
|
@Transform(schemaObjArrayToInstances)
|
|
8
8
|
readonly tags?: TagSchema[];
|
|
9
|
-
constructor(readonly location: Location, readonly comment?: string, tags?: TagSchema[]) {
|
|
9
|
+
constructor(readonly location: Location, readonly raw: string, readonly comment?: string, tags?: TagSchema[]) {
|
|
10
10
|
super();
|
|
11
11
|
this.tags = tags;
|
|
12
12
|
}
|
package/schemas/docs/index.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
2
|
+
import { Location, SchemaNode } from '../../schema-node';
|
|
3
|
+
import { TagName, TagSchema } from './tag';
|
|
4
|
+
import { schemaObjToInstance } from '../../class-transformers';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* e.g. `@param myParam {string} some comment`
|
|
8
|
+
*/
|
|
9
|
+
export class PropertyLikeTagSchema extends TagSchema {
|
|
10
|
+
@Transform(schemaObjToInstance)
|
|
11
|
+
readonly type?: SchemaNode;
|
|
12
|
+
constructor(readonly location: Location, readonly paramName: string, readonly comment?: string, type?: SchemaNode) {
|
|
13
|
+
super(location, TagName.parameter, comment);
|
|
14
|
+
this.type = type;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
toString() {
|
|
18
|
+
const comment = this.comment ? ` ${this.comment}` : '';
|
|
19
|
+
const type = this.type ? ` {${this.type.toString()}} ` : '';
|
|
20
|
+
return `@${this.tagName} ${this.paramName}${type} ${comment}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
1
2
|
import { Location, SchemaNode } from '../../schema-node';
|
|
2
3
|
import { TagName, TagSchema } from './tag';
|
|
4
|
+
import { schemaObjToInstance } from '../../class-transformers';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* e.g. `@return {string} some comment`
|
|
6
8
|
*/
|
|
7
9
|
export class ReturnTagSchema extends TagSchema {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
) {
|
|
14
|
-
super(location, tagName, comment);
|
|
10
|
+
@Transform(schemaObjToInstance)
|
|
11
|
+
readonly type?: SchemaNode;
|
|
12
|
+
constructor(readonly location: Location, readonly comment?: string, type?: SchemaNode) {
|
|
13
|
+
super(location, TagName.return, comment);
|
|
14
|
+
this.type = type;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
toString() {
|
package/schemas/enum.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import { Transform } from 'class-transformer';
|
|
1
2
|
import chalk from 'chalk';
|
|
3
|
+
import { schemaObjToInstance } from '../class-transformers';
|
|
2
4
|
import { Location, SchemaNode } from '../schema-node';
|
|
5
|
+
import { DocSchema } from './docs';
|
|
3
6
|
|
|
4
7
|
export class EnumSchema extends SchemaNode {
|
|
5
|
-
|
|
8
|
+
@Transform(schemaObjToInstance)
|
|
9
|
+
readonly doc?: DocSchema;
|
|
10
|
+
|
|
11
|
+
constructor(readonly location: Location, readonly name: string, readonly members: string[], doc?: DocSchema) {
|
|
6
12
|
super();
|
|
13
|
+
this.doc = doc;
|
|
7
14
|
}
|
|
8
15
|
|
|
9
16
|
toString() {
|
package/schemas/index.ts
CHANGED
|
@@ -28,4 +28,6 @@ export { TemplateLiteralTypeSchema } from './template-literal-type';
|
|
|
28
28
|
export { TemplateLiteralTypeSpanSchema } from './template-literal-type-span';
|
|
29
29
|
export { ThisTypeSchema } from './this-type';
|
|
30
30
|
export { UnknownSchema } from './unknown-schema';
|
|
31
|
+
export { UnresolvedSchema } from './unresolved-schema';
|
|
32
|
+
export { ConditionalTypeSchema } from './conditional-type';
|
|
31
33
|
export * from './docs';
|
package/schemas/interface.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { Transform } from 'class-transformer';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
|
-
import { schemaObjArrayToInstances } from '../class-transformers';
|
|
4
|
+
import { schemaObjArrayToInstances, schemaObjToInstance } from '../class-transformers';
|
|
5
|
+
import { DocSchema } from './docs';
|
|
5
6
|
|
|
6
7
|
export class InterfaceSchema extends SchemaNode {
|
|
7
8
|
@Transform(schemaObjArrayToInstances)
|
|
8
9
|
readonly members: SchemaNode[];
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
@Transform(schemaObjToInstance)
|
|
12
|
+
readonly doc?: DocSchema;
|
|
13
|
+
|
|
14
|
+
constructor(readonly location: Location, readonly name: string, members: SchemaNode[], doc?: DocSchema) {
|
|
10
15
|
super();
|
|
11
16
|
this.members = members;
|
|
17
|
+
this.doc = doc;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
toString() {
|
package/schemas/type.ts
CHANGED
|
@@ -2,13 +2,25 @@ import { Transform } from 'class-transformer';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
4
|
import { schemaObjToInstance } from '../class-transformers';
|
|
5
|
+
import { DocSchema } from './docs';
|
|
5
6
|
|
|
6
7
|
export class TypeSchema extends SchemaNode {
|
|
7
8
|
@Transform(schemaObjToInstance)
|
|
8
9
|
readonly type: SchemaNode;
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
@Transform(schemaObjToInstance)
|
|
12
|
+
readonly doc?: DocSchema;
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
readonly location: Location,
|
|
16
|
+
readonly name: string,
|
|
17
|
+
type: SchemaNode,
|
|
18
|
+
readonly signature: string,
|
|
19
|
+
doc?: DocSchema
|
|
20
|
+
) {
|
|
10
21
|
super();
|
|
11
22
|
this.type = type;
|
|
23
|
+
this.doc = doc;
|
|
12
24
|
}
|
|
13
25
|
|
|
14
26
|
toString() {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Location, SchemaNode } from '../schema-node';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* needed for cases when the exported entity could not be resolved.
|
|
5
|
+
* e.g. exporting mdx variables in the main index.ts file.
|
|
6
|
+
*/
|
|
7
|
+
export class UnresolvedSchema extends SchemaNode {
|
|
8
|
+
constructor(readonly location: Location, readonly name: string) {
|
|
9
|
+
super();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
toString() {
|
|
13
|
+
return this.name;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/schemas/variable-like.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Transform } from 'class-transformer';
|
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { Location, SchemaNode } from '../schema-node';
|
|
4
4
|
import { schemaObjToInstance } from '../class-transformers';
|
|
5
|
+
import { DocSchema } from './docs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* can be also a property or property-signature
|
|
@@ -9,15 +10,20 @@ import { schemaObjToInstance } from '../class-transformers';
|
|
|
9
10
|
export class VariableLikeSchema extends SchemaNode {
|
|
10
11
|
@Transform(schemaObjToInstance)
|
|
11
12
|
type: SchemaNode;
|
|
13
|
+
|
|
14
|
+
@Transform(schemaObjToInstance)
|
|
15
|
+
readonly doc?: DocSchema;
|
|
12
16
|
constructor(
|
|
13
17
|
readonly location: Location,
|
|
14
18
|
readonly name: string,
|
|
15
19
|
readonly signature: string,
|
|
16
20
|
type: SchemaNode,
|
|
17
|
-
readonly isOptional: boolean
|
|
21
|
+
readonly isOptional: boolean,
|
|
22
|
+
doc?: DocSchema
|
|
18
23
|
) {
|
|
19
24
|
super();
|
|
20
25
|
this.type = type;
|
|
26
|
+
this.doc = doc;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
toString() {
|
|
Binary file
|