@teambit/semantics.entities.semantic-schema 0.0.78 → 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/types/asset.d.ts +15 -3
- package/dist/preview-1737084088495.js +0 -7
|
@@ -1,71 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.ParameterSchema = void 0;
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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 ParameterSchema extends _schemaNode().SchemaNode {
|
|
22
|
+
constructor(location, name, type, isOptional, defaultValue, description, objectBindingNodes, isSpread = false) {
|
|
23
|
+
super();
|
|
24
|
+
this.location = location;
|
|
25
|
+
this.name = name;
|
|
26
|
+
this.isOptional = isOptional;
|
|
27
|
+
this.defaultValue = defaultValue;
|
|
28
|
+
this.description = description;
|
|
29
|
+
this.isSpread = isSpread;
|
|
30
|
+
this.type = type;
|
|
31
|
+
this.objectBindingNodes = objectBindingNodes;
|
|
32
|
+
this.isSpread = isSpread;
|
|
33
|
+
}
|
|
34
|
+
toString() {
|
|
35
|
+
return `${this.name}${this.isOptional ? '?' : ''}: ${this.type.toString()}`;
|
|
36
|
+
}
|
|
37
|
+
toFullSignature(options) {
|
|
38
|
+
let paramStr = '';
|
|
39
|
+
if (options?.showDocs && this.description) {
|
|
40
|
+
paramStr += `/** ${this.description} */\n`;
|
|
41
|
+
}
|
|
42
|
+
if (this.isSpread) {
|
|
43
|
+
paramStr += '...';
|
|
18
44
|
}
|
|
19
|
-
|
|
20
|
-
|
|
45
|
+
let paramName = '';
|
|
46
|
+
if (this.objectBindingNodes && this.objectBindingNodes.length > 0) {
|
|
47
|
+
const bindingsStr = this.objectBindingNodes.map(node => node.toFullSignature(options)).join(', ');
|
|
48
|
+
paramName += `{ ${bindingsStr} }`;
|
|
49
|
+
} else {
|
|
50
|
+
paramName += this.name;
|
|
21
51
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if ((options === null || options === void 0 ? void 0 : options.showDocs) && this.description) {
|
|
25
|
-
paramStr += `/** ${this.description} */\n`;
|
|
26
|
-
}
|
|
27
|
-
if (this.isSpread) {
|
|
28
|
-
paramStr += '...';
|
|
29
|
-
}
|
|
30
|
-
let paramName = '';
|
|
31
|
-
if (this.objectBindingNodes && this.objectBindingNodes.length > 0) {
|
|
32
|
-
const bindingsStr = this.objectBindingNodes.map((node) => node.toFullSignature(options)).join(', ');
|
|
33
|
-
paramName += `{ ${bindingsStr} }`;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
paramName += this.name;
|
|
37
|
-
}
|
|
38
|
-
if (this.isOptional) {
|
|
39
|
-
paramName += '?';
|
|
40
|
-
}
|
|
41
|
-
paramStr += `${paramName}`;
|
|
42
|
-
if (this.type && typeof this.type.toString === 'function') {
|
|
43
|
-
const typeName = this.type.toString();
|
|
44
|
-
if (typeName) {
|
|
45
|
-
paramStr += `: ${typeName}`;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (this.defaultValue !== undefined) {
|
|
49
|
-
paramStr += ` = ${this.defaultValue}`;
|
|
50
|
-
}
|
|
51
|
-
return paramStr;
|
|
52
|
+
if (this.isOptional) {
|
|
53
|
+
paramName += '?';
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
paramStr += `${paramName}`;
|
|
56
|
+
if (this.type && typeof this.type.toString === 'function') {
|
|
57
|
+
const typeName = this.type.toString();
|
|
58
|
+
if (typeName) {
|
|
59
|
+
paramStr += `: ${typeName}`;
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const location = obj.location;
|
|
60
|
-
const name = obj.name;
|
|
61
|
-
const type = schema_registry_1.SchemaRegistry.fromObject(obj.type);
|
|
62
|
-
const isOptional = obj.isOptional;
|
|
63
|
-
const defaultValue = obj.defaultValue;
|
|
64
|
-
const description = obj.description;
|
|
65
|
-
const isSpread = obj.isSpread;
|
|
66
|
-
const objectBindingNodes = (_a = obj.objectBindingNodes) === null || _a === void 0 ? void 0 : _a.map((node) => schema_registry_1.SchemaRegistry.fromObject(node));
|
|
67
|
-
return new ParameterSchema(location, name, type, isOptional, defaultValue, description, objectBindingNodes, isSpread);
|
|
62
|
+
if (this.defaultValue !== undefined) {
|
|
63
|
+
paramStr += ` = ${this.defaultValue}`;
|
|
68
64
|
}
|
|
65
|
+
return paramStr;
|
|
66
|
+
}
|
|
67
|
+
toObject() {
|
|
68
|
+
return {
|
|
69
|
+
...super.toObject(),
|
|
70
|
+
name: this.name,
|
|
71
|
+
type: this.type.toObject(),
|
|
72
|
+
isOptional: this.isOptional,
|
|
73
|
+
defaultValue: this.defaultValue,
|
|
74
|
+
description: this.description,
|
|
75
|
+
objectBindingNodes: this.objectBindingNodes?.map(node => node.toObject()),
|
|
76
|
+
isSpread: this.isSpread
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
static fromObject(obj) {
|
|
80
|
+
const location = obj.location;
|
|
81
|
+
const name = obj.name;
|
|
82
|
+
const type = _schemaRegistry().SchemaRegistry.fromObject(obj.type);
|
|
83
|
+
const isOptional = obj.isOptional;
|
|
84
|
+
const defaultValue = obj.defaultValue;
|
|
85
|
+
const description = obj.description;
|
|
86
|
+
const isSpread = obj.isSpread;
|
|
87
|
+
const objectBindingNodes = obj.objectBindingNodes?.map(node => _schemaRegistry().SchemaRegistry.fromObject(node));
|
|
88
|
+
return new ParameterSchema(location, name, type, isOptional, defaultValue, description, objectBindingNodes, isSpread);
|
|
89
|
+
}
|
|
69
90
|
}
|
|
70
91
|
exports.ParameterSchema = ParameterSchema;
|
|
92
|
+
|
|
71
93
|
//# sourceMappingURL=parameter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","_schemaRegistry","ParameterSchema","SchemaNode","constructor","location","name","type","isOptional","defaultValue","description","objectBindingNodes","isSpread","toString","toFullSignature","options","paramStr","showDocs","paramName","length","bindingsStr","map","node","join","typeName","undefined","toObject","fromObject","obj","SchemaRegistry","exports"],"sources":["parameter.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\nimport { SchemaRegistry } from '../schema-registry';\n\nexport class ParameterSchema<T extends SchemaNode = SchemaNode> extends SchemaNode {\n readonly type: T;\n readonly objectBindingNodes?: SchemaNode[];\n\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n type: T,\n readonly isOptional: boolean,\n readonly defaultValue?: any,\n readonly description?: string,\n objectBindingNodes?: SchemaNode[],\n readonly isSpread: boolean = false\n ) {\n super();\n this.type = type;\n this.objectBindingNodes = objectBindingNodes;\n this.isSpread = isSpread;\n }\n\n toString() {\n return `${this.name}${this.isOptional ? '?' : ''}: ${this.type.toString()}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n let paramStr = '';\n\n if (options?.showDocs && this.description) {\n paramStr += `/** ${this.description} */\\n`;\n }\n\n if (this.isSpread) {\n paramStr += '...';\n }\n\n let paramName = '';\n\n if (this.objectBindingNodes && this.objectBindingNodes.length > 0) {\n const bindingsStr = this.objectBindingNodes.map((node) => node.toFullSignature(options)).join(', ');\n paramName += `{ ${bindingsStr} }`;\n } else {\n paramName += this.name;\n }\n\n if (this.isOptional) {\n paramName += '?';\n }\n\n paramStr += `${paramName}`;\n\n if (this.type && typeof this.type.toString === 'function') {\n const typeName = this.type.toString();\n if (typeName) {\n paramStr += `: ${typeName}`;\n }\n }\n\n if (this.defaultValue !== undefined) {\n paramStr += ` = ${this.defaultValue}`;\n }\n\n return paramStr;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n type: this.type.toObject(),\n isOptional: this.isOptional,\n defaultValue: this.defaultValue,\n description: this.description,\n objectBindingNodes: this.objectBindingNodes?.map((node) => node.toObject()),\n isSpread: this.isSpread,\n };\n }\n\n static fromObject<T extends SchemaNode = SchemaNode>(obj: Record<string, any>): ParameterSchema<T> {\n const location = obj.location;\n const name = obj.name;\n const type = SchemaRegistry.fromObject(obj.type);\n const isOptional = obj.isOptional;\n const defaultValue = obj.defaultValue;\n const description = obj.description;\n const isSpread = obj.isSpread;\n const objectBindingNodes = obj.objectBindingNodes?.map((node: any) => SchemaRegistry.fromObject(node));\n return new ParameterSchema(\n location,\n name,\n type,\n isOptional,\n defaultValue,\n description,\n objectBindingNodes,\n isSpread\n );\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;AAAA;AAEO,MAAMG,eAAe,SAA4CC,wBAAU,CAAC;EAIjFC,WAAWA,CACAC,QAAwB,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UAAU,GAAGoB,GAAG,CAACpB,UAAU;IACjC,MAAMC,YAAY,GAAGmB,GAAG,CAACnB,YAAY;IACrC,MAAMC,WAAW,GAAGkB,GAAG,CAAClB,WAAW;IACnC,MAAME,QAAQ,GAAGgB,GAAG,CAAChB,QAAQ;IAC7B,MAAMD,kBAAkB,GAAGiB,GAAG,CAACjB,kBAAkB,EAAEU,GAAG,CAAEC,IAAS,IAAKO,gCAAc,CAACF,UAAU,CAACL,IAAI,CAAC,CAAC;IACtG,OAAO,IAAIpB,eAAe,CACxBG,QAAQ,EACRC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,YAAY,EACZC,WAAW,EACXC,kBAAkB,EAClBC,QACF,CAAC;EACH;AACF;AAACkB,OAAA,CAAA5B,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1,35 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.ParenthesizedTypeSchema = void 0;
|
|
4
|
-
|
|
5
|
-
const
|
|
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
|
+
}
|
|
6
21
|
/**
|
|
7
22
|
* type inside parentheses
|
|
8
23
|
* e.g. (T1 | T2)
|
|
9
24
|
*/
|
|
10
|
-
class ParenthesizedTypeSchema extends
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
class ParenthesizedTypeSchema extends _schemaNode().SchemaNode {
|
|
26
|
+
constructor(location, type) {
|
|
27
|
+
super();
|
|
28
|
+
this.location = location;
|
|
29
|
+
this.type = type;
|
|
30
|
+
}
|
|
31
|
+
getNodes() {
|
|
32
|
+
return [this.type];
|
|
33
|
+
}
|
|
34
|
+
toString(options) {
|
|
35
|
+
return `(${this.type.toString(options)})`;
|
|
36
|
+
}
|
|
37
|
+
toFullSignature(options) {
|
|
38
|
+
return `(${this.type.toFullSignature(options)})`;
|
|
39
|
+
}
|
|
40
|
+
toObject() {
|
|
41
|
+
return {
|
|
42
|
+
...super.toObject(),
|
|
43
|
+
type: this.type.toObject()
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
static fromObject(obj) {
|
|
47
|
+
const location = obj.location;
|
|
48
|
+
const type = _schemaRegistry().SchemaRegistry.fromObject(obj.type);
|
|
49
|
+
return new ParenthesizedTypeSchema(location, type);
|
|
50
|
+
}
|
|
33
51
|
}
|
|
34
52
|
exports.ParenthesizedTypeSchema = ParenthesizedTypeSchema;
|
|
53
|
+
|
|
35
54
|
//# sourceMappingURL=parenthesized-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","_schemaRegistry","ParenthesizedTypeSchema","SchemaNode","constructor","location","type","getNodes","toString","options","toFullSignature","toObject","fromObject","obj","SchemaRegistry","exports"],"sources":["parenthesized-type.ts"],"sourcesContent":["import { SchemaLocation, SchemaNode } from '../schema-node';\nimport { SchemaRegistry } from '../schema-registry';\n\n/**\n * type inside parentheses\n * e.g. (T1 | T2)\n */\nexport class ParenthesizedTypeSchema extends SchemaNode {\n readonly type: SchemaNode;\n constructor(\n readonly location: SchemaLocation,\n type: SchemaNode\n ) {\n super();\n this.type = type;\n }\n\n getNodes() {\n return [this.type];\n }\n\n toString(options?: { color?: boolean }): string {\n return `(${this.type.toString(options)})`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n return `(${this.type.toFullSignature(options)})`;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n type: this.type.toObject(),\n };\n }\n\n static fromObject(obj: Record<string, any>): ParenthesizedTypeSchema {\n const location = obj.location;\n const type = SchemaRegistry.fromObject(obj.type);\n return new ParenthesizedTypeSchema(location, type);\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;AAAA;AAEA;AACA;AACA;AACA;AACO,MAAMG,uBAAuB,SAASC,wBAAU,CAAC;EAEtDC,WAAWA,CACAC,QAAwB,EACjCC,IAAgB,EAChB;IACA,KAAK,CAAC,CAAC;IAAC,KAHCD,QAAwB,GAAxBA,QAAwB;IAIjC,IAAI,CAACC,IAAI,GAAGA,IAAI;EAClB;EAEAC,QAAQA,CAAA,EAAG;IACT,OAAO,CAAC,IAAI,CAACD,IAAI,CAAC;EACpB;EAEAE,QAAQA,CAACC,OAA6B,EAAU;IAC9C,OAAO,IAAI,IAAI,CAACH,IAAI,CAACE,QAAQ,CAACC,OAAO,CAAC,GAAG;EAC3C;EAEAC,eAAeA,CAACD,OAAgC,EAAU;IACxD,OAAO,IAAI,IAAI,CAACH,IAAI,CAACI,eAAe,CAACD,OAAO,CAAC,GAAG;EAClD;EAEAE,QAAQA,CAAA,EAAG;IACT,OAAO;MACL,GAAG,KAAK,CAACA,QAAQ,CAAC,CAAC;MACnBL,IAAI,EAAE,IAAI,CAACA,IAAI,CAACK,QAAQ,CAAC;IAC3B,CAAC;EACH;EAEA,OAAOC,UAAUA,CAACC,GAAwB,EAA2B;IACnE,MAAMR,QAAQ,GAAGQ,GAAG,CAACR,QAAQ;IAC7B,MAAMC,IAAI,GAAGQ,gCAAc,CAACF,UAAU,CAACC,GAAG,CAACP,IAAI,CAAC;IAChD,OAAO,IAAIJ,uBAAuB,CAACG,QAAQ,EAAEC,IAAI,CAAC;EACpD;AACF;AAACS,OAAA,CAAAb,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -4,8 +4,8 @@ export declare class PropertyAssignmentSchema extends SchemaNode {
|
|
|
4
4
|
readonly name: string;
|
|
5
5
|
readonly value: SchemaNode;
|
|
6
6
|
readonly location: SchemaLocation;
|
|
7
|
-
readonly doc?: DocSchema;
|
|
8
|
-
constructor(name: string, value: SchemaNode, location: SchemaLocation, doc?: DocSchema);
|
|
7
|
+
readonly doc?: DocSchema | undefined;
|
|
8
|
+
constructor(name: string, value: SchemaNode, location: SchemaLocation, doc?: DocSchema | undefined);
|
|
9
9
|
toString(options?: {
|
|
10
10
|
color?: boolean;
|
|
11
11
|
}): string;
|
|
@@ -17,20 +17,20 @@ export declare class PropertyAssignmentSchema extends SchemaNode {
|
|
|
17
17
|
value: Record<string, any>;
|
|
18
18
|
doc: {
|
|
19
19
|
__schema: string;
|
|
20
|
-
name: string;
|
|
20
|
+
name: string | undefined;
|
|
21
21
|
location: SchemaLocation;
|
|
22
|
-
signature: string;
|
|
22
|
+
signature: string | undefined;
|
|
23
23
|
raw: string;
|
|
24
|
-
comment: string;
|
|
24
|
+
comment: string | undefined;
|
|
25
25
|
tags: {
|
|
26
26
|
__schema: string;
|
|
27
27
|
location: SchemaLocation;
|
|
28
|
-
name: string;
|
|
29
|
-
signature: string;
|
|
28
|
+
name: string | undefined;
|
|
29
|
+
signature: string | undefined;
|
|
30
30
|
tagName: string;
|
|
31
|
-
comment: string;
|
|
32
|
-
}[];
|
|
33
|
-
};
|
|
31
|
+
comment: string | undefined;
|
|
32
|
+
}[] | undefined;
|
|
33
|
+
} | undefined;
|
|
34
34
|
location: SchemaLocation;
|
|
35
35
|
};
|
|
36
36
|
static fromObject(obj: Record<string, any>): PropertyAssignmentSchema;
|
|
@@ -1,40 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
3
6
|
exports.PropertyAssignmentSchema = 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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
function _docs() {
|
|
22
|
+
const data = require("./docs");
|
|
23
|
+
_docs = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
class PropertyAssignmentSchema extends _schemaNode().SchemaNode {
|
|
29
|
+
constructor(name, value, location, doc) {
|
|
30
|
+
super();
|
|
31
|
+
this.name = name;
|
|
32
|
+
this.value = value;
|
|
33
|
+
this.location = location;
|
|
34
|
+
this.doc = doc;
|
|
35
|
+
}
|
|
36
|
+
toString(options) {
|
|
37
|
+
return `${this.name}: ${this.value.toString(options)}`;
|
|
38
|
+
}
|
|
39
|
+
toFullSignature(options) {
|
|
40
|
+
let result = '';
|
|
41
|
+
if (options?.showDocs && this.doc) {
|
|
42
|
+
result += `${this.doc.toFullSignature()}\n`;
|
|
37
43
|
}
|
|
44
|
+
const valueStr = this.value.toFullSignature(options);
|
|
45
|
+
result += `${this.name}: ${valueStr}`;
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
toObject() {
|
|
49
|
+
return {
|
|
50
|
+
...super.toObject(),
|
|
51
|
+
name: this.name,
|
|
52
|
+
value: this.value.toObject(),
|
|
53
|
+
doc: this.doc?.toObject(),
|
|
54
|
+
location: this.location
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
static fromObject(obj) {
|
|
58
|
+
const name = obj.name;
|
|
59
|
+
const value = _schemaRegistry().SchemaRegistry.fromObject(obj.value);
|
|
60
|
+
const location = obj.location;
|
|
61
|
+
const doc = obj.doc ? _docs().DocSchema.fromObject(obj.doc) : undefined;
|
|
62
|
+
return new PropertyAssignmentSchema(name, value, location, doc);
|
|
63
|
+
}
|
|
38
64
|
}
|
|
39
65
|
exports.PropertyAssignmentSchema = PropertyAssignmentSchema;
|
|
66
|
+
|
|
40
67
|
//# sourceMappingURL=property-assignment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_schemaNode","data","require","_schemaRegistry","_docs","PropertyAssignmentSchema","SchemaNode","constructor","name","value","location","doc","toString","options","toFullSignature","result","showDocs","valueStr","toObject","fromObject","obj","SchemaRegistry","DocSchema","undefined","exports"],"sources":["property-assignment.ts"],"sourcesContent":["import { SchemaNode, SchemaLocation } from '../schema-node';\nimport { SchemaRegistry } from '../schema-registry';\nimport { DocSchema } from './docs';\n\nexport class PropertyAssignmentSchema extends SchemaNode {\n constructor(\n readonly name: string,\n readonly value: SchemaNode,\n readonly location: SchemaLocation,\n readonly doc?: DocSchema\n ) {\n super();\n }\n\n toString(options?: { color?: boolean }): string {\n return `${this.name}: ${this.value.toString(options)}`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n let result = '';\n\n if (options?.showDocs && this.doc) {\n result += `${this.doc.toFullSignature()}\\n`;\n }\n\n const valueStr = this.value.toFullSignature(options);\n\n result += `${this.name}: ${valueStr}`;\n\n return result;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n value: this.value.toObject(),\n doc: this.doc?.toObject(),\n location: this.location,\n };\n }\n\n static fromObject(obj: Record<string, any>): PropertyAssignmentSchema {\n const name = obj.name;\n const value = SchemaRegistry.fromObject(obj.value);\n const location = obj.location;\n const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;\n return new PropertyAssignmentSchema(name, value, location, doc);\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;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMI,wBAAwB,SAASC,wBAAU,CAAC;EACvDC,WAAWA,CACAC,IAAY,EACZC,KAAiB,EACjBC,QAAwB,EACxBC,GAAe,EACxB;IACA,KAAK,CAAC,CAAC;IAAC,KALCH,IAAY,GAAZA,IAAY;IAAA,KACZC,KAAiB,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AO,IAAIlB,wBAAwB,CAACG,IAAI,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,GAAG,CAAC;EACjE;AACF;AAACa,OAAA,CAAAnB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -18,8 +18,8 @@ export declare class SetAccessorSchema extends SchemaNode {
|
|
|
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
|
signature: string;
|
|
@@ -1,40 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
6
|
exports.SetAccessorSchema = 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
|
-
|
|
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 _parameter() {
|
|
22
|
+
const data = require("./parameter");
|
|
23
|
+
_parameter = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
+
class SetAccessorSchema extends _schemaNode().SchemaNode {
|
|
30
|
+
constructor(location, name, param, signature) {
|
|
31
|
+
super();
|
|
32
|
+
this.location = location;
|
|
33
|
+
this.name = name;
|
|
34
|
+
this.signature = signature;
|
|
35
|
+
this.param = param;
|
|
36
|
+
}
|
|
37
|
+
getSignature() {
|
|
38
|
+
return this.signature;
|
|
39
|
+
}
|
|
40
|
+
toString() {
|
|
41
|
+
return `set ${_chalk().default.bold(this.name)}(${this.param.toString()})`;
|
|
42
|
+
}
|
|
43
|
+
toFullSignature(options) {
|
|
44
|
+
const paramStr = this.param.toFullSignature(options);
|
|
45
|
+
return `set ${this.name}(${paramStr})`;
|
|
46
|
+
}
|
|
47
|
+
toObject() {
|
|
48
|
+
return {
|
|
49
|
+
...super.toObject(),
|
|
50
|
+
name: this.name,
|
|
51
|
+
param: this.param.toObject(),
|
|
52
|
+
signature: this.signature
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
static fromObject(obj) {
|
|
56
|
+
const location = obj.location;
|
|
57
|
+
const name = obj.name;
|
|
58
|
+
const param = _parameter().ParameterSchema.fromObject(obj.param);
|
|
59
|
+
const signature = obj.signature;
|
|
60
|
+
return new SetAccessorSchema(location, name, param, signature);
|
|
61
|
+
}
|
|
38
62
|
}
|
|
39
63
|
exports.SetAccessorSchema = SetAccessorSchema;
|
|
64
|
+
|
|
40
65
|
//# sourceMappingURL=set-accessor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_schemaNode","_parameter","e","__esModule","default","SetAccessorSchema","SchemaNode","constructor","location","name","param","signature","getSignature","toString","chalk","bold","toFullSignature","options","paramStr","toObject","fromObject","obj","ParameterSchema","exports"],"sources":["set-accessor.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { SchemaLocation, SchemaNode } from '../schema-node';\nimport { ParameterSchema } from './parameter';\n\nexport class SetAccessorSchema extends SchemaNode {\n readonly param: ParameterSchema;\n\n constructor(\n readonly location: SchemaLocation,\n readonly name: string,\n param: ParameterSchema,\n readonly signature: string\n ) {\n super();\n this.param = param;\n }\n\n getSignature() {\n return this.signature;\n }\n\n toString() {\n return `set ${chalk.bold(this.name)}(${this.param.toString()})`;\n }\n\n toFullSignature(options?: { showDocs?: boolean }): string {\n const paramStr = this.param.toFullSignature(options);\n return `set ${this.name}(${paramStr})`;\n }\n\n toObject() {\n return {\n ...super.toObject(),\n name: this.name,\n param: this.param.toObject(),\n signature: this.signature,\n };\n }\n\n static fromObject(obj: Record<string, any>): SetAccessorSchema {\n const location = obj.location;\n const name = obj.name;\n const param = ParameterSchema.fromObject(obj.param);\n const signature = obj.signature;\n return new SetAccessorSchema(location, name, param, signature);\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,WAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,U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