@teambit/semantics.entities.semantic-schema 0.0.77 → 0.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-schema.d.ts +3 -3
- package/dist/api-schema.js +160 -115
- package/dist/api-schema.js.map +1 -1
- package/dist/export.d.ts +2 -2
- package/dist/export.js +27 -23
- package/dist/export.js.map +1 -1
- package/dist/index.js +134 -39
- package/dist/index.js.map +1 -1
- package/dist/schema-node-constructor.js +1 -1
- package/dist/schema-node-constructor.js.map +1 -1
- package/dist/schema-node.js +45 -40
- package/dist/schema-node.js.map +1 -1
- package/dist/schema-registry.js +36 -23
- package/dist/schema-registry.js.map +1 -1
- package/dist/schemas/array-literal-expression.js +43 -23
- package/dist/schemas/array-literal-expression.js.map +1 -1
- package/dist/schemas/class.d.ts +17 -17
- package/dist/schemas/class.js +116 -83
- package/dist/schemas/class.js.map +1 -1
- package/dist/schemas/conditional-type.js +58 -36
- package/dist/schemas/conditional-type.js.map +1 -1
- package/dist/schemas/constructor.js +46 -18
- package/dist/schemas/constructor.js.map +1 -1
- package/dist/schemas/decorator.d.ts +12 -12
- package/dist/schemas/decorator.js +64 -40
- package/dist/schemas/decorator.js.map +1 -1
- package/dist/schemas/docs/doc.d.ts +10 -10
- package/dist/schemas/docs/doc.js +66 -51
- package/dist/schemas/docs/doc.js.map +1 -1
- package/dist/schemas/docs/index.js +57 -10
- package/dist/schemas/docs/index.js.map +1 -1
- package/dist/schemas/docs/property-like-tag.d.ts +5 -5
- package/dist/schemas/docs/property-like-tag.js +51 -32
- package/dist/schemas/docs/property-like-tag.js.map +1 -1
- package/dist/schemas/docs/return-tag.d.ts +6 -6
- package/dist/schemas/docs/return-tag.js +47 -29
- package/dist/schemas/docs/return-tag.js.map +1 -1
- package/dist/schemas/docs/tag.d.ts +5 -5
- package/dist/schemas/docs/tag.js +68 -58
- package/dist/schemas/docs/tag.js.map +1 -1
- package/dist/schemas/enum-member.d.ts +11 -11
- package/dist/schemas/enum-member.js +59 -40
- package/dist/schemas/enum-member.js.map +1 -1
- package/dist/schemas/enum.d.ts +8 -8
- package/dist/schemas/enum.js +81 -52
- package/dist/schemas/enum.js.map +1 -1
- package/dist/schemas/export.d.ts +9 -9
- package/dist/schemas/export.js +84 -58
- package/dist/schemas/export.js.map +1 -1
- package/dist/schemas/expression-with-arguments.js +53 -31
- package/dist/schemas/expression-with-arguments.js.map +1 -1
- package/dist/schemas/function-like.d.ts +16 -16
- package/dist/schemas/function-like.js +136 -99
- package/dist/schemas/function-like.js.map +1 -1
- package/dist/schemas/get-accessor.js +67 -42
- package/dist/schemas/get-accessor.js.map +1 -1
- package/dist/schemas/ignored.d.ts +1 -1
- package/dist/schemas/ignored.js +49 -30
- package/dist/schemas/ignored.js.map +1 -1
- package/dist/schemas/index-signature.js +55 -28
- package/dist/schemas/index-signature.js.map +1 -1
- package/dist/schemas/index.js +620 -107
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/indexed-access-type.js +50 -30
- package/dist/schemas/indexed-access-type.js.map +1 -1
- package/dist/schemas/inference-type.d.ts +8 -8
- package/dist/schemas/inference-type.js +54 -38
- package/dist/schemas/inference-type.js.map +1 -1
- package/dist/schemas/interface.d.ts +11 -11
- package/dist/schemas/interface.js +100 -67
- package/dist/schemas/interface.js.map +1 -1
- package/dist/schemas/keyword-type.js +35 -22
- package/dist/schemas/keyword-type.js.map +1 -1
- package/dist/schemas/literal-type.js +35 -22
- package/dist/schemas/literal-type.js.map +1 -1
- package/dist/schemas/literal-value.js +36 -23
- package/dist/schemas/literal-value.js.map +1 -1
- package/dist/schemas/module.d.ts +1 -1
- package/dist/schemas/module.js +81 -57
- package/dist/schemas/module.js.map +1 -1
- package/dist/schemas/named-tuple.d.ts +3 -3
- package/dist/schemas/named-tuple.js +48 -28
- package/dist/schemas/named-tuple.js.map +1 -1
- package/dist/schemas/object-literal-expression.js +47 -30
- package/dist/schemas/object-literal-expression.js.map +1 -1
- package/dist/schemas/parameter.d.ts +5 -5
- package/dist/schemas/parameter.js +83 -61
- package/dist/schemas/parameter.js.map +1 -1
- package/dist/schemas/parenthesized-type.js +45 -26
- package/dist/schemas/parenthesized-type.js.map +1 -1
- package/dist/schemas/property-assignment.d.ts +10 -10
- package/dist/schemas/property-assignment.js +61 -34
- package/dist/schemas/property-assignment.js.map +1 -1
- package/dist/schemas/set-accessor.d.ts +2 -2
- package/dist/schemas/set-accessor.js +60 -35
- package/dist/schemas/set-accessor.js.map +1 -1
- package/dist/schemas/template-literal-type-span.js +48 -28
- package/dist/schemas/template-literal-type-span.js.map +1 -1
- package/dist/schemas/template-literal-type.js +47 -27
- package/dist/schemas/template-literal-type.js.map +1 -1
- package/dist/schemas/this-type.js +29 -19
- package/dist/schemas/this-type.js.map +1 -1
- package/dist/schemas/tuple-type.js +42 -23
- package/dist/schemas/tuple-type.js.map +1 -1
- package/dist/schemas/type-array.js +45 -26
- package/dist/schemas/type-array.js.map +1 -1
- package/dist/schemas/type-intersection.js +45 -26
- package/dist/schemas/type-intersection.js.map +1 -1
- package/dist/schemas/type-literal.js +56 -37
- package/dist/schemas/type-literal.js.map +1 -1
- package/dist/schemas/type-operator.js +48 -28
- package/dist/schemas/type-operator.js.map +1 -1
- package/dist/schemas/type-predicate.d.ts +1 -1
- package/dist/schemas/type-predicate.js +56 -36
- package/dist/schemas/type-predicate.js.map +1 -1
- package/dist/schemas/type-query.js +51 -31
- package/dist/schemas/type-query.js.map +1 -1
- package/dist/schemas/type-ref.d.ts +8 -8
- package/dist/schemas/type-ref.js +138 -101
- package/dist/schemas/type-ref.js.map +1 -1
- package/dist/schemas/type-union.js +50 -31
- package/dist/schemas/type-union.js.map +1 -1
- package/dist/schemas/type.js +74 -43
- package/dist/schemas/type.js.map +1 -1
- package/dist/schemas/unimplemented-schema.js +37 -24
- package/dist/schemas/unimplemented-schema.js.map +1 -1
- package/dist/schemas/unknown-schema.js +37 -24
- package/dist/schemas/unknown-schema.js.map +1 -1
- package/dist/schemas/unresolved-schema.js +32 -22
- package/dist/schemas/unresolved-schema.js.map +1 -1
- package/dist/schemas/variable-like.d.ts +11 -11
- package/dist/schemas/variable-like.js +84 -51
- package/dist/schemas/variable-like.js.map +1 -1
- package/dist/type.js +1 -1
- package/dist/type.js.map +1 -1
- package/dist/unknown-schema-factory.js +13 -7
- package/dist/unknown-schema-factory.js.map +1 -1
- package/package.json +4 -4
- package/schemas/type.ts +2 -2
- package/types/asset.d.ts +15 -3
- package/dist/preview-1736711473672.js +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","KeywordTypeSchema","SchemaNode","constructor","location","name","toString","toFullSignature","toObject","fromObject","obj","exports"],"sources":["keyword-type.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\n\n/**\n * e.g. 'string', 'boolean', etc.\n */\nexport class KeywordTypeSchema extends SchemaNode {\n constructor(\n readonly location: SchemaLocation,\n readonly name: string\n ) {\n super();\n }\n\n toString() {\n return this.name;\n }\n\n toFullSignature(): string {\n return this.toString();\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n };\n }\n\n static fromObject(obj: Record<string, any>): KeywordTypeSchema {\n const location = obj.location;\n const name = obj.name;\n return new KeywordTypeSchema(location, name);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACO,MAAME,iBAAiB,SAASC,wBAAU,CAAC;EAChDC,WAAWA,CACAC,QAAwB,EACxBC,IAAY,EACrB;IACA,KAAK,CAAC,CAAC;IAAC,KAHCD,QAAwB,GAAxBA,QAAwB;IAAA,KACxBC,IAAY,GAAZA,IAAY;EAGvB;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,IAAI,CAACD,IAAI;EAClB;EAEAE,eAAeA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACD,QAAQ,CAAC,CAAC;EACxB;EAEAE,QAAQA,CAAA,EAAG;IACT,OAAO;MACL,GAAG,KAAK,CAACA,QAAQ,CAAC,CAAC;MACnBH,IAAI,EAAE,IAAI,CAACA;IACb,CAAC;EACH;EAEA,OAAOI,UAAUA,CAACC,GAAwB,EAAqB;IAC7D,MAAMN,QAAQ,GAAGM,GAAG,CAACN,QAAQ;IAC7B,MAAMC,IAAI,GAAGK,GAAG,CAACL,IAAI;IACrB,OAAO,IAAIJ,iBAAiB,CAACG,QAAQ,EAAEC,IAAI,CAAC;EAC9C;AACF;AAACM,OAAA,CAAAV,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -1,30 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.LiteralTypeSchema = void 0;
|
|
4
|
-
|
|
7
|
+
function _schemaNode() {
|
|
8
|
+
const data = require("../schema-node");
|
|
9
|
+
_schemaNode = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
5
14
|
/**
|
|
6
15
|
* e.g. const a: 'a';
|
|
7
16
|
*/
|
|
8
|
-
class LiteralTypeSchema extends
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
class LiteralTypeSchema extends _schemaNode().SchemaNode {
|
|
18
|
+
constructor(location, name) {
|
|
19
|
+
super();
|
|
20
|
+
this.location = location;
|
|
21
|
+
this.name = name;
|
|
22
|
+
}
|
|
23
|
+
toObject() {
|
|
24
|
+
return {
|
|
25
|
+
...super.toObject(),
|
|
26
|
+
name: this.name
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
toString() {
|
|
30
|
+
return this.name;
|
|
31
|
+
}
|
|
32
|
+
toFullSignature() {
|
|
33
|
+
return this.toString();
|
|
34
|
+
}
|
|
35
|
+
static fromObject(obj) {
|
|
36
|
+
const location = obj.location;
|
|
37
|
+
const name = obj.name;
|
|
38
|
+
return new LiteralTypeSchema(location, name);
|
|
39
|
+
}
|
|
28
40
|
}
|
|
29
41
|
exports.LiteralTypeSchema = LiteralTypeSchema;
|
|
42
|
+
|
|
30
43
|
//# sourceMappingURL=literal-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","LiteralTypeSchema","SchemaNode","constructor","location","name","toObject","toString","toFullSignature","fromObject","obj","exports"],"sources":["literal-type.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\n\n/**\n * e.g. const a: 'a';\n */\nexport class LiteralTypeSchema extends SchemaNode {\n constructor(\n readonly location: SchemaLocation,\n readonly name: string\n ) {\n super();\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toFullSignature(): string {\n return this.toString();\n }\n\n static fromObject(obj: Record<string, any>): LiteralTypeSchema {\n const location = obj.location;\n const name = obj.name;\n return new LiteralTypeSchema(location, name);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACO,MAAME,iBAAiB,SAASC,wBAAU,CAAC;EAChDC,WAAWA,CACAC,QAAwB,EACxBC,IAAY,EACrB;IACA,KAAK,CAAC,CAAC;IAAC,KAHCD,QAAwB,GAAxBA,QAAwB;IAAA,KACxBC,IAAY,GAAZA,IAAY;EAGvB;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO;MACL,GAAG,KAAK,CAACA,QAAQ,CAAC,CAAC;MACnBD,IAAI,EAAE,IAAI,CAACA;IACb,CAAC;EACH;EAEAE,QAAQA,CAAA,EAAG;IACT,OAAO,IAAI,CAACF,IAAI;EAClB;EAEAG,eAAeA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACD,QAAQ,CAAC,CAAC;EACxB;EAEA,OAAOE,UAAUA,CAACC,GAAwB,EAAqB;IAC7D,MAAMN,QAAQ,GAAGM,GAAG,CAACN,QAAQ;IAC7B,MAAMC,IAAI,GAAGK,GAAG,CAACL,IAAI;IACrB,OAAO,IAAIJ,iBAAiB,CAACG,QAAQ,EAAEC,IAAI,CAAC;EAC9C;AACF;AAACM,OAAA,CAAAV,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.LiteralValueSchema = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
function _schemaNode() {
|
|
8
|
+
const data = require("../schema-node");
|
|
9
|
+
_schemaNode = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
class LiteralValueSchema extends _schemaNode().SchemaNode {
|
|
15
|
+
constructor(location, value) {
|
|
16
|
+
super();
|
|
17
|
+
this.location = location;
|
|
18
|
+
this.value = value;
|
|
19
|
+
this.value = this.value.replace(/^['"]|['"]$/g, '');
|
|
20
|
+
}
|
|
21
|
+
toString() {
|
|
22
|
+
return this.value;
|
|
23
|
+
}
|
|
24
|
+
toFullSignature() {
|
|
25
|
+
return this.toString();
|
|
26
|
+
}
|
|
27
|
+
toObject() {
|
|
28
|
+
return {
|
|
29
|
+
...super.toObject(),
|
|
30
|
+
value: this.value
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
static fromObject(obj) {
|
|
34
|
+
const location = obj.location;
|
|
35
|
+
const value = obj.value;
|
|
36
|
+
return new LiteralValueSchema(location, value);
|
|
37
|
+
}
|
|
26
38
|
}
|
|
27
39
|
exports.LiteralValueSchema = LiteralValueSchema;
|
|
40
|
+
|
|
28
41
|
//# sourceMappingURL=literal-value.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","LiteralValueSchema","SchemaNode","constructor","location","value","replace","toString","toFullSignature","toObject","fromObject","obj","exports"],"sources":["literal-value.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\n\nexport class LiteralValueSchema extends SchemaNode {\n constructor(\n readonly location: SchemaLocation,\n readonly value: string\n ) {\n super();\n this.value = this.value.replace(/^['\"]|['\"]$/g, '');\n }\n\n toString() {\n return this.value;\n }\n\n toFullSignature(): string {\n return this.toString();\n }\n\n toObject() {\n return {\n ...super.toObject(),\n value: this.value,\n };\n }\n\n static fromObject(obj: Record<string, any>): LiteralValueSchema {\n const location = obj.location;\n const value = obj.value;\n return new LiteralValueSchema(location, value);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,kBAAkB,SAASC,wBAAU,CAAC;EACjDC,WAAWA,CACAC,QAAwB,EACxBC,KAAa,EACtB;IACA,KAAK,CAAC,CAAC;IAAC,KAHCD,QAAwB,GAAxBA,QAAwB;IAAA,KACxBC,KAAa,GAAbA,KAAa;IAGtB,IAAI,CAACA,KAAK,GAAG,IAAI,CAACA,KAAK,CAACC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;EACrD;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,IAAI,CAACF,KAAK;EACnB;EAEAG,eAAeA,CAAA,EAAW;IACxB,OAAO,IAAI,CAACD,QAAQ,CAAC,CAAC;EACxB;EAEAE,QAAQA,CAAA,EAAG;IACT,OAAO;MACL,GAAG,KAAK,CAACA,QAAQ,CAAC,CAAC;MACnBJ,KAAK,EAAE,IAAI,CAACA;IACd,CAAC;EACH;EAEA,OAAOK,UAAUA,CAACC,GAAwB,EAAsB;IAC9D,MAAMP,QAAQ,GAAGO,GAAG,CAACP,QAAQ;IAC7B,MAAMC,KAAK,GAAGM,GAAG,CAACN,KAAK;IACvB,OAAO,IAAIJ,kBAAkB,CAACG,QAAQ,EAAEC,KAAK,CAAC;EAChD;AACF;AAACO,OAAA,CAAAX,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
package/dist/schemas/module.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare class ModuleSchema extends SchemaNode {
|
|
|
16
16
|
toObject(): {
|
|
17
17
|
exports: Record<string, any>[];
|
|
18
18
|
internals: Record<string, any>[];
|
|
19
|
-
namespace: string;
|
|
19
|
+
namespace: string | undefined;
|
|
20
20
|
};
|
|
21
21
|
static fromObject(obj: Record<string, any>): ModuleSchema;
|
|
22
22
|
}
|
package/dist/schemas/module.js
CHANGED
|
@@ -1,63 +1,87 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
6
|
exports.ModuleSchema = void 0;
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
7
|
+
function _chalk() {
|
|
8
|
+
const data = _interopRequireDefault(require("chalk"));
|
|
9
|
+
_chalk = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _schemaNode() {
|
|
15
|
+
const data = require("../schema-node");
|
|
16
|
+
_schemaNode = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _schemaRegistry() {
|
|
22
|
+
const data = require("../schema-registry");
|
|
23
|
+
_schemaRegistry = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
class ModuleSchema extends _schemaNode().SchemaNode {
|
|
30
|
+
// exports could either be re exports (export declarations) or nodes with export modifier
|
|
31
|
+
|
|
32
|
+
constructor(location, exports, internals) {
|
|
33
|
+
super();
|
|
34
|
+
this.location = location;
|
|
35
|
+
this.exports = exports;
|
|
36
|
+
this.internals = internals;
|
|
37
|
+
}
|
|
38
|
+
getNodes() {
|
|
39
|
+
return [...this.exports, ...this.internals];
|
|
40
|
+
}
|
|
41
|
+
flatExportsRecursively() {
|
|
42
|
+
this.exports = this.exports.reduce((acc, exp) => {
|
|
43
|
+
if (exp instanceof ModuleSchema) {
|
|
44
|
+
exp.flatExportsRecursively();
|
|
45
|
+
if (exp.namespace) return [...acc, exp];
|
|
46
|
+
return [...acc, ...exp.exports];
|
|
47
|
+
}
|
|
48
|
+
return [...acc, exp];
|
|
49
|
+
}, []);
|
|
50
|
+
}
|
|
51
|
+
toString(options) {
|
|
52
|
+
if (!this.namespace) throw new Error('toString() should not be called on a module without namespace, make sure this.flatExportsRecursively() is called');
|
|
53
|
+
const boldUnderline = options?.color ? _chalk().default.bold.underline : str => str;
|
|
54
|
+
const exportsStr = this.exports.map(m => `* ${m.toString(options)}`).join('\n');
|
|
55
|
+
return `${boldUnderline(this.namespace)}\n${exportsStr}`;
|
|
56
|
+
}
|
|
57
|
+
toFullSignature(options) {
|
|
58
|
+
if (!this.namespace) throw new Error('toFullSignature() should not be called on a module without namespace; make sure this.flatExportsRecursively() is called');
|
|
59
|
+
const exportsSignatures = this.exports.map(m => m.toFullSignature(options)).join('\n');
|
|
60
|
+
let signature = `${this.namespace}\n${exportsSignatures}`;
|
|
61
|
+
if (options?.showDocs && this.doc) {
|
|
62
|
+
const docString = this.doc.toFullSignature();
|
|
63
|
+
signature = `${docString}\n${signature}`;
|
|
60
64
|
}
|
|
65
|
+
return signature;
|
|
66
|
+
}
|
|
67
|
+
toObject() {
|
|
68
|
+
return {
|
|
69
|
+
...super.toObject(),
|
|
70
|
+
exports: this.exports.map(member => member.toObject()),
|
|
71
|
+
internals: this.internals.map(member => member.toObject()),
|
|
72
|
+
namespace: this.namespace
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
static fromObject(obj) {
|
|
76
|
+
const location = obj.location;
|
|
77
|
+
const exportNodes = (obj.exports || []).map(member => _schemaRegistry().SchemaRegistry.fromObject(member));
|
|
78
|
+
const internals = (obj.internals || []).map(member => _schemaRegistry().SchemaRegistry.fromObject(member));
|
|
79
|
+
const namespace = obj.namespace;
|
|
80
|
+
const module = new ModuleSchema(location, exportNodes, internals);
|
|
81
|
+
module.namespace = namespace;
|
|
82
|
+
return module;
|
|
83
|
+
}
|
|
61
84
|
}
|
|
62
85
|
exports.ModuleSchema = ModuleSchema;
|
|
86
|
+
|
|
63
87
|
//# sourceMappingURL=module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_schemaNode","_schemaRegistry","e","__esModule","default","ModuleSchema","SchemaNode","constructor","location","exports","internals","getNodes","flatExportsRecursively","reduce","acc","exp","namespace","toString","options","Error","boldUnderline","color","chalk","bold","underline","str","exportsStr","map","m","join","toFullSignature","exportsSignatures","signature","showDocs","doc","docString","toObject","member","fromObject","obj","exportNodes","SchemaRegistry","module"],"sources":["module.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { SchemaLocation, SchemaNode } from '../schema-node';\nimport { SchemaRegistry } from '../schema-registry';\nimport { ExportSchema } from './export';\n\nexport class ModuleSchema extends SchemaNode {\n // exports could either be re exports (export declarations) or nodes with export modifier\n exports: SchemaNode[];\n internals: SchemaNode[];\n namespace?: string;\n\n constructor(\n readonly location: SchemaLocation,\n exports: SchemaNode[],\n internals: SchemaNode[]\n ) {\n super();\n this.exports = exports;\n this.internals = internals;\n }\n\n getNodes() {\n return [...this.exports, ...this.internals];\n }\n\n flatExportsRecursively() {\n this.exports = this.exports.reduce(\n (acc, exp) => {\n if (exp instanceof ModuleSchema) {\n exp.flatExportsRecursively();\n if (exp.namespace) return [...acc, exp];\n return [...acc, ...exp.exports];\n }\n return [...acc, exp];\n },\n [] as (ExportSchema | SchemaNode)[]\n );\n }\n\n toString(options?: { color?: boolean }) {\n if (!this.namespace)\n throw new Error(\n 'toString() should not be called on a module without namespace, make sure this.flatExportsRecursively() is called'\n );\n const boldUnderline = options?.color ? chalk.bold.underline : (str: string) => str;\n\n const exportsStr = this.exports.map((m) => `* ${m.toString(options)}`).join('\\n');\n return `${boldUnderline(this.namespace)}\\n${exportsStr}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n if (!this.namespace)\n throw new Error(\n 'toFullSignature() should not be called on a module without namespace; make sure this.flatExportsRecursively() is called'\n );\n\n const exportsSignatures = this.exports.map((m) => m.toFullSignature(options)).join('\\n');\n\n let signature = `${this.namespace}\\n${exportsSignatures}`;\n\n if (options?.showDocs && this.doc) {\n const docString = this.doc.toFullSignature();\n signature = `${docString}\\n${signature}`;\n }\n\n return signature;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n exports: this.exports.map((member) => member.toObject()),\n internals: this.internals.map((member) => member.toObject()),\n namespace: this.namespace,\n };\n }\n\n static fromObject(obj: Record<string, any>): ModuleSchema {\n const location = obj.location;\n const exportNodes = (obj.exports || []).map((member: any) => SchemaRegistry.fromObject(member));\n const internals = (obj.internals || []).map((member: any) => SchemaRegistry.fromObject(member));\n const namespace = obj.namespace;\n const module = new ModuleSchema(location, exportNodes, internals);\n module.namespace = namespace;\n return module;\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,eAAA,Y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,WAAW,GAAG,CAACD,GAAG,CAAC9B,OAAO,IAAI,EAAE,EAAEkB,GAAG,CAAEU,MAAW,IAAKI,gCAAc,CAACH,UAAU,CAACD,MAAM,CAAC,CAAC;IAC/F,MAAM3B,SAAS,GAAG,CAAC6B,GAAG,CAAC7B,SAAS,IAAI,EAAE,EAAEiB,GAAG,CAAEU,MAAW,IAAKI,gCAAc,CAACH,UAAU,CAACD,MAAM,CAAC,CAAC;IAC/F,MAAMrB,SAAS,GAAGuB,GAAG,CAACvB,SAAS;IAC/B,MAAM0B,MAAM,GAAG,IAAIrC,YAAY,CAACG,QAAQ,EAAEgC,WAAW,EAAE9B,SAAS,CAAC;IACjEgC,MAAM,CAAC1B,SAAS,GAAGA,SAAS;IAC5B,OAAO0B,MAAM;EACf;AACF;AAACjC,OAAA,CAAAJ,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@ import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
|
2
2
|
export declare class NamedTupleSchema extends SchemaNode {
|
|
3
3
|
readonly location: SchemaLocation;
|
|
4
4
|
readonly type: SchemaNode;
|
|
5
|
-
readonly name?: string;
|
|
6
|
-
constructor(location: SchemaLocation, type: SchemaNode, name?: string);
|
|
5
|
+
readonly name?: string | undefined;
|
|
6
|
+
constructor(location: SchemaLocation, type: SchemaNode, name?: string | undefined);
|
|
7
7
|
getNodes(): SchemaNode[];
|
|
8
8
|
toString(options?: {
|
|
9
9
|
color?: boolean;
|
|
@@ -12,7 +12,7 @@ export declare class NamedTupleSchema extends SchemaNode {
|
|
|
12
12
|
showDocs?: boolean;
|
|
13
13
|
}): string;
|
|
14
14
|
toObject(): {
|
|
15
|
-
name: string;
|
|
15
|
+
name: string | undefined;
|
|
16
16
|
type: Record<string, any>;
|
|
17
17
|
};
|
|
18
18
|
static fromObject(obj: Record<string, any>): NamedTupleSchema;
|
|
@@ -1,33 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.NamedTupleSchema = void 0;
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
7
|
+
function _schemaNode() {
|
|
8
|
+
const data = require("../schema-node");
|
|
9
|
+
_schemaNode = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _schemaRegistry() {
|
|
15
|
+
const data = require("../schema-registry");
|
|
16
|
+
_schemaRegistry = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
class NamedTupleSchema extends _schemaNode().SchemaNode {
|
|
22
|
+
constructor(location, type, name) {
|
|
23
|
+
super();
|
|
24
|
+
this.location = location;
|
|
25
|
+
this.type = type;
|
|
26
|
+
this.name = name;
|
|
27
|
+
}
|
|
28
|
+
getNodes() {
|
|
29
|
+
return [this.type];
|
|
30
|
+
}
|
|
31
|
+
toString(options) {
|
|
32
|
+
return `${this.name}: ${this.type.toString(options)}`;
|
|
33
|
+
}
|
|
34
|
+
toFullSignature(options) {
|
|
35
|
+
return `${this.name}: ${this.type.toFullSignature(options)}`;
|
|
36
|
+
}
|
|
37
|
+
toObject() {
|
|
38
|
+
return {
|
|
39
|
+
...super.toObject(),
|
|
40
|
+
name: this.name,
|
|
41
|
+
type: this.type.toObject()
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static fromObject(obj) {
|
|
45
|
+
const location = obj.location;
|
|
46
|
+
const type = _schemaRegistry().SchemaRegistry.fromObject(obj.type);
|
|
47
|
+
const name = obj.name;
|
|
48
|
+
return new NamedTupleSchema(location, type, name);
|
|
49
|
+
}
|
|
31
50
|
}
|
|
32
51
|
exports.NamedTupleSchema = NamedTupleSchema;
|
|
52
|
+
|
|
33
53
|
//# sourceMappingURL=named-tuple.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","_schemaRegistry","NamedTupleSchema","SchemaNode","constructor","location","type","name","getNodes","toString","options","toFullSignature","toObject","fromObject","obj","SchemaRegistry","exports"],"sources":["named-tuple.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\nimport { SchemaRegistry } from '../schema-registry';\n\nexport class NamedTupleSchema extends SchemaNode {\n constructor(\n readonly location: SchemaLocation,\n readonly type: SchemaNode,\n readonly name?: string\n ) {\n super();\n }\n\n getNodes() {\n return [this.type];\n }\n\n toString(options?: { color?: boolean }): string {\n return `${this.name}: ${this.type.toString(options)}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n return `${this.name}: ${this.type.toFullSignature(options)}`;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n type: this.type.toObject(),\n };\n }\n\n static fromObject(obj: Record<string, any>): NamedTupleSchema {\n const location = obj.location;\n const type = SchemaRegistry.fromObject(obj.type);\n const name = obj.name;\n return new NamedTupleSchema(location, type, name);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AA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{
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.ObjectLiteralExpressionSchema = void 0;
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
7
|
+
function _schemaNode() {
|
|
8
|
+
const data = require("../schema-node");
|
|
9
|
+
_schemaNode = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _schemaRegistry() {
|
|
15
|
+
const data = require("../schema-registry");
|
|
16
|
+
_schemaRegistry = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
class ObjectLiteralExpressionSchema extends _schemaNode().SchemaNode {
|
|
22
|
+
constructor(members, location) {
|
|
23
|
+
super();
|
|
24
|
+
this.members = members;
|
|
25
|
+
this.location = location;
|
|
26
|
+
}
|
|
27
|
+
getNodes() {
|
|
28
|
+
return this.members;
|
|
29
|
+
}
|
|
30
|
+
toString(options) {
|
|
31
|
+
return `{\n${this.members.map(member => `\t${member.toString(options)}`).join('\n')}\n}`;
|
|
32
|
+
}
|
|
33
|
+
toFullSignature(options) {
|
|
34
|
+
const membersStr = this.members.map(member => member.toFullSignature(options)).join(',\n');
|
|
35
|
+
return `{\n${membersStr.split('\n').map(line => ` ${line}`).join('\n')}\n}`;
|
|
36
|
+
}
|
|
37
|
+
toObject() {
|
|
38
|
+
return {
|
|
39
|
+
...super.toObject(),
|
|
40
|
+
members: this.members.map(element => element.toObject()),
|
|
41
|
+
location: this.location
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static fromObject(obj) {
|
|
45
|
+
const members = obj.members.map(member => _schemaRegistry().SchemaRegistry.fromObject(member));
|
|
46
|
+
const location = obj.location;
|
|
47
|
+
return new ObjectLiteralExpressionSchema(members, location);
|
|
48
|
+
}
|
|
33
49
|
}
|
|
34
50
|
exports.ObjectLiteralExpressionSchema = ObjectLiteralExpressionSchema;
|
|
51
|
+
|
|
35
52
|
//# sourceMappingURL=object-literal-expression.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","_schemaRegistry","ObjectLiteralExpressionSchema","SchemaNode","constructor","members","location","getNodes","toString","options","map","member","join","toFullSignature","membersStr","split","line","toObject","element","fromObject","obj","SchemaRegistry","exports"],"sources":["object-literal-expression.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\nimport { SchemaRegistry } from '../schema-registry';\n\nexport class ObjectLiteralExpressionSchema extends SchemaNode {\n constructor(\n readonly members: SchemaNode[],\n readonly location: SchemaLocation\n ) {\n super();\n }\n\n getNodes() {\n return this.members;\n }\n\n toString(options?: { color?: boolean }): string {\n return `{\\n${this.members.map((member) => `\\t${member.toString(options)}`).join('\\n')}\\n}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n const membersStr = this.members.map((member) => member.toFullSignature(options)).join(',\\n');\n\n return `{\\n${membersStr\n .split('\\n')\n .map((line) => ` ${line}`)\n .join('\\n')}\\n}`;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n members: this.members.map((element) => element.toObject()),\n location: this.location,\n };\n }\n\n static fromObject(obj: Record<string, any>): ObjectLiteralExpressionSchema {\n const members = obj.members.map((member) => SchemaRegistry.fromObject(member));\n const location = obj.location;\n return new ObjectLiteralExpressionSchema(members, location);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MA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,EAAE,IAAI,CAACA;IACjB,CAAC;EACH;EAEA,OAAOa,UAAUA,CAACC,GAAwB,EAAiC;IACzE,MAAMf,OAAO,GAAGe,GAAG,CAACf,OAAO,CAACK,GAAG,CAAEC,MAAM,IAAKU,gCAAc,CAACF,UAAU,CAACR,MAAM,CAAC,CAAC;IAC9E,MAAML,QAAQ,GAAGc,GAAG,CAACd,QAAQ;IAC7B,OAAO,IAAIJ,6BAA6B,CAACG,OAAO,EAAEC,QAAQ,CAAC;EAC7D;AACF;AAACgB,OAAA,CAAApB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
|
@@ -3,12 +3,12 @@ export declare class ParameterSchema<T extends SchemaNode = SchemaNode> extends
|
|
|
3
3
|
readonly location: SchemaLocation;
|
|
4
4
|
readonly name: string;
|
|
5
5
|
readonly isOptional: boolean;
|
|
6
|
-
readonly defaultValue?: any;
|
|
7
|
-
readonly description?: string;
|
|
6
|
+
readonly defaultValue?: any | undefined;
|
|
7
|
+
readonly description?: string | undefined;
|
|
8
8
|
readonly isSpread: boolean;
|
|
9
9
|
readonly type: T;
|
|
10
10
|
readonly objectBindingNodes?: SchemaNode[];
|
|
11
|
-
constructor(location: SchemaLocation, name: string, type: T, isOptional: boolean, defaultValue?: any, description?: string, objectBindingNodes?: SchemaNode[], isSpread?: boolean);
|
|
11
|
+
constructor(location: SchemaLocation, name: string, type: T, isOptional: boolean, defaultValue?: any | undefined, description?: string | undefined, objectBindingNodes?: SchemaNode[], isSpread?: boolean);
|
|
12
12
|
toString(): string;
|
|
13
13
|
toFullSignature(options?: {
|
|
14
14
|
showDocs?: boolean;
|
|
@@ -18,8 +18,8 @@ export declare class ParameterSchema<T extends SchemaNode = SchemaNode> extends
|
|
|
18
18
|
type: Record<string, any>;
|
|
19
19
|
isOptional: boolean;
|
|
20
20
|
defaultValue: any;
|
|
21
|
-
description: string;
|
|
22
|
-
objectBindingNodes: Record<string, any>[];
|
|
21
|
+
description: string | undefined;
|
|
22
|
+
objectBindingNodes: Record<string, any>[] | undefined;
|
|
23
23
|
isSpread: boolean;
|
|
24
24
|
};
|
|
25
25
|
static fromObject<T extends SchemaNode = SchemaNode>(obj: Record<string, any>): ParameterSchema<T>;
|