@teambit/semantics.entities.semantic-schema 0.0.66 → 0.0.68
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 +2 -4
- package/dist/api-schema.js +2 -4
- package/dist/api-schema.js.map +1 -1
- package/dist/preview-1708958940676.js +7 -0
- package/dist/schemas/array-literal-expression.d.ts +12 -0
- package/dist/schemas/array-literal-expression.js +24 -0
- package/dist/schemas/array-literal-expression.js.map +1 -0
- package/dist/schemas/class.d.ts +4 -1
- package/dist/schemas/class.js +13 -6
- package/dist/schemas/class.js.map +1 -1
- package/dist/schemas/decorator.d.ts +32 -0
- package/dist/schemas/decorator.js +37 -0
- package/dist/schemas/decorator.js.map +1 -0
- package/dist/schemas/function-like.d.ts +4 -2
- package/dist/schemas/function-like.js +14 -10
- package/dist/schemas/function-like.js.map +1 -1
- package/dist/schemas/ignored.d.ts +16 -0
- package/dist/schemas/ignored.js +32 -0
- package/dist/schemas/ignored.js.map +1 -0
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/index.js +13 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/literal-value.d.ts +11 -0
- package/dist/schemas/literal-value.js +25 -0
- package/dist/schemas/literal-value.js.map +1 -0
- package/dist/schemas/object-literal-expression.d.ts +13 -0
- package/dist/schemas/object-literal-expression.js +28 -0
- package/dist/schemas/object-literal-expression.js.map +1 -0
- package/dist/schemas/property-assignment.d.ts +32 -0
- package/dist/schemas/property-assignment.js +31 -0
- package/dist/schemas/property-assignment.js.map +1 -0
- package/package.json +2 -2
- package/schemas/array-literal-expression.ts +25 -0
- package/schemas/class.ts +31 -3
- package/schemas/decorator.ts +41 -0
- package/schemas/function-like.ts +17 -7
- package/schemas/ignored.ts +39 -0
- package/schemas/index.ts +6 -0
- package/schemas/literal-value.ts +25 -0
- package/schemas/object-literal-expression.ts +30 -0
- package/schemas/property-assignment.ts +36 -0
- package/dist/preview-1704778620686.js +0 -7
package/api-schema.ts
CHANGED
|
@@ -35,10 +35,8 @@ export class APISchema extends SchemaNode {
|
|
|
35
35
|
this.module = module;
|
|
36
36
|
this.internals = internals;
|
|
37
37
|
this.componentId = componentId;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.taggedModuleExports = this.taggedModuleExports.concat(taggedModuleExports);
|
|
41
|
-
}
|
|
38
|
+
taggedModuleExports = (taggedModuleExports.length && taggedModuleExports) || this.listTaggedExports(module);
|
|
39
|
+
this.taggedModuleExports = taggedModuleExports;
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
listTaggedExports(module?: ModuleSchema) {
|
package/dist/api-schema.js
CHANGED
|
@@ -17,10 +17,8 @@ class APISchema extends schema_node_1.SchemaNode {
|
|
|
17
17
|
this.module = module;
|
|
18
18
|
this.internals = internals;
|
|
19
19
|
this.componentId = componentId;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.taggedModuleExports = this.taggedModuleExports.concat(taggedModuleExports);
|
|
23
|
-
}
|
|
20
|
+
taggedModuleExports = (taggedModuleExports.length && taggedModuleExports) || this.listTaggedExports(module);
|
|
21
|
+
this.taggedModuleExports = taggedModuleExports;
|
|
24
22
|
}
|
|
25
23
|
listTaggedExports(module) {
|
|
26
24
|
if (!module)
|
package/dist/api-schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-schema.js","sourceRoot":"","sources":["../api-schema.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,wDAAoD;AACpD,uCAUmB;AACnB,+CAA2D;AAC3D,4CAA6C;AAC7C,uDAAmD;AAEnD,MAAa,SAAU,SAAQ,wBAAU;IASvC,YACW,QAAwB,EACjC,MAAoB,EACpB,SAAyB,EACzB,WAAwB,EACxB,sBAAoC,EAAE;QAEtC,KAAK,EAAE,CAAC;QANC,aAAQ,GAAR,QAAQ,CAAgB;QAOjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC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EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EACjE,EAAE,EACF,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AA7FD,8BA6FC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
;
|
|
2
|
+
import * as overview_0 from '/Users/giladshoham/Library/Caches/Bit/capsules/root/95c2f3515392701f327019ce43202e7563a02128/teambit.semantics_entities_semantic-schema@0.0.68/dist/semantic-schema.docs.md';
|
|
3
|
+
|
|
4
|
+
export const compositions = [];
|
|
5
|
+
export const overview = [overview_0];
|
|
6
|
+
|
|
7
|
+
export const compositions_metadata = {"compositions":[]};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
2
|
+
export declare class ArrayLiteralExpressionSchema extends SchemaNode {
|
|
3
|
+
readonly members: SchemaNode[];
|
|
4
|
+
readonly location: SchemaLocation;
|
|
5
|
+
constructor(members: SchemaNode[], location: SchemaLocation);
|
|
6
|
+
toObject(): {
|
|
7
|
+
members: Record<string, any>[];
|
|
8
|
+
location: SchemaLocation;
|
|
9
|
+
};
|
|
10
|
+
static fromObject(obj: Record<string, any>): ArrayLiteralExpressionSchema;
|
|
11
|
+
toString(): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayLiteralExpressionSchema = void 0;
|
|
4
|
+
const schema_node_1 = require("../schema-node");
|
|
5
|
+
const schema_registry_1 = require("../schema-registry");
|
|
6
|
+
class ArrayLiteralExpressionSchema extends schema_node_1.SchemaNode {
|
|
7
|
+
constructor(members, location) {
|
|
8
|
+
super();
|
|
9
|
+
this.members = members;
|
|
10
|
+
this.location = location;
|
|
11
|
+
}
|
|
12
|
+
toObject() {
|
|
13
|
+
return Object.assign(Object.assign({}, super.toObject()), { members: this.members.map((member) => member.toObject()), location: this.location });
|
|
14
|
+
}
|
|
15
|
+
static fromObject(obj) {
|
|
16
|
+
const members = obj.members.map((member) => schema_registry_1.SchemaRegistry.fromObject(member));
|
|
17
|
+
return new ArrayLiteralExpressionSchema(members, obj.location);
|
|
18
|
+
}
|
|
19
|
+
toString() {
|
|
20
|
+
return `[${this.members.join(', ')}]`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ArrayLiteralExpressionSchema = ArrayLiteralExpressionSchema;
|
|
24
|
+
//# sourceMappingURL=array-literal-expression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-literal-expression.js","sourceRoot":"","sources":["../../schemas/array-literal-expression.ts"],"names":[],"mappings":";;;AAAA,gDAA4D;AAC5D,wDAAoD;AAEpD,MAAa,4BAA6B,SAAQ,wBAAU;IAC1D,YAAqB,OAAqB,EAAW,QAAwB;QAC3E,KAAK,EAAE,CAAC;QADW,YAAO,GAAP,OAAO,CAAc;QAAW,aAAQ,GAAR,QAAQ,CAAgB;IAE7E,CAAC;IAED,QAAQ;QACN,uCACK,KAAK,CAAC,QAAQ,EAAE,KACnB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EACxD,QAAQ,EAAE,IAAI,CAAC,QAAQ,IACvB;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAwB;QACxC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,gCAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/E,OAAO,IAAI,4BAA4B,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACxC,CAAC;CACF;AArBD,oEAqBC"}
|
package/dist/schemas/class.d.ts
CHANGED
|
@@ -8,9 +8,10 @@ export declare class ClassSchema extends SchemaNode {
|
|
|
8
8
|
readonly typeParams?: string[];
|
|
9
9
|
readonly extendsNodes?: ExpressionWithTypeArgumentsSchema[];
|
|
10
10
|
readonly implementNodes?: ExpressionWithTypeArgumentsSchema[];
|
|
11
|
+
readonly decorators?: SchemaNode[];
|
|
11
12
|
readonly members: SchemaNode[];
|
|
12
13
|
readonly doc?: DocSchema;
|
|
13
|
-
constructor(name: string, members: SchemaNode[], location: SchemaLocation, signature: string, doc?: DocSchema, typeParams?: string[], extendsNodes?: ExpressionWithTypeArgumentsSchema[], implementNodes?: ExpressionWithTypeArgumentsSchema[]);
|
|
14
|
+
constructor(name: string, members: SchemaNode[], location: SchemaLocation, signature: string, doc?: DocSchema, typeParams?: string[], extendsNodes?: ExpressionWithTypeArgumentsSchema[], implementNodes?: ExpressionWithTypeArgumentsSchema[], decorators?: SchemaNode[]);
|
|
14
15
|
getNodes(): SchemaNode[];
|
|
15
16
|
toString(): string;
|
|
16
17
|
toObject(): {
|
|
@@ -46,6 +47,8 @@ export declare class ClassSchema extends SchemaNode {
|
|
|
46
47
|
typeArgs: Record<string, any>[];
|
|
47
48
|
expression: SchemaNode;
|
|
48
49
|
}[];
|
|
50
|
+
decorators: Record<string, any>[];
|
|
49
51
|
};
|
|
50
52
|
static fromObject(obj: Record<string, any>): ClassSchema;
|
|
53
|
+
static fromSchema(node: ClassSchema, memberTransformer?: (_node: SchemaNode) => SchemaNode): ClassSchema;
|
|
51
54
|
}
|
package/dist/schemas/class.js
CHANGED
|
@@ -10,7 +10,7 @@ const docs_1 = require("./docs");
|
|
|
10
10
|
const expression_with_arguments_1 = require("./expression-with-arguments");
|
|
11
11
|
const schema_registry_1 = require("../schema-registry");
|
|
12
12
|
class ClassSchema extends schema_node_1.SchemaNode {
|
|
13
|
-
constructor(name, members, location, signature, doc, typeParams, extendsNodes, implementNodes) {
|
|
13
|
+
constructor(name, members, location, signature, doc, typeParams, extendsNodes, implementNodes, decorators) {
|
|
14
14
|
super();
|
|
15
15
|
this.name = name;
|
|
16
16
|
this.location = location;
|
|
@@ -18,6 +18,7 @@ class ClassSchema extends schema_node_1.SchemaNode {
|
|
|
18
18
|
this.typeParams = typeParams;
|
|
19
19
|
this.extendsNodes = extendsNodes;
|
|
20
20
|
this.implementNodes = implementNodes;
|
|
21
|
+
this.decorators = decorators;
|
|
21
22
|
this.members = members;
|
|
22
23
|
this.doc = doc;
|
|
23
24
|
}
|
|
@@ -25,15 +26,17 @@ class ClassSchema extends schema_node_1.SchemaNode {
|
|
|
25
26
|
return this.members;
|
|
26
27
|
}
|
|
27
28
|
toString() {
|
|
29
|
+
var _a;
|
|
28
30
|
const membersStr = this.members.map((m) => `* ${m.toString()}`).join('\n');
|
|
29
|
-
|
|
31
|
+
const decoratorsStr = (_a = this.decorators) === null || _a === void 0 ? void 0 : _a.map((decorator) => decorator.toString()).join('\n');
|
|
32
|
+
return `${this.decorators ? `${decoratorsStr}\n` : ''}${chalk_1.default.bold.underline(this.name)}\n${membersStr}`;
|
|
30
33
|
}
|
|
31
34
|
toObject() {
|
|
32
|
-
var _a, _b, _c;
|
|
33
|
-
return Object.assign(Object.assign({}, super.toObject()), { name: this.name, members: this.members.map((member) => member.toObject()), doc: (_a = this.doc) === null || _a === void 0 ? void 0 : _a.toObject(), signature: this.signature, typeParams: this.typeParams, extendsNodes: (_b = this.extendsNodes) === null || _b === void 0 ? void 0 : _b.map((node) => node.toObject()), implementNodes: (_c = this.implementNodes) === null || _c === void 0 ? void 0 : _c.map((node) => node.toObject()) });
|
|
35
|
+
var _a, _b, _c, _d;
|
|
36
|
+
return Object.assign(Object.assign({}, super.toObject()), { name: this.name, members: this.members.map((member) => member.toObject()), doc: (_a = this.doc) === null || _a === void 0 ? void 0 : _a.toObject(), signature: this.signature, typeParams: this.typeParams, extendsNodes: (_b = this.extendsNodes) === null || _b === void 0 ? void 0 : _b.map((node) => node.toObject()), implementNodes: (_c = this.implementNodes) === null || _c === void 0 ? void 0 : _c.map((node) => node.toObject()), decorators: (_d = this.decorators) === null || _d === void 0 ? void 0 : _d.map((decorator) => decorator.toObject()) });
|
|
34
37
|
}
|
|
35
38
|
static fromObject(obj) {
|
|
36
|
-
var _a, _b;
|
|
39
|
+
var _a, _b, _c;
|
|
37
40
|
const name = obj.name;
|
|
38
41
|
const members = obj.members.map((member) => schema_registry_1.SchemaRegistry.fromObject(member));
|
|
39
42
|
const location = obj.location;
|
|
@@ -42,7 +45,11 @@ class ClassSchema extends schema_node_1.SchemaNode {
|
|
|
42
45
|
const typeParams = obj.typeParams;
|
|
43
46
|
const extendsNodes = (_a = obj.extendsNodes) === null || _a === void 0 ? void 0 : _a.map((node) => expression_with_arguments_1.ExpressionWithTypeArgumentsSchema.fromObject(node));
|
|
44
47
|
const implementNodes = (_b = obj.implementNodes) === null || _b === void 0 ? void 0 : _b.map((node) => expression_with_arguments_1.ExpressionWithTypeArgumentsSchema.fromObject(node));
|
|
45
|
-
|
|
48
|
+
const decorators = (_c = obj.decorators) === null || _c === void 0 ? void 0 : _c.map((decorator) => schema_registry_1.SchemaRegistry.fromObject(decorator));
|
|
49
|
+
return new ClassSchema(name, members, location, signature, doc, typeParams, extendsNodes, implementNodes, decorators);
|
|
50
|
+
}
|
|
51
|
+
static fromSchema(node, memberTransformer = (_node) => _node) {
|
|
52
|
+
return new ClassSchema(node.name, node.members.map(memberTransformer), node.location, node.signature, node.doc, node.typeParams, node.extendsNodes, node.implementNodes, node.decorators);
|
|
46
53
|
}
|
|
47
54
|
}
|
|
48
55
|
exports.ClassSchema = ClassSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../schemas/class.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAA4D;AAC5D,iCAAmC;AACnC,2EAAgF;AAChF,wDAAoD;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../schema-node';
|
|
2
|
+
import { DocSchema } from './docs';
|
|
3
|
+
export declare class DecoratorSchema extends SchemaNode {
|
|
4
|
+
readonly location: SchemaLocation;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly doc?: DocSchema;
|
|
7
|
+
readonly args?: SchemaNode[];
|
|
8
|
+
constructor(location: SchemaLocation, name: string, doc?: DocSchema, args?: SchemaNode[]);
|
|
9
|
+
getNodes(): SchemaNode[];
|
|
10
|
+
toString(): string;
|
|
11
|
+
toObject(): {
|
|
12
|
+
name: string;
|
|
13
|
+
doc: {
|
|
14
|
+
__schema: string;
|
|
15
|
+
name: string;
|
|
16
|
+
location: SchemaLocation;
|
|
17
|
+
signature: string;
|
|
18
|
+
raw: string;
|
|
19
|
+
comment: string;
|
|
20
|
+
tags: {
|
|
21
|
+
__schema: string;
|
|
22
|
+
location: SchemaLocation;
|
|
23
|
+
name: string;
|
|
24
|
+
signature: string;
|
|
25
|
+
tagName: string;
|
|
26
|
+
comment: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
args: Record<string, any>[];
|
|
30
|
+
};
|
|
31
|
+
static fromObject(obj: Record<string, any>): DecoratorSchema;
|
|
32
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DecoratorSchema = void 0;
|
|
4
|
+
const schema_node_1 = require("../schema-node");
|
|
5
|
+
const schema_registry_1 = require("../schema-registry");
|
|
6
|
+
const docs_1 = require("./docs");
|
|
7
|
+
class DecoratorSchema extends schema_node_1.SchemaNode {
|
|
8
|
+
constructor(location, name, doc, args) {
|
|
9
|
+
super();
|
|
10
|
+
this.location = location;
|
|
11
|
+
this.name = name;
|
|
12
|
+
this.doc = doc;
|
|
13
|
+
this.args = args;
|
|
14
|
+
}
|
|
15
|
+
getNodes() {
|
|
16
|
+
return this.args || [];
|
|
17
|
+
}
|
|
18
|
+
toString() {
|
|
19
|
+
var _a;
|
|
20
|
+
// name and args
|
|
21
|
+
const argsStr = (_a = this.args) === null || _a === void 0 ? void 0 : _a.map((arg) => arg.toString()).join(', ');
|
|
22
|
+
return `@${this.name}${argsStr ? `(${argsStr})` : ''}`;
|
|
23
|
+
}
|
|
24
|
+
toObject() {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
return Object.assign(Object.assign({}, super.toObject()), { name: this.name, doc: (_a = this.doc) === null || _a === void 0 ? void 0 : _a.toObject(), args: (_b = this.args) === null || _b === void 0 ? void 0 : _b.map((arg) => arg.toObject()) });
|
|
27
|
+
}
|
|
28
|
+
static fromObject(obj) {
|
|
29
|
+
const location = obj.location;
|
|
30
|
+
const name = obj.name;
|
|
31
|
+
const doc = obj.doc ? docs_1.DocSchema.fromObject(obj.doc) : undefined;
|
|
32
|
+
const args = obj.args ? obj.args.map((arg) => schema_registry_1.SchemaRegistry.fromObject(arg)) : undefined;
|
|
33
|
+
return new DecoratorSchema(location, name, doc, args);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.DecoratorSchema = DecoratorSchema;
|
|
37
|
+
//# sourceMappingURL=decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../schemas/decorator.ts"],"names":[],"mappings":";;;AAAA,gDAA4D;AAC5D,wDAAoD;AACpD,iCAAmC;AAEnC,MAAa,eAAgB,SAAQ,wBAAU;IAC7C,YACW,QAAwB,EACxB,IAAY,EACZ,GAAe,EACf,IAAmB;QAE5B,KAAK,EAAE,CAAC;QALC,aAAQ,GAAR,QAAQ,CAAgB;QACxB,SAAI,GAAJ,IAAI,CAAQ;QACZ,QAAG,GAAH,GAAG,CAAY;QACf,SAAI,GAAJ,IAAI,CAAe;IAG9B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,QAAQ;;QACN,gBAAgB;QAChB,MAAM,OAA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: string;
|
|
11
11
|
readonly modifiers: Modifier[];
|
|
12
12
|
readonly typeParams?: string[];
|
|
13
|
+
readonly decorators?: SchemaNode[];
|
|
13
14
|
readonly returnType: SchemaNode;
|
|
14
15
|
readonly params: ParameterSchema[];
|
|
15
16
|
readonly doc?: DocSchema;
|
|
16
17
|
readonly signature?: string | undefined;
|
|
17
|
-
constructor(location: SchemaLocation, name: string, params: ParameterSchema[], returnType: SchemaNode, signature: string, modifiers?: Modifier[], doc?: DocSchema, typeParams?: string[]);
|
|
18
|
+
constructor(location: SchemaLocation, name: string, params: ParameterSchema[], returnType: SchemaNode, signature: string, modifiers?: Modifier[], doc?: DocSchema, typeParams?: string[], decorators?: SchemaNode[]);
|
|
18
19
|
getNodes(): SchemaNode[];
|
|
19
20
|
toString(): string;
|
|
20
21
|
isDeprecated(): boolean;
|
|
21
22
|
isPrivate(): boolean;
|
|
22
23
|
generateSignature(): string;
|
|
23
|
-
static createSignature(name: string, params: ParameterSchema[], returnType: SchemaNode): string;
|
|
24
|
+
static createSignature(name: string, params: ParameterSchema[], returnType: SchemaNode, decorators?: SchemaNode[]): string;
|
|
24
25
|
toObject(): {
|
|
25
26
|
name: string;
|
|
26
27
|
params: {
|
|
@@ -52,6 +53,7 @@ export declare class FunctionLikeSchema extends SchemaNode {
|
|
|
52
53
|
}[];
|
|
53
54
|
};
|
|
54
55
|
typeParams: string[];
|
|
56
|
+
decorators: Record<string, any>[];
|
|
55
57
|
};
|
|
56
58
|
static fromObject(obj: Record<string, any>): FunctionLikeSchema;
|
|
57
59
|
private modifiersToString;
|
|
@@ -14,25 +14,27 @@ const schema_registry_1 = require("../schema-registry");
|
|
|
14
14
|
* function-like can be a function, method, arrow-function, variable-function, etc.
|
|
15
15
|
*/
|
|
16
16
|
class FunctionLikeSchema extends schema_node_1.SchemaNode {
|
|
17
|
-
constructor(location, name, params, returnType, signature, modifiers = [], doc, typeParams
|
|
18
|
-
) {
|
|
17
|
+
constructor(location, name, params, returnType, signature, modifiers = [], doc, typeParams, decorators) {
|
|
19
18
|
super();
|
|
20
19
|
this.location = location;
|
|
21
20
|
this.name = name;
|
|
22
21
|
this.modifiers = modifiers;
|
|
23
22
|
this.typeParams = typeParams;
|
|
23
|
+
this.decorators = decorators;
|
|
24
24
|
this.params = params;
|
|
25
25
|
this.returnType = returnType;
|
|
26
26
|
this.doc = doc;
|
|
27
27
|
this.signature = signature || FunctionLikeSchema.createSignature(this.name, this.params, this.returnType);
|
|
28
28
|
}
|
|
29
29
|
getNodes() {
|
|
30
|
-
return [...this.params, this.returnType];
|
|
30
|
+
return [...this.params, this.returnType, ...(this.decorators || [])];
|
|
31
31
|
}
|
|
32
32
|
toString() {
|
|
33
|
+
var _a;
|
|
33
34
|
const paramsStr = this.params.map((param) => param.toString()).join(', ');
|
|
34
35
|
const typeParamsStr = this.typeParams ? `<${this.typeParams.join(', ')}>` : '';
|
|
35
|
-
|
|
36
|
+
const decoratorsStr = (_a = this.decorators) === null || _a === void 0 ? void 0 : _a.map((decorator) => decorator.toString()).join('\n');
|
|
37
|
+
return `${this.decorators ? `${decoratorsStr}\n` : ''}${this.modifiersToString()}${typeParamsStr}${chalk_1.default.bold(this.name)}(${paramsStr}): ${this.returnType.toString()}`;
|
|
36
38
|
}
|
|
37
39
|
isDeprecated() {
|
|
38
40
|
var _a;
|
|
@@ -43,9 +45,9 @@ class FunctionLikeSchema extends schema_node_1.SchemaNode {
|
|
|
43
45
|
return Boolean(this.modifiers.find((m) => m === 'private') || ((_a = this.doc) === null || _a === void 0 ? void 0 : _a.hasTag(tag_1.TagName.private)));
|
|
44
46
|
}
|
|
45
47
|
generateSignature() {
|
|
46
|
-
return FunctionLikeSchema.createSignature(this.name, this.params, this.returnType);
|
|
48
|
+
return FunctionLikeSchema.createSignature(this.name, this.params, this.returnType, this.decorators);
|
|
47
49
|
}
|
|
48
|
-
static createSignature(name, params, returnType) {
|
|
50
|
+
static createSignature(name, params, returnType, decorators) {
|
|
49
51
|
const paramsStr = params
|
|
50
52
|
.map((param) => {
|
|
51
53
|
let type = param.type.toString();
|
|
@@ -54,14 +56,16 @@ class FunctionLikeSchema extends schema_node_1.SchemaNode {
|
|
|
54
56
|
return `${param.name}${param.isOptional ? '?' : ''}: ${type}`;
|
|
55
57
|
})
|
|
56
58
|
.join(', ');
|
|
57
|
-
|
|
59
|
+
const decoratorsStr = decorators === null || decorators === void 0 ? void 0 : decorators.map((decorator) => decorator.toString()).join('\n');
|
|
60
|
+
return `${decorators ? `${decoratorsStr}\n` : ''}${name}(${paramsStr}): ${returnType.toString()}`;
|
|
58
61
|
}
|
|
59
62
|
toObject() {
|
|
60
|
-
var _a;
|
|
61
|
-
return Object.assign(Object.assign({}, super.toObject()), { name: this.name, params: this.params.map((param) => param.toObject()), returnType: this.returnType.toObject(), signature: this.signature, modifiers: this.modifiers, doc: (_a = this.doc) === null || _a === void 0 ? void 0 : _a.toObject(), typeParams: this.typeParams });
|
|
63
|
+
var _a, _b;
|
|
64
|
+
return Object.assign(Object.assign({}, super.toObject()), { name: this.name, params: this.params.map((param) => param.toObject()), returnType: this.returnType.toObject(), signature: this.signature, modifiers: this.modifiers, doc: (_a = this.doc) === null || _a === void 0 ? void 0 : _a.toObject(), typeParams: this.typeParams, decorators: (_b = this.decorators) === null || _b === void 0 ? void 0 : _b.map((decorator) => decorator.toObject()) });
|
|
62
65
|
}
|
|
63
66
|
static fromObject(obj) {
|
|
64
|
-
|
|
67
|
+
var _a;
|
|
68
|
+
return new FunctionLikeSchema(obj.location, obj.name, obj.params.map((param) => parameter_1.ParameterSchema.fromObject(param)), schema_registry_1.SchemaRegistry.fromObject(obj.returnType), obj.signature, obj.modifiers, obj.doc ? docs_1.DocSchema.fromObject(obj.doc) : undefined, obj.typeParams, (_a = obj.decorators) === null || _a === void 0 ? void 0 : _a.map((decorator) => schema_registry_1.SchemaRegistry.fromObject(decorator)));
|
|
65
69
|
}
|
|
66
70
|
modifiersToString() {
|
|
67
71
|
const modifiersToPrint = this.modifiers.filter((modifier) => modifier !== 'export');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-like.js","sourceRoot":"","sources":["../../schemas/function-like.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAA4D;AAC5D,2CAA8C;AAC9C,iCAAmC;AACnC,oCAAqC;AACrC,wDAAoD;AAapD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAAU;IAMhD,YACW,QAAwB,EACxB,IAAY,EACrB,MAAyB,EACzB,UAAsB,EACtB,SAAiB,EACR,YAAwB,EAAE,EACnC,GAAe,EACN,UAAqB,
|
|
1
|
+
{"version":3,"file":"function-like.js","sourceRoot":"","sources":["../../schemas/function-like.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAA4D;AAC5D,2CAA8C;AAC9C,iCAAmC;AACnC,oCAAqC;AACrC,wDAAoD;AAapD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAAU;IAMhD,YACW,QAAwB,EACxB,IAAY,EACrB,MAAyB,EACzB,UAAsB,EACtB,SAAiB,EACR,YAAwB,EAAE,EACnC,GAAe,EACN,UAAqB,EACrB,UAAyB;QAElC,KAAK,EAAE,CAAC;QAVC,aAAQ,GAAR,QAAQ,CAAgB;QACxB,SAAI,GAAJ,IAAI,CAAQ;QAIZ,cAAS,GAAT,SAAS,CAAiB;QAE1B,eAAU,GAAV,UAAU,CAAW;QACrB,eAAU,GAAV,UAAU,CAAe;QAGlC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,kBAAkB,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5G,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,GAAG,IAAI,CAAC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16 @@
|
|
|
1
|
+
import { DocSchema } from '..';
|
|
2
|
+
import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
3
|
+
export declare class IgnoredSchema extends SchemaNode {
|
|
4
|
+
readonly node: SchemaNode;
|
|
5
|
+
location: SchemaLocation;
|
|
6
|
+
doc?: DocSchema;
|
|
7
|
+
name?: string;
|
|
8
|
+
constructor(node: SchemaNode);
|
|
9
|
+
getNodes(): any[];
|
|
10
|
+
getAllNodesRecursively(): SchemaNode[];
|
|
11
|
+
toString(): string;
|
|
12
|
+
toObject(): {
|
|
13
|
+
node: Record<string, any>;
|
|
14
|
+
};
|
|
15
|
+
static fromObject(obj: Record<string, any>): IgnoredSchema;
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IgnoredSchema = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const schema_node_1 = require("../schema-node");
|
|
6
|
+
class IgnoredSchema extends schema_node_1.SchemaNode {
|
|
7
|
+
constructor(node) {
|
|
8
|
+
super();
|
|
9
|
+
this.node = node;
|
|
10
|
+
this.location = node.location;
|
|
11
|
+
this.doc = node.doc;
|
|
12
|
+
this.name = node.name;
|
|
13
|
+
}
|
|
14
|
+
getNodes() {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
getAllNodesRecursively() {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
toString() {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
toObject() {
|
|
24
|
+
return Object.assign(Object.assign({}, super.toObject()), { node: this.node.toObject() });
|
|
25
|
+
}
|
|
26
|
+
static fromObject(obj) {
|
|
27
|
+
const node = __1.SchemaRegistry.fromObject(obj.node);
|
|
28
|
+
return new IgnoredSchema(node);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.IgnoredSchema = IgnoredSchema;
|
|
32
|
+
//# sourceMappingURL=ignored.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignored.js","sourceRoot":"","sources":["../../schemas/ignored.ts"],"names":[],"mappings":";;;AAAA,0BAA+C;AAC/C,gDAA4D;AAE5D,MAAa,aAAc,SAAQ,wBAAU;IAK3C,YAA4B,IAAgB;QAC1C,KAAK,EAAE,CAAC;QADkB,SAAI,GAAJ,IAAI,CAAY;QAE1C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,QAAQ;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,sBAAsB;QACpB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,QAAQ;QACN,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,QAAQ;QACN,uCACK,KAAK,CAAC,QAAQ,EAAE,KACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,IAC1B;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAwB;QACxC,MAAM,IAAI,GAAG,kBAAc,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjD,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACF;AAnCD,sCAmCC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -39,4 +39,10 @@ export { ConditionalTypeSchema } from './conditional-type';
|
|
|
39
39
|
export { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';
|
|
40
40
|
export { NamedTupleSchema } from './named-tuple';
|
|
41
41
|
export { UnImplementedSchema } from './unimplemented-schema';
|
|
42
|
+
export { ObjectLiteralExpressionSchema } from './object-literal-expression';
|
|
43
|
+
export { ArrayLiteralExpressionSchema } from './array-literal-expression';
|
|
44
|
+
export { PropertyAssignmentSchema } from './property-assignment';
|
|
45
|
+
export { DecoratorSchema } from './decorator';
|
|
46
|
+
export { LiteralValueSchema } from './literal-value';
|
|
47
|
+
export { IgnoredSchema } from './ignored';
|
|
42
48
|
export * from './docs';
|
package/dist/schemas/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.UnImplementedSchema = exports.NamedTupleSchema = exports.ExpressionWithTypeArgumentsSchema = exports.ConditionalTypeSchema = exports.UnresolvedSchema = exports.UnknownSchema = exports.ThisTypeSchema = exports.TemplateLiteralTypeSpanSchema = exports.TemplateLiteralTypeSchema = exports.IndexedAccessSchema = exports.TypePredicateSchema = exports.ParenthesizedTypeSchema = exports.EnumMemberSchema = exports.EnumSchema = exports.ParameterSchema = exports.TupleTypeSchema = exports.TypeOperatorSchema = exports.TypeArraySchema = exports.KeywordTypeSchema = exports.LiteralTypeSchema = exports.InferenceTypeSchema = exports.TypeQuerySchema = exports.SetAccessorSchema = exports.GetAccessorSchema = exports.InterfaceSchema = exports.IndexSignatureSchema = exports.TypeLiteralSchema = exports.TypeUnionSchema = exports.TypeIntersectionSchema = exports.TypeSchema = exports.ConstructorSchema = exports.ClassSchema = exports.VariableLikeSchema = exports.TypeRefSchema = exports.FunctionLikeSchema = exports.ModuleSchema = void 0;
|
|
17
|
+
exports.IgnoredSchema = exports.LiteralValueSchema = exports.DecoratorSchema = exports.PropertyAssignmentSchema = exports.ArrayLiteralExpressionSchema = exports.ObjectLiteralExpressionSchema = exports.UnImplementedSchema = exports.NamedTupleSchema = exports.ExpressionWithTypeArgumentsSchema = exports.ConditionalTypeSchema = exports.UnresolvedSchema = exports.UnknownSchema = exports.ThisTypeSchema = exports.TemplateLiteralTypeSpanSchema = exports.TemplateLiteralTypeSchema = exports.IndexedAccessSchema = exports.TypePredicateSchema = exports.ParenthesizedTypeSchema = exports.EnumMemberSchema = exports.EnumSchema = exports.ParameterSchema = exports.TupleTypeSchema = exports.TypeOperatorSchema = exports.TypeArraySchema = exports.KeywordTypeSchema = exports.LiteralTypeSchema = exports.InferenceTypeSchema = exports.TypeQuerySchema = exports.SetAccessorSchema = exports.GetAccessorSchema = exports.InterfaceSchema = exports.IndexSignatureSchema = exports.TypeLiteralSchema = exports.TypeUnionSchema = exports.TypeIntersectionSchema = exports.TypeSchema = exports.ConstructorSchema = exports.ClassSchema = exports.VariableLikeSchema = exports.TypeRefSchema = exports.FunctionLikeSchema = exports.ModuleSchema = void 0;
|
|
18
18
|
/**
|
|
19
19
|
* Ensure that any new Schema class ends with the word 'Schema'
|
|
20
20
|
* This will make sure that the Class Name is not minimized during prod bundling process
|
|
@@ -92,5 +92,17 @@ var named_tuple_1 = require("./named-tuple");
|
|
|
92
92
|
Object.defineProperty(exports, "NamedTupleSchema", { enumerable: true, get: function () { return named_tuple_1.NamedTupleSchema; } });
|
|
93
93
|
var unimplemented_schema_1 = require("./unimplemented-schema");
|
|
94
94
|
Object.defineProperty(exports, "UnImplementedSchema", { enumerable: true, get: function () { return unimplemented_schema_1.UnImplementedSchema; } });
|
|
95
|
+
var object_literal_expression_1 = require("./object-literal-expression");
|
|
96
|
+
Object.defineProperty(exports, "ObjectLiteralExpressionSchema", { enumerable: true, get: function () { return object_literal_expression_1.ObjectLiteralExpressionSchema; } });
|
|
97
|
+
var array_literal_expression_1 = require("./array-literal-expression");
|
|
98
|
+
Object.defineProperty(exports, "ArrayLiteralExpressionSchema", { enumerable: true, get: function () { return array_literal_expression_1.ArrayLiteralExpressionSchema; } });
|
|
99
|
+
var property_assignment_1 = require("./property-assignment");
|
|
100
|
+
Object.defineProperty(exports, "PropertyAssignmentSchema", { enumerable: true, get: function () { return property_assignment_1.PropertyAssignmentSchema; } });
|
|
101
|
+
var decorator_1 = require("./decorator");
|
|
102
|
+
Object.defineProperty(exports, "DecoratorSchema", { enumerable: true, get: function () { return decorator_1.DecoratorSchema; } });
|
|
103
|
+
var literal_value_1 = require("./literal-value");
|
|
104
|
+
Object.defineProperty(exports, "LiteralValueSchema", { enumerable: true, get: function () { return literal_value_1.LiteralValueSchema; } });
|
|
105
|
+
var ignored_1 = require("./ignored");
|
|
106
|
+
Object.defineProperty(exports, "IgnoredSchema", { enumerable: true, get: function () { return ignored_1.IgnoredSchema; } });
|
|
95
107
|
__exportStar(require("./docs"), exports);
|
|
96
108
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;GAIG;AACH,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AACrB,iDAAqD;AAA5C,mHAAA,kBAAkB,OAAA;AAC3B,uCAA2C;AAAlC,yGAAA,aAAa,OAAA;AACtB,iDAAqD;AAA5C,mHAAA,kBAAkB,OAAA;AAC3B,iCAAsC;AAA7B,oGAAA,WAAW,OAAA;AACpB,6CAAkD;AAAzC,gHAAA,iBAAiB,OAAA;AAC1B,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,yDAA6D;AAApD,2HAAA,sBAAsB,OAAA;AAC/B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,qDAAyD;AAAhD,uHAAA,oBAAoB,OAAA;AAC7B,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,+CAAmD;AAA1C,iHAAA,iBAAiB,OAAA;AAC1B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AACxB,mDAAuD;AAA9C,qHAAA,mBAAmB,OAAA;AAC5B,+CAAmD;AAA1C,iHAAA,iBAAiB,O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A,mBAAmB,OAAA;AAC5B,yEAA4E;AAAnE,0IAAA,6BAA6B,OAAA;AACtC,uEAA0E;AAAjE,wIAAA,4BAA4B,OAAA;AACrC,6DAAiE;AAAxD,+HAAA,wBAAwB,OAAA;AACjC,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,iDAAqD;AAA5C,mHAAA,kBAAkB,OAAA;AAC3B,qCAA0C;AAAjC,wGAAA,aAAa,OAAA;AACtB,yCAAuB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
2
|
+
export declare class LiteralValueSchema extends SchemaNode {
|
|
3
|
+
readonly location: SchemaLocation;
|
|
4
|
+
readonly value: string;
|
|
5
|
+
constructor(location: SchemaLocation, value: string);
|
|
6
|
+
toString(): string;
|
|
7
|
+
toObject(): {
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
static fromObject(obj: Record<string, any>): LiteralValueSchema;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LiteralValueSchema = void 0;
|
|
4
|
+
const schema_node_1 = require("../schema-node");
|
|
5
|
+
class LiteralValueSchema extends schema_node_1.SchemaNode {
|
|
6
|
+
constructor(location, value) {
|
|
7
|
+
super();
|
|
8
|
+
this.location = location;
|
|
9
|
+
this.value = value;
|
|
10
|
+
this.value = this.value.replace(/^['"]|['"]$/g, '');
|
|
11
|
+
}
|
|
12
|
+
toString() {
|
|
13
|
+
return this.value;
|
|
14
|
+
}
|
|
15
|
+
toObject() {
|
|
16
|
+
return Object.assign(Object.assign({}, super.toObject()), { value: this.value });
|
|
17
|
+
}
|
|
18
|
+
static fromObject(obj) {
|
|
19
|
+
const location = obj.location;
|
|
20
|
+
const value = obj.value;
|
|
21
|
+
return new LiteralValueSchema(location, value);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.LiteralValueSchema = LiteralValueSchema;
|
|
25
|
+
//# sourceMappingURL=literal-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"literal-value.js","sourceRoot":"","sources":["../../schemas/literal-value.ts"],"names":[],"mappings":";;;AAAA,gDAA4D;AAE5D,MAAa,kBAAmB,SAAQ,wBAAU;IAChD,YAAqB,QAAwB,EAAW,KAAa;QACnE,KAAK,EAAE,CAAC;QADW,aAAQ,GAAR,QAAQ,CAAgB;QAAW,UAAK,GAAL,KAAK,CAAQ;QAEnE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,QAAQ;QACN,uCACK,KAAK,CAAC,QAAQ,EAAE,KACnB,KAAK,EAAE,IAAI,CAAC,KAAK,IACjB;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAwB;QACxC,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QAC9B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QACxB,OAAO,IAAI,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;CACF;AAtBD,gDAsBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
2
|
+
export declare class ObjectLiteralExpressionSchema extends SchemaNode {
|
|
3
|
+
readonly members: SchemaNode[];
|
|
4
|
+
readonly location: SchemaLocation;
|
|
5
|
+
constructor(members: SchemaNode[], location: SchemaLocation);
|
|
6
|
+
getNodes(): SchemaNode[];
|
|
7
|
+
toString(): string;
|
|
8
|
+
toObject(): {
|
|
9
|
+
members: Record<string, any>[];
|
|
10
|
+
location: SchemaLocation;
|
|
11
|
+
};
|
|
12
|
+
static fromObject(obj: Record<string, any>): ObjectLiteralExpressionSchema;
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObjectLiteralExpressionSchema = void 0;
|
|
4
|
+
const schema_node_1 = require("../schema-node");
|
|
5
|
+
const schema_registry_1 = require("../schema-registry");
|
|
6
|
+
class ObjectLiteralExpressionSchema extends schema_node_1.SchemaNode {
|
|
7
|
+
constructor(members, location) {
|
|
8
|
+
super();
|
|
9
|
+
this.members = members;
|
|
10
|
+
this.location = location;
|
|
11
|
+
}
|
|
12
|
+
getNodes() {
|
|
13
|
+
return this.members;
|
|
14
|
+
}
|
|
15
|
+
toString() {
|
|
16
|
+
return `{\n${this.members.map((member) => `\t${member.toString()}`).join('\n')}\n}`;
|
|
17
|
+
}
|
|
18
|
+
toObject() {
|
|
19
|
+
return Object.assign(Object.assign({}, super.toObject()), { members: this.members.map((element) => element.toObject()), location: this.location });
|
|
20
|
+
}
|
|
21
|
+
static fromObject(obj) {
|
|
22
|
+
const members = obj.members.map((member) => schema_registry_1.SchemaRegistry.fromObject(member));
|
|
23
|
+
const location = obj.location;
|
|
24
|
+
return new ObjectLiteralExpressionSchema(members, location);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ObjectLiteralExpressionSchema = ObjectLiteralExpressionSchema;
|
|
28
|
+
//# sourceMappingURL=object-literal-expression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-literal-expression.js","sourceRoot":"","sources":["../../schemas/object-literal-expression.ts"],"names":[],"mappings":";;;AAAA,gDAA4D;AAC5D,wDAAoD;AAEpD,MAAa,6BAA8B,SAAQ,wBAAU;IAC3D,YAAqB,OAAqB,EAAW,QAAwB;QAC3E,KAAK,EAAE,CAAC;QADW,YAAO,GAAP,OAAO,CAAc;QAAW,aAAQ,GAAR,QAAQ,CAAgB;IAE7E,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,QAAQ;QACN,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IACtF,CAAC;IAED,QAAQ;QACN,uCACK,KAAK,CAAC,QAAQ,EAAE,KACnB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,EAC1D,QAAQ,EAAE,IAAI,CAAC,QAAQ,IACvB;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAwB;QACxC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,gCAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/E,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QAC9B,OAAO,IAAI,6BAA6B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC;CACF;AA1BD,sEA0BC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SchemaNode, SchemaLocation } from '../schema-node';
|
|
2
|
+
import { DocSchema } from './docs';
|
|
3
|
+
export declare class PropertyAssignmentSchema extends SchemaNode {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly value: SchemaNode;
|
|
6
|
+
readonly location: SchemaLocation;
|
|
7
|
+
readonly doc?: DocSchema;
|
|
8
|
+
constructor(name: string, value: SchemaNode, location: SchemaLocation, doc?: DocSchema);
|
|
9
|
+
toString(): string;
|
|
10
|
+
toObject(): {
|
|
11
|
+
name: string;
|
|
12
|
+
value: Record<string, any>;
|
|
13
|
+
doc: {
|
|
14
|
+
__schema: string;
|
|
15
|
+
name: string;
|
|
16
|
+
location: SchemaLocation;
|
|
17
|
+
signature: string;
|
|
18
|
+
raw: string;
|
|
19
|
+
comment: string;
|
|
20
|
+
tags: {
|
|
21
|
+
__schema: string;
|
|
22
|
+
location: SchemaLocation;
|
|
23
|
+
name: string;
|
|
24
|
+
signature: string;
|
|
25
|
+
tagName: string;
|
|
26
|
+
comment: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
location: SchemaLocation;
|
|
30
|
+
};
|
|
31
|
+
static fromObject(obj: Record<string, any>): PropertyAssignmentSchema;
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PropertyAssignmentSchema = void 0;
|
|
4
|
+
const schema_node_1 = require("../schema-node");
|
|
5
|
+
const schema_registry_1 = require("../schema-registry");
|
|
6
|
+
const docs_1 = require("./docs");
|
|
7
|
+
class PropertyAssignmentSchema extends schema_node_1.SchemaNode {
|
|
8
|
+
constructor(name, value, location, doc) {
|
|
9
|
+
super();
|
|
10
|
+
this.name = name;
|
|
11
|
+
this.value = value;
|
|
12
|
+
this.location = location;
|
|
13
|
+
this.doc = doc;
|
|
14
|
+
}
|
|
15
|
+
toString() {
|
|
16
|
+
return `${this.name}: ${this.value.toString()}`;
|
|
17
|
+
}
|
|
18
|
+
toObject() {
|
|
19
|
+
var _a;
|
|
20
|
+
return Object.assign(Object.assign({}, super.toObject()), { name: this.name, value: this.value.toObject(), doc: (_a = this.doc) === null || _a === void 0 ? void 0 : _a.toObject(), location: this.location });
|
|
21
|
+
}
|
|
22
|
+
static fromObject(obj) {
|
|
23
|
+
const name = obj.name;
|
|
24
|
+
const value = schema_registry_1.SchemaRegistry.fromObject(obj.value);
|
|
25
|
+
const location = obj.location;
|
|
26
|
+
const doc = obj.doc ? docs_1.DocSchema.fromObject(obj.doc) : undefined;
|
|
27
|
+
return new PropertyAssignmentSchema(name, value, location, doc);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.PropertyAssignmentSchema = PropertyAssignmentSchema;
|
|
31
|
+
//# sourceMappingURL=property-assignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"property-assignment.js","sourceRoot":"","sources":["../../schemas/property-assignment.ts"],"names":[],"mappings":";;;AAAA,gDAA4D;AAC5D,wDAAoD;AACpD,iCAAmC;AAEnC,MAAa,wBAAyB,SAAQ,wBAAU;IACtD,YACW,IAAY,EACZ,KAAiB,EACjB,QAAwB,EACxB,GAAe;QAExB,KAAK,EAAE,CAAC;QALC,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAY;QACjB,aAAQ,GAAR,QAAQ,CAAgB;QACxB,QAAG,GAAH,GAAG,CAAY;IAG1B,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;IAClD,CAAC;IAED,QAAQ;;QACN,uCACK,KAAK,CAAC,QAAQ,EAAE,KACnB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,EAC5B,GAAG,EAAE,MAAA,IAAI,CAAC,GAAG,0CAAE,QAAQ,EAAE,EACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IACvB;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,GAAwB;QACxC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACtB,MAAM,KAAK,GAAG,gCAAc,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAS,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAChE,OAAO,IAAI,wBAAwB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAClE,CAAC;CACF;AA/BD,4DA+BC"}
|
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.68",
|
|
4
4
|
"homepage": "https://bit.cloud/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.68"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
2
|
+
import { SchemaRegistry } from '../schema-registry';
|
|
3
|
+
|
|
4
|
+
export class ArrayLiteralExpressionSchema extends SchemaNode {
|
|
5
|
+
constructor(readonly members: SchemaNode[], readonly location: SchemaLocation) {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
toObject() {
|
|
10
|
+
return {
|
|
11
|
+
...super.toObject(),
|
|
12
|
+
members: this.members.map((member) => member.toObject()),
|
|
13
|
+
location: this.location,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static fromObject(obj: Record<string, any>): ArrayLiteralExpressionSchema {
|
|
18
|
+
const members = obj.members.map((member) => SchemaRegistry.fromObject(member));
|
|
19
|
+
return new ArrayLiteralExpressionSchema(members, obj.location);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toString(): string {
|
|
23
|
+
return `[${this.members.join(', ')}]`;
|
|
24
|
+
}
|
|
25
|
+
}
|
package/schemas/class.ts
CHANGED
|
@@ -16,7 +16,8 @@ export class ClassSchema extends SchemaNode {
|
|
|
16
16
|
doc?: DocSchema,
|
|
17
17
|
readonly typeParams?: string[],
|
|
18
18
|
readonly extendsNodes?: ExpressionWithTypeArgumentsSchema[],
|
|
19
|
-
readonly implementNodes?: ExpressionWithTypeArgumentsSchema[]
|
|
19
|
+
readonly implementNodes?: ExpressionWithTypeArgumentsSchema[],
|
|
20
|
+
readonly decorators?: SchemaNode[]
|
|
20
21
|
) {
|
|
21
22
|
super();
|
|
22
23
|
this.members = members;
|
|
@@ -29,7 +30,8 @@ export class ClassSchema extends SchemaNode {
|
|
|
29
30
|
|
|
30
31
|
toString() {
|
|
31
32
|
const membersStr = this.members.map((m) => `* ${m.toString()}`).join('\n');
|
|
32
|
-
|
|
33
|
+
const decoratorsStr = this.decorators?.map((decorator) => decorator.toString()).join('\n');
|
|
34
|
+
return `${this.decorators ? `${decoratorsStr}\n` : ''}${chalk.bold.underline(this.name)}\n${membersStr}`;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
toObject() {
|
|
@@ -42,6 +44,7 @@ export class ClassSchema extends SchemaNode {
|
|
|
42
44
|
typeParams: this.typeParams,
|
|
43
45
|
extendsNodes: this.extendsNodes?.map((node) => node.toObject()),
|
|
44
46
|
implementNodes: this.implementNodes?.map((node) => node.toObject()),
|
|
47
|
+
decorators: this.decorators?.map((decorator) => decorator.toObject()),
|
|
45
48
|
};
|
|
46
49
|
}
|
|
47
50
|
|
|
@@ -54,6 +57,31 @@ export class ClassSchema extends SchemaNode {
|
|
|
54
57
|
const typeParams = obj.typeParams;
|
|
55
58
|
const extendsNodes = obj.extendsNodes?.map((node: any) => ExpressionWithTypeArgumentsSchema.fromObject(node));
|
|
56
59
|
const implementNodes = obj.implementNodes?.map((node: any) => ExpressionWithTypeArgumentsSchema.fromObject(node));
|
|
57
|
-
|
|
60
|
+
const decorators = obj.decorators?.map((decorator: any) => SchemaRegistry.fromObject(decorator));
|
|
61
|
+
return new ClassSchema(
|
|
62
|
+
name,
|
|
63
|
+
members,
|
|
64
|
+
location,
|
|
65
|
+
signature,
|
|
66
|
+
doc,
|
|
67
|
+
typeParams,
|
|
68
|
+
extendsNodes,
|
|
69
|
+
implementNodes,
|
|
70
|
+
decorators
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static fromSchema(node: ClassSchema, memberTransformer: (_node: SchemaNode) => SchemaNode = (_node) => _node) {
|
|
75
|
+
return new ClassSchema(
|
|
76
|
+
node.name,
|
|
77
|
+
node.members.map(memberTransformer),
|
|
78
|
+
node.location,
|
|
79
|
+
node.signature,
|
|
80
|
+
node.doc,
|
|
81
|
+
node.typeParams,
|
|
82
|
+
node.extendsNodes,
|
|
83
|
+
node.implementNodes,
|
|
84
|
+
node.decorators
|
|
85
|
+
);
|
|
58
86
|
}
|
|
59
87
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
2
|
+
import { SchemaRegistry } from '../schema-registry';
|
|
3
|
+
import { DocSchema } from './docs';
|
|
4
|
+
|
|
5
|
+
export class DecoratorSchema extends SchemaNode {
|
|
6
|
+
constructor(
|
|
7
|
+
readonly location: SchemaLocation,
|
|
8
|
+
readonly name: string,
|
|
9
|
+
readonly doc?: DocSchema,
|
|
10
|
+
readonly args?: SchemaNode[]
|
|
11
|
+
) {
|
|
12
|
+
super();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getNodes() {
|
|
16
|
+
return this.args || [];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
toString() {
|
|
20
|
+
// name and args
|
|
21
|
+
const argsStr = this.args?.map((arg) => arg.toString()).join(', ');
|
|
22
|
+
return `@${this.name}${argsStr ? `(${argsStr})` : ''}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
toObject() {
|
|
26
|
+
return {
|
|
27
|
+
...super.toObject(),
|
|
28
|
+
name: this.name,
|
|
29
|
+
doc: this.doc?.toObject(),
|
|
30
|
+
args: this.args?.map((arg) => arg.toObject()),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static fromObject(obj: Record<string, any>): DecoratorSchema {
|
|
35
|
+
const location = obj.location;
|
|
36
|
+
const name = obj.name;
|
|
37
|
+
const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;
|
|
38
|
+
const args = obj.args ? obj.args.map((arg) => SchemaRegistry.fromObject(arg)) : undefined;
|
|
39
|
+
return new DecoratorSchema(location, name, doc, args);
|
|
40
|
+
}
|
|
41
|
+
}
|
package/schemas/function-like.ts
CHANGED
|
@@ -33,7 +33,8 @@ export class FunctionLikeSchema extends SchemaNode {
|
|
|
33
33
|
signature: string,
|
|
34
34
|
readonly modifiers: Modifier[] = [],
|
|
35
35
|
doc?: DocSchema,
|
|
36
|
-
readonly typeParams?: string[]
|
|
36
|
+
readonly typeParams?: string[],
|
|
37
|
+
readonly decorators?: SchemaNode[]
|
|
37
38
|
) {
|
|
38
39
|
super();
|
|
39
40
|
this.params = params;
|
|
@@ -43,13 +44,14 @@ export class FunctionLikeSchema extends SchemaNode {
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
getNodes() {
|
|
46
|
-
return [...this.params, this.returnType];
|
|
47
|
+
return [...this.params, this.returnType, ...(this.decorators || [])];
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
toString() {
|
|
50
51
|
const paramsStr = this.params.map((param) => param.toString()).join(', ');
|
|
51
52
|
const typeParamsStr = this.typeParams ? `<${this.typeParams.join(', ')}>` : '';
|
|
52
|
-
|
|
53
|
+
const decoratorsStr = this.decorators?.map((decorator) => decorator.toString()).join('\n');
|
|
54
|
+
return `${this.decorators ? `${decoratorsStr}\n` : ''}${this.modifiersToString()}${typeParamsStr}${chalk.bold(
|
|
53
55
|
this.name
|
|
54
56
|
)}(${paramsStr}): ${this.returnType.toString()}`;
|
|
55
57
|
}
|
|
@@ -63,10 +65,15 @@ export class FunctionLikeSchema extends SchemaNode {
|
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
generateSignature(): string {
|
|
66
|
-
return FunctionLikeSchema.createSignature(this.name, this.params, this.returnType);
|
|
68
|
+
return FunctionLikeSchema.createSignature(this.name, this.params, this.returnType, this.decorators);
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
static createSignature(
|
|
71
|
+
static createSignature(
|
|
72
|
+
name: string,
|
|
73
|
+
params: ParameterSchema[],
|
|
74
|
+
returnType: SchemaNode,
|
|
75
|
+
decorators?: SchemaNode[]
|
|
76
|
+
): string {
|
|
70
77
|
const paramsStr = params
|
|
71
78
|
.map((param) => {
|
|
72
79
|
let type = param.type.toString();
|
|
@@ -74,7 +81,8 @@ export class FunctionLikeSchema extends SchemaNode {
|
|
|
74
81
|
return `${param.name}${param.isOptional ? '?' : ''}: ${type}`;
|
|
75
82
|
})
|
|
76
83
|
.join(', ');
|
|
77
|
-
|
|
84
|
+
const decoratorsStr = decorators?.map((decorator) => decorator.toString()).join('\n');
|
|
85
|
+
return `${decorators ? `${decoratorsStr}\n` : ''}${name}(${paramsStr}): ${returnType.toString()}`;
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
toObject() {
|
|
@@ -87,6 +95,7 @@ export class FunctionLikeSchema extends SchemaNode {
|
|
|
87
95
|
modifiers: this.modifiers,
|
|
88
96
|
doc: this.doc?.toObject(),
|
|
89
97
|
typeParams: this.typeParams,
|
|
98
|
+
decorators: this.decorators?.map((decorator) => decorator.toObject()),
|
|
90
99
|
};
|
|
91
100
|
}
|
|
92
101
|
|
|
@@ -99,7 +108,8 @@ export class FunctionLikeSchema extends SchemaNode {
|
|
|
99
108
|
obj.signature,
|
|
100
109
|
obj.modifiers,
|
|
101
110
|
obj.doc ? DocSchema.fromObject(obj.doc) : undefined,
|
|
102
|
-
obj.typeParams
|
|
111
|
+
obj.typeParams,
|
|
112
|
+
obj.decorators?.map((decorator) => SchemaRegistry.fromObject(decorator))
|
|
103
113
|
);
|
|
104
114
|
}
|
|
105
115
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DocSchema, SchemaRegistry } from '..';
|
|
2
|
+
import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
3
|
+
|
|
4
|
+
export class IgnoredSchema extends SchemaNode {
|
|
5
|
+
public location: SchemaLocation;
|
|
6
|
+
public doc?: DocSchema;
|
|
7
|
+
public name?: string;
|
|
8
|
+
|
|
9
|
+
constructor(public readonly node: SchemaNode) {
|
|
10
|
+
super();
|
|
11
|
+
this.location = node.location;
|
|
12
|
+
this.doc = node.doc;
|
|
13
|
+
this.name = node.name;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
getNodes() {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
getAllNodesRecursively(): SchemaNode[] {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
toString() {
|
|
25
|
+
return '';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
toObject() {
|
|
29
|
+
return {
|
|
30
|
+
...super.toObject(),
|
|
31
|
+
node: this.node.toObject(),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static fromObject(obj: Record<string, any>): IgnoredSchema {
|
|
36
|
+
const node = SchemaRegistry.fromObject(obj.node);
|
|
37
|
+
return new IgnoredSchema(node);
|
|
38
|
+
}
|
|
39
|
+
}
|
package/schemas/index.ts
CHANGED
|
@@ -39,4 +39,10 @@ export { ConditionalTypeSchema } from './conditional-type';
|
|
|
39
39
|
export { ExpressionWithTypeArgumentsSchema } from './expression-with-arguments';
|
|
40
40
|
export { NamedTupleSchema } from './named-tuple';
|
|
41
41
|
export { UnImplementedSchema } from './unimplemented-schema';
|
|
42
|
+
export { ObjectLiteralExpressionSchema } from './object-literal-expression';
|
|
43
|
+
export { ArrayLiteralExpressionSchema } from './array-literal-expression';
|
|
44
|
+
export { PropertyAssignmentSchema } from './property-assignment';
|
|
45
|
+
export { DecoratorSchema } from './decorator';
|
|
46
|
+
export { LiteralValueSchema } from './literal-value';
|
|
47
|
+
export { IgnoredSchema } from './ignored';
|
|
42
48
|
export * from './docs';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
2
|
+
|
|
3
|
+
export class LiteralValueSchema extends SchemaNode {
|
|
4
|
+
constructor(readonly location: SchemaLocation, readonly value: string) {
|
|
5
|
+
super();
|
|
6
|
+
this.value = this.value.replace(/^['"]|['"]$/g, '');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
toString() {
|
|
10
|
+
return this.value;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
toObject() {
|
|
14
|
+
return {
|
|
15
|
+
...super.toObject(),
|
|
16
|
+
value: this.value,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static fromObject(obj: Record<string, any>): LiteralValueSchema {
|
|
21
|
+
const location = obj.location;
|
|
22
|
+
const value = obj.value;
|
|
23
|
+
return new LiteralValueSchema(location, value);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SchemaLocation, SchemaNode } from '../schema-node';
|
|
2
|
+
import { SchemaRegistry } from '../schema-registry';
|
|
3
|
+
|
|
4
|
+
export class ObjectLiteralExpressionSchema extends SchemaNode {
|
|
5
|
+
constructor(readonly members: SchemaNode[], readonly location: SchemaLocation) {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
getNodes() {
|
|
10
|
+
return this.members;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
toString(): string {
|
|
14
|
+
return `{\n${this.members.map((member) => `\t${member.toString()}`).join('\n')}\n}`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
toObject() {
|
|
18
|
+
return {
|
|
19
|
+
...super.toObject(),
|
|
20
|
+
members: this.members.map((element) => element.toObject()),
|
|
21
|
+
location: this.location,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static fromObject(obj: Record<string, any>): ObjectLiteralExpressionSchema {
|
|
26
|
+
const members = obj.members.map((member) => SchemaRegistry.fromObject(member));
|
|
27
|
+
const location = obj.location;
|
|
28
|
+
return new ObjectLiteralExpressionSchema(members, location);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SchemaNode, SchemaLocation } from '../schema-node';
|
|
2
|
+
import { SchemaRegistry } from '../schema-registry';
|
|
3
|
+
import { DocSchema } from './docs';
|
|
4
|
+
|
|
5
|
+
export class PropertyAssignmentSchema extends SchemaNode {
|
|
6
|
+
constructor(
|
|
7
|
+
readonly name: string,
|
|
8
|
+
readonly value: SchemaNode,
|
|
9
|
+
readonly location: SchemaLocation,
|
|
10
|
+
readonly doc?: DocSchema
|
|
11
|
+
) {
|
|
12
|
+
super();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toString() {
|
|
16
|
+
return `${this.name}: ${this.value.toString()}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
toObject() {
|
|
20
|
+
return {
|
|
21
|
+
...super.toObject(),
|
|
22
|
+
name: this.name,
|
|
23
|
+
value: this.value.toObject(),
|
|
24
|
+
doc: this.doc?.toObject(),
|
|
25
|
+
location: this.location,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static fromObject(obj: Record<string, any>): PropertyAssignmentSchema {
|
|
30
|
+
const name = obj.name;
|
|
31
|
+
const value = SchemaRegistry.fromObject(obj.value);
|
|
32
|
+
const location = obj.location;
|
|
33
|
+
const doc = obj.doc ? DocSchema.fromObject(obj.doc) : undefined;
|
|
34
|
+
return new PropertyAssignmentSchema(name, value, location, doc);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
;
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.66/dist/semantic-schema.docs.md';
|
|
3
|
-
|
|
4
|
-
export const compositions = [];
|
|
5
|
-
export const overview = [overview_0];
|
|
6
|
-
|
|
7
|
-
export const compositions_metadata = {"compositions":[]};
|