@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.
@@ -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
- // readonly doc: any,
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
- return `${this.modifiersToString()}${chalk_1.default.bold(this.name)}(${paramsStr}): ${this.returnType.toString()}`;
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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AAS,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.16",
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.16"
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.16/dist/semantic-schema.docs.md')]
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')]
@@ -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
- return `${this.modifiersToString()}${chalk.bold(this.name)}(${paramsStr}): ${this.returnType.toString()}`;
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
@@ -22,6 +22,11 @@
22
22
  "resolveJsonModule": true
23
23
  },
24
24
  "exclude": [
25
- "dist"
25
+ "dist",
26
+ "package.json"
27
+ ],
28
+ "include": [
29
+ "**/*",
30
+ "**/*.json"
26
31
  ]
27
32
  }