@teambit/semantics.entities.semantic-schema 0.0.69 → 0.0.71
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 +49 -1
- package/dist/api-schema.d.ts +7 -44
- package/dist/api-schema.js +36 -1
- package/dist/api-schema.js.map +1 -1
- package/dist/preview-1726715976656.js +7 -0
- package/dist/schema-node.d.ts +12 -2
- package/dist/schema-node.js.map +1 -1
- package/dist/schemas/array-literal-expression.d.ts +3 -0
- package/dist/schemas/array-literal-expression.js +4 -0
- package/dist/schemas/array-literal-expression.js.map +1 -1
- package/dist/schemas/class.d.ts +6 -1
- package/dist/schemas/class.js +41 -4
- package/dist/schemas/class.js.map +1 -1
- package/dist/schemas/conditional-type.d.ts +3 -0
- package/dist/schemas/conditional-type.js +7 -0
- package/dist/schemas/conditional-type.js.map +1 -1
- package/dist/schemas/decorator.d.ts +3 -0
- package/dist/schemas/decorator.js +10 -1
- package/dist/schemas/decorator.js.map +1 -1
- package/dist/schemas/docs/doc.d.ts +1 -0
- package/dist/schemas/docs/doc.js +15 -0
- package/dist/schemas/docs/doc.js.map +1 -1
- package/dist/schemas/docs/property-like-tag.d.ts +3 -0
- package/dist/schemas/docs/property-like-tag.js +5 -0
- package/dist/schemas/docs/property-like-tag.js.map +1 -1
- package/dist/schemas/docs/return-tag.d.ts +3 -0
- package/dist/schemas/docs/return-tag.js +5 -0
- package/dist/schemas/docs/return-tag.js.map +1 -1
- package/dist/schemas/docs/tag.d.ts +3 -1
- package/dist/schemas/docs/tag.js +4 -0
- package/dist/schemas/docs/tag.js.map +1 -1
- package/dist/schemas/enum-member.d.ts +3 -0
- package/dist/schemas/enum-member.js +13 -0
- package/dist/schemas/enum-member.js.map +1 -1
- package/dist/schemas/enum.d.ts +4 -1
- package/dist/schemas/enum.js +20 -3
- package/dist/schemas/enum.js.map +1 -1
- package/dist/schemas/export.d.ts +7 -1
- package/dist/schemas/export.js +31 -4
- package/dist/schemas/export.js.map +1 -1
- package/dist/schemas/expression-with-arguments.d.ts +3 -0
- package/dist/schemas/expression-with-arguments.js +8 -0
- package/dist/schemas/expression-with-arguments.js.map +1 -1
- package/dist/schemas/function-like.d.ts +6 -1
- package/dist/schemas/function-like.js +35 -2
- package/dist/schemas/function-like.js.map +1 -1
- package/dist/schemas/get-accessor.d.ts +6 -1
- package/dist/schemas/get-accessor.js +11 -2
- package/dist/schemas/get-accessor.js.map +1 -1
- package/dist/schemas/ignored.d.ts +1 -0
- package/dist/schemas/ignored.js +3 -0
- package/dist/schemas/ignored.js.map +1 -1
- package/dist/schemas/index-signature.d.ts +3 -0
- package/dist/schemas/index-signature.js +5 -0
- package/dist/schemas/index-signature.js.map +1 -1
- package/dist/schemas/indexed-access-type.d.ts +3 -0
- package/dist/schemas/indexed-access-type.js +5 -0
- package/dist/schemas/indexed-access-type.js.map +1 -1
- package/dist/schemas/inference-type.d.ts +4 -1
- package/dist/schemas/inference-type.js +16 -3
- package/dist/schemas/inference-type.js.map +1 -1
- package/dist/schemas/interface.d.ts +6 -1
- package/dist/schemas/interface.js +31 -3
- package/dist/schemas/interface.js.map +1 -1
- package/dist/schemas/keyword-type.d.ts +1 -0
- package/dist/schemas/keyword-type.js +3 -0
- package/dist/schemas/keyword-type.js.map +1 -1
- package/dist/schemas/literal-type.d.ts +1 -0
- package/dist/schemas/literal-type.js +3 -0
- package/dist/schemas/literal-type.js.map +1 -1
- package/dist/schemas/literal-value.d.ts +1 -0
- package/dist/schemas/literal-value.js +3 -0
- package/dist/schemas/literal-value.js.map +1 -1
- package/dist/schemas/module.d.ts +10 -27
- package/dist/schemas/module.js +15 -3
- package/dist/schemas/module.js.map +1 -1
- package/dist/schemas/named-tuple.d.ts +6 -1
- package/dist/schemas/named-tuple.js +5 -2
- package/dist/schemas/named-tuple.js.map +1 -1
- package/dist/schemas/object-literal-expression.d.ts +6 -1
- package/dist/schemas/object-literal-expression.js +9 -2
- package/dist/schemas/object-literal-expression.js.map +1 -1
- package/dist/schemas/parameter.d.ts +3 -0
- package/dist/schemas/parameter.js +31 -0
- package/dist/schemas/parameter.js.map +1 -1
- package/dist/schemas/parenthesized-type.d.ts +6 -1
- package/dist/schemas/parenthesized-type.js +5 -2
- package/dist/schemas/parenthesized-type.js.map +1 -1
- package/dist/schemas/property-assignment.d.ts +6 -1
- package/dist/schemas/property-assignment.js +11 -2
- package/dist/schemas/property-assignment.js.map +1 -1
- package/dist/schemas/set-accessor.d.ts +3 -0
- package/dist/schemas/set-accessor.js +4 -0
- package/dist/schemas/set-accessor.js.map +1 -1
- package/dist/schemas/template-literal-type-span.d.ts +6 -1
- package/dist/schemas/template-literal-type-span.js +5 -2
- package/dist/schemas/template-literal-type-span.js.map +1 -1
- package/dist/schemas/template-literal-type.d.ts +6 -1
- package/dist/schemas/template-literal-type.js +6 -2
- package/dist/schemas/template-literal-type.js.map +1 -1
- package/dist/schemas/this-type.d.ts +1 -0
- package/dist/schemas/this-type.js +3 -0
- package/dist/schemas/this-type.js.map +1 -1
- package/dist/schemas/tuple-type.d.ts +6 -1
- package/dist/schemas/tuple-type.js +5 -2
- package/dist/schemas/tuple-type.js.map +1 -1
- package/dist/schemas/type-array.d.ts +6 -1
- package/dist/schemas/type-array.js +5 -2
- package/dist/schemas/type-array.js.map +1 -1
- package/dist/schemas/type-intersection.d.ts +6 -1
- package/dist/schemas/type-intersection.js +5 -2
- package/dist/schemas/type-intersection.js.map +1 -1
- package/dist/schemas/type-literal.d.ts +3 -0
- package/dist/schemas/type-literal.js +14 -0
- package/dist/schemas/type-literal.js.map +1 -1
- package/dist/schemas/type-operator.d.ts +6 -1
- package/dist/schemas/type-operator.js +5 -2
- package/dist/schemas/type-operator.js.map +1 -1
- package/dist/schemas/type-predicate.d.ts +6 -1
- package/dist/schemas/type-predicate.js +12 -2
- package/dist/schemas/type-predicate.js.map +1 -1
- package/dist/schemas/type-query.d.ts +6 -1
- package/dist/schemas/type-query.js +5 -2
- package/dist/schemas/type-query.js.map +1 -1
- package/dist/schemas/type-ref.d.ts +6 -1
- package/dist/schemas/type-ref.js +19 -6
- package/dist/schemas/type-ref.js.map +1 -1
- package/dist/schemas/type-union.d.ts +6 -1
- package/dist/schemas/type-union.js +11 -2
- package/dist/schemas/type-union.js.map +1 -1
- package/dist/schemas/type.d.ts +6 -1
- package/dist/schemas/type.js +12 -2
- package/dist/schemas/type.js.map +1 -1
- package/dist/schemas/unimplemented-schema.d.ts +1 -0
- package/dist/schemas/unimplemented-schema.js +3 -0
- package/dist/schemas/unimplemented-schema.js.map +1 -1
- package/dist/schemas/unknown-schema.d.ts +1 -0
- package/dist/schemas/unknown-schema.js +3 -0
- package/dist/schemas/unknown-schema.js.map +1 -1
- package/dist/schemas/unresolved-schema.d.ts +1 -0
- package/dist/schemas/unresolved-schema.js +3 -0
- package/dist/schemas/unresolved-schema.js.map +1 -1
- package/dist/schemas/variable-like.d.ts +6 -1
- package/dist/schemas/variable-like.js +16 -2
- package/dist/schemas/variable-like.js.map +1 -1
- package/package.json +2 -2
- package/schema-node.ts +4 -2
- package/schemas/array-literal-expression.ts +5 -0
- package/schemas/class.ts +52 -4
- package/schemas/conditional-type.ts +9 -0
- package/schemas/decorator.ts +14 -1
- package/schemas/docs/doc.ts +20 -0
- package/schemas/docs/property-like-tag.ts +6 -0
- package/schemas/docs/return-tag.ts +6 -0
- package/schemas/docs/tag.ts +5 -0
- package/schemas/enum-member.ts +16 -0
- package/schemas/enum.ts +27 -3
- package/schemas/export.ts +42 -4
- package/schemas/expression-with-arguments.ts +11 -0
- package/schemas/function-like.ts +37 -4
- package/schemas/get-accessor.ts +15 -2
- package/schemas/ignored.ts +4 -0
- package/schemas/index-signature.ts +7 -0
- package/schemas/indexed-access-type.ts +7 -0
- package/schemas/inference-type.ts +21 -2
- package/schemas/interface.ts +41 -3
- package/schemas/keyword-type.ts +4 -0
- package/schemas/literal-type.ts +4 -0
- package/schemas/literal-value.ts +4 -0
- package/schemas/module.ts +25 -5
- package/schemas/named-tuple.ts +6 -2
- package/schemas/object-literal-expression.ts +11 -2
- package/schemas/parameter.ts +40 -0
- package/schemas/parenthesized-type.ts +6 -2
- package/schemas/property-assignment.ts +16 -2
- package/schemas/set-accessor.ts +5 -0
- package/schemas/template-literal-type-span.ts +6 -2
- package/schemas/template-literal-type.ts +7 -2
- package/schemas/this-type.ts +4 -0
- package/schemas/tuple-type.ts +6 -2
- package/schemas/type-array.ts +6 -2
- package/schemas/type-intersection.ts +6 -2
- package/schemas/type-literal.ts +22 -0
- package/schemas/type-operator.ts +6 -2
- package/schemas/type-predicate.ts +15 -2
- package/schemas/type-query.ts +6 -2
- package/schemas/type-ref.ts +23 -6
- package/schemas/type-union.ts +13 -2
- package/schemas/type.ts +16 -2
- package/schemas/unimplemented-schema.ts +4 -0
- package/schemas/unknown-schema.ts +4 -0
- package/schemas/unresolved-schema.ts +4 -0
- package/schemas/variable-like.ts +20 -2
- package/dist/preview-1714472366682.js +0 -7
- package/dist/tsconfig.json +0 -36
- package/tsconfig.json +0 -36
|
@@ -13,11 +13,16 @@ export class TemplateLiteralTypeSchema extends SchemaNode {
|
|
|
13
13
|
this.templateSpans = templateSpans;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
toString() {
|
|
17
|
-
const spans = this.templateSpans.map((span) => span.toString()).join('');
|
|
16
|
+
toString(options?: { color?: boolean }) {
|
|
17
|
+
const spans = this.templateSpans.map((span) => span.toString(options)).join('');
|
|
18
18
|
return `${this.head}${spans}`;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
22
|
+
const spans = this.templateSpans.map((span) => span.toFullSignature(options)).join('');
|
|
23
|
+
return `\`${this.head}${spans}\``;
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
toObject() {
|
|
22
27
|
return {
|
|
23
28
|
...super.toObject(),
|
package/schemas/this-type.ts
CHANGED
|
@@ -12,6 +12,10 @@ export class ThisTypeSchema extends SchemaNode {
|
|
|
12
12
|
return this.name;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
toFullSignature() {
|
|
16
|
+
return this.toString();
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
static fromObject(obj: Record<string, any>): ThisTypeSchema {
|
|
16
20
|
const location = obj.location;
|
|
17
21
|
const name = obj.name;
|
package/schemas/tuple-type.ts
CHANGED
|
@@ -9,8 +9,12 @@ export class TupleTypeSchema extends SchemaNode {
|
|
|
9
9
|
this.elements = elements;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
toString() {
|
|
13
|
-
return `[${this.elements.map((elem) => elem.toString()).join(', ')}]`;
|
|
12
|
+
toString(options?: { color?: boolean }) {
|
|
13
|
+
return `[${this.elements.map((elem) => elem.toString(options)).join(', ')}]`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
17
|
+
return `[${this.elements.map((elem) => elem.toFullSignature(options)).join(', ')}]`;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
toObject() {
|
package/schemas/type-array.ts
CHANGED
|
@@ -13,8 +13,12 @@ export class TypeArraySchema extends SchemaNode {
|
|
|
13
13
|
return [this.type];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
toString() {
|
|
17
|
-
return `${this.type.toString()}[]`;
|
|
16
|
+
toString(options?: { color?: boolean }) {
|
|
17
|
+
return `${this.type.toString(options)}[]`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
21
|
+
return `${this.type.toFullSignature(options)}[]`;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
toObject() {
|
|
@@ -13,8 +13,12 @@ export class TypeIntersectionSchema extends SchemaNode {
|
|
|
13
13
|
return this.types;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
toString() {
|
|
17
|
-
return `${this.types.map((type) => type.toString()).join(' & ')}`;
|
|
16
|
+
toString(options?: { color?: boolean }) {
|
|
17
|
+
return `${this.types.map((type) => type.toString(options)).join(' & ')}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
21
|
+
return this.types.map((type) => type.toFullSignature(options)).join(' & ');
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
toObject() {
|
package/schemas/type-literal.ts
CHANGED
|
@@ -20,6 +20,28 @@ export class TypeLiteralSchema extends SchemaNode {
|
|
|
20
20
|
return `{ ${this.members.map((type) => type.toString()).join('; ')} }`;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
24
|
+
const indent = (level: number) => ' '.repeat(level);
|
|
25
|
+
const level = 0;
|
|
26
|
+
let signature = '';
|
|
27
|
+
|
|
28
|
+
signature += '{\n';
|
|
29
|
+
|
|
30
|
+
this.members.forEach((member) => {
|
|
31
|
+
const memberSignature = member.toFullSignature(options);
|
|
32
|
+
|
|
33
|
+
const memberLines = memberSignature.split('\n');
|
|
34
|
+
|
|
35
|
+
const indentedLines = memberLines.map((line) => indent(level + 1) + line);
|
|
36
|
+
|
|
37
|
+
signature += indentedLines.join('\n') + '\n';
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
signature += indent(level) + '}';
|
|
41
|
+
|
|
42
|
+
return signature;
|
|
43
|
+
}
|
|
44
|
+
|
|
23
45
|
toObject() {
|
|
24
46
|
return {
|
|
25
47
|
...super.toObject(),
|
package/schemas/type-operator.ts
CHANGED
|
@@ -12,8 +12,12 @@ export class TypeOperatorSchema extends SchemaNode {
|
|
|
12
12
|
return [this.type];
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
toString() {
|
|
16
|
-
return `${this.name} ${this.type.toString()}`;
|
|
15
|
+
toString(options?: { color?: boolean }) {
|
|
16
|
+
return `${this.name} ${this.type.toString(options)}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
20
|
+
return `${this.name} ${this.type.toFullSignature(options)}`;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
toObject() {
|
|
@@ -26,12 +26,25 @@ export class TypePredicateSchema extends SchemaNode {
|
|
|
26
26
|
this.type = type;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
toString() {
|
|
29
|
+
toString(options?: { color?: boolean }) {
|
|
30
30
|
const assertsKeyword = this.hasAssertsModifier ? 'asserts ' : '';
|
|
31
|
-
const typeStr = this.type ? ` is ${this.type.toString()}` : '';
|
|
31
|
+
const typeStr = this.type ? ` is ${this.type.toString(options)}` : '';
|
|
32
32
|
return assertsKeyword + this.name + typeStr;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
36
|
+
const assertsKeyword = this.hasAssertsModifier ? 'asserts ' : '';
|
|
37
|
+
const typeSignature = this.type ? ` is ${this.type.toFullSignature(options)}` : '';
|
|
38
|
+
let signature = `${assertsKeyword}${this.name}${typeSignature}`;
|
|
39
|
+
|
|
40
|
+
if (options?.showDocs && this.doc) {
|
|
41
|
+
const docString = this.doc.toFullSignature();
|
|
42
|
+
signature = `${docString}\n${signature}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return signature;
|
|
46
|
+
}
|
|
47
|
+
|
|
35
48
|
toObject() {
|
|
36
49
|
return {
|
|
37
50
|
...super.toObject(),
|
package/schemas/type-query.ts
CHANGED
|
@@ -20,8 +20,12 @@ export class TypeQuerySchema extends SchemaNode {
|
|
|
20
20
|
return this.signature;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
toString() {
|
|
24
|
-
return `typeof ${this.type.toString()}`;
|
|
23
|
+
toString(options?: { color?: boolean }) {
|
|
24
|
+
return `typeof ${this.type.toString(options)}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
28
|
+
return `typeof ${this.type.toFullSignature(options)}`;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
toObject() {
|
package/schemas/type-ref.ts
CHANGED
|
@@ -52,27 +52,44 @@ export class TypeRefSchema extends SchemaNode {
|
|
|
52
52
|
return this;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
toString() {
|
|
56
|
-
const name = this.nameToString();
|
|
55
|
+
toString(options?: { color?: boolean }) {
|
|
56
|
+
const name = this.nameToString(options);
|
|
57
57
|
if (!this.typeArgs) {
|
|
58
58
|
return name;
|
|
59
59
|
}
|
|
60
|
-
const args = this.typeArgs.map((arg) => arg.toString()).join(', ');
|
|
60
|
+
const args = this.typeArgs.map((arg) => arg.toString(options)).join(', ');
|
|
61
61
|
return `${name}<${args}>`;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
private nameToString() {
|
|
64
|
+
private nameToString(options?: { color?: boolean }) {
|
|
65
|
+
const dim = options?.color ? chalk.dim : (str: string) => str;
|
|
65
66
|
if (this.componentId) {
|
|
66
|
-
const compStr =
|
|
67
|
+
const compStr = dim(`(component: ${this.componentId.toStringWithoutVersion()})`);
|
|
67
68
|
return `${compStr} ${this.name}`;
|
|
68
69
|
}
|
|
69
70
|
if (this.packageName) {
|
|
70
|
-
const pkgStr =
|
|
71
|
+
const pkgStr = dim(`(package: ${this.packageName})`);
|
|
71
72
|
return `${pkgStr} ${this.name}`;
|
|
72
73
|
}
|
|
73
74
|
return this.name;
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
78
|
+
let signature = this.name;
|
|
79
|
+
|
|
80
|
+
if (this.typeArgs && this.typeArgs.length > 0) {
|
|
81
|
+
const argsSignatures = this.typeArgs.map((arg) => arg.toFullSignature(options)).join(', ');
|
|
82
|
+
signature += `<${argsSignatures}>`;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (options?.showDocs && this.doc) {
|
|
86
|
+
const docString = this.doc.toFullSignature();
|
|
87
|
+
signature = `${docString}\n${signature}`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return signature;
|
|
91
|
+
}
|
|
92
|
+
|
|
76
93
|
/**
|
|
77
94
|
* whether this type was already exported in this component
|
|
78
95
|
*/
|
package/schemas/type-union.ts
CHANGED
|
@@ -7,8 +7,19 @@ export class TypeUnionSchema extends SchemaNode {
|
|
|
7
7
|
super();
|
|
8
8
|
this.types = types;
|
|
9
9
|
}
|
|
10
|
-
toString() {
|
|
11
|
-
return `${this.types.map((type) => type.toString()).join(' | ')}`;
|
|
10
|
+
toString(options?: { color?: boolean }) {
|
|
11
|
+
return `${this.types.map((type) => type.toString(options)).join(' | ')}`;
|
|
12
|
+
}
|
|
13
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
14
|
+
const typeSignatures = this.types.map((type) => type.toFullSignature(options));
|
|
15
|
+
let signature = typeSignatures.join(' | ');
|
|
16
|
+
|
|
17
|
+
if (options?.showDocs && this.doc) {
|
|
18
|
+
const docString = this.doc.toFullSignature();
|
|
19
|
+
signature = `${docString}\n${signature}`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return signature;
|
|
12
23
|
}
|
|
13
24
|
getNodes() {
|
|
14
25
|
return this.types;
|
package/schemas/type.ts
CHANGED
|
@@ -19,8 +19,22 @@ export class TypeSchema extends SchemaNode {
|
|
|
19
19
|
this.doc = doc;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
toString() {
|
|
23
|
-
|
|
22
|
+
toString(options?: { color?: boolean }) {
|
|
23
|
+
const bold = options?.color ? chalk.bold : (str: string) => str;
|
|
24
|
+
return `${bold(this.name)}: ${this.type.toString(options)}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
28
|
+
const typeSignature = this.type.toFullSignature(options);
|
|
29
|
+
|
|
30
|
+
let signature = `${this.name}: ${typeSignature}`;
|
|
31
|
+
|
|
32
|
+
if (options?.showDocs && this.doc) {
|
|
33
|
+
const docString = this.doc.toFullSignature();
|
|
34
|
+
signature = `${docString}\n${signature}`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return signature;
|
|
24
38
|
}
|
|
25
39
|
|
|
26
40
|
getNodes() {
|
|
@@ -9,6 +9,10 @@ export class UnImplementedSchema extends SchemaNode {
|
|
|
9
9
|
return `<<unimplemented schema ${this.name} of type ${this.type}>>`;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
toFullSignature(): string {
|
|
13
|
+
return `<<unimplemented schema ${this.name} of type ${this.type}>>`;
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
toObject() {
|
|
13
17
|
return {
|
|
14
18
|
...super.toObject(),
|
package/schemas/variable-like.ts
CHANGED
|
@@ -28,8 +28,26 @@ export class VariableLikeSchema extends SchemaNode {
|
|
|
28
28
|
return [this.type];
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
toString() {
|
|
32
|
-
|
|
31
|
+
toString(options?: { color?: boolean }) {
|
|
32
|
+
const bold = options?.color ? chalk.bold : (str: string) => str;
|
|
33
|
+
return `${bold(this.name)}${this.isOptional ? '?' : ''}: ${this.type.toString(options)}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
toFullSignature(options?: { showDocs?: boolean }): string {
|
|
37
|
+
const namePart = `${this.name}${this.isOptional ? '?' : ''}`;
|
|
38
|
+
const typeSignature = this.type.toFullSignature(options);
|
|
39
|
+
let signature = `${namePart}: ${typeSignature}`;
|
|
40
|
+
|
|
41
|
+
if (this.defaultValue !== undefined) {
|
|
42
|
+
signature += ` = ${this.defaultValue}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (options?.showDocs && this.doc) {
|
|
46
|
+
const docString = this.doc.toFullSignature();
|
|
47
|
+
signature = `${docString}\n${signature}`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return signature;
|
|
33
51
|
}
|
|
34
52
|
|
|
35
53
|
toObject() {
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
;
|
|
2
|
-
import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/b5ea46ec3/teambit.semantics_entities_semantic-schema@0.0.69/dist/semantic-schema.docs.md';
|
|
3
|
-
|
|
4
|
-
export const compositions = [];
|
|
5
|
-
export const overview = [overview_0];
|
|
6
|
-
|
|
7
|
-
export const compositions_metadata = {"compositions":[]};
|
package/dist/tsconfig.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"lib": [
|
|
4
|
-
"es2019",
|
|
5
|
-
"DOM",
|
|
6
|
-
"ES6",
|
|
7
|
-
"DOM.Iterable"
|
|
8
|
-
],
|
|
9
|
-
"target": "es2015",
|
|
10
|
-
"module": "CommonJS",
|
|
11
|
-
"jsx": "react",
|
|
12
|
-
"allowJs": true,
|
|
13
|
-
"composite": true,
|
|
14
|
-
"declaration": true,
|
|
15
|
-
"sourceMap": true,
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"experimentalDecorators": true,
|
|
18
|
-
"outDir": "dist",
|
|
19
|
-
"moduleResolution": "node",
|
|
20
|
-
"esModuleInterop": true,
|
|
21
|
-
"rootDir": ".",
|
|
22
|
-
"resolveJsonModule": true
|
|
23
|
-
},
|
|
24
|
-
"exclude": [
|
|
25
|
-
"artifacts",
|
|
26
|
-
"public",
|
|
27
|
-
"dist",
|
|
28
|
-
"node_modules",
|
|
29
|
-
"package.json",
|
|
30
|
-
"**/*.cjs"
|
|
31
|
-
],
|
|
32
|
-
"include": [
|
|
33
|
-
"**/*",
|
|
34
|
-
"**/*.json"
|
|
35
|
-
]
|
|
36
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"lib": [
|
|
4
|
-
"es2019",
|
|
5
|
-
"DOM",
|
|
6
|
-
"ES6",
|
|
7
|
-
"DOM.Iterable"
|
|
8
|
-
],
|
|
9
|
-
"target": "es2015",
|
|
10
|
-
"module": "CommonJS",
|
|
11
|
-
"jsx": "react",
|
|
12
|
-
"allowJs": true,
|
|
13
|
-
"composite": true,
|
|
14
|
-
"declaration": true,
|
|
15
|
-
"sourceMap": true,
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"experimentalDecorators": true,
|
|
18
|
-
"outDir": "dist",
|
|
19
|
-
"moduleResolution": "node",
|
|
20
|
-
"esModuleInterop": true,
|
|
21
|
-
"rootDir": ".",
|
|
22
|
-
"resolveJsonModule": true
|
|
23
|
-
},
|
|
24
|
-
"exclude": [
|
|
25
|
-
"artifacts",
|
|
26
|
-
"public",
|
|
27
|
-
"dist",
|
|
28
|
-
"node_modules",
|
|
29
|
-
"package.json",
|
|
30
|
-
"**/*.cjs"
|
|
31
|
-
],
|
|
32
|
-
"include": [
|
|
33
|
-
"**/*",
|
|
34
|
-
"**/*.json"
|
|
35
|
-
]
|
|
36
|
-
}
|