@teambit/semantics.entities.semantic-schema 0.0.16 → 0.0.17
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/schemas/function-like.d.ts +2 -1
- package/dist/schemas/function-like.js +5 -4
- package/dist/schemas/function-like.js.map +1 -1
- package/dist/tsconfig.json +32 -0
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.17.tgz +0 -0
- package/package.json +2 -2
- package/{preview-1653708349111.js → preview-1654313169583.js} +1 -1
- package/schemas/function-like.ts +6 -4
- package/tsconfig.json +6 -1
- package/package-tar/teambit-semantics.entities.semantic-schema-0.0.16.tgz +0 -0
|
@@ -10,10 +10,11 @@ export declare class FunctionLikeSchema extends SchemaNode {
|
|
|
10
10
|
readonly name: string;
|
|
11
11
|
readonly signature: string;
|
|
12
12
|
readonly modifiers: Modifier[];
|
|
13
|
+
readonly typeParams?: string[];
|
|
13
14
|
readonly returnType: SchemaNode;
|
|
14
15
|
readonly params: ParameterSchema[];
|
|
15
16
|
readonly doc?: DocSchema;
|
|
16
|
-
constructor(location: Location, name: string, params: ParameterSchema[], returnType: SchemaNode, signature: string, modifiers?: Modifier[], doc?: DocSchema);
|
|
17
|
+
constructor(location: Location, name: string, params: ParameterSchema[], returnType: SchemaNode, signature: string, modifiers?: Modifier[], doc?: DocSchema, typeParams?: string[]);
|
|
17
18
|
toString(): string;
|
|
18
19
|
isDeprecated(): boolean;
|
|
19
20
|
isPrivate(): boolean;
|
|
@@ -19,21 +19,22 @@ const tag_1 = require("./docs/tag");
|
|
|
19
19
|
* function-like can be a function, method, arrow-function, variable-function, etc.
|
|
20
20
|
*/
|
|
21
21
|
class FunctionLikeSchema extends schema_node_1.SchemaNode {
|
|
22
|
-
constructor(location, name,
|
|
23
|
-
|
|
24
|
-
params, returnType, signature, modifiers = [], doc) {
|
|
22
|
+
constructor(location, name, params, returnType, signature, modifiers = [], doc, typeParams // generics e.g. <T>myFunction
|
|
23
|
+
) {
|
|
25
24
|
super();
|
|
26
25
|
this.location = location;
|
|
27
26
|
this.name = name;
|
|
28
27
|
this.signature = signature;
|
|
29
28
|
this.modifiers = modifiers;
|
|
29
|
+
this.typeParams = typeParams;
|
|
30
30
|
this.params = params;
|
|
31
31
|
this.returnType = returnType;
|
|
32
32
|
this.doc = doc;
|
|
33
33
|
}
|
|
34
34
|
toString() {
|
|
35
35
|
const paramsStr = this.params.map((param) => param.toString()).join(', ');
|
|
36
|
-
|
|
36
|
+
const typeParamsStr = this.typeParams ? `<${this.typeParams.join(', ')}>` : '';
|
|
37
|
+
return `${this.modifiersToString()}${typeParamsStr}${chalk_1.default.bold(this.name)}(${paramsStr}): ${this.returnType.toString()}`;
|
|
37
38
|
}
|
|
38
39
|
isDeprecated() {
|
|
39
40
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-like.js","sourceRoot":"","sources":["../../schemas/function-like.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAAuF;AAGvF,oCAAqC;AAarC;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAAU;IAUhD,YACW,QAAkB,EAClB,IAAY
|
|
1
|
+
{"version":3,"file":"function-like.js","sourceRoot":"","sources":["../../schemas/function-like.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,kDAA0B;AAC1B,gDAAsD;AACtD,8DAAuF;AAGvF,oCAAqC;AAarC;;GAEG;AACH,MAAa,kBAAmB,SAAQ,wBAAU;IAUhD,YACW,QAAkB,EAClB,IAAY,EACrB,MAAyB,EACzB,UAAsB,EACb,SAAiB,EACjB,YAAwB,EAAE,EACnC,GAAe,EACN,UAAqB,CAAC,8BAA8B;;QAE7D,KAAK,EAAE,CAAC;QATC,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAQ;QAGZ,cAAS,GAAT,SAAS,CAAQ;QACjB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MAAM,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACzE,CAAC;CACF;AA5CC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;sDACC;AAGhC;IADC,IAAA,6BAAS,EAAC,8CAAyB,CAAC;kDACF;AAGnC;IADC,IAAA,6BAAS,EAAC,wCAAmB,CAAC;+CACN;AAR3B,gDA8CC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
"dist",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"include": [
|
|
29
|
+
"**/*",
|
|
30
|
+
"**/*.json"
|
|
31
|
+
]
|
|
32
|
+
}
|
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.17",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/semantics/entities/semantic-schema",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.semantics",
|
|
8
8
|
"name": "entities/semantic-schema",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.17"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.
|
|
1
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_entities_semantic-schema@0.0.17/dist/semantic-schema.docs.md')]
|
package/schemas/function-like.ts
CHANGED
|
@@ -33,13 +33,12 @@ export class FunctionLikeSchema extends SchemaNode {
|
|
|
33
33
|
constructor(
|
|
34
34
|
readonly location: Location,
|
|
35
35
|
readonly name: string,
|
|
36
|
-
// readonly doc: any,
|
|
37
36
|
params: ParameterSchema[],
|
|
38
|
-
|
|
39
37
|
returnType: SchemaNode,
|
|
40
38
|
readonly signature: string,
|
|
41
39
|
readonly modifiers: Modifier[] = [],
|
|
42
|
-
doc?: DocSchema
|
|
40
|
+
doc?: DocSchema,
|
|
41
|
+
readonly typeParams?: string[] // generics e.g. <T>myFunction
|
|
43
42
|
) {
|
|
44
43
|
super();
|
|
45
44
|
this.params = params;
|
|
@@ -49,7 +48,10 @@ export class FunctionLikeSchema extends SchemaNode {
|
|
|
49
48
|
|
|
50
49
|
toString() {
|
|
51
50
|
const paramsStr = this.params.map((param) => param.toString()).join(', ');
|
|
52
|
-
|
|
51
|
+
const typeParamsStr = this.typeParams ? `<${this.typeParams.join(', ')}>` : '';
|
|
52
|
+
return `${this.modifiersToString()}${typeParamsStr}${chalk.bold(
|
|
53
|
+
this.name
|
|
54
|
+
)}(${paramsStr}): ${this.returnType.toString()}`;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
isDeprecated(): boolean {
|
package/tsconfig.json
CHANGED
|
Binary file
|