@teambit/typescript 0.0.740 → 0.0.743

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.
Files changed (73) hide show
  1. package/dist/schema-extractor-context.d.ts +4 -6
  2. package/dist/schema-extractor-context.js +37 -27
  3. package/dist/schema-extractor-context.js.map +1 -1
  4. package/dist/transformers/class-deceleration.js +10 -40
  5. package/dist/transformers/class-deceleration.js.map +1 -1
  6. package/dist/transformers/export-declaration.js +9 -2
  7. package/dist/transformers/export-declaration.js.map +1 -1
  8. package/dist/transformers/index.d.ts +0 -6
  9. package/dist/transformers/index.js +0 -96
  10. package/dist/transformers/index.js.map +1 -1
  11. package/dist/transformers/interface-declaration.js +13 -6
  12. package/dist/transformers/interface-declaration.js.map +1 -1
  13. package/dist/transformers/type-alias.js +2 -5
  14. package/dist/transformers/type-alias.js.map +1 -1
  15. package/dist/transformers/utils/class-element-to-schema.d.ts +4 -0
  16. package/dist/transformers/utils/class-element-to-schema.js +122 -0
  17. package/dist/transformers/utils/class-element-to-schema.js.map +1 -0
  18. package/dist/transformers/utils/jsdoc-to-doc-schema.d.ts +4 -0
  19. package/dist/transformers/utils/jsdoc-to-doc-schema.js +163 -0
  20. package/dist/transformers/utils/jsdoc-to-doc-schema.js.map +1 -0
  21. package/dist/transformers/utils/to-function-schema.d.ts +1 -1
  22. package/dist/transformers/utils/to-function-schema.js +17 -7
  23. package/dist/transformers/utils/to-function-schema.js.map +1 -1
  24. package/dist/transformers/utils/type-element-to-schema.d.ts +7 -0
  25. package/dist/transformers/utils/type-element-to-schema.js +134 -0
  26. package/dist/transformers/utils/type-element-to-schema.js.map +1 -0
  27. package/dist/transformers/utils/type-node-to-schema.js +50 -9
  28. package/dist/transformers/utils/type-node-to-schema.js.map +1 -1
  29. package/dist/transformers/variable-declaration.js +15 -1
  30. package/dist/transformers/variable-declaration.js.map +1 -1
  31. package/dist/typescript.extractor.js +1 -1
  32. package/dist/typescript.extractor.js.map +1 -1
  33. package/dist/typescript.main.runtime.js +1 -1
  34. package/dist/typescript.main.runtime.js.map +1 -1
  35. package/package-tar/teambit-typescript-0.0.743.tgz +0 -0
  36. package/package.json +16 -16
  37. package/{preview-1653449228788.js → preview-1653708349111.js} +2 -2
  38. package/transformers/class-deceleration.ts +7 -26
  39. package/transformers/export-declaration.ts +7 -2
  40. package/transformers/index.ts +0 -6
  41. package/transformers/interface-declaration.ts +4 -6
  42. package/transformers/type-alias.ts +2 -3
  43. package/transformers/utils/class-element-to-schema.ts +61 -0
  44. package/transformers/utils/jsdoc-to-doc-schema.ts +81 -0
  45. package/transformers/utils/to-function-schema.ts +12 -8
  46. package/transformers/utils/type-element-to-schema.ts +72 -0
  47. package/transformers/utils/type-node-to-schema.ts +35 -8
  48. package/transformers/variable-declaration.ts +5 -2
  49. package/dist/transformers/constructor.d.ts +0 -10
  50. package/dist/transformers/constructor.js +0 -70
  51. package/dist/transformers/constructor.js.map +0 -1
  52. package/dist/transformers/index-signature.d.ts +0 -9
  53. package/dist/transformers/index-signature.js +0 -71
  54. package/dist/transformers/index-signature.js.map +0 -1
  55. package/dist/transformers/method-declaration.d.ts +0 -11
  56. package/dist/transformers/method-declaration.js +0 -65
  57. package/dist/transformers/method-declaration.js.map +0 -1
  58. package/dist/transformers/method-signature.d.ts +0 -10
  59. package/dist/transformers/method-signature.js +0 -53
  60. package/dist/transformers/method-signature.js.map +0 -1
  61. package/dist/transformers/property-declaration.d.ts +0 -11
  62. package/dist/transformers/property-declaration.js +0 -80
  63. package/dist/transformers/property-declaration.js.map +0 -1
  64. package/dist/transformers/property-signature.d.ts +0 -10
  65. package/dist/transformers/property-signature.js +0 -87
  66. package/dist/transformers/property-signature.js.map +0 -1
  67. package/package-tar/teambit-typescript-0.0.740.tgz +0 -0
  68. package/transformers/constructor.ts +0 -22
  69. package/transformers/index-signature.ts +0 -22
  70. package/transformers/method-declaration.ts +0 -24
  71. package/transformers/method-signature.ts +0 -23
  72. package/transformers/property-declaration.ts +0 -30
  73. package/transformers/property-signature.ts +0 -34
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", {
10
10
  exports.InterfaceDeclarationTransformer = void 0;
11
11
 
12
12
  function _typescript() {
13
- const data = _interopRequireDefault(require("typescript"));
13
+ const data = require("typescript");
14
14
 
15
15
  _typescript = function () {
16
16
  return data;
@@ -49,9 +49,19 @@ function _exportIdentifier() {
49
49
  return data;
50
50
  }
51
51
 
52
+ function _typeElementToSchema() {
53
+ const data = require("./utils/type-element-to-schema");
54
+
55
+ _typeElementToSchema = function () {
56
+ return data;
57
+ };
58
+
59
+ return data;
60
+ }
61
+
52
62
  class InterfaceDeclarationTransformer {
53
63
  predicate(node) {
54
- return node.kind === _typescript().default.SyntaxKind.InterfaceDeclaration;
64
+ return node.kind === _typescript().SyntaxKind.InterfaceDeclaration;
55
65
  }
56
66
 
57
67
  async getIdentifiers(node) {
@@ -59,10 +69,7 @@ class InterfaceDeclarationTransformer {
59
69
  }
60
70
 
61
71
  async transform(interfaceDec, context) {
62
- const members = await (0, _pMapSeries().default)(interfaceDec.members, async member => {
63
- const typeSchema = await context.computeSchema(member);
64
- return typeSchema;
65
- });
72
+ const members = await (0, _pMapSeries().default)(interfaceDec.members, member => (0, _typeElementToSchema().typeElementToSchema)(member, context));
66
73
  return new (_semanticsEntities().InterfaceSchema)(context.getLocation(interfaceDec), interfaceDec.name.getText(), members);
67
74
  }
68
75
 
@@ -1 +1 @@
1
- {"version":3,"names":["InterfaceDeclarationTransformer","predicate","node","kind","ts","SyntaxKind","InterfaceDeclaration","getIdentifiers","ExportIdentifier","name","getText","getSourceFile","fileName","transform","interfaceDec","context","members","pMapSeries","member","typeSchema","computeSchema","InterfaceSchema","getLocation"],"sources":["interface-declaration.ts"],"sourcesContent":["import ts, { Node, InterfaceDeclaration } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { InterfaceSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { ExportIdentifier } from '../export-identifier';\n\nexport class InterfaceDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.InterfaceDeclaration;\n }\n\n async getIdentifiers(node: InterfaceDeclaration): Promise<ExportIdentifier[]> {\n return [new ExportIdentifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n async transform(interfaceDec: InterfaceDeclaration, context: SchemaExtractorContext) {\n const members = await pMapSeries(interfaceDec.members, async (member) => {\n const typeSchema = await context.computeSchema(member);\n return typeSchema;\n });\n return new InterfaceSchema(context.getLocation(interfaceDec), interfaceDec.name.getText(), members);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,+BAAN,CAAmE;EACxEC,SAAS,CAACC,IAAD,EAAa;IACpB,OAAOA,IAAI,CAACC,IAAL,KAAcC,qBAAA,CAAGC,UAAH,CAAcC,oBAAnC;EACD;;EAEmB,MAAdC,cAAc,CAACL,IAAD,EAA0D;IAC5E,OAAO,CAAC,KAAIM,oCAAJ,EAAqBN,IAAI,CAACO,IAAL,CAAUC,OAAV,EAArB,EAA0CR,IAAI,CAACS,aAAL,GAAqBC,QAA/D,CAAD,CAAP;EACD;;EAEc,MAATC,SAAS,CAACC,YAAD,EAAqCC,OAArC,EAAsE;IACnF,MAAMC,OAAO,GAAG,MAAM,IAAAC,qBAAA,EAAWH,YAAY,CAACE,OAAxB,EAAiC,MAAOE,MAAP,IAAkB;MACvE,MAAMC,UAAU,GAAG,MAAMJ,OAAO,CAACK,aAAR,CAAsBF,MAAtB,CAAzB;MACA,OAAOC,UAAP;IACD,CAHqB,CAAtB;IAIA,OAAO,KAAIE,oCAAJ,EAAoBN,OAAO,CAACO,WAAR,CAAoBR,YAApB,CAApB,EAAuDA,YAAY,CAACL,IAAb,CAAkBC,OAAlB,EAAvD,EAAoFM,OAApF,CAAP;EACD;;AAfuE"}
1
+ {"version":3,"names":["InterfaceDeclarationTransformer","predicate","node","kind","SyntaxKind","InterfaceDeclaration","getIdentifiers","ExportIdentifier","name","getText","getSourceFile","fileName","transform","interfaceDec","context","members","pMapSeries","member","typeElementToSchema","InterfaceSchema","getLocation"],"sources":["interface-declaration.ts"],"sourcesContent":["import { Node, InterfaceDeclaration, SyntaxKind } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { InterfaceSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { ExportIdentifier } from '../export-identifier';\nimport { typeElementToSchema } from './utils/type-element-to-schema';\n\nexport class InterfaceDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.InterfaceDeclaration;\n }\n\n async getIdentifiers(node: InterfaceDeclaration): Promise<ExportIdentifier[]> {\n return [new ExportIdentifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n async transform(interfaceDec: InterfaceDeclaration, context: SchemaExtractorContext) {\n const members = await pMapSeries(interfaceDec.members, (member) => typeElementToSchema(member, context));\n return new InterfaceSchema(context.getLocation(interfaceDec), interfaceDec.name.getText(), members);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,+BAAN,CAAmE;EACxEC,SAAS,CAACC,IAAD,EAAa;IACpB,OAAOA,IAAI,CAACC,IAAL,KAAcC,wBAAA,CAAWC,oBAAhC;EACD;;EAEmB,MAAdC,cAAc,CAACJ,IAAD,EAA0D;IAC5E,OAAO,CAAC,KAAIK,oCAAJ,EAAqBL,IAAI,CAACM,IAAL,CAAUC,OAAV,EAArB,EAA0CP,IAAI,CAACQ,aAAL,GAAqBC,QAA/D,CAAD,CAAP;EACD;;EAEc,MAATC,SAAS,CAACC,YAAD,EAAqCC,OAArC,EAAsE;IACnF,MAAMC,OAAO,GAAG,MAAM,IAAAC,qBAAA,EAAWH,YAAY,CAACE,OAAxB,EAAkCE,MAAD,IAAY,IAAAC,0CAAA,EAAoBD,MAApB,EAA4BH,OAA5B,CAA7C,CAAtB;IACA,OAAO,KAAIK,oCAAJ,EAAoBL,OAAO,CAACM,WAAR,CAAoBP,YAApB,CAApB,EAAuDA,YAAY,CAACL,IAAb,CAAkBC,OAAlB,EAAvD,EAAoFM,OAApF,CAAP;EACD;;AAZuE"}
@@ -63,12 +63,9 @@ class TypeAliasTransformer {
63
63
  }
64
64
 
65
65
  async transform(typeAlias, context) {
66
- var _info$body;
67
-
68
66
  const type = await (0, _typeNodeToSchema().typeNodeToSchema)(typeAlias.type, context);
69
- const info = await context.getQuickInfo(typeAlias.name);
70
- const displaySig = info === null || info === void 0 ? void 0 : (_info$body = info.body) === null || _info$body === void 0 ? void 0 : _info$body.displayString;
71
- return new (_semanticsEntities().TypeSchema)(context.getLocation(typeAlias), this.getName(typeAlias), type, displaySig || '');
67
+ const displaySig = await context.getQuickInfoDisplayString(typeAlias.name);
68
+ return new (_semanticsEntities().TypeSchema)(context.getLocation(typeAlias), this.getName(typeAlias), type, displaySig);
72
69
  }
73
70
 
74
71
  }
@@ -1 +1 @@
1
- {"version":3,"names":["TypeAliasTransformer","predicate","node","kind","ts","SyntaxKind","TypeAliasDeclaration","getIdentifiers","ExportIdentifier","name","getText","getSourceFile","fileName","getName","transform","typeAlias","context","type","typeNodeToSchema","info","getQuickInfo","displaySig","body","displayString","TypeSchema","getLocation"],"sources":["type-alias.ts"],"sourcesContent":["import ts, { Node, TypeAliasDeclaration } from 'typescript';\nimport { TypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { ExportIdentifier } from '../export-identifier';\nimport { typeNodeToSchema } from './utils/type-node-to-schema';\n\nexport class TypeAliasTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.TypeAliasDeclaration;\n }\n\n async getIdentifiers(node: TypeAliasDeclaration) {\n return [new ExportIdentifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n private getName(node: TypeAliasDeclaration): string {\n return node.name.getText();\n }\n\n async transform(typeAlias: TypeAliasDeclaration, context: SchemaExtractorContext) {\n const type = await typeNodeToSchema(typeAlias.type, context);\n const info = await context.getQuickInfo(typeAlias.name);\n const displaySig = info?.body?.displayString;\n return new TypeSchema(context.getLocation(typeAlias), this.getName(typeAlias), type, displaySig || '');\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,oBAAN,CAAwD;EAC7DC,SAAS,CAACC,IAAD,EAAa;IACpB,OAAOA,IAAI,CAACC,IAAL,KAAcC,qBAAA,CAAGC,UAAH,CAAcC,oBAAnC;EACD;;EAEmB,MAAdC,cAAc,CAACL,IAAD,EAA6B;IAC/C,OAAO,CAAC,KAAIM,oCAAJ,EAAqBN,IAAI,CAACO,IAAL,CAAUC,OAAV,EAArB,EAA0CR,IAAI,CAACS,aAAL,GAAqBC,QAA/D,CAAD,CAAP;EACD;;EAEOC,OAAO,CAACX,IAAD,EAAqC;IAClD,OAAOA,IAAI,CAACO,IAAL,CAAUC,OAAV,EAAP;EACD;;EAEc,MAATI,SAAS,CAACC,SAAD,EAAkCC,OAAlC,EAAmE;IAAA;;IAChF,MAAMC,IAAI,GAAG,MAAM,IAAAC,oCAAA,EAAiBH,SAAS,CAACE,IAA3B,EAAiCD,OAAjC,CAAnB;IACA,MAAMG,IAAI,GAAG,MAAMH,OAAO,CAACI,YAAR,CAAqBL,SAAS,CAACN,IAA/B,CAAnB;IACA,MAAMY,UAAU,GAAGF,IAAH,aAAGA,IAAH,qCAAGA,IAAI,CAAEG,IAAT,+CAAG,WAAYC,aAA/B;IACA,OAAO,KAAIC,+BAAJ,EAAeR,OAAO,CAACS,WAAR,CAAoBV,SAApB,CAAf,EAA+C,KAAKF,OAAL,CAAaE,SAAb,CAA/C,EAAwEE,IAAxE,EAA8EI,UAAU,IAAI,EAA5F,CAAP;EACD;;AAlB4D"}
1
+ {"version":3,"names":["TypeAliasTransformer","predicate","node","kind","ts","SyntaxKind","TypeAliasDeclaration","getIdentifiers","ExportIdentifier","name","getText","getSourceFile","fileName","getName","transform","typeAlias","context","type","typeNodeToSchema","displaySig","getQuickInfoDisplayString","TypeSchema","getLocation"],"sources":["type-alias.ts"],"sourcesContent":["import ts, { Node, TypeAliasDeclaration } from 'typescript';\nimport { TypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { ExportIdentifier } from '../export-identifier';\nimport { typeNodeToSchema } from './utils/type-node-to-schema';\n\nexport class TypeAliasTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.TypeAliasDeclaration;\n }\n\n async getIdentifiers(node: TypeAliasDeclaration) {\n return [new ExportIdentifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n private getName(node: TypeAliasDeclaration): string {\n return node.name.getText();\n }\n\n async transform(typeAlias: TypeAliasDeclaration, context: SchemaExtractorContext) {\n const type = await typeNodeToSchema(typeAlias.type, context);\n const displaySig = await context.getQuickInfoDisplayString(typeAlias.name);\n return new TypeSchema(context.getLocation(typeAlias), this.getName(typeAlias), type, displaySig);\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,MAAMA,oBAAN,CAAwD;EAC7DC,SAAS,CAACC,IAAD,EAAa;IACpB,OAAOA,IAAI,CAACC,IAAL,KAAcC,qBAAA,CAAGC,UAAH,CAAcC,oBAAnC;EACD;;EAEmB,MAAdC,cAAc,CAACL,IAAD,EAA6B;IAC/C,OAAO,CAAC,KAAIM,oCAAJ,EAAqBN,IAAI,CAACO,IAAL,CAAUC,OAAV,EAArB,EAA0CR,IAAI,CAACS,aAAL,GAAqBC,QAA/D,CAAD,CAAP;EACD;;EAEOC,OAAO,CAACX,IAAD,EAAqC;IAClD,OAAOA,IAAI,CAACO,IAAL,CAAUC,OAAV,EAAP;EACD;;EAEc,MAATI,SAAS,CAACC,SAAD,EAAkCC,OAAlC,EAAmE;IAChF,MAAMC,IAAI,GAAG,MAAM,IAAAC,oCAAA,EAAiBH,SAAS,CAACE,IAA3B,EAAiCD,OAAjC,CAAnB;IACA,MAAMG,UAAU,GAAG,MAAMH,OAAO,CAACI,yBAAR,CAAkCL,SAAS,CAACN,IAA5C,CAAzB;IACA,OAAO,KAAIY,+BAAJ,EAAeL,OAAO,CAACM,WAAR,CAAoBP,SAApB,CAAf,EAA+C,KAAKF,OAAL,CAAaE,SAAb,CAA/C,EAAwEE,IAAxE,EAA8EE,UAA9E,CAAP;EACD;;AAjB4D"}
@@ -0,0 +1,4 @@
1
+ import { ClassElement } from 'typescript';
2
+ import { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
3
+ import { SchemaExtractorContext } from '../../schema-extractor-context';
4
+ export declare function classElementToSchema(node: ClassElement, context: SchemaExtractorContext): Promise<SchemaNode | null>;
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.promise.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.classElementToSchema = classElementToSchema;
9
+
10
+ function _typescript() {
11
+ const data = require("typescript");
12
+
13
+ _typescript = function () {
14
+ return data;
15
+ };
16
+
17
+ return data;
18
+ }
19
+
20
+ function _semanticsEntities() {
21
+ const data = require("@teambit/semantics.entities.semantic-schema");
22
+
23
+ _semanticsEntities = function () {
24
+ return data;
25
+ };
26
+
27
+ return data;
28
+ }
29
+
30
+ function _getParams() {
31
+ const data = require("./get-params");
32
+
33
+ _getParams = function () {
34
+ return data;
35
+ };
36
+
37
+ return data;
38
+ }
39
+
40
+ function _typeElementToSchema() {
41
+ const data = require("./type-element-to-schema");
42
+
43
+ _typeElementToSchema = function () {
44
+ return data;
45
+ };
46
+
47
+ return data;
48
+ }
49
+
50
+ function _parseTypeFromQuickInfo() {
51
+ const data = require("./parse-type-from-quick-info");
52
+
53
+ _parseTypeFromQuickInfo = function () {
54
+ return data;
55
+ };
56
+
57
+ return data;
58
+ }
59
+
60
+ function _toFunctionSchema() {
61
+ const data = require("./to-function-schema");
62
+
63
+ _toFunctionSchema = function () {
64
+ return data;
65
+ };
66
+
67
+ return data;
68
+ }
69
+
70
+ async function classElementToSchema(node, context) {
71
+ switch (node.kind) {
72
+ case _typescript().SyntaxKind.Constructor:
73
+ return constructor(node, context);
74
+
75
+ case _typescript().SyntaxKind.PropertyDeclaration:
76
+ return propertyDeclaration(node, context);
77
+
78
+ case _typescript().SyntaxKind.MethodDeclaration:
79
+ return methodDeclaration(node, context);
80
+
81
+ case _typescript().SyntaxKind.GetAccessor:
82
+ return (0, _typeElementToSchema().getAccessor)(node, context);
83
+
84
+ case _typescript().SyntaxKind.SetAccessor:
85
+ return (0, _typeElementToSchema().setAccessor)(node, context);
86
+
87
+ case _typescript().SyntaxKind.IndexSignature:
88
+ return (0, _typeElementToSchema().indexSignature)(node, context);
89
+
90
+ case _typescript().SyntaxKind.ClassStaticBlockDeclaration: // not sure what is it, but the name sounds like not something we need
91
+
92
+ case _typescript().SyntaxKind.SemicolonClassElement:
93
+ // seems to be just a semicolon
94
+ return null;
95
+
96
+ default:
97
+ // should never be here unless typescript added new class elements
98
+ throw new Error(`unrecognized ClassElement type. got ${node.kind}`);
99
+ }
100
+ }
101
+
102
+ async function constructor(node, context) {
103
+ const args = await (0, _getParams().getParams)(node.parameters, context);
104
+ return new (_semanticsEntities().ConstructorSchema)(context.getLocation(node), args);
105
+ }
106
+
107
+ async function propertyDeclaration(node, context) {
108
+ var _info$body;
109
+
110
+ const name = node.name.getText();
111
+ const info = await context.getQuickInfo(node.name);
112
+ const displaySig = info === null || info === void 0 ? void 0 : (_info$body = info.body) === null || _info$body === void 0 ? void 0 : _info$body.displayString;
113
+ const typeStr = (0, _parseTypeFromQuickInfo().parseTypeFromQuickInfo)(info);
114
+ const type = await context.resolveType(node, typeStr);
115
+ return new (_semanticsEntities().VariableSchema)(context.getLocation(node), name, displaySig || '', type);
116
+ }
117
+
118
+ async function methodDeclaration(node, context) {
119
+ return (0, _toFunctionSchema().toFunctionLikeSchema)(node, context);
120
+ }
121
+
122
+ //# sourceMappingURL=class-element-to-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["classElementToSchema","node","context","kind","SyntaxKind","Constructor","constructor","PropertyDeclaration","propertyDeclaration","MethodDeclaration","methodDeclaration","GetAccessor","getAccessor","SetAccessor","setAccessor","IndexSignature","indexSignature","ClassStaticBlockDeclaration","SemicolonClassElement","Error","args","getParams","parameters","ConstructorSchema","getLocation","name","getText","info","getQuickInfo","displaySig","body","displayString","typeStr","parseTypeFromQuickInfo","type","resolveType","VariableSchema","toFunctionLikeSchema"],"sources":["class-element-to-schema.ts"],"sourcesContent":["import {\n ClassElement,\n ConstructorDeclaration,\n GetAccessorDeclaration,\n IndexSignatureDeclaration,\n MethodDeclaration,\n PropertyDeclaration,\n SetAccessorDeclaration,\n SyntaxKind,\n} from 'typescript';\nimport { ConstructorSchema, SchemaNode, VariableSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaExtractorContext } from '../../schema-extractor-context';\nimport { getParams } from './get-params';\nimport { getAccessor, indexSignature, setAccessor } from './type-element-to-schema';\nimport { parseTypeFromQuickInfo } from './parse-type-from-quick-info';\nimport { toFunctionLikeSchema } from './to-function-schema';\n\nexport async function classElementToSchema(\n node: ClassElement,\n context: SchemaExtractorContext\n): Promise<SchemaNode | null> {\n switch (node.kind) {\n case SyntaxKind.Constructor:\n return constructor(node as ConstructorDeclaration, context);\n case SyntaxKind.PropertyDeclaration:\n return propertyDeclaration(node as PropertyDeclaration, context);\n case SyntaxKind.MethodDeclaration:\n return methodDeclaration(node as MethodDeclaration, context);\n case SyntaxKind.GetAccessor:\n return getAccessor(node as GetAccessorDeclaration, context);\n case SyntaxKind.SetAccessor:\n return setAccessor(node as SetAccessorDeclaration, context);\n case SyntaxKind.IndexSignature:\n return indexSignature(node as IndexSignatureDeclaration, context);\n case SyntaxKind.ClassStaticBlockDeclaration: // not sure what is it, but the name sounds like not something we need\n case SyntaxKind.SemicolonClassElement: // seems to be just a semicolon\n return null;\n default:\n // should never be here unless typescript added new class elements\n throw new Error(`unrecognized ClassElement type. got ${node.kind}`);\n }\n}\n\nasync function constructor(node: ConstructorDeclaration, context: SchemaExtractorContext) {\n const args = await getParams(node.parameters, context);\n return new ConstructorSchema(context.getLocation(node), args);\n}\n\nasync function propertyDeclaration(node: PropertyDeclaration, context: SchemaExtractorContext) {\n const name = node.name.getText();\n const info = await context.getQuickInfo(node.name);\n const displaySig = info?.body?.displayString;\n const typeStr = parseTypeFromQuickInfo(info);\n const type = await context.resolveType(node, typeStr);\n\n return new VariableSchema(context.getLocation(node), name, displaySig || '', type);\n}\n\nasync function methodDeclaration(node: MethodDeclaration, context: SchemaExtractorContext) {\n return toF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kB,IAAI,GAAG,MAAM,IAAAC,sBAAA,EAAUpB,IAAI,CAACqB,UAAf,EAA2BpB,OAA3B,CAAnB;EACA,OAAO,KAAIqB,sCAAJ,EAAsBrB,OAAO,CAACsB,WAAR,CAAoBvB,IAApB,CAAtB,EAAiDmB,IAAjD,CAAP;AACD;;AAED,eAAeZ,mBAAf,CAAmCP,IAAnC,EAA8DC,OAA9D,EAA+F;EAAA;;EAC7F,MAAMuB,IAAI,GAAGxB,IAAI,CAACwB,IAAL,CAAUC,OAAV,EAAb;EACA,MAAMC,IAAI,GAAG,MAAMzB,OAAO,CAAC0B,YAAR,CAAqB3B,IAAI,CAACwB,IAA1B,CAAnB;EACA,MAAMI,UAAU,GAAGF,IAAH,aAAGA,IAAH,qCAAGA,IAAI,CAAEG,IAAT,+CAAG,WAAYC,aAA/B;EACA,MAAMC,OAAO,GAAG,IAAAC,gDAAA,EAAuBN,IAAvB,CAAhB;EACA,MAAMO,IAAI,GAAG,MAAMhC,OAAO,CAACiC,WAAR,CAAoBlC,IAApB,EAA0B+B,OAA1B,CAAnB;EAEA,OAAO,KAAII,mCAAJ,EAAmBlC,OAAO,CAACsB,WAAR,CAAoBvB,IAApB,CAAnB,EAA8CwB,IAA9C,EAAoDI,UAAU,IAAI,EAAlE,EAAsEK,IAAtE,CAAP;AACD;;AAED,eAAexB,iBAAf,CAAiCT,IAAjC,EAA0DC,OAA1D,EAA2F;EACzF,OAAO,IAAAmC,wCAAA,EAAqBpC,IAArB,EAA2BC,OAA3B,CAAP;AACD"}
@@ -0,0 +1,4 @@
1
+ import { Node } from 'typescript';
2
+ import { DocSchema } from '@teambit/semantics.entities.semantic-schema';
3
+ import { SchemaExtractorContext } from '../../schema-extractor-context';
4
+ export declare function jsDocToDocSchema(node: Node, context: SchemaExtractorContext): Promise<DocSchema | undefined>;
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ require("core-js/modules/es.promise.js");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.jsDocToDocSchema = jsDocToDocSchema;
11
+
12
+ function _typescript() {
13
+ const data = require("typescript");
14
+
15
+ _typescript = function () {
16
+ return data;
17
+ };
18
+
19
+ return data;
20
+ }
21
+
22
+ function _tsutils() {
23
+ const data = require("tsutils");
24
+
25
+ _tsutils = function () {
26
+ return data;
27
+ };
28
+
29
+ return data;
30
+ }
31
+
32
+ function _pMapSeries() {
33
+ const data = _interopRequireDefault(require("p-map-series"));
34
+
35
+ _pMapSeries = function () {
36
+ return data;
37
+ };
38
+
39
+ return data;
40
+ }
41
+
42
+ function _semanticsEntities() {
43
+ const data = require("@teambit/semantics.entities.semantic-schema");
44
+
45
+ _semanticsEntities = function () {
46
+ return data;
47
+ };
48
+
49
+ return data;
50
+ }
51
+
52
+ function _typeNodeToSchema() {
53
+ const data = require("./type-node-to-schema");
54
+
55
+ _typeNodeToSchema = function () {
56
+ return data;
57
+ };
58
+
59
+ return data;
60
+ }
61
+
62
+ /* eslint-disable no-fallthrough */
63
+ async function jsDocToDocSchema(node, context) {
64
+ if (!(0, _tsutils().canHaveJsDoc)(node)) {
65
+ return undefined;
66
+ }
67
+
68
+ const jsDocs = (0, _tsutils().getJsDoc)(node);
69
+
70
+ if (!jsDocs.length) {
71
+ return undefined;
72
+ } // not sure how common it is to have multiple JSDocs. never seen it before.
73
+ // regardless, in typescript implementation of methods like `getJSDocDeprecatedTag()`, they use the first one. (`getFirstJSDocTag()`)
74
+
75
+
76
+ const jsDoc = jsDocs[0];
77
+ const location = context.getLocation(jsDoc);
78
+ const comment = (0, _typescript().getTextOfJSDocComment)(jsDoc.comment);
79
+ const tags = jsDoc.tags ? await (0, _pMapSeries().default)(jsDoc.tags, tag => tagParser(tag, context)) : undefined;
80
+ return new (_semanticsEntities().DocSchema)(location, comment, tags);
81
+ }
82
+
83
+ async function tagParser(tag, context) {
84
+ let tagName = tag.tagName.getText();
85
+
86
+ switch (tag.kind) {
87
+ case _typescript().SyntaxKind.JSDocReturnTag:
88
+ return returnTag(tag, context);
89
+
90
+ case _typescript().SyntaxKind.JSDocAugmentsTag:
91
+ tagName = _semanticsEntities().TagName.augments;
92
+
93
+ case _typescript().SyntaxKind.JSDocAuthorTag:
94
+ tagName = _semanticsEntities().TagName.author;
95
+
96
+ case _typescript().SyntaxKind.JSDocClassTag:
97
+ tagName = _semanticsEntities().TagName.class;
98
+
99
+ case _typescript().SyntaxKind.JSDocCallbackTag:
100
+ tagName = _semanticsEntities().TagName.callback;
101
+
102
+ case _typescript().SyntaxKind.JSDocPublicTag:
103
+ tagName = _semanticsEntities().TagName.public;
104
+
105
+ case _typescript().SyntaxKind.JSDocPrivateTag:
106
+ tagName = _semanticsEntities().TagName.private;
107
+
108
+ case _typescript().SyntaxKind.JSDocProtectedTag:
109
+ tagName = _semanticsEntities().TagName.protected;
110
+
111
+ case _typescript().SyntaxKind.JSDocReadonlyTag:
112
+ tagName = _semanticsEntities().TagName.readonly;
113
+
114
+ case _typescript().SyntaxKind.JSDocOverrideTag:
115
+ tagName = _semanticsEntities().TagName.override;
116
+
117
+ case _typescript().SyntaxKind.JSDocDeprecatedTag:
118
+ tagName = _semanticsEntities().TagName.deprecated;
119
+
120
+ case _typescript().SyntaxKind.JSDocSeeTag:
121
+ tagName = _semanticsEntities().TagName.see;
122
+
123
+ case _typescript().SyntaxKind.JSDocEnumTag:
124
+ tagName = _semanticsEntities().TagName.enum;
125
+
126
+ case _typescript().SyntaxKind.JSDocParameterTag:
127
+ tagName = _semanticsEntities().TagName.parameter;
128
+
129
+ case _typescript().SyntaxKind.JSDocThisTag:
130
+ tagName = _semanticsEntities().TagName.this;
131
+
132
+ case _typescript().SyntaxKind.JSDocTypeTag:
133
+ tagName = _semanticsEntities().TagName.type;
134
+
135
+ case _typescript().SyntaxKind.JSDocTemplateTag:
136
+ tagName = _semanticsEntities().TagName.template;
137
+
138
+ case _typescript().SyntaxKind.JSDocTypedefTag:
139
+ tagName = _semanticsEntities().TagName.typedef;
140
+
141
+ case _typescript().SyntaxKind.JSDocPropertyTag:
142
+ tagName = _semanticsEntities().TagName.property;
143
+
144
+ case _typescript().SyntaxKind.JSDocImplementsTag:
145
+ tagName = _semanticsEntities().TagName.implements;
146
+
147
+ default:
148
+ return simpleTag(tag, tagName, context);
149
+ }
150
+ }
151
+
152
+ function simpleTag(tag, tagName, context) {
153
+ return new (_semanticsEntities().TagSchema)(context.getLocation(tag), tagName, (0, _typescript().getTextOfJSDocComment)(tag.comment));
154
+ }
155
+
156
+ async function returnTag(tag, context) {
157
+ var _tag$typeExpression, _tag$typeExpression2;
158
+
159
+ const type = (_tag$typeExpression = tag.typeExpression) !== null && _tag$typeExpression !== void 0 && _tag$typeExpression.type ? await (0, _typeNodeToSchema().typeNodeToSchema)((_tag$typeExpression2 = tag.typeExpression) === null || _tag$typeExpression2 === void 0 ? void 0 : _tag$typeExpression2.type, context) : undefined;
160
+ return new (_semanticsEntities().ReturnTagSchema)(context.getLocation(tag), _semanticsEntities().TagName.return, (0, _typescript().getTextOfJSDocComment)(tag.comment), type);
161
+ }
162
+
163
+ //# sourceMappingURL=jsdoc-to-doc-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["jsDocToDocSchema","node","context","canHaveJsDoc","undefined","jsDocs","getJsDoc","length","jsDoc","location","getLocation","comment","getTextOfJSDocComment","tags","pMapSeries","tag","tagParser","DocSchema","tagName","getText","kind","SyntaxKind","JSDocReturnTag","returnTag","JSDocAugmentsTag","TagName","augments","JSDocAuthorTag","author","JSDocClassTag","class","JSDocCallbackTag","callback","JSDocPublicTag","public","JSDocPrivateTag","private","JSDocProtectedTag","protected","JSDocReadonlyTag","readonly","JSDocOverrideTag","override","JSDocDeprecatedTag","deprecated","JSDocSeeTag","see","JSDocEnumTag","enum","JSDocParameterTag","parameter","JSDocThisTag","this","JSDocTypeTag","type","JSDocTemplateTag","template","JSDocTypedefTag","typedef","JSDocPropertyTag","property","JSDocImplementsTag","implements","simpleTag","TagSchema","typeExpression","typeNodeToSchema","ReturnTagSchema","return"],"sources":["jsdoc-to-doc-schema.ts"],"sourcesContent":["/* eslint-disable no-fallthrough */\nimport { getTextOfJSDocComment, JSDocReturnTag, JSDocTag, Node, SyntaxKind } from 'typescript';\nimport { getJsDoc, canHaveJsDoc } from 'tsutils';\nimport pMapSeries from 'p-map-series';\nimport { DocSchema, ReturnTagSchema, TagName, TagSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaExtractorContext } from '../../schema-extractor-context';\nimport { typeNodeToSchema } from './type-node-to-schema';\n\nexport async function jsDocToDocSchema(node: Node, context: SchemaExtractorContext): Promise<DocSchema | undefined> {\n if (!canHaveJsDoc(node)) {\n return undefined;\n }\n const jsDocs = getJsDoc(node);\n if (!jsDocs.length) {\n return undefined;\n }\n // not sure how common it is to have multiple JSDocs. never seen it before.\n // regardless, in typescript implementation of methods like `getJSDocDeprecatedTag()`, they use the first one. (`getFirstJSDocTag()`)\n const jsDoc = jsDocs[0];\n const location = context.getLocation(jsDoc);\n const comment = getTextOfJSDocComment(jsDoc.comment);\n const tags = jsDoc.tags ? await pMapSeries(jsDoc.tags, (tag) => tagParser(tag, context)) : undefined;\n return new DocSchema(location, comment, tags);\n}\n\nasync function tagParser(tag: JSDocTag, context: SchemaExtractorContext): Promise<TagSchema> {\n let tagName: TagName | string = tag.tagName.getText();\n switch (tag.kind) {\n case SyntaxKind.JSDocReturnTag:\n return returnTag(tag as JSDocReturnTag, context);\n case SyntaxKind.JSDocAugmentsTag:\n tagName = TagName.augments;\n case SyntaxKind.JSDocAuthorTag:\n tagName = TagName.author;\n case SyntaxKind.JSDocClassTag:\n tagName = TagName.class;\n case SyntaxKind.JSDocCallbackTag:\n tagName = TagName.callback;\n case SyntaxKind.JSDocPublicTag:\n tagName = TagName.public;\n case SyntaxKind.JSDocPrivateTag:\n tagName = TagName.private;\n case SyntaxKind.JSDocProtectedTag:\n tagName = TagName.protected;\n case SyntaxKind.JSDocReadonlyTag:\n tagName = TagName.readonly;\n case SyntaxKind.JSDocOverrideTag:\n tagName = TagName.override;\n case SyntaxKind.JSDocDeprecatedTag:\n tagName = TagName.deprecated;\n case SyntaxKind.JSDocSeeTag:\n tagName = TagName.see;\n case SyntaxKind.JSDocEnumTag:\n tagName = TagName.enum;\n case SyntaxKind.JSDocParameterTag:\n tagName = TagName.parameter;\n case SyntaxKind.JSDocThisTag:\n tagName = TagName.this;\n case SyntaxKind.JSDocTypeTag:\n tagName = TagName.type;\n case SyntaxKind.JSDocTemplateTag:\n tagName = TagName.template;\n case SyntaxKind.JSDocTypedefTag:\n tagName = TagName.typedef;\n case SyntaxKind.JSDocPropertyTag:\n tagName = TagName.property;\n case SyntaxKind.JSDocImplementsTag:\n tagName = TagName.implements;\n default:\n return simpleTag(tag, tagName, context);\n }\n}\n\nfunction simpleTag(tag: JSDocTag, tagName: TagName | string, context: SchemaExtractorContext): TagSchema {\n return new TagSchema(context.getLocation(tag), tagName, getTextOfJSDocComment(tag.comment));\n}\n\nasync function returnTag(tag: JSDocReturnTag, context: SchemaExtractorContext) {\n const type = tag.typeExpression?.type ? await typeNodeToSchema(tag.typeExpression?.type, context) : undefined;\n return new ReturnTagSchema(context.getLocation(tag), TagName.return, getTextOfJSDocComment(tag.comment), type);\n}\n"],"mappings":";;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AANA;AAQO,eAAeA,gBAAf,CAAgCC,IAAhC,EAA4CC,OAA5C,EAA6G;EAClH,IAAI,CAAC,IAAAC,uBAAA,EAAaF,IAAb,CAAL,EAAyB;IACvB,OAAOG,SAAP;EACD;;EACD,MAAMC,MAAM,GAAG,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kCG,OAAlC,EAA6DhB,OAA7D,EAAyG;EACvG,OAAO,KAAI8D,8BAAJ,EAAc9D,OAAO,CAACQ,WAAR,CAAoBK,GAApB,CAAd,EAAwCG,OAAxC,EAAiD,IAAAN,mCAAA,EAAsBG,GAAG,CAACJ,OAA1B,CAAjD,CAAP;AACD;;AAED,eAAeY,SAAf,CAAyBR,GAAzB,EAA8Cb,OAA9C,EAA+E;EAAA;;EAC7E,MAAMoD,IAAI,GAAG,uBAAAvC,GAAG,CAACkD,cAAJ,oEAAoBX,IAApB,GAA2B,MAAM,IAAAY,oCAAA,0BAAiBnD,GAAG,CAACkD,cAArB,yDAAiB,qBAAoBX,IAArC,EAA2CpD,OAA3C,CAAjC,GAAuFE,SAApG;EACA,OAAO,KAAI+D,oCAAJ,EAAoBjE,OAAO,CAACQ,WAAR,CAAoBK,GAApB,CAApB,EAA8CU,4BAAA,CAAQ2C,MAAtD,EAA8D,IAAAxD,mCAAA,EAAsBG,GAAG,CAACJ,OAA1B,CAA9D,EAAkG2C,IAAlG,CAAP;AACD"}
@@ -1,4 +1,4 @@
1
1
  import { SignatureDeclaration } from 'typescript';
2
2
  import { FunctionLikeSchema } from '@teambit/semantics.entities.semantic-schema';
3
3
  import { SchemaExtractorContext } from '../../schema-extractor-context';
4
- export declare function toFunctionLikeSchema(node: SignatureDeclaration, context: SchemaExtractorContext): Promise<FunctionLikeSchema>;
4
+ export declare function toFunctionLikeSchema(node: SignatureDeclaration, context: SchemaExtractorContext, funcName?: string): Promise<FunctionLikeSchema>;
@@ -37,19 +37,29 @@ function _parseTypeFromQuickInfo() {
37
37
  return data;
38
38
  }
39
39
 
40
- async function toFunctionLikeSchema(node, context) {
41
- var _node$name, _info$body, _node$modifiers;
40
+ function _jsdocToDocSchema() {
41
+ const data = require("./jsdoc-to-doc-schema");
42
+
43
+ _jsdocToDocSchema = function () {
44
+ return data;
45
+ };
42
46
 
43
- const name = ((_node$name = node.name) === null || _node$name === void 0 ? void 0 : _node$name.getText()) || ''; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
47
+ return data;
48
+ }
49
+
50
+ async function toFunctionLikeSchema(node, context, funcName) {
51
+ var _node$name, _info$body, _node$modifiers;
44
52
 
45
- const info = await context.getQuickInfo(node.name);
46
- const returnTypeStr = (0, _parseTypeFromQuickInfo().parseTypeFromQuickInfo)(info);
53
+ const name = funcName || ((_node$name = node.name) === null || _node$name === void 0 ? void 0 : _node$name.getText()) || '';
54
+ const info = node.name ? await context.getQuickInfo(node.name) : null;
55
+ const returnTypeStr = info ? (0, _parseTypeFromQuickInfo().parseTypeFromQuickInfo)(info) : 'any';
47
56
  const displaySig = (info === null || info === void 0 ? void 0 : (_info$body = info.body) === null || _info$body === void 0 ? void 0 : _info$body.displayString) || '';
48
57
  const args = await (0, _getParams().getParams)(node.parameters, context);
49
- const returnType = await context.resolveType(node, returnTypeStr);
58
+ const returnType = await context.resolveType(node, returnTypeStr, Boolean(info));
50
59
  const modifiers = ((_node$modifiers = node.modifiers) === null || _node$modifiers === void 0 ? void 0 : _node$modifiers.map(modifier => modifier.getText())) || [];
51
60
  const location = context.getLocation(node);
52
- return new (_semanticsEntities().FunctionLikeSchema)(location, name, args, returnType, displaySig, modifiers);
61
+ const doc = await (0, _jsdocToDocSchema().jsDocToDocSchema)(node, context);
62
+ return new (_semanticsEntities().FunctionLikeSchema)(location, name, args, returnType, displaySig, modifiers, doc);
53
63
  }
54
64
 
55
65
  //# sourceMappingURL=to-function-schema.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["toFunctionLikeSchema","node","context","name","getText","info","getQuickInfo","returnTypeStr","parseTypeFromQuickInfo","displaySig","body","displayString","args","getParams","parameters","returnType","resolveType","modifiers","map","modifier","location","getLocation","FunctionLikeSchema"],"sources":["to-function-schema.ts"],"sourcesContent":["import { SignatureDeclaration } from 'typescript';\nimport { FunctionLikeSchema, Modifier } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaExtractorContext } from '../../schema-extractor-context';\nimport { getParams } from './get-params';\nimport { parseTypeFromQuickInfo } from './parse-type-from-quick-info';\n\nexport async function toFunctionLikeSchema(node: SignatureDeclaration, context: SchemaExtractorContext) {\n const name = node.name?.getText() || '';\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const info = await context.getQuickInfo(node.name!);\n const returnTypeStr = parseTypeFromQuickInfo(info);\n const displaySig = info?.body?.displayString || '';\n const args = await getParams(node.parameters, context);\n const returnType = await context.resolveType(node, returnTypeStr);\n const modifiers = node.modifiers?.map((modifier) => modifier.getText()) || [];\n const location = context.getLocation(node);\n\n return new FunctionLikeSchema(location, name, args, returnType, displaySig, modifiers as Modifier[]);\n}\n"],"mappings":";;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,eAAeA,oBAAf,CAAoCC,IAApC,EAAgEC,OAAhE,EAAiG;EAAA;;EACtG,MAAMC,IAAI,GAAG,eAAAF,IAAI,CAACE,IAAL,0DAAWC,OAAX,OAAwB,EAArC,CADsG,CAEtG;;EACA,MAAMC,IAAI,GAAG,MAAMH,OAAO,CAACI,YAAR,CAAqBL,IAAI,CAACE,IAA1B,CAAnB;EACA,MAAMI,aAAa,GAAG,IAAAC,gDAAA,EAAuBH,IAAvB,CAAtB;EACA,MAAMI,UAAU,GAAG,CAAAJ,IAAI,SAAJ,IAAAA,IAAI,WAAJ,0BAAAA,IAAI,CAAEK,IAAN,0DAAYC,aAAZ,KAA6B,EAAhD;EACA,MAAMC,IAAI,GAAG,MAAM,IAAAC,sBAAA,EAAUZ,IAAI,CAACa,UAAf,EAA2BZ,OAA3B,CAAnB;EACA,MAAMa,UAAU,GAAG,MAAMb,OAAO,CAACc,WAAR,CAAoBf,IAApB,EAA0BM,aAA1B,CAAzB;EACA,MAAMU,SAAS,GAAG,oBAAAhB,IAAI,CAACgB,SAAL,oEAAgBC,GAAhB,CAAqBC,QAAD,IAAcA,QAAQ,CAACf,OAAT,EAAlC,MAAyD,EAA3E;EACA,MAAMgB,QAAQ,GAAGlB,OAAO,CAACmB,WAAR,CAAoBpB,IAApB,CAAjB;EAEA,OAAO,KAAIqB,uCAAJ,EAAuBF,QAAvB,EAAiCjB,IAAjC,EAAuCS,IAAvC,EAA6CG,UAA7C,EAAyDN,UAAzD,EAAqEQ,SAArE,CAAP;AACD"}
1
+ {"version":3,"names":["toFunctionLikeSchema","node","context","funcName","name","getText","info","getQuickInfo","returnTypeStr","parseTypeFromQuickInfo","displaySig","body","displayString","args","getParams","parameters","returnType","resolveType","Boolean","modifiers","map","modifier","location","getLocation","doc","jsDocToDocSchema","FunctionLikeSchema"],"sources":["to-function-schema.ts"],"sourcesContent":["import { SignatureDeclaration } from 'typescript';\nimport { FunctionLikeSchema, Modifier } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaExtractorContext } from '../../schema-extractor-context';\nimport { getParams } from './get-params';\nimport { parseTypeFromQuickInfo } from './parse-type-from-quick-info';\nimport { jsDocToDocSchema } from './jsdoc-to-doc-schema';\n\nexport async function toFunctionLikeSchema(\n node: SignatureDeclaration,\n context: SchemaExtractorContext,\n funcName?: string\n) {\n const name = funcName || node.name?.getText() || '';\n const info = node.name ? await context.getQuickInfo(node.name) : null;\n const returnTypeStr = info ? parseTypeFromQuickInfo(info) : 'any';\n const displaySig = info?.body?.displayString || '';\n const args = await getParams(node.parameters, context);\n const returnType = await context.resolveType(node, returnTypeStr, Boolean(info));\n const modifiers = node.modifiers?.map((modifier) => modifier.getText()) || [];\n const location = context.getLocation(node);\n const doc = await jsDocToDocSchema(node, context);\n return new FunctionLikeSchema(location, name, args, returnType, displaySig, modifiers as Modifier[], doc);\n}\n"],"mappings":";;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA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-0,0 +1,7 @@
1
+ import { TypeElement, IndexSignatureDeclaration, GetAccessorDeclaration, SetAccessorDeclaration } from 'typescript';
2
+ import { GetAccessorSchema, IndexSignatureSchema, SchemaNode, SetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';
3
+ import { SchemaExtractorContext } from '../../schema-extractor-context';
4
+ export declare function typeElementToSchema(node: TypeElement, context: SchemaExtractorContext): Promise<SchemaNode>;
5
+ export declare function indexSignature(node: IndexSignatureDeclaration, context: SchemaExtractorContext): Promise<IndexSignatureSchema>;
6
+ export declare function getAccessor(node: GetAccessorDeclaration, context: SchemaExtractorContext): Promise<GetAccessorSchema>;
7
+ export declare function setAccessor(node: SetAccessorDeclaration, context: SchemaExtractorContext): Promise<SetAccessorSchema>;
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.promise.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getAccessor = getAccessor;
9
+ exports.indexSignature = indexSignature;
10
+ exports.setAccessor = setAccessor;
11
+ exports.typeElementToSchema = typeElementToSchema;
12
+
13
+ function _typescript() {
14
+ const data = require("typescript");
15
+
16
+ _typescript = function () {
17
+ return data;
18
+ };
19
+
20
+ return data;
21
+ }
22
+
23
+ function _semanticsEntities() {
24
+ const data = require("@teambit/semantics.entities.semantic-schema");
25
+
26
+ _semanticsEntities = function () {
27
+ return data;
28
+ };
29
+
30
+ return data;
31
+ }
32
+
33
+ function _toFunctionSchema() {
34
+ const data = require("./to-function-schema");
35
+
36
+ _toFunctionSchema = function () {
37
+ return data;
38
+ };
39
+
40
+ return data;
41
+ }
42
+
43
+ function _parseTypeFromQuickInfo() {
44
+ const data = require("./parse-type-from-quick-info");
45
+
46
+ _parseTypeFromQuickInfo = function () {
47
+ return data;
48
+ };
49
+
50
+ return data;
51
+ }
52
+
53
+ function _typeNodeToSchema() {
54
+ const data = require("./type-node-to-schema");
55
+
56
+ _typeNodeToSchema = function () {
57
+ return data;
58
+ };
59
+
60
+ return data;
61
+ }
62
+
63
+ function _getParams() {
64
+ const data = require("./get-params");
65
+
66
+ _getParams = function () {
67
+ return data;
68
+ };
69
+
70
+ return data;
71
+ }
72
+
73
+ async function typeElementToSchema(node, context) {
74
+ switch (node.kind) {
75
+ case _typescript().SyntaxKind.MethodSignature:
76
+ return (0, _toFunctionSchema().toFunctionLikeSchema)(node, context);
77
+
78
+ case _typescript().SyntaxKind.ConstructSignature:
79
+ return (0, _toFunctionSchema().toFunctionLikeSchema)(node, context, 'new');
80
+
81
+ case _typescript().SyntaxKind.CallSignature:
82
+ throw new Error(`CallSignature was not implemented yet`);
83
+
84
+ case _typescript().SyntaxKind.PropertySignature:
85
+ return propertySignature(node, context);
86
+
87
+ case _typescript().SyntaxKind.IndexSignature:
88
+ return indexSignature(node, context);
89
+
90
+ case _typescript().SyntaxKind.GetAccessor:
91
+ return getAccessor(node, context);
92
+
93
+ case _typescript().SyntaxKind.SetAccessor:
94
+ return setAccessor(node, context);
95
+
96
+ default:
97
+ throw new Error(`typeElementToSchema expect type-element node. got ${node.kind}`);
98
+ }
99
+ }
100
+
101
+ async function propertySignature(node, context) {
102
+ var _info$body;
103
+
104
+ const name = node.name.getText();
105
+ const info = (0, _typescript().isComputedPropertyName)(node.name) ? undefined : await context.getQuickInfo(node.name);
106
+ const displaySig = (info === null || info === void 0 ? void 0 : (_info$body = info.body) === null || _info$body === void 0 ? void 0 : _info$body.displayString) || '';
107
+ const typeStr = (0, _parseTypeFromQuickInfo().parseTypeFromQuickInfo)(info);
108
+ const type = await context.resolveType(node, typeStr);
109
+ return new (_semanticsEntities().VariableSchema)(context.getLocation(node), name, displaySig, type);
110
+ }
111
+
112
+ async function indexSignature(node, context) {
113
+ const params = await (0, _getParams().getParams)(node.parameters, context);
114
+ const type = await (0, _typeNodeToSchema().typeNodeToSchema)(node.type, context);
115
+ return new (_semanticsEntities().IndexSignatureSchema)(context.getLocation(node), params, type);
116
+ }
117
+
118
+ async function getAccessor(node, context) {
119
+ var _info$body2;
120
+
121
+ const info = await context.getQuickInfo(node.name);
122
+ const displaySig = (info === null || info === void 0 ? void 0 : (_info$body2 = info.body) === null || _info$body2 === void 0 ? void 0 : _info$body2.displayString) || '';
123
+ const typeStr = (0, _parseTypeFromQuickInfo().parseTypeFromQuickInfo)(info);
124
+ const type = await context.resolveType(node, typeStr);
125
+ return new (_semanticsEntities().GetAccessorSchema)(context.getLocation(node), node.name.getText(), type, displaySig);
126
+ }
127
+
128
+ async function setAccessor(node, context) {
129
+ const params = await (0, _getParams().getParams)(node.parameters, context);
130
+ const displaySig = await context.getQuickInfoDisplayString(node.name);
131
+ return new (_semanticsEntities().SetAccessorSchema)(context.getLocation(node), node.name.getText(), params[0], displaySig);
132
+ }
133
+
134
+ //# sourceMappingURL=type-element-to-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["typeElementToSchema","node","context","kind","SyntaxKind","MethodSignature","toFunctionLikeSchema","ConstructSignature","CallSignature","Error","PropertySignature","propertySignature","IndexSignature","indexSignature","GetAccessor","getAccessor","SetAccessor","setAccessor","name","getText","info","isComputedPropertyName","undefined","getQuickInfo","displaySig","body","displayString","typeStr","parseTypeFromQuickInfo","type","resolveType","VariableSchema","getLocation","params","getParams","parameters","typeNodeToSchema","IndexSignatureSchema","GetAccessorSchema","getQuickInfoDisplayString","SetAccessorSchema"],"sources":["type-element-to-schema.ts"],"sourcesContent":["import ts, {\n SyntaxKind,\n TypeElement,\n MethodSignature,\n isComputedPropertyName,\n IndexSignatureDeclaration,\n GetAccessorDeclaration,\n SetAccessorDeclaration,\n ConstructSignatureDeclaration,\n} from 'typescript';\nimport {\n GetAccessorSchema,\n IndexSignatureSchema,\n SchemaNode,\n SetAccessorSchema,\n VariableSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport { toFunctionLikeSchema } from './to-function-schema';\nimport { SchemaExtractorContext } from '../../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './parse-type-from-quick-info';\nimport { typeNodeToSchema } from './type-node-to-schema';\nimport { getParams } from './get-params';\n\nexport async function typeElementToSchema(node: TypeElement, context: SchemaExtractorContext): Promise<SchemaNode> {\n switch (node.kind) {\n case SyntaxKind.MethodSignature:\n return toFunctionLikeSchema(node as MethodSignature, context);\n case SyntaxKind.ConstructSignature:\n return toFunctionLikeSchema(node as ConstructSignatureDeclaration, context, 'new');\n case SyntaxKind.CallSignature:\n throw new Error(`CallSignature was not implemented yet`);\n case SyntaxKind.PropertySignature:\n return propertySignature(node as ts.PropertySignature, context);\n case SyntaxKind.IndexSignature:\n return indexSignature(node as IndexSignatureDeclaration, context);\n case SyntaxKind.GetAccessor:\n return getAccessor(node as GetAccessorDeclaration, context);\n case SyntaxKind.SetAccessor:\n return setAccessor(node as SetAccessorDeclaration, context);\n default:\n throw new Error(`typeElementToSchema expect type-element node. got ${node.kind}`);\n }\n}\n\nasync function propertySignature(node: ts.PropertySignature, context: SchemaExtractorContext) {\n const name = node.name.getText();\n const info = isComputedPropertyName(node.name) ? undefined : await context.getQuickInfo(node.name);\n const displaySig = info?.body?.displayString || '';\n const typeStr = parseTypeFromQuickInfo(info);\n const type = await context.resolveType(node, typeStr);\n return new VariableSchema(context.getLocation(node), name, displaySig, type);\n}\n\nexport async function indexSignature(node: IndexSignatureDeclaration, context: SchemaExtractorContext) {\n const params = await getParams(node.parameters, context);\n const type = await typeNodeToSchema(node.type, context);\n return new IndexSignatureSchema(context.getLocation(node), params, type);\n}\n\nexport async function getAccessor(node: GetAccessorDeclaration, context: SchemaExtractorContext) {\n const info = await context.getQuickInfo(node.name);\n const displaySig = info?.body?.displayString || '';\n const typeStr = parseTypeFromQuickInfo(info);\n const type = await context.resolveType(node, typeStr);\n return new GetAccessorSchema(context.getLocation(node), node.name.getText(), type, displaySig);\n}\n\nexport async function setAccessor(node: SetAccessorDeclaration, context: SchemaExtractorContext) {\n const params = await getParams(node.parameters, context);\n const displaySig = await context.getQuickInfoDisplayString(node.name);\n return new SetAccessorSchema(context.getL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