durable-actors 0.7.16 → 0.8.0

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 (56) hide show
  1. package/README.md +5 -5
  2. package/bin/durable-actors.js +2 -0
  3. package/dist/actor/actor.d.ts +2 -2
  4. package/dist/actor/actor.d.ts.map +1 -1
  5. package/dist/actor/actor.js +5 -3
  6. package/dist/actor/actor.js.map +1 -1
  7. package/dist/actor/database.d.ts +3 -2
  8. package/dist/actor/database.d.ts.map +1 -1
  9. package/dist/actor/database.js +21 -3
  10. package/dist/actor/database.js.map +1 -1
  11. package/dist/cli/dev.d.ts.map +1 -1
  12. package/dist/cli/dev.js +13 -42
  13. package/dist/cli/dev.js.map +1 -1
  14. package/dist/cli/python.d.ts.map +1 -1
  15. package/dist/cli/python.js +0 -1
  16. package/dist/cli/python.js.map +1 -1
  17. package/dist/cli.d.ts +1 -1
  18. package/dist/cli.js +9 -18
  19. package/dist/cli.js.map +1 -1
  20. package/dist/compiler/declarations.js +2648 -183
  21. package/dist/compiler/declarations.js.map +7 -1
  22. package/dist/host/actor-runtime.d.ts.map +1 -1
  23. package/dist/host/actor-runtime.js +2 -3
  24. package/dist/host/actor-runtime.js.map +1 -1
  25. package/dist/host/sqlite.d.ts.map +1 -1
  26. package/dist/host/sqlite.js +2 -0
  27. package/dist/host/sqlite.js.map +1 -1
  28. package/dist/projectSdk.js +1 -1
  29. package/dist/projectSdk.js.map +1 -1
  30. package/dist/templates/actor/README.md +7 -9
  31. package/dist/templates/actor/bunfig +2 -0
  32. package/dist/templates/actor/package.json +6 -3
  33. package/dist/templates/ai-chat/README.md +8 -8
  34. package/dist/templates/ai-chat/bunfig +2 -0
  35. package/dist/templates/ai-chat/package.json +7 -5
  36. package/dist/templates/chat/README.md +8 -8
  37. package/dist/templates/chat/bunfig +2 -0
  38. package/dist/templates/chat/package.json +7 -5
  39. package/dist/templates/documents/README.md +8 -8
  40. package/dist/templates/documents/bunfig +2 -0
  41. package/dist/templates/documents/package.json +7 -5
  42. package/package.json +110 -108
  43. package/dist/cli/actor-source-watcher.d.ts +0 -25
  44. package/dist/cli/actor-source-watcher.d.ts.map +0 -1
  45. package/dist/cli/actor-source-watcher.js +0 -129
  46. package/dist/cli/actor-source-watcher.js.map +0 -1
  47. package/dist/templates/actor/pnpm-workspace.yaml +0 -2
  48. package/dist/templates/ai-chat/pnpm-workspace.yaml +0 -2
  49. package/dist/templates/chat/pnpm-workspace.yaml +0 -2
  50. package/dist/templates/documents/pnpm-workspace.yaml +0 -2
  51. package/dist/templates/python/README.md +0 -7
  52. package/dist/templates/python/gitignore +0 -6
  53. package/dist/templates/python/package.json +0 -11
  54. package/dist/templates/python/pnpm-workspace.yaml +0 -2
  55. package/dist/templates/python/pyproject.toml +0 -8
  56. package/dist/templates/python/src/actors.py +0 -9
@@ -1 +1,7 @@
1
- {"version":3,"file":"declarations.js","sourceRoot":"","sources":["../../src/compiler/declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACpF,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAGnD,MAAM,mBAAmB;IACQ;IAA7B,YAA6B,SAAoB,EAAE,CAAC,GAAG;QAA1B,WAAM,GAAN,MAAM,CAAoB;IAAG,CAAC;IAE3D,OAAO,CACH,OAAmB,EACnB,MAAsC,EACtC,SAA8B;QAE9B,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAA;QAC5E,IAAI,CAAC;YACD,OA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AO,KAAK,QAAQ;oBAChC,MAAM,IAAI,oBAAoB,CAAC,0BAA0B,IAAI,yBAAyB,CAAC,CAAA;gBAC3F,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAiB,EAAE,CAAA;YACzD,CAAC;QACL,CAAC;QACD,IAAI,SAAS,KAAK,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;YACrC,MAAM,IAAI,oBAAoB,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;IAClF,CAAC;AACL,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/logger.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/helpers/fix-path.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/helpers/get-absolute-path.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/helpers/check-diagnostics-errors.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/get-compiler-options.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/compile-dts.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/helpers/typescript.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/types-usage-evaluator.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/helpers/node-modules.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/module-info.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/helpers/package-version.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/generate-output.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/collisions-resolver.js", "../../../node_modules/.bun/dts-bundle-generator@9.5.1/node_modules/dts-bundle-generator/dist/bundle-generator.js", "../../src/compiler/declarations.ts"],
4
+ "sourcesContent": ["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enableNormalLog = exports.enableVerbose = exports.errorLog = exports.warnLog = exports.normalLog = exports.verboseLog = void 0;\nfunction verboseLog(message) {\n logMessage(message, 0 /* LogLevel.Verbose */);\n}\nexports.verboseLog = verboseLog;\nfunction normalLog(message) {\n logMessage(message, 1 /* LogLevel.Normal */);\n}\nexports.normalLog = normalLog;\nfunction warnLog(message) {\n logMessage(message, 2 /* LogLevel.Warning */);\n}\nexports.warnLog = warnLog;\nfunction errorLog(message) {\n logMessage(message, 3 /* LogLevel.Error */);\n}\nexports.errorLog = errorLog;\nlet currentLogLevel = 3 /* LogLevel.Error */;\nfunction enableVerbose() {\n currentLogLevel = 0 /* LogLevel.Verbose */;\n normalLog('Verbose log enabled');\n}\nexports.enableVerbose = enableVerbose;\nfunction enableNormalLog() {\n currentLogLevel = 1 /* LogLevel.Normal */;\n}\nexports.enableNormalLog = enableNormalLog;\nfunction logMessage(message, level = 0 /* LogLevel.Verbose */) {\n if (level < currentLogLevel) {\n return;\n }\n switch (level) {\n case 3 /* LogLevel.Error */:\n // print red\n // eslint-disable-next-line no-console\n console.error(`\\x1b[0;31m${message}\\x1b[0m`);\n break;\n case 2 /* LogLevel.Warning */:\n // eslint-disable-next-line no-console\n console.warn(`\\x1b[1;33m${message}\\x1b[0m`);\n break;\n case 1 /* LogLevel.Normal */:\n case 0 /* LogLevel.Verbose */:\n // eslint-disable-next-line no-console\n console.log(message);\n }\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.fixPath = void 0;\nfunction fixPath(path) {\n // special case for windows\n return path.replace(/\\\\/g, '/');\n}\nexports.fixPath = fixPath;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getAbsolutePath = void 0;\nconst path = require(\"path\");\nconst process = require(\"process\");\nconst fix_path_1 = require(\"./fix-path\");\nfunction getAbsolutePath(fileName, cwd) {\n if (!path.isAbsolute(fileName)) {\n fileName = path.join(cwd !== undefined ? cwd : process.cwd(), fileName);\n }\n return (0, fix_path_1.fixPath)(fileName);\n}\nexports.getAbsolutePath = getAbsolutePath;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkDiagnosticsErrors = exports.checkProgramDiagnosticsErrors = void 0;\nconst ts = require(\"typescript\");\nconst logger_1 = require(\"../logger\");\nconst formatDiagnosticsHost = {\n getCanonicalFileName: (fileName) => ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(),\n getCurrentDirectory: ts.sys.getCurrentDirectory,\n getNewLine: () => ts.sys.newLine,\n};\nfunction checkProgramDiagnosticsErrors(program) {\n if (!program.getCompilerOptions().declaration) {\n throw new Error(`Something went wrong - the program doesn't have declaration option enabled`);\n }\n checkDiagnosticsErrors(ts.getPreEmitDiagnostics(program), 'Compiled with errors');\n}\nexports.checkProgramDiagnosticsErrors = checkProgramDiagnosticsErrors;\nfunction checkDiagnosticsErrors(diagnostics, failMessage) {\n if (diagnostics.length === 0) {\n return;\n }\n (0, logger_1.errorLog)(ts.formatDiagnostics(diagnostics, formatDiagnosticsHost).trim());\n throw new Error(failMessage);\n}\nexports.checkDiagnosticsErrors = checkDiagnosticsErrors;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCompilerOptions = void 0;\nconst ts = require(\"typescript\");\nconst path = require(\"path\");\nconst get_absolute_path_1 = require(\"./helpers/get-absolute-path\");\nconst check_diagnostics_errors_1 = require(\"./helpers/check-diagnostics-errors\");\nconst logger_1 = require(\"./logger\");\nconst parseConfigHost = {\n useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames,\n readDirectory: ts.sys.readDirectory,\n fileExists: ts.sys.fileExists,\n readFile: ts.sys.readFile,\n};\nfunction getCompilerOptions(inputFileNames, preferredConfigPath) {\n const configFileName = preferredConfigPath !== undefined ? preferredConfigPath : findConfig(inputFileNames);\n (0, logger_1.verboseLog)(`Using config: ${configFileName}`);\n const configParseResult = ts.readConfigFile(configFileName, ts.sys.readFile);\n (0, check_diagnostics_errors_1.checkDiagnosticsErrors)(configParseResult.error !== undefined ? [configParseResult.error] : [], 'Error while processing tsconfig file');\n const compilerOptionsParseResult = ts.parseJsonConfigFileContent(configParseResult.config, parseConfigHost, path.resolve(path.dirname(configFileName)), undefined, (0, get_absolute_path_1.getAbsolutePath)(configFileName));\n // we don't want to raise an error if no inputs found in a config file\n // because this error is mostly for CLI, but we'll pass an inputs in createProgram\n // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n const diagnostics = compilerOptionsParseResult.errors.filter((d) => d.code !== 18003 /* Constants.NoInputsWereFoundDiagnosticCode */);\n (0, check_diagnostics_errors_1.checkDiagnosticsErrors)(diagnostics, 'Error while processing tsconfig compiler options');\n return compilerOptionsParseResult.options;\n}\nexports.getCompilerOptions = getCompilerOptions;\nfunction findConfig(inputFiles) {\n if (inputFiles.length !== 1) {\n throw new Error('Cannot find tsconfig for multiple files. Please specify preferred tsconfig file');\n }\n // input file could be a relative path to the current path\n // and desired config could be outside of current cwd folder\n // so we have to provide absolute path to find config until the root\n const searchPath = (0, get_absolute_path_1.getAbsolutePath)(inputFiles[0]);\n const configFileName = ts.findConfigFile(searchPath, ts.sys.fileExists);\n if (!configFileName) {\n throw new Error(`Cannot find config file for file ${searchPath}`);\n }\n return configFileName;\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.compileDts = void 0;\nconst ts = require(\"typescript\");\nconst logger_1 = require(\"./logger\");\nconst get_compiler_options_1 = require(\"./get-compiler-options\");\nconst check_diagnostics_errors_1 = require(\"./helpers/check-diagnostics-errors\");\nconst declarationExtsRemapping = {\n [ts.Extension.Js]: ts.Extension.Js,\n [ts.Extension.Jsx]: ts.Extension.Jsx,\n [ts.Extension.Json]: ts.Extension.Json,\n [ts.Extension.TsBuildInfo]: ts.Extension.TsBuildInfo,\n [ts.Extension.Mjs]: ts.Extension.Mjs,\n [ts.Extension.Cjs]: ts.Extension.Cjs,\n [ts.Extension.Ts]: ts.Extension.Dts,\n [ts.Extension.Tsx]: ts.Extension.Dts,\n [ts.Extension.Dts]: ts.Extension.Dts,\n [ts.Extension.Mts]: ts.Extension.Dmts,\n [ts.Extension.Dmts]: ts.Extension.Dmts,\n [ts.Extension.Cts]: ts.Extension.Dcts,\n [ts.Extension.Dcts]: ts.Extension.Dcts,\n};\nfunction compileDts(rootFiles, preferredConfigPath, followSymlinks = true) {\n const compilerOptions = (0, get_compiler_options_1.getCompilerOptions)(rootFiles, preferredConfigPath);\n // currently we don't support these compiler options\n // and removing them shouldn't affect generated code\n // so let's just remove them for this run\n compilerOptions.outDir = undefined;\n compilerOptions.incremental = undefined;\n compilerOptions.tsBuildInfoFile = undefined;\n compilerOptions.declarationDir = undefined;\n // we want to turn this option on because in this case the compile will generate declaration diagnostics out of the box\n compilerOptions.declaration = true;\n if (compilerOptions.composite) {\n (0, logger_1.warnLog)(`Composite projects aren't supported at the time. Prefer to use non-composite project to generate declarations instead or just ignore this message if everything works fine. See https://github.com/timocov/dts-bundle-generator/issues/93`);\n compilerOptions.composite = undefined;\n }\n const host = createCachingCompilerHost(compilerOptions);\n const dtsFiles = getDeclarationFiles(rootFiles, compilerOptions, host);\n if (!followSymlinks) {\n // note that this shouldn't affect the previous call as there we actually want to use actual path in order to compile files\n // and avoid issues like \"you have .ts files in node_modules\"\n host.realpath = (p) => p;\n }\n const moduleResolutionCache = ts.createModuleResolutionCache(host.getCurrentDirectory(), host.getCanonicalFileName, compilerOptions);\n host.resolveModuleNameLiterals = (moduleLiterals, containingFile) => {\n return moduleLiterals.map((moduleLiteral) => {\n const resolvedModule = ts.resolveModuleName(moduleLiteral.text, containingFile, compilerOptions, host, moduleResolutionCache).resolvedModule;\n if (resolvedModule && !resolvedModule.isExternalLibraryImport) {\n const newExt = declarationExtsRemapping[resolvedModule.extension];\n if (newExt === undefined) {\n (0, logger_1.verboseLog)(`Skipping module ${resolvedModule.resolvedFileName} because it has unsupported extension \"${resolvedModule.extension}\"`);\n return { resolvedModule };\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n if (newExt !== resolvedModule.extension) {\n (0, logger_1.verboseLog)(`Changing module from ${resolvedModule.extension} to ${newExt} for ${resolvedModule.resolvedFileName}`);\n resolvedModule.extension = newExt;\n resolvedModule.resolvedFileName = changeExtensionToDts(resolvedModule.resolvedFileName);\n }\n }\n return { resolvedModule };\n });\n };\n const originalGetSourceFile = host.getSourceFile;\n host.getSourceFile = (fileName, languageVersion, onError) => {\n const storedValue = dtsFiles.get(host.getCanonicalFileName(fileName));\n if (storedValue !== undefined) {\n return ts.createSourceFile(fileName, storedValue, languageVersion);\n }\n return originalGetSourceFile(fileName, languageVersion, onError);\n };\n const rootFilesRemapping = new Map();\n const inputFiles = rootFiles.map((rootFile) => {\n const rootDtsFile = changeExtensionToDts(rootFile);\n rootFilesRemapping.set(rootFile, rootDtsFile);\n return rootDtsFile;\n });\n const program = ts.createProgram(inputFiles, compilerOptions, host);\n (0, check_diagnostics_errors_1.checkProgramDiagnosticsErrors)(program);\n warnAboutTypeScriptFilesInProgram(program);\n return { program, rootFilesRemapping };\n}\nexports.compileDts = compileDts;\nfunction createCachingCompilerHost(compilerOptions) {\n const host = ts.createIncrementalCompilerHost(compilerOptions);\n const sourceFilesCache = new Map();\n const originalGetSourceFile = host.getSourceFile;\n host.getSourceFile = (fileName, languageVersion, onError) => {\n const key = host.getCanonicalFileName(fileName);\n let cacheValue = sourceFilesCache.get(key);\n if (cacheValue === undefined) {\n cacheValue = originalGetSourceFile(fileName, languageVersion, onError);\n sourceFilesCache.set(key, cacheValue);\n }\n return cacheValue;\n };\n return host;\n}\nfunction changeExtensionToDts(fileName) {\n let ext;\n // `path.extname` doesn't handle `.d.ts` cases (it returns `.ts` instead of `.d.ts`)\n if (fileName.endsWith(ts.Extension.Dts)) {\n return fileName;\n }\n if (fileName.endsWith(ts.Extension.Cts)) {\n ext = ts.Extension.Cts;\n }\n else if (fileName.endsWith(ts.Extension.Mts)) {\n ext = ts.Extension.Mts;\n }\n else if (fileName.endsWith(ts.Extension.Ts)) {\n ext = ts.Extension.Ts;\n }\n else if (fileName.endsWith(ts.Extension.Tsx)) {\n ext = ts.Extension.Tsx;\n }\n if (ext === undefined) {\n return fileName;\n }\n return fileName.slice(0, -ext.length) + declarationExtsRemapping[ext];\n}\n/**\n * @description Compiles source files into d.ts files and returns map of absolute path to file content\n */\nfunction getDeclarationFiles(rootFiles, compilerOptions, host) {\n // we must pass `declaration: true` and `noEmit: false` if we want to generate declaration files\n // see https://github.com/microsoft/TypeScript/issues/24002#issuecomment-550549393\n // also, we don't want to generate anything apart from declarations so that's why `emitDeclarationOnly: true` is here\n // it allows to run the tool for projects with allowJs flag enabled to avoid errors like:\n // error TS5055: Cannot write file '<filename>' because it would overwrite input file.\n compilerOptions = {\n ...compilerOptions,\n noEmit: false,\n declaration: true,\n emitDeclarationOnly: true,\n };\n // theoretically this could be dangerous because the compiler host is created with compiler options\n // so technically `compilerOptions` and ones that were used to create the host might be different (and most likely will be)\n // but apparently a compiler host doesn't use compiler options that much, just a few encoding/newLine oriented\n // so hopefully it should be fine\n const program = ts.createProgram(rootFiles, compilerOptions, host);\n const allFilesAreDeclarations = program.getSourceFiles().every((s) => s.isDeclarationFile);\n const declarations = new Map();\n if (allFilesAreDeclarations) {\n // if all files are declarations we don't need to compile the project twice\n // so let's just return empty map to speed up\n (0, logger_1.verboseLog)('Skipping compiling the project to generate d.ts because all files in it are d.ts already');\n return declarations;\n }\n (0, check_diagnostics_errors_1.checkProgramDiagnosticsErrors)(program);\n const emitResult = program.emit(undefined, (fileName, data) => declarations.set(host.getCanonicalFileName(fileName), data), undefined, true);\n (0, check_diagnostics_errors_1.checkDiagnosticsErrors)(emitResult.diagnostics, 'Errors while emitting declarations');\n return declarations;\n}\nfunction warnAboutTypeScriptFilesInProgram(program) {\n const nonDeclarationFiles = program.getSourceFiles().filter((file) => !file.isDeclarationFile);\n if (nonDeclarationFiles.length !== 0) {\n (0, logger_1.warnLog)(`WARNING: It seems that some files in the compilation still are not declaration files.\nFor more information see https://github.com/timocov/dts-bundle-generator/issues/53.\nIf you think this is a mistake, feel free to open new issue or just ignore this warning.\n ${nonDeclarationFiles.map((file) => file.fileName).join('\\n ')}\n`);\n }\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveGlobalName = exports.getDeclarationsForExportedValues = exports.getSymbolExportStarDeclarations = exports.getImportExportReferencedSymbol = exports.getImportModuleName = exports.resolveReferencedModule = exports.getClosestSourceFileLikeNode = exports.getClosestModuleLikeNode = exports.getNodeSymbol = exports.getNodeOwnSymbol = exports.getRootSourceFile = exports.getModifiers = exports.recreateRootLevelNodeWithModifiers = exports.modifiersMapToArray = exports.modifiersToMap = exports.getExportsForStatement = exports.resolveIdentifier = exports.getExportsForSourceFile = exports.getDeclarationsForSymbol = exports.isDeclareGlobalStatement = exports.isDeclareModule = exports.isAmbientModule = exports.splitTransientSymbol = exports.getDeclarationNameSymbol = exports.getActualSymbol = exports.getNodeName = exports.hasNodeModifier = exports.isNodeNamedDeclaration = void 0;\nconst ts = require(\"typescript\");\nconst logger_1 = require(\"../logger\");\nconst namedDeclarationKinds = [\n ts.SyntaxKind.InterfaceDeclaration,\n ts.SyntaxKind.ClassDeclaration,\n ts.SyntaxKind.EnumDeclaration,\n ts.SyntaxKind.TypeAliasDeclaration,\n ts.SyntaxKind.ModuleDeclaration,\n ts.SyntaxKind.FunctionDeclaration,\n ts.SyntaxKind.VariableDeclaration,\n ts.SyntaxKind.PropertySignature,\n ts.SyntaxKind.NamespaceExport,\n ts.SyntaxKind.NamespaceImport,\n ts.SyntaxKind.ExportSpecifier,\n ts.SyntaxKind.BindingElement,\n];\nfunction isNodeNamedDeclaration(node) {\n return namedDeclarationKinds.indexOf(node.kind) !== -1;\n}\nexports.isNodeNamedDeclaration = isNodeNamedDeclaration;\nfunction hasNodeModifier(node, modifier) {\n const modifiers = getModifiers(node);\n return Boolean(modifiers && modifiers.some((nodeModifier) => nodeModifier.kind === modifier));\n}\nexports.hasNodeModifier = hasNodeModifier;\nfunction getNodeName(node) {\n const nodeName = node.name;\n if (nodeName === undefined) {\n const modifiers = getModifiers(node);\n const defaultModifier = modifiers?.find((mod) => mod.kind === ts.SyntaxKind.DefaultKeyword);\n if (defaultModifier !== undefined) {\n return defaultModifier;\n }\n }\n return nodeName;\n}\nexports.getNodeName = getNodeName;\nfunction getActualSymbol(symbol, typeChecker) {\n if (symbol.flags & ts.SymbolFlags.Alias) {\n symbol = typeChecker.getAliasedSymbol(symbol);\n }\n return typeChecker.getMergedSymbol(symbol);\n}\nexports.getActualSymbol = getActualSymbol;\nfunction getDeclarationNameSymbol(name, typeChecker) {\n const symbol = typeChecker.getSymbolAtLocation(name);\n if (symbol === undefined) {\n return null;\n }\n return getActualSymbol(symbol, typeChecker);\n}\nexports.getDeclarationNameSymbol = getDeclarationNameSymbol;\nfunction splitTransientSymbol(symbol, typeChecker) {\n // actually I think we even don't need to operate/use \"Transient\" symbols anywhere\n // it's kind of aliased symbol, but just merged\n // but it's hard to refractor everything to use array of symbols instead of just symbol\n // so let's fix it for some places\n if ((symbol.flags & ts.SymbolFlags.Transient) === 0) {\n return new Set([symbol]);\n }\n // \"Transient\" symbol is kinda \"merged\" symbol\n // I don't really know is this way to \"split\" is correct\n // but it seems that it works for now \u00AF\\_(\u30C4)_/\u00AF\n const declarations = getDeclarationsForSymbol(symbol);\n const result = new Set();\n for (const declaration of declarations) {\n if (!isNodeNamedDeclaration(declaration) || declaration.name === undefined) {\n continue;\n }\n const sym = typeChecker.getSymbolAtLocation(declaration.name);\n if (sym === undefined) {\n continue;\n }\n result.add(getActualSymbol(sym, typeChecker));\n }\n return result;\n}\nexports.splitTransientSymbol = splitTransientSymbol;\n/**\n * @see https://github.com/Microsoft/TypeScript/blob/f7c4fefeb62416c311077a699cc15beb211c25c9/src/compiler/utilities.ts#L626-L628\n */\nfunction isGlobalScopeAugmentation(module) {\n return Boolean(module.flags & ts.NodeFlags.GlobalAugmentation);\n}\n/**\n * Returns whether node is ambient module declaration (declare module \"name\" or declare global)\n * @see https://github.com/Microsoft/TypeScript/blob/f7c4fefeb62416c311077a699cc15beb211c25c9/src/compiler/utilities.ts#L588-L590\n */\nfunction isAmbientModule(node) {\n return ts.isModuleDeclaration(node) && (node.name.kind === ts.SyntaxKind.StringLiteral || isGlobalScopeAugmentation(node));\n}\nexports.isAmbientModule = isAmbientModule;\n/**\n * Returns whether node is `declare module` ModuleDeclaration (not `declare global` or `namespace`)\n */\nfunction isDeclareModule(node) {\n // `declare module \"\"`, `declare global` and `namespace {}` are ModuleDeclaration\n // but here we need to check only `declare module` statements\n return ts.isModuleDeclaration(node) && !(node.flags & ts.NodeFlags.Namespace) && !isGlobalScopeAugmentation(node);\n}\nexports.isDeclareModule = isDeclareModule;\n/**\n * Returns whether statement is `declare global` ModuleDeclaration\n */\nfunction isDeclareGlobalStatement(statement) {\n return ts.isModuleDeclaration(statement) && isGlobalScopeAugmentation(statement);\n}\nexports.isDeclareGlobalStatement = isDeclareGlobalStatement;\nfunction getDeclarationsForSymbol(symbol) {\n const result = [];\n if (symbol.declarations !== undefined) {\n result.push(...symbol.declarations);\n }\n if (symbol.valueDeclaration !== undefined) {\n // push valueDeclaration might be already in declarations array\n // so let's check first to avoid duplication nodes\n if (!result.includes(symbol.valueDeclaration)) {\n result.push(symbol.valueDeclaration);\n }\n }\n return result;\n}\nexports.getDeclarationsForSymbol = getDeclarationsForSymbol;\nfunction getExportsForSourceFile(typeChecker, sourceFileSymbol) {\n if (sourceFileSymbol.exports !== undefined) {\n const commonJsExport = sourceFileSymbol.exports.get(ts.InternalSymbolName.ExportEquals);\n if (commonJsExport !== undefined) {\n const symbol = getActualSymbol(commonJsExport, typeChecker);\n return [\n {\n symbol,\n originalSymbol: commonJsExport,\n type: 0 /* ExportType.CommonJS */,\n exportedName: '',\n },\n ];\n }\n }\n const result = typeChecker\n .getExportsOfModule(sourceFileSymbol)\n .map((symbol) => ({ symbol, originalSymbol: symbol, exportedName: symbol.name, type: 1 /* ExportType.ES6Named */ }));\n if (sourceFileSymbol.exports !== undefined) {\n const defaultExportSymbol = sourceFileSymbol.exports.get(ts.InternalSymbolName.Default);\n if (defaultExportSymbol !== undefined) {\n const defaultExport = result.find((exp) => exp.symbol === defaultExportSymbol);\n if (defaultExport !== undefined) {\n defaultExport.type = 2 /* ExportType.ES6Default */;\n }\n else {\n // it seems that default export is always returned by getExportsOfModule\n // but let's add it to be sure add if there is no such export\n result.push({\n symbol: defaultExportSymbol,\n originalSymbol: defaultExportSymbol,\n type: 2 /* ExportType.ES6Default */,\n exportedName: 'default',\n });\n }\n }\n }\n const symbolsMergingResolvedExports = [];\n result.forEach((exp) => {\n exp.symbol = getActualSymbol(exp.symbol, typeChecker);\n const symbolsDeclarations = getDeclarationsForSymbol(exp.symbol);\n const importSpecifierDeclaration = symbolsDeclarations.find(ts.isImportSpecifier);\n if (symbolsDeclarations.length > 1 && importSpecifierDeclaration !== undefined) {\n // most likely this export is part of the symbol merging situation\n // where one of the declarations is the imported value but the other is declared locally\n // in this case we need to add an extra export to the exports list to make sure that it is marked as \"exported\"\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const referencedModule = resolveReferencedModule(importSpecifierDeclaration.parent.parent.parent, typeChecker);\n if (referencedModule !== null) {\n const referencedModuleSymbol = getNodeSymbol(referencedModule, typeChecker);\n if (referencedModuleSymbol !== null) {\n const importedName = (importSpecifierDeclaration.propertyName ?? importSpecifierDeclaration.name).getText();\n const exportedItemSymbol = typeChecker.getExportsOfModule(referencedModuleSymbol).find((exportSymbol) => exportSymbol.getName() === importedName);\n if (exportedItemSymbol !== undefined) {\n symbolsMergingResolvedExports.push({\n ...exp,\n symbol: getActualSymbol(exportedItemSymbol, typeChecker),\n });\n }\n }\n }\n }\n });\n return [...result, ...symbolsMergingResolvedExports];\n}\nexports.getExportsForSourceFile = getExportsForSourceFile;\nfunction resolveIdentifier(typeChecker, identifier) {\n const symbol = getDeclarationNameSymbol(identifier, typeChecker);\n if (symbol === null) {\n return undefined;\n }\n return resolveDeclarationByIdentifierSymbol(symbol);\n}\nexports.resolveIdentifier = resolveIdentifier;\nfunction resolveDeclarationByIdentifierSymbol(identifierSymbol) {\n const declarations = getDeclarationsForSymbol(identifierSymbol);\n if (declarations.length === 0) {\n return undefined;\n }\n const decl = declarations[0];\n if (!isNodeNamedDeclaration(decl)) {\n return undefined;\n }\n return decl;\n}\nfunction getExportsForStatement(exportedSymbols, typeChecker, statement) {\n if (ts.isVariableStatement(statement)) {\n if (statement.declarationList.declarations.length === 0) {\n return [];\n }\n const firstDeclarationExports = getExportsForName(exportedSymbols, typeChecker, statement.declarationList.declarations[0].name);\n const allDeclarationsHaveSameExportType = statement.declarationList.declarations.every((variableDecl) => {\n // all declaration should have the same export type\n // TODO: for now it's not supported to have different type of exports\n return getExportsForName(exportedSymbols, typeChecker, variableDecl.name)[0]?.type === firstDeclarationExports[0]?.type;\n });\n if (!allDeclarationsHaveSameExportType) {\n // log warn?\n return [];\n }\n return firstDeclarationExports;\n }\n const nodeName = getNodeName(statement);\n if (nodeName === undefined) {\n return [];\n }\n return getExportsForName(exportedSymbols, typeChecker, nodeName);\n}\nexports.getExportsForStatement = getExportsForStatement;\nfunction getExportsForName(exportedSymbols, typeChecker, name) {\n if (ts.isArrayBindingPattern(name) || ts.isObjectBindingPattern(name)) {\n // TODO: binding patterns in variable declarations are not supported for now\n // see https://github.com/microsoft/TypeScript/issues/30598 also\n return [];\n }\n const declarationSymbol = typeChecker.getSymbolAtLocation(name);\n return exportedSymbols.filter((rootExport) => rootExport.symbol === declarationSymbol);\n}\nconst modifiersPriority = {\n [ts.SyntaxKind.ExportKeyword]: 4,\n [ts.SyntaxKind.DefaultKeyword]: 3,\n [ts.SyntaxKind.DeclareKeyword]: 2,\n [ts.SyntaxKind.AsyncKeyword]: 1,\n [ts.SyntaxKind.ConstKeyword]: 1,\n};\nfunction modifiersToMap(modifiers) {\n modifiers = modifiers || [];\n return modifiers.reduce((result, modifier) => {\n result[modifier.kind] = true;\n return result;\n }, \n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n {});\n}\nexports.modifiersToMap = modifiersToMap;\nfunction modifiersMapToArray(modifiersMap) {\n return Object.entries(modifiersMap)\n .filter(([kind, include]) => include)\n .map(([kind]) => {\n // we don't care about decorators here as it is not possible to have them in declaration files\n return ts.factory.createModifier(Number(kind));\n })\n .sort((a, b) => {\n // note `|| 0` is here as a fallback in the case if the compiler adds a new modifier\n // but the tool isn't updated yet\n const aValue = modifiersPriority[a.kind] || 0;\n const bValue = modifiersPriority[b.kind] || 0;\n return bValue - aValue;\n });\n}\nexports.modifiersMapToArray = modifiersMapToArray;\nfunction recreateRootLevelNodeWithModifiers(node, modifiersMap, newName, keepComments = true) {\n const newNode = recreateRootLevelNodeWithModifiersImpl(node, modifiersMap, newName);\n if (keepComments) {\n ts.setCommentRange(newNode, ts.getCommentRange(node));\n }\n return newNode;\n}\nexports.recreateRootLevelNodeWithModifiers = recreateRootLevelNodeWithModifiers;\n// eslint-disable-next-line complexity\nfunction recreateRootLevelNodeWithModifiersImpl(node, modifiersMap, newName) {\n const modifiers = modifiersMapToArray(modifiersMap);\n if (ts.isArrowFunction(node)) {\n return ts.factory.createArrowFunction(modifiers, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body);\n }\n if (ts.isClassDeclaration(node)) {\n return ts.factory.createClassDeclaration(modifiers, newName || node.name, node.typeParameters, node.heritageClauses, node.members);\n }\n if (ts.isClassExpression(node)) {\n return ts.factory.createClassExpression(modifiers, newName || node.name, node.typeParameters, node.heritageClauses, node.members);\n }\n if (ts.isEnumDeclaration(node)) {\n return ts.factory.createEnumDeclaration(modifiers, newName || node.name, node.members);\n }\n if (ts.isExportAssignment(node)) {\n return ts.factory.createExportAssignment(modifiers, node.isExportEquals, node.expression);\n }\n if (ts.isExportDeclaration(node)) {\n return ts.factory.createExportDeclaration(modifiers, node.isTypeOnly, node.exportClause, node.moduleSpecifier, \n // eslint-disable-next-line deprecation/deprecation\n node.attributes || node.assertClause);\n }\n if (ts.isFunctionDeclaration(node)) {\n return ts.factory.createFunctionDeclaration(modifiers, node.asteriskToken, newName || node.name, node.typeParameters, node.parameters, node.type, node.body);\n }\n if (ts.isFunctionExpression(node)) {\n return ts.factory.createFunctionExpression(modifiers, node.asteriskToken, newName || node.name, node.typeParameters, node.parameters, node.type, node.body);\n }\n if (ts.isImportDeclaration(node)) {\n return ts.factory.createImportDeclaration(modifiers, node.importClause, node.moduleSpecifier, \n // eslint-disable-next-line deprecation/deprecation\n node.attributes || node.assertClause);\n }\n if (ts.isImportEqualsDeclaration(node)) {\n return ts.factory.createImportEqualsDeclaration(modifiers, node.isTypeOnly, newName || node.name, node.moduleReference);\n }\n if (ts.isInterfaceDeclaration(node)) {\n return ts.factory.createInterfaceDeclaration(modifiers, newName || node.name, node.typeParameters, node.heritageClauses, node.members);\n }\n if (ts.isModuleDeclaration(node)) {\n return ts.factory.createModuleDeclaration(modifiers, node.name, node.body, node.flags);\n }\n if (ts.isTypeAliasDeclaration(node)) {\n return ts.factory.createTypeAliasDeclaration(modifiers, newName || node.name, node.typeParameters, node.type);\n }\n if (ts.isVariableStatement(node)) {\n return ts.factory.createVariableStatement(modifiers, node.declarationList);\n }\n throw new Error(`Unknown top-level node kind (with modifiers): ${ts.SyntaxKind[node.kind]}.\nIf you're seeing this error, please report a bug on https://github.com/timocov/dts-bundle-generator/issues`);\n}\nfunction getModifiers(node) {\n if (!ts.canHaveModifiers(node)) {\n return undefined;\n }\n return ts.getModifiers(node);\n}\nexports.getModifiers = getModifiers;\nfunction getRootSourceFile(program, rootFileName) {\n if (program.getRootFileNames().indexOf(rootFileName) === -1) {\n throw new Error(`There is no such root file ${rootFileName}`);\n }\n const sourceFile = program.getSourceFile(rootFileName);\n if (sourceFile === undefined) {\n throw new Error(`Cannot get source file for root file ${rootFileName}`);\n }\n return sourceFile;\n}\nexports.getRootSourceFile = getRootSourceFile;\nfunction getNodeOwnSymbol(node, typeChecker) {\n const nodeSymbol = typeChecker.getSymbolAtLocation(node);\n if (nodeSymbol === undefined) {\n throw new Error(`Cannot find symbol for node \"${node.getText()}\" in \"${node.parent.getText()}\" from \"${node.getSourceFile().fileName}\"`);\n }\n return nodeSymbol;\n}\nexports.getNodeOwnSymbol = getNodeOwnSymbol;\nfunction getNodeSymbol(node, typeChecker) {\n if (ts.isSourceFile(node)) {\n const fileSymbol = typeChecker.getSymbolAtLocation(node);\n // a source file might not have a symbol in case of no exports in that file\n if (fileSymbol === undefined) {\n return null;\n }\n return getActualSymbol(fileSymbol, typeChecker);\n }\n const nodeName = getNodeName(node);\n if (nodeName === undefined) {\n return null;\n }\n return getDeclarationNameSymbol(nodeName, typeChecker);\n}\nexports.getNodeSymbol = getNodeSymbol;\nfunction getClosestModuleLikeNode(node) {\n // we need to find a module block and return its module declaration\n // we don't need to handle empty modules/modules with jsdoc/etc\n while (!ts.isModuleBlock(node) && !ts.isSourceFile(node)) {\n node = node.parent;\n }\n return ts.isSourceFile(node) ? node : node.parent;\n}\nexports.getClosestModuleLikeNode = getClosestModuleLikeNode;\nfunction getClosestSourceFileLikeNode(node) {\n // we need to find a module block and return its module declaration\n // we don't need to handle empty modules/modules with jsdoc/etc\n while (!(ts.isModuleBlock(node) && ts.isStringLiteral(node.parent.name)) && !ts.isSourceFile(node)) {\n node = node.parent;\n }\n return ts.isSourceFile(node) ? node : node.parent;\n}\nexports.getClosestSourceFileLikeNode = getClosestSourceFileLikeNode;\nfunction resolveReferencedModule(node, typeChecker) {\n let moduleName;\n if (ts.isExportDeclaration(node) || ts.isImportDeclaration(node)) {\n moduleName = node.moduleSpecifier;\n }\n else if (ts.isModuleDeclaration(node)) {\n moduleName = node.name;\n }\n else if (ts.isImportEqualsDeclaration(node)) {\n if (ts.isExternalModuleReference(node.moduleReference)) {\n moduleName = node.moduleReference.expression;\n }\n }\n else if (ts.isLiteralTypeNode(node.argument) && ts.isStringLiteral(node.argument.literal)) {\n moduleName = node.argument.literal;\n }\n if (moduleName === undefined) {\n return null;\n }\n const moduleSymbol = typeChecker.getSymbolAtLocation(moduleName);\n if (moduleSymbol === undefined) {\n return null;\n }\n const symbol = getActualSymbol(moduleSymbol, typeChecker);\n if (symbol.valueDeclaration === undefined) {\n return null;\n }\n return ts.isSourceFile(symbol.valueDeclaration) || ts.isModuleDeclaration(symbol.valueDeclaration)\n ? symbol.valueDeclaration\n : null;\n}\nexports.resolveReferencedModule = resolveReferencedModule;\nfunction getImportModuleName(imp) {\n if (ts.isImportDeclaration(imp)) {\n return imp.importClause === undefined\n ? null\n : imp.moduleSpecifier.text;\n }\n if (ts.isExportDeclaration(imp)) {\n return imp.moduleSpecifier === undefined\n ? null\n : imp.moduleSpecifier.text;\n }\n if (ts.isExternalModuleReference(imp.moduleReference)) {\n if (!ts.isStringLiteral(imp.moduleReference.expression)) {\n (0, logger_1.warnLog)(`Cannot handle non string-literal-like import expression: ${imp.moduleReference.expression.getText()}`);\n return null;\n }\n return imp.moduleReference.expression.text;\n }\n return null;\n}\nexports.getImportModuleName = getImportModuleName;\n/**\n * Returns a symbol that an {@link importExportSpecifier} node references to.\n *\n * For example, for given `export { Value }` it returns a declaration of `Value` whatever it is (import statement, interface declaration, etc).\n */\nfunction getImportExportReferencedSymbol(importExportSpecifier, typeChecker) {\n return importExportSpecifier.propertyName !== undefined\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n ? typeChecker.getSymbolAtLocation(importExportSpecifier.propertyName)\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n : typeChecker.getImmediateAliasedSymbol(typeChecker.getSymbolAtLocation(importExportSpecifier.name));\n}\nexports.getImportExportReferencedSymbol = getImportExportReferencedSymbol;\nfunction getSymbolExportStarDeclarations(symbol) {\n if (symbol.escapedName !== ts.InternalSymbolName.ExportStar) {\n throw new Error(`Only ExportStar symbol can have export star declaration, but got ${symbol.escapedName}`);\n }\n // this means that an export contains `export * from 'module'` statement\n return getDeclarationsForSymbol(symbol).filter((decl) => ts.isExportDeclaration(decl) && decl.moduleSpecifier !== undefined);\n}\nexports.getSymbolExportStarDeclarations = getSymbolExportStarDeclarations;\nfunction getDeclarationsForExportedValues(exp, typeChecker) {\n const nodeForSymbol = ts.isExportAssignment(exp) ? exp.expression : exp.moduleSpecifier;\n if (nodeForSymbol === undefined) {\n return [];\n }\n const symbolForExpression = typeChecker.getSymbolAtLocation(nodeForSymbol);\n if (symbolForExpression === undefined) {\n return [];\n }\n const symbol = getActualSymbol(symbolForExpression, typeChecker);\n return getDeclarationsForSymbol(symbol);\n}\nexports.getDeclarationsForExportedValues = getDeclarationsForExportedValues;\nfunction resolveGlobalName(typeChecker, name) {\n // this value isn't available in all typescript versions so lets assign its value here instead\n const tsSymbolFlagsAll = /* ts.SymbolFlags.All */ -1;\n // see https://github.com/microsoft/TypeScript/pull/56932\n return typeChecker.resolveName(name, undefined, tsSymbolFlagsAll, false);\n}\nexports.resolveGlobalName = resolveGlobalName;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TypesUsageEvaluator = void 0;\nconst ts = require(\"typescript\");\nconst typescript_1 = require(\"./helpers/typescript\");\nclass TypesUsageEvaluator {\n constructor(files, typeChecker) {\n this.nodesParentsMap = new Map();\n this.usageResultCache = new Map();\n this.typeChecker = typeChecker;\n this.computeUsages(files);\n }\n isSymbolUsedBySymbol(symbol, by) {\n return this.isSymbolUsedBySymbolImpl(this.getActualSymbol(symbol), this.getActualSymbol(by), new Set());\n }\n getSymbolsUsingSymbol(symbol) {\n return this.nodesParentsMap.get(this.getActualSymbol(symbol)) || null;\n }\n isSymbolUsedBySymbolImpl(fromSymbol, toSymbol, visitedSymbols) {\n if (fromSymbol === toSymbol) {\n return this.setUsageCacheValue(fromSymbol, toSymbol, true);\n }\n const cacheResult = this.usageResultCache.get(fromSymbol)?.get(toSymbol);\n if (cacheResult !== undefined) {\n return cacheResult;\n }\n const reachableNodes = this.nodesParentsMap.get(fromSymbol);\n if (reachableNodes !== undefined) {\n for (const symbol of reachableNodes) {\n if (visitedSymbols.has(symbol)) {\n continue;\n }\n visitedSymbols.add(symbol);\n if (this.isSymbolUsedBySymbolImpl(symbol, toSymbol, visitedSymbols)) {\n return this.setUsageCacheValue(fromSymbol, toSymbol, true);\n }\n }\n }\n visitedSymbols.add(fromSymbol);\n // note that we can't save negative result here because it might be not a final one\n // because we might ended up here because of `visitedSymbols.has(symbol)` check above\n // while actually checking that `symbol` symbol and we will store all its \"children\" as `false`\n // while in reality some of them might be `true` because of cross-references or using the same children symbols\n return false;\n }\n setUsageCacheValue(fromSymbol, toSymbol, value) {\n let fromSymbolCacheMap = this.usageResultCache.get(fromSymbol);\n if (fromSymbolCacheMap === undefined) {\n fromSymbolCacheMap = new Map();\n this.usageResultCache.set(fromSymbol, fromSymbolCacheMap);\n }\n fromSymbolCacheMap.set(toSymbol, value);\n return value;\n }\n computeUsages(files) {\n this.nodesParentsMap.clear();\n for (const file of files) {\n ts.forEachChild(file, this.computeUsageForNode.bind(this));\n }\n }\n // eslint-disable-next-line complexity\n computeUsageForNode(node) {\n if ((0, typescript_1.isDeclareModule)(node) && node.body !== undefined && ts.isModuleBlock(node.body)) {\n const moduleSymbol = this.getSymbol(node.name);\n for (const statement of node.body.statements) {\n this.computeUsageForNode(statement);\n if ((0, typescript_1.isNodeNamedDeclaration)(statement)) {\n const nodeName = (0, typescript_1.getNodeName)(statement);\n if (nodeName !== undefined) {\n // a node declared in `declare module` should adds \"usage\" to that module\n // so we can track its usage later if needed\n const statementSymbol = this.getSymbol(nodeName);\n this.addUsages(statementSymbol, moduleSymbol);\n }\n }\n }\n }\n if ((0, typescript_1.isNodeNamedDeclaration)(node)) {\n const nodeName = (0, typescript_1.getNodeName)(node);\n if (nodeName !== undefined) {\n if (ts.isObjectBindingPattern(nodeName) || ts.isArrayBindingPattern(nodeName)) {\n for (const element of nodeName.elements) {\n this.computeUsageForNode(element);\n }\n }\n else {\n const childSymbol = this.getSymbol(nodeName);\n if (childSymbol !== null) {\n this.computeUsagesRecursively(node, childSymbol);\n }\n }\n }\n }\n if (ts.isVariableStatement(node)) {\n for (const varDeclaration of node.declarationList.declarations) {\n this.computeUsageForNode(varDeclaration);\n }\n }\n // `export * as ns from 'mod'`\n if (ts.isExportDeclaration(node) && node.moduleSpecifier !== undefined && node.exportClause !== undefined && ts.isNamespaceExport(node.exportClause)) {\n this.addUsagesForNamespacedModule(node.exportClause, node.moduleSpecifier);\n }\n // `import * as ns from 'mod'`\n if (ts.isImportDeclaration(node) && node.moduleSpecifier !== undefined && node.importClause?.namedBindings !== undefined && ts.isNamespaceImport(node.importClause.namedBindings)) {\n // for namespaced imports we don't want to include module's exports into usage\n // because only exports actually \"assign\" all exports to a namespace node\n // namespaced imports affect only local scope (unless it is exported, but it handled elsewhere)\n this.addUsagesForNamespacedModule(node.importClause.namedBindings, node.moduleSpecifier, false);\n }\n // `export {}` or `export {} from 'mod'`\n if (ts.isExportDeclaration(node) && node.exportClause !== undefined && ts.isNamedExports(node.exportClause)) {\n for (const exportElement of node.exportClause.elements) {\n const exportElementSymbol = (0, typescript_1.getImportExportReferencedSymbol)(exportElement, this.typeChecker);\n // i.e. `import * as NS from './local-module'`\n const namespaceImportForElement = (0, typescript_1.getDeclarationsForSymbol)(exportElementSymbol).find(ts.isNamespaceImport);\n if (namespaceImportForElement !== undefined) {\n // the namespaced import itself doesn't add a \"usage\", but re-export of that imported namespace does\n // so here we're handling the case where previously imported namespace import has been re-exported from a module\n this.addUsagesForNamespacedModule(namespaceImportForElement, namespaceImportForElement.parent.parent.moduleSpecifier);\n }\n // \"link\" referenced symbol with its import\n const exportElementOwnSymbol = this.getNodeOwnSymbol(exportElement.name);\n this.addUsages(exportElementSymbol, exportElementOwnSymbol);\n this.addUsages(this.getActualSymbol(exportElementSymbol), exportElementOwnSymbol);\n }\n }\n // `export =`\n if (ts.isExportAssignment(node) && node.isExportEquals) {\n this.addUsagesForExportAssignment(node);\n }\n }\n addUsagesForExportAssignment(exportAssignment) {\n for (const declaration of (0, typescript_1.getDeclarationsForExportedValues)(exportAssignment, this.typeChecker)) {\n // `declare module foobar {}` or `namespace foobar {}`\n if (ts.isModuleDeclaration(declaration) && ts.isIdentifier(declaration.name) && declaration.body !== undefined && ts.isModuleBlock(declaration.body)) {\n const moduleSymbol = this.getSymbol(declaration.name);\n for (const statement of declaration.body.statements) {\n if ((0, typescript_1.isNodeNamedDeclaration)(statement) && statement.name !== undefined) {\n const statementSymbol = this.getSymbol(statement.name);\n if (statementSymbol !== null) {\n // this feels counter-intuitive that we assign a statement as a parent of a module\n // but this is what happens when you have `export=` statements\n // you can import an interface declared in `export=` exported namespace\n // via named import statement\n // e.g. lets say you have `namespace foo { export interface Interface {} }; export = foo;`\n // then you can import it like `import { Interface } from 'module'`\n // in this case only `Interface` is used, but it is part of module `foo`\n // which means that `foo` is used via using `Interface`\n // if you're reading this - please stop using `export=` exports asap!\n this.addUsages(moduleSymbol, statementSymbol);\n }\n }\n }\n }\n }\n }\n addUsagesForNamespacedModule(namespaceNode, moduleSpecifier, includeExports = true) {\n // note that we shouldn't resolve the actual symbol for the namespace\n // as in some circumstances it will be resolved to the source file\n // i.e. namespaceSymbol would become referencedModuleSymbol so it would be no-op\n // but we want to add this module's usage to the map\n const namespaceSymbol = this.getNodeOwnSymbol(namespaceNode.name);\n const referencedSourceFileSymbol = this.getSymbol(moduleSpecifier);\n this.addUsages(referencedSourceFileSymbol, namespaceSymbol);\n // but in case it is not resolved to the source file we need to link them\n const resolvedNamespaceSymbol = this.getSymbol(namespaceNode.name);\n this.addUsages(resolvedNamespaceSymbol, namespaceSymbol);\n if (includeExports) {\n // if a referenced source file has any exports, they should be added \"to the usage\" as they all are re-exported/imported\n this.addExportsToSymbol(referencedSourceFileSymbol.exports, referencedSourceFileSymbol);\n }\n }\n addExportsToSymbol(exports, parentSymbol, visitedSymbols = new Set()) {\n exports?.forEach((moduleExportedSymbol, name) => {\n if (name === ts.InternalSymbolName.ExportStar) {\n // this means that an export contains `export * from 'module'` statement\n for (const exportStarDeclaration of (0, typescript_1.getSymbolExportStarDeclarations)(moduleExportedSymbol)) {\n if (exportStarDeclaration.moduleSpecifier === undefined) {\n throw new Error(`Export star declaration does not have a module specifier '${exportStarDeclaration.getText()}'`);\n }\n const referencedSourceFileSymbol = this.getSymbol(exportStarDeclaration.moduleSpecifier);\n if (visitedSymbols.has(referencedSourceFileSymbol)) {\n continue;\n }\n visitedSymbols.add(referencedSourceFileSymbol);\n this.addExportsToSymbol(referencedSourceFileSymbol.exports, parentSymbol, visitedSymbols);\n }\n return;\n }\n this.addUsages(moduleExportedSymbol, parentSymbol);\n });\n }\n computeUsagesRecursively(parent, parentSymbol) {\n ts.forEachChild(parent, (child) => {\n if (child.kind === ts.SyntaxKind.JSDoc) {\n return;\n }\n this.computeUsagesRecursively(child, parentSymbol);\n if (ts.isIdentifier(child) || child.kind === ts.SyntaxKind.DefaultKeyword) {\n // identifiers in labelled tuples don't have symbols for their labels\n // so let's just skip them from collecting\n if (ts.isNamedTupleMember(child.parent) && child.parent.name === child) {\n return;\n }\n // `{ propertyName: name }` - in this case we don't need to handle `propertyName` as it has no symbol\n if (ts.isBindingElement(child.parent) && child.parent.propertyName === child) {\n return;\n }\n this.addUsages(this.getSymbol(child), parentSymbol);\n if (!ts.isQualifiedName(child.parent)) {\n const childOwnSymbol = this.getNodeOwnSymbol(child);\n // i.e. `import * as NS from './local-module'`\n const namespaceImport = (0, typescript_1.getDeclarationsForSymbol)(childOwnSymbol).find(ts.isNamespaceImport);\n if (namespaceImport !== undefined) {\n // if a node is an identifier and not part of a qualified name\n // and it was created as part of namespaced import\n // then we need to assign all exports of referenced module into that namespace\n // because they might not be added previously while processing imports/exports\n this.addUsagesForNamespacedModule(namespaceImport, namespaceImport.parent.parent.moduleSpecifier, true);\n }\n }\n }\n });\n }\n addUsages(childSymbol, parentSymbol) {\n const childSymbols = (0, typescript_1.splitTransientSymbol)(childSymbol, this.typeChecker);\n for (const childSplitSymbol of childSymbols) {\n let symbols = this.nodesParentsMap.get(childSplitSymbol);\n if (symbols === undefined) {\n symbols = new Set();\n this.nodesParentsMap.set(childSplitSymbol, symbols);\n }\n // to avoid infinite recursion\n if (childSplitSymbol !== parentSymbol) {\n symbols.add(parentSymbol);\n }\n }\n }\n getSymbol(node) {\n return this.getActualSymbol(this.getNodeOwnSymbol(node));\n }\n getNodeOwnSymbol(node) {\n return (0, typescript_1.getNodeOwnSymbol)(node, this.typeChecker);\n }\n getActualSymbol(symbol) {\n return (0, typescript_1.getActualSymbol)(symbol, this.typeChecker);\n }\n}\nexports.TypesUsageEvaluator = TypesUsageEvaluator;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getTypesLibraryName = exports.getLibraryName = void 0;\nconst nodeModulesFolderName = 'node_modules/';\nconst libraryNameRegex = /node_modules\\/((?:(?=@)[^/]+\\/[^/]+|[^/]+))\\//;\nfunction getLibraryName(fileName) {\n const lastNodeModulesIndex = fileName.lastIndexOf(nodeModulesFolderName);\n if (lastNodeModulesIndex === -1) {\n return null;\n }\n const match = libraryNameRegex.exec(fileName.slice(lastNodeModulesIndex));\n if (match === null) {\n return null;\n }\n return match[1];\n}\nexports.getLibraryName = getLibraryName;\nfunction getTypesLibraryName(path) {\n const libraryName = getLibraryName(path);\n if (libraryName === null) {\n return null;\n }\n const typesFolderPrefix = '@types/';\n if (!libraryName.startsWith(typesFolderPrefix)) {\n return null;\n }\n return libraryName.substring(typesFolderPrefix.length);\n}\nexports.getTypesLibraryName = getTypesLibraryName;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getModuleLikeModuleInfo = exports.getReferencedModuleInfo = exports.getFileModuleInfo = void 0;\nconst path = require(\"path\");\nconst ts = require(\"typescript\");\nconst node_modules_1 = require(\"./helpers/node-modules\");\nconst fix_path_1 = require(\"./helpers/fix-path\");\nconst typescript_1 = require(\"./helpers/typescript\");\nfunction getFileModuleInfo(fileName, criteria) {\n return getModuleInfoImpl(fileName, fileName, criteria);\n}\nexports.getFileModuleInfo = getFileModuleInfo;\nfunction getReferencedModuleInfo(moduleDecl, criteria, typeChecker) {\n const referencedModule = (0, typescript_1.resolveReferencedModule)(moduleDecl, typeChecker);\n if (referencedModule === null) {\n return null;\n }\n const moduleFilePath = ts.isSourceFile(referencedModule)\n ? referencedModule.fileName\n : resolveModuleFileName(referencedModule.getSourceFile().fileName, referencedModule.name.text);\n return getFileModuleInfo(moduleFilePath, criteria);\n}\nexports.getReferencedModuleInfo = getReferencedModuleInfo;\nfunction getModuleLikeModuleInfo(moduleLike, criteria, typeChecker) {\n const resolvedModuleLike = ts.isSourceFile(moduleLike) ? moduleLike : (0, typescript_1.resolveReferencedModule)(moduleLike, typeChecker) ?? moduleLike;\n const fileName = ts.isSourceFile(resolvedModuleLike)\n ? resolvedModuleLike.fileName\n : resolveModuleFileName(resolvedModuleLike.getSourceFile().fileName, resolvedModuleLike.name.text);\n return getFileModuleInfo(fileName, criteria);\n}\nexports.getModuleLikeModuleInfo = getModuleLikeModuleInfo;\nfunction resolveModuleFileName(currentFileName, moduleName) {\n return moduleName.startsWith('.') ? (0, fix_path_1.fixPath)(path.join(currentFileName, '..', moduleName)) : `node_modules/${moduleName}/`;\n}\n/**\n * @param currentFilePath Current file path - can be used to override actual path of module (e.g. with `typeRoots`)\n * @param originalFileName Original file name of the module\n * @param criteria Criteria of module info\n */\nfunction getModuleInfoImpl(currentFilePath, originalFileName, criteria) {\n const npmLibraryName = (0, node_modules_1.getLibraryName)(currentFilePath);\n if (npmLibraryName === null) {\n if (criteria.typeRoots !== undefined) {\n for (const root of criteria.typeRoots) {\n const relativePath = (0, fix_path_1.fixPath)(path.relative(root, originalFileName));\n if (!relativePath.startsWith('../')) {\n // relativePath is path relative to type root\n // so we should treat it as \"library from node_modules/@types/\"\n return getModuleInfoImpl(remapToTypesFromNodeModules(relativePath), originalFileName, criteria);\n }\n }\n }\n return { type: 0 /* ModuleType.ShouldBeInlined */, fileName: originalFileName, isExternal: false };\n }\n const typesLibraryName = (0, node_modules_1.getTypesLibraryName)(currentFilePath);\n if (shouldLibraryBeInlined(npmLibraryName, typesLibraryName, criteria.inlinedLibraries)) {\n return { type: 0 /* ModuleType.ShouldBeInlined */, fileName: originalFileName, isExternal: true };\n }\n if (shouldLibraryBeImported(npmLibraryName, typesLibraryName, criteria.importedLibraries, criteria.allowedTypesLibraries)) {\n return { type: 1 /* ModuleType.ShouldBeImported */, fileName: originalFileName, isExternal: true };\n }\n if (typesLibraryName !== null && isLibraryAllowed(typesLibraryName, criteria.allowedTypesLibraries)) {\n return { type: 2 /* ModuleType.ShouldBeReferencedAsTypes */, fileName: originalFileName, typesLibraryName, isExternal: true };\n }\n return { type: 3 /* ModuleType.ShouldBeUsedForModulesOnly */, fileName: originalFileName, isExternal: true };\n}\nfunction shouldLibraryBeInlined(npmLibraryName, typesLibraryName, inlinedLibraries) {\n return isLibraryAllowed(npmLibraryName, inlinedLibraries) || typesLibraryName !== null && isLibraryAllowed(typesLibraryName, inlinedLibraries);\n}\nfunction shouldLibraryBeImported(npmLibraryName, typesLibraryName, importedLibraries, allowedTypesLibraries) {\n if (typesLibraryName === null) {\n return isLibraryAllowed(npmLibraryName, importedLibraries);\n }\n // to be imported a library from types shouldn't be allowed to be references as types\n // thus by default we treat all libraries as \"should be imported\"\n // but if it is a @types library then it should be imported only if it is not marked as \"should be referenced as types\" explicitly\n if (allowedTypesLibraries === undefined || !isLibraryAllowed(typesLibraryName, allowedTypesLibraries)) {\n return isLibraryAllowed(typesLibraryName, importedLibraries);\n }\n return false;\n}\nfunction isLibraryAllowed(libraryName, allowedArray) {\n return allowedArray === undefined || allowedArray.indexOf(libraryName) !== -1;\n}\nfunction remapToTypesFromNodeModules(pathRelativeToTypesRoot) {\n return `node_modules/@types/${pathRelativeToTypesRoot}`;\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.packageVersion = void 0;\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nfunction packageVersion() {\n let dirName = __dirname;\n while (dirName.length !== 0) {\n const packageJsonFilePath = path.join(dirName, 'package.json');\n if (fs.existsSync(packageJsonFilePath)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-var-requires\n return require(packageJsonFilePath).version;\n }\n dirName = path.join(dirName, '..');\n }\n throw new Error(`Cannot find up package.json in ${__dirname}`);\n}\nexports.packageVersion = packageVersion;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateOutput = void 0;\nconst ts = require(\"typescript\");\nconst package_version_1 = require(\"./helpers/package-version\");\nconst typescript_1 = require(\"./helpers/typescript\");\nfunction generateOutput(params, options = {}) {\n const resultOutputParts = [];\n if (!options.noBanner) {\n resultOutputParts.push(`// Generated by dts-bundle-generator v${(0, package_version_1.packageVersion)()}`);\n }\n if (params.typesReferences.size !== 0) {\n const header = generateReferenceTypesDirective(Array.from(params.typesReferences));\n resultOutputParts.push(header);\n }\n if (params.imports.size !== 0) {\n // we need to have sorted imports of libraries to have more \"stable\" output\n const sortedEntries = Array.from(params.imports.entries()).sort((firstEntry, secondEntry) => {\n return firstEntry[0].localeCompare(secondEntry[0]);\n });\n const importsArray = [];\n for (const [libraryName, libraryImports] of sortedEntries) {\n importsArray.push(...generateImports(libraryName, libraryImports));\n }\n if (importsArray.length !== 0) {\n resultOutputParts.push(importsArray.join('\\n'));\n }\n }\n const statements = params.statements.map((statement) => getStatementText(statement, Boolean(options.sortStatements), params));\n if (options.sortStatements) {\n statements.sort(compareStatementText);\n }\n if (statements.length !== 0) {\n resultOutputParts.push(statementsTextToString(statements));\n }\n if (params.wrappedNamespaces.size !== 0) {\n resultOutputParts.push(Array.from(params.wrappedNamespaces.entries())\n .map(([namespaceName, exportedNames]) => {\n return `declare namespace ${namespaceName} {\\n\\texport { ${Array.from(exportedNames.entries())\n .map(([exportedName, localName]) => renamedExportValue(exportedName, localName))\n .sort()\n .join(', ')} };\\n}`;\n })\n .join('\\n'));\n }\n if (params.renamedExports.size !== 0) {\n resultOutputParts.push(`export {\\n\\t${Array.from(params.renamedExports.entries())\n .map(([exportedName, localName]) => renamedExportValue(exportedName, localName))\n .sort()\n .join(',\\n\\t')},\\n};`);\n }\n if (options.umdModuleName !== undefined) {\n resultOutputParts.push(`export as namespace ${options.umdModuleName};`);\n }\n // this is used to prevent importing non-exported nodes\n // see https://stackoverflow.com/questions/52583603/intentional-that-export-shuts-off-automatic-export-of-all-symbols-from-a-ty\n resultOutputParts.push(`export {};\\n`);\n return resultOutputParts.join('\\n\\n');\n}\nexports.generateOutput = generateOutput;\nfunction statementsTextToString(statements) {\n const statementsText = statements.map(statement => statement.text).join('\\n');\n return spacesToTabs(prettifyStatementsText(statementsText));\n}\nfunction renamedExportValue(exportedName, localName) {\n return exportedName !== localName ? `${localName} as ${exportedName}` : exportedName;\n}\nfunction renamedImportValue(importedName, localName) {\n return importedName !== localName ? `${importedName} as ${localName}` : importedName;\n}\nfunction prettifyStatementsText(statementsText) {\n const sourceFile = ts.createSourceFile('output.d.ts', statementsText, ts.ScriptTarget.Latest, false, ts.ScriptKind.TS);\n const printer = ts.createPrinter({\n newLine: ts.NewLineKind.LineFeed,\n removeComments: false,\n });\n return printer.printFile(sourceFile).trim();\n}\nfunction compareStatementText(a, b) {\n if (a.sortingValue > b.sortingValue) {\n return 1;\n }\n else if (a.sortingValue < b.sortingValue) {\n return -1;\n }\n return 0;\n}\nfunction recreateEntityName(node, helpers) {\n const resolvedName = helpers.resolveIdentifierName(node);\n if (resolvedName !== null && resolvedName !== node.getText()) {\n const identifiers = resolvedName.split('.');\n let result = ts.factory.createIdentifier(identifiers[0]);\n for (let index = 1; index < identifiers.length; index += 1) {\n result = ts.factory.createQualifiedName(result, ts.factory.createIdentifier(identifiers[index]));\n }\n return result;\n }\n return node;\n}\nfunction getStatementText(statement, includeSortingValue, helpers) {\n const { shouldHaveExportKeyword, shouldHaveJSDoc } = helpers.getStatementSettings(statement);\n // re-export statements do not contribute to top-level names scope so we don't need to resolve their identifiers\n const needResolveIdentifiers = !ts.isExportDeclaration(statement) || statement.moduleSpecifier === undefined;\n const printer = ts.createPrinter({\n newLine: ts.NewLineKind.LineFeed,\n removeComments: false,\n }, {\n // eslint-disable-next-line complexity\n substituteNode: (hint, node) => {\n if (node.parent === undefined) {\n return node;\n }\n if (needResolveIdentifiers) {\n if (ts.isPropertyAccessExpression(node)) {\n const resolvedName = helpers.resolveIdentifierName(node);\n if (resolvedName !== null && resolvedName !== node.getText()) {\n const identifiers = resolvedName.split('.');\n let result = ts.factory.createIdentifier(identifiers[0]);\n for (let index = 1; index < identifiers.length; index += 1) {\n result = ts.factory.createPropertyAccessExpression(result, ts.factory.createIdentifier(identifiers[index]));\n }\n return result;\n }\n return node;\n }\n if (ts.isIdentifier(node) || ts.isQualifiedName(node)) {\n // QualifiedName and PropertyAccessExpression are handled separately\n if (ts.isIdentifier(node) && (ts.isQualifiedName(node.parent) || ts.isPropertyAccessExpression(node.parent))) {\n return node;\n }\n if (ts.isIdentifier(node) && ts.isImportTypeNode(node.parent) && node.parent.qualifier === node) {\n // identifiers in dynamic imports should be ignored as they don't use local scope\n return node;\n }\n return recreateEntityName(node, helpers);\n }\n }\n // `import('module').Qualifier` or `typeof import('module').Qualifier`\n if (ts.isImportTypeNode(node) && node.qualifier !== undefined && helpers.needStripImportFromImportTypeNode(node)) {\n const newQualifier = recreateEntityName(node.qualifier, helpers);\n if (node.isTypeOf) {\n return ts.factory.createTypeQueryNode(newQualifier);\n }\n return ts.factory.createTypeReferenceNode(newQualifier, node.typeArguments);\n }\n if (node !== statement) {\n return node;\n }\n const modifiersMap = (0, typescript_1.modifiersToMap)((0, typescript_1.getModifiers)(node));\n if (ts.isEnumDeclaration(node)\n && modifiersMap[ts.SyntaxKind.ConstKeyword]\n && helpers.needStripConstFromConstEnum(node)) {\n modifiersMap[ts.SyntaxKind.ConstKeyword] = false;\n }\n const nodeName = (0, typescript_1.getNodeName)(node);\n const resolvedStatementName = nodeName !== undefined ? helpers.resolveIdentifierName(nodeName) || undefined : undefined;\n // strip the `default` keyword from node regardless\n if (modifiersMap[ts.SyntaxKind.DefaultKeyword]) {\n modifiersMap[ts.SyntaxKind.DefaultKeyword] = false;\n if (ts.isClassDeclaration(node)) {\n // for classes we need to replace `default` with `declare` instead otherwise it will produce an invalid syntax\n modifiersMap[ts.SyntaxKind.DeclareKeyword] = true;\n }\n }\n if (!shouldHaveExportKeyword) {\n modifiersMap[ts.SyntaxKind.ExportKeyword] = false;\n }\n else {\n modifiersMap[ts.SyntaxKind.ExportKeyword] = true;\n }\n // for some reason TypeScript allows to not write `declare` keyword for ClassDeclaration, FunctionDeclaration and VariableDeclaration\n // if it already has `export` keyword - so we need to add it\n // to avoid TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.\n if (!modifiersMap[ts.SyntaxKind.ExportKeyword] &&\n (ts.isClassDeclaration(node)\n || ts.isFunctionDeclaration(node)\n || ts.isVariableStatement(node)\n || ts.isEnumDeclaration(node)\n || ts.isModuleDeclaration(node))) {\n modifiersMap[ts.SyntaxKind.DeclareKeyword] = true;\n }\n return (0, typescript_1.recreateRootLevelNodeWithModifiers)(node, modifiersMap, resolvedStatementName, shouldHaveJSDoc);\n },\n });\n const statementText = printer.printNode(ts.EmitHint.Unspecified, statement, statement.getSourceFile()).trim();\n let sortingValue = '';\n if (includeSortingValue) {\n // it looks like there is no way to get node's text without a comment at the same time as printing it\n // so to get the actual node text we have to parse it again\n // hopefully it shouldn't take too long (we don't need to do type check, just parse the AST)\n // also let's do it opt-in so if someone isn't using node sorting it won't affect them\n const tempSourceFile = ts.createSourceFile('temp.d.ts', statementText, ts.ScriptTarget.ESNext);\n // we certainly know that there should be 1 statement at the root level (the printed statement)\n sortingValue = tempSourceFile.getChildren()[0].getText();\n }\n return { text: statementText, sortingValue };\n}\nfunction generateImports(libraryName, imports) {\n const fromEnding = `from '${libraryName}';`;\n const result = [];\n // sort to make output more \"stable\"\n if (imports.nsImport !== null) {\n result.push(`import * as ${imports.nsImport} ${fromEnding}`);\n }\n Array.from(imports.requireImports).sort().forEach((importName) => result.push(`import ${importName} = require('${libraryName}');`));\n Array.from(imports.defaultImports).sort().forEach((importName) => result.push(`import ${importName} ${fromEnding}`));\n if (imports.namedImports.size !== 0) {\n result.push(`import { ${Array.from(imports.namedImports.entries())\n .map(([localName, importedName]) => renamedImportValue(importedName, localName))\n .sort()\n .join(', ')} } ${fromEnding}`);\n }\n if (imports.reExports.size !== 0) {\n result.push(`export { ${Array.from(imports.reExports.entries())\n .map(([localName, importedName]) => renamedImportValue(importedName, localName))\n .sort()\n .join(', ')} } ${fromEnding}`);\n }\n return result;\n}\nfunction generateReferenceTypesDirective(libraries) {\n return libraries.sort().map((library) => {\n return `/// <reference types=\"${library}\" />`;\n }).join('\\n');\n}\nfunction spacesToTabs(text) {\n // eslint-disable-next-line no-regex-spaces\n return text.replace(/^( )+/gm, (substring) => {\n return '\\t'.repeat(substring.length / 4);\n });\n}\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CollisionsResolver = void 0;\nconst ts = require(\"typescript\");\nconst typescript_1 = require(\"./helpers/typescript\");\nconst logger_1 = require(\"./logger\");\nconst renamingSupportedSymbols = [\n ts.SymbolFlags.Alias,\n ts.SymbolFlags.Variable,\n ts.SymbolFlags.Class,\n ts.SymbolFlags.Enum,\n ts.SymbolFlags.Function,\n ts.SymbolFlags.Interface,\n ts.SymbolFlags.NamespaceModule,\n ts.SymbolFlags.TypeAlias,\n ts.SymbolFlags.ValueModule,\n];\n/**\n * A class that holds information about top-level scoped names and allows to get collision-free names in one occurred.\n */\nclass CollisionsResolver {\n constructor(typeChecker) {\n this.collisionsMap = new Map();\n this.generatedNames = new Map();\n this.typeChecker = typeChecker;\n }\n /**\n * Adds (or \"registers\") a top-level {@link identifier} (which takes a top-level scope name to use).\n */\n addTopLevelIdentifier(identifier) {\n const symbol = (0, typescript_1.getDeclarationNameSymbol)(identifier, this.typeChecker);\n if (symbol === null) {\n throw new Error(`Something went wrong - cannot find a symbol for top-level identifier ${identifier.getText()} (from ${identifier.parent.parent.getText()})`);\n }\n const newLocalName = this.registerSymbol(symbol, identifier.getText());\n if (newLocalName === null) {\n throw new Error(`Something went wrong - a symbol ${symbol.name} for top-level identifier ${identifier.getText()} cannot be renamed`);\n }\n return newLocalName;\n }\n /**\n * Returns a set of all already registered names for a given {@link symbol}.\n */\n namesForSymbol(symbol) {\n return this.generatedNames.get((0, typescript_1.getActualSymbol)(symbol, this.typeChecker)) || new Set();\n }\n /**\n * Resolves given {@link referencedIdentifier} to a name.\n * It assumes that a symbol for this identifier has been registered before by calling {@link addTopLevelIdentifier} method.\n * Otherwise it will return `null`.\n *\n * Note that a returned value might be of a different type of the identifier (e.g. {@link ts.QualifiedName} for a given {@link ts.Identifier})\n */\n resolveReferencedIdentifier(referencedIdentifier) {\n const identifierSymbol = (0, typescript_1.getDeclarationNameSymbol)(referencedIdentifier, this.typeChecker);\n if (identifierSymbol === null) {\n // that's fine if an identifier doesn't have a symbol\n // it could be in cases like for `prop` in `declare function func({ prop: prop3 }?: InterfaceName): TypeName;`\n return null;\n }\n const symbolScopePath = this.getSymbolScope(identifierSymbol);\n // this scope defines where the current identifier is located\n const currentIdentifierScope = this.getNodeScope(referencedIdentifier);\n if (symbolScopePath.length > 0 && currentIdentifierScope.length > 0 && symbolScopePath[0] === currentIdentifierScope[0]) {\n // if a referenced symbol is declared in the same scope where it is located\n // then just return its reference as is without any modification\n // also note that in this method we're working with identifiers only (i.e. it cannot be a qualified name)\n return referencedIdentifier.getText();\n }\n const topLevelIdentifierSymbol = symbolScopePath.length === 0 ? identifierSymbol : symbolScopePath[0];\n const namesForTopLevelSymbol = this.namesForSymbol(topLevelIdentifierSymbol);\n if (namesForTopLevelSymbol.size === 0) {\n return null;\n }\n let topLevelName = symbolScopePath.length === 0 ? referencedIdentifier.getText() : topLevelIdentifierSymbol.getName();\n if (!namesForTopLevelSymbol.has(topLevelName)) {\n // if the set of already registered names does not contain the one that is requested\n const topLevelNamesArray = Array.from(namesForTopLevelSymbol);\n // lets find more suitable name for a top level symbol\n let suitableTopLevelName = topLevelNamesArray[0];\n for (const name of topLevelNamesArray) {\n // attempt to find a generated name first to provide identifiers close to the original code as much as possible\n if (name.startsWith(`${topLevelName}$`)) {\n suitableTopLevelName = name;\n break;\n }\n }\n topLevelName = suitableTopLevelName;\n }\n const newIdentifierParts = [\n ...symbolScopePath.map((symbol) => symbol.getName()),\n referencedIdentifier.getText(),\n ];\n // we don't need to rename any symbol but top level only as only it can collide with other symbols\n newIdentifierParts[0] = topLevelName;\n return newIdentifierParts.join('.');\n }\n /**\n * Similar to {@link resolveReferencedIdentifier}, but works with qualified names (Ns.Ns1.Interface).\n * The main point of this resolver is that it might change the first part of the qualifier only (as it drives uniqueness of a name).\n */\n resolveReferencedQualifiedName(referencedIdentifier) {\n let topLevelIdentifier = referencedIdentifier;\n if (ts.isQualifiedName(topLevelIdentifier) || ts.isPropertyAccessExpression(topLevelIdentifier)) {\n let leftmostIdentifier = ts.isQualifiedName(topLevelIdentifier) ? topLevelIdentifier.left : topLevelIdentifier.expression;\n while (ts.isQualifiedName(leftmostIdentifier) || ts.isPropertyAccessExpression(leftmostIdentifier)) {\n leftmostIdentifier = ts.isQualifiedName(leftmostIdentifier) ? leftmostIdentifier.left : leftmostIdentifier.expression;\n }\n topLevelIdentifier = leftmostIdentifier;\n }\n const topLevelName = this.resolveReferencedIdentifier(topLevelIdentifier);\n if (topLevelName === null) {\n // that's fine if we don't have a name for this top-level symbol\n // it simply means that this symbol type might not be supported for renaming\n // at this point the top-level identifier isn't registered yet\n // but it is possible that the full qualified name is registered so we can use its replacement instead\n // it is possible in cases where you use `import * as nsName` for internal modules\n // so `nsName.Interface` will be resolved to `Interface` (or any other name that `Interface` was registered with)\n const identifierSymbol = (0, typescript_1.getDeclarationNameSymbol)(referencedIdentifier, this.typeChecker);\n if (identifierSymbol === null) {\n // that's fine if an identifier doesn't have a symbol\n // it could be in cases like for `prop` in `declare function func({ prop: prop3 }?: InterfaceName): TypeName;`\n return null;\n }\n const namesForSymbol = this.namesForSymbol(identifierSymbol);\n if (namesForSymbol.size !== 0) {\n // if the set of already registered names contains the one that is requested then lets use it\n return Array.from(namesForSymbol)[0];\n }\n // if it is not registered - just skip it\n return null;\n }\n // for nodes that we have to import we need to add an imported value to the collisions map\n // so it will not overlap with other imports/inlined nodes\n const identifierParts = referencedIdentifier.getText().split('.');\n // update top level part as it could get renamed above\n // note that `topLevelName` might be a qualified name (e.g. with `.` in the name)\n // but this is fine as we join with `.` below anyway\n // but it is worth it to mention here \u00AF\\_(\u30C4)_/\u00AF\n identifierParts[0] = topLevelName;\n return identifierParts.join('.');\n }\n getSymbolScope(identifierSymbol) {\n const identifierDeclarations = (0, typescript_1.getDeclarationsForSymbol)(identifierSymbol);\n // not all symbols have declarations, e.g. `globalThis` or `undefined` (not type but value e.g. in `typeof undefined`)\n // they are \"fake\" symbols that exist only at the compiler level (see checker.ts file in in the compiler or `globals.set()` calls)\n if (identifierDeclarations.length === 0) {\n return [];\n }\n // we assume that all symbols for a given identifier will be in the same scope (i.e. defined in the same namespaces-chain)\n // so we can use any declaration to find that scope as they all will have the same scope\n return this.getNodeScope(identifierDeclarations[0]);\n }\n /**\n * Returns a node's scope where it is located in terms of namespaces/modules.\n * E.g. A scope for `Opt` in `declare module foo { type Opt = number; }` is `[Symbol(foo)]`\n */\n getNodeScope(node) {\n const scopeIdentifiersPath = [];\n let currentNode = (0, typescript_1.getClosestModuleLikeNode)(node);\n while (ts.isModuleDeclaration(currentNode) && ts.isIdentifier(currentNode.name)) {\n const nameSymbol = (0, typescript_1.getDeclarationNameSymbol)(currentNode.name, this.typeChecker);\n if (nameSymbol === null) {\n throw new Error(`Cannot find symbol for identifier '${currentNode.name.getText()}'`);\n }\n scopeIdentifiersPath.push(nameSymbol);\n currentNode = (0, typescript_1.getClosestModuleLikeNode)(currentNode.parent);\n }\n return scopeIdentifiersPath.reverse();\n }\n registerSymbol(identifierSymbol, preferredName) {\n if (!renamingSupportedSymbols.some((flag) => identifierSymbol.flags & flag)) {\n // if a symbol for something else that we don't support yet - skip\n (0, logger_1.verboseLog)(`Symbol ${identifierSymbol.name} cannot be renamed because its flag (${identifierSymbol.flags}) isn't supported`);\n return null;\n }\n if (identifierSymbol.flags & ts.SymbolFlags.NamespaceModule && identifierSymbol.escapedName === ts.InternalSymbolName.Global) {\n // no need to rename `declare global` namespaces\n return null;\n }\n let symbolName = preferredName;\n if (symbolName === 'default') {\n // this is special case as an identifier cannot be named `default` because of es6 syntax\n // so lets fallback to some valid name\n symbolName = '_default';\n }\n const collisionsKey = symbolName;\n let collisionSymbols = this.collisionsMap.get(collisionsKey);\n if (collisionSymbols === undefined) {\n collisionSymbols = new Map();\n this.collisionsMap.set(collisionsKey, collisionSymbols);\n }\n const storedSymbolName = collisionSymbols.get(identifierSymbol);\n if (storedSymbolName !== undefined) {\n return storedSymbolName;\n }\n let nameIndex = collisionSymbols.size;\n let newName = collisionSymbols.size === 0 ? symbolName : `${symbolName}$${nameIndex}`;\n let resolvedGlobalSymbol = (0, typescript_1.resolveGlobalName)(this.typeChecker, newName);\n while (resolvedGlobalSymbol !== undefined && resolvedGlobalSymbol !== identifierSymbol) {\n nameIndex += 1;\n newName = `${symbolName}$${nameIndex}`;\n resolvedGlobalSymbol = (0, typescript_1.resolveGlobalName)(this.typeChecker, newName);\n }\n collisionSymbols.set(identifierSymbol, newName);\n let symbolNames = this.generatedNames.get(identifierSymbol);\n if (symbolNames === undefined) {\n symbolNames = new Set();\n this.generatedNames.set(identifierSymbol, symbolNames);\n }\n symbolNames.add(newName);\n return newName;\n }\n}\nexports.CollisionsResolver = CollisionsResolver;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.generateDtsBundle = void 0;\nconst ts = require(\"typescript\");\nconst compile_dts_1 = require(\"./compile-dts\");\nconst types_usage_evaluator_1 = require(\"./types-usage-evaluator\");\nconst typescript_1 = require(\"./helpers/typescript\");\nconst module_info_1 = require(\"./module-info\");\nconst generate_output_1 = require(\"./generate-output\");\nconst logger_1 = require(\"./logger\");\nconst collisions_resolver_1 = require(\"./collisions-resolver\");\nfunction generateDtsBundle(entries, options = {}) {\n (0, logger_1.normalLog)('Compiling input files...');\n const { program, rootFilesRemapping } = (0, compile_dts_1.compileDts)(entries.map((entry) => entry.filePath), options.preferredConfigPath, options.followSymlinks);\n const typeChecker = program.getTypeChecker();\n const typeRoots = ts.getEffectiveTypeRoots(program.getCompilerOptions(), {});\n const sourceFiles = program.getSourceFiles().filter((file) => {\n return !program.isSourceFileDefaultLibrary(file);\n });\n const typesUsageEvaluator = new types_usage_evaluator_1.TypesUsageEvaluator(sourceFiles, typeChecker);\n // eslint-disable-next-line complexity\n return entries.map((entryConfig) => {\n (0, logger_1.normalLog)(`Processing ${entryConfig.filePath}`);\n const newRootFilePath = rootFilesRemapping.get(entryConfig.filePath);\n if (newRootFilePath === undefined) {\n throw new Error(`Cannot remap root source file ${entryConfig.filePath}`);\n }\n const rootSourceFile = (0, typescript_1.getRootSourceFile)(program, newRootFilePath);\n const rootSourceFileSymbol = typeChecker.getSymbolAtLocation(rootSourceFile);\n if (rootSourceFileSymbol === undefined) {\n throw new Error(`Symbol for root source file ${newRootFilePath} not found`);\n }\n const librariesOptions = entryConfig.libraries || {};\n const criteria = {\n allowedTypesLibraries: librariesOptions.allowedTypesLibraries,\n importedLibraries: librariesOptions.importedLibraries,\n inlinedLibraries: librariesOptions.inlinedLibraries || [],\n typeRoots,\n };\n const rootFileExports = (0, typescript_1.getExportsForSourceFile)(typeChecker, rootSourceFileSymbol);\n const rootFileExportSymbols = rootFileExports.map((exp) => exp.symbol);\n const collectionResult = {\n typesReferences: new Set(),\n imports: new Map(),\n statements: [],\n renamedExports: new Map(),\n wrappedNamespaces: new Map(),\n };\n const outputOptions = entryConfig.output || {};\n const inlineDeclareGlobals = Boolean(outputOptions.inlineDeclareGlobals);\n const inlineDeclareExternals = Boolean(outputOptions.inlineDeclareExternals);\n const collisionsResolver = new collisions_resolver_1.CollisionsResolver(typeChecker);\n function updateResultForAnyModule(statements, currentModule) {\n // contains a set of modules that were visited already\n // can be used to prevent infinite recursion in updating results in re-exports\n const visitedModules = new Set();\n function updateResultForExternalExport(exportAssignment) {\n // if we have `export =` or `export * from` somewhere so we can decide that every declaration of exported symbol in this way\n // is \"part of the exported module\" and we need to update result according every member of each declaration\n // but treat they as current module (we do not need to update module info)\n for (const declaration of (0, typescript_1.getDeclarationsForExportedValues)(exportAssignment, typeChecker)) {\n if (ts.isVariableDeclaration(declaration)) {\n // variables will be processed separately anyway so no need to process them again here\n continue;\n }\n let exportedDeclarations = [];\n if (ts.isExportDeclaration(exportAssignment) && ts.isSourceFile(declaration)) {\n const referencedModule = (0, module_info_1.getReferencedModuleInfo)(exportAssignment, criteria, typeChecker);\n if (referencedModule !== null) {\n if (visitedModules.has(referencedModule.fileName)) {\n continue;\n }\n visitedModules.add(referencedModule.fileName);\n }\n exportedDeclarations = declaration.statements;\n }\n else if (ts.isModuleDeclaration(declaration)) {\n if (declaration.body !== undefined && ts.isModuleBlock(declaration.body)) {\n const referencedModule = (0, module_info_1.getReferencedModuleInfo)(declaration, criteria, typeChecker);\n if (referencedModule !== null) {\n if (visitedModules.has(referencedModule.fileName)) {\n continue;\n }\n visitedModules.add(referencedModule.fileName);\n }\n exportedDeclarations = declaration.body.statements;\n }\n }\n else {\n exportedDeclarations = [declaration];\n }\n updateResultImpl(exportedDeclarations);\n }\n }\n // eslint-disable-next-line complexity\n function updateResultImpl(statementsToProcess) {\n for (const statement of statementsToProcess) {\n // we should skip import statements\n if (statement.kind === ts.SyntaxKind.ImportDeclaration || statement.kind === ts.SyntaxKind.ImportEqualsDeclaration) {\n continue;\n }\n if ((0, typescript_1.isDeclareModule)(statement)) {\n updateResultForModuleDeclaration(statement, currentModule);\n // if a statement is `declare module \"module\" {}` then don't process it below\n // as it is handled already in `updateResultForModuleDeclaration`\n // but if it is `declare module Module {}` then it can be used in types and imports\n // so in this case it needs to be checked for \"usages\" below\n if (ts.isStringLiteral(statement.name)) {\n continue;\n }\n }\n if (currentModule.type === 3 /* ModuleType.ShouldBeUsedForModulesOnly */) {\n continue;\n }\n if ((0, typescript_1.isDeclareGlobalStatement)(statement) && inlineDeclareGlobals && currentModule.type === 0 /* ModuleType.ShouldBeInlined */) {\n collectionResult.statements.push(statement);\n continue;\n }\n if (ts.isExportDeclaration(statement)) {\n if (currentModule.type === 0 /* ModuleType.ShouldBeInlined */) {\n continue;\n }\n // `export * from`\n if (statement.exportClause === undefined) {\n updateResultForExternalExport(statement);\n continue;\n }\n // `export { val }`\n if (ts.isNamedExports(statement.exportClause) && currentModule.type === 1 /* ModuleType.ShouldBeImported */) {\n updateImportsForStatement(statement);\n continue;\n }\n }\n if (ts.isExportAssignment(statement) && statement.isExportEquals && currentModule.type !== 0 /* ModuleType.ShouldBeInlined */) {\n updateResultForExternalExport(statement);\n continue;\n }\n if (!isNodeUsed(statement)) {\n continue;\n }\n switch (currentModule.type) {\n case 2 /* ModuleType.ShouldBeReferencedAsTypes */:\n // while a node might be \"used\" somewhere via transitive nodes\n // we need to add types reference only if a node is treated as \"should be imported\"\n // because otherwise we might have lots of false-positive references\n forEachNodeThatShouldBeImported(statement, () => addTypesReference(currentModule.typesLibraryName));\n break;\n case 1 /* ModuleType.ShouldBeImported */:\n updateImportsForStatement(statement);\n break;\n case 0 /* ModuleType.ShouldBeInlined */:\n if (ts.isVariableStatement(statement)) {\n for (const variableDeclaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(variableDeclaration.name)) {\n collisionsResolver.addTopLevelIdentifier(variableDeclaration.name);\n continue;\n }\n for (const element of variableDeclaration.name.elements) {\n if (!ts.isOmittedExpression(element) && ts.isIdentifier(element.name)) {\n collisionsResolver.addTopLevelIdentifier(element.name);\n }\n }\n }\n }\n else if ((0, typescript_1.isNodeNamedDeclaration)(statement)) {\n const statementName = (0, typescript_1.getNodeName)(statement);\n if (statementName !== undefined) {\n collisionsResolver.addTopLevelIdentifier(statementName);\n }\n }\n collectionResult.statements.push(statement);\n break;\n }\n }\n }\n updateResultImpl(statements);\n }\n function isReferencedModuleImportable(statement) {\n return (0, module_info_1.getReferencedModuleInfo)(statement, criteria, typeChecker)?.type === 1 /* ModuleType.ShouldBeImported */;\n }\n function handleExportDeclarationFromRootModule(exportDeclaration) {\n function handleExportStarStatement(exportStarStatement, visitedSymbols = new Set()) {\n if (exportStarStatement.moduleSpecifier === undefined || exportStarStatement.exportClause !== undefined) {\n throw new Error(`Invalid export-star declaration statement provided, ${exportStarStatement.getText()}`);\n }\n const importModuleSpecifier = (0, typescript_1.getImportModuleName)(exportStarStatement);\n if (importModuleSpecifier === null) {\n return;\n }\n const referencedModuleInfo = (0, module_info_1.getReferencedModuleInfo)(exportStarStatement, criteria, typeChecker);\n if (referencedModuleInfo === null) {\n return;\n }\n switch (referencedModuleInfo.type) {\n case 0 /* ModuleType.ShouldBeInlined */: {\n // `export * from './inlined-module'`\n const referencedModuleSymbol = (0, typescript_1.getNodeOwnSymbol)(exportStarStatement.moduleSpecifier, typeChecker);\n const referencedSourceFileExportStarSymbol = referencedModuleSymbol.exports?.get(ts.InternalSymbolName.ExportStar);\n if (referencedSourceFileExportStarSymbol !== undefined) {\n if (visitedSymbols.has(referencedSourceFileExportStarSymbol)) {\n return;\n }\n visitedSymbols.add(referencedSourceFileExportStarSymbol);\n // we need to go recursive for all `export * from` statements and add all that are from imported modules\n for (const exportDecl of (0, typescript_1.getSymbolExportStarDeclarations)(referencedSourceFileExportStarSymbol)) {\n handleExportStarStatement(exportDecl, visitedSymbols);\n }\n }\n break;\n }\n case 1 /* ModuleType.ShouldBeImported */: {\n // `export * from 'importable-package'`\n collectionResult.statements.push(exportStarStatement);\n break;\n }\n }\n }\n /**\n * This function returns an export-star object that exports given {@link nodeSymbol} symbol.\n * If an exporting export declaration object is not from an importable module then `null` is returned.\n * Also if the symbol is exported explicitly (i.e. via `export { Name }` or specifying `export` keyword next to the node) then `null` is returned as well.\n */\n function findExportingExportStarExportFromImportableModule(referencedModuleSymbol, nodeSymbol) {\n function findResultRecursively(referencedModuleSym, exportedNodeSym, visitedSymbols) {\n // prevent infinite recursion\n if (visitedSymbols.has(referencedModuleSym)) {\n return null;\n }\n visitedSymbols.add(referencedModuleSym);\n // `export * from` exports always have less priority over explicit exports so it should go last\n const exportStarExport = referencedModuleSym.exports?.get(ts.InternalSymbolName.ExportStar);\n if (exportStarExport === undefined) {\n return null;\n }\n for (const exportStarDeclaration of (0, typescript_1.getDeclarationsForSymbol)(exportStarExport).filter(ts.isExportDeclaration)) {\n if (exportStarDeclaration.moduleSpecifier === undefined) {\n // this seems impossible, but to make the compiler/types happy\n continue;\n }\n const exportStarModuleSymbol = (0, typescript_1.getNodeOwnSymbol)(exportStarDeclaration.moduleSpecifier, typeChecker);\n if (exportStarModuleSymbol.exports === undefined) {\n continue;\n }\n if (isReferencedModuleImportable(exportStarDeclaration)) {\n // for \"importable\" modules we don't need to go deeper or even check \"explicit\" exports\n // as it doesn't matter how its done internally and we care about \"public\" interface only\n // so we can just check whether it exports a symbol or not (irregardless of how it is exported exactly internally)\n const referencedModuleExports = typeChecker.getExportsOfModule(exportStarModuleSymbol);\n const exportedNodeSymbol = referencedModuleExports.find((exp) => (0, typescript_1.getActualSymbol)(exp, typeChecker) === nodeSymbol);\n if (exportedNodeSymbol !== undefined) {\n return { exportStarDeclaration, exportedNodeSymbol };\n }\n continue;\n }\n const result = findResultRecursively(exportStarModuleSymbol, exportedNodeSym, visitedSymbols);\n if (result !== null) {\n return result;\n }\n }\n return null;\n }\n if (referencedModuleSymbol.exports === undefined) {\n throw new Error(`No exports found for \"${referencedModuleSymbol.getName()}\" symbol`);\n }\n const hasExplicitExportOfSymbol = Array.from(referencedModuleSymbol.exports.values()).some((exp) => {\n if (exp.escapedName === ts.InternalSymbolName.ExportStar) {\n return false;\n }\n return (0, typescript_1.getActualSymbol)(exp, typeChecker) === nodeSymbol;\n });\n if (hasExplicitExportOfSymbol) {\n // symbol is exported explicitly \u00AF\\_(\u30C4)_/\u00AF\n return null;\n }\n return findResultRecursively(referencedModuleSymbol, nodeSymbol, new Set());\n }\n // `export * from 'module'`\n if (exportDeclaration.exportClause === undefined) {\n handleExportStarStatement(exportDeclaration);\n return;\n }\n if (exportDeclaration.exportClause !== undefined && ts.isNamedExports(exportDeclaration.exportClause)) {\n // `export { val, val2 }`\n if (exportDeclaration.moduleSpecifier === undefined) {\n for (const exportElement of exportDeclaration.exportClause.elements) {\n const exportElementSymbol = (0, typescript_1.getImportExportReferencedSymbol)(exportElement, typeChecker);\n const namespaceImportFromImportableModule = (0, typescript_1.getDeclarationsForSymbol)(exportElementSymbol).find((importDecl) => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n return ts.isNamespaceImport(importDecl) && isReferencedModuleImportable(importDecl.parent.parent);\n });\n if (namespaceImportFromImportableModule !== undefined) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const importModuleSpecifier = (0, typescript_1.getImportModuleName)(namespaceImportFromImportableModule.parent.parent);\n if (importModuleSpecifier === null) {\n throw new Error(`Cannot get import module name from '${namespaceImportFromImportableModule.parent.parent.getText()}'`);\n }\n addNsImport(getImportItem(importModuleSpecifier), namespaceImportFromImportableModule.name);\n }\n }\n return;\n }\n // `export { val, val2 } from 'module'`\n if (exportDeclaration.moduleSpecifier !== undefined) {\n const referencedModuleSymbol = (0, typescript_1.getNodeOwnSymbol)(exportDeclaration.moduleSpecifier, typeChecker);\n // in this case we want to find all elements that we re-exported via `export * from` exports as they aren't handled elsewhere\n for (const exportElement of exportDeclaration.exportClause.elements) {\n const exportedNodeSymbol = (0, typescript_1.getActualSymbol)((0, typescript_1.getImportExportReferencedSymbol)(exportElement, typeChecker), typeChecker);\n const exportingExportStarResult = findExportingExportStarExportFromImportableModule(referencedModuleSymbol, exportedNodeSymbol);\n if (exportingExportStarResult === null) {\n continue;\n }\n const importModuleSpecifier = (0, typescript_1.getImportModuleName)(exportingExportStarResult.exportStarDeclaration);\n if (importModuleSpecifier === null) {\n throw new Error(`Cannot get import module name from '${exportingExportStarResult.exportStarDeclaration.getText()}'`);\n }\n // technically we could use named imports and then add re-exports\n // but this solution affects names scope (re-exports don't affect it)\n // and also it is slightly complicated to find a name declaration (identifier) that needs to be imported\n // so it feels better to go this way, but happy to change in the future if there would be any issues\n addReExport(getImportItem(importModuleSpecifier), exportingExportStarResult.exportedNodeSymbol.getName(), exportElement.name.text);\n }\n return;\n }\n }\n }\n function updateResultForRootModule(statements, currentModule) {\n updateResultForAnyModule(statements, currentModule);\n // add skipped by `updateResult` exports\n for (const statement of statements) {\n if (ts.isExportDeclaration(statement)) {\n handleExportDeclarationFromRootModule(statement);\n continue;\n }\n if (ts.isExportAssignment(statement)) {\n // `\"export =\"` or `export default 123` or `export default \"str\"`\n if (statement.isExportEquals || !ts.isIdentifier(statement.expression)) {\n collectionResult.statements.push(statement);\n }\n continue;\n }\n }\n }\n function updateResultForModuleDeclaration(moduleDecl, currentModule) {\n if (moduleDecl.body === undefined || !ts.isModuleBlock(moduleDecl.body)) {\n return;\n }\n const referencedModuleInfo = (0, module_info_1.getModuleLikeModuleInfo)(moduleDecl, criteria, typeChecker);\n if (referencedModuleInfo === null) {\n return;\n }\n // if we have declaration of external module inside internal one\n if (!currentModule.isExternal && referencedModuleInfo.isExternal) {\n // if it's allowed - we need to just add it to result without any processing\n if (inlineDeclareExternals) {\n collectionResult.statements.push(moduleDecl);\n }\n return;\n }\n updateResultForAnyModule(moduleDecl.body.statements, referencedModuleInfo);\n }\n function addTypesReference(library) {\n if (!collectionResult.typesReferences.has(library)) {\n (0, logger_1.normalLog)(`Library \"${library}\" will be added via reference directive`);\n collectionResult.typesReferences.add(library);\n }\n }\n function forEachNodeThatShouldBeImported(statement, callback) {\n const statementsToImport = ts.isVariableStatement(statement)\n ? statement.declarationList.declarations\n : ts.isExportDeclaration(statement) && statement.exportClause !== undefined\n ? ts.isNamespaceExport(statement.exportClause)\n ? [statement.exportClause]\n : statement.exportClause.elements\n : [statement];\n for (const statementToImport of statementsToImport) {\n if (shouldNodeBeImported(statementToImport)) {\n callback(statementToImport);\n }\n }\n }\n function updateImportsForStatement(statement) {\n forEachNodeThatShouldBeImported(statement, (statementToImport) => {\n addImport(statementToImport);\n // if we're going to add import of any statement in the bundle\n // we should check whether the library of that statement\n // could be referenced via triple-slash reference-types directive\n // because the project which will use bundled declaration file\n // can have `types: []` in the tsconfig and it'll fail\n // this is especially related to the types packages\n // which declares different modules in their declarations\n // e.g. @types/node has declaration for \"packages\" events, fs, path and so on\n const sourceFile = statementToImport.getSourceFile();\n const moduleInfo = (0, module_info_1.getFileModuleInfo)(sourceFile.fileName, criteria);\n if (moduleInfo.type === 2 /* ModuleType.ShouldBeReferencedAsTypes */) {\n addTypesReference(moduleInfo.typesLibraryName);\n }\n });\n }\n function getDeclarationUsagesSourceFiles(declaration) {\n return new Set(getExportedSymbolsUsingStatement(declaration)\n .map((symbol) => (0, typescript_1.getDeclarationsForSymbol)(symbol))\n .reduce((acc, val) => acc.concat(val), [])\n .map(typescript_1.getClosestModuleLikeNode));\n }\n function getImportItem(importModuleSpecifier) {\n let importItem = collectionResult.imports.get(importModuleSpecifier);\n if (importItem === undefined) {\n importItem = {\n defaultImports: new Set(),\n namedImports: new Map(),\n nsImport: null,\n requireImports: new Set(),\n reExports: new Map(),\n };\n collectionResult.imports.set(importModuleSpecifier, importItem);\n }\n return importItem;\n }\n function addRequireImport(importItem, preferredLocalName) {\n importItem.requireImports.add(collisionsResolver.addTopLevelIdentifier(preferredLocalName));\n }\n function addNamedImport(importItem, preferredLocalName, importedIdentifier) {\n const newLocalName = collisionsResolver.addTopLevelIdentifier(preferredLocalName);\n const importedName = importedIdentifier.text;\n importItem.namedImports.set(newLocalName, importedName);\n }\n function addReExport(importItem, moduleExportedName, reExportedName) {\n // re-exports don't affect local names scope so we don't need to register them in collisions resolver\n importItem.reExports.set(reExportedName, moduleExportedName);\n }\n function addNsImport(importItem, preferredLocalName) {\n if (importItem.nsImport === null) {\n importItem.nsImport = collisionsResolver.addTopLevelIdentifier(preferredLocalName);\n }\n }\n function addDefaultImport(importItem, preferredLocalName) {\n importItem.defaultImports.add(collisionsResolver.addTopLevelIdentifier(preferredLocalName));\n }\n function addImport(statement) {\n forEachImportOfStatement(statement, (imp, referencedModuleInfo, importModuleSpecifier) => {\n // if a referenced module should be inlined we can just ignore it\n if (referencedModuleInfo.type !== 1 /* ModuleType.ShouldBeImported */) {\n return;\n }\n const importItem = getImportItem(importModuleSpecifier);\n if (ts.isImportEqualsDeclaration(imp)) {\n // import x = require(\"mod\");\n addRequireImport(importItem, imp.name);\n return;\n }\n if (ts.isExportSpecifier(imp)) {\n // export { El1, El2 as ExportedName } from 'module';\n addNamedImport(importItem, imp.name, imp.propertyName || imp.name);\n return;\n }\n if (ts.isNamespaceExport(imp)) {\n // export * as name from 'module';\n addNsImport(importItem, imp.name);\n return;\n }\n if (ts.isImportClause(imp) && imp.name !== undefined) {\n // import name from 'module';\n addDefaultImport(importItem, imp.name);\n return;\n }\n if (ts.isImportSpecifier(imp)) {\n // import { El1, El2 as ImportedName } from 'module';\n addNamedImport(importItem, imp.name, imp.propertyName || imp.name);\n return;\n }\n if (ts.isNamespaceImport(imp)) {\n // import * as name from 'module';\n addNsImport(importItem, imp.name);\n return;\n }\n });\n }\n function forEachImportOfStatement(statement, callback) {\n if (!ts.isSourceFile(statement) && statement.name === undefined) {\n throw new Error(`Import/usage unnamed declaration: ${statement.getText()}`);\n }\n getDeclarationUsagesSourceFiles(statement).forEach((sourceFile) => {\n if ((0, module_info_1.getModuleLikeModuleInfo)(sourceFile, criteria, typeChecker).type !== 0 /* ModuleType.ShouldBeInlined */) {\n // we should ignore source files that aren't inlined\n return;\n }\n const sourceFileStatements = ts.isSourceFile(sourceFile)\n ? sourceFile.statements\n : sourceFile.body !== undefined && ts.isModuleBlock(sourceFile.body)\n ? sourceFile.body.statements\n : [];\n // eslint-disable-next-line complexity\n sourceFileStatements.forEach((st) => {\n if (!ts.isImportEqualsDeclaration(st) && !ts.isImportDeclaration(st) && !ts.isExportDeclaration(st)) {\n return;\n }\n const importModuleSpecifier = (0, typescript_1.getImportModuleName)(st);\n if (importModuleSpecifier === null) {\n return;\n }\n const referencedModuleInfo = (0, module_info_1.getReferencedModuleInfo)(st, criteria, typeChecker);\n // if a referenced module should be inlined we can just ignore it\n if (referencedModuleInfo === null) {\n return;\n }\n if (ts.isImportEqualsDeclaration(st)) {\n if (areDeclarationSame(statement, st)) {\n callback(st, referencedModuleInfo, importModuleSpecifier);\n }\n return;\n }\n if (ts.isExportDeclaration(st) && st.exportClause !== undefined) {\n if (ts.isNamedExports(st.exportClause)) {\n // export { El1, El2 as ExportedName } from 'module';\n st.exportClause.elements\n .filter(areDeclarationSame.bind(null, statement))\n .forEach((specifier) => {\n callback(specifier, referencedModuleInfo, importModuleSpecifier);\n });\n }\n else {\n // export * as name from 'module';\n if (isNodeUsed(st.exportClause)) {\n callback(st.exportClause, referencedModuleInfo, importModuleSpecifier);\n }\n }\n }\n else if (ts.isImportDeclaration(st) && st.importClause !== undefined) {\n if (st.importClause.name !== undefined && areDeclarationSame(statement, st.importClause)) {\n // import name from 'module';\n callback(st.importClause, referencedModuleInfo, importModuleSpecifier);\n }\n if (st.importClause.namedBindings !== undefined) {\n if (ts.isNamedImports(st.importClause.namedBindings)) {\n // import { El1, El2 as ImportedName } from 'module';\n st.importClause.namedBindings.elements\n .filter(areDeclarationSame.bind(null, statement))\n .forEach((specifier) => {\n callback(specifier, referencedModuleInfo, importModuleSpecifier);\n });\n }\n else {\n // import * as name from 'module';\n if (isNodeUsed(st.importClause)) {\n callback(st.importClause.namedBindings, referencedModuleInfo, importModuleSpecifier);\n }\n }\n }\n }\n });\n });\n }\n function getInlinedSymbolsUsingSymbol(symbol, predicate) {\n return Array.from(typesUsageEvaluator.getSymbolsUsingSymbol(symbol) ?? []).filter((usedInSymbol) => {\n if (!predicate(usedInSymbol)) {\n return false;\n }\n return (0, typescript_1.getDeclarationsForSymbol)(usedInSymbol).some((decl) => {\n const closestModuleLike = (0, typescript_1.getClosestSourceFileLikeNode)(decl);\n const moduleInfo = (0, module_info_1.getModuleLikeModuleInfo)(closestModuleLike, criteria, typeChecker);\n return moduleInfo.type === 0 /* ModuleType.ShouldBeInlined */;\n });\n });\n }\n function isSymbolUsedByInlinedSymbols(symbol, predicate, visitedSymbols = new Set()) {\n if (visitedSymbols.has(symbol)) {\n return false;\n }\n visitedSymbols.add(symbol);\n return Array.from(typesUsageEvaluator.getSymbolsUsingSymbol(symbol) ?? []).some((usedInSymbol) => {\n if (!predicate(usedInSymbol)) {\n return isSymbolUsedByInlinedSymbols(usedInSymbol, predicate, visitedSymbols);\n }\n const usedByThisSymbol = (0, typescript_1.getDeclarationsForSymbol)(usedInSymbol).some((decl) => {\n const closestModuleLike = (0, typescript_1.getClosestSourceFileLikeNode)(decl);\n const moduleInfo = (0, module_info_1.getModuleLikeModuleInfo)(closestModuleLike, criteria, typeChecker);\n return moduleInfo.type === 0 /* ModuleType.ShouldBeInlined */;\n });\n if (usedByThisSymbol) {\n return true;\n }\n return isSymbolUsedByInlinedSymbols(usedInSymbol, predicate, visitedSymbols);\n });\n }\n function isSymbolUsedByRootFileExports(symbol) {\n return rootFileExportSymbols.some((rootSymbol) => typesUsageEvaluator.isSymbolUsedBySymbol(symbol, rootSymbol));\n }\n function isSymbolForGlobalDeclaration(symbol) {\n return symbol.escapedName === ts.InternalSymbolName.Global;\n }\n function isSymbolForDeclareModuleDeclaration(symbol) {\n return (0, typescript_1.getDeclarationsForSymbol)(symbol).some(typescript_1.isDeclareModule);\n }\n // eslint-disable-next-line complexity\n function isNodeUsed(node) {\n if ((0, typescript_1.isNodeNamedDeclaration)(node) || ts.isSourceFile(node)) {\n const nodeSymbol = (0, typescript_1.getNodeSymbol)(node, typeChecker);\n if (nodeSymbol === null) {\n return false;\n }\n // note we don't need a function similar to `isSymbolUsedByGlobalSymbols` or `isSymbolUsedByGlobalSymbols`\n // because `TypesUsageEvaluator.isSymbolUsedBySymbol` already handles recursive checks\n const nodeUsedByDirectExports = isSymbolUsedByRootFileExports(nodeSymbol);\n if (nodeUsedByDirectExports) {\n return true;\n }\n if (inlineDeclareGlobals && isSymbolUsedByInlinedSymbols(nodeSymbol, isSymbolForGlobalDeclaration)) {\n return true;\n }\n if (inlineDeclareExternals && isSymbolUsedByInlinedSymbols(nodeSymbol, isSymbolForDeclareModuleDeclaration)) {\n return true;\n }\n return false;\n }\n if (ts.isVariableStatement(node)) {\n return node.declarationList.declarations.some((declaration) => {\n if (ts.isObjectBindingPattern(declaration.name) || ts.isArrayBindingPattern(declaration.name)) {\n return declaration.name.elements.some(isNodeUsed);\n }\n return isNodeUsed(declaration);\n });\n }\n if (ts.isExportDeclaration(node) && node.exportClause !== undefined && ts.isNamespaceExport(node.exportClause)) {\n return isNodeUsed(node.exportClause);\n }\n if (ts.isImportClause(node) && node.namedBindings !== undefined) {\n return isNodeUsed(node.namedBindings);\n }\n return false;\n }\n function shouldNodeBeImported(node) {\n const nodeSymbol = (0, typescript_1.getNodeSymbol)(node, typeChecker);\n if (nodeSymbol === null) {\n return false;\n }\n return shouldSymbolBeImported(nodeSymbol);\n }\n function shouldSymbolBeImported(nodeSymbol) {\n const isSymbolDeclaredInDefaultLibrary = (0, typescript_1.getDeclarationsForSymbol)(nodeSymbol).some((declaration) => program.isSourceFileDefaultLibrary(declaration.getSourceFile()));\n if (isSymbolDeclaredInDefaultLibrary) {\n // we shouldn't import a node declared in the default library (such dom, es2015)\n // yeah, actually we should check that node is declared only in the default lib\n // but it seems we can check that at least one declaration is from default lib\n // to treat the node as un-importable\n // because we can't re-export declared somewhere else node with declaration merging\n // also, if some lib file will not be added to the project\n // for example like it is described in the react declaration file (e.g. React Native)\n // then here we still have a bug with \"importing global declaration from a package\"\n // (see https://github.com/timocov/dts-bundle-generator/issues/71)\n // but I don't think it is a big problem for now\n // and it's possible that it will be fixed in https://github.com/timocov/dts-bundle-generator/issues/59\n return false;\n }\n const symbolsDeclarations = (0, typescript_1.getDeclarationsForSymbol)(nodeSymbol);\n // if all declarations of the symbol are in modules that should be inlined then this symbol must be inlined, not imported\n const shouldSymbolBeInlined = symbolsDeclarations.every((decl) => (0, module_info_1.getModuleLikeModuleInfo)((0, typescript_1.getClosestSourceFileLikeNode)(decl), criteria, typeChecker).type === 0 /* ModuleType.ShouldBeInlined */);\n if (shouldSymbolBeInlined) {\n return false;\n }\n return getExportedSymbolsUsingSymbol(nodeSymbol).length !== 0;\n }\n function getExportedSymbolsUsingStatement(node) {\n const nodeSymbol = (0, typescript_1.getNodeSymbol)(node, typeChecker);\n if (nodeSymbol === null) {\n return [];\n }\n return getExportedSymbolsUsingSymbol(nodeSymbol);\n }\n function getExportedSymbolsUsingSymbol(nodeSymbol) {\n const symbolsUsingNode = typesUsageEvaluator.getSymbolsUsingSymbol(nodeSymbol);\n if (symbolsUsingNode === null) {\n throw new Error(`Something went wrong - getSymbolsUsingSymbol returned null but expected to be a set of symbols (symbol=${nodeSymbol.name})`);\n }\n return [\n ...(rootFileExportSymbols.includes(nodeSymbol) ? [nodeSymbol] : []),\n // symbols which are used in types directly\n ...getInlinedSymbolsUsingSymbol(nodeSymbol, isSymbolUsedByRootFileExports),\n // symbols which are used in global types i.e. in `declare global`s\n ...(inlineDeclareGlobals ? getInlinedSymbolsUsingSymbol(nodeSymbol, isSymbolForGlobalDeclaration) : []),\n // symbols which are used in \"declare module\" types\n ...(inlineDeclareExternals ? getInlinedSymbolsUsingSymbol(nodeSymbol, isSymbolForDeclareModuleDeclaration) : []),\n ];\n }\n function areDeclarationSame(left, right) {\n const leftSymbols = (0, typescript_1.splitTransientSymbol)((0, typescript_1.getNodeSymbol)(left, typeChecker), typeChecker);\n const rightSymbols = (0, typescript_1.splitTransientSymbol)((0, typescript_1.getNodeSymbol)(right, typeChecker), typeChecker);\n for (const leftSymbol of leftSymbols) {\n if (rightSymbols.has(leftSymbol)) {\n return true;\n }\n }\n return false;\n }\n function createNamespaceForExports(exports, namespaceSymbol) {\n function addSymbolToNamespaceExports(namespaceExports, symbol) {\n // if a symbol isn't used by the namespace symbol it might mean that it shouldn't be included into the bundle because of tree-shaking\n // in this case we shouldn't even try to add such symbol to the namespace\n if (!typesUsageEvaluator.isSymbolUsedBySymbol(symbol, namespaceSymbol)) {\n return;\n }\n const symbolKnownNames = collisionsResolver.namesForSymbol(symbol);\n if (symbolKnownNames.size === 0) {\n throw new Error(`Cannot get local names for symbol '${symbol.getName()}' while generating namespaced export`);\n }\n namespaceExports.set(symbol.getName(), Array.from(symbolKnownNames)[0]);\n }\n function handleNamespacedImportOrExport(namespacedImportOrExport, namespaceExports, symbol) {\n if (namespacedImportOrExport.moduleSpecifier === undefined) {\n return;\n }\n if (isReferencedModuleImportable(namespacedImportOrExport)) {\n // in case of an external export statement we should copy it as is\n // here we assume that a namespace import will be added in other places\n // so here we can just add re-export\n addSymbolToNamespaceExports(namespaceExports, symbol);\n return;\n }\n const referencedSourceFileSymbol = (0, typescript_1.getNodeOwnSymbol)(namespacedImportOrExport.moduleSpecifier, typeChecker);\n if (referencedSourceFileSymbol.exports === undefined) {\n return;\n }\n if (ts.isImportDeclaration(namespacedImportOrExport) && referencedSourceFileSymbol.exports.has(ts.InternalSymbolName.ExportEquals)) {\n // in case of handling `import * as Ns` statements with `export =` export in a module we need to ignore it\n // as that import will be renamed later\n return;\n }\n const localNamespaceName = createNamespaceForExports(referencedSourceFileSymbol.exports, symbol);\n if (localNamespaceName !== null) {\n namespaceExports.set(symbol.getName(), localNamespaceName);\n }\n }\n function processExportSymbol(namespaceExports, symbol) {\n if (symbol.escapedName === ts.InternalSymbolName.ExportStar) {\n // this means that an export contains `export * from 'module'` statement\n for (const exportStarDeclaration of (0, typescript_1.getSymbolExportStarDeclarations)(symbol)) {\n if (exportStarDeclaration.moduleSpecifier === undefined) {\n throw new Error(`Export star declaration does not have a module specifier '${exportStarDeclaration.getText()}'`);\n }\n if (isReferencedModuleImportable(exportStarDeclaration)) {\n // in case of re-exporting from other modules directly we should import everything and re-export manually\n // but it is not supported yet so lets just fail for now\n throw new Error(`Having a re-export from an importable module as a part of namespaced export is not supported yet.`);\n }\n const referencedSourceFileSymbol = (0, typescript_1.getNodeOwnSymbol)(exportStarDeclaration.moduleSpecifier, typeChecker);\n referencedSourceFileSymbol.exports?.forEach(processExportSymbol.bind(null, namespaceExports));\n }\n return;\n }\n symbol.declarations?.forEach((decl) => {\n if (ts.isNamespaceExport(decl) && decl.parent.moduleSpecifier !== undefined) {\n handleNamespacedImportOrExport(decl.parent, namespaceExports, symbol);\n return;\n }\n if (ts.isExportSpecifier(decl)) {\n const exportElementSymbol = (0, typescript_1.getImportExportReferencedSymbol)(decl, typeChecker);\n const namespaceImport = (0, typescript_1.getDeclarationsForSymbol)(exportElementSymbol).find(ts.isNamespaceImport);\n if (namespaceImport !== undefined) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n handleNamespacedImportOrExport(namespaceImport.parent.parent, namespaceExports, symbol);\n }\n return;\n }\n });\n addSymbolToNamespaceExports(namespaceExports, symbol);\n }\n // eslint-disable-next-line complexity\n function getIdentifierOfNamespaceImportFromInlinedModule(nsSymbol) {\n // handling namespaced re-exports/imports\n // e.g. `export * as NS from './local-module';` or `import * as NS from './local-module'; export { NS }`\n for (const decl of (0, typescript_1.getDeclarationsForSymbol)(nsSymbol)) {\n if (!ts.isNamespaceExport(decl) && !ts.isExportSpecifier(decl) && !ts.isNamespaceImport(decl)) {\n continue;\n }\n // if it is namespace export then it should be from a inlined module (e.g. `export * as NS from './local-module';`)\n if (ts.isNamespaceExport(decl) && !isReferencedModuleImportable(decl.parent)) {\n return decl.name;\n }\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n if (ts.isNamespaceImport(decl) && !isReferencedModuleImportable(decl.parent.parent)) {\n return decl.name;\n }\n if (ts.isExportSpecifier(decl)) {\n // if it is export specifier then it should exporting a local symbol i.e. without a module specifier (e.g. `export { NS };` or `export { NS as NewNsName };`)\n if (decl.parent.parent.moduleSpecifier !== undefined) {\n // this means that namespace symbol is created somewhere else in the import/export chain\n if (isReferencedModuleImportable(decl.parent.parent)) {\n continue;\n }\n // in case of a chain of imports/exports we need to keep searching recursively\n if (getIdentifierOfNamespaceImportFromInlinedModule((0, typescript_1.getImportExportReferencedSymbol)(decl, typeChecker))) {\n return decl.name;\n }\n }\n // but also that local symbol should be a namespace imported from inlined module\n // i.e. `import * as NS from './local-module'`\n const result = (0, typescript_1.getDeclarationsForSymbol)((0, typescript_1.getImportExportReferencedSymbol)(decl, typeChecker)).some((importDecl) => {\n if (ts.isNamespaceImport(importDecl)) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n return !isReferencedModuleImportable(importDecl.parent.parent);\n }\n if (ts.isImportSpecifier(importDecl)) {\n // this means that namespace symbol is created somewhere else in the import/export chain\n return getIdentifierOfNamespaceImportFromInlinedModule((0, typescript_1.getImportExportReferencedSymbol)(importDecl, typeChecker));\n }\n return false;\n });\n if (result) {\n return decl.name;\n }\n }\n }\n return null;\n }\n const namespaceNameIdentifier = getIdentifierOfNamespaceImportFromInlinedModule(namespaceSymbol);\n if (namespaceNameIdentifier === null) {\n return null;\n }\n const namespaceExports = new Map();\n exports.forEach(processExportSymbol.bind(null, namespaceExports));\n if (namespaceExports.size !== 0) {\n const namespaceLocalName = collisionsResolver.addTopLevelIdentifier(namespaceNameIdentifier);\n collectionResult.wrappedNamespaces.set(namespaceLocalName, namespaceExports);\n return namespaceLocalName;\n }\n return null;\n }\n function syncExports() {\n for (const exp of rootFileExports) {\n if (exp.type === 0 /* ExportType.CommonJS */) {\n // commonjs will be handled separately where we handle root source files\n // as the only way of adding it is to add an explicit export statement in the root source file\n continue;\n }\n // if resolved symbol is a \"synthetic\" symbol already (i.e. not namespace module)\n // then we should create a namespace for its exports\n // otherwise most likely it will be inlined as is anyway so we don't need to do anything\n const namespaceLocalName = exp.symbol.flags & ts.SymbolFlags.ValueModule && exp.symbol.exports !== undefined\n ? createNamespaceForExports(exp.symbol.exports, exp.originalSymbol)\n : null;\n if (namespaceLocalName !== null) {\n collectionResult.renamedExports.set(exp.exportedName, namespaceLocalName);\n }\n const symbolKnownNames = collisionsResolver.namesForSymbol(exp.symbol);\n if (symbolKnownNames.size === 0) {\n // that's fine if a symbol doesn't exists in collisions resolver because it operates on top-level symbols only\n // in some cases a symbol can be exported but not added to the top-level scope\n // for instance in case of re-export from a library `export { Foo } from 'bar'`\n // in this case we'll add this re-export differently\n continue;\n }\n if (symbolKnownNames.has(exp.exportedName)) {\n // an exported symbol is already known with its \"exported\" name so nothing to do at this point\n // but if it is re-exported from imported library then we assume it was previously imported so we should re-export it anyway\n if (shouldSymbolBeImported(exp.symbol)) {\n collectionResult.renamedExports.set(exp.exportedName, exp.exportedName);\n }\n continue;\n }\n // in case if this symbol isn't known yet we need to add it via renamed export\n // we assume that all known names are equal so we can use any (first)\n // usually all \"local\" names should have only one known name\n // but having multiple names is possible with imports - you can import the same node with different names\n // and we want to preserve the source input as much as we can that's why we re-use them\n collectionResult.renamedExports.set(exp.exportedName, Array.from(symbolKnownNames)[0]);\n }\n }\n for (const sourceFile of sourceFiles) {\n (0, logger_1.verboseLog)(`======= Processing ${sourceFile.fileName} =======`);\n const updateFn = sourceFile === rootSourceFile ? updateResultForRootModule : updateResultForAnyModule;\n const currentModule = (0, module_info_1.getFileModuleInfo)(sourceFile.fileName, criteria);\n updateFn(sourceFile.statements, currentModule);\n // handle `import * as module` usage if it's used as whole module\n if (isNodeUsed(sourceFile)) {\n switch (currentModule.type) {\n case 1 /* ModuleType.ShouldBeImported */: {\n updateImportsForStatement(sourceFile);\n break;\n }\n case 0 /* ModuleType.ShouldBeInlined */: {\n const sourceFileSymbol = (0, typescript_1.getNodeSymbol)(sourceFile, typeChecker);\n if (sourceFileSymbol === null || sourceFileSymbol.exports === undefined) {\n throw new Error(`Cannot find symbol or exports for source file ${sourceFile.fileName}`);\n }\n let namespaceIdentifier = null;\n forEachImportOfStatement(sourceFile, (imp) => {\n // here we want to handle creation of artificial namespace for a inlined module\n // so we don't care about other type of imports/exports - only these that create a \"namespace\"\n if (ts.isNamespaceExport(imp) || ts.isNamespaceImport(imp)) {\n namespaceIdentifier = imp.name;\n }\n });\n if (namespaceIdentifier === null) {\n break;\n }\n createNamespaceForExports(sourceFileSymbol.exports, (0, typescript_1.getNodeOwnSymbol)(namespaceIdentifier, typeChecker));\n break;\n }\n }\n }\n }\n if (entryConfig.failOnClass) {\n const classes = collectionResult.statements.filter(ts.isClassDeclaration);\n if (classes.length !== 0) {\n const classesNames = classes.map((c) => c.name === undefined ? 'anonymous class' : c.name.text);\n throw new Error(`${classes.length} class statement(s) are found in generated dts: ${classesNames.join(', ')}`);\n }\n }\n syncExports();\n // by default this option should be enabled\n const exportReferencedTypes = outputOptions.exportReferencedTypes !== false;\n function isExportedWithLocalName(namedDeclaration, exportedName) {\n const nodeName = (0, typescript_1.getNodeName)(namedDeclaration);\n if (nodeName === undefined) {\n throw new Error(`Cannot find node name ${namedDeclaration.getText()}`);\n }\n return collisionsResolver.resolveReferencedIdentifier(nodeName) === exportedName;\n }\n const renamedAndNotExplicitlyExportedTypes = [];\n const output = (0, generate_output_1.generateOutput)({\n ...collectionResult,\n resolveIdentifierName: (identifier) => {\n if (ts.isPropertyAccessOrQualifiedName(identifier)) {\n return collisionsResolver.resolveReferencedQualifiedName(identifier);\n }\n else {\n return collisionsResolver.resolveReferencedIdentifier(identifier);\n }\n },\n // eslint-disable-next-line complexity\n getStatementSettings: (statement) => {\n if ((0, typescript_1.isAmbientModule)(statement) || ts.isExportDeclaration(statement)) {\n return { shouldHaveExportKeyword: false, shouldHaveJSDoc: true };\n }\n const statementExports = (0, typescript_1.getExportsForStatement)(rootFileExports, typeChecker, statement);\n // If true, then no direct export was found. That means that node might have\n // an export keyword (like interface, type, etc) otherwise, if there are\n // only re-exports with renaming (like export { foo as bar }) we don't need\n // to put export keyword for this statement because we'll re-export it in the way\n const isExplicitlyExportedWithOriginalName = statementExports.find((exp) => {\n if (ts.isVariableStatement(statement)) {\n for (const variableDeclaration of statement.declarationList.declarations) {\n if (ts.isIdentifier(variableDeclaration.name)) {\n const resolvedName = collisionsResolver.resolveReferencedIdentifier(variableDeclaration.name);\n if (exp.exportedName === resolvedName) {\n return true;\n }\n continue;\n }\n // it seems that the compiler doesn't produce anything else (e.g. binding elements) in declaration files\n // but it is still possible to write such code manually\n // this feels like quite rare case so no support for now\n (0, logger_1.warnLog)(`Unhandled variable identifier type detected (${ts.SyntaxKind[variableDeclaration.name.kind]}). Please report this issue to https://github.com/timocov/dts-bundle-generator`);\n }\n return false;\n }\n return (0, typescript_1.isNodeNamedDeclaration)(statement) && isExportedWithLocalName(statement, exp.exportedName);\n }) !== undefined;\n // \"direct export\" means export from the root source file\n // e.g. classes/functions/etc must be exported from the root source file to have an \"export\" keyword\n // by default interfaces/types are exported even if they aren't directly exported (e.g. when they are referenced by other types)\n // but if `exportReferencedTypes` option is disabled we have to check direct export for them either\n const onlyExplicitlyExportedShouldBeExported = !exportReferencedTypes\n || ts.isClassDeclaration(statement)\n || (ts.isEnumDeclaration(statement) && !(0, typescript_1.hasNodeModifier)(statement, ts.SyntaxKind.ConstKeyword))\n || ts.isFunctionDeclaration(statement)\n || ts.isVariableStatement(statement)\n || ts.isModuleDeclaration(statement);\n if (onlyExplicitlyExportedShouldBeExported) {\n // \"valuable\" statements must be re-exported from root source file\n // to having export keyword in declaration file\n return { shouldHaveExportKeyword: isExplicitlyExportedWithOriginalName, shouldHaveJSDoc: statementExports.length !== 0 };\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if ((0, typescript_1.isNodeNamedDeclaration)(statement) && !isExportedWithLocalName(statement, (0, typescript_1.getNodeName)(statement).getText())) {\n // if a type node was renamed because of name collisions it shouldn't be exported with its new name\n renamedAndNotExplicitlyExportedTypes.push(statement);\n return { shouldHaveExportKeyword: false, shouldHaveJSDoc: statementExports.length !== 0 };\n }\n // at this point a statement of a type (interface, const enum, etc) will be exported 100% (it's just a matter of a name)\n // so it must have jsdoc comment\n return { shouldHaveExportKeyword: isExplicitlyExportedWithOriginalName || statementExports.length === 0, shouldHaveJSDoc: true };\n },\n needStripConstFromConstEnum: (constEnum) => {\n if (!program.getCompilerOptions().preserveConstEnums || !outputOptions.respectPreserveConstEnum) {\n return false;\n }\n const enumSymbol = (0, typescript_1.getNodeSymbol)(constEnum, typeChecker);\n if (enumSymbol === null) {\n return false;\n }\n return rootFileExportSymbols.includes(enumSymbol);\n },\n needStripImportFromImportTypeNode: (node) => {\n if (node.qualifier === undefined) {\n return false;\n }\n if (!ts.isLiteralTypeNode(node.argument) || !ts.isStringLiteral(node.argument.literal)) {\n return false;\n }\n return (0, module_info_1.getReferencedModuleInfo)(node, criteria, typeChecker)?.type === 0 /* ModuleType.ShouldBeInlined */;\n },\n }, {\n sortStatements: outputOptions.sortNodes,\n umdModuleName: outputOptions.umdModuleName,\n noBanner: outputOptions.noBanner,\n });\n if (renamedAndNotExplicitlyExportedTypes.length !== 0) {\n (0, logger_1.warnLog)(`The following type nodes were renamed because of the name collisions and will not be exported from the generated bundle:\\n- ${\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n renamedAndNotExplicitlyExportedTypes.map(node => `${(0, typescript_1.getNodeName)(node).getText()} (from ${node.getSourceFile().fileName})`).join('\\n- ')}${'\\n'}This might lead to unpredictable and unexpected output, and possible breaking changes to your API.${'\\n'}Consider either (re-)exporting them explicitly from the entry point, or disable --export-referenced-types option ('output.exportReferencedTypes' in the config).`);\n }\n return output;\n });\n}\nexports.generateDtsBundle = generateDtsBundle;\n", "import { generateDtsBundle } from \"dts-bundle-generator\"\nimport { mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from \"node:fs\"\nimport os from \"node:os\"\nimport path from \"node:path\"\nimport ts from \"typescript\"\n\nimport { ActorDefinitionError } from \"../errors.js\"\nimport type { ActorApi, TypeScriptContract } from \"../wire/public-contract.js\"\n\nclass DeclarationCompiler {\n constructor(private readonly system: ts.System = ts.sys) {}\n\n compile(\n program: ts.Program,\n actors: readonly ts.ClassDeclaration[],\n contracts: readonly ActorApi[]\n ): TypeScriptContract {\n const directory = mkdtempSync(path.join(os.tmpdir(), \"actor-declarations-\"))\n try {\n return this.bundle(directory, program, actors, contracts)\n } finally {\n rmSync(directory, { recursive: true, force: true })\n }\n }\n\n private bundle(\n directory: string,\n program: ts.Program,\n actors: readonly ts.ClassDeclaration[],\n contracts: readonly ActorApi[]\n ) {\n const packages = new Map<string, { directory: string; version: string }>()\n const entry = this.writeActors(directory, program, actors, contracts, packages)\n const config = writeBundleConfig(directory, program.getCompilerOptions(), packages)\n const [declarations] = generateDtsBundle(\n [\n {\n filePath: entry,\n libraries: { inlinedLibraries: [\"durable-actors\"] },\n output: { noBanner: true, exportReferencedTypes: false, sortNodes: true }\n }\n ],\n { preferredConfigPath: config }\n )\n const dependencies = Object.fromEntries(\n externalModules(declarations)\n .map(specifier => {\n const name = packageName(specifier)\n const pkg =\n packages.get(name) ??\n findPackage(specifier, program.getRootFileNames()[0], program.getCompilerOptions(), this.system)\n return [name, pkg.version]\n })\n .sort(([left], [right]) => left.localeCompare(right))\n )\n return { declarations, dependencies }\n }\n\n private writeActors(\n directory: string,\n program: ts.Program,\n actors: readonly ts.ClassDeclaration[],\n contracts: readonly ActorApi[],\n packages: Map<string, { directory: string; version: string }>\n ): string {\n const files = emitDeclarations(program, this.system)\n const imports: string[] = []\n const properties: string[] = []\n for (const [index, contract] of contracts.entries()) {\n const actor = actors.find(actor => actor.name!.text === contract.actorName)!\n const source = actor.getSourceFile()\n const emitted = files.get(source.fileName)!\n const projected = projectActor(emitted, actor, contract, program.getTypeChecker())\n const file = path.join(directory, `actor-${index}.d.ts`)\n const code = resolveImports(\n projected.code,\n source.fileName,\n program.getCompilerOptions(),\n this.system,\n packages\n )\n writeFileSync(file, code)\n imports.push(`import type { ${projected.name} as Actor${index} } from \"./actor-${index}.js\"`)\n properties.push(`${JSON.stringify(contract.actorName)}: Actor${index}`)\n }\n const entry = path.join(directory, \"index.d.ts\")\n writeFileSync(entry, `${imports.join(\"\\n\")}\\nexport interface ActorTypes { ${properties.join(\";\\n\")} }`)\n return entry\n }\n}\n\nfunction writeBundleConfig(\n directory: string,\n options: ts.CompilerOptions,\n packages: ReadonlyMap<string, { directory: string }>\n): string {\n for (const [name, pkg] of packages) {\n const link = path.join(directory, \"node_modules\", name)\n mkdirSync(path.dirname(link), { recursive: true })\n symlinkSync(pkg.directory, link, \"dir\")\n }\n const config = path.join(directory, \"tsconfig.json\")\n writeFileSync(\n config,\n JSON.stringify({\n compilerOptions: {\n target: \"ES2022\",\n module: \"NodeNext\",\n strict: true,\n skipLibCheck: true,\n baseUrl: options.baseUrl ?? options.pathsBasePath,\n paths: options.paths,\n exactOptionalPropertyTypes: options.exactOptionalPropertyTypes ?? false,\n types: []\n }\n })\n )\n writeFileSync(path.join(directory, \"package.json\"), '{\"type\":\"module\"}')\n return config\n}\n\nfunction emitDeclarations(program: ts.Program, system: ts.System) {\n const options = {\n ...program.getCompilerOptions(),\n noEmit: false,\n declaration: true,\n declarationMap: false,\n emitDeclarationOnly: true,\n outDir: undefined,\n outFile: undefined,\n incremental: false,\n composite: false\n }\n const host = ts.createCompilerHost(options)\n host.readFile = file => program.getSourceFile(file)?.text ?? system.readFile(file)\n host.fileExists = system.fileExists\n const emitter = ts.createProgram(program.getRootFileNames(), options, host, program)\n const files = new Map<string, string>()\n const result = emitter.emit(\n undefined,\n (_file, text, _bom, _error, sources) => {\n if (sources?.length === 1) files.set(sources[0].fileName, text)\n },\n undefined,\n true\n )\n if (result.diagnostics.length)\n throw new ActorDefinitionError(\n result.diagnostics.map(d => ts.flattenDiagnosticMessageText(d.messageText, \"\\n\")).join(\"\\n\")\n )\n return files\n}\n\nfunction projectActor(text: string, actor: ts.ClassDeclaration, contract: ActorApi, checker: ts.TypeChecker) {\n const source = ts.createSourceFile(\"actor.d.ts\", text, ts.ScriptTarget.Latest, true)\n const declaration = source.statements.find(\n statement => ts.isClassDeclaration(statement) && statement.name?.text === actor.name!.text\n ) as ts.ClassDeclaration\n const instance = checker.getTypeAtLocation(actor)\n const types = checker.getTypeArguments(instance.getBaseTypes()![0] as ts.TypeReference)\n const declaredTypes = declaration.heritageClauses?.find(clause => clause.token === ts.SyntaxKind.ExtendsKeyword)\n ?.types[0].typeArguments\n const name = availableName(source, `$${contract.actorName}Contract`)\n const properties = [\"Metadata\", \"Incoming\", \"Outgoing\"].map((kind, index) =>\n ts.factory.createPropertySignature(\n undefined,\n kind,\n undefined,\n declaredTypes?.[index] ??\n checker.typeToTypeNode(\n types[index],\n undefined,\n ts.NodeBuilderFlags.NoTruncation | ts.NodeBuilderFlags.UseFullyQualifiedType\n )!\n )\n )\n properties.push(\n ts.factory.createPropertySignature(undefined, \"State\", undefined, publicState(declaration, contract))\n )\n properties.push(\n ts.factory.createPropertySignature(undefined, \"Methods\", undefined, publicMethods(declaration, contract))\n )\n const root = ts.factory.createInterfaceDeclaration(\n [ts.factory.createModifier(ts.SyntaxKind.ExportKeyword)],\n name,\n undefined,\n undefined,\n properties\n )\n return {\n name,\n code: ts.createPrinter().printFile(ts.factory.updateSourceFile(source, [...source.statements, root]))\n }\n}\n\nfunction publicState(declaration: ts.ClassDeclaration, contract: ActorApi): ts.TypeLiteralNode {\n const state = declaration.members.filter(\n member =>\n ts.isPropertyDeclaration(member) &&\n Object.hasOwn(\n (contract.socket.schema.definitions!.State as { properties: object }).properties,\n propertyName(member.name)\n )\n ) as ts.PropertyDeclaration[]\n return ts.factory.createTypeLiteralNode(\n state.map(member =>\n ts.factory.createPropertySignature(\n member.modifiers?.filter(m => m.kind === ts.SyntaxKind.ReadonlyKeyword),\n member.name,\n member.questionToken,\n member.type\n )\n )\n )\n}\n\nfunction publicMethods(declaration: ts.ClassDeclaration, contract: ActorApi): ts.TypeLiteralNode {\n const members = declaration.members.filter(\n member =>\n ts.isMethodDeclaration(member) &&\n contract.rpc.methods.some(method => method.name === propertyName(member.name))\n ) as ts.MethodDeclaration[]\n return ts.factory.createTypeLiteralNode(\n members\n .sort((a, b) => propertyName(a.name).localeCompare(propertyName(b.name)))\n .map(member =>\n ts.factory.createMethodSignature(\n undefined,\n member.name,\n member.questionToken,\n member.typeParameters,\n member.parameters,\n member.type\n )\n )\n )\n}\n\nfunction availableName(source: ts.SourceFile, proposed: string): string {\n let name = proposed\n while (source.text.includes(name)) name += \"_\"\n return name\n}\n\nfunction propertyName(name: ts.PropertyName): string {\n if (ts.isComputedPropertyName(name) && ts.isStringLiteral(name.expression)) return name.expression.text\n return ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name) ? name.text : name.getText()\n}\n\nfunction resolveImports(\n text: string,\n location: string,\n options: ts.CompilerOptions,\n system: ts.System,\n packages: Map<string, { directory: string; version: string }>\n): string {\n const source = ts.createSourceFile(\"actor.d.ts\", text, ts.ScriptTarget.Latest, true)\n const result = ts.transform(source, [\n context => root =>\n ts.visitNode(root, function visit(node: ts.Node): ts.VisitResult<ts.Node> {\n if (ts.isStringLiteral(node) && isModuleSpecifier(node)) {\n const resolved = ts.resolveModuleName(node.text, location, options, system).resolvedModule\n if (!resolved) throw new ActorDefinitionError(`Cannot resolve public type dependency ${node.text}`)\n if (node.text.startsWith(\".\") || path.isAbsolute(node.text) || !resolved.isExternalLibraryImport)\n return ts.factory.createStringLiteral(resolved.resolvedFileName)\n const name = packageName(node.text)\n packages.set(name, packageAt(resolved.resolvedFileName, name, system))\n }\n return ts.visitEachChild(node, visit, context)\n }) as ts.SourceFile\n ])\n const code = ts.createPrinter().printFile(result.transformed[0])\n result.dispose()\n return code\n}\n\nfunction isModuleSpecifier(node: ts.StringLiteral): boolean {\n const parent = node.parent\n return (\n ((ts.isImportDeclaration(parent) || ts.isExportDeclaration(parent)) && parent.moduleSpecifier === node) ||\n (ts.isLiteralTypeNode(parent) && ts.isImportTypeNode(parent.parent))\n )\n}\n\nfunction externalModules(code: string): string[] {\n const source = ts.createSourceFile(\"types.d.ts\", code, ts.ScriptTarget.Latest, true)\n const names = new Set(\n source.typeReferenceDirectives.map(ref =>\n ref.fileName.startsWith(\"@types/\") ? ref.fileName : `@types/${ref.fileName}`\n )\n )\n const visit = (node: ts.Node) => {\n if (ts.isStringLiteral(node) && isModuleSpecifier(node)) {\n if (node.text.startsWith(\".\") || path.isAbsolute(node.text))\n throw new ActorDefinitionError(`Unbundled public type dependency ${node.text}`)\n if (!node.text.startsWith(\"node:\")) names.add(node.text)\n }\n ts.forEachChild(node, visit)\n }\n visit(source)\n return [...names].sort()\n}\n\nfunction packageName(specifier: string): string {\n return specifier\n .split(\"/\")\n .slice(0, specifier.startsWith(\"@\") ? 2 : 1)\n .join(\"/\")\n}\n\nfunction findPackage(specifier: string, location: string, options: ts.CompilerOptions, system: ts.System) {\n const resolved = ts.resolveModuleName(specifier, location, options, system).resolvedModule\n if (!resolved) throw new ActorDefinitionError(`Cannot resolve public type dependency ${specifier}`)\n return packageAt(resolved.resolvedFileName, packageName(specifier), system)\n}\n\nfunction packageAt(file: string, name: string, system: ts.System) {\n for (let directory = path.dirname(file); ; directory = path.dirname(directory)) {\n const manifest = system.readFile(path.join(directory, \"package.json\"))\n if (manifest) {\n const json = JSON.parse(manifest)\n if (json.name === name || directory.endsWith(`${path.sep}${name}`)) {\n if (typeof json.version !== \"string\")\n throw new ActorDefinitionError(`Public type dependency ${name} must declare a version`)\n return { directory, version: json.version as string }\n }\n }\n if (directory === path.dirname(directory))\n throw new ActorDefinitionError(`Cannot find package metadata for ${name}`)\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path", "ts", "ts", "path", "ts", "ts", "module", "ts", "exports", "path", "path", "ts", "path", "ts", "ts", "ts", "generateDtsBundle", "exports", "namespaceExports", "actor"]
7
+ }