@teambit/typescript 1.0.666 → 1.0.668

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 (176) hide show
  1. package/cmds/check-types.cmd.ts +5 -4
  2. package/dist/cmds/check-types.cmd.d.ts +5 -5
  3. package/dist/cmds/check-types.cmd.js.map +1 -1
  4. package/dist/exceptions/transformer-not-found.d.ts +3 -3
  5. package/dist/exceptions/transformer-not-found.js.map +1 -1
  6. package/dist/extractor-options.d.ts +1 -1
  7. package/dist/extractor-options.js.map +1 -1
  8. package/dist/identifier-list.d.ts +1 -1
  9. package/dist/identifier-list.js.map +1 -1
  10. package/dist/{preview-1753803956605.js → preview-1753833698619.js} +2 -2
  11. package/dist/remove-types-task.d.ts +1 -1
  12. package/dist/remove-types-task.js.map +1 -1
  13. package/dist/schema-extractor-context.d.ts +10 -8
  14. package/dist/schema-extractor-context.js.map +1 -1
  15. package/dist/schema-transformer.d.ts +4 -4
  16. package/dist/schema-transformer.js.map +1 -1
  17. package/dist/schema-transformer.plugin.d.ts +2 -2
  18. package/dist/schema-transformer.plugin.js.map +1 -1
  19. package/dist/sourceFileTransformers/export.d.ts +1 -1
  20. package/dist/sourceFileTransformers/export.js.map +1 -1
  21. package/dist/sourceFileTransformers/expression-statement.d.ts +1 -1
  22. package/dist/sourceFileTransformers/expression-statement.js.map +1 -1
  23. package/dist/sourceFileTransformers/function.d.ts +1 -1
  24. package/dist/sourceFileTransformers/function.js.map +1 -1
  25. package/dist/sourceFileTransformers/import.d.ts +1 -1
  26. package/dist/sourceFileTransformers/import.js.map +1 -1
  27. package/dist/sourceFileTransformers/index.d.ts +1 -1
  28. package/dist/sourceFileTransformers/index.js.map +1 -1
  29. package/dist/sourceFileTransformers/transform.d.ts +1 -1
  30. package/dist/sourceFileTransformers/transform.js.map +1 -1
  31. package/dist/transformers/array-literal-expression.d.ts +4 -4
  32. package/dist/transformers/array-literal-expression.js.map +1 -1
  33. package/dist/transformers/array-type.d.ts +4 -4
  34. package/dist/transformers/array-type.js.map +1 -1
  35. package/dist/transformers/binding-element.d.ts +3 -3
  36. package/dist/transformers/binding-element.js.map +1 -1
  37. package/dist/transformers/class-declaration.d.ts +3 -3
  38. package/dist/transformers/class-declaration.js.map +1 -1
  39. package/dist/transformers/conditional-type.d.ts +4 -4
  40. package/dist/transformers/conditional-type.js.map +1 -1
  41. package/dist/transformers/constructor.d.ts +4 -4
  42. package/dist/transformers/constructor.js.map +1 -1
  43. package/dist/transformers/decorator.d.ts +4 -4
  44. package/dist/transformers/decorator.js.map +1 -1
  45. package/dist/transformers/enum-declaration.d.ts +3 -3
  46. package/dist/transformers/enum-declaration.js.map +1 -1
  47. package/dist/transformers/export-assignment.d.ts +4 -4
  48. package/dist/transformers/export-assignment.js.map +1 -1
  49. package/dist/transformers/export-declaration.d.ts +4 -4
  50. package/dist/transformers/export-declaration.js.map +1 -1
  51. package/dist/transformers/expression-statement.d.ts +4 -4
  52. package/dist/transformers/expression-statement.js.map +1 -1
  53. package/dist/transformers/function-like.d.ts +4 -4
  54. package/dist/transformers/function-like.js.map +1 -1
  55. package/dist/transformers/get-accessor.d.ts +4 -4
  56. package/dist/transformers/get-accessor.js.map +1 -1
  57. package/dist/transformers/import-declaration.d.ts +3 -3
  58. package/dist/transformers/import-declaration.js.map +1 -1
  59. package/dist/transformers/index-signature.d.ts +4 -4
  60. package/dist/transformers/index-signature.js.map +1 -1
  61. package/dist/transformers/indexed-access-type.d.ts +4 -4
  62. package/dist/transformers/indexed-access-type.js.map +1 -1
  63. package/dist/transformers/interface-declaration.d.ts +3 -3
  64. package/dist/transformers/interface-declaration.js.map +1 -1
  65. package/dist/transformers/intersection-type.d.ts +4 -4
  66. package/dist/transformers/intersection-type.js.map +1 -1
  67. package/dist/transformers/keyword-type.d.ts +4 -4
  68. package/dist/transformers/keyword-type.js.map +1 -1
  69. package/dist/transformers/literal-type.d.ts +4 -4
  70. package/dist/transformers/literal-type.js.map +1 -1
  71. package/dist/transformers/literal-value.d.ts +5 -4
  72. package/dist/transformers/literal-value.js.map +1 -1
  73. package/dist/transformers/module-declaration.d.ts +4 -4
  74. package/dist/transformers/module-declaration.js.map +1 -1
  75. package/dist/transformers/named-tuple.d.ts +4 -4
  76. package/dist/transformers/named-tuple.js.map +1 -1
  77. package/dist/transformers/object-literal-expression.d.ts +2 -2
  78. package/dist/transformers/object-literal-expression.js.map +1 -1
  79. package/dist/transformers/parameter.d.ts +6 -5
  80. package/dist/transformers/parameter.js.map +1 -1
  81. package/dist/transformers/parenthesized-type.d.ts +4 -4
  82. package/dist/transformers/parenthesized-type.js.map +1 -1
  83. package/dist/transformers/property-assignment.d.ts +4 -4
  84. package/dist/transformers/property-assignment.js.map +1 -1
  85. package/dist/transformers/property-declaration.d.ts +4 -4
  86. package/dist/transformers/property-declaration.js.map +1 -1
  87. package/dist/transformers/set-accessor.d.ts +4 -4
  88. package/dist/transformers/set-accessor.js.map +1 -1
  89. package/dist/transformers/source-file-transformer.d.ts +4 -4
  90. package/dist/transformers/source-file-transformer.js.map +1 -1
  91. package/dist/transformers/template-literal-type-span.d.ts +4 -4
  92. package/dist/transformers/template-literal-type-span.js.map +1 -1
  93. package/dist/transformers/template-literal-type.d.ts +4 -4
  94. package/dist/transformers/template-literal-type.js.map +1 -1
  95. package/dist/transformers/this-type.d.ts +4 -4
  96. package/dist/transformers/this-type.js.map +1 -1
  97. package/dist/transformers/tuple-type.d.ts +4 -4
  98. package/dist/transformers/tuple-type.js.map +1 -1
  99. package/dist/transformers/type-alias.d.ts +3 -3
  100. package/dist/transformers/type-alias.js.map +1 -1
  101. package/dist/transformers/type-literal.d.ts +4 -4
  102. package/dist/transformers/type-literal.js.map +1 -1
  103. package/dist/transformers/type-operator.d.ts +5 -4
  104. package/dist/transformers/type-operator.js.map +1 -1
  105. package/dist/transformers/type-predicate.d.ts +4 -4
  106. package/dist/transformers/type-predicate.js.map +1 -1
  107. package/dist/transformers/type-query.d.ts +4 -4
  108. package/dist/transformers/type-query.js.map +1 -1
  109. package/dist/transformers/type-reference.d.ts +4 -4
  110. package/dist/transformers/type-reference.js.map +1 -1
  111. package/dist/transformers/union-type.d.ts +4 -4
  112. package/dist/transformers/union-type.js.map +1 -1
  113. package/dist/transformers/utils/jsdoc-to-doc-schema.d.ts +3 -3
  114. package/dist/transformers/utils/jsdoc-to-doc-schema.js.map +1 -1
  115. package/dist/transformers/variable-declaration.d.ts +4 -4
  116. package/dist/transformers/variable-declaration.js.map +1 -1
  117. package/dist/transformers/variable-statement.d.ts +4 -4
  118. package/dist/transformers/variable-statement.js.map +1 -1
  119. package/dist/typescript.extractor.d.ts +15 -14
  120. package/dist/typescript.extractor.js.map +1 -1
  121. package/dist/typescript.main.runtime.d.ts +16 -15
  122. package/dist/typescript.main.runtime.js.map +1 -1
  123. package/dist/typescript.parser.d.ts +4 -3
  124. package/dist/typescript.parser.js.map +1 -1
  125. package/exceptions/transformer-not-found.ts +4 -3
  126. package/package.json +19 -19
  127. package/sourceFileTransformers/export.ts +1 -1
  128. package/sourceFileTransformers/expression-statement.ts +1 -1
  129. package/sourceFileTransformers/function.ts +1 -1
  130. package/sourceFileTransformers/import.ts +1 -1
  131. package/sourceFileTransformers/index.ts +1 -1
  132. package/sourceFileTransformers/transform.ts +1 -1
  133. package/transformers/array-literal-expression.ts +6 -8
  134. package/transformers/array-type.ts +5 -4
  135. package/transformers/binding-element.ts +4 -3
  136. package/transformers/class-declaration.ts +4 -3
  137. package/transformers/conditional-type.ts +5 -4
  138. package/transformers/constructor.ts +7 -10
  139. package/transformers/decorator.ts +6 -4
  140. package/transformers/enum-declaration.ts +4 -3
  141. package/transformers/export-assignment.ts +6 -4
  142. package/transformers/export-declaration.ts +5 -5
  143. package/transformers/expression-statement.ts +5 -4
  144. package/transformers/function-like.ts +6 -4
  145. package/transformers/get-accessor.ts +5 -4
  146. package/transformers/import-declaration.ts +4 -3
  147. package/transformers/index-signature.ts +7 -5
  148. package/transformers/indexed-access-type.ts +5 -4
  149. package/transformers/interface-declaration.ts +5 -3
  150. package/transformers/intersection-type.ts +5 -4
  151. package/transformers/keyword-type.ts +5 -4
  152. package/transformers/literal-type.ts +5 -4
  153. package/transformers/literal-value.ts +6 -4
  154. package/transformers/module-declaration.ts +5 -4
  155. package/transformers/named-tuple.ts +5 -4
  156. package/transformers/object-literal-expression.ts +3 -2
  157. package/transformers/parameter.ts +6 -13
  158. package/transformers/parenthesized-type.ts +5 -4
  159. package/transformers/property-assignment.ts +5 -4
  160. package/transformers/property-declaration.ts +5 -4
  161. package/transformers/set-accessor.ts +7 -5
  162. package/transformers/source-file-transformer.ts +5 -4
  163. package/transformers/template-literal-type-span.ts +5 -4
  164. package/transformers/template-literal-type.ts +7 -5
  165. package/transformers/this-type.ts +5 -4
  166. package/transformers/tuple-type.ts +5 -4
  167. package/transformers/type-alias.ts +4 -3
  168. package/transformers/type-literal.ts +5 -4
  169. package/transformers/type-operator.ts +5 -4
  170. package/transformers/type-predicate.ts +5 -4
  171. package/transformers/type-query.ts +5 -4
  172. package/transformers/type-reference.ts +5 -4
  173. package/transformers/union-type.ts +5 -4
  174. package/transformers/utils/jsdoc-to-doc-schema.ts +4 -11
  175. package/transformers/variable-declaration.ts +5 -5
  176. package/transformers/variable-statement.ts +6 -4
@@ -1,7 +1,7 @@
1
- import { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
2
- import { Node, ExportDeclaration as ExportDeclarationNode } from 'typescript';
3
- import { SchemaExtractorContext } from '../schema-extractor-context';
4
- import { SchemaTransformer } from '../schema-transformer';
1
+ import type { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
2
+ import type { Node, ExportDeclaration as ExportDeclarationNode } from 'typescript';
3
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
4
+ import type { SchemaTransformer } from '../schema-transformer';
5
5
  import { ExportIdentifier } from '../export-identifier';
6
6
  export declare class ExportDeclarationTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
@@ -1 +1 @@
1
- {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireWildcard","_exportIdentifier","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ExportDeclarationTransformer","predicate","node","kind","SyntaxKind","ExportDeclaration","getIdentifiers","exportDec","context","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","exportClause","ts","NamedExports","elements","map","elm","alias","propertyName","name","undefined","id","fileName","getSourceFile","ExportIdentifier","NamespaceExport","getFileExports","transform","specifier","Error","sourceFile","getSourceFileFromNode","UnImplementedSchema","getLocation","computeSchema","schemas","namedExport","ModuleSchema","namespaceExport","exports","isSameNode","nodeA","nodeB","pos","end","Promise","all","element","exportSpecifierToSchemaNode","location","definitionInfo","isTypeOnly","exportNode","UnresolvedSchema","ExportSchema","definitionNode","definition","resolveType","parent","getLocationAsString","ExportSpecifier","namespace","filePath","getFilePathByNode","getSourceFileInsideComponent","getTypeRefForExternalPath","result"],"sources":["export-declaration.ts"],"sourcesContent":["import {\n SchemaNode,\n ModuleSchema,\n UnresolvedSchema,\n UnImplementedSchema,\n ExportSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport ts, {\n Node,\n SyntaxKind,\n ExportDeclaration as ExportDeclarationNode,\n NamedExports,\n NamespaceExport,\n ExportSpecifier,\n} from 'typescript';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { ExportIdentifier } from '../export-identifier';\n\nexport class ExportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ExportDeclaration;\n }\n\n async getIdentifiers(exportDec: ExportDeclarationNode, context: SchemaExtractorContext) {\n // e.g. `export { button1, button2 } as Composition from './button';\n const rawSourceFilePath = exportDec.moduleSpecifier?.getText();\n\n // strip off quotes ''\n const sourceFilePath = rawSourceFilePath && rawSourceFilePath.substring(1, rawSourceFilePath?.length - 1);\n\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamedExports) {\n return exportDec.exportClause.elements.map((elm) => {\n const alias = (elm.propertyName && elm.name.getText()) || undefined;\n const id = elm.propertyName?.getText() || elm.name.getText();\n const fileName = elm.getSourceFile().fileName;\n\n return new ExportIdentifier(id, fileName, alias, sourceFilePath);\n });\n }\n\n // e.g. `export * as Composition from './button';\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamespaceExport) {\n return [\n new ExportIdentifier(\n exportDec.exportClause.name.getText(),\n exportDec.getSourceFile().fileName,\n undefined,\n sourceFilePath\n ),\n ];\n }\n\n if (exportDec.moduleSpecifier) {\n return context.getFileExports(exportDec);\n }\n\n return [];\n }\n\n async transform(exportDec: ExportDeclarationNode, context: SchemaExtractorContext): Promise<SchemaNode> {\n const exportClause = exportDec.exportClause;\n\n // it's export-all, e.g. `export * from './button'`;\n if (!exportClause) {\n const specifier = exportDec.moduleSpecifier;\n if (!specifier) {\n throw new Error(`fatal: no specifier`);\n }\n const sourceFile = await context.getSourceFileFromNode(specifier);\n // export * from 'webpack', export-all from a package\n if (!sourceFile) {\n return new UnImplementedSchema(\n context.getLocation(exportDec),\n exportDec.getText(),\n SyntaxKind[SyntaxKind.ExportDeclaration]\n );\n }\n return context.computeSchema(sourceFile);\n }\n\n // e.g. `export { button1, button2 } as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamedExports) {\n const schemas = await namedExport(exportClause, context);\n return new ModuleSchema(context.getLocation(exportDec), schemas, []);\n }\n // e.g. `export * as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamespaceExport) {\n return namespaceExport(exportClause, exportDec, context);\n }\n\n // should never reach here. exportClause can be either NamespaceExport or NamedExports\n throw new Error(`unrecognized exportClause type`);\n }\n}\n\nfunction isSameNode(nodeA: Node, nodeB: Node): boolean {\n return nodeA.kind === nodeB.kind && nodeA.pos === nodeB.pos && nodeA.end === nodeB.end;\n}\n\nasync function namedExport(exportClause: NamedExports, context: SchemaExtractorContext): Promise<ExportSchema[]> {\n const schemas = await Promise.all(\n exportClause.elements.map(async (element) => {\n return exportSpecifierToSchemaNode(element, context);\n })\n );\n\n return schemas;\n}\n\nasync function exportSpecifierToSchemaNode(\n element: ExportSpecifier,\n context: SchemaExtractorContext\n): Promise<ExportSchema> {\n try {\n const name = element.propertyName?.getText() || element.name.getText();\n const alias = element.propertyName ? element.name.getText() : undefined;\n const location = context.getLocation(element.name);\n const definitionInfo = element.isTypeOnly\n ? await context.definitionInfo(element.name)\n : await context.definitionInfo(element);\n\n if (!definitionInfo) {\n const exportNode = new UnresolvedSchema(location, element.name.getText());\n // happens for example when the main index.ts file exports variable from an mdx file.\n // tsserver is unable to get the definition node because it doesn't know to parse mdx files.\n // return new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n const definitionNode = await context.definition(definitionInfo);\n\n if (!definitionNode) {\n const exportNode = await context.resolveType(element, name);\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n // if it is reexported from another export\n if (isSameNode(element, definitionNode.parent)) {\n // the definition node is the same node as element.name. tsserver wasn't able to find the source for it\n // normally, \"bit install\" should fix it. another option is to open vscode and look for errors.\n throw new Error(`error: tsserver is unable to locate the identifier \"${element.name.getText()}\" at ${context.getLocationAsString(\n element.name\n )}.\nmake sure \"bit status\" is clean and there are no errors about missing packages/links.\nalso, make sure the tsconfig.json in the root has the \"jsx\" setting defined.`);\n }\n\n if (definitionNode.parent.kind === SyntaxKind.ExportSpecifier) {\n return await exportSpecifierToSchemaNode(definitionNode.parent as ExportSpecifier, context);\n }\n\n const exportNode = await context.computeSchema(definitionNode.parent);\n return new ExportSchema(location, name, exportNode, alias);\n } catch {\n const exportNode = new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(context.getLocation(element.name), element.name.getText(), exportNode);\n }\n}\n\nasync function namespaceExport(\n exportClause: NamespaceExport,\n exportDec: ExportDeclarationNode,\n context: SchemaExtractorContext\n) {\n const namespace = exportClause.name.getText();\n const filePath = await context.getFilePathByNode(exportClause.name);\n if (!filePath) {\n throw new Error(`unable to find the file-path for \"${namespace}\"`);\n }\n const sourceFile = context.getSourceFileInsideComponent(filePath);\n if (!sourceFile) {\n // it's a namespace from another component or an external package.\n return context.getTypeRefForExternalPath(namespace, filePath, context.getLocation(exportDec));\n }\n const result = await context.computeSchema(sourceFile);\n if (!(result instanceof ModuleSchema)) {\n throw new Error(`expect result to be instance of Module`);\n }\n result.namespace = namespace;\n return result;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAUA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwD,SAAAG,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CA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AC;EACtD,IAAI,EAAEoC,MAAM,YAAY7B,iCAAY,CAAC,EAAE;IACrC,MAAM,IAAIR,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACAqC,MAAM,CAACL,SAAS,GAAGA,SAAS;EAC5B,OAAOK,MAAM;AACf","ignoreList":[]}
1
+ {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireWildcard","_exportIdentifier","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ExportDeclarationTransformer","predicate","node","kind","SyntaxKind","ExportDeclaration","getIdentifiers","exportDec","context","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","exportClause","ts","NamedExports","elements","map","elm","alias","propertyName","name","undefined","id","fileName","getSourceFile","ExportIdentifier","NamespaceExport","getFileExports","transform","specifier","Error","sourceFile","getSourceFileFromNode","UnImplementedSchema","getLocation","computeSchema","schemas","namedExport","ModuleSchema","namespaceExport","exports","isSameNode","nodeA","nodeB","pos","end","Promise","all","element","exportSpecifierToSchemaNode","location","definitionInfo","isTypeOnly","exportNode","UnresolvedSchema","ExportSchema","definitionNode","definition","resolveType","parent","getLocationAsString","ExportSpecifier","namespace","filePath","getFilePathByNode","getSourceFileInsideComponent","getTypeRefForExternalPath","result"],"sources":["export-declaration.ts"],"sourcesContent":["import type { SchemaNode } from '@teambit/semantics.entities.semantic-schema';\nimport {\n ModuleSchema,\n UnresolvedSchema,\n UnImplementedSchema,\n ExportSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport type {\n Node,\n ExportDeclaration as ExportDeclarationNode,\n NamedExports,\n NamespaceExport,\n ExportSpecifier,\n} from 'typescript';\nimport ts, { SyntaxKind } from 'typescript';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport { ExportIdentifier } from '../export-identifier';\n\nexport class ExportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ExportDeclaration;\n }\n\n async getIdentifiers(exportDec: ExportDeclarationNode, context: SchemaExtractorContext) {\n // e.g. `export { button1, button2 } as Composition from './button';\n const rawSourceFilePath = exportDec.moduleSpecifier?.getText();\n\n // strip off quotes ''\n const sourceFilePath = rawSourceFilePath && rawSourceFilePath.substring(1, rawSourceFilePath?.length - 1);\n\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamedExports) {\n return exportDec.exportClause.elements.map((elm) => {\n const alias = (elm.propertyName && elm.name.getText()) || undefined;\n const id = elm.propertyName?.getText() || elm.name.getText();\n const fileName = elm.getSourceFile().fileName;\n\n return new ExportIdentifier(id, fileName, alias, sourceFilePath);\n });\n }\n\n // e.g. `export * as Composition from './button';\n if (exportDec.exportClause?.kind === ts.SyntaxKind.NamespaceExport) {\n return [\n new ExportIdentifier(\n exportDec.exportClause.name.getText(),\n exportDec.getSourceFile().fileName,\n undefined,\n sourceFilePath\n ),\n ];\n }\n\n if (exportDec.moduleSpecifier) {\n return context.getFileExports(exportDec);\n }\n\n return [];\n }\n\n async transform(exportDec: ExportDeclarationNode, context: SchemaExtractorContext): Promise<SchemaNode> {\n const exportClause = exportDec.exportClause;\n\n // it's export-all, e.g. `export * from './button'`;\n if (!exportClause) {\n const specifier = exportDec.moduleSpecifier;\n if (!specifier) {\n throw new Error(`fatal: no specifier`);\n }\n const sourceFile = await context.getSourceFileFromNode(specifier);\n // export * from 'webpack', export-all from a package\n if (!sourceFile) {\n return new UnImplementedSchema(\n context.getLocation(exportDec),\n exportDec.getText(),\n SyntaxKind[SyntaxKind.ExportDeclaration]\n );\n }\n return context.computeSchema(sourceFile);\n }\n\n // e.g. `export { button1, button2 } as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamedExports) {\n const schemas = await namedExport(exportClause, context);\n return new ModuleSchema(context.getLocation(exportDec), schemas, []);\n }\n // e.g. `export * as Composition from './button';\n if (exportClause.kind === SyntaxKind.NamespaceExport) {\n return namespaceExport(exportClause, exportDec, context);\n }\n\n // should never reach here. exportClause can be either NamespaceExport or NamedExports\n throw new Error(`unrecognized exportClause type`);\n }\n}\n\nfunction isSameNode(nodeA: Node, nodeB: Node): boolean {\n return nodeA.kind === nodeB.kind && nodeA.pos === nodeB.pos && nodeA.end === nodeB.end;\n}\n\nasync function namedExport(exportClause: NamedExports, context: SchemaExtractorContext): Promise<ExportSchema[]> {\n const schemas = await Promise.all(\n exportClause.elements.map(async (element) => {\n return exportSpecifierToSchemaNode(element, context);\n })\n );\n\n return schemas;\n}\n\nasync function exportSpecifierToSchemaNode(\n element: ExportSpecifier,\n context: SchemaExtractorContext\n): Promise<ExportSchema> {\n try {\n const name = element.propertyName?.getText() || element.name.getText();\n const alias = element.propertyName ? element.name.getText() : undefined;\n const location = context.getLocation(element.name);\n const definitionInfo = element.isTypeOnly\n ? await context.definitionInfo(element.name)\n : await context.definitionInfo(element);\n\n if (!definitionInfo) {\n const exportNode = new UnresolvedSchema(location, element.name.getText());\n // happens for example when the main index.ts file exports variable from an mdx file.\n // tsserver is unable to get the definition node because it doesn't know to parse mdx files.\n // return new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n const definitionNode = await context.definition(definitionInfo);\n\n if (!definitionNode) {\n const exportNode = await context.resolveType(element, name);\n return new ExportSchema(location, name, exportNode, alias);\n }\n\n // if it is reexported from another export\n if (isSameNode(element, definitionNode.parent)) {\n // the definition node is the same node as element.name. tsserver wasn't able to find the source for it\n // normally, \"bit install\" should fix it. another option is to open vscode and look for errors.\n throw new Error(`error: tsserver is unable to locate the identifier \"${element.name.getText()}\" at ${context.getLocationAsString(\n element.name\n )}.\nmake sure \"bit status\" is clean and there are no errors about missing packages/links.\nalso, make sure the tsconfig.json in the root has the \"jsx\" setting defined.`);\n }\n\n if (definitionNode.parent.kind === SyntaxKind.ExportSpecifier) {\n return await exportSpecifierToSchemaNode(definitionNode.parent as ExportSpecifier, context);\n }\n\n const exportNode = await context.computeSchema(definitionNode.parent);\n return new ExportSchema(location, name, exportNode, alias);\n } catch {\n const exportNode = new UnresolvedSchema(context.getLocation(element.name), element.name.getText());\n return new ExportSchema(context.getLocation(element.name), element.name.getText(), exportNode);\n }\n}\n\nasync function namespaceExport(\n exportClause: NamespaceExport,\n exportDec: ExportDeclarationNode,\n context: SchemaExtractorContext\n) {\n const namespace = exportClause.name.getText();\n const filePath = await context.getFilePathByNode(exportClause.name);\n if (!filePath) {\n throw new Error(`unable to find the file-path for \"${namespace}\"`);\n }\n const sourceFile = context.getSourceFileInsideComponent(filePath);\n if (!sourceFile) {\n // it's a namespace from another component or an external package.\n return context.getTypeRefForExternalPath(namespace, filePath, context.getLocation(exportDec));\n }\n const result = await context.computeSchema(sourceFile);\n if (!(result instanceof ModuleSchema)) {\n throw new Error(`expect result to be instance of Module`);\n }\n result.namespace = namespace;\n return result;\n}\n"],"mappings":";;;;;;AACA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAaA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,uBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,kBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,iBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAwD,SAAAG,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA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F,QAAQ,CAAC;EACjE,IAAI,CAAChC,UAAU,EAAE;IACf;IACA,OAAO1B,OAAO,CAAC6D,yBAAyB,CAACJ,SAAS,EAAEC,QAAQ,EAAE1D,OAAO,CAAC6B,WAAW,CAAC9B,SAAS,CAAC,CAAC;EAC/F;EACA,MAAM+D,MAAM,GAAG,MAAM9D,OAAO,CAAC8B,aAAa,CAACJ,UAAU,CAAC;EACtD,IAAI,EAAEoC,MAAM,YAAY7B,iCAAY,CAAC,EAAE;IACrC,MAAM,IAAIR,KAAK,CAAC,wCAAwC,CAAC;EAC3D;EACAqC,MAAM,CAACL,SAAS,GAAGA,SAAS;EAC5B,OAAOK,MAAM;AACf","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Node, ExpressionStatement } from 'typescript';
1
+ import type { Node, ExpressionStatement } from 'typescript';
2
2
  import { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
5
- import { Identifier } from '../identifier';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import type { Identifier } from '../identifier';
6
6
  export declare class ExpressionStatementTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
8
8
  getIdentifiers(): Promise<Identifier[]>;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","ExpressionStatementTransformer","predicate","node","kind","ts","SyntaxKind","ExpressionStatement","getIdentifiers","transform","context","location","getLocation","UnImplementedSchema","getText","exports"],"sources":["expression-statement.ts"],"sourcesContent":["import ts, { Node, ExpressionStatement } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ExpressionStatementTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.ExpressionStatement;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ExpressionStatement, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new UnImplementedSchema(location, node.getText(), ts.SyntaxKind[node.kind]);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkF,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK3E,MAAMG,8BAA8B,CAA8B;EACvEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,mBAAmB;EACxD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAyB,EAAEO,OAA+B,EAAE;IAC1E,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACT,IAAI,CAAC;IAC1C,OAAO,KAAIU,wCAAmB,EAACF,QAAQ,EAAER,IAAI,CAACW,OAAO,CAAC,CAAC,EAAET,qBAAE,CAACC,UAAU,CAACH,IAAI,CAACC,IAAI,CAAC,CAAC;EACpF;AACF;AAACW,OAAA,CAAAd,8BAAA,GAAAA,8BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","ExpressionStatementTransformer","predicate","node","kind","ts","SyntaxKind","ExpressionStatement","getIdentifiers","transform","context","location","getLocation","UnImplementedSchema","getText","exports"],"sources":["expression-statement.ts"],"sourcesContent":["import type { Node, ExpressionStatement } from 'typescript';\nimport ts from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { Identifier } from '../identifier';\n\nexport class ExpressionStatementTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.ExpressionStatement;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ExpressionStatement, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new UnImplementedSchema(location, node.getText(), ts.SyntaxKind[node.kind]);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkF,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK3E,MAAMG,8BAA8B,CAA8B;EACvEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,mBAAmB;EACxD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAyB,EAAEO,OAA+B,EAAE;IAC1E,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACT,IAAI,CAAC;IAC1C,OAAO,KAAIU,wCAAmB,EAACF,QAAQ,EAAER,IAAI,CAACW,OAAO,CAAC,CAAC,EAAET,qBAAE,CAACC,UAAU,CAACH,IAAI,CAACC,IAAI,CAAC,CAAC;EACpF;AACF;AAACW,OAAA,CAAAd,8BAAA,GAAAA,8BAAA","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
2
- import { Node, SignatureDeclaration } from 'typescript';
3
- import { SchemaExtractorContext } from '../schema-extractor-context';
4
- import { SchemaTransformer } from '../schema-transformer';
1
+ import type { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
2
+ import type { Node, SignatureDeclaration } from 'typescript';
3
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
4
+ import type { SchemaTransformer } from '../schema-transformer';
5
5
  import { Identifier } from '../identifier';
6
6
  export declare class FunctionLikeTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
@@ -1 +1 @@
1
- {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireDefault","_pMapSeries","_parseTypeFromQuickInfo","_identifier","e","__esModule","default","FunctionLikeTransformer","predicate","node","kind","ts","SyntaxKind","FunctionDeclaration","ArrowFunction","MethodDeclaration","CallSignature","ConstructSignature","FunctionType","MethodSignature","getIdentifiers","funcDec","Identifier","getName","getSourceFile","fileName","name","getText","transform","context","nodeModifiers","canHaveModifiers","getModifiers","undefined","getQuickInfoFromDefaultModifier","defaultModifier","find","modifier","DefaultKeyword","getQuickInfo","equalsGreaterThanToken","info","returnTypeStr","parseTypeFromQuickInfo","displaySig","body","displayString","args","pMapSeries","parameters","param","computeSchema","returnType","resolveType","modifiers","map","typeParameters","typeParam","location","getLocation","doc","jsDocToDocSchema","nodeDecorators","canHaveDecorators","getDecorators","decorators","length","decorator","FunctionLikeSchema","exports"],"sources":["function-like.ts"],"sourcesContent":["import { FunctionLikeSchema, ParameterSchema, SchemaNode, Modifier } from '@teambit/semantics.entities.semantic-schema';\nimport ts, { Node, SignatureDeclaration } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class FunctionLikeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return (\n node.kind === ts.SyntaxKind.FunctionDeclaration ||\n node.kind === ts.SyntaxKind.ArrowFunction ||\n node.kind === ts.SyntaxKind.MethodDeclaration ||\n node.kind === ts.SyntaxKind.CallSignature ||\n node.kind === ts.SyntaxKind.ConstructSignature ||\n node.kind === ts.SyntaxKind.FunctionType ||\n node.kind === ts.SyntaxKind.MethodSignature\n );\n }\n\n // need to check for anonymous functions assigned for vars, const and let.\n async getIdentifiers(funcDec: SignatureDeclaration) {\n return [new Identifier(this.getName(funcDec), funcDec.getSourceFile().fileName)];\n }\n\n private getName(funcDec: SignatureDeclaration) {\n if (funcDec.kind === ts.SyntaxKind.ConstructSignature) return 'new';\n return funcDec.name?.getText() || '';\n }\n\n async transform(node: SignatureDeclaration, context: SchemaExtractorContext): Promise<SchemaNode> {\n const name = this.getName(node);\n const nodeModifiers = ts.canHaveModifiers(node) ? ts.getModifiers(node) : undefined;\n const getQuickInfoFromDefaultModifier = async () => {\n const defaultModifier = nodeModifiers?.find((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword);\n if (defaultModifier) return context.getQuickInfo(defaultModifier);\n if (node.kind === ts.SyntaxKind.ArrowFunction) return context.getQuickInfo(node.equalsGreaterThanToken);\n return null;\n };\n const info = node.name ? await context.getQuickInfo(node.name) : await getQuickInfoFromDefaultModifier();\n const returnTypeStr = info ? parseTypeFromQuickInfo(info) : 'any';\n const displaySig = info?.body?.displayString || '';\n const args = (await pMapSeries(node.parameters, async (param) =>\n context.computeSchema(param)\n )) as ParameterSchema[];\n\n const returnType = await context.resolveType(node, returnTypeStr);\n const modifiers = nodeModifiers?.map((modifier) => modifier.getText()) || [];\n const typeParameters = node.typeParameters?.map((typeParam) => typeParam.name.getText());\n const location = context.getLocation(node);\n const doc = await context.jsDocToDocSchema(node);\n const nodeDecorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined;\n const decorators = nodeDecorators?.length\n ? await pMapSeries(nodeDecorators, (decorator) => context.computeSchema(decorator))\n : undefined;\n\n return new FunctionLikeSchema(\n location,\n name,\n args,\n returnType,\n displaySig,\n modifiers as Modifier[],\n doc,\n typeParameters,\n decorators\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,wBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,uBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,YAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,WAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,MAAMG,uBAAuB,CAA8B;EAChEC,SAASA,CAACC,IAAU,EAAE;IACpB,OACEA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,mBAAmB,I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,GAAGE,qBAAE,CAACqD,aAAa,CAACvD,IAAI,CAAC,GAAGwB,SAAS;IACtF,MAAMgC,UAAU,GAAGH,cAAc,EAAEI,MAAM,GACrC,MAAM,IAAAlB,qBAAU,EAACc,cAAc,EAAGK,SAAS,IAAKtC,OAAO,CAACsB,aAAa,CAACgB,SAAS,CAAC,CAAC,GACjFlC,SAAS;IAEb,OAAO,KAAImC,uCAAkB,EAC3BV,QAAQ,EACRhC,IAAI,EACJqB,IAAI,EACJK,UAAU,EACVR,UAAU,EACVU,SAAS,EACTM,GAAG,EACHJ,cAAc,EACdS,UACF,CAAC;EACH;AACF;AAACI,OAAA,CAAA9D,uBAAA,GAAAA,uBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireDefault","_pMapSeries","_parseTypeFromQuickInfo","_identifier","e","__esModule","default","FunctionLikeTransformer","predicate","node","kind","ts","SyntaxKind","FunctionDeclaration","ArrowFunction","MethodDeclaration","CallSignature","ConstructSignature","FunctionType","MethodSignature","getIdentifiers","funcDec","Identifier","getName","getSourceFile","fileName","name","getText","transform","context","nodeModifiers","canHaveModifiers","getModifiers","undefined","getQuickInfoFromDefaultModifier","defaultModifier","find","modifier","DefaultKeyword","getQuickInfo","equalsGreaterThanToken","info","returnTypeStr","parseTypeFromQuickInfo","displaySig","body","displayString","args","pMapSeries","parameters","param","computeSchema","returnType","resolveType","modifiers","map","typeParameters","typeParam","location","getLocation","doc","jsDocToDocSchema","nodeDecorators","canHaveDecorators","getDecorators","decorators","length","decorator","FunctionLikeSchema","exports"],"sources":["function-like.ts"],"sourcesContent":["import type { ParameterSchema, SchemaNode, Modifier } from '@teambit/semantics.entities.semantic-schema';\nimport { FunctionLikeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { Node, SignatureDeclaration } from 'typescript';\nimport ts from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class FunctionLikeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return (\n node.kind === ts.SyntaxKind.FunctionDeclaration ||\n node.kind === ts.SyntaxKind.ArrowFunction ||\n node.kind === ts.SyntaxKind.MethodDeclaration ||\n node.kind === ts.SyntaxKind.CallSignature ||\n node.kind === ts.SyntaxKind.ConstructSignature ||\n node.kind === ts.SyntaxKind.FunctionType ||\n node.kind === ts.SyntaxKind.MethodSignature\n );\n }\n\n // need to check for anonymous functions assigned for vars, const and let.\n async getIdentifiers(funcDec: SignatureDeclaration) {\n return [new Identifier(this.getName(funcDec), funcDec.getSourceFile().fileName)];\n }\n\n private getName(funcDec: SignatureDeclaration) {\n if (funcDec.kind === ts.SyntaxKind.ConstructSignature) return 'new';\n return funcDec.name?.getText() || '';\n }\n\n async transform(node: SignatureDeclaration, context: SchemaExtractorContext): Promise<SchemaNode> {\n const name = this.getName(node);\n const nodeModifiers = ts.canHaveModifiers(node) ? ts.getModifiers(node) : undefined;\n const getQuickInfoFromDefaultModifier = async () => {\n const defaultModifier = nodeModifiers?.find((modifier) => modifier.kind === ts.SyntaxKind.DefaultKeyword);\n if (defaultModifier) return context.getQuickInfo(defaultModifier);\n if (node.kind === ts.SyntaxKind.ArrowFunction) return context.getQuickInfo(node.equalsGreaterThanToken);\n return null;\n };\n const info = node.name ? await context.getQuickInfo(node.name) : await getQuickInfoFromDefaultModifier();\n const returnTypeStr = info ? parseTypeFromQuickInfo(info) : 'any';\n const displaySig = info?.body?.displayString || '';\n const args = (await pMapSeries(node.parameters, async (param) =>\n context.computeSchema(param)\n )) as ParameterSchema[];\n\n const returnType = await context.resolveType(node, returnTypeStr);\n const modifiers = nodeModifiers?.map((modifier) => modifier.getText()) || [];\n const typeParameters = node.typeParameters?.map((typeParam) => typeParam.name.getText());\n const location = context.getLocation(node);\n const doc = await context.jsDocToDocSchema(node);\n const nodeDecorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined;\n const decorators = nodeDecorators?.length\n ? await pMapSeries(nodeDecorators, (decorator) => context.computeSchema(decorator))\n : undefined;\n\n return new FunctionLikeSchema(\n location,\n name,\n args,\n returnType,\n displaySig,\n modifiers as Modifier[],\n doc,\n typeParameters,\n decorators\n );\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,wBAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,uBAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,YAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,WAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpC,MAAMG,uBAAuB,CAA8B;EAChEC,SAASA,CAACC,IAAU,EAAE;IACpB,OACEA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,mBAAmB,IAC/CJ,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACE,aAAa,IACzCL,IAAI,C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AU,GAAGH,cAAc,EAAEI,MAAM,GACrC,MAAM,IAAAlB,qBAAU,EAACc,cAAc,EAAGK,SAAS,IAAKtC,OAAO,CAACsB,aAAa,CAACgB,SAAS,CAAC,CAAC,GACjFlC,SAAS;IAEb,OAAO,KAAImC,uCAAkB,EAC3BV,QAAQ,EACRhC,IAAI,EACJqB,IAAI,EACJK,UAAU,EACVR,UAAU,EACVU,SAAS,EACTM,GAAG,EACHJ,cAAc,EACdS,UACF,CAAC;EACH;AACF;AAACI,OAAA,CAAA9D,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Node, GetAccessorDeclaration } from 'typescript';
1
+ import type { Node, GetAccessorDeclaration } from 'typescript';
2
2
  import { GetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
5
- import { Identifier } from '../identifier';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import type { Identifier } from '../identifier';
6
6
  export declare class GetAccessorTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
8
8
  getIdentifiers(): Promise<Identifier[]>;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_parseTypeFromQuickInfo","e","__esModule","default","GetAccessorTransformer","predicate","node","kind","ts","SyntaxKind","GetAccessor","getIdentifiers","transform","context","info","getQuickInfo","name","displaySig","body","displayString","typeStr","parseTypeFromQuickInfo","type","resolveType","GetAccessorSchema","getLocation","getText","exports"],"sources":["get-accessor.ts"],"sourcesContent":["import ts, { Node, GetAccessorDeclaration } from 'typescript';\nimport { GetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport { Identifier } from '../identifier';\n\nexport class GetAccessorTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.GetAccessor;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(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}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,wBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,uBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4E,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGrE,MAAMG,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,WAAW;EAChD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA4B,EAAEO,OAA+B,EAAE;IAC7E,MAAMC,IAAI,GAAG,MAAMD,OAAO,CAACE,YAAY,CAACT,IAAI,CAACU,IAAI,CAAC;IAClD,MAAMC,UAAU,GAAGH,IAAI,EAAEI,IAAI,EAAEC,aAAa,IAAI,EAAE;IAClD,MAAMC,OAAO,GAAG,IAAAC,gDAAsB,EAACP,IAAI,CAAC;IAC5C,MAAMQ,IAAI,GAAG,MAAMT,OAAO,CAACU,WAAW,CAACjB,IAAI,EAAEc,OAAO,CAAC;IACrD,OAAO,KAAII,sCAAiB,EAACX,OAAO,CAACY,WAAW,CAACnB,IAAI,CAAC,EAAEA,IAAI,CAACU,IAAI,CAACU,OAAO,CAAC,CAAC,EAAEJ,IAAI,EAAEL,UAAU,CAAC;EAChG;AACF;AAACU,OAAA,CAAAvB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_parseTypeFromQuickInfo","e","__esModule","default","GetAccessorTransformer","predicate","node","kind","ts","SyntaxKind","GetAccessor","getIdentifiers","transform","context","info","getQuickInfo","name","displaySig","body","displayString","typeStr","parseTypeFromQuickInfo","type","resolveType","GetAccessorSchema","getLocation","getText","exports"],"sources":["get-accessor.ts"],"sourcesContent":["import type { Node, GetAccessorDeclaration } from 'typescript';\nimport ts from 'typescript';\nimport { GetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport { parseTypeFromQuickInfo } from './utils/parse-type-from-quick-info';\nimport type { Identifier } from '../identifier';\n\nexport class GetAccessorTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.GetAccessor;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(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}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA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AA,sBAAA","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import { ImportDeclaration, Node } from 'typescript';
1
+ import type { ImportDeclaration, Node } from 'typescript';
2
2
  import { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
5
  import { Identifier } from '../identifier';
6
6
  export declare class ImportDeclarationTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","require","_semanticsEntities","_identifier","ImportDeclarationTransformer","predicate","node","kind","SyntaxKind","ImportDeclaration","getIdentifiers","importDec","importClause","sourceFile","getSourceFile","fileName","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","namedBindings","Identifier","undefined","NamedImports","elements","map","name","propertyName","id","alias","identifier","NamespaceImport","transform","context","location","getLocation","UnImplementedSchema","toString","exports"],"sources":["import-declaration.ts"],"sourcesContent":["import { ImportDeclaration, Node, SyntaxKind } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ImportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ImportDeclaration;\n }\n\n async getIdentifiers(importDec: ImportDeclaration): Promise<Identifier[]> {\n if (!importDec.importClause) return [];\n\n const sourceFile = importDec.getSourceFile().fileName;\n const rawSourceFilePath = importDec.moduleSpecifier.getText();\n const sourceFilePath = rawSourceFilePath.substring(1, rawSourceFilePath.length - 1);\n\n // import A from 'a'\n if (!importDec.importClause.namedBindings) {\n return [new Identifier(importDec.importClause.getText(), sourceFile, undefined, sourceFilePath)];\n }\n\n // import { A } from 'a'\n if (importDec.importClause.namedBindings?.kind === SyntaxKind.NamedImports) {\n const { elements } = importDec.importClause.namedBindings;\n\n return elements.map(({ name, propertyName }) => {\n const id = propertyName?.getText() || name.getText();\n const alias = (propertyName && name.getText()) || undefined;\n const identifier = new Identifier(id, sourceFile, alias, sourceFilePath);\n return identifier;\n });\n }\n\n // import * as A from 'a';\n if (importDec.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {\n return [\n new Identifier(\n importDec.importClause.namedBindings.name.getText(),\n sourceFile,\n undefined,\n importDec.moduleSpecifier.getText()\n ),\n ];\n }\n\n return [];\n }\n\n async transform(node: ImportDeclaration, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n\n return new UnImplementedSchema(location, node.getText(), node.kind.toString());\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMI,4BAA4B,CAA8B;EACrEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,iBAAiB;EACnD;EAEA,MAAMC,cAAcA,CAACC,SAA4B,EAAyB;IACxE,IAAI,CAACA,SAAS,CAACC,YAAY,EAAE,OAAO,EAAE;IAEtC,MAAMC,UAAU,GAAGF,SAAS,CAACG,aAAa,CAAC,CAAC,CAACC,QAAQ;IACrD,MAAMC,iBAAiB,GAAGL,SAAS,CAACM,eAAe,CAACC,OAAO,CAAC,CAAC;IAC7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E6B,OAA+B,EAAE;IACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAAC/B,IAAI,CAAC;IAE1C,OAAO,KAAIgC,wCAAmB,EAACF,QAAQ,EAAE9B,IAAI,CAACY,OAAO,CAAC,CAAC,EAAEZ,IAAI,CAACC,IAAI,CAACgC,QAAQ,CAAC,CAAC,CAAC;EAChF;AACF;AAACC,OAAA,CAAApC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","require","_semanticsEntities","_identifier","ImportDeclarationTransformer","predicate","node","kind","SyntaxKind","ImportDeclaration","getIdentifiers","importDec","importClause","sourceFile","getSourceFile","fileName","rawSourceFilePath","moduleSpecifier","getText","sourceFilePath","substring","length","namedBindings","Identifier","undefined","NamedImports","elements","map","name","propertyName","id","alias","identifier","NamespaceImport","transform","context","location","getLocation","UnImplementedSchema","toString","exports"],"sources":["import-declaration.ts"],"sourcesContent":["import type { ImportDeclaration, Node } from 'typescript';\nimport { SyntaxKind } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ImportDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.ImportDeclaration;\n }\n\n async getIdentifiers(importDec: ImportDeclaration): Promise<Identifier[]> {\n if (!importDec.importClause) return [];\n\n const sourceFile = importDec.getSourceFile().fileName;\n const rawSourceFilePath = importDec.moduleSpecifier.getText();\n const sourceFilePath = rawSourceFilePath.substring(1, rawSourceFilePath.length - 1);\n\n // import A from 'a'\n if (!importDec.importClause.namedBindings) {\n return [new Identifier(importDec.importClause.getText(), sourceFile, undefined, sourceFilePath)];\n }\n\n // import { A } from 'a'\n if (importDec.importClause.namedBindings?.kind === SyntaxKind.NamedImports) {\n const { elements } = importDec.importClause.namedBindings;\n\n return elements.map(({ name, propertyName }) => {\n const id = propertyName?.getText() || name.getText();\n const alias = (propertyName && name.getText()) || undefined;\n const identifier = new Identifier(id, sourceFile, alias, sourceFilePath);\n return identifier;\n });\n }\n\n // import * as A from 'a';\n if (importDec.importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {\n return [\n new Identifier(\n importDec.importClause.namedBindings.name.getText(),\n sourceFile,\n undefined,\n importDec.moduleSpecifier.getText()\n ),\n ];\n }\n\n return [];\n }\n\n async transform(node: ImportDeclaration, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n\n return new UnImplementedSchema(location, node.getText(), node.kind.toString());\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMI,4BAA4B,CAA8B;EACrEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,iBAAiB;EACnD;EAEA,MAAMC,cAAcA,CAACC,SAA4B,EAAyB;IACxE,IAAI,CAACA,SAAS,CAACC,YAAY,EAAE,OAAO,EAAE;IAEtC,MAAMC,UAAU,GAAGF,SAAS,CAACG,aAAa,CAAC,CAAC,CAACC,QAAQ;IACrD,MAAMC,iBAAiB,GAAGL,SAAS,CAACM,eAAe,CAACC,OAAO,CAAC,CAAC;IAC7D,MAAMC,cAAc,GAAGH,iBAAiB,CAACI,SAAS,CAAC,CAAC,EAAEJ,iBAAiB,CAACK,MA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AC;IAE1C,OAAO,KAAIgC,wCAAmB,EAACF,QAAQ,EAAE9B,IAAI,CAACY,OAAO,CAAC,CAAC,EAAEZ,IAAI,CAACC,IAAI,CAACgC,QAAQ,CAAC,CAAC,CAAC;EAChF;AACF;AAACC,OAAA,CAAApC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Node, IndexSignatureDeclaration } from 'typescript';
1
+ import type { Node, IndexSignatureDeclaration } from 'typescript';
2
2
  import { IndexSignatureSchema, UnresolvedSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
5
- import { Identifier } from '../identifier';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import type { Identifier } from '../identifier';
6
6
  export declare class IndexSignatureTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
8
8
  getIdentifiers(): Promise<Identifier[]>;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","IndexSignatureTransformer","predicate","node","kind","ts","SyntaxKind","IndexSignature","getIdentifiers","transform","context","param","parameters","UnresolvedSchema","getLocation","keyType","computeSchema","valueType","type","IndexSignatureSchema","exports"],"sources":["index-signature.ts"],"sourcesContent":["import ts, { Node, IndexSignatureDeclaration } from 'typescript';\nimport { IndexSignatureSchema, ParameterSchema, UnresolvedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IndexSignatureTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IndexSignature;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexSignatureDeclaration, context: SchemaExtractorContext) {\n const param = node.parameters[0];\n if (!param) {\n return new UnresolvedSchema(context.getLocation(node), `IndexSignatureTransformer: no parameter found`);\n }\n const keyType = (await context.computeSchema(param)) as ParameterSchema;\n const valueType = await context.computeSchema(node.type);\n return new IndexSignatureSchema(context.getLocation(node), keyType, valueType);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsH,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK/G,MAAMG,yBAAyB,CAA8B;EAClEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,cAAc;EACnD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA+B,EAAEO,OAA+B,EAAE;IAChF,MAAMC,KAAK,GAAGR,IAAI,CAACS,UAAU,CAAC,CAAC,CAAC;IAChC,IAAI,CAACD,KAAK,EAAE;MACV,OAAO,KAAIE,qCAAgB,EAACH,OAAO,CAACI,WAAW,CAACX,IAAI,CAAC,EAAE,+CAA+C,CAAC;IACzG;IACA,MAAMY,OAAO,GAAI,MAAML,OAAO,CAACM,aAAa,CAACL,KAAK,CAAqB;IACvE,MAAMM,SAAS,GAAG,MAAMP,OAAO,CAACM,aAAa,CAACb,IAAI,CAACe,IAAI,CAAC;IACxD,OAAO,KAAIC,yCAAoB,EAACT,OAAO,CAACI,WAAW,CAACX,IAAI,CAAC,EAAEY,OAAO,EAAEE,SAAS,CAAC;EAChF;AACF;AAACG,OAAA,CAAAnB,yBAAA,GAAAA,yBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","IndexSignatureTransformer","predicate","node","kind","ts","SyntaxKind","IndexSignature","getIdentifiers","transform","context","param","parameters","UnresolvedSchema","getLocation","keyType","computeSchema","valueType","type","IndexSignatureSchema","exports"],"sources":["index-signature.ts"],"sourcesContent":["import type { Node, IndexSignatureDeclaration } from 'typescript';\nimport ts from 'typescript';\nimport type { ParameterSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { IndexSignatureSchema, UnresolvedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { Identifier } from '../identifier';\n\nexport class IndexSignatureTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IndexSignature;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexSignatureDeclaration, context: SchemaExtractorContext) {\n const param = node.parameters[0];\n if (!param) {\n return new UnresolvedSchema(context.getLocation(node), `IndexSignatureTransformer: no parameter found`);\n }\n const keyType = (await context.computeSchema(param)) as ParameterSchema;\n const valueType = await context.computeSchema(node.type);\n return new IndexSignatureSchema(context.getLocation(node), keyType, valueType);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAqG,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK9F,MAAMG,yBAAyB,CAA8B;EAClEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,cAAc;EACnD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA+B,EAAEO,OAA+B,EAAE;IAChF,MAAMC,KAAK,GAAGR,IAAI,CAACS,UAAU,CAAC,CAAC,CAAC;IAChC,IAAI,CAACD,KAAK,EAAE;MACV,OAAO,KAAIE,qCAAgB,EAACH,OAAO,CAACI,WAAW,CAACX,IAAI,CAAC,EAAE,+CAA+C,CAAC;IACzG;IACA,MAAMY,OAAO,GAAI,MAAML,OAAO,CAACM,aAAa,CAACL,KAAK,CAAqB;IACvE,MAAMM,SAAS,GAAG,MAAMP,OAAO,CAACM,aAAa,CAACb,IAAI,CAACe,IAAI,CAAC;IACxD,OAAO,KAAIC,yCAAoB,EAACT,OAAO,CAACI,WAAW,CAACX,IAAI,CAAC,EAAEY,OAAO,EAAEE,SAAS,CAAC;EAChF;AACF;AAACG,OAAA,CAAAnB,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { IndexedAccessTypeNode, Node } from 'typescript';
1
+ import type { IndexedAccessTypeNode, Node } from 'typescript';
2
2
  import { IndexedAccessSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
5
- import { Identifier } from '../identifier';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import type { Identifier } from '../identifier';
6
6
  export declare class IndexedAccessTypeTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
8
8
  getIdentifiers(): Promise<Identifier[]>;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","require","_semanticsEntities","IndexedAccessTypeTransformer","predicate","node","kind","SyntaxKind","IndexedAccessType","getIdentifiers","transform","context","objectType","computeSchema","indexType","IndexedAccessSchema","getLocation","exports"],"sources":["indexed-access-type.ts"],"sourcesContent":["import { IndexedAccessTypeNode, Node, SyntaxKind } from 'typescript';\nimport { IndexedAccessSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IndexedAccessTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.IndexedAccessType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexedAccessTypeNode, context: SchemaExtractorContext) {\n const objectType = await context.computeSchema(node.objectType);\n const indexType = await context.computeSchema(node.indexType);\n return new IndexedAccessSchema(context.getLocation(node), objectType, indexType);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,4BAA4B,CAA8B;EACrEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,iBAAiB;EACnD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAA2B,EAAEM,OAA+B,EAAE;IAC5E,MAAMC,UAAU,GAAG,MAAMD,OAAO,CAACE,aAAa,CAACR,IAAI,CAACO,UAAU,CAAC;IAC/D,MAAME,SAAS,GAAG,MAAMH,OAAO,CAACE,aAAa,CAACR,IAAI,CAACS,SAAS,CAAC;IAC7D,OAAO,KAAIC,wCAAmB,EAACJ,OAAO,CAACK,WAAW,CAACX,IAAI,CAAC,EAAEO,UAAU,EAAEE,SAAS,CAAC;EAClF;AACF;AAACG,OAAA,CAAAd,4BAAA,GAAAA,4BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","require","_semanticsEntities","IndexedAccessTypeTransformer","predicate","node","kind","SyntaxKind","IndexedAccessType","getIdentifiers","transform","context","objectType","computeSchema","indexType","IndexedAccessSchema","getLocation","exports"],"sources":["indexed-access-type.ts"],"sourcesContent":["import type { IndexedAccessTypeNode, Node } from 'typescript';\nimport { SyntaxKind } from 'typescript';\nimport { IndexedAccessSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { Identifier } from '../identifier';\n\nexport class IndexedAccessTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.IndexedAccessType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IndexedAccessTypeNode, context: SchemaExtractorContext) {\n const objectType = await context.computeSchema(node.objectType);\n const indexType = await context.computeSchema(node.indexType);\n return new IndexedAccessSchema(context.getLocation(node), objectType, indexType);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,4BAA4B,CAA8B;EACrEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,iBAAiB;EACnD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAA2B,EAAEM,OAA+B,EAAE;IAC5E,MAAMC,UAAU,GAAG,MAAMD,OAAO,CAACE,aAAa,CAACR,IAAI,CAACO,UAAU,CAAC;IAC/D,MAAME,SAAS,GAAG,MAAMH,OAAO,CAACE,aAAa,CAACR,IAAI,CAACS,SAAS,CAAC;IAC7D,OAAO,KAAIC,wCAAmB,EAACJ,OAAO,CAACK,WAAW,CAACX,IAAI,CAAC,EAAEO,UAAU,EAAEE,SAAS,CAAC;EAClF;AACF;AAACG,OAAA,CAAAd,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import { Node, InterfaceDeclaration } from 'typescript';
1
+ import type { Node, InterfaceDeclaration } from 'typescript';
2
2
  import { InterfaceSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
5
  import { Identifier } from '../identifier';
6
6
  export declare class InterfaceDeclarationTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","require","_pMapSeries","_interopRequireDefault","_semanticsEntities","_identifier","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","InterfaceDeclarationTransformer","predicate","node","kind","SyntaxKind","InterfaceDeclaration","getIdentifiers","Identifier","name","getText","getSourceFile","fileName","getExpressionWithTypeArgs","context","heritageClauses","pMapSeries","heritageClause","token","ExtendsKeyword","flatMap","h","types","map","type","expressionWithTypeArgs","typeArguments","expression","typeArgsNodes","computeSchema","location","getLocation","expressionNode","visitDefinition","UnresolvedSchema","ExpressionWithTypeArgumentsSchema","transform","interfaceDec","members","member","doc","jsDocToDocSchema","signature","getQuickInfoDisplayString","undefined","extendsNodes","typeParameters","typeParam","Error","InterfaceSchema","exports"],"sources":["interface-declaration.ts"],"sourcesContent":["import ts, { Node, InterfaceDeclaration, SyntaxKind } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport {\n ExpressionWithTypeArgumentsSchema,\n InterfaceSchema,\n UnresolvedSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class InterfaceDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.InterfaceDeclaration;\n }\n\n async getIdentifiers(node: InterfaceDeclaration): Promise<Identifier[]> {\n return [new Identifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n private async getExpressionWithTypeArgs(node: InterfaceDeclaration, context: SchemaExtractorContext) {\n if (!node.heritageClauses) return [];\n\n return pMapSeries(\n node.heritageClauses\n .filter((heritageClause: ts.HeritageClause) => heritageClause.token === SyntaxKind.ExtendsKeyword)\n .flatMap((h: ts.HeritageClause) => {\n const { types } = h;\n const name = h.getText();\n return types.map((type) => ({ ...type, name }));\n }),\n async (expressionWithTypeArgs: ts.ExpressionWithTypeArguments & { name: string }) => {\n const { typeArguments, expression, name } = expressionWithTypeArgs;\n const typeArgsNodes = typeArguments ? await pMapSeries(typeArguments, (t) => context.computeSchema(t)) : [];\n const location = context.getLocation(expression);\n const expressionNode =\n (await context.visitDefinition(expression)) || new UnresolvedSchema(location, expression.getText());\n return new ExpressionWithTypeArgumentsSchema(typeArgsNodes, expressionNode, name, location);\n }\n );\n }\n\n async transform(interfaceDec: InterfaceDeclaration, context: SchemaExtractorContext) {\n const members = await pMapSeries(interfaceDec.members, (member) => context.computeSchema(member));\n const doc = await context.jsDocToDocSchema(interfaceDec);\n const signature = interfaceDec.name ? await context.getQuickInfoDisplayString(interfaceDec.name) : undefined;\n const extendsNodes = await this.getExpressionWithTypeArgs(interfaceDec, context);\n const typeParameters = interfaceDec.typeParameters?.map((typeParam) => {\n return typeParam.name.getText();\n });\n\n if (!signature) {\n throw Error(`Missing signature for interface ${interfaceDec.name.getText()} declaration`);\n }\n\n return new InterfaceSchema(\n context.getLocation(interfaceDec),\n interfaceDec.name.getText(),\n signature,\n extendsNodes,\n members,\n doc,\n typeParameters\n );\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAOA,SAAAK,YAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,WAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,QAAAH,CAAA,EAAAI,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAP,CAAA,OAAAM,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,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AAmCX,YAAY,CAAC5B,IAAI,CAACC,OAAO,CAAC,CAAC,cAAc,CAAC;IAC3F;IAEA,OAAO,KAAIuC,oCAAe,EACxBnC,OAAO,CAACiB,WAAW,CAACM,YAAY,CAAC,EACjCA,YAAY,CAAC5B,IAAI,CAACC,OAAO,CAAC,CAAC,EAC3BgC,SAAS,EACTG,YAAY,EACZP,OAAO,EACPE,GAAG,EACHM,cACF,CAAC;EACH;AACF;AAACI,OAAA,CAAAjD,+BAAA,GAAAA,+BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","require","_pMapSeries","_interopRequireDefault","_semanticsEntities","_identifier","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","InterfaceDeclarationTransformer","predicate","node","kind","SyntaxKind","InterfaceDeclaration","getIdentifiers","Identifier","name","getText","getSourceFile","fileName","getExpressionWithTypeArgs","context","heritageClauses","pMapSeries","heritageClause","token","ExtendsKeyword","flatMap","h","types","map","type","expressionWithTypeArgs","typeArguments","expression","typeArgsNodes","computeSchema","location","getLocation","expressionNode","visitDefinition","UnresolvedSchema","ExpressionWithTypeArgumentsSchema","transform","interfaceDec","members","member","doc","jsDocToDocSchema","signature","getQuickInfoDisplayString","undefined","extendsNodes","typeParameters","typeParam","Error","InterfaceSchema","exports"],"sources":["interface-declaration.ts"],"sourcesContent":["import type { Node, InterfaceDeclaration } from 'typescript';\nimport type ts from 'typescript';\nimport { SyntaxKind } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport {\n ExpressionWithTypeArgumentsSchema,\n InterfaceSchema,\n UnresolvedSchema,\n} from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class InterfaceDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.InterfaceDeclaration;\n }\n\n async getIdentifiers(node: InterfaceDeclaration): Promise<Identifier[]> {\n return [new Identifier(node.name.getText(), node.getSourceFile().fileName)];\n }\n\n private async getExpressionWithTypeArgs(node: InterfaceDeclaration, context: SchemaExtractorContext) {\n if (!node.heritageClauses) return [];\n\n return pMapSeries(\n node.heritageClauses\n .filter((heritageClause: ts.HeritageClause) => heritageClause.token === SyntaxKind.ExtendsKeyword)\n .flatMap((h: ts.HeritageClause) => {\n const { types } = h;\n const name = h.getText();\n return types.map((type) => ({ ...type, name }));\n }),\n async (expressionWithTypeArgs: ts.ExpressionWithTypeArguments & { name: string }) => {\n const { typeArguments, expression, name } = expressionWithTypeArgs;\n const typeArgsNodes = typeArguments ? await pMapSeries(typeArguments, (t) => context.computeSchema(t)) : [];\n const location = context.getLocation(expression);\n const expressionNode =\n (await context.visitDefinition(expression)) || new UnresolvedSchema(location, expression.getText());\n return new ExpressionWithTypeArgumentsSchema(typeArgsNodes, expressionNode, name, location);\n }\n );\n }\n\n async transform(interfaceDec: InterfaceDeclaration, context: SchemaExtractorContext) {\n const members = await pMapSeries(interfaceDec.members, (member) => context.computeSchema(member));\n const doc = await context.jsDocToDocSchema(interfaceDec);\n const signature = interfaceDec.name ? await context.getQuickInfoDisplayString(interfaceDec.name) : undefined;\n const extendsNodes = await this.getExpressionWithTypeArgs(interfaceDec, context);\n const typeParameters = interfaceDec.typeParameters?.map((typeParam) => {\n return typeParam.name.getText();\n });\n\n if (!signature) {\n throw Error(`Missing signature for interface ${interfaceDec.name.getText()} declaration`);\n }\n\n return new InterfaceSchema(\n context.getLocation(interfaceDec),\n interfaceDec.name.getText(),\n signature,\n extendsNodes,\n members,\n doc,\n typeParameters\n );\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;E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IAAI,EAAEqB,QAAQ,CAAC;IAC7F,CACF,CAAC;EACH;EAEA,MAAMM,SAASA,CAACC,YAAkC,EAAEvB,OAA+B,EAAE;IACnF,MAAMwB,OAAO,GAAG,MAAM,IAAAtB,qBAAU,EAACqB,YAAY,CAACC,OAAO,EAAGC,MAAM,IAAKzB,OAAO,CAACe,aAAa,CAACU,MAAM,CAAC,CAAC;IACjG,MAAMC,GAAG,GAAG,MAAM1B,OAAO,CAAC2B,gBAAgB,CAACJ,YAAY,CAAC;IACxD,MAAMK,SAAS,GAAGL,YAAY,CAAC5B,IAAI,GAAG,MAAMK,OAAO,CAAC6B,yBAAyB,CAACN,YAAY,CAAC5B,IAAI,CAAC,GAAGmC,SAAS;IAC5G,MAAMC,YAAY,GAAG,MAAM,IAAI,CAAChC,yBAAyB,CAACwB,YAAY,EAAEvB,OAAO,CAAC;IAChF,MAAMgC,cAAc,GAAGT,YAAY,CAACS,cAAc,EAAEvB,GAAG,CAAEwB,SAAS,IAAK;MACrE,OAAOA,SAAS,CAACtC,IAAI,CAACC,OAAO,CAAC,CAAC;IACjC,CAAC,CAAC;IAEF,IAAI,CAACgC,SAAS,EAAE;MACd,MAAMM,KAAK,CAAC,mCAAmCX,YAAY,CAAC5B,IAAI,CAACC,OAAO,CAAC,CAAC,cAAc,CAAC;IAC3F;IAEA,OAAO,KAAIuC,oCAAe,EACxBnC,OAAO,CAACiB,WAAW,CAACM,YAAY,CAAC,EACjCA,YAAY,CAAC5B,IAAI,CAACC,OAAO,CAAC,CAAC,EAC3BgC,SAAS,EACTG,YAAY,EACZP,OAAO,EACPE,GAAG,EACHM,cACF,CAAC;EACH;AACF;AAACI,OAAA,CAAAjD,+BAAA,GAAAA,+BAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Node, IntersectionTypeNode } from 'typescript';
1
+ import type { Node, IntersectionTypeNode } from 'typescript';
2
2
  import { TypeIntersectionSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
5
- import { Identifier } from '../identifier';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import type { Identifier } from '../identifier';
6
6
  export declare class IntersectionTypeTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
8
8
  getIdentifiers(): Promise<Identifier[]>;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_pMapSeries","e","__esModule","default","IntersectionTypeTransformer","predicate","node","kind","ts","SyntaxKind","IntersectionType","getIdentifiers","transform","context","types","pMapSeries","type","typeSchema","computeSchema","location","getLocation","TypeIntersectionSchema","exports"],"sources":["intersection-type.ts"],"sourcesContent":["import ts, { Node, IntersectionTypeNode } from 'typescript';\nimport { TypeIntersectionSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class IntersectionTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IntersectionType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IntersectionTypeNode, context: SchemaExtractorContext) {\n const types = await pMapSeries(node.types, async (type) => {\n const typeSchema = context.computeSchema(type);\n return typeSchema;\n });\n const location = context.getLocation(node);\n return new TypeIntersectionSchema(location, types);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsC,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK/B,MAAMG,2BAA2B,CAA8B;EACpEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,gBAAgB;EACrD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA0B,EAAEO,OAA+B,EAAE;IAC3E,MAAMC,KAAK,GAAG,MAAM,IAAAC,qBAAU,EAACT,IAAI,CAACQ,KAAK,EAAE,MAAOE,IAAI,IAAK;MACzD,MAAMC,UAAU,GAAGJ,OAAO,CAACK,aAAa,CAACF,IAAI,CAAC;MAC9C,OAAOC,UAAU;IACnB,CAAC,CAAC;IACF,MAAME,QAAQ,GAAGN,OAAO,CAACO,WAAW,CAACd,IAAI,CAAC;IAC1C,OAAO,KAAIe,2CAAsB,EAACF,QAAQ,EAAEL,KAAK,CAAC;EACpD;AACF;AAACQ,OAAA,CAAAlB,2BAAA,GAAAA,2BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","_pMapSeries","e","__esModule","default","IntersectionTypeTransformer","predicate","node","kind","ts","SyntaxKind","IntersectionType","getIdentifiers","transform","context","types","pMapSeries","type","typeSchema","computeSchema","location","getLocation","TypeIntersectionSchema","exports"],"sources":["intersection-type.ts"],"sourcesContent":["import type { Node, IntersectionTypeNode } from 'typescript';\nimport ts from 'typescript';\nimport { TypeIntersectionSchema } from '@teambit/semantics.entities.semantic-schema';\nimport pMapSeries from 'p-map-series';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { Identifier } from '../identifier';\n\nexport class IntersectionTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.IntersectionType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: IntersectionTypeNode, context: SchemaExtractorContext) {\n const types = await pMapSeries(node.types, async (type) => {\n const typeSchema = context.computeSchema(type);\n return typeSchema;\n });\n const location = context.getLocation(node);\n return new TypeIntersectionSchema(location, types);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,YAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAsC,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK/B,MAAMG,2BAA2B,CAA8B;EACpEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,gBAAgB;EACrD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA0B,EAAEO,OAA+B,EAAE;IAC3E,MAAMC,KAAK,GAAG,MAAM,IAAAC,qBAAU,EAACT,IAAI,CAACQ,KAAK,EAAE,MAAOE,IAAI,IAAK;MACzD,MAAMC,UAAU,GAAGJ,OAAO,CAACK,aAAa,CAACF,IAAI,CAAC;MAC9C,OAAOC,UAAU;IACnB,CAAC,CAAC;IACF,MAAME,QAAQ,GAAGN,OAAO,CAACO,WAAW,CAACd,IAAI,CAAC;IAC1C,OAAO,KAAIe,2CAAsB,EAACF,QAAQ,EAAEL,KAAK,CAAC;EACpD;AACF;AAACQ,OAAA,CAAAlB,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Node } from 'typescript';
1
+ import type { Node } from 'typescript';
2
2
  import { KeywordTypeSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
5
- import { Identifier } from '../identifier';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import type { Identifier } from '../identifier';
6
6
  /**
7
7
  * whether it's kind of `ts.KeywordTypeSyntaxKind`
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","require","_semanticsEntities","KeywordTypeTransformer","predicate","node","kind","SyntaxKind","AnyKeyword","BigIntKeyword","BooleanKeyword","IntrinsicKeyword","NeverKeyword","NumberKeyword","ObjectKeyword","StringKeyword","SymbolKeyword","UndefinedKeyword","UnknownKeyword","VoidKeyword","getIdentifiers","transform","context","location","getLocation","KeywordTypeSchema","getText","exports"],"sources":["keyword-type.ts"],"sourcesContent":["import { Node, SyntaxKind } from 'typescript';\nimport { KeywordTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * whether it's kind of `ts.KeywordTypeSyntaxKind`\n */\nexport class KeywordTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n switch (node.kind) {\n case SyntaxKind.AnyKeyword:\n case SyntaxKind.BigIntKeyword:\n case SyntaxKind.BooleanKeyword:\n case SyntaxKind.IntrinsicKeyword:\n case SyntaxKind.NeverKeyword:\n case SyntaxKind.NumberKeyword:\n case SyntaxKind.ObjectKeyword:\n case SyntaxKind.StringKeyword:\n case SyntaxKind.SymbolKeyword:\n case SyntaxKind.UndefinedKeyword:\n case SyntaxKind.UnknownKeyword:\n case SyntaxKind.VoidKeyword:\n return true;\n default:\n return false;\n }\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: Node, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new KeywordTypeSchema(location, node.getText());\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA;AACA;AACA;AACO,MAAMG,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,QAAQA,IAAI,CAACC,IAAI;MACf,KAAKC,wBAAU,CAACC,UAAU;MAC1B,KAAKD,wBAAU,CAACE,aAAa;MAC7B,KAAKF,wBAAU,CAACG,cAAc;MAC9B,KAAKH,wBAAU,CAACI,gBAAgB;MAChC,KAAKJ,wBAAU,CAACK,YAAY;MAC5B,KAAKL,wBAAU,CAACM,aAAa;MAC7B,KAAKN,wBAAU,CAACO,aAAa;MAC7B,KAAKP,wBAAU,CAACQ,aAAa;MAC7B,KAAKR,wBAAU,CAACS,aAAa;MAC7B,KAAKT,wBAAU,CAACU,gBAAgB;MAChC,KAAKV,wBAAU,CAACW,cAAc;MAC9B,KAAKX,wBAAU,CAACY,WAAW;QACzB,OAAO,IAAI;MACb;QACE,OAAO,KAAK;IAChB;EACF;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAAChB,IAAU,EAAEiB,OAA+B,EAAE;IAC3D,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACnB,IAAI,CAAC;IAC1C,OAAO,KAAIoB,sCAAiB,EAACF,QAAQ,EAAElB,IAAI,CAACqB,OAAO,CAAC,CAAC,CAAC;EACxD;AACF;AAACC,OAAA,CAAAxB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","require","_semanticsEntities","KeywordTypeTransformer","predicate","node","kind","SyntaxKind","AnyKeyword","BigIntKeyword","BooleanKeyword","IntrinsicKeyword","NeverKeyword","NumberKeyword","ObjectKeyword","StringKeyword","SymbolKeyword","UndefinedKeyword","UnknownKeyword","VoidKeyword","getIdentifiers","transform","context","location","getLocation","KeywordTypeSchema","getText","exports"],"sources":["keyword-type.ts"],"sourcesContent":["import type { Node } from 'typescript';\nimport { SyntaxKind } from 'typescript';\nimport { KeywordTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { Identifier } from '../identifier';\n\n/**\n * whether it's kind of `ts.KeywordTypeSyntaxKind`\n */\nexport class KeywordTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n switch (node.kind) {\n case SyntaxKind.AnyKeyword:\n case SyntaxKind.BigIntKeyword:\n case SyntaxKind.BooleanKeyword:\n case SyntaxKind.IntrinsicKeyword:\n case SyntaxKind.NeverKeyword:\n case SyntaxKind.NumberKeyword:\n case SyntaxKind.ObjectKeyword:\n case SyntaxKind.StringKeyword:\n case SyntaxKind.SymbolKeyword:\n case SyntaxKind.UndefinedKeyword:\n case SyntaxKind.UnknownKeyword:\n case SyntaxKind.VoidKeyword:\n return true;\n default:\n return false;\n }\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: Node, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new KeywordTypeSchema(location, node.getText());\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA;AACA;AACA;AACO,MAAMG,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,QAAQA,IAAI,CAACC,IAAI;MACf,KAAKC,wBAAU,CAACC,UAAU;MAC1B,KAAKD,wBAAU,CAACE,aAAa;MAC7B,KAAKF,wBAAU,CAACG,cAAc;MAC9B,KAAKH,wBAAU,CAACI,gBAAgB;MAChC,KAAKJ,wBAAU,CAACK,YAAY;MAC5B,KAAKL,wBAAU,CAACM,aAAa;MAC7B,KAAKN,wBAAU,CAACO,aAAa;MAC7B,KAAKP,wBAAU,CAACQ,aAAa;MAC7B,KAAKR,wBAAU,CAACS,aAAa;MAC7B,KAAKT,wBAAU,CAACU,gBAAgB;MAChC,KAAKV,wBAAU,CAACW,cAAc;MAC9B,KAAKX,wBAAU,CAACY,WAAW;QACzB,OAAO,IAAI;MACb;QACE,OAAO,KAAK;IAChB;EACF;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAAChB,IAAU,EAAEiB,OAA+B,EAAE;IAC3D,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACnB,IAAI,CAAC;IAC1C,OAAO,KAAIoB,sCAAiB,EAACF,QAAQ,EAAElB,IAAI,CAACqB,OAAO,CAAC,CAAC,CAAC;EACxD;AACF;AAACC,OAAA,CAAAxB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { LiteralTypeNode, Node } from 'typescript';
1
+ import type { LiteralTypeNode, Node } from 'typescript';
2
2
  import { LiteralTypeSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
5
- import { Identifier } from '../identifier';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import type { Identifier } from '../identifier';
6
6
  /**
7
7
  * e.g. string/boolean
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","LiteralTypeTransformer","predicate","node","kind","ts","SyntaxKind","LiteralType","getIdentifiers","transform","context","location","getLocation","LiteralTypeSchema","getText","exports"],"sources":["literal-type.ts"],"sourcesContent":["import ts, { LiteralTypeNode, Node } from 'typescript';\nimport { LiteralTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\n/**\n * e.g. string/boolean\n */\nexport class LiteralTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.LiteralType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: LiteralTypeNode, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new LiteralTypeSchema(location, node.getText());\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgF,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKhF;AACA;AACA;AACO,MAAMG,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,WAAW;EAChD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAqB,EAAEO,OAA+B,EAAE;IACtE,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACT,IAAI,CAAC;IAC1C,OAAO,KAAIU,sCAAiB,EAACF,QAAQ,EAAER,IAAI,CAACW,OAAO,CAAC,CAAC,CAAC;EACxD;AACF;AAACC,OAAA,CAAAd,sBAAA,GAAAA,sBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","LiteralTypeTransformer","predicate","node","kind","ts","SyntaxKind","LiteralType","getIdentifiers","transform","context","location","getLocation","LiteralTypeSchema","getText","exports"],"sources":["literal-type.ts"],"sourcesContent":["import type { LiteralTypeNode, Node } from 'typescript';\nimport ts from 'typescript';\nimport { LiteralTypeSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { Identifier } from '../identifier';\n\n/**\n * e.g. string/boolean\n */\nexport class LiteralTypeTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.LiteralType;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: LiteralTypeNode, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new LiteralTypeSchema(location, node.getText());\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgF,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKhF;AACA;AACA;AACO,MAAMG,sBAAsB,CAA8B;EAC/DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,WAAW;EAChD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAqB,EAAEO,OAA+B,EAAE;IACtE,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACT,IAAI,CAAC;IAC1C,OAAO,KAAIU,sCAAiB,EAACF,QAAQ,EAAER,IAAI,CAACW,OAAO,CAAC,CAAC,CAAC;EACxD;AACF;AAACC,OAAA,CAAAd,sBAAA,GAAAA,sBAAA","ignoreList":[]}
@@ -1,8 +1,9 @@
1
- import { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
2
- import ts, { Node, StringLiteral } from 'typescript';
1
+ import type { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
2
+ import type { Node, StringLiteral } from 'typescript';
3
+ import ts from 'typescript';
3
4
  import type { SchemaExtractorContext } from '../schema-extractor-context';
4
- import { SchemaTransformer } from '../schema-transformer';
5
- import { Identifier } from '../identifier';
5
+ import type { SchemaTransformer } from '../schema-transformer';
6
+ import type { Identifier } from '../identifier';
6
7
  export type LiteralValueNode = StringLiteral | ts.NumericLiteral | ts.TrueLiteral | ts.FalseLiteral | ts.NullLiteral | ts.BigIntLiteral | ts.RegularExpressionLiteral | ts.NewExpression;
7
8
  export declare class LiteralValueTransformer implements SchemaTransformer {
8
9
  predicate(node: Node): boolean;
@@ -1 +1 @@
1
- {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireDefault","e","__esModule","default","LiteralValueTransformer","predicate","node","kind","ts","SyntaxKind","StringLiteral","NumericLiteral","TrueKeyword","FalseKeyword","NullKeyword","UndefinedKeyword","BigIntLiteral","RegularExpressionLiteral","NewExpression","NoSubstitutionTemplateLiteral","getIdentifiers","transform","context","LiteralValueSchema","getLocation","getText","exports"],"sources":["literal-value.ts"],"sourcesContent":["import { LiteralValueSchema, SchemaNode } from '@teambit/semantics.entities.semantic-schema';\nimport ts, { Node, StringLiteral } from 'typescript';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { Identifier } from '../identifier';\n\nexport type LiteralValueNode =\n | StringLiteral\n | ts.NumericLiteral\n | ts.TrueLiteral\n | ts.FalseLiteral\n | ts.NullLiteral\n | ts.BigIntLiteral\n | ts.RegularExpressionLiteral\n | ts.NewExpression;\n\nexport class LiteralValueTransformer implements SchemaTransformer {\n predicate(node: Node): boolean {\n return (\n node.kind === ts.SyntaxKind.StringLiteral ||\n node.kind === ts.SyntaxKind.NumericLiteral ||\n node.kind === ts.SyntaxKind.TrueKeyword ||\n node.kind === ts.SyntaxKind.FalseKeyword ||\n node.kind === ts.SyntaxKind.NullKeyword ||\n node.kind === ts.SyntaxKind.UndefinedKeyword ||\n node.kind === ts.SyntaxKind.BigIntLiteral ||\n node.kind === ts.SyntaxKind.RegularExpressionLiteral ||\n node.kind === ts.SyntaxKind.NewExpression ||\n node.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral\n );\n }\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n async transform(node: LiteralValueNode, context: SchemaExtractorContext): Promise<SchemaNode> {\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,SAASA,CAACf,IAAsB,EAAEgB,OAA+B,EAAuB;IAC5F,OAAO,KAAIC,uCAAkB,EAACD,OAAO,CAACE,WAAW,CAAClB,IAAI,CAAC,EAAEA,IAAI,CAACmB,OAAO,CAAC,CAAC,CAAC;EAC1E;AACF;AAACC,OAAA,CAAAtB,uBAAA,GAAAA,uBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_semanticsEntities","data","require","_typescript","_interopRequireDefault","e","__esModule","default","LiteralValueTransformer","predicate","node","kind","ts","SyntaxKind","StringLiteral","NumericLiteral","TrueKeyword","FalseKeyword","NullKeyword","UndefinedKeyword","BigIntLiteral","RegularExpressionLiteral","NewExpression","NoSubstitutionTemplateLiteral","getIdentifiers","transform","context","LiteralValueSchema","getLocation","getText","exports"],"sources":["literal-value.ts"],"sourcesContent":["import type { SchemaNode } from '@teambit/semantics.entities.semantic-schema';\nimport { LiteralValueSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { Node, StringLiteral } from 'typescript';\nimport ts from 'typescript';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { Identifier } from '../identifier';\n\nexport type LiteralValueNode =\n | StringLiteral\n | ts.NumericLiteral\n | ts.TrueLiteral\n | ts.FalseLiteral\n | ts.NullLiteral\n | ts.BigIntLiteral\n | ts.RegularExpressionLiteral\n | ts.NewExpression;\n\nexport class LiteralValueTransformer implements SchemaTransformer {\n predicate(node: Node): boolean {\n return (\n node.kind === ts.SyntaxKind.StringLiteral ||\n node.kind === ts.SyntaxKind.NumericLiteral ||\n node.kind === ts.SyntaxKind.TrueKeyword ||\n node.kind === ts.SyntaxKind.FalseKeyword ||\n node.kind === ts.SyntaxKind.NullKeyword ||\n node.kind === ts.SyntaxKind.UndefinedKeyword ||\n node.kind === ts.SyntaxKind.BigIntLiteral ||\n node.kind === ts.SyntaxKind.RegularExpressionLiteral ||\n node.kind === ts.SyntaxKind.NewExpression ||\n node.kind === ts.SyntaxKind.NoSubstitutionTemplateLiteral\n );\n }\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n async transform(node: LiteralValueNode, context: SchemaExtractorContext): Promise<SchemaNode> {\n return new LiteralValueSchema(context.getLocation(node), node.getText());\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4B,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAerB,MAAMG,uBAAuB,CAA8B;EAChEC,SAASA,CAACC,IAAU,EAAW;IAC7B,OACEA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,aAAa,IACzCJ,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACE,cAAc,IAC1CL,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACG,WAAW,IACvCN,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACI,YAAY,IACxCP,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACK,WAAW,IACvCR,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACM,gBAAgB,IAC5CT,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACO,aAAa,IACzCV,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACQ,wBAAwB,IACpDX,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACS,aAAa,IACzCZ,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACU,6BAA6B;EAE7D;EACA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EACA,MAAMC,SAASA,CAACf,IAAsB,EAAEgB,OAA+B,EAAuB;IAC5F,OAAO,KAAIC,uCAAkB,EAACD,OAAO,CAACE,WAAW,CAAClB,IAAI,CAAC,EAAEA,IAAI,CAACmB,OAAO,CAAC,CAAC,CAAC;EAC1E;AACF;AAACC,OAAA,CAAAtB,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Node, ModuleDeclaration } from 'typescript';
1
+ import type { Node, ModuleDeclaration } from 'typescript';
2
2
  import { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
5
- import { Identifier } from '../identifier';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import type { Identifier } from '../identifier';
6
6
  export declare class ModuleDeclarationTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
8
8
  getIdentifiers(): Promise<Identifier[]>;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","ModuleDeclarationTransformer","predicate","node","kind","ts","SyntaxKind","ModuleDeclaration","getIdentifiers","transform","context","location","getLocation","UnImplementedSchema","getText","exports"],"sources":["module-declaration.ts"],"sourcesContent":["import ts, { Node, ModuleDeclaration } from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class ModuleDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.ModuleDeclaration;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ModuleDeclaration, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new UnImplementedSchema(location, node.getText(), ts.SyntaxKind[node.kind]);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkF,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK3E,MAAMG,4BAA4B,CAA8B;EACrEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,iBAAiB;EACtD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAuB,EAAEO,OAA+B,EAAE;IACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACT,IAAI,CAAC;IAC1C,OAAO,KAAIU,wCAAmB,EAACF,QAAQ,EAAER,IAAI,CAACW,OAAO,CAAC,CAAC,EAAET,qBAAE,CAACC,UAAU,CAACH,IAAI,CAACC,IAAI,CAAC,CAAC;EACpF;AACF;AAACW,OAAA,CAAAd,4BAAA,GAAAA,4BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_semanticsEntities","e","__esModule","default","ModuleDeclarationTransformer","predicate","node","kind","ts","SyntaxKind","ModuleDeclaration","getIdentifiers","transform","context","location","getLocation","UnImplementedSchema","getText","exports"],"sources":["module-declaration.ts"],"sourcesContent":["import type { Node, ModuleDeclaration } from 'typescript';\nimport ts from 'typescript';\nimport { UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { Identifier } from '../identifier';\n\nexport class ModuleDeclarationTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.ModuleDeclaration;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: ModuleDeclaration, context: SchemaExtractorContext) {\n const location = context.getLocation(node);\n return new UnImplementedSchema(location, node.getText(), ts.SyntaxKind[node.kind]);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,mBAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAkF,SAAAC,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAK3E,MAAMG,4BAA4B,CAA8B;EACrEC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,iBAAiB;EACtD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAAuB,EAAEO,OAA+B,EAAE;IACxE,MAAMC,QAAQ,GAAGD,OAAO,CAACE,WAAW,CAACT,IAAI,CAAC;IAC1C,OAAO,KAAIU,wCAAmB,EAACF,QAAQ,EAAER,IAAI,CAACW,OAAO,CAAC,CAAC,EAAET,qBAAE,CAACC,UAAU,CAACH,IAAI,CAACC,IAAI,CAAC,CAAC;EACpF;AACF;AAACW,OAAA,CAAAd,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { Node, NamedTupleMember } from 'typescript';
1
+ import type { Node, NamedTupleMember } from 'typescript';
2
2
  import { NamedTupleSchema } from '@teambit/semantics.entities.semantic-schema';
3
- import { SchemaTransformer } from '../schema-transformer';
4
- import { SchemaExtractorContext } from '../schema-extractor-context';
5
- import { Identifier } from '../identifier';
3
+ import type { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaExtractorContext } from '../schema-extractor-context';
5
+ import type { Identifier } from '../identifier';
6
6
  export declare class NamedTupleTransformer implements SchemaTransformer {
7
7
  predicate(node: Node): boolean;
8
8
  getIdentifiers(): Promise<Identifier[]>;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","require","_semanticsEntities","NamedTupleTransformer","predicate","node","kind","SyntaxKind","NamedTupleMember","getIdentifiers","transform","context","name","getText","location","getLocation","type","computeSchema","NamedTupleSchema","exports"],"sources":["named-tuple.ts"],"sourcesContent":["import { Node, SyntaxKind, NamedTupleMember } from 'typescript';\nimport { NamedTupleSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { SchemaTransformer } from '../schema-transformer';\nimport { SchemaExtractorContext } from '../schema-extractor-context';\nimport { Identifier } from '../identifier';\n\nexport class NamedTupleTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.NamedTupleMember;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: NamedTupleMember, context: SchemaExtractorContext) {\n const name = node.name.getText();\n const location = context.getLocation(node);\n const type = await context.computeSchema(node.type);\n return new NamedTupleSchema(location, type, name);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,qBAAqB,CAA8B;EAC9DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,gBAAgB;EAClD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAAsB,EAAEM,OAA+B,EAAE;IACvE,MAAMC,IAAI,GAAGP,IAAI,CAACO,IAAI,CAACC,OAAO,CAAC,CAAC;IAChC,MAAMC,QAAQ,GAAGH,OAAO,CAACI,WAAW,CAACV,IAAI,CAAC;IAC1C,MAAMW,IAAI,GAAG,MAAML,OAAO,CAACM,aAAa,CAACZ,IAAI,CAACW,IAAI,CAAC;IACnD,OAAO,KAAIE,qCAAgB,EAACJ,QAAQ,EAAEE,IAAI,EAAEJ,IAAI,CAAC;EACnD;AACF;AAACO,OAAA,CAAAhB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","require","_semanticsEntities","NamedTupleTransformer","predicate","node","kind","SyntaxKind","NamedTupleMember","getIdentifiers","transform","context","name","getText","location","getLocation","type","computeSchema","NamedTupleSchema","exports"],"sources":["named-tuple.ts"],"sourcesContent":["import type { Node, NamedTupleMember } from 'typescript';\nimport { SyntaxKind } from 'typescript';\nimport { NamedTupleSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaTransformer } from '../schema-transformer';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { Identifier } from '../identifier';\n\nexport class NamedTupleTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === SyntaxKind.NamedTupleMember;\n }\n\n async getIdentifiers(): Promise<Identifier[]> {\n return [];\n }\n\n async transform(node: NamedTupleMember, context: SchemaExtractorContext) {\n const name = node.name.getText();\n const location = context.getLocation(node);\n const type = await context.computeSchema(node.type);\n return new NamedTupleSchema(location, type, name);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKO,MAAMG,qBAAqB,CAA8B;EAC9DC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,wBAAU,CAACC,gBAAgB;EAClD;EAEA,MAAMC,cAAcA,CAAA,EAA0B;IAC5C,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACL,IAAsB,EAAEM,OAA+B,EAAE;IACvE,MAAMC,IAAI,GAAGP,IAAI,CAACO,IAAI,CAACC,OAAO,CAAC,CAAC;IAChC,MAAMC,QAAQ,GAAGH,OAAO,CAACI,WAAW,CAACV,IAAI,CAAC;IAC1C,MAAMW,IAAI,GAAG,MAAML,OAAO,CAACM,aAAa,CAACZ,IAAI,CAACW,IAAI,CAAC;IACnD,OAAO,KAAIE,qCAAgB,EAACJ,QAAQ,EAAEE,IAAI,EAAEJ,IAAI,CAAC;EACnD;AACF;AAACO,OAAA,CAAAhB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import { Node, ObjectLiteralExpression } from 'typescript';
1
+ import type { Node, ObjectLiteralExpression } from 'typescript';
2
2
  import { ObjectLiteralExpressionSchema } from '@teambit/semantics.entities.semantic-schema';
3
3
  import type { SchemaExtractorContext } from '../schema-extractor-context';
4
- import { SchemaTransformer } from '../schema-transformer';
4
+ import type { SchemaTransformer } from '../schema-transformer';
5
5
  export declare class ObjectLiteralExpressionTransformer implements SchemaTransformer {
6
6
  predicate(node: Node): boolean;
7
7
  getIdentifiers(): Promise<never[]>;
@@ -1 +1 @@
1
- {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_pMapSeries","_semanticsEntities","e","__esModule","default","ObjectLiteralExpressionTransformer","predicate","node","kind","ts","SyntaxKind","ObjectLiteralExpression","getIdentifiers","transform","context","properties","pMapSeries","prop","schema","computeSchema","UnImplementedSchema","typeRef","resolveType","getText","location","getLocation","ObjectLiteralExpressionSchema","exports"],"sources":["object-literal-expression.ts"],"sourcesContent":["import ts, { Node, ObjectLiteralExpression } from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { ObjectLiteralExpressionSchema, UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport { SchemaTransformer } from '../schema-transformer';\n\nexport class ObjectLiteralExpressionTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.ObjectLiteralExpression;\n }\n\n async getIdentifiers() {\n return [];\n }\n\n async transform(node: ObjectLiteralExpression, context: SchemaExtractorContext) {\n const properties = await pMapSeries(node.properties, async (prop) => {\n const schema = await context.computeSchema(prop);\n if (schema instanceof UnImplementedSchema) {\n const typeRef = await context.resolveType(prop, prop.getText());\n return typeRef;\n }\n return schema;\n });\n const location = context.getLocation(node);\n return new ObjectLiteralExpressionSchema(properties, location);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiH,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI1G,MAAMG,kCAAkC,CAA8B;EAC3EC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,CAACC,UAAU,CAACC,uBAAuB;EAC5D;EAEA,MAAMC,cAAcA,CAAA,EAAG;IACrB,OAAO,EAAE;EACX;EAEA,MAAMC,SAASA,CAACN,IAA6B,EAAEO,OAA+B,EAAE;IAC9E,MAAMC,UAAU,GAAG,MAAM,IAAAC,qBAAU,EAACT,IAAI,CAACQ,UAAU,EAAE,MAAOE,IAAI,IAAK;MACnE,MAAMC,MAAM,GAAG,MAAMJ,OAAO,CAACK,aAAa,CAACF,IAAI,CAAC;MAChD,IAAIC,MAAM,YAAYE,wCAAmB,EAAE;QACzC,MAAMC,OAAO,GAAG,MAAMP,OAAO,CAACQ,WAAW,CAACL,IAAI,EAAEA,IAAI,CAACM,OAAO,CAAC,CAAC,CAAC;QAC/D,OAAOF,OAAO;MAChB;MACA,OAAOH,MAAM;IACf,CAAC,CAAC;IACF,MAAMM,QAAQ,GAAGV,OAAO,CAACW,WAAW,CAAClB,IAAI,CAAC;IAC1C,OAAO,KAAImB,kDAA6B,EAACX,UAAU,EAAES,QAAQ,CAAC;EAChE;AACF;AAACG,OAAA,CAAAtB,kCAAA,GAAAA,kCAAA","ignoreList":[]}
1
+ {"version":3,"names":["_typescript","data","_interopRequireDefault","require","_pMapSeries","_semanticsEntities","e","__esModule","default","ObjectLiteralExpressionTransformer","predicate","node","kind","ts","SyntaxKind","ObjectLiteralExpression","getIdentifiers","transform","context","properties","pMapSeries","prop","schema","computeSchema","UnImplementedSchema","typeRef","resolveType","getText","location","getLocation","ObjectLiteralExpressionSchema","exports"],"sources":["object-literal-expression.ts"],"sourcesContent":["import type { Node, ObjectLiteralExpression } from 'typescript';\nimport ts from 'typescript';\nimport pMapSeries from 'p-map-series';\nimport { ObjectLiteralExpressionSchema, UnImplementedSchema } from '@teambit/semantics.entities.semantic-schema';\nimport type { SchemaExtractorContext } from '../schema-extractor-context';\nimport type { SchemaTransformer } from '../schema-transformer';\n\nexport class ObjectLiteralExpressionTransformer implements SchemaTransformer {\n predicate(node: Node) {\n return node.kind === ts.SyntaxKind.ObjectLiteralExpression;\n }\n\n async getIdentifiers() {\n return [];\n }\n\n async transform(node: ObjectLiteralExpression, context: SchemaExtractorContext) {\n const properties = await pMapSeries(node.properties, async (prop) => {\n const schema = await context.computeSchema(prop);\n if (schema instanceof UnImplementedSchema) {\n const typeRef = await context.resolveType(prop, prop.getText());\n return typeRef;\n }\n return schema;\n });\n const location = context.getLocation(node);\n return new ObjectLiteralExpressionSchema(properties, location);\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,mBAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,kBAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiH,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI1G,MAAMG,kCAAkC,CAA8B;EAC3EC,SAASA,CAACC,IAAU,EAAE;IACpB,OAAOA,IAAI,CAACC,IAAI,KAAKC,qBAAE,C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