@openpkg-ts/sdk 0.30.1 → 0.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4593,6 +4593,15 @@ function extractExportItem(symbol, checker, entryFile, entrySourceFile) {
|
|
|
4593
4593
|
const declaration = targetSymbol.valueDeclaration || declarations.find((d) => d.kind !== ts12.SyntaxKind.ExportSpecifier) || declarations[0];
|
|
4594
4594
|
if (!declaration)
|
|
4595
4595
|
return null;
|
|
4596
|
+
if (ts12.isSourceFile(declaration)) {
|
|
4597
|
+
return {
|
|
4598
|
+
name,
|
|
4599
|
+
kind: "namespace",
|
|
4600
|
+
file: path2.relative(path2.dirname(entryFile), declaration.fileName),
|
|
4601
|
+
line: 1,
|
|
4602
|
+
reexport: true
|
|
4603
|
+
};
|
|
4604
|
+
}
|
|
4596
4605
|
const kind = getExportKind(declaration, checker.getTypeAtLocation(declaration));
|
|
4597
4606
|
const sourceFile = declaration.getSourceFile();
|
|
4598
4607
|
const { line } = sourceFile.getLineAndCharacterOfPosition(declaration.getStart());
|
|
@@ -4610,6 +4619,9 @@ function extractExportItem(symbol, checker, entryFile, entrySourceFile) {
|
|
|
4610
4619
|
};
|
|
4611
4620
|
}
|
|
4612
4621
|
function getExportKind(declaration, type) {
|
|
4622
|
+
if (ts12.isSourceFile(declaration)) {
|
|
4623
|
+
return "namespace";
|
|
4624
|
+
}
|
|
4613
4625
|
if (ts12.isFunctionDeclaration(declaration) || ts12.isFunctionExpression(declaration)) {
|
|
4614
4626
|
return "function";
|
|
4615
4627
|
}
|