jsii 5.9.9-dev.2 → 5.9.9-dev.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"assembler.js","sourceRoot":"","sources":["../src/assembler.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,8BAA8B;AAC9B,kCAAkC;AAClC,mCAAmC;AACnC,qCAA+F;AAC/F,+BAA+B;AAC/B,iDAAiD;AACjD,iCAAiC;AACjC,iCAAiC;AAEjC,+BAA+B;AAC/B,kDAAsD;AACtD,6CAA0C;AAC1C,iCAA2F;AAE3F,uCAAgD;AAChD,uDAAmD;AACnD,uCAAuC;AACvC,4CAA4C;AAE5C,qDAAkD;AAClD,iCAA8B;AAC9B,wEAAoE;AACpE,4EAAgF;AAChF,4DAAoE;AACpE,8CAA0D;AAC1D,qDAA6E;AAC7E,iDAA0F;AAC1F,mCAAoC;AACpC,2CAAwC;AACxC,uCAAmD;AACnD,yCAA6C;AAE7C,qGAAqG;AACrG,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEtC,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAE/C;;GAEG;AACH,MAAa,SAAS;IA8BpB;;;;OAIG;IACH,YACkB,WAAwB,EACvB,MAAiB,EAClB,OAAmB,EACnB,MAAc,EAC9B,UAA4B,EAAE;QAJd,gBAAW,GAAX,WAAW,CAAa;QACvB,WAAM,GAAN,MAAM,CAAW;QAClB,YAAO,GAAP,OAAO,CAAY;QACnB,WAAM,GAAN,MAAM,CAAQ;QA/Bf,iBAAY,GAAG,IAAI,GAAG,EAAoB,CAAC;QAIpD,iBAAY,GAAG,IAAI,KAAK,EAAkB,CAAC;QAC3C,cAAS,GAAG,IAAI,KAAK,EAAkB,CAAC;QAC/B,WAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;QACtC,sBAAiB,GAAG,IAAI,GA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AC,EACjC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,EACnD,WAAW,CACZ;aACA,IAAI,CAAC,IAAI,CAAC;KACd,CAAC;AACJ,CAAC;AAED,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACvE,SAAS,gBAAgB,CAAC,MAAiB;IACzC,OAAO,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,IAA6B,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import * as crypto from 'node:crypto';\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as spec from '@jsii/spec';\nimport { describeTypeReference, writeAssembly, SPEC_FILE_NAME, PackageJson } from '@jsii/spec';\nimport * as chalk from 'chalk';\nimport * as deepEqual from 'fast-deep-equal/es6';\nimport * as log4js from 'log4js';\nimport * as ts from 'typescript';\n\nimport * as Case from './case';\nimport { symbolIdentifier } from './common/symbol-id';\nimport { Directives } from './directives';\nimport { getReferencedDocParams, parseSymbolDocumentation, TypeSystemHints } from './docs';\nimport { Emitter } from './emitter';\nimport { normalizeConfigPath } from './helpers';\nimport { JsiiDiagnostic } from './jsii-diagnostic';\nimport * as literate from './literate';\nimport * as bindings from './node-bindings';\nimport { ProjectInfo } from './project-info';\nimport { isReservedName } from './reserved-words';\nimport { Sets } from './sets';\nimport { DeprecatedRemover } from './transforms/deprecated-remover';\nimport { DeprecationWarningsInjector } from './transforms/deprecation-warnings';\nimport { RuntimeTypeInfoInjector } from './transforms/runtime-info';\nimport { combinedTransformers } from './transforms/utils';\nimport { typeReferenceEqual, typeReferenceToString } from './type-reference';\nimport { isBehavioralInterfaceType, visitType, visitTypeReference } from './type-visitor';\nimport { JsiiError } from './utils';\nimport { Validator } from './validator';\nimport { SHORT_VERSION, VERSION } from './version';\nimport { enabledWarnings } from './warnings';\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports\nconst sortJson = require('sort-json');\n\nconst LOG = log4js.getLogger('jsii/assembler');\n\n/**\n * The JSII Assembler consumes a ``ts.Program`` instance and emits a JSII assembly.\n */\nexport class Assembler implements Emitter {\n private readonly runtimeTypeInfoInjector: RuntimeTypeInfoInjector;\n private readonly deprecatedRemover?: DeprecatedRemover;\n private readonly warningsInjector?: DeprecationWarningsInjector;\n\n private readonly mainFile: string;\n private readonly tscRootDir?: string;\n private readonly compressAssembly?: boolean;\n private readonly usedFeatures = new Set<spec.JsiiFeature>();\n\n private readonly _typeChecker: ts.TypeChecker;\n\n private _diagnostics = new Array<JsiiDiagnostic>();\n private _deferred = new Array<DeferredRecord>();\n private readonly _types = new Map<string, spec.Type>();\n private readonly _packageInfoCache = new Map<string, PackageJson | undefined>();\n\n /** Map of Symbol to namespace export Symbol */\n private readonly _submoduleMap = new Map<ts.Symbol, ts.Symbol>();\n\n /**\n * Submodule information\n *\n * Contains submodule information for all namespaces that have been seen\n * across all assemblies (this and dependencies).\n *\n * Filtered to local submodules only at time of writing the assembly out to disk.\n */\n private readonly _submodules = new Map<ts.Symbol, SubmoduleSpec>();\n\n /**\n * @param projectInfo information about the package being assembled\n * @param program the TypeScript program to be assembled from\n * @param stdlib the directory where the TypeScript stdlib is rooted\n */\n public constructor(\n public readonly projectInfo: ProjectInfo,\n private readonly system: ts.System,\n public readonly program: ts.Program,\n public readonly stdlib: string,\n options: AssemblerOptions = {},\n ) {\n this._typeChecker = this.program.getTypeChecker();\n\n if (options.stripDeprecated) {\n let allowlistedDeprecations: Set<string> | undefined;\n if (options.stripDeprecatedAllowListFile) {\n if (!fs.existsSync(options.stripDeprecatedAllowListFile)) {\n throw new JsiiError(`--strip-deprecated file not found: ${options.stripDeprecatedAllowListFile}`);\n }\n allowlistedDeprecations = new Set<string>(\n fs.readFileSync(options.stripDeprecatedAllowListFile, 'utf8').split('\\n'),\n );\n }\n\n this.deprecatedRemover = new DeprecatedRemover(this._typeChecker, allowlistedDeprecations);\n }\n\n if (options.addDeprecationWarnings) {\n this.warningsInjector = new DeprecationWarningsInjector(this._typeChecker);\n }\n\n this.compressAssembly = options.compressAssembly;\n\n const dts = projectInfo.types;\n let mainFile = dts.replace(/\\.d\\.ts(x?)$/, '.ts$1');\n\n // If out-of-source build was configured (tsc's outDir and rootDir), the\n // main file's path needs to be re-rooted from the outDir into the rootDir.\n // outDir might be also be absolute, so we need to normalize it.\n const tscOutDir = normalizeConfigPath(projectInfo.projectRoot, program.getCompilerOptions().outDir);\n if (tscOutDir != null) {\n mainFile = path.relative(tscOutDir, mainFile);\n\n // rootDir may be set explicitly or not. If not, inferRootDir replicates\n // tsc's behavior of using the longest prefix of all built source files.\n this.tscRootDir = program.getCompilerOptions().rootDir ?? inferRootDir(program);\n if (this.tscRootDir != null) {\n mainFile = path.join(this.tscRootDir, mainFile);\n }\n }\n\n this.mainFile = path.resolve(projectInfo.projectRoot, mainFile);\n this.runtimeTypeInfoInjector = new RuntimeTypeInfoInjector(projectInfo.version);\n }\n\n public get customTransformers(): ts.CustomTransformers {\n return combinedTransformers(\n this.deprecatedRemover?.customTransformers ?? {},\n this.runtimeTypeInfoInjector.makeTransformers(),\n this.warningsInjector?.customTransformers ?? {},\n );\n }\n\n /**\n * Attempt emitting the JSII assembly for the program.\n *\n * @return the result of the assembly emission.\n */\n public emit(): ts.EmitResult {\n if (!this.projectInfo.description) {\n this._diagnostics.push(JsiiDiagnostic.JSII_0001_PKG_MISSING_DESCRIPTION.createDetached());\n }\n if (!this.projectInfo.homepage) {\n this._diagnostics.push(JsiiDiagnostic.JSII_0002_PKG_MISSING_HOMEPAGE.createDetached());\n }\n const readme = _loadReadme.call(this);\n if (readme == null) {\n this._diagnostics.push(JsiiDiagnostic.JSII_0003_MISSING_README.createDetached());\n }\n const docs = _loadDocs.call(this);\n\n const sourceFile = this.program.getSourceFile(this.mainFile);\n\n if (sourceFile == null) {\n this._diagnostics.push(JsiiDiagnostic.JSII_0004_COULD_NOT_FIND_ENTRYPOINT.createDetached(this.mainFile));\n } else {\n this._registerDependenciesNamespaces(sourceFile);\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n `Processing source file: ${chalk.blue(path.relative(this.projectInfo.projectRoot, sourceFile.fileName))}`,\n );\n }\n const symbol = this._typeChecker.getSymbolAtLocation(sourceFile);\n if (symbol) {\n const moduleExports = this._typeChecker.getExportsOfModule(symbol);\n moduleExports.map((item) => this._registerNamespaces(item, this.projectInfo.projectRoot));\n for (const node of moduleExports) {\n const decl = node.declarations?.[0];\n if (decl == null) {\n continue;\n }\n this._visitNode(decl, new EmitContext([], this.projectInfo.stability));\n }\n }\n }\n\n this.callDeferredsInOrder();\n\n this.validateTypesAgainstPositions();\n\n // Skip emitting if any diagnostic message is an error\n if (this._diagnostics.find((diag) => diag.category === ts.DiagnosticCategory.Error) != null) {\n LOG.debug('Skipping emit due to errors.');\n try {\n return { diagnostics: this._diagnostics, emitSkipped: true };\n } finally {\n // Clearing ``this._diagnostics`` to allow contents to be garbage-collected.\n this._afterEmit();\n }\n }\n\n const jsiiVersion = this.projectInfo.jsiiVersionFormat === 'short' ? SHORT_VERSION : VERSION;\n\n const assembly: spec.Assembly = {\n schema: spec.SchemaVersion.LATEST,\n name: this.projectInfo.name,\n version: this.projectInfo.version,\n description: this.projectInfo.description ?? this.projectInfo.name,\n license: this.projectInfo.license,\n keywords: this.projectInfo.keywords && Array.from(this.projectInfo.keywords),\n homepage: this.projectInfo.homepage ?? this.projectInfo.repository.url,\n author: this.projectInfo.author,\n contributors: this.projectInfo.contributors && [...this.projectInfo.contributors],\n repository: this.projectInfo.repository,\n dependencies: noEmptyDict({\n ...this.projectInfo.dependencies,\n ...this.projectInfo.peerDependencies,\n }),\n dependencyClosure: noEmptyDict(toDependencyClosure(this.projectInfo.dependencyClosure)),\n bundled: this.projectInfo.bundleDependencies,\n types: Object.fromEntries(this._types),\n submodules: noEmptyDict(toSubmoduleDeclarations(this.mySubmodules())),\n targets: this.projectInfo.targets,\n metadata: {\n ...this.projectInfo.metadata,\n\n // Downstream consumers need this to map a symbolId in the outDir to a\n // symbolId in the rootDir.\n tscRootDir: this.tscRootDir,\n },\n docs,\n readme,\n jsiiVersion,\n bin: this.projectInfo.bin,\n fingerprint: '<TBD>',\n usedFeatures: this.usedFeatures.size > 0 ? Array.from(this.usedFeatures) : undefined,\n };\n\n if (this.deprecatedRemover) {\n this._diagnostics.push(...this.deprecatedRemover.removeFrom(assembly));\n }\n\n if (this.warningsInjector) {\n const jsiiMetadata = {\n ...(assembly.metadata?.jsii ?? {}),\n ...{ compiledWithDeprecationWarnings: true },\n };\n\n if (assembly.metadata) {\n assembly.metadata.jsii = jsiiMetadata;\n } else {\n assembly.metadata = { jsii: jsiiMetadata };\n }\n this.warningsInjector.process(assembly, this.projectInfo);\n }\n\n const validator = new Validator(this.projectInfo, assembly);\n const validationResult = validator.emit();\n if (!validationResult.emitSkipped) {\n const zipped = writeAssembly(this.projectInfo.projectRoot, _fingerprint(assembly), {\n compress: this.compressAssembly ?? false,\n });\n LOG.trace(\n `${zipped ? 'Zipping' : 'Emitting'} assembly: ${chalk.blue(\n path.join(this.projectInfo.projectRoot, SPEC_FILE_NAME),\n )}`,\n );\n }\n\n try {\n return {\n diagnostics: [...this._diagnostics, ...validationResult.diagnostics],\n emitSkipped: validationResult.emitSkipped,\n };\n } finally {\n this._afterEmit();\n }\n\n function _loadReadme(this: Assembler) {\n // Search for `README.md` in a case-insensitive way\n const fileName = fs\n .readdirSync(this.projectInfo.projectRoot)\n .find((file) => file.toLocaleLowerCase() === 'readme.md');\n if (fileName == null) {\n return undefined;\n }\n const readmePath = path.join(this.projectInfo.projectRoot, fileName);\n return loadAndRenderReadme(readmePath, this.projectInfo.projectRoot);\n }\n\n function _loadDocs(this: Assembler): spec.Docs | undefined {\n if (!this.projectInfo.stability && !this.projectInfo.deprecated) {\n return undefined;\n }\n const deprecated = this.projectInfo.deprecated;\n const stability = this.projectInfo.stability;\n return { deprecated, stability };\n }\n }\n\n private _afterEmit() {\n this._diagnostics = [];\n this._deferred = [];\n this._types.clear();\n this._submoduleMap.clear();\n this._submodules.clear();\n this._packageInfoCache.clear();\n }\n\n /**\n * Defer a callback until a (set of) types are available\n *\n * This is a helper function around _defer() which encapsulates the _dereference\n * action (which is basically the majority use case for _defer anyway).\n *\n * Will not invoke the function with any 'undefined's; an error will already have been emitted in\n * that case anyway.\n *\n * @param fqn FQN of the current type (the type that has a dependency on baseTypes)\n * @param baseTypes Array of type references to be looked up\n * @param referencingNode Node to report a diagnostic on if we fail to look up a type\n * @param cb Callback to be invoked with the Types corresponding to the TypeReferences in baseTypes\n */\n private _deferUntilTypesAvailable(\n fqn: string,\n baseTypes: Array<string | spec.TypeReference>,\n referencingNode: ts.Node | undefined,\n cb: (...xs: spec.Type[]) => void,\n ) {\n // We can do this one eagerly\n if (baseTypes.length === 0) {\n cb();\n return;\n }\n const baseFqns = baseTypes.flatMap((bt) => {\n if (typeof bt === 'string') {\n return [bt];\n }\n if (spec.isNamedTypeReference(bt)) {\n return [bt.fqn];\n }\n return [];\n });\n\n this._defer(fqn, baseFqns, () => {\n const resolved = baseFqns\n .map((x) => this._dereference(x, referencingNode, 'used-in-syntax'))\n .filter((x) => x !== undefined);\n if (resolved.length > 0) {\n cb(...(resolved as spec.Type[]));\n }\n });\n }\n\n /**\n * Defer checks for after the program has been entirely processed; useful for verifying type references that may not\n * have been discovered yet, and verifying properties about them.\n *\n * The callback is guaranteed to be executed only after all deferreds for all types in 'dependedFqns' have\n * been executed.\n *\n * @param fqn FQN of the current type.\n * @param dependedFqns List of FQNs of types this callback depends on. All deferreds for all\n * @param cb the function to be called in a deferred way. It will be bound with ``this``, so it can depend on using\n * ``this``.\n */\n private _defer(fqn: string, dependedFqns: string[], cb: () => void) {\n this._deferred.push({ fqn, dependedFqns, cb: cb.bind(this) });\n }\n\n /**\n * Obtains the ``spec.Type`` for a given ``spec.NamedTypeReference``.\n *\n * @param ref the type reference to be de-referenced\n *\n * @returns the de-referenced type, if it was found, otherwise ``undefined``.\n */\n private _dereference(\n ref: string | spec.NamedTypeReference,\n referencingNode: ts.Node | undefined,\n usedInSyntax: 'used-in-syntax' | 'just-validating',\n ): spec.Type | undefined {\n if (typeof ref !== 'string') {\n ref = ref.fqn;\n }\n\n const [assm] = ref.split('.');\n let type;\n if (assm === this.projectInfo.name) {\n type = this._types.get(ref);\n } else {\n const assembly = this.projectInfo.dependencyClosure.find((dep) => dep.name === assm);\n type = assembly?.types?.[ref];\n\n // since we are exposing a type of this assembly in this module's public API,\n // we expect it to appear as a peer dependency instead of a normal dependency.\n if (assembly) {\n if (!(assembly.name in this.projectInfo.peerDependencies)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_0005_MISSING_PEER_DEPENDENCY.create(\n referencingNode!, // Cheating here for now, until the referencingNode can be made required\n assembly.name,\n ref,\n ),\n );\n }\n }\n }\n\n if (!type && usedInSyntax === 'used-in-syntax') {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9002_UNRESOLVEABLE_TYPE.create(\n referencingNode!, // Cheating here for now, until the referencingNode can be made required\n ref,\n ),\n );\n }\n\n return type;\n }\n\n /**\n * Compute the JSII fully qualified name corresponding to a ``ts.Type`` instance. If for any reason a name cannot be\n * computed for the type, a marker is returned instead, and an ``ts.DiagnosticCategory.Error`` diagnostic is\n * inserted in the assembler context.\n *\n * @param type the type for which a JSII fully qualified name is needed.\n * @param typeAnnotationNode the type annotation for which this FQN is generated. This is used for attaching the error\n * marker. When there is no explicit type annotation (e.g: inferred method return type), the\n * preferred substitute is the \"type-inferred\" element's name.\n * @param typeUse the reason why this type was resolved (e.g: \"return type\")\n * @param isThisType whether this type was specified or inferred as \"this\" or not\n *\n * @returns the FQN of the type, or some \"unknown\" marker.\n */\n private _getFQN(\n type: ts.Type,\n typeAnnotationNode: ts.Node | undefined,\n typeUse: TypeUseKind,\n isThisType: boolean,\n ): string | undefined {\n const sym = symbolFromType(type, this._typeChecker);\n const typeDeclaration = sym.valueDeclaration ?? sym.declarations?.[0];\n\n // Set to true to prevent further adding of Error diagnostics for known-bad reference\n let hasError = false;\n\n if (this._isPrivateOrInternal(sym)) {\n // Check if this type is \"this\" (explicit or inferred method return type).\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3001_EXPOSED_INTERNAL_TYPE.create(\n typeAnnotationNode,\n sym,\n isThisType,\n typeUse,\n ).addRelatedInformationIf(typeDeclaration, 'The referenced type is declared here'),\n );\n\n hasError = true;\n }\n\n const tsName = this._typeChecker.getFullyQualifiedName(sym);\n const groups = /^\"([^\"]+)\"\\.(.*)$/.exec(tsName);\n if (!groups) {\n if (!hasError) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3001_EXPOSED_INTERNAL_TYPE.create(\n typeAnnotationNode,\n sym,\n isThisType,\n typeUse,\n ).addRelatedInformationIf(typeDeclaration, 'The referenced type is declared here'),\n );\n hasError = true;\n }\n return tsName;\n }\n const [, modulePath, typeName] = groups;\n const pkg = this.findPackageInfo(modulePath);\n if (!pkg) {\n if (!hasError) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9003_UNRESOLVEABLE_MODULE.create(typeAnnotationNode, modulePath).addRelatedInformationIf(\n typeDeclaration,\n 'The referenced type is declared here',\n ),\n );\n hasError = true;\n }\n return `unknown.${typeName}`;\n }\n\n // If the symbol comes from an assembly whose submodules we've already\n // spidered (or from the current assembly), look up there. This relies\n // on an entry-point import of the library having been done first\n // (`import * as x from 'module-root';`)\n const submodule = this._submoduleMap.get(sym);\n if (submodule != null) {\n const submoduleNs = this._submodules.get(submodule)!.fqnResolutionPrefix;\n return `${submoduleNs}.${typeName}`;\n }\n\n // This is the fallback: in case we can't find a symbolId for the given\n // type, we're return this value. This is for backwards compatibility with\n // modules that haven't been compiled to have symbolId support. Those also\n // most likely won't be using submodules so this legacy guess will be correct.\n const fallbackFqn = `${pkg.name}.${typeName}`;\n\n // If the type is coming from the current module, we won't find it in a dependency\n if (pkg.name === this.projectInfo.name) {\n return fallbackFqn;\n }\n\n // Otherwise look up the symbol identifier in the dependency assemblies\n // This is now the preferred mechanism but we can't do this as the only mechanism,\n // as we may still have compile against very old assemblies that don't have a\n // symbol identifier table at all.\n const dep = this.projectInfo.dependencyClosure.find((d) => d.name === pkg.name);\n if (!dep) {\n this._diagnostics.push(JsiiDiagnostic.JSII_9000_UNKNOWN_MODULE.create(typeAnnotationNode, pkg.name));\n return fallbackFqn;\n }\n const symbolId = symbolIdentifier(this._typeChecker, sym, {\n assembly: dep,\n });\n const fqn = (dep && symbolId ? symbolIdIndex(dep)[symbolId] : undefined) ?? fallbackFqn;\n\n if (!fqn || !this._dereference({ fqn }, sym.valueDeclaration, 'used-in-syntax')) {\n if (!hasError) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3002_USE_OF_UNEXPORTED_FOREIGN_TYPE.create(\n typeAnnotationNode,\n fqn ?? tsName,\n typeUse,\n pkg,\n ).addRelatedInformationIf(typeDeclaration, 'The referenced type is declared here'),\n );\n hasError = true;\n }\n }\n\n return fqn;\n }\n\n /**\n * For all modules in the dependency closure, crawl their exports to register\n * the submodules they contain.\n *\n * @param entryPoint the main source file for the currently compiled module.\n */\n private _registerDependenciesNamespaces(entryPoint: ts.SourceFile) {\n for (const assm of this.projectInfo.dependencyClosure) {\n const resolved = ts.resolveModuleName(assm.name, entryPoint.fileName, this.program.getCompilerOptions(), ts.sys);\n // If we can't resolve the module name, simply ignore it (TypeScript compilation likely failed)\n if (resolved.resolvedModule == null) {\n continue;\n }\n const source = this.program.getSourceFile(resolved.resolvedModule.resolvedFileName);\n const depMod = source && this._typeChecker.getSymbolAtLocation(source);\n // It's unlikely, but if we can't get the SourceFile here, ignore it (TypeScript compilation probably failed)\n if (depMod == null) {\n continue;\n }\n\n const depRoot = packageRoot(resolved.resolvedModule.resolvedFileName);\n\n for (const symbol of this._typeChecker.getExportsOfModule(depMod)) {\n this._registerNamespaces(symbol, depRoot);\n }\n }\n\n function packageRoot(file: string): string {\n const parent = path.dirname(file);\n if (path.basename(parent) === 'node_modules' || parent === file) {\n return file;\n }\n return packageRoot(parent);\n }\n }\n\n private _registerNamespaces(symbol: ts.Symbol, packageRoot: string): void {\n const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];\n if (declaration == null) {\n // Nothing to do here...\n return;\n }\n if (ts.isModuleDeclaration(declaration)) {\n // Looks like:\n //\n // export some_namespace {\n // ...\n // }\n //\n // No way to configure targets\n\n const { fqn, fqnResolutionPrefix } = qualifiedNameOf.call(this, symbol, true);\n\n this._submodules.set(symbol, {\n fqn,\n fqnResolutionPrefix,\n symbolId: symbolIdentifier(this._typeChecker, symbol),\n locationInModule: this.declarationLocation(declaration),\n });\n this._addToSubmodule(symbol, symbol, packageRoot);\n return;\n }\n if (!ts.isNamespaceExport(declaration)) {\n // Nothing to do here...\n return;\n }\n\n const moduleSpecifier = declaration.parent.moduleSpecifier;\n if (moduleSpecifier == null || !ts.isStringLiteral(moduleSpecifier)) {\n // There is a grammar error here, so we'll let tsc report this for us.\n return;\n }\n const resolution = ts.resolveModuleName(\n moduleSpecifier.text,\n declaration.getSourceFile().fileName,\n this.program.getCompilerOptions(),\n this.system,\n );\n if (resolution.resolvedModule == null) {\n // Unresolvable module... We'll let tsc report this for us.\n return;\n }\n\n if (\n // We're not looking into a dependency's namespace exports, and the resolution says it's external\n (packageRoot === this.projectInfo.projectRoot && resolution.resolvedModule.isExternalLibraryImport) ||\n // Or the module resolves outside of the current dependency's tree entirely\n !isUnder(resolution.resolvedModule.resolvedFileName, packageRoot) ||\n // Or the module is under one the current dependency's node_modules subtree\n resolution.resolvedModule.resolvedFileName\n .split('/') // Separator is always '/', even on Windows\n .filter((entry) => entry === 'node_modules').length !==\n packageRoot.split('/').filter((entry) => entry === 'node_modules').length\n ) {\n // External re-exports are \"pure-javascript\" sugar; they need not be\n // represented in the jsii Assembly since the types in there will be\n // resolved through dependencies.\n return;\n }\n\n const sourceFile = this.program.getSourceFile(resolution.resolvedModule.resolvedFileName)!;\n const sourceModule = this._typeChecker.getSymbolAtLocation(sourceFile);\n // If there's no module, it's a syntax error, and tsc will have reported it for us.\n if (sourceModule) {\n if (symbol.name !== Case.camel(symbol.name) && symbol.name !== Case.snake(symbol.name)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_8004_SUBMOULE_NAME_CASING.create(declaration.name, symbol.name));\n }\n\n const { fqn, fqnResolutionPrefix } = qualifiedNameOf.call(this, symbol);\n const targets = loadSubmoduleTargetConfig(sourceFile.fileName);\n // There is no need to process the README file for submodules that are\n // external (i.e: from a dependency), as these will not be emitted in the\n // assembly. That'd be wasted effort, and could fail if the README file\n // refers to literate examples that are not packaged in the dependency.\n const readme =\n packageRoot === this.projectInfo.projectRoot\n ? loadSubmoduleReadMe(sourceFile.fileName, this.projectInfo.projectRoot)\n : undefined;\n\n this._submodules.set(symbol, {\n fqn,\n fqnResolutionPrefix,\n targets,\n readme,\n symbolId: symbolIdentifier(this._typeChecker, symbol),\n locationInModule: this.declarationLocation(declaration),\n });\n this._addToSubmodule(symbol, sourceModule, packageRoot);\n }\n\n function qualifiedNameOf(\n this: Assembler,\n sym: ts.Symbol,\n inlineNamespace = false,\n ): { fqn: string; fqnResolutionPrefix: string } {\n if (this._submoduleMap.has(sym)) {\n const parent = this._submodules.get(this._submoduleMap.get(sym)!)!;\n const fqn = `${parent.fqn}.${sym.name}`;\n return {\n fqn,\n fqnResolutionPrefix: inlineNamespace ? parent.fqnResolutionPrefix : fqn,\n };\n }\n const symbolLocation = sym.getDeclarations()?.[0]?.getSourceFile()?.fileName;\n const pkgInfo = symbolLocation ? this.findPackageInfo(symbolLocation) : undefined;\n const assemblyName: string = pkgInfo?.name ?? this.projectInfo.name;\n const fqn = `${assemblyName}.${sym.name}`;\n return {\n fqn,\n fqnResolutionPrefix: inlineNamespace ? this.projectInfo.name : fqn,\n };\n }\n\n function loadSubmoduleTargetConfig(submoduleMain: string): SubmoduleSpec['targets'] {\n const jsiirc = path.resolve(submoduleMain, '..', '.jsiirc.json');\n if (!fs.existsSync(jsiirc)) {\n return undefined;\n }\n const data = JSON.parse(fs.readFileSync(jsiirc, 'utf-8'));\n return data.targets;\n }\n\n /**\n * Load the README for the given submodule\n *\n * If the submodule is loaded from a complete directory (determined by the 'main'\n * file ending in `index.[d.]ts`, then we load `README.md` in that same directory.\n *\n * If the submodule is loaded from a file, like `mymodule.[d.]ts`, we will load\n * `mymodule.README.md`.\n */\n function loadSubmoduleReadMe(submoduleMain: string, projectRoot: string): SubmoduleSpec['readme'] {\n const fileBase = path.basename(submoduleMain).replace(/(\\.d)?\\.ts$/, '');\n const readMeName = fileBase === 'index' ? 'README.md' : `${fileBase}.README.md`;\n const fullPath = path.join(path.dirname(submoduleMain), readMeName);\n return loadAndRenderReadme(fullPath, projectRoot);\n }\n }\n\n /**\n * Registers Symbols to a particular submodule. This is used to associate\n * declarations exported by an `export * as ns from 'moduleLike';` statement\n * so that they can subsequently be correctly namespaced.\n *\n * @param ns the symbol that identifies the submodule.\n * @param moduleLike the module-like symbol bound to the submodule.\n * @param packageRoot the root of the package being traversed.\n */\n private _addToSubmodule(ns: ts.Symbol, moduleLike: ts.Symbol, packageRoot: string) {\n // For each symbol exported by the moduleLike, map it to the ns submodule.\n for (const symbol of this._typeChecker.getExportsOfModule(moduleLike)) {\n if (this._submoduleMap.has(symbol)) {\n const currNs = this._submoduleMap.get(symbol)!;\n // Checking if there's been two submodules exporting the same symbol,\n // which is illegal. We can tell if the currently registered symbol has\n // a different name than the one we're currently trying to register in.\n if (currNs.name !== ns.name) {\n const currNsDecl = currNs.valueDeclaration ?? currNs.declarations?.[0];\n const nsDecl = ns.valueDeclaration ?? ns.declarations?.[0];\n\n // Make sure the error message always lists causes in the same order\n const refs = [\n { decl: currNsDecl, name: currNs.name } as const,\n { decl: nsDecl, name: ns.name } as const,\n ].sort(({ name: l }, { name: r }) => l.localeCompare(r));\n\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3003_SYMBOL_IS_EXPORTED_TWICE.create(\n _nameOrDeclarationNode(symbol),\n refs[0].name,\n refs[1].name,\n )\n .addRelatedInformationIf(refs[0].decl, `Symbol is exported under the \"${refs[0].name}\" submodule`)\n .addRelatedInformationIf(refs[1].decl, `Symbol is exported under the \"${refs[1].name}\" submodule`),\n );\n }\n // Found two re-exports, which is odd, but they use the same submodule,\n // so it's probably okay? That's likely a tsc error, which will have\n // been reported for us already anyway.\n continue;\n }\n this._submoduleMap.set(symbol, ns);\n\n // If the exported symbol has any declaration, and that delcaration is of\n // an entity that can have nested declarations of interest to jsii\n // (classes, interfaces, enums, modules), we need to also associate those\n // nested symbols to the submodule (or they won't be named correctly!)\n const decl = symbol.declarations?.[0];\n if (decl != null) {\n if (ts.isClassDeclaration(decl) || ts.isInterfaceDeclaration(decl) || ts.isEnumDeclaration(decl)) {\n const type = this._typeChecker.getTypeAtLocation(decl);\n if (isSingleValuedEnum(type, this._typeChecker)) {\n // type.symbol !== symbol, because symbol is the enum itself, but\n // since it's single-valued, the TypeChecker will only show us the\n // value's symbol later on.\n this._submoduleMap.set(type.symbol, ns);\n }\n if (type.symbol.exports) {\n // eslint-disable-next-line no-await-in-loop\n this._addToSubmodule(ns, symbol, packageRoot);\n }\n } else if (ts.isModuleDeclaration(decl)) {\n // eslint-disable-next-line no-await-in-loop\n this._registerNamespaces(symbol, packageRoot);\n } else if (ts.isNamespaceExport(decl)) {\n // eslint-disable-next-line no-await-in-loop\n this._registerNamespaces(symbol, packageRoot);\n }\n }\n }\n }\n\n /**\n * Register exported types in ``this.types``.\n *\n * @param node a node found in a module\n * @param namePrefix the prefix for the types' namespaces\n */\n // eslint-disable-next-line complexity\n private _visitNode(node: ts.Declaration, context: EmitContext): spec.Type[] {\n if (ts.isNamespaceExport(node)) {\n // export * as ns from 'module';\n // Note: the \"ts.NamespaceExport\" refers to the \"export * as ns\" part of\n // the statement only. We must refer to `node.parent` in order to be able\n // to access the module specifier (\"from 'module'\") part.\n const symbol = this._typeChecker.getSymbolAtLocation(node.parent.moduleSpecifier!)!;\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Entering submodule: ${chalk.cyan([...context.namespace, symbol.name].join('.'))}`);\n }\n\n const nsContext = context.appendNamespace(node.name.text);\n const allTypes = this._typeChecker.getExportsOfModule(symbol).flatMap((child) => {\n const decl = child.declarations?.[0];\n if (decl == null) {\n return [];\n }\n return this._visitNode(decl, nsContext);\n });\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Leaving submodule: ${chalk.cyan([...context.namespace, symbol.name].join('.'))}`);\n }\n\n return allTypes;\n }\n\n if (ts.isExportSpecifier(node)) {\n // This is what happens when one does `export { Symbol } from \"./location\";`\n // ExportSpecifier: ~~~~~~\n\n const resolvedSymbol = this._typeChecker.getExportSpecifierLocalTargetSymbol(node);\n const decl = resolvedSymbol?.valueDeclaration ?? resolvedSymbol?.declarations?.[0];\n if (!decl) {\n // A grammar error, compilation will already have failed\n return [];\n }\n return this._visitNode(decl, context);\n }\n\n if ((ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) === 0) {\n return [];\n }\n\n let jsiiType: spec.Type | undefined;\n\n if (ts.isClassDeclaration(node) && _isExported(node)) {\n // export class Name { ... }\n this._validateHeritageClauses(node.heritageClauses);\n\n jsiiType = this._visitClass(this._typeChecker.getTypeAtLocation(node), context);\n if (jsiiType) {\n this.registerExportedClassFqn(node, jsiiType.fqn);\n }\n } else if (ts.isInterfaceDeclaration(node) && _isExported(node)) {\n // export interface Name { ... }\n this._validateHeritageClauses(node.heritageClauses);\n jsiiType = this._visitInterface(this._typeChecker.getTypeAtLocation(node), context);\n } else if (ts.isEnumDeclaration(node) && _isExported(node)) {\n // export enum Name { ... }\n jsiiType = this._visitEnum(this._typeChecker.getTypeAtLocation(node), context);\n } else if (ts.isModuleDeclaration(node)) {\n // export namespace name { ... }\n const name = node.name.getText();\n const symbol = this._typeChecker.getSymbolAtLocation(node.name)!;\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Entering namespace: ${chalk.cyan([...context.namespace, name].join('.'))}`);\n }\n\n const nsContext = context.appendNamespace(node.name.getText());\n const allTypes = this._typeChecker.getExportsOfModule(symbol).flatMap((prop) => {\n const decl = prop.declarations?.[0];\n if (decl == null) {\n return [];\n }\n return this._visitNode(decl, nsContext);\n });\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Leaving namespace: ${chalk.cyan([...context.namespace, name].join('.'))}`);\n }\n return allTypes;\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9998_UNSUPPORTED_NODE.create(ts.getNameOfDeclaration(node) ?? node, node.kind),\n );\n }\n\n if (!jsiiType) {\n return [];\n }\n\n // If symbolId hasn't been set yet, set it here\n if (!jsiiType.symbolId) {\n jsiiType.symbolId = this.getSymbolId(node);\n }\n\n // Let's quickly verify the declaration does not collide with a submodule. Submodules get case-adjusted for each\n // target language separately, so names cannot collide with case-variations.\n for (const submodule of this._submodules.keys()) {\n const candidates = Array.from(\n new Set([submodule.name, Case.camel(submodule.name), Case.pascal(submodule.name), Case.snake(submodule.name)]),\n );\n const colliding = candidates.find((name) => `${this.projectInfo.name}.${name}` === jsiiType!.fqn);\n if (colliding != null) {\n const submoduleDeclName = _nameOrDeclarationNode(submodule);\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5011_SUBMODULE_NAME_CONFLICT.create(\n ts.getNameOfDeclaration(node) ?? node,\n submodule.name,\n jsiiType.name,\n candidates,\n ).addRelatedInformationIf(submoduleDeclName, 'This is the conflicting submodule declaration'),\n );\n }\n }\n\n if (LOG.isInfoEnabled()) {\n LOG.info(`Registering JSII ${chalk.magenta(jsiiType.kind)}: ${chalk.green(jsiiType.fqn)}`);\n }\n this._types.set(jsiiType.fqn, jsiiType);\n jsiiType.locationInModule = this.declarationLocation(node);\n\n const type = this._typeChecker.getTypeAtLocation(node);\n if (type.symbol.exports) {\n const nestedContext = context.appendNamespace(type.symbol.name);\n const visitedNodes = this._typeChecker\n .getExportsOfModule(type.symbol)\n .filter((s) => s.declarations)\n .flatMap((exportedNode) => {\n const decl = exportedNode.valueDeclaration ?? exportedNode.declarations?.[0];\n if (decl == null) {\n return [];\n }\n return [this._visitNode(decl, nestedContext)];\n });\n for (const nestedTypes of visitedNodes) {\n for (const nestedType of nestedTypes) {\n if (nestedType.namespace !== nestedContext.namespace.join('.')) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5012_NAMESPACE_IN_TYPE.create(\n ts.getNameOfDeclaration(node) ?? node,\n jsiiType.fqn,\n nestedType.namespace!,\n ),\n );\n }\n }\n }\n }\n\n return [jsiiType];\n }\n\n private getSymbolId(node: ts.Node) {\n return symbolIdentifier(this._typeChecker, this._typeChecker.getTypeAtLocation(node).symbol);\n }\n\n private _validateHeritageClauses(clauses?: ts.NodeArray<ts.HeritageClause>) {\n if (clauses == null || clauses.length === 0) {\n // Nothing to do.\n return;\n }\n for (const clause of clauses) {\n for (const node of clause.types) {\n const parentType = this._typeChecker.getTypeAtLocation(node);\n if (parentType.symbol == null) {\n // The parent type won't have a symbol if it's an \"error type\" inserted by the type checker when the original\n // code contains a compilation error. In such cases, the TypeScript compiler will already have reported about\n // the incoherent declarations, so we'll just not re-validate it there (we'd fail anyway).\n continue;\n }\n // For some reason, we cannot trust parentType.isClassOrInterface()\n const badDecl = parentType.symbol.declarations?.find(\n (decl) =>\n !ts.isClassDeclaration(decl) && // <-- local classes\n !ts.isInterfaceDeclaration(decl) && // <-- local interfaces\n !ts.isModuleDeclaration(decl), // <-- imported types\n );\n if (badDecl != null) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3004_INVALID_SUPERTYPE.create(node, clause, badDecl).addRelatedInformation(\n badDecl,\n 'The invalid super type is declared here.',\n ),\n );\n }\n }\n }\n }\n\n private declarationLocation(node: ts.Declaration): spec.SourceLocation {\n const file = node.getSourceFile();\n const line = ts.getLineAndCharacterOfPosition(file, node.getStart()).line;\n const filename = path.normalize(path.relative(this.projectInfo.projectRoot, file.fileName)).replace(/\\\\/g, '/');\n return {\n filename,\n line: line + 1,\n };\n }\n\n private _processBaseInterfaces(fqn: string, baseTypes?: ts.Type[]) {\n const erasedBases = new Array<ts.Type>();\n if (!baseTypes) {\n return { erasedBases };\n }\n\n const result = new Array<spec.NamedTypeReference>();\n const baseInterfaces = new Set<ts.Type>();\n\n const processBaseTypes = (types: ts.Type[]) => {\n for (const iface of types) {\n // base is private/internal, so we continue recursively with it's own bases\n if (this._isPrivateOrInternal(iface.symbol) || isInternalSymbol(iface.symbol)) {\n erasedBases.push(iface);\n if (!isInternalSymbol(iface.symbol)) {\n const bases = iface.getBaseTypes();\n if (bases) {\n processBaseTypes(bases);\n }\n }\n continue;\n }\n\n baseInterfaces.add(iface);\n }\n };\n\n processBaseTypes(baseTypes);\n\n const typeRefs = Array.from(baseInterfaces).map((iface) => {\n const decl = iface.symbol.valueDeclaration;\n const typeRef = this._typeReference(iface, decl, 'base interface');\n return { decl, typeRef };\n });\n for (const { decl, typeRef } of typeRefs) {\n if (!spec.isNamedTypeReference(typeRef)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_3005_TYPE_USED_AS_INTERFACE.create(decl, typeRef));\n continue;\n }\n\n this._deferUntilTypesAvailable(fqn, [typeRef], decl, (deref) => {\n if (!spec.isInterfaceType(deref)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_3005_TYPE_USED_AS_INTERFACE.create(decl, typeRef));\n }\n });\n\n result.push(typeRef);\n }\n\n return {\n interfaces: result.length === 0 ? undefined : result,\n erasedBases,\n };\n }\n\n // eslint-disable-next-line complexity\n private _visitClass(type: ts.Type, ctx: EmitContext): spec.ClassType | undefined {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing class: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan(type.symbol.name)}`);\n }\n\n if (_hasInternalJsDocTag(type.symbol)) {\n return undefined;\n }\n\n this._warnAboutReservedWords(type.symbol);\n\n const fqn = `${[this.projectInfo.name, ...ctx.namespace].join('.')}.${type.symbol.name}`;\n\n if (Case.pascal(type.symbol.name) !== type.symbol.name) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8000_PASCAL_CASED_TYPE_NAMES.create(\n (type.symbol.valueDeclaration as ts.ClassDeclaration).name ??\n type.symbol.valueDeclaration ??\n type.symbol.declarations?.[0],\n type.symbol.name,\n ),\n );\n }\n\n const classDeclaration = type.symbol.valueDeclaration as ts.ClassDeclaration;\n for (const typeParam of classDeclaration.typeParameters ?? []) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1006_GENERIC_TYPE.create(typeParam));\n }\n\n const jsiiType: spec.ClassType = bindings.setClassRelatedNode(\n {\n assembly: this.projectInfo.name,\n fqn,\n kind: spec.TypeKind.Class,\n name: type.symbol.name,\n namespace: ctx.namespace.length > 0 ? ctx.namespace.join('.') : undefined,\n docs: this._visitDocumentation(type.symbol, ctx).docs,\n },\n classDeclaration,\n );\n\n if (_isAbstract(type.symbol, jsiiType)) {\n jsiiType.abstract = true;\n }\n\n const erasedBases = new Array<ts.BaseType>();\n for (let base of type.getBaseTypes() ?? []) {\n if (jsiiType.base) {\n // Ignoring this - there has already been a compilation error generated by tsc here.\n continue;\n }\n\n //\n // base classes (\"extends foo\")\n\n // Crawl up the inheritance tree if the current base type is not exported, so we identify the type(s) to be\n // erased, and identify the closest exported base class, should there be one.\n while (base && this._isPrivateOrInternal(base.symbol)) {\n LOG.debug(\n `Base class of ${chalk.green(jsiiType.fqn)} named ${chalk.green(\n base.symbol.name,\n )} is not exported, erasing it...`,\n );\n erasedBases.push(base);\n base = (base.getBaseTypes() ?? [])[0];\n }\n if (!base || isInternalSymbol(base.symbol)) {\n // There is no exported base class to be found, pretend this class has no base class.\n continue;\n }\n\n // eslint-disable-next-line no-await-in-loop\n const ref = this._typeReference(\n base,\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n 'base class',\n );\n\n if (!spec.isNamedTypeReference(ref)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3006_TYPE_USED_AS_CLASS.create(\n base.symbol.valueDeclaration ?? base.symbol.declarations?.[0],\n ref,\n ),\n );\n continue;\n }\n this._deferUntilTypesAvailable(fqn, [ref], base.symbol.valueDeclaration, (deref) => {\n if (!spec.isClassType(deref)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3006_TYPE_USED_AS_CLASS.create(\n base.symbol.valueDeclaration ?? base.symbol.declarations?.[0],\n ref,\n ),\n );\n }\n });\n jsiiType.base = ref.fqn;\n }\n\n //\n // base interfaces (\"implements foo\")\n\n // collect all \"implements\" declarations from the current type and all\n // erased base types (because otherwise we lose them, see jsii#487)\n const implementsClauses = new Array<ts.HeritageClause>();\n for (const heritage of [type, ...erasedBases].map(\n (t) => (t.symbol.valueDeclaration as ts.ClassDeclaration).heritageClauses ?? [],\n )) {\n for (const clause of heritage) {\n if (clause.token === ts.SyntaxKind.ExtendsKeyword) {\n // Handled by `getBaseTypes`\n continue;\n } else if (clause.token !== ts.SyntaxKind.ImplementsKeyword) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9998_UNSUPPORTED_NODE.create(\n clause,\n `Ignoring ${ts.SyntaxKind[clause.token]} heritage clause`,\n ),\n );\n continue;\n }\n\n implementsClauses.push(clause);\n }\n }\n\n // process all \"implements\" clauses\n const allInterfaces = new Set<string>();\n const baseInterfaces = implementsClauses.map((clause) =>\n this._processBaseInterfaces(\n fqn,\n clause.types.map((t) => this._getTypeFromTypeNode(t)),\n ),\n );\n for (const { interfaces } of baseInterfaces) {\n for (const ifc of interfaces ?? []) {\n allInterfaces.add(ifc.fqn);\n }\n if (interfaces) {\n this._deferUntilTypesAvailable(jsiiType.fqn, interfaces, type.symbol.valueDeclaration, (...ifaces) => {\n for (const iface of ifaces) {\n if (spec.isInterfaceType(iface) && iface.datatype) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3007_ILLEGAL_STRUCT_EXTENSION.create(\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n jsiiType,\n iface,\n ),\n );\n }\n }\n });\n }\n }\n\n if (allInterfaces.size > 0) {\n jsiiType.interfaces = Array.from(allInterfaces);\n }\n\n if (!type.isClass()) {\n throw new Error('Oh no');\n }\n\n const allDeclarations: Array<{\n decl: ts.Declaration;\n type: ts.InterfaceType | ts.BaseType;\n }> = (type.symbol.declarations ?? []).map((decl) => ({ decl, type }));\n\n // Considering erased bases' declarations, too, so they are \"blended in\"\n for (const base of erasedBases) {\n allDeclarations.push(\n ...(base.symbol.declarations ?? []).map((decl) => ({\n decl,\n type: base,\n })),\n );\n }\n\n for (const { decl, type: declaringType } of allDeclarations) {\n const classDecl = decl as ts.ClassDeclaration | ts.InterfaceDeclaration;\n if (!classDecl.members) {\n continue;\n }\n\n for (const memberDecl of classDecl.members) {\n if (ts.isSemicolonClassElement(memberDecl)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_9996_UNNECESSARY_TOKEN.create(memberDecl));\n continue;\n }\n\n const member = ts.isConstructorDeclaration(memberDecl)\n ? getConstructor(this._typeChecker.getTypeAtLocation(memberDecl.parent))\n : ts.isIndexSignatureDeclaration(memberDecl)\n ? type.symbol.members?.get(ts.InternalSymbolName.Index) ??\n type.symbol.exports?.get(ts.InternalSymbolName.Index)\n : this._typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(memberDecl) ?? memberDecl);\n\n if (member && this._isPrivateOrInternal(member, memberDecl as ts.ClassElement)) {\n continue;\n }\n\n if (ts.isIndexSignatureDeclaration(memberDecl)) {\n // Index signatures (static or not) are not supported in the jsii type model.\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1999_UNSUPPORTED.create(memberDecl, {\n what: 'Index signatures',\n suggestInternal: true,\n }),\n );\n continue;\n }\n\n if (!(declaringType.symbol.getDeclarations() ?? []).find((d) => d === memberDecl.parent)) {\n continue;\n }\n\n // constructors are handled later\n if (ts.isConstructorDeclaration(memberDecl)) {\n continue;\n }\n\n // eslint-disable-next-line no-await-in-loop\n if (ts.isMethodDeclaration(memberDecl) || ts.isMethodSignature(memberDecl)) {\n // eslint-disable-next-line no-await-in-loop\n this._visitMethod(member!, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), classDecl);\n } else if (\n ts.isPropertyDeclaration(memberDecl) ||\n ts.isPropertySignature(memberDecl) ||\n ts.isAccessor(memberDecl)\n ) {\n // eslint-disable-next-line no-await-in-loop\n this._visitProperty(member!, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), classDecl);\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9998_UNSUPPORTED_NODE.create(\n ts.getNameOfDeclaration(memberDecl) ?? memberDecl,\n memberDecl.kind,\n ),\n );\n }\n /* eslint-enable no-await-in-loop */\n }\n }\n\n const memberEmitContext = ctx.replaceStability(jsiiType.docs && jsiiType.docs.stability);\n\n // Find the first defined constructor in this class, or it's erased bases\n const constructor = [type, ...erasedBases].map(getConstructor).find((ctor) => ctor != null);\n const ctorDeclaration = constructor && (constructor.declarations?.[0] as ts.ConstructorDeclaration | undefined);\n if (constructor && ctorDeclaration) {\n const signature = this._typeChecker.getSignatureFromDeclaration(ctorDeclaration);\n\n if ((ts.getCombinedModifierFlags(ctorDeclaration) & ts.ModifierFlags.Private) === 0) {\n jsiiType.initializer = {\n locationInModule: this.declarationLocation(ctorDeclaration),\n };\n if (signature) {\n for (const param of signature.getParameters()) {\n jsiiType.initializer.parameters = jsiiType.initializer.parameters ?? [];\n\n const jsiiParam = // eslint-disable-next-line no-await-in-loop\n this._toParameter(param, ctx.replaceStability(jsiiType.docs?.stability));\n\n if (containsIntersection(jsiiParam.type)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1010_INTERSECTION_NOT_IN_CTOR.create(param.declarations?.[0]));\n }\n\n jsiiType.initializer.parameters.push(jsiiParam);\n jsiiType.initializer.variadic = jsiiType.initializer?.parameters?.some((p) => !!p.variadic) || undefined;\n jsiiType.initializer.protected =\n (ts.getCombinedModifierFlags(ctorDeclaration) & ts.ModifierFlags.Protected) !== 0 || undefined;\n }\n }\n this._verifyConsecutiveOptionals(ctorDeclaration, jsiiType.initializer.parameters);\n jsiiType.initializer.docs = this._visitDocumentation(constructor, memberEmitContext).docs;\n }\n\n // Process constructor-based property declarations even if constructor is private\n if (signature) {\n for (const param of signature.getParameters()) {\n const decl = param.valueDeclaration ?? param.declarations?.[0];\n\n if (decl && ts.isParameterPropertyDeclaration(decl, decl.parent) && !this._isPrivateOrInternal(param)) {\n // eslint-disable-next-line no-await-in-loop\n this._visitProperty(param, jsiiType, memberEmitContext, ctorDeclaration.parent);\n }\n }\n }\n } else if (jsiiType.base) {\n this._deferUntilTypesAvailable(fqn, [jsiiType.base], type.symbol.valueDeclaration, (baseType) => {\n if (spec.isClassType(baseType)) {\n jsiiType.initializer = baseType.initializer;\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL.create(\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n `Base type of ${jsiiType.fqn} (${jsiiType.base}) is not a class`,\n ),\n );\n }\n });\n } else {\n jsiiType.initializer = {\n docs: ctx.stability && { stability: ctx.stability },\n };\n }\n\n this._verifyNoStaticMixing(jsiiType, type.symbol.valueDeclaration ?? type.symbol.declarations?.[0]);\n\n return _sortMembers(jsiiType);\n }\n\n /**\n * Use the TypeChecker's getTypeFromTypeNode, but throw a descriptive error if it fails\n */\n private _getTypeFromTypeNode(t: ts.TypeNode) {\n const type = this._typeChecker.getTypeFromTypeNode(t);\n if (isErrorType(type)) {\n throw new JsiiError(\n `Unable to resolve type: ${t.getFullText()}. This typically happens if something is wrong with your dependency closure.`,\n );\n }\n return type;\n }\n\n /**\n * Check that this class doesn't declare any members that are of different staticness in itself or any of its bases\n */\n private _verifyNoStaticMixing(klass: spec.ClassType, decl: ts.Declaration | undefined) {\n // Check class itself--may have two methods/props with the same name, so check the arrays\n const statics = new Set(\n (klass.methods ?? [])\n .concat(klass.properties ?? [])\n .filter((x) => x.static)\n .map((x) => x.name),\n );\n const nonStatics = new Set(\n (klass.methods ?? [])\n .concat(klass.properties ?? [])\n .filter((x) => !x.static)\n .map((x) => x.name),\n );\n // Intersect\n for (const member of Sets.intersect(statics, nonStatics)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_5013_STATIC_INSTANCE_CONFLICT.create(decl, member, klass));\n }\n\n // Check against base classes. They will not contain duplicate member names so we can load\n // the members into a map.\n const classMembers = typeMembers(klass);\n this._withBaseClass(klass, decl, (base, recurse) => {\n for (const [name, baseMember] of Object.entries(typeMembers(base))) {\n const member = classMembers[name];\n if (!member) {\n continue;\n }\n\n if (!!baseMember.static !== !!member.static) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5014_INHERITED_STATIC_CONFLICT.create(decl, member, klass, baseMember, base),\n );\n }\n }\n\n recurse();\n });\n }\n\n /**\n * Wrapper around _deferUntilTypesAvailable, invoke the callback with the given classes' base type\n *\n * Does nothing if the given class doesn't have a base class.\n *\n * The second argument will be a `recurse` function for easy recursion up the inheritance tree\n * (no messing around with binding 'self' and 'this' and doing multiple calls to _withBaseClass.)\n */\n private _withBaseClass(\n klass: spec.ClassType,\n decl: ts.Declaration | undefined,\n cb: (base: spec.ClassType, recurse: () => void) => void,\n ) {\n if (klass.base) {\n this._deferUntilTypesAvailable(klass.fqn, [klass.base], decl, (base) => {\n if (!spec.isClassType(base)) {\n throw new Error('Oh no');\n }\n cb(base, () => this._withBaseClass(base, decl, cb));\n });\n }\n }\n\n /**\n * @returns true if this member is internal and should be omitted from the type manifest\n */\n private _isPrivateOrInternal(symbol: ts.Symbol, validateDeclaration?: ts.Declaration): boolean {\n const hasInternalJsDocTag = _hasInternalJsDocTag(symbol);\n const hasInternalSymbolName = isInternalSymbol(symbol);\n const hasUnderscorePrefix = !hasInternalSymbolName && symbol.name.startsWith('_');\n\n if (_isPrivate(symbol)) {\n LOG.trace(`${chalk.cyan(symbol.name)} is marked \"private\", or is an unexported type declaration`);\n return true;\n }\n\n // If all the declarations are marked with `@jsii ignore`, then this is effetcively private as far as jsii is concerned.\n if (\n symbol.declarations?.every((decl) => Directives.of(decl, (diag) => this._diagnostics.push(diag)).ignore != null)\n ) {\n return true;\n }\n\n if (!hasInternalJsDocTag && !hasUnderscorePrefix) {\n return false;\n }\n\n // We only validate if we have a declaration and the symbol doesn't have an internal name.\n if (validateDeclaration && !hasInternalSymbolName) {\n if (!hasUnderscorePrefix) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8005_INTERNAL_UNDERSCORE.create(\n ts.getNameOfDeclaration(validateDeclaration) ?? validateDeclaration,\n symbol.name,\n ),\n );\n }\n\n if (!hasInternalJsDocTag) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8006_UNDERSCORE_INTERNAL.create(\n ts.getNameOfDeclaration(validateDeclaration) ?? validateDeclaration,\n symbol.name,\n ),\n );\n }\n }\n\n return true;\n }\n\n private _visitEnum(type: ts.Type, ctx: EmitContext): spec.EnumType | undefined {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing enum: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan(type.symbol.name)}`);\n }\n\n // Forcefully resolving to the EnumDeclaration symbol for single-valued enums\n let decl: ts.Node | undefined = type.symbol.declarations?.[0];\n let symbol: ts.Symbol | undefined;\n if (decl && ts.isEnumMember(decl)) {\n decl = decl?.parent;\n }\n if (decl && ts.isEnumDeclaration(decl)) {\n symbol = getSymbolFromDeclaration(decl, this._typeChecker);\n }\n if (!decl || !symbol || !ts.isEnumDeclaration(decl)) {\n throw new JsiiError(`Unable to resolve enum declaration for ${type.symbol.name}!`);\n }\n\n if (_hasInternalJsDocTag(symbol)) {\n return undefined;\n }\n\n // check the enum to see if there are duplicate enum values\n this.assertNoDuplicateEnumValues(decl);\n\n this._warnAboutReservedWords(symbol);\n\n const flags = ts.getCombinedModifierFlags(decl);\n if (flags & ts.ModifierFlags.Const) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1000_NO_CONST_ENUM.create(\n decl.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.ConstKeyword) ?? decl,\n ),\n );\n }\n\n const { docs } = this._visitDocumentation(symbol, ctx);\n\n const typeContext = ctx.replaceStability(docs?.stability);\n const members = type.isUnion() ? type.types : [type];\n\n if (Case.pascal(symbol.name) !== symbol.name) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8000_PASCAL_CASED_TYPE_NAMES.create(\n (symbol.valueDeclaration as ts.EnumDeclaration).name,\n symbol.name,\n ),\n );\n }\n\n const jsiiType: spec.EnumType = bindings.setEnumRelatedNode(\n {\n assembly: this.projectInfo.name,\n fqn: `${[this.projectInfo.name, ...ctx.namespace].join('.')}.${symbol.name}`,\n kind: spec.TypeKind.Enum,\n members: members.map((m) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { docs } = this._visitDocumentation(m.symbol, typeContext);\n return { name: m.symbol.name, docs };\n }),\n name: symbol.name,\n namespace: ctx.namespace.length > 0 ? ctx.namespace.join('.') : undefined,\n docs,\n\n // Set SymbolId here instead of later, as by default TS will pick single-enum members\n // as the target symbol if possible.\n symbolId: symbolIdentifier(this._typeChecker, symbol),\n },\n decl,\n );\n\n return jsiiType;\n }\n\n private assertNoDuplicateEnumValues(decl: ts.EnumDeclaration): void {\n type EnumValue = {\n name: string;\n value: string;\n decl: ts.DeclarationName | undefined;\n };\n\n const enumValues = decl.members\n .filter((m) => m.initializer)\n .map((member): EnumValue => {\n return {\n value: member.initializer!.getText(),\n name: member.name.getText(),\n decl: ts.getNameOfDeclaration(member),\n };\n });\n\n const hasDuplicateEnumValues = enumValues.some(\n (val, _, arr) => arr.filter((e) => val.value === e.value).length > 1,\n );\n\n if (hasDuplicateEnumValues) {\n const enumValueMap = enumValues.reduce<Record<string, EnumValue[]>>((acc, val) => {\n if (!acc[val.value]) {\n acc[val.value] = [];\n }\n acc[val.value].push(val);\n return acc;\n }, {});\n for (const duplicateValue of Object.keys(enumValueMap)) {\n if (enumValueMap[duplicateValue].length > 1) {\n const err = JsiiDiagnostic.JSII_1004_DUPLICATE_ENUM_VALUE.create(\n enumValueMap[duplicateValue][0].decl!,\n duplicateValue,\n enumValueMap[duplicateValue].map((v) => v.name),\n );\n for (let i = 1; i < enumValueMap[duplicateValue].length; i++) {\n err.addRelatedInformation(enumValueMap[duplicateValue][i].decl!, 'The conflicting declaration is here');\n }\n this._diagnostics.push(err);\n }\n }\n }\n }\n\n /**\n * Return docs for a symbol\n */\n private _visitDocumentation(\n sym: ts.Symbol,\n context: EmitContext,\n ): { readonly docs?: spec.Docs; readonly hints: TypeSystemHints } {\n const result = parseSymbolDocumentation(sym, this._typeChecker);\n\n for (const diag of result.diagnostics ?? []) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_7999_DOCUMENTATION_ERROR.create(sym.valueDeclaration ?? sym.declarations?.[0], diag),\n );\n }\n\n const decl = sym.valueDeclaration ?? sym.declarations?.[0];\n // The @struct hint is only valid for interface declarations\n if (decl && !ts.isInterfaceDeclaration(decl) && result.hints.struct) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_7001_ILLEGAL_HINT.create(\n _findHint(decl, 'struct')!,\n 'struct',\n 'interfaces with only readonly properties',\n ).addRelatedInformationIf(ts.getNameOfDeclaration(decl) ?? decl, 'The annotated declaration is here'),\n );\n // Clean up the bad hint...\n delete (result.hints as any).struct;\n }\n\n // Apply the current context's stability if none was specified locally.\n if (result.docs.stability == null) {\n result.docs.stability = context.stability;\n }\n\n const allUndefined = Object.values(result.docs).every((v) => v === undefined);\n return {\n docs: !allUndefined ? result.docs : undefined,\n hints: result.hints,\n };\n }\n\n /**\n * Check that all parameters the doc block refers to with a @param declaration actually exist\n */\n private _validateReferencedDocParams(method: spec.Method, methodSym: ts.Symbol) {\n const params = getReferencedDocParams(methodSym);\n const actualNames = new Set((method.parameters ?? []).map((p) => p.name));\n for (const param of params) {\n if (!actualNames.has(param)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_7000_NON_EXISTENT_PARAMETER.create(\n methodSym.valueDeclaration ?? methodSym.declarations?.[0],\n method,\n param,\n ),\n );\n }\n }\n }\n\n private _visitInterface(type: ts.Type, ctx: EmitContext): spec.InterfaceType | undefined {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing interface: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan(type.symbol.name)}`);\n }\n\n if (_hasInternalJsDocTag(type.symbol)) {\n return undefined;\n }\n\n this._warnAboutReservedWords(type.symbol);\n\n const fqn = `${[this.projectInfo.name, ...ctx.namespace].join('.')}.${type.symbol.name}`;\n\n const { docs, hints } = this._visitDocumentation(type.symbol, ctx);\n const jsiiType: spec.InterfaceType = bindings.setInterfaceRelatedNode(\n {\n assembly: this.projectInfo.name,\n fqn,\n kind: spec.TypeKind.Interface,\n name: type.symbol.name,\n namespace: ctx.namespace.length > 0 ? ctx.namespace.join('.') : undefined,\n docs,\n },\n type.symbol.declarations?.[0] as ts.InterfaceDeclaration | undefined,\n );\n\n const { interfaces, erasedBases } = this._processBaseInterfaces(fqn, type.getBaseTypes());\n jsiiType.interfaces = apply(interfaces, (arr) => arr.map((i) => i.fqn));\n\n const typeDecl = (type.symbol.valueDeclaration ?? type.symbol.declarations?.[0]) as\n | ts.ClassLikeDeclaration\n | ts.InterfaceDeclaration\n | undefined;\n\n for (const typeParam of typeDecl?.typeParameters ?? []) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1006_GENERIC_TYPE.create(typeParam));\n }\n\n for (const decl of (typeDecl?.members as ReadonlyArray<ts.ClassElement | ts.TypeElement> | undefined)?.filter(\n (mem) => ts.isIndexSignatureDeclaration(mem),\n ) ?? []) {\n const sym =\n type.symbol.members?.get(ts.InternalSymbolName.Index) ?? type.symbol.exports?.get(ts.InternalSymbolName.Index);\n if (sym != null && this._isPrivateOrInternal(sym, decl)) {\n continue;\n }\n\n // Index signatures (static or not) are not supported in the jsii type model.\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1999_UNSUPPORTED.create(decl, { what: 'Index signatures', suggestInternal: true }),\n );\n }\n\n for (const declaringType of [type, ...erasedBases]) {\n for (const member of declaringType.getProperties()) {\n const decl = member.valueDeclaration ?? (member.declarations?.[0] as ts.PropertyDeclaration | undefined);\n\n if (!(declaringType.symbol.getDeclarations() ?? []).find((d) => d === decl?.parent)) {\n continue;\n }\n\n if (this._isPrivateOrInternal(member, decl)) {\n continue;\n }\n\n if (decl && (ts.isMethodDeclaration(decl) || ts.isMethodSignature(decl))) {\n // eslint-disable-next-line no-await-in-loop\n this._visitMethod(member, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), typeDecl);\n } else if (decl && (ts.isPropertyDeclaration(decl) || ts.isPropertySignature(decl) || ts.isAccessor(decl))) {\n // eslint-disable-next-line no-await-in-loop\n this._visitProperty(member, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), typeDecl);\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9998_UNSUPPORTED_NODE.create(\n _nameOrDeclarationNode(member),\n (member.valueDeclaration ?? member.declarations?.[0])?.kind ?? ts.SyntaxKind.Unknown,\n ),\n );\n }\n }\n }\n\n // Calculate datatype based on the datatypeness of this interface and all of its parents\n // To keep the spec minimal the actual values of the attribute are \"true\" or \"undefined\" (to represent \"false\").\n const declaration = type.symbol.valueDeclaration ?? type.symbol.declarations?.[0];\n this._deferUntilTypesAvailable(fqn, jsiiType.interfaces ?? [], declaration, (...bases: spec.Type[]) => {\n if ((jsiiType.methods ?? []).length === 0) {\n jsiiType.datatype = true;\n } else if (hints.struct) {\n this._diagnostics.push(\n jsiiType.methods!.reduce((diag, mthod) => {\n const node = bindings.getMethodRelatedNode(mthod);\n return node\n ? diag.addRelatedInformation(ts.getNameOfDeclaration(node) ?? node, 'A method is declared here')\n : diag;\n }, JsiiDiagnostic.JSII_7001_ILLEGAL_HINT.create(declaration && _findHint(declaration, 'struct')!, 'struct', 'interfaces with only readonly properties').addRelatedInformationIf(ts.getNameOfDeclaration(declaration) ?? declaration, 'The annotated declartion is here')),\n );\n }\n\n for (const base of bases) {\n if (spec.isInterfaceType(base) && !base.datatype) {\n jsiiType.datatype = undefined;\n }\n }\n\n const interfaceName = isInterfaceName(jsiiType.name);\n\n // If it's not a datatype the name must start with an \"I\".\n if (!jsiiType.datatype && !interfaceName) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8007_BEHAVIORAL_INTERFACE_NAME.create(\n ts.getNameOfDeclaration(declaration) ?? declaration,\n jsiiType.name,\n ),\n );\n }\n\n // NOTE: We need to be careful with the `I` prefix for behavioral interfaces, as this can mess with PascalCase\n // transformations, especially with short names such as `IA`, ...\n const expectedName = interfaceName ? `I${Case.pascal(type.symbol.name.slice(1))}` : Case.pascal(type.symbol.name);\n if (expectedName !== type.symbol.name) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8000_PASCAL_CASED_TYPE_NAMES.create(\n (type.symbol.declarations?.[0] as ts.InterfaceDeclaration | undefined)?.name,\n type.symbol.name,\n expectedName,\n ),\n );\n }\n\n // If the name starts with an \"I\" it is not intended as a datatype, so switch that off,\n // unless a TSDoc hint was set to force this to be considered a behavioral interface.\n if (jsiiType.datatype && interfaceName && !hints.struct) {\n delete jsiiType.datatype;\n }\n\n // Okay, this is a data type, check that all properties are readonly\n if (jsiiType.datatype) {\n for (const prop of jsiiType.properties ?? []) {\n if (!prop.immutable) {\n const p = type.getProperty(prop.name)!;\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3008_STRUCT_PROPS_MUST_BE_READONLY.create(\n _nameOrDeclarationNode(p),\n p.name,\n jsiiType,\n ),\n );\n\n // force property to be \"readonly\" since jsii languages will pass this by-value\n prop.immutable = true;\n }\n }\n } else {\n // This is *NOT* a data type, so it may not extend something that is one.\n for (const base of bases) {\n if (!spec.isInterfaceType(base)) {\n // Invalid type we already warned about earlier, just ignoring it here..\n continue;\n }\n if (base.datatype) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3007_ILLEGAL_STRUCT_EXTENSION.create(\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n jsiiType,\n base,\n ),\n );\n }\n }\n }\n });\n\n // Check that no interface declares a member that's already declared\n // in a base type (not allowed in C#).\n const names = memberNames(jsiiType);\n const checkNoIntersection = (...bases: spec.Type[]) => {\n for (const base of bases) {\n if (!spec.isInterfaceType(base)) {\n continue;\n }\n\n const baseMembers = memberNames(base);\n for (const memberName of names) {\n if (baseMembers.includes(memberName)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5015_REDECLARED_INTERFACE_MEMBER.create(\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n memberName,\n jsiiType,\n ),\n );\n }\n }\n // Recurse upwards\n this._deferUntilTypesAvailable(fqn, base.interfaces ?? [], type.symbol.valueDeclaration, checkNoIntersection);\n }\n };\n this._deferUntilTypesAvailable(fqn, jsiiType.interfaces ?? [], type.symbol.valueDeclaration, checkNoIntersection);\n\n return _sortMembers(jsiiType);\n }\n\n private _visitMethod(\n symbol: ts.Symbol,\n type: spec.ClassType | spec.InterfaceType,\n ctx: EmitContext,\n declaringTypeDecl: ts.ClassLikeDeclaration | ts.InterfaceDeclaration | undefined,\n ) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing method: ${chalk.green(type.fqn)}#${chalk.cyan(symbol.name)}`);\n }\n\n const declaration = symbol.valueDeclaration as ts.MethodDeclaration | ts.MethodSignature;\n const signature = this._typeChecker.getSignatureFromDeclaration(declaration);\n if (!signature) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9004_UNABLE_TO_COMPUTE_SIGNATURE.create(declaration, symbol.name, type),\n );\n return;\n }\n\n if (type.name === Case.pascal(symbol.name)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5019_MEMBER_TYPE_NAME_CONFLICT.create(\n declaration.name,\n 'method',\n symbol,\n type,\n ).addRelatedInformationIf(\n declaringTypeDecl?.name ?? declaringTypeDecl,\n `The declaring ${type.kind} is introduced here`,\n ),\n );\n }\n\n if (isProhibitedMemberName(symbol.name)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_5016_PROHIBITED_MEMBER_NAME.create(declaration.name, symbol.name));\n return;\n }\n this._warnAboutReservedWords(symbol);\n\n const parameters = signature.getParameters().map((p) => this._toParameter(p, ctx));\n const returnType = signature.getReturnType();\n const method: spec.Method = bindings.setMethodRelatedNode(\n {\n abstract: _isAbstract(symbol, type) || undefined,\n name: symbol.name,\n parameters: parameters.length > 0 ? parameters : undefined,\n protected: _isProtected(symbol) || undefined,\n returns: _isVoid(returnType)\n ? undefined\n : this._optionalValue(returnType, declaration.type ?? declaration.name, 'return type'),\n async: _isPromise(returnType) || undefined,\n static: _isStatic(symbol) || undefined,\n locationInModule: this.declarationLocation(declaration),\n },\n declaration,\n );\n method.variadic = method.parameters?.some((p) => !!p.variadic) === true ? true : undefined;\n\n this._verifyConsecutiveOptionals(declaration, method.parameters);\n\n method.docs = this._visitDocumentation(symbol, ctx).docs;\n\n // If the last parameter is a datatype, verify that it does not share any field names with\n // other function arguments, so that it can be turned into keyword arguments by jsii frontends\n // that support such.\n const lastParamTypeRef = apply(last(parameters), (x) => x.type);\n const lastParamSymbol = last(signature.getParameters());\n if (lastParamTypeRef && spec.isNamedTypeReference(lastParamTypeRef)) {\n this._deferUntilTypesAvailable(\n symbol.name,\n [lastParamTypeRef],\n lastParamSymbol!.declarations?.[0],\n (lastParamType) => {\n if (!spec.isInterfaceType(lastParamType) || !lastParamType.datatype) {\n return;\n }\n\n // Liftable datatype, make sure no parameter names match any of the properties in the datatype\n const propNames = this.allProperties(lastParamType);\n const paramNames = new Set(parameters.slice(0, parameters.length - 1).map((x) => x.name));\n const sharedNames = Sets.intersection(propNames, paramNames);\n\n for (const badName of sharedNames) {\n this._diagnostics.push(JsiiDiagnostic.JSII_5017_POSITIONAL_KEYWORD_CONFLICT.create(declaration, badName));\n }\n },\n );\n }\n\n this._validateReferencedDocParams(method, symbol);\n\n type.methods = type.methods ?? [];\n if (type.methods.find((m) => m.name === method.name && m.static === method.static) != null) {\n LOG.trace(`Dropping re-declaration of ${chalk.green(type.fqn)}#${chalk.cyan(method.name)}`);\n return;\n }\n type.methods.push(method);\n }\n\n private _warnAboutReservedWords(symbol: ts.Symbol) {\n if (!enabledWarnings['reserved-word']) {\n return;\n }\n\n const reservingLanguages = isReservedName(symbol.name);\n if (reservingLanguages) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5018_RESERVED_WORD.create(_nameOrDeclarationNode(symbol), symbol.name, reservingLanguages),\n );\n }\n }\n\n private _visitProperty(\n symbol: ts.Symbol,\n type: spec.ClassType | spec.InterfaceType,\n ctx: EmitContext,\n declaringTypeDecl: ts.ClassLikeDeclaration | ts.InterfaceDeclaration | undefined,\n ) {\n if (type.properties?.find((p) => p.name === symbol.name)) {\n /*\n * Second declaration of the same property. For example, if code specifies a getter & setter signature,\n * there will be one pass for each of the signatures, but we can process only the first encountered. The\n * typescript compiler will take care of making sure we don't have conflicting declarations, anyway.\n */\n return;\n }\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing property: ${chalk.green(type.fqn)}#${chalk.cyan(symbol.name)}`);\n }\n\n const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];\n const signature = declaration as\n | ts.PropertySignature\n | ts.PropertyDeclaration\n | ts.AccessorDeclaration\n | ts.ParameterPropertyDeclaration;\n\n if (type.name === Case.pascal(symbol.name)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5019_MEMBER_TYPE_NAME_CONFLICT.create(\n signature.name,\n 'property',\n symbol,\n type,\n ).addRelatedInformationIf(\n declaringTypeDecl?.name ?? declaringTypeDecl,\n `The declaring ${type.kind} is introduced here`,\n ),\n );\n }\n\n if (isProhibitedMemberName(symbol.name)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5016_PROHIBITED_MEMBER_NAME.create(\n symbol.valueDeclaration ?? symbol.declarations?.[0],\n symbol.name,\n ),\n );\n return;\n }\n\n this._warnAboutReservedWords(symbol);\n\n const property: spec.Property = bindings.setPropertyRelatedNode(\n {\n ...this._optionalValue(\n this._typeChecker.getTypeOfSymbolAtLocation(symbol, signature),\n signature.type ?? signature.name,\n 'property type',\n ),\n abstract: _isAbstract(symbol, type) || undefined,\n name: symbol.name,\n protected: _isProtected(symbol) || undefined,\n static: _isStatic(symbol) || undefined,\n locationInModule: this.declarationLocation(signature),\n },\n signature,\n );\n\n if (ts.isGetAccessor(signature)) {\n property.immutable = true;\n for (const decl of symbol.getDeclarations() ?? []) {\n if (!ts.isSetAccessor(decl)) {\n continue;\n }\n delete property.immutable;\n\n // Verify the setter doesn't have a Separate Write Type (SWT)\n const valueParam = decl.parameters[0];\n if (valueParam?.type == null) {\n // If there is no type node, there can't be a SWT\n continue;\n }\n const paramType = this._typeChecker.getTypeFromTypeNode(valueParam.type);\n const paramOptionalValue = this._optionalValue(paramType, valueParam.type, 'parameter type');\n\n if (\n property.optional !== paramOptionalValue.optional ||\n describeTypeReference(property.type) !== describeTypeReference(paramOptionalValue.type)\n ) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1005_SEPARATE_WRITE_TYPE.create(valueParam.type).addRelatedInformation(\n signature.type ?? signature.name,\n 'The getter signature is declared here',\n ),\n );\n }\n }\n } else {\n property.immutable = (ts.getCombinedModifierFlags(signature) & ts.ModifierFlags.Readonly) !== 0 || undefined;\n }\n\n if (signature.questionToken) {\n property.optional = true;\n }\n\n if (property.static && property.immutable && ts.isPropertyDeclaration(signature) && signature.initializer) {\n property.const = true;\n }\n\n property.docs = this._visitDocumentation(symbol, ctx).docs;\n\n type.properties = type.properties ?? [];\n if (type.properties.find((prop) => prop.name === property.name && prop.static === property.static) != null) {\n LOG.trace(`Dropping re-declaration of ${chalk.green(type.fqn)}#${chalk.cyan(property.name)}`);\n return;\n }\n type.properties.push(property);\n }\n\n private _toParameter(paramSymbol: ts.Symbol, ctx: EmitContext): spec.Parameter {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing parameter: ${chalk.cyan(paramSymbol.name)}`);\n }\n const paramDeclaration = paramSymbol.valueDeclaration as ts.ParameterDeclaration;\n\n this._warnAboutReservedWords(paramSymbol);\n\n const parameter: spec.Parameter = bindings.setParameterRelatedNode(\n {\n ...this._optionalValue(\n this._typeChecker.getTypeAtLocation(paramDeclaration),\n paramDeclaration.type ?? paramDeclaration.name,\n 'parameter type',\n ),\n name: paramSymbol.name,\n variadic: paramDeclaration.dotDotDotToken && true,\n },\n paramDeclaration,\n );\n\n if (parameter.variadic && spec.isCollectionTypeReference(parameter.type)) {\n // TypeScript types variadic parameters as an array, but JSII uses the item-type instead.\n parameter.type = parameter.type.collection.elementtype;\n } else if (paramDeclaration.initializer || paramDeclaration.questionToken) {\n // Optional parameters have an inherently null-able type.\n parameter.optional = true;\n }\n\n parameter.docs = this._visitDocumentation(\n paramSymbol,\n ctx.removeStability(), // No inheritance on purpose\n ).docs;\n\n // Don't rewrite doc comment here on purpose -- instead, we add them as '@param'\n // into the parent's doc comment.\n\n return parameter;\n }\n\n private _typeReference(type: ts.Type, declaration: ts.Node | undefined, purpose: TypeUseKind): spec.TypeReference {\n const optionalValue = this._optionalValue(type, declaration, purpose);\n if (optionalValue.optional) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL.create(\n declaration,\n 'Encountered optional value in location where a plain type reference is expected',\n ),\n );\n }\n return optionalValue.type;\n }\n\n private _optionalValue(type: ts.Type, declaration: ts.Node | undefined, purpose: TypeUseKind): spec.OptionalValue {\n const isThisType = _isThisType(type, this._typeChecker, declaration?.parent);\n\n if (type.isLiteral() && _isEnumLike(type)) {\n type = this._typeChecker.getBaseTypeOfLiteralType(type);\n } else {\n type = this._typeChecker.getApparentType(type);\n }\n\n const primitiveType = _tryMakePrimitiveType.call(this);\n if (primitiveType) {\n return { type: primitiveType };\n }\n\n if (type.isUnion() && !_isEnumLike(type)) {\n return _setType.call(this, 'union');\n }\n\n if (type.isIntersection()) {\n this.usedFeatures.add('intersection-types');\n const ret = _setType.call(this, 'intersection');\n const intersectionType = ret.type as spec.IntersectionTypeReference;\n\n this.validateIntersectionType(intersectionType, declaration);\n\n return ret;\n }\n\n if ((type.getFlags() & ts.TypeFlags.Never) !== 0) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1007_NEVER_TYPE.create(declaration));\n return { type: spec.CANONICAL_ANY };\n }\n\n if (!type.symbol) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1001_TYPE_HAS_NO_SYMBOL.create(declaration));\n return { type: spec.CANONICAL_ANY };\n }\n\n if (type.symbol.name === 'Array') {\n return { type: _arrayType.call(this) };\n }\n\n if (type.symbol.name === '__type' && type.symbol.members) {\n return { type: _mapType.call(this) };\n }\n\n if (type.symbol.escapedName === 'Promise') {\n const typeRef = type as ts.TypeReference;\n if (!typeRef.typeArguments || typeRef.typeArguments.length !== 1) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1002_UNSPECIFIED_PROMISE.create(declaration));\n return { type: spec.CANONICAL_ANY };\n }\n return {\n type: this._typeReference(typeRef.typeArguments[0], declaration, purpose),\n };\n }\n\n const fqn = this._getFQN(type, declaration, purpose, isThisType);\n if (fqn == null) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9997_UNKNOWN_ERROR.create(declaration, new Error('Could not determine FQN')),\n );\n return { type: { fqn: '' } };\n }\n\n return {\n type: { fqn },\n };\n\n function _arrayType(this: Assembler): spec.CollectionTypeReference {\n const typeRef = type as ts.TypeReference;\n let elementtype: spec.TypeReference;\n\n if (typeRef.typeArguments?.length === 1) {\n elementtype = this._typeReference(typeRef.typeArguments[0], declaration, 'list element type');\n } else {\n const count = typeRef.typeArguments ? typeRef.typeArguments.length : 'none';\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1003_UNSUPPORTED_TYPE.create(\n declaration,\n `Array references must have exactly one type argument (found ${count})`,\n ),\n );\n elementtype = spec.CANONICAL_ANY;\n }\n\n return {\n collection: {\n elementtype,\n kind: spec.CollectionKind.Array,\n },\n };\n }\n\n function _mapType(this: Assembler): spec.CollectionTypeReference {\n let elementtype: spec.TypeReference;\n const objectType = type.getStringIndexType();\n if (objectType) {\n elementtype = this._typeReference(objectType, declaration, 'map element type');\n } else {\n const typeDecl = type.symbol.declarations?.[0];\n if (\n typeDecl != null &&\n ts.isTypeLiteralNode(typeDecl) &&\n typeDecl.members.length == 1 &&\n ts.isIndexSignatureDeclaration(typeDecl.members[0]) &&\n typeDecl.members[0].parameters[0].type != null &&\n ts.isTemplateLiteralTypeNode(typeDecl.members[0].parameters[0].type)\n ) {\n const indexTypeNode = typeDecl.members[0].type;\n const indexType = this._typeChecker.getTypeFromTypeNode(indexTypeNode);\n elementtype = this._typeReference(indexType, indexTypeNode, 'map element type');\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1003_UNSUPPORTED_TYPE.create(\n declaration,\n 'Only string-indexed map types are supported',\n ),\n );\n elementtype = spec.CANONICAL_ANY;\n }\n }\n return {\n collection: {\n elementtype,\n kind: spec.CollectionKind.Map,\n },\n };\n }\n\n function _tryMakePrimitiveType(this: Assembler): spec.PrimitiveTypeReference | undefined {\n if (!type.symbol) {\n if (type.flags & ts.TypeFlags.Object) {\n if (isTupleType(type as ts.ObjectType)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1999_UNSUPPORTED.create(declaration, { what: 'Tuple types', alternative: 'arrays' }),\n );\n }\n\n return { primitive: spec.PrimitiveType.Json };\n }\n if (type.flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) {\n return spec.CANONICAL_ANY;\n }\n } else if (\n type.symbol.valueDeclaration &&\n isUnder(type.symbol.valueDeclaration.getSourceFile().fileName, this.stdlib)\n ) {\n switch (type.symbol.name) {\n case 'Boolean':\n return { primitive: spec.PrimitiveType.Boolean };\n case 'Date':\n return { primitive: spec.PrimitiveType.Date };\n case 'Number':\n return { primitive: spec.PrimitiveType.Number };\n case 'String':\n return { primitive: spec.PrimitiveType.String };\n }\n }\n // Not a primitive type!\n return undefined;\n }\n\n function _setType(this: Assembler, field: 'union' | 'intersection'): spec.OptionalValue {\n const types = new Array<spec.TypeReference>();\n let optional: boolean | undefined;\n\n for (const subType of (type as ts.UnionType).types) {\n if (subType.flags & ts.TypeFlags.Undefined) {\n optional = true;\n continue;\n }\n // eslint-disable-next-line no-await-in-loop\n const resolvedType = this._typeReference(subType, declaration, purpose);\n if (types.some((ref) => deepEqual(ref, resolvedType))) {\n continue;\n }\n types.push(resolvedType);\n }\n\n const returnedType: spec.UnionTypeReference | spec.IntersectionTypeReference = {\n [field]: { types },\n } as any;\n return types.length === 1 ? { optional, type: types[0] } : { optional, type: returnedType };\n }\n }\n\n /**\n * Validate the restrictions on an intersection type reference\n *\n * - Type only consists of (behavioral) interface types\n * - For all types referenced in the intersection, the definitions of all shared\n * members must match exactly.\n */\n private validateIntersectionType(intersectionType: spec.IntersectionTypeReference, declaration: ts.Node | undefined) {\n // Validate that this intersection type only consists of interface types\n this._deferUntilTypesAvailable('', intersectionType.intersection.types, declaration, (...elementTypes) => {\n const requestedFqns = new Set(intersectionType.intersection.types.map(typeReferenceToString));\n const resolvedFqns = new Set(elementTypes.map((t) => t.fqn));\n\n const unresolved = Sets.diff(requestedFqns, resolvedFqns);\n if (unresolved.size > 0) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1008_ONLY_INTERFACE_INTERSECTION.create(declaration, Array.from(unresolved).join(', ')),\n );\n }\n\n const nonBehavioral = elementTypes.filter((t) => !isBehavioralInterfaceType(t));\n if (nonBehavioral.length > 0) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1008_ONLY_INTERFACE_INTERSECTION.create(\n declaration,\n nonBehavioral.map((t) => t.fqn).join(', '),\n ),\n );\n }\n\n // Check that shared members are the same\n const interfaces = elementTypes.filter(isBehavioralInterfaceType);\n const allProps = Sets.union(...interfaces.map((int) => this.allProperties(int)));\n const allMethods = Sets.union(...interfaces.map((int) => this.allMethods(int)));\n\n for (let i = 1; i < interfaces.length; i++) {\n let int0 = interfaces[0];\n let int1 = interfaces[i];\n\n for (const prop of allProps) {\n const p1 = int0.properties?.find((p) => p.name === prop);\n const p2 = int1.properties?.find((p) => p.name === prop);\n const diff = this.comparePropForIntersection(p1, p2);\n if (diff) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1011_INTERSECTION_MEMBER_DIFFERENT.create(\n declaration,\n prop,\n int0.name,\n diff[0],\n int1.name,\n diff[1],\n ),\n );\n }\n }\n\n for (const meth of allMethods) {\n const m1 = int0.methods?.find((p) => p.name === meth);\n const m2 = int1.methods?.find((p) => p.name === meth);\n const diff = this.compareMethodForIntersection(m1, m2);\n if (diff) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1011_INTERSECTION_MEMBER_DIFFERENT.create(\n declaration,\n meth,\n int0.name,\n diff[0],\n int1.name,\n diff[1],\n ),\n );\n }\n }\n }\n });\n }\n\n private comparePropForIntersection(\n a: spec.Property | undefined,\n b: spec.Property | undefined,\n ): [string, string] | undefined {\n if (!a || !b) {\n return undefined;\n }\n\n if (!typeReferenceEqual(a.type, b.type)) {\n return [typeReferenceToString(a.type), typeReferenceToString(b.type)];\n }\n\n return (\n cmpDesc(a.static, b.static, (s) => (s ? 'static' : 'instance member')) ??\n cmpDesc(a.optional, b.optional, (o) => (o ? 'optional' : 'required')) ??\n cmpDesc(a.abstract, b.abstract, (s) => (s ? 'abstract' : 'concrete'))\n );\n }\n\n private compareMethodForIntersection(\n a: spec.Method | undefined,\n b: spec.Method | undefined,\n ): [string, string] | undefined {\n if (!a || !b) {\n return undefined;\n }\n\n if (a.returns && b.returns) {\n if (!typeReferenceEqual(a.returns.type, b.returns.type)) {\n return [typeReferenceToString(a.returns.type), typeReferenceToString(b.returns.type)];\n }\n\n const x = cmpDesc(a.returns.optional, b.returns.optional, (o) =>\n o ? 'return type optional' : 'return type required',\n );\n if (x) {\n return x;\n }\n }\n\n const paramsA = a.parameters ?? [];\n const paramsB = b.parameters ?? [];\n if (paramsA.length !== paramsB.length) {\n return [`${paramsA.length} parameters`, `${paramsB.length} parameters`];\n }\n for (let i = 0; i < paramsA.length; i++) {\n const p1 = paramsA[i];\n const p2 = paramsB[i];\n\n if (!typeReferenceEqual(p1.type, p2.type)) {\n return [typeReferenceToString(p1.type), typeReferenceToString(p2.type)];\n }\n\n const x =\n cmpDesc(p1.optional, p2.optional, (o) => (o ? `parameter ${i + 1} optional` : `parameter ${i + 1} required`)) ??\n cmpDesc(p1.variadic, p2.variadic, (v) =>\n v ? `parameter ${i + 1} variadic` : `parameter ${i + 1} not variadic`,\n );\n if (x) {\n return x;\n }\n }\n\n return (\n cmpDesc(a.abstract, b.abstract, (s) => (s ? 'abstract' : 'concrete')) ??\n cmpDesc(a.async, b.async, (s) => (s ? 'async' : 'async')) ??\n cmpDesc(a.protected, b.protected, (p) => (p ? 'protected' : 'public')) ??\n cmpDesc(a.variadic, b.variadic, (v) => (v ? 'variadic' : 'non-variadic')) ??\n cmpDesc(a.static, b.static, (s) => (s ? 'static' : 'instance member'))\n );\n }\n\n private callDeferredsInOrder() {\n // Do a topological call order of all deferreds.\n while (this._deferred.length > 0) {\n // All fqns in dependency lists that don't have any pending\n // deferreds themselves can be executed now, so are removed from\n // dependency lists.\n const pendingFqns = new Set<string>(this._deferred.map((x) => x.fqn).filter((x) => x));\n for (const deferred of this._deferred) {\n restrictDependenciesTo(deferred, pendingFqns);\n }\n\n // Invoke all deferreds with no more dependencies and remove them from the list.\n let invoked = false;\n for (let i = 0; i < this._deferred.length; i++) {\n if (this._deferred[i].dependedFqns.length === 0) {\n const deferred = this._deferred.splice(i, 1)[0];\n deferred.cb();\n invoked = true;\n }\n }\n\n if (!invoked) {\n // Apparently we're stuck. Complain loudly.\n throw new Error(\n `Could not invoke any more deferreds, cyclic dependency? Remaining: ${JSON.stringify(\n this._deferred,\n undefined,\n 2,\n )}`,\n );\n }\n }\n\n /**\n * Retain only elements in the dependencyfqn that are also in the set\n */\n function restrictDependenciesTo(def: DeferredRecord, fqns: Set<string>) {\n def.dependedFqns = def.dependedFqns.filter(fqns.has.bind(fqns));\n }\n }\n\n /**\n * Return the set of all (inherited) properties of an interface\n */\n private allProperties(root: spec.InterfaceType): Set<string> {\n return this.allInterfacesRecursively(root, (int) => {\n return (int.properties ?? []).map((p) => p.name);\n });\n }\n\n /**\n * Return the set of all (inherited) methods of an interface\n */\n private allMethods(root: spec.InterfaceType): Set<string> {\n return this.allInterfacesRecursively(root, (int) => {\n return (int.methods ?? []).map((p) => p.name);\n });\n }\n\n private allInterfacesRecursively<T>(root: spec.InterfaceType, cb: (x: spec.InterfaceType) => Iterable<T>): Set<T> {\n const ret = new Set<T>();\n recurse.call(this, root);\n return ret;\n\n function recurse(this: Assembler, int: spec.InterfaceType) {\n for (const x of cb(int)) {\n ret.add(x);\n }\n\n for (const baseRef of int.interfaces ?? []) {\n const base = this._dereference(baseRef, undefined, 'used-in-syntax');\n if (!base) {\n throw new Error('Impossible to have unresolvable base in allInterfacesRecursively()');\n }\n if (!spec.isInterfaceType(base)) {\n throw new Error('Impossible to have non-interface base in allInterfacesRecursively()');\n }\n\n recurse.call(this, base);\n }\n }\n }\n\n private _verifyConsecutiveOptionals(node: ts.Node, parameters?: spec.Parameter[]) {\n if (!parameters) {\n return;\n }\n\n const remaining = [...parameters].reverse();\n while (remaining.length > 0) {\n const current = remaining.pop()!;\n if (current.optional) {\n const offender = remaining.find((p) => !p.optional && !p.variadic);\n if (offender == null) {\n continue;\n }\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3009_OPTIONAL_PARAMETER_BEFORE_REQUIRED.create(node, current, offender),\n );\n delete current.optional;\n }\n }\n }\n\n /**\n * Updates the runtime type info with the fully-qualified name for the current class definition.\n * Used by the runtime type info injector to add this information to the compiled file.\n */\n private registerExportedClassFqn(clazz: ts.ClassDeclaration, fqn: string) {\n this.runtimeTypeInfoInjector.registerClassFqn(clazz, fqn);\n }\n\n /**\n * Return only those submodules from the submodules list that are submodules inside this\n * assembly.\n */\n private mySubmodules() {\n return Array.from(this._submodules.values()).filter((m) => m.fqn.startsWith(`${this.projectInfo.name}.`));\n }\n\n private findPackageInfo(fromDir: string): PackageJson | undefined {\n if (this._packageInfoCache.has(fromDir)) {\n return this._packageInfoCache.get(fromDir);\n }\n\n const packageInfo = _findPackageInfo.call(this, fromDir);\n this._packageInfoCache.set(fromDir, packageInfo);\n return packageInfo;\n\n function _findPackageInfo(this: Assembler, dir: string): PackageJson | undefined {\n const filePath = path.join(dir, 'package.json');\n if (fs.existsSync(filePath)) {\n return JSON.parse(fs.readFileSync(filePath, 'utf-8'));\n }\n const parent = path.dirname(dir);\n if (parent === dir) {\n return undefined;\n }\n return this.findPackageInfo(parent);\n }\n }\n\n /**\n * Validate types against input/output positions in functions and APIs\n *\n * Currently used to validate that intersection types are only used in input position,\n * not output position\n */\n private validateTypesAgainstPositions() {\n const self = this;\n\n const validatedFqns = {\n in: new Set<string>(),\n out: new Set<string>(),\n };\n\n for (const type of this._types.values()) {\n if (spec.isClassType(type)) {\n for (const ctorParam of type.initializer?.parameters ?? []) {\n validateRefFor.call(this, 'in', ctorParam.type, `a constructor parameter of ${type.name}`);\n }\n }\n if (spec.isClassType(type) || isBehavioralInterfaceType(type)) {\n for (const property of type.properties ?? []) {\n validateRefFor.call(this, 'out', property.type, `type of property ${type.name}.${property.name}`);\n }\n\n for (const method of type.methods ?? []) {\n for (const param of method.parameters ?? []) {\n validateRefFor.call(this, 'in', param.type, `a parameter of method ${type.name}.${method.name}()`);\n }\n if (method.returns) {\n validateRefFor.call(\n this,\n 'out',\n method.returns.type,\n `return type of method ${type.name}.${method.name}()`,\n );\n }\n }\n }\n }\n\n function validateRefFor(dir: 'in' | 'out', typeRef: spec.TypeReference, reason: string) {\n visitTypeReference(typeRef, {\n named: (ref) => {\n // Named types we'll only validate once for every direction\n if (validatedFqns[dir].has(ref.fqn)) {\n return;\n }\n validatedFqns[dir].add(ref.fqn);\n\n const type = self._dereference(ref, undefined, 'just-validating');\n if (!type) {\n // Maybe this is an unexported type.\n return;\n }\n validateTypeFor(dir, type, reason);\n },\n primitive: () => {},\n collection: (ref) => {\n validateRefFor(dir, ref.collection.elementtype, reason);\n },\n union: (ref) => {\n for (const t of ref.union.types) {\n validateRefFor(dir, t, reason);\n }\n },\n intersection: (ref) => {\n if (dir === 'out') {\n self._diagnostics.push(JsiiDiagnostic.JSII_1009_INTERSECTION_ONLY_INPUT.createDetached(reason));\n }\n\n for (const t of ref.intersection.types) {\n validateRefFor(dir, t, reason);\n }\n },\n });\n }\n\n function validateTypeFor(dir: 'in' | 'out', type: spec.Type, reason: string) {\n visitType(type, {\n dataType: (t) => {\n // We only need to validate data types, because classes and interfaces\n // are done as part of the main loop.\n //\n // Recurse.\n for (const prop of t.properties ?? []) {\n validateRefFor(dir, prop.type, `type of property ${t.name}.${prop.name}, ${reason}`);\n }\n },\n classType: () => {},\n interfaceType: () => {},\n enumType: () => {},\n });\n }\n }\n}\n\nexport interface AssemblerOptions {\n /**\n * Whether to remove `@deprecated` members from the generated assembly.\n *\n * @default false\n */\n readonly stripDeprecated?: boolean;\n\n /**\n * If `stripDeprecated` is true, and a file is provided here, only the FQNs\n * present in the file will actually be removed. This can be useful when\n * you wish to deprecate some elements without actually removing them.\n *\n * @default undefined\n */\n readonly stripDeprecatedAllowListFile?: string;\n\n /**\n * Whether to inject code that warns when a deprecated element is used.\n *\n * @default false\n */\n readonly addDeprecationWarnings?: boolean;\n\n /**\n * Whether to compress the assembly.\n *\n * @default false\n */\n readonly compressAssembly?: boolean;\n}\n\ninterface SubmoduleSpec {\n /**\n * The submodule's fully qualified name.\n */\n readonly fqn: string;\n\n /**\n * The submodule's fully qualified name prefix to use when resolving type FQNs. This does not\n * include \"inline namespace\" names as those are already represented in the TypeCheckers' view of\n * the type names.\n */\n readonly fqnResolutionPrefix: string;\n\n /**\n * The location of the submodule definition in the source.\n */\n readonly locationInModule: spec.SourceLocation;\n\n /**\n * Symbol identifier of the root of the root file that represents this submodule\n */\n readonly symbolId?: string;\n\n /**\n * Any customized configuration for the currentl submodule.\n */\n readonly targets?: spec.AssemblyTargets;\n\n /**\n * Readme for this submodule (if found)\n */\n readonly readme?: spec.ReadMe;\n}\n\nfunction _fingerprint(assembly: spec.Assembly): spec.Assembly {\n delete (assembly as any).fingerprint;\n assembly = sortJson(assembly);\n const fingerprint = crypto.createHash('sha256').update(JSON.stringify(assembly)).digest('base64');\n return { ...assembly, fingerprint };\n}\n\nfunction _isAbstract(symbol: ts.Symbol, declaringType: spec.ClassType | spec.InterfaceType): boolean {\n // everything is abstract in interfaces\n if (declaringType.kind === spec.TypeKind.Interface) {\n return true;\n }\n\n return (\n !!symbol.valueDeclaration &&\n (ts.getCombinedModifierFlags(symbol.valueDeclaration) & ts.ModifierFlags.Abstract) !== 0\n );\n}\n\nfunction _isEnumLike(type: ts.Type): type is ts.EnumType {\n return (type.flags & ts.TypeFlags.EnumLike) !== 0;\n}\n\nfunction _isExported(node: ts.Declaration): boolean {\n return (ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) !== 0;\n}\n\n/**\n * Members with names starting with `_` (and marked as @internal) and members\n * that are private are hidden.\n *\n * @param symbol the symbol which should be assessed\n *\n * @return `true` if the symbol should be hidden\n */\nfunction _isPrivate(symbol: ts.Symbol): boolean {\n // Private identifiers are always private...\n if (symbol.name.startsWith('#')) {\n return true;\n }\n\n const TYPE_DECLARATION_KINDS = new Set([\n ts.SyntaxKind.ClassDeclaration,\n ts.SyntaxKind.InterfaceDeclaration,\n ts.SyntaxKind.EnumDeclaration,\n ]);\n\n // if the symbol doesn't have a value declaration, we are assuming it's a type (enum/interface/class)\n // and check that it has an \"export\" modifier\n if (\n !isInternalSymbol(symbol) &&\n (!symbol.valueDeclaration || TYPE_DECLARATION_KINDS.has(symbol.valueDeclaration.kind))\n ) {\n let hasExport = false;\n for (const decl of symbol.declarations ?? []) {\n if (ts.getCombinedModifierFlags(decl) & ts.ModifierFlags.Export) {\n hasExport = true;\n break;\n }\n // Handle nested classes from project references\n if (ts.isModuleBlock(decl.parent)) {\n const moduleDeclaration = decl.parent.parent;\n const modifiers = ts.getCombinedModifierFlags(moduleDeclaration);\n // The trick is the module is declared as ambient & exported\n if ((modifiers & ts.ModifierFlags.Ambient) !== 0 && (modifiers & ts.ModifierFlags.Export) !== 0) {\n hasExport = true;\n break;\n }\n }\n }\n return !hasExport;\n }\n\n const decl = symbol.valueDeclaration ?? symbol.declarations?.[0];\n\n return decl != null && (ts.getCombinedModifierFlags(decl) & ts.ModifierFlags.Private) !== 0;\n}\n\nfunction _hasInternalJsDocTag(symbol: ts.Symbol) {\n return symbol.getJsDocTags().some((t: any) => t.name === 'internal');\n}\n\nfunction _isProtected(symbol: ts.Symbol): boolean {\n return (\n !!symbol.valueDeclaration &&\n (ts.getCombinedModifierFlags(symbol.valueDeclaration) & ts.ModifierFlags.Protected) !== 0\n );\n}\n\nfunction _isStatic(symbol: ts.Symbol): boolean {\n return (\n !!symbol.valueDeclaration && (ts.getCombinedModifierFlags(symbol.valueDeclaration) & ts.ModifierFlags.Static) !== 0\n );\n}\n\n/**\n * Determines whether a given type is void or Promise<void>.\n *\n * @param type the tested type\n *\n * @returns `true` if the type is void or Promise<void>\n */\nfunction _isVoid(type: ts.Type): boolean {\n if (_isPromise(type)) {\n const typeRef = type as ts.TypeReference;\n return typeRef.typeArguments != null && typeRef.typeArguments.length === 1 && _isVoid(typeRef.typeArguments[0]);\n }\n return (type.flags & ts.TypeFlags.Void) !== 0;\n}\n\nfunction _isPromise(type: ts.Type): boolean {\n return type.symbol?.escapedName === 'Promise';\n}\n\nfunction _sortMembers(type: spec.ClassType): spec.ClassType;\nfunction _sortMembers(type: spec.InterfaceType): spec.InterfaceType;\nfunction _sortMembers(type: spec.ClassType | spec.InterfaceType): spec.ClassType | spec.InterfaceType {\n type.methods = type.methods && _sort(type.methods);\n type.properties = type.properties && _sort(type.properties);\n return type;\n\n /**\n * Sorts a member array such that:\n * 1. Static members appear first\n * 2. Immutable members appear first\n * 3. Non-optional members appear first\n * 4. Members appear in lexicographical order\n *\n * @param values the array of members to be sorted\n *\n * @return a sorted copy of ``values``\n */\n function _sort<T extends TypeMember>(values: T[]): T[] {\n if (!values) {\n return values;\n }\n return values.sort(_comparator);\n\n function _comparator(lval: T, rval: T): number {\n return _format(lval).localeCompare(_format(rval));\n\n function _format(val: T): string {\n return [val.static ? '0' : '1', val.immutable ? '0' : '1', !val.optional ? '0' : '1', val.name].join('|');\n }\n }\n }\n type TypeMember = {\n name?: string; // Methods & Properties\n static?: boolean; // Methods & Properties\n immutable?: boolean; // Properties\n optional?: boolean; // Properties\n };\n}\n\n/**\n * Deferred processing that needs to happen in a second, ordered pass\n */\ninterface DeferredRecord {\n /**\n * The FQN of the type the action will be executed on\n */\n fqn: string;\n\n /**\n * Dependency FQNs of the types that need to be processed before analysis.\n *\n * All deferred analysis actions for the types listed here must be complete\n * before this analysis action can run.\n */\n dependedFqns: string[];\n\n /**\n * Callback representing the action to run.\n */\n cb: () => void;\n}\n\n/**\n * Return the last element from a list\n */\nfunction last<T>(xs: T[]): T | undefined {\n return xs.length > 0 ? xs[xs.length - 1] : undefined;\n}\n\n/**\n * Apply a function to a value if it's not equal to undefined\n */\nfunction apply<T, U>(x: T | undefined, fn: (x: T) => U | undefined): U | undefined {\n return x !== undefined ? fn(x) : undefined;\n}\n\n/**\n * Return all members names of a JSII interface type\n *\n * Returns empty string for a non-interface type.\n */\nfunction memberNames(jsiiType: spec.InterfaceType | spec.ClassType): string[] {\n return Object.keys(typeMembers(jsiiType)).filter((n) => n !== '');\n}\n\nfunction typeMembers(jsiiType: spec.InterfaceType | spec.ClassType): {\n [key: string]: spec.Property | spec.Method;\n} {\n const ret: { [key: string]: spec.Property | spec.Method } = {};\n\n for (const prop of jsiiType.properties ?? []) {\n ret[prop.name] = prop;\n }\n\n for (const method of jsiiType.methods ?? []) {\n ret[method.name ?? ''] = method;\n }\n\n return ret;\n}\n\n/**\n * Whether or not the given name is conventionally an interface name\n *\n * It's an interface name if it starts with I and has another capital\n * (so we don't mark IonicColumnProps as an interface).\n */\nfunction isInterfaceName(name: string) {\n return name.length >= 2 && name.startsWith('I') && name.charAt(1).toUpperCase() === name.charAt(1);\n}\n\nfunction getConstructor(type: ts.Type): ts.Symbol | undefined {\n return type.symbol.members?.get(ts.InternalSymbolName.Constructor);\n}\n\nfunction cmpDesc<T>(a: T, b: T, desc: (x: T) => string): [string, string] | undefined {\n const desc1 = desc(a);\n const desc2 = desc(b);\n return desc1 !== desc2 ? [desc1, desc2] : undefined;\n}\n\nfunction noEmptyDict<T>(xs: Record<string, T> | undefined): Record<string, T> | undefined {\n if (xs == null || Object.keys(xs).length === 0) {\n return undefined;\n }\n return xs;\n}\n\nfunction toDependencyClosure(assemblies: readonly spec.Assembly[]): {\n [name: string]: spec.DependencyConfiguration;\n} {\n const result: { [name: string]: spec.DependencyConfiguration } = {};\n for (const assembly of assemblies) {\n if (!assembly.targets) {\n continue;\n }\n result[assembly.name] = {\n submodules: cleanUp(assembly.submodules),\n targets: assembly.targets,\n };\n }\n return result;\n\n /**\n * Removes unneeded fields from the entries part of the `dependencyClosure`\n * property. Fields such as `readme` are not necessary and can bloat up the\n * assembly object.\n *\n * This removes the `readme` and `locationInModule` fields from the submodule\n * descriptios if present.\n *\n * @param submodules the submodules list to clean up.\n *\n * @returns the cleaned up submodules list.\n */\n function cleanUp(submodules: spec.Assembly['submodules']): spec.DependencyConfiguration['submodules'] {\n if (submodules == null) {\n return submodules;\n }\n const clean: spec.DependencyConfiguration['submodules'] = {};\n for (const [fqn, { targets }] of Object.entries(submodules)) {\n clean[fqn] = { targets };\n }\n return clean;\n }\n}\n\nfunction toSubmoduleDeclarations(submodules: Iterable<SubmoduleSpec>): spec.Assembly['submodules'] {\n const result: spec.Assembly['submodules'] = {};\n\n for (const submodule of submodules) {\n result[submodule.fqn] = {\n locationInModule: submodule.locationInModule,\n targets: submodule.targets,\n readme: submodule.readme,\n symbolId: submodule.symbolId,\n };\n }\n\n return result;\n}\n\n/**\n * Check whether this type is the intrinsic TypeScript \"error type\"\n *\n * This type is returned if type lookup fails. Unfortunately no public\n * accessors for it are exposed.\n */\nfunction isErrorType(t: ts.Type) {\n return (t as any).intrinsicName === 'error';\n}\n\n/**\n * Those have specific semantics in certain languages that don't always translate cleanly in others\n * (like how equals/hashCode are not a thing in Javascript, but carry meaning in Java and C#). The\n * `build` name is reserved for generated code (Java builders use that).\n */\nconst PROHIBITED_MEMBER_NAMES = ['build', 'equals', 'hashcode'];\n\n/**\n * Whether the given name is prohibited\n */\nfunction isProhibitedMemberName(name: string) {\n return PROHIBITED_MEMBER_NAMES.includes(name.toLowerCase());\n}\n\n/**\n * Information about the context in which a declaration is emitted.\n */\nclass EmitContext {\n public constructor(public readonly namespace: readonly string[], public readonly stability?: spec.Stability) {}\n\n /**\n * Create a new EmitContext by appending a namespace entry at the end.\n * @param element the new namespace entry.\n */\n public appendNamespace(element: string) {\n return new EmitContext([...this.namespace, element], this.stability);\n }\n\n /**\n * Create a new EmitContext by replacing the stability.\n * @param stability the new stability, if available.\n */\n public replaceStability(stability?: spec.Stability) {\n if (!stability) {\n return this;\n }\n return new EmitContext(this.namespace, stability);\n }\n\n /**\n * Create a new EmitContext without stability.\n */\n public removeStability() {\n return new EmitContext(this.namespace, undefined);\n }\n}\n\nfunction inferRootDir(program: ts.Program): string | undefined {\n const directories = program\n .getRootFileNames()\n .filter((fileName) => {\n const sourceFile = program.getSourceFile(fileName);\n return (\n sourceFile != null &&\n !program.isSourceFileFromExternalLibrary(sourceFile) &&\n !program.isSourceFileDefaultLibrary(sourceFile)\n );\n })\n .map((fileName) => path.relative(program.getCurrentDirectory(), path.dirname(fileName)))\n .map(segmentPath);\n\n const maxPrefix = Math.min(...directories.map((segments) => segments.length - 1));\n let commonIndex = -1;\n while (commonIndex < maxPrefix && new Set(directories.map((segments) => segments[commonIndex + 1])).size === 1) {\n commonIndex++;\n }\n\n if (commonIndex < 0) {\n return undefined;\n }\n\n return directories[0][commonIndex];\n\n function segmentPath(fileName: string): string[] {\n const result = new Array<string>();\n for (let parent = fileName; parent !== path.dirname(parent); parent = path.dirname(parent)) {\n result.unshift(parent);\n }\n return result;\n }\n}\n\n/**\n * Determines whether the provided type is a single-valued enum. It is necessary\n * to check as enums are union-like in the type model, and single-valued enum\n * types are actually reduced to the only available literal, which can trip\n * the assembler.\n *\n * @param type the type being checked.\n * @param typeChecker the type checker to use to get more information.\n *\n * @return `true` if `type` is a single-valued enum type.\n */\nfunction isSingleValuedEnum(type: ts.Type, typeChecker: ts.TypeChecker): type is ts.EnumType {\n if (type.isLiteral() && _isEnumLike(type)) {\n // Single-Valued enums are reduced to the only literal available.\n return type === typeChecker.getBaseTypeOfLiteralType(type);\n }\n return false;\n}\n\n/**\n * Checks is the provided type is \"this\" (as a type annotation).\n *\n * @param type the validated type.\n * @param typeChecker the type checker.\n *\n * @returns `true` iif the type is `this`\n */\nfunction _isThisType(type: ts.Type, typeChecker: ts.TypeChecker, enclosingDeclaration: ts.Node | undefined): boolean {\n return (\n typeChecker.typeToTypeNode(type, enclosingDeclaration, ts.NodeBuilderFlags.None)?.kind === ts.SyntaxKind.ThisKeyword\n );\n}\n\n/**\n * Gets the name node for a given symbol; or it's first declaration if no name can be found. This is\n * intended for use in placing problem markers on the right location.\n *\n * @param symbol the symbol for which the name node is needed.\n *\n * @returns the name node for the symbol, or the symbol's first declaration.\n */\nfunction _nameOrDeclarationNode(symbol: ts.Symbol): ts.Node | undefined {\n const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];\n if (declaration == null) {\n return undefined;\n }\n return ts.getNameOfDeclaration(declaration) ?? declaration;\n}\n\nfunction _findHint(decl: ts.Declaration, hint: string): ts.JSDocTag | undefined {\n const [node] = ts.getAllJSDocTags(decl, (tag): tag is ts.JSDocTag => tag.tagName.text === hint);\n return node;\n}\n\nfunction containsIntersection(type: spec.TypeReference): boolean {\n if (spec.isIntersectionTypeReference(type)) {\n return true;\n }\n if (spec.isUnionTypeReference(type)) {\n return type.union.types.some(containsIntersection);\n }\n if (spec.isCollectionTypeReference(type)) {\n return containsIntersection(type.collection.elementtype);\n }\n return false;\n}\n\n/**\n * A location where a type can be used.\n */\ntype TypeUseKind =\n | 'base class'\n | 'base interface'\n | 'list element type'\n | 'map element type'\n | 'parameter type'\n | 'property type'\n | 'return type';\n\n/**\n * Resolve a Type to Symbol, taking into account single-valued enums which have a bug\n *\n * Bug reference: https://github.com/microsoft/TypeScript/issues/46755\n */\nfunction symbolFromType(type: ts.Type, typeChecker: ts.TypeChecker): ts.Symbol {\n if ((type.flags & ts.TypeFlags.EnumLiteral) === 0) {\n return type.symbol;\n }\n\n const decl = type.symbol.declarations?.[0];\n if (!decl) {\n return type.symbol;\n }\n\n if (!ts.isEnumMember(decl)) {\n return type.symbol;\n }\n\n const parentDecl = decl.parent;\n if (!parentDecl || !ts.isEnumDeclaration(parentDecl)) {\n return type.symbol;\n }\n\n const name = ts.getNameOfDeclaration(parentDecl);\n if (!name) {\n return type.symbol;\n }\n return typeChecker.getSymbolAtLocation(name) ?? type.symbol;\n}\n\nconst SYMBOLID_CACHE = new WeakMap<spec.Assembly, Record<string, string>>();\n\n/**\n * Build and return an index of { symbolId -> fqn }\n *\n * Uses a cache for performance reasons.\n */\nfunction symbolIdIndex(asm: spec.Assembly): Record<string, string> {\n const existing = SYMBOLID_CACHE.get(asm);\n if (existing) {\n return existing;\n }\n\n const ret = buildIndex();\n SYMBOLID_CACHE.set(asm, ret);\n return ret;\n\n function buildIndex() {\n const index: Record<string, string> = {};\n for (const [fqn, type] of Object.entries(asm.types ?? {})) {\n if (type.symbolId) {\n index[type.symbolId] = fqn;\n }\n }\n return index;\n }\n}\n\nfunction getSymbolFromDeclaration(decl: ts.Declaration, typeChecker: ts.TypeChecker): ts.Symbol | undefined {\n const name = ts.getNameOfDeclaration(decl);\n return name ? typeChecker.getSymbolAtLocation(name) : undefined;\n}\n\nfunction isTupleType(type: ts.ObjectType): type is ts.TupleType {\n if (type.objectFlags & ts.ObjectFlags.Tuple) {\n return true;\n }\n\n if (type.objectFlags & ts.ObjectFlags.Reference) {\n return isTupleType((type as ts.TypeReference).target);\n }\n\n return false;\n}\n\nfunction isUnder(file: string, dir: string): boolean {\n const relative = path.relative(dir, file);\n return !relative.startsWith(path.sep) && !relative.startsWith('..');\n}\n\nfunction loadAndRenderReadme(readmePath: string, projectRoot: string) {\n if (!fs.existsSync(readmePath)) {\n return undefined;\n }\n\n return {\n markdown: literate\n .includeAndRenderExamples(\n literate.loadFromFile(readmePath),\n literate.fileSystemLoader(path.dirname(readmePath)),\n projectRoot,\n )\n .join('\\n'),\n };\n}\n\nconst INTERNAL_SYMBOLS = new Set(Object.values(ts.InternalSymbolName));\nfunction isInternalSymbol(symbol: ts.Symbol): boolean {\n return INTERNAL_SYMBOLS.has(symbol.name as ts.InternalSymbolName);\n}\n"]}
1
+ {"version":3,"file":"assembler.js","sourceRoot":"","sources":["../src/assembler.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,8BAA8B;AAC9B,kCAAkC;AAClC,mCAAmC;AACnC,qCAA+F;AAC/F,+BAA+B;AAC/B,iDAAiD;AACjD,iCAAiC;AACjC,iCAAiC;AAEjC,+BAA+B;AAC/B,kDAAsD;AACtD,6CAA0C;AAC1C,iCAA2F;AAE3F,uCAAgD;AAChD,uDAAmD;AACnD,uCAAuC;AACvC,4CAA4C;AAE5C,qDAAkD;AAClD,iCAA8B;AAC9B,wEAAoE;AACpE,4EAAgF;AAChF,4DAAoE;AACpE,8CAA0D;AAC1D,qDAA6E;AAC7E,iDAA0F;AAC1F,mCAAoC;AACpC,2CAAwC;AACxC,uCAAmD;AACnD,yCAA6C;AAE7C,qGAAqG;AACrG,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEtC,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAE/C;;GAEG;AACH,MAAa,SAAS;IA8BpB;;;;OAIG;IACH,YACkB,WAAwB,EACvB,MAAiB,EAClB,OAAmB,EACnB,MAAc,EAC9B,UAA4B,EAAE;QAJd,gBAAW,GAAX,WAAW,CAAa;QACvB,WAAM,GAAN,MAAM,CAAW;QAClB,YAA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I,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;QAChD,OAAO,WAAW,CAAE,IAAyB,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,OAAO,CAAC,IAAY,EAAE,GAAW;IACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,mBAAmB,CAAC,UAAkB,EAAE,WAAmB;IAClE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,QAAQ;aACf,wBAAwB,CACvB,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,EACjC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,EACnD,WAAW,CACZ;aACA,IAAI,CAAC,IAAI,CAAC;KACd,CAAC;AACJ,CAAC;AAED,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;AACvE,SAAS,gBAAgB,CAAC,MAAiB;IACzC,OAAO,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,IAA6B,CAAC,CAAC;AACpE,CAAC","sourcesContent":["import * as crypto from 'node:crypto';\nimport * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as spec from '@jsii/spec';\nimport { describeTypeReference, writeAssembly, SPEC_FILE_NAME, PackageJson } from '@jsii/spec';\nimport * as chalk from 'chalk';\nimport * as deepEqual from 'fast-deep-equal/es6';\nimport * as log4js from 'log4js';\nimport * as ts from 'typescript';\n\nimport * as Case from './case';\nimport { symbolIdentifier } from './common/symbol-id';\nimport { Directives } from './directives';\nimport { getReferencedDocParams, parseSymbolDocumentation, TypeSystemHints } from './docs';\nimport { Emitter } from './emitter';\nimport { normalizeConfigPath } from './helpers';\nimport { JsiiDiagnostic } from './jsii-diagnostic';\nimport * as literate from './literate';\nimport * as bindings from './node-bindings';\nimport { ProjectInfo } from './project-info';\nimport { isReservedName } from './reserved-words';\nimport { Sets } from './sets';\nimport { DeprecatedRemover } from './transforms/deprecated-remover';\nimport { DeprecationWarningsInjector } from './transforms/deprecation-warnings';\nimport { RuntimeTypeInfoInjector } from './transforms/runtime-info';\nimport { combinedTransformers } from './transforms/utils';\nimport { typeReferenceEqual, typeReferenceToString } from './type-reference';\nimport { isBehavioralInterfaceType, visitType, visitTypeReference } from './type-visitor';\nimport { JsiiError } from './utils';\nimport { Validator } from './validator';\nimport { SHORT_VERSION, VERSION } from './version';\nimport { enabledWarnings } from './warnings';\n\n// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports\nconst sortJson = require('sort-json');\n\nconst LOG = log4js.getLogger('jsii/assembler');\n\n/**\n * The JSII Assembler consumes a ``ts.Program`` instance and emits a JSII assembly.\n */\nexport class Assembler implements Emitter {\n private readonly runtimeTypeInfoInjector: RuntimeTypeInfoInjector;\n private readonly deprecatedRemover?: DeprecatedRemover;\n private readonly warningsInjector?: DeprecationWarningsInjector;\n\n private readonly mainFile: string;\n private readonly tscRootDir?: string;\n private readonly compressAssembly?: boolean;\n private readonly usedFeatures = new Set<spec.JsiiFeature>();\n\n private readonly _typeChecker: ts.TypeChecker;\n\n private _diagnostics = new Array<JsiiDiagnostic>();\n private _deferred = new Array<DeferredRecord>();\n private readonly _types = new Map<string, spec.Type>();\n private readonly _packageInfoCache = new Map<string, PackageJson | undefined>();\n\n /** Map of Symbol to namespace export Symbol */\n private readonly _submoduleMap = new Map<ts.Symbol, ts.Symbol>();\n\n /**\n * Submodule information\n *\n * Contains submodule information for all namespaces that have been seen\n * across all assemblies (this and dependencies).\n *\n * Filtered to local submodules only at time of writing the assembly out to disk.\n */\n private readonly _submodules = new Map<ts.Symbol, SubmoduleSpec>();\n\n /**\n * @param projectInfo information about the package being assembled\n * @param program the TypeScript program to be assembled from\n * @param stdlib the directory where the TypeScript stdlib is rooted\n */\n public constructor(\n public readonly projectInfo: ProjectInfo,\n private readonly system: ts.System,\n public readonly program: ts.Program,\n public readonly stdlib: string,\n options: AssemblerOptions = {},\n ) {\n this._typeChecker = this.program.getTypeChecker();\n\n if (options.stripDeprecated) {\n let allowlistedDeprecations: Set<string> | undefined;\n if (options.stripDeprecatedAllowListFile) {\n if (!fs.existsSync(options.stripDeprecatedAllowListFile)) {\n throw new JsiiError(`--strip-deprecated file not found: ${options.stripDeprecatedAllowListFile}`);\n }\n allowlistedDeprecations = new Set<string>(\n fs.readFileSync(options.stripDeprecatedAllowListFile, 'utf8').split('\\n'),\n );\n }\n\n this.deprecatedRemover = new DeprecatedRemover(this._typeChecker, allowlistedDeprecations);\n }\n\n if (options.addDeprecationWarnings) {\n this.warningsInjector = new DeprecationWarningsInjector(this._typeChecker);\n }\n\n this.compressAssembly = options.compressAssembly;\n\n const dts = projectInfo.types;\n let mainFile = dts.replace(/\\.d\\.ts(x?)$/, '.ts$1');\n\n // If out-of-source build was configured (tsc's outDir and rootDir), the\n // main file's path needs to be re-rooted from the outDir into the rootDir.\n // outDir might be also be absolute, so we need to normalize it.\n const tscOutDir = normalizeConfigPath(projectInfo.projectRoot, program.getCompilerOptions().outDir);\n if (tscOutDir != null) {\n mainFile = path.relative(tscOutDir, mainFile);\n\n // rootDir may be set explicitly or not. If not, inferRootDir replicates\n // tsc's behavior of using the longest prefix of all built source files.\n this.tscRootDir = program.getCompilerOptions().rootDir ?? inferRootDir(program);\n if (this.tscRootDir != null) {\n mainFile = path.join(this.tscRootDir, mainFile);\n }\n }\n\n this.mainFile = path.resolve(projectInfo.projectRoot, mainFile);\n this.runtimeTypeInfoInjector = new RuntimeTypeInfoInjector(projectInfo.version);\n }\n\n public get customTransformers(): ts.CustomTransformers {\n return combinedTransformers(\n this.deprecatedRemover?.customTransformers ?? {},\n this.runtimeTypeInfoInjector.makeTransformers(),\n this.warningsInjector?.customTransformers ?? {},\n );\n }\n\n /**\n * Attempt emitting the JSII assembly for the program.\n *\n * @return the result of the assembly emission.\n */\n public emit(): ts.EmitResult {\n if (!this.projectInfo.description) {\n this._diagnostics.push(JsiiDiagnostic.JSII_0001_PKG_MISSING_DESCRIPTION.createDetached());\n }\n if (!this.projectInfo.homepage) {\n this._diagnostics.push(JsiiDiagnostic.JSII_0002_PKG_MISSING_HOMEPAGE.createDetached());\n }\n const readme = _loadReadme.call(this);\n if (readme == null) {\n this._diagnostics.push(JsiiDiagnostic.JSII_0003_MISSING_README.createDetached());\n }\n const docs = _loadDocs.call(this);\n\n const sourceFile = this.program.getSourceFile(this.mainFile);\n\n if (sourceFile == null) {\n this._diagnostics.push(JsiiDiagnostic.JSII_0004_COULD_NOT_FIND_ENTRYPOINT.createDetached(this.mainFile));\n } else {\n this._registerDependenciesNamespaces(sourceFile);\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(\n `Processing source file: ${chalk.blue(path.relative(this.projectInfo.projectRoot, sourceFile.fileName))}`,\n );\n }\n const symbol = this._typeChecker.getSymbolAtLocation(sourceFile);\n if (symbol) {\n const moduleExports = this._typeChecker.getExportsOfModule(symbol);\n moduleExports.map((item) => this._registerNamespaces(item, this.projectInfo.projectRoot));\n for (const node of moduleExports) {\n const decl = node.declarations?.[0];\n if (decl == null) {\n continue;\n }\n this._visitNode(decl, new EmitContext([], this.projectInfo.stability));\n }\n }\n }\n\n this.callDeferredsInOrder();\n\n this.validateTypesAgainstPositions();\n\n // Skip emitting if any diagnostic message is an error\n if (this._diagnostics.find((diag) => diag.category === ts.DiagnosticCategory.Error) != null) {\n LOG.debug('Skipping emit due to errors.');\n try {\n return { diagnostics: this._diagnostics, emitSkipped: true };\n } finally {\n // Clearing ``this._diagnostics`` to allow contents to be garbage-collected.\n this._afterEmit();\n }\n }\n\n const jsiiVersion = this.projectInfo.jsiiVersionFormat === 'short' ? SHORT_VERSION : VERSION;\n\n const assembly: spec.Assembly = {\n schema: spec.SchemaVersion.LATEST,\n name: this.projectInfo.name,\n version: this.projectInfo.version,\n description: this.projectInfo.description ?? this.projectInfo.name,\n license: this.projectInfo.license,\n keywords: this.projectInfo.keywords && Array.from(this.projectInfo.keywords),\n homepage: this.projectInfo.homepage ?? this.projectInfo.repository.url,\n author: this.projectInfo.author,\n contributors: this.projectInfo.contributors && [...this.projectInfo.contributors],\n repository: this.projectInfo.repository,\n dependencies: noEmptyDict({\n ...this.projectInfo.dependencies,\n ...this.projectInfo.peerDependencies,\n }),\n dependencyClosure: noEmptyDict(toDependencyClosure(this.projectInfo.dependencyClosure)),\n bundled: this.projectInfo.bundleDependencies,\n types: Object.fromEntries(this._types),\n submodules: noEmptyDict(toSubmoduleDeclarations(this.mySubmodules())),\n targets: this.projectInfo.targets,\n metadata: {\n ...this.projectInfo.metadata,\n\n // Downstream consumers need this to map a symbolId in the outDir to a\n // symbolId in the rootDir.\n tscRootDir: this.tscRootDir,\n },\n docs,\n readme,\n jsiiVersion,\n bin: this.projectInfo.bin,\n fingerprint: '<TBD>',\n usedFeatures: _assemblyFeatures(this.usedFeatures), // might be appended later\n };\n\n if (this.deprecatedRemover) {\n this._diagnostics.push(...this.deprecatedRemover.removeFrom(assembly));\n }\n\n if (this.warningsInjector) {\n const jsiiMetadata = {\n ...(assembly.metadata?.jsii ?? {}),\n ...{ compiledWithDeprecationWarnings: true },\n };\n\n if (assembly.metadata) {\n assembly.metadata.jsii = jsiiMetadata;\n } else {\n assembly.metadata = { jsii: jsiiMetadata };\n }\n this.warningsInjector.process(assembly, this.projectInfo);\n }\n\n const validator = new Validator(this.projectInfo, assembly);\n const validationResult = validator.emit();\n\n // Inject detected features\n if (validationResult.usedFeatures) {\n for (const item of validationResult.usedFeatures) {\n this.usedFeatures.add(item);\n }\n assembly.usedFeatures = _assemblyFeatures(this.usedFeatures);\n }\n\n if (!validationResult.emitSkipped) {\n const zipped = writeAssembly(this.projectInfo.projectRoot, _fingerprint(assembly), {\n compress: this.compressAssembly ?? false,\n });\n LOG.trace(\n `${zipped ? 'Zipping' : 'Emitting'} assembly: ${chalk.blue(\n path.join(this.projectInfo.projectRoot, SPEC_FILE_NAME),\n )}`,\n );\n }\n\n try {\n return {\n diagnostics: [...this._diagnostics, ...validationResult.diagnostics],\n emitSkipped: validationResult.emitSkipped,\n };\n } finally {\n this._afterEmit();\n }\n\n function _assemblyFeatures(usedFeatures: Set<spec.JsiiFeature>): spec.JsiiFeature[] | undefined {\n return usedFeatures.size > 0 ? Array.from(usedFeatures).sort() : undefined;\n }\n\n function _loadReadme(this: Assembler) {\n // Search for `README.md` in a case-insensitive way\n const fileName = fs\n .readdirSync(this.projectInfo.projectRoot)\n .find((file) => file.toLocaleLowerCase() === 'readme.md');\n if (fileName == null) {\n return undefined;\n }\n const readmePath = path.join(this.projectInfo.projectRoot, fileName);\n return loadAndRenderReadme(readmePath, this.projectInfo.projectRoot);\n }\n\n function _loadDocs(this: Assembler): spec.Docs | undefined {\n if (!this.projectInfo.stability && !this.projectInfo.deprecated) {\n return undefined;\n }\n const deprecated = this.projectInfo.deprecated;\n const stability = this.projectInfo.stability;\n return { deprecated, stability };\n }\n }\n\n private _afterEmit() {\n this._diagnostics = [];\n this._deferred = [];\n this._types.clear();\n this._submoduleMap.clear();\n this._submodules.clear();\n this._packageInfoCache.clear();\n }\n\n /**\n * Defer a callback until a (set of) types are available\n *\n * This is a helper function around _defer() which encapsulates the _dereference\n * action (which is basically the majority use case for _defer anyway).\n *\n * Will not invoke the function with any 'undefined's; an error will already have been emitted in\n * that case anyway.\n *\n * @param fqn FQN of the current type (the type that has a dependency on baseTypes)\n * @param baseTypes Array of type references to be looked up\n * @param referencingNode Node to report a diagnostic on if we fail to look up a type\n * @param cb Callback to be invoked with the Types corresponding to the TypeReferences in baseTypes\n */\n private _deferUntilTypesAvailable(\n fqn: string,\n baseTypes: Array<string | spec.TypeReference>,\n referencingNode: ts.Node | undefined,\n cb: (...xs: spec.Type[]) => void,\n ) {\n // We can do this one eagerly\n if (baseTypes.length === 0) {\n cb();\n return;\n }\n const baseFqns = baseTypes.flatMap((bt) => {\n if (typeof bt === 'string') {\n return [bt];\n }\n if (spec.isNamedTypeReference(bt)) {\n return [bt.fqn];\n }\n return [];\n });\n\n this._defer(fqn, baseFqns, () => {\n const resolved = baseFqns\n .map((x) => this._dereference(x, referencingNode, 'used-in-syntax'))\n .filter((x) => x !== undefined);\n if (resolved.length > 0) {\n cb(...(resolved as spec.Type[]));\n }\n });\n }\n\n /**\n * Defer checks for after the program has been entirely processed; useful for verifying type references that may not\n * have been discovered yet, and verifying properties about them.\n *\n * The callback is guaranteed to be executed only after all deferreds for all types in 'dependedFqns' have\n * been executed.\n *\n * @param fqn FQN of the current type.\n * @param dependedFqns List of FQNs of types this callback depends on. All deferreds for all\n * @param cb the function to be called in a deferred way. It will be bound with ``this``, so it can depend on using\n * ``this``.\n */\n private _defer(fqn: string, dependedFqns: string[], cb: () => void) {\n this._deferred.push({ fqn, dependedFqns, cb: cb.bind(this) });\n }\n\n /**\n * Obtains the ``spec.Type`` for a given ``spec.NamedTypeReference``.\n *\n * @param ref the type reference to be de-referenced\n *\n * @returns the de-referenced type, if it was found, otherwise ``undefined``.\n */\n private _dereference(\n ref: string | spec.NamedTypeReference,\n referencingNode: ts.Node | undefined,\n usedInSyntax: 'used-in-syntax' | 'just-validating',\n ): spec.Type | undefined {\n if (typeof ref !== 'string') {\n ref = ref.fqn;\n }\n\n const [assm] = ref.split('.');\n let type;\n if (assm === this.projectInfo.name) {\n type = this._types.get(ref);\n } else {\n const assembly = this.projectInfo.dependencyClosure.find((dep) => dep.name === assm);\n type = assembly?.types?.[ref];\n\n // since we are exposing a type of this assembly in this module's public API,\n // we expect it to appear as a peer dependency instead of a normal dependency.\n if (assembly) {\n if (!(assembly.name in this.projectInfo.peerDependencies)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_0005_MISSING_PEER_DEPENDENCY.create(\n referencingNode!, // Cheating here for now, until the referencingNode can be made required\n assembly.name,\n ref,\n ),\n );\n }\n }\n }\n\n if (!type && usedInSyntax === 'used-in-syntax') {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9002_UNRESOLVEABLE_TYPE.create(\n referencingNode!, // Cheating here for now, until the referencingNode can be made required\n ref,\n ),\n );\n }\n\n return type;\n }\n\n /**\n * Compute the JSII fully qualified name corresponding to a ``ts.Type`` instance. If for any reason a name cannot be\n * computed for the type, a marker is returned instead, and an ``ts.DiagnosticCategory.Error`` diagnostic is\n * inserted in the assembler context.\n *\n * @param type the type for which a JSII fully qualified name is needed.\n * @param typeAnnotationNode the type annotation for which this FQN is generated. This is used for attaching the error\n * marker. When there is no explicit type annotation (e.g: inferred method return type), the\n * preferred substitute is the \"type-inferred\" element's name.\n * @param typeUse the reason why this type was resolved (e.g: \"return type\")\n * @param isThisType whether this type was specified or inferred as \"this\" or not\n *\n * @returns the FQN of the type, or some \"unknown\" marker.\n */\n private _getFQN(\n type: ts.Type,\n typeAnnotationNode: ts.Node | undefined,\n typeUse: TypeUseKind,\n isThisType: boolean,\n ): string | undefined {\n const sym = symbolFromType(type, this._typeChecker);\n const typeDeclaration = sym.valueDeclaration ?? sym.declarations?.[0];\n\n // Set to true to prevent further adding of Error diagnostics for known-bad reference\n let hasError = false;\n\n if (this._isPrivateOrInternal(sym)) {\n // Check if this type is \"this\" (explicit or inferred method return type).\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3001_EXPOSED_INTERNAL_TYPE.create(\n typeAnnotationNode,\n sym,\n isThisType,\n typeUse,\n ).addRelatedInformationIf(typeDeclaration, 'The referenced type is declared here'),\n );\n\n hasError = true;\n }\n\n const tsName = this._typeChecker.getFullyQualifiedName(sym);\n const groups = /^\"([^\"]+)\"\\.(.*)$/.exec(tsName);\n if (!groups) {\n if (!hasError) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3001_EXPOSED_INTERNAL_TYPE.create(\n typeAnnotationNode,\n sym,\n isThisType,\n typeUse,\n ).addRelatedInformationIf(typeDeclaration, 'The referenced type is declared here'),\n );\n hasError = true;\n }\n return tsName;\n }\n const [, modulePath, typeName] = groups;\n const pkg = this.findPackageInfo(modulePath);\n if (!pkg) {\n if (!hasError) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9003_UNRESOLVEABLE_MODULE.create(typeAnnotationNode, modulePath).addRelatedInformationIf(\n typeDeclaration,\n 'The referenced type is declared here',\n ),\n );\n hasError = true;\n }\n return `unknown.${typeName}`;\n }\n\n // If the symbol comes from an assembly whose submodules we've already\n // spidered (or from the current assembly), look up there. This relies\n // on an entry-point import of the library having been done first\n // (`import * as x from 'module-root';`)\n const submodule = this._submoduleMap.get(sym);\n if (submodule != null) {\n const submoduleNs = this._submodules.get(submodule)!.fqnResolutionPrefix;\n return `${submoduleNs}.${typeName}`;\n }\n\n // This is the fallback: in case we can't find a symbolId for the given\n // type, we're return this value. This is for backwards compatibility with\n // modules that haven't been compiled to have symbolId support. Those also\n // most likely won't be using submodules so this legacy guess will be correct.\n const fallbackFqn = `${pkg.name}.${typeName}`;\n\n // If the type is coming from the current module, we won't find it in a dependency\n if (pkg.name === this.projectInfo.name) {\n return fallbackFqn;\n }\n\n // Otherwise look up the symbol identifier in the dependency assemblies\n // This is now the preferred mechanism but we can't do this as the only mechanism,\n // as we may still have compile against very old assemblies that don't have a\n // symbol identifier table at all.\n const dep = this.projectInfo.dependencyClosure.find((d) => d.name === pkg.name);\n if (!dep) {\n this._diagnostics.push(JsiiDiagnostic.JSII_9000_UNKNOWN_MODULE.create(typeAnnotationNode, pkg.name));\n return fallbackFqn;\n }\n const symbolId = symbolIdentifier(this._typeChecker, sym, {\n assembly: dep,\n });\n const fqn = (dep && symbolId ? symbolIdIndex(dep)[symbolId] : undefined) ?? fallbackFqn;\n\n if (!fqn || !this._dereference({ fqn }, sym.valueDeclaration, 'used-in-syntax')) {\n if (!hasError) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3002_USE_OF_UNEXPORTED_FOREIGN_TYPE.create(\n typeAnnotationNode,\n fqn ?? tsName,\n typeUse,\n pkg,\n ).addRelatedInformationIf(typeDeclaration, 'The referenced type is declared here'),\n );\n hasError = true;\n }\n }\n\n return fqn;\n }\n\n /**\n * For all modules in the dependency closure, crawl their exports to register\n * the submodules they contain.\n *\n * @param entryPoint the main source file for the currently compiled module.\n */\n private _registerDependenciesNamespaces(entryPoint: ts.SourceFile) {\n for (const assm of this.projectInfo.dependencyClosure) {\n const resolved = ts.resolveModuleName(assm.name, entryPoint.fileName, this.program.getCompilerOptions(), ts.sys);\n // If we can't resolve the module name, simply ignore it (TypeScript compilation likely failed)\n if (resolved.resolvedModule == null) {\n continue;\n }\n const source = this.program.getSourceFile(resolved.resolvedModule.resolvedFileName);\n const depMod = source && this._typeChecker.getSymbolAtLocation(source);\n // It's unlikely, but if we can't get the SourceFile here, ignore it (TypeScript compilation probably failed)\n if (depMod == null) {\n continue;\n }\n\n const depRoot = packageRoot(resolved.resolvedModule.resolvedFileName);\n\n for (const symbol of this._typeChecker.getExportsOfModule(depMod)) {\n this._registerNamespaces(symbol, depRoot);\n }\n }\n\n function packageRoot(file: string): string {\n const parent = path.dirname(file);\n if (path.basename(parent) === 'node_modules' || parent === file) {\n return file;\n }\n return packageRoot(parent);\n }\n }\n\n private _registerNamespaces(symbol: ts.Symbol, packageRoot: string): void {\n const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];\n if (declaration == null) {\n // Nothing to do here...\n return;\n }\n if (ts.isModuleDeclaration(declaration)) {\n // Looks like:\n //\n // export some_namespace {\n // ...\n // }\n //\n // No way to configure targets\n\n const { fqn, fqnResolutionPrefix } = qualifiedNameOf.call(this, symbol, true);\n\n this._submodules.set(symbol, {\n fqn,\n fqnResolutionPrefix,\n symbolId: symbolIdentifier(this._typeChecker, symbol),\n locationInModule: this.declarationLocation(declaration),\n });\n this._addToSubmodule(symbol, symbol, packageRoot);\n return;\n }\n if (!ts.isNamespaceExport(declaration)) {\n // Nothing to do here...\n return;\n }\n\n const moduleSpecifier = declaration.parent.moduleSpecifier;\n if (moduleSpecifier == null || !ts.isStringLiteral(moduleSpecifier)) {\n // There is a grammar error here, so we'll let tsc report this for us.\n return;\n }\n const resolution = ts.resolveModuleName(\n moduleSpecifier.text,\n declaration.getSourceFile().fileName,\n this.program.getCompilerOptions(),\n this.system,\n );\n if (resolution.resolvedModule == null) {\n // Unresolvable module... We'll let tsc report this for us.\n return;\n }\n\n if (\n // We're not looking into a dependency's namespace exports, and the resolution says it's external\n (packageRoot === this.projectInfo.projectRoot && resolution.resolvedModule.isExternalLibraryImport) ||\n // Or the module resolves outside of the current dependency's tree entirely\n !isUnder(resolution.resolvedModule.resolvedFileName, packageRoot) ||\n // Or the module is under one the current dependency's node_modules subtree\n resolution.resolvedModule.resolvedFileName\n .split('/') // Separator is always '/', even on Windows\n .filter((entry) => entry === 'node_modules').length !==\n packageRoot.split('/').filter((entry) => entry === 'node_modules').length\n ) {\n // External re-exports are \"pure-javascript\" sugar; they need not be\n // represented in the jsii Assembly since the types in there will be\n // resolved through dependencies.\n return;\n }\n\n const sourceFile = this.program.getSourceFile(resolution.resolvedModule.resolvedFileName)!;\n const sourceModule = this._typeChecker.getSymbolAtLocation(sourceFile);\n // If there's no module, it's a syntax error, and tsc will have reported it for us.\n if (sourceModule) {\n if (symbol.name !== Case.camel(symbol.name) && symbol.name !== Case.snake(symbol.name)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_8004_SUBMOULE_NAME_CASING.create(declaration.name, symbol.name));\n }\n\n const { fqn, fqnResolutionPrefix } = qualifiedNameOf.call(this, symbol);\n const targets = loadSubmoduleTargetConfig(sourceFile.fileName);\n // There is no need to process the README file for submodules that are\n // external (i.e: from a dependency), as these will not be emitted in the\n // assembly. That'd be wasted effort, and could fail if the README file\n // refers to literate examples that are not packaged in the dependency.\n const readme =\n packageRoot === this.projectInfo.projectRoot\n ? loadSubmoduleReadMe(sourceFile.fileName, this.projectInfo.projectRoot)\n : undefined;\n\n this._submodules.set(symbol, {\n fqn,\n fqnResolutionPrefix,\n targets,\n readme,\n symbolId: symbolIdentifier(this._typeChecker, symbol),\n locationInModule: this.declarationLocation(declaration),\n });\n this._addToSubmodule(symbol, sourceModule, packageRoot);\n }\n\n function qualifiedNameOf(\n this: Assembler,\n sym: ts.Symbol,\n inlineNamespace = false,\n ): { fqn: string; fqnResolutionPrefix: string } {\n if (this._submoduleMap.has(sym)) {\n const parent = this._submodules.get(this._submoduleMap.get(sym)!)!;\n const fqn = `${parent.fqn}.${sym.name}`;\n return {\n fqn,\n fqnResolutionPrefix: inlineNamespace ? parent.fqnResolutionPrefix : fqn,\n };\n }\n const symbolLocation = sym.getDeclarations()?.[0]?.getSourceFile()?.fileName;\n const pkgInfo = symbolLocation ? this.findPackageInfo(symbolLocation) : undefined;\n const assemblyName: string = pkgInfo?.name ?? this.projectInfo.name;\n const fqn = `${assemblyName}.${sym.name}`;\n return {\n fqn,\n fqnResolutionPrefix: inlineNamespace ? this.projectInfo.name : fqn,\n };\n }\n\n function loadSubmoduleTargetConfig(submoduleMain: string): SubmoduleSpec['targets'] {\n const jsiirc = path.resolve(submoduleMain, '..', '.jsiirc.json');\n if (!fs.existsSync(jsiirc)) {\n return undefined;\n }\n const data = JSON.parse(fs.readFileSync(jsiirc, 'utf-8'));\n return data.targets;\n }\n\n /**\n * Load the README for the given submodule\n *\n * If the submodule is loaded from a complete directory (determined by the 'main'\n * file ending in `index.[d.]ts`, then we load `README.md` in that same directory.\n *\n * If the submodule is loaded from a file, like `mymodule.[d.]ts`, we will load\n * `mymodule.README.md`.\n */\n function loadSubmoduleReadMe(submoduleMain: string, projectRoot: string): SubmoduleSpec['readme'] {\n const fileBase = path.basename(submoduleMain).replace(/(\\.d)?\\.ts$/, '');\n const readMeName = fileBase === 'index' ? 'README.md' : `${fileBase}.README.md`;\n const fullPath = path.join(path.dirname(submoduleMain), readMeName);\n return loadAndRenderReadme(fullPath, projectRoot);\n }\n }\n\n /**\n * Registers Symbols to a particular submodule. This is used to associate\n * declarations exported by an `export * as ns from 'moduleLike';` statement\n * so that they can subsequently be correctly namespaced.\n *\n * @param ns the symbol that identifies the submodule.\n * @param moduleLike the module-like symbol bound to the submodule.\n * @param packageRoot the root of the package being traversed.\n */\n private _addToSubmodule(ns: ts.Symbol, moduleLike: ts.Symbol, packageRoot: string) {\n // For each symbol exported by the moduleLike, map it to the ns submodule.\n for (const symbol of this._typeChecker.getExportsOfModule(moduleLike)) {\n if (this._submoduleMap.has(symbol)) {\n const currNs = this._submoduleMap.get(symbol)!;\n // Checking if there's been two submodules exporting the same symbol,\n // which is illegal. We can tell if the currently registered symbol has\n // a different name than the one we're currently trying to register in.\n if (currNs.name !== ns.name) {\n const currNsDecl = currNs.valueDeclaration ?? currNs.declarations?.[0];\n const nsDecl = ns.valueDeclaration ?? ns.declarations?.[0];\n\n // Make sure the error message always lists causes in the same order\n const refs = [\n { decl: currNsDecl, name: currNs.name } as const,\n { decl: nsDecl, name: ns.name } as const,\n ].sort(({ name: l }, { name: r }) => l.localeCompare(r));\n\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3003_SYMBOL_IS_EXPORTED_TWICE.create(\n _nameOrDeclarationNode(symbol),\n refs[0].name,\n refs[1].name,\n )\n .addRelatedInformationIf(refs[0].decl, `Symbol is exported under the \"${refs[0].name}\" submodule`)\n .addRelatedInformationIf(refs[1].decl, `Symbol is exported under the \"${refs[1].name}\" submodule`),\n );\n }\n // Found two re-exports, which is odd, but they use the same submodule,\n // so it's probably okay? That's likely a tsc error, which will have\n // been reported for us already anyway.\n continue;\n }\n this._submoduleMap.set(symbol, ns);\n\n // If the exported symbol has any declaration, and that delcaration is of\n // an entity that can have nested declarations of interest to jsii\n // (classes, interfaces, enums, modules), we need to also associate those\n // nested symbols to the submodule (or they won't be named correctly!)\n const decl = symbol.declarations?.[0];\n if (decl != null) {\n if (ts.isClassDeclaration(decl) || ts.isInterfaceDeclaration(decl) || ts.isEnumDeclaration(decl)) {\n const type = this._typeChecker.getTypeAtLocation(decl);\n if (isSingleValuedEnum(type, this._typeChecker)) {\n // type.symbol !== symbol, because symbol is the enum itself, but\n // since it's single-valued, the TypeChecker will only show us the\n // value's symbol later on.\n this._submoduleMap.set(type.symbol, ns);\n }\n if (type.symbol.exports) {\n // eslint-disable-next-line no-await-in-loop\n this._addToSubmodule(ns, symbol, packageRoot);\n }\n } else if (ts.isModuleDeclaration(decl)) {\n // eslint-disable-next-line no-await-in-loop\n this._registerNamespaces(symbol, packageRoot);\n } else if (ts.isNamespaceExport(decl)) {\n // eslint-disable-next-line no-await-in-loop\n this._registerNamespaces(symbol, packageRoot);\n }\n }\n }\n }\n\n /**\n * Register exported types in ``this.types``.\n *\n * @param node a node found in a module\n * @param namePrefix the prefix for the types' namespaces\n */\n // eslint-disable-next-line complexity\n private _visitNode(node: ts.Declaration, context: EmitContext): spec.Type[] {\n if (ts.isNamespaceExport(node)) {\n // export * as ns from 'module';\n // Note: the \"ts.NamespaceExport\" refers to the \"export * as ns\" part of\n // the statement only. We must refer to `node.parent` in order to be able\n // to access the module specifier (\"from 'module'\") part.\n const symbol = this._typeChecker.getSymbolAtLocation(node.parent.moduleSpecifier!)!;\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Entering submodule: ${chalk.cyan([...context.namespace, symbol.name].join('.'))}`);\n }\n\n const nsContext = context.appendNamespace(node.name.text);\n const allTypes = this._typeChecker.getExportsOfModule(symbol).flatMap((child) => {\n const decl = child.declarations?.[0];\n if (decl == null) {\n return [];\n }\n return this._visitNode(decl, nsContext);\n });\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Leaving submodule: ${chalk.cyan([...context.namespace, symbol.name].join('.'))}`);\n }\n\n return allTypes;\n }\n\n if (ts.isExportSpecifier(node)) {\n // This is what happens when one does `export { Symbol } from \"./location\";`\n // ExportSpecifier: ~~~~~~\n\n const resolvedSymbol = this._typeChecker.getExportSpecifierLocalTargetSymbol(node);\n const decl = resolvedSymbol?.valueDeclaration ?? resolvedSymbol?.declarations?.[0];\n if (!decl) {\n // A grammar error, compilation will already have failed\n return [];\n }\n return this._visitNode(decl, context);\n }\n\n if ((ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) === 0) {\n return [];\n }\n\n let jsiiType: spec.Type | undefined;\n\n if (ts.isClassDeclaration(node) && _isExported(node)) {\n // export class Name { ... }\n this._validateHeritageClauses(node.heritageClauses);\n\n jsiiType = this._visitClass(this._typeChecker.getTypeAtLocation(node), context);\n if (jsiiType) {\n this.registerExportedClassFqn(node, jsiiType.fqn);\n }\n } else if (ts.isInterfaceDeclaration(node) && _isExported(node)) {\n // export interface Name { ... }\n this._validateHeritageClauses(node.heritageClauses);\n jsiiType = this._visitInterface(this._typeChecker.getTypeAtLocation(node), context);\n } else if (ts.isEnumDeclaration(node) && _isExported(node)) {\n // export enum Name { ... }\n jsiiType = this._visitEnum(this._typeChecker.getTypeAtLocation(node), context);\n } else if (ts.isModuleDeclaration(node)) {\n // export namespace name { ... }\n const name = node.name.getText();\n const symbol = this._typeChecker.getSymbolAtLocation(node.name)!;\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Entering namespace: ${chalk.cyan([...context.namespace, name].join('.'))}`);\n }\n\n const nsContext = context.appendNamespace(node.name.getText());\n const allTypes = this._typeChecker.getExportsOfModule(symbol).flatMap((prop) => {\n const decl = prop.declarations?.[0];\n if (decl == null) {\n return [];\n }\n return this._visitNode(decl, nsContext);\n });\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Leaving namespace: ${chalk.cyan([...context.namespace, name].join('.'))}`);\n }\n return allTypes;\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9998_UNSUPPORTED_NODE.create(ts.getNameOfDeclaration(node) ?? node, node.kind),\n );\n }\n\n if (!jsiiType) {\n return [];\n }\n\n // If symbolId hasn't been set yet, set it here\n if (!jsiiType.symbolId) {\n jsiiType.symbolId = this.getSymbolId(node);\n }\n\n // Let's quickly verify the declaration does not collide with a submodule. Submodules get case-adjusted for each\n // target language separately, so names cannot collide with case-variations.\n for (const submodule of this._submodules.keys()) {\n const candidates = Array.from(\n new Set([submodule.name, Case.camel(submodule.name), Case.pascal(submodule.name), Case.snake(submodule.name)]),\n );\n const colliding = candidates.find((name) => `${this.projectInfo.name}.${name}` === jsiiType!.fqn);\n if (colliding != null) {\n const submoduleDeclName = _nameOrDeclarationNode(submodule);\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5011_SUBMODULE_NAME_CONFLICT.create(\n ts.getNameOfDeclaration(node) ?? node,\n submodule.name,\n jsiiType.name,\n candidates,\n ).addRelatedInformationIf(submoduleDeclName, 'This is the conflicting submodule declaration'),\n );\n }\n }\n\n if (LOG.isInfoEnabled()) {\n LOG.info(`Registering JSII ${chalk.magenta(jsiiType.kind)}: ${chalk.green(jsiiType.fqn)}`);\n }\n this._types.set(jsiiType.fqn, jsiiType);\n jsiiType.locationInModule = this.declarationLocation(node);\n\n const type = this._typeChecker.getTypeAtLocation(node);\n if (type.symbol.exports) {\n const nestedContext = context.appendNamespace(type.symbol.name);\n const visitedNodes = this._typeChecker\n .getExportsOfModule(type.symbol)\n .filter((s) => s.declarations)\n .flatMap((exportedNode) => {\n const decl = exportedNode.valueDeclaration ?? exportedNode.declarations?.[0];\n if (decl == null) {\n return [];\n }\n return [this._visitNode(decl, nestedContext)];\n });\n for (const nestedTypes of visitedNodes) {\n for (const nestedType of nestedTypes) {\n if (nestedType.namespace !== nestedContext.namespace.join('.')) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5012_NAMESPACE_IN_TYPE.create(\n ts.getNameOfDeclaration(node) ?? node,\n jsiiType.fqn,\n nestedType.namespace!,\n ),\n );\n }\n }\n }\n }\n\n return [jsiiType];\n }\n\n private getSymbolId(node: ts.Node) {\n return symbolIdentifier(this._typeChecker, this._typeChecker.getTypeAtLocation(node).symbol);\n }\n\n private _validateHeritageClauses(clauses?: ts.NodeArray<ts.HeritageClause>) {\n if (clauses == null || clauses.length === 0) {\n // Nothing to do.\n return;\n }\n for (const clause of clauses) {\n for (const node of clause.types) {\n const parentType = this._typeChecker.getTypeAtLocation(node);\n if (parentType.symbol == null) {\n // The parent type won't have a symbol if it's an \"error type\" inserted by the type checker when the original\n // code contains a compilation error. In such cases, the TypeScript compiler will already have reported about\n // the incoherent declarations, so we'll just not re-validate it there (we'd fail anyway).\n continue;\n }\n // For some reason, we cannot trust parentType.isClassOrInterface()\n const badDecl = parentType.symbol.declarations?.find(\n (decl) =>\n !ts.isClassDeclaration(decl) && // <-- local classes\n !ts.isInterfaceDeclaration(decl) && // <-- local interfaces\n !ts.isModuleDeclaration(decl), // <-- imported types\n );\n if (badDecl != null) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3004_INVALID_SUPERTYPE.create(node, clause, badDecl).addRelatedInformation(\n badDecl,\n 'The invalid super type is declared here.',\n ),\n );\n }\n }\n }\n }\n\n private declarationLocation(node: ts.Declaration): spec.SourceLocation {\n const file = node.getSourceFile();\n const line = ts.getLineAndCharacterOfPosition(file, node.getStart()).line;\n const filename = path.normalize(path.relative(this.projectInfo.projectRoot, file.fileName)).replace(/\\\\/g, '/');\n return {\n filename,\n line: line + 1,\n };\n }\n\n private _processBaseInterfaces(fqn: string, baseTypes?: ts.Type[]) {\n const erasedBases = new Array<ts.Type>();\n if (!baseTypes) {\n return { erasedBases };\n }\n\n const result = new Array<spec.NamedTypeReference>();\n const baseInterfaces = new Set<ts.Type>();\n\n const processBaseTypes = (types: ts.Type[]) => {\n for (const iface of types) {\n // base is private/internal, so we continue recursively with it's own bases\n if (this._isPrivateOrInternal(iface.symbol) || isInternalSymbol(iface.symbol)) {\n erasedBases.push(iface);\n if (!isInternalSymbol(iface.symbol)) {\n const bases = iface.getBaseTypes();\n if (bases) {\n processBaseTypes(bases);\n }\n }\n continue;\n }\n\n baseInterfaces.add(iface);\n }\n };\n\n processBaseTypes(baseTypes);\n\n const typeRefs = Array.from(baseInterfaces).map((iface) => {\n const decl = iface.symbol.valueDeclaration;\n const typeRef = this._typeReference(iface, decl, 'base interface');\n return { decl, typeRef };\n });\n for (const { decl, typeRef } of typeRefs) {\n if (!spec.isNamedTypeReference(typeRef)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_3005_TYPE_USED_AS_INTERFACE.create(decl, typeRef));\n continue;\n }\n\n this._deferUntilTypesAvailable(fqn, [typeRef], decl, (deref) => {\n if (!spec.isInterfaceType(deref)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_3005_TYPE_USED_AS_INTERFACE.create(decl, typeRef));\n }\n });\n\n result.push(typeRef);\n }\n\n return {\n interfaces: result.length === 0 ? undefined : result,\n erasedBases,\n };\n }\n\n // eslint-disable-next-line complexity\n private _visitClass(type: ts.Type, ctx: EmitContext): spec.ClassType | undefined {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing class: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan(type.symbol.name)}`);\n }\n\n if (_hasInternalJsDocTag(type.symbol)) {\n return undefined;\n }\n\n this._warnAboutReservedWords(type.symbol);\n\n const fqn = `${[this.projectInfo.name, ...ctx.namespace].join('.')}.${type.symbol.name}`;\n\n if (Case.pascal(type.symbol.name) !== type.symbol.name) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8000_PASCAL_CASED_TYPE_NAMES.create(\n (type.symbol.valueDeclaration as ts.ClassDeclaration).name ??\n type.symbol.valueDeclaration ??\n type.symbol.declarations?.[0],\n type.symbol.name,\n ),\n );\n }\n\n const classDeclaration = type.symbol.valueDeclaration as ts.ClassDeclaration;\n for (const typeParam of classDeclaration.typeParameters ?? []) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1006_GENERIC_TYPE.create(typeParam));\n }\n\n const jsiiType: spec.ClassType = bindings.setClassRelatedNode(\n {\n assembly: this.projectInfo.name,\n fqn,\n kind: spec.TypeKind.Class,\n name: type.symbol.name,\n namespace: ctx.namespace.length > 0 ? ctx.namespace.join('.') : undefined,\n docs: this._visitDocumentation(type.symbol, ctx).docs,\n },\n classDeclaration,\n );\n\n if (_isAbstract(type.symbol, jsiiType)) {\n jsiiType.abstract = true;\n }\n\n const erasedBases = new Array<ts.BaseType>();\n for (let base of type.getBaseTypes() ?? []) {\n if (jsiiType.base) {\n // Ignoring this - there has already been a compilation error generated by tsc here.\n continue;\n }\n\n //\n // base classes (\"extends foo\")\n\n // Crawl up the inheritance tree if the current base type is not exported, so we identify the type(s) to be\n // erased, and identify the closest exported base class, should there be one.\n while (base && this._isPrivateOrInternal(base.symbol)) {\n LOG.debug(\n `Base class of ${chalk.green(jsiiType.fqn)} named ${chalk.green(\n base.symbol.name,\n )} is not exported, erasing it...`,\n );\n erasedBases.push(base);\n base = (base.getBaseTypes() ?? [])[0];\n }\n if (!base || isInternalSymbol(base.symbol)) {\n // There is no exported base class to be found, pretend this class has no base class.\n continue;\n }\n\n // eslint-disable-next-line no-await-in-loop\n const ref = this._typeReference(\n base,\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n 'base class',\n );\n\n if (!spec.isNamedTypeReference(ref)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3006_TYPE_USED_AS_CLASS.create(\n base.symbol.valueDeclaration ?? base.symbol.declarations?.[0],\n ref,\n ),\n );\n continue;\n }\n this._deferUntilTypesAvailable(fqn, [ref], base.symbol.valueDeclaration, (deref) => {\n if (!spec.isClassType(deref)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3006_TYPE_USED_AS_CLASS.create(\n base.symbol.valueDeclaration ?? base.symbol.declarations?.[0],\n ref,\n ),\n );\n }\n });\n jsiiType.base = ref.fqn;\n }\n\n //\n // base interfaces (\"implements foo\")\n\n // collect all \"implements\" declarations from the current type and all\n // erased base types (because otherwise we lose them, see jsii#487)\n const implementsClauses = new Array<ts.HeritageClause>();\n for (const heritage of [type, ...erasedBases].map(\n (t) => (t.symbol.valueDeclaration as ts.ClassDeclaration).heritageClauses ?? [],\n )) {\n for (const clause of heritage) {\n if (clause.token === ts.SyntaxKind.ExtendsKeyword) {\n // Handled by `getBaseTypes`\n continue;\n } else if (clause.token !== ts.SyntaxKind.ImplementsKeyword) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9998_UNSUPPORTED_NODE.create(\n clause,\n `Ignoring ${ts.SyntaxKind[clause.token]} heritage clause`,\n ),\n );\n continue;\n }\n\n implementsClauses.push(clause);\n }\n }\n\n // process all \"implements\" clauses\n const allInterfaces = new Set<string>();\n const baseInterfaces = implementsClauses.map((clause) =>\n this._processBaseInterfaces(\n fqn,\n clause.types.map((t) => this._getTypeFromTypeNode(t)),\n ),\n );\n for (const { interfaces } of baseInterfaces) {\n for (const ifc of interfaces ?? []) {\n allInterfaces.add(ifc.fqn);\n }\n if (interfaces) {\n this._deferUntilTypesAvailable(jsiiType.fqn, interfaces, type.symbol.valueDeclaration, (...ifaces) => {\n for (const iface of ifaces) {\n if (spec.isInterfaceType(iface) && iface.datatype) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3007_ILLEGAL_STRUCT_EXTENSION.create(\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n jsiiType,\n iface,\n ),\n );\n }\n }\n });\n }\n }\n\n if (allInterfaces.size > 0) {\n jsiiType.interfaces = Array.from(allInterfaces);\n }\n\n if (!type.isClass()) {\n throw new Error('Oh no');\n }\n\n const allDeclarations: Array<{\n decl: ts.Declaration;\n type: ts.InterfaceType | ts.BaseType;\n }> = (type.symbol.declarations ?? []).map((decl) => ({ decl, type }));\n\n // Considering erased bases' declarations, too, so they are \"blended in\"\n for (const base of erasedBases) {\n allDeclarations.push(\n ...(base.symbol.declarations ?? []).map((decl) => ({\n decl,\n type: base,\n })),\n );\n }\n\n for (const { decl, type: declaringType } of allDeclarations) {\n const classDecl = decl as ts.ClassDeclaration | ts.InterfaceDeclaration;\n if (!classDecl.members) {\n continue;\n }\n\n for (const memberDecl of classDecl.members) {\n if (ts.isSemicolonClassElement(memberDecl)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_9996_UNNECESSARY_TOKEN.create(memberDecl));\n continue;\n }\n\n const member = ts.isConstructorDeclaration(memberDecl)\n ? getConstructor(this._typeChecker.getTypeAtLocation(memberDecl.parent))\n : ts.isIndexSignatureDeclaration(memberDecl)\n ? type.symbol.members?.get(ts.InternalSymbolName.Index) ??\n type.symbol.exports?.get(ts.InternalSymbolName.Index)\n : this._typeChecker.getSymbolAtLocation(ts.getNameOfDeclaration(memberDecl) ?? memberDecl);\n\n if (member && this._isPrivateOrInternal(member, memberDecl as ts.ClassElement)) {\n continue;\n }\n\n if (ts.isIndexSignatureDeclaration(memberDecl)) {\n // Index signatures (static or not) are not supported in the jsii type model.\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1999_UNSUPPORTED.create(memberDecl, {\n what: 'Index signatures',\n suggestInternal: true,\n }),\n );\n continue;\n }\n\n if (!(declaringType.symbol.getDeclarations() ?? []).find((d) => d === memberDecl.parent)) {\n continue;\n }\n\n // constructors are handled later\n if (ts.isConstructorDeclaration(memberDecl)) {\n continue;\n }\n\n // eslint-disable-next-line no-await-in-loop\n if (ts.isMethodDeclaration(memberDecl) || ts.isMethodSignature(memberDecl)) {\n // eslint-disable-next-line no-await-in-loop\n this._visitMethod(member!, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), classDecl);\n } else if (\n ts.isPropertyDeclaration(memberDecl) ||\n ts.isPropertySignature(memberDecl) ||\n ts.isAccessor(memberDecl)\n ) {\n // eslint-disable-next-line no-await-in-loop\n this._visitProperty(member!, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), classDecl);\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9998_UNSUPPORTED_NODE.create(\n ts.getNameOfDeclaration(memberDecl) ?? memberDecl,\n memberDecl.kind,\n ),\n );\n }\n /* eslint-enable no-await-in-loop */\n }\n }\n\n const memberEmitContext = ctx.replaceStability(jsiiType.docs && jsiiType.docs.stability);\n\n // Find the first defined constructor in this class, or it's erased bases\n const constructor = [type, ...erasedBases].map(getConstructor).find((ctor) => ctor != null);\n const ctorDeclaration = constructor && (constructor.declarations?.[0] as ts.ConstructorDeclaration | undefined);\n if (constructor && ctorDeclaration) {\n const signature = this._typeChecker.getSignatureFromDeclaration(ctorDeclaration);\n\n if ((ts.getCombinedModifierFlags(ctorDeclaration) & ts.ModifierFlags.Private) === 0) {\n jsiiType.initializer = {\n locationInModule: this.declarationLocation(ctorDeclaration),\n };\n if (signature) {\n for (const param of signature.getParameters()) {\n jsiiType.initializer.parameters = jsiiType.initializer.parameters ?? [];\n\n const jsiiParam = // eslint-disable-next-line no-await-in-loop\n this._toParameter(param, ctx.replaceStability(jsiiType.docs?.stability));\n\n if (containsIntersection(jsiiParam.type)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1010_INTERSECTION_NOT_IN_CTOR.create(param.declarations?.[0]));\n }\n\n jsiiType.initializer.parameters.push(jsiiParam);\n jsiiType.initializer.variadic = jsiiType.initializer?.parameters?.some((p) => !!p.variadic) || undefined;\n jsiiType.initializer.protected =\n (ts.getCombinedModifierFlags(ctorDeclaration) & ts.ModifierFlags.Protected) !== 0 || undefined;\n }\n }\n this._verifyConsecutiveOptionals(ctorDeclaration, jsiiType.initializer.parameters);\n jsiiType.initializer.docs = this._visitDocumentation(constructor, memberEmitContext).docs;\n }\n\n // Process constructor-based property declarations even if constructor is private\n if (signature) {\n for (const param of signature.getParameters()) {\n const decl = param.valueDeclaration ?? param.declarations?.[0];\n\n if (decl && ts.isParameterPropertyDeclaration(decl, decl.parent) && !this._isPrivateOrInternal(param)) {\n // eslint-disable-next-line no-await-in-loop\n this._visitProperty(param, jsiiType, memberEmitContext, ctorDeclaration.parent);\n }\n }\n }\n } else if (jsiiType.base) {\n this._deferUntilTypesAvailable(fqn, [jsiiType.base], type.symbol.valueDeclaration, (baseType) => {\n if (spec.isClassType(baseType)) {\n jsiiType.initializer = baseType.initializer;\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL.create(\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n `Base type of ${jsiiType.fqn} (${jsiiType.base}) is not a class`,\n ),\n );\n }\n });\n } else {\n jsiiType.initializer = {\n docs: ctx.stability && { stability: ctx.stability },\n };\n }\n\n this._verifyNoStaticMixing(jsiiType, type.symbol.valueDeclaration ?? type.symbol.declarations?.[0]);\n\n return _sortMembers(jsiiType);\n }\n\n /**\n * Use the TypeChecker's getTypeFromTypeNode, but throw a descriptive error if it fails\n */\n private _getTypeFromTypeNode(t: ts.TypeNode) {\n const type = this._typeChecker.getTypeFromTypeNode(t);\n if (isErrorType(type)) {\n throw new JsiiError(\n `Unable to resolve type: ${t.getFullText()}. This typically happens if something is wrong with your dependency closure.`,\n );\n }\n return type;\n }\n\n /**\n * Check that this class doesn't declare any members that are of different staticness in itself or any of its bases\n */\n private _verifyNoStaticMixing(klass: spec.ClassType, decl: ts.Declaration | undefined) {\n // Check class itself--may have two methods/props with the same name, so check the arrays\n const statics = new Set(\n (klass.methods ?? [])\n .concat(klass.properties ?? [])\n .filter((x) => x.static)\n .map((x) => x.name),\n );\n const nonStatics = new Set(\n (klass.methods ?? [])\n .concat(klass.properties ?? [])\n .filter((x) => !x.static)\n .map((x) => x.name),\n );\n // Intersect\n for (const member of Sets.intersect(statics, nonStatics)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_5013_STATIC_INSTANCE_CONFLICT.create(decl, member, klass));\n }\n\n // Check against base classes. They will not contain duplicate member names so we can load\n // the members into a map.\n const classMembers = typeMembers(klass);\n this._withBaseClass(klass, decl, (base, recurse) => {\n for (const [name, baseMember] of Object.entries(typeMembers(base))) {\n const member = classMembers[name];\n if (!member) {\n continue;\n }\n\n if (!!baseMember.static !== !!member.static) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5014_INHERITED_STATIC_CONFLICT.create(decl, member, klass, baseMember, base),\n );\n }\n }\n\n recurse();\n });\n }\n\n /**\n * Wrapper around _deferUntilTypesAvailable, invoke the callback with the given classes' base type\n *\n * Does nothing if the given class doesn't have a base class.\n *\n * The second argument will be a `recurse` function for easy recursion up the inheritance tree\n * (no messing around with binding 'self' and 'this' and doing multiple calls to _withBaseClass.)\n */\n private _withBaseClass(\n klass: spec.ClassType,\n decl: ts.Declaration | undefined,\n cb: (base: spec.ClassType, recurse: () => void) => void,\n ) {\n if (klass.base) {\n this._deferUntilTypesAvailable(klass.fqn, [klass.base], decl, (base) => {\n if (!spec.isClassType(base)) {\n throw new Error('Oh no');\n }\n cb(base, () => this._withBaseClass(base, decl, cb));\n });\n }\n }\n\n /**\n * @returns true if this member is internal and should be omitted from the type manifest\n */\n private _isPrivateOrInternal(symbol: ts.Symbol, validateDeclaration?: ts.Declaration): boolean {\n const hasInternalJsDocTag = _hasInternalJsDocTag(symbol);\n const hasInternalSymbolName = isInternalSymbol(symbol);\n const hasUnderscorePrefix = !hasInternalSymbolName && symbol.name.startsWith('_');\n\n if (_isPrivate(symbol)) {\n LOG.trace(`${chalk.cyan(symbol.name)} is marked \"private\", or is an unexported type declaration`);\n return true;\n }\n\n // If all the declarations are marked with `@jsii ignore`, then this is effetcively private as far as jsii is concerned.\n if (\n symbol.declarations?.every((decl) => Directives.of(decl, (diag) => this._diagnostics.push(diag)).ignore != null)\n ) {\n return true;\n }\n\n if (!hasInternalJsDocTag && !hasUnderscorePrefix) {\n return false;\n }\n\n // We only validate if we have a declaration and the symbol doesn't have an internal name.\n if (validateDeclaration && !hasInternalSymbolName) {\n if (!hasUnderscorePrefix) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8005_INTERNAL_UNDERSCORE.create(\n ts.getNameOfDeclaration(validateDeclaration) ?? validateDeclaration,\n symbol.name,\n ),\n );\n }\n\n if (!hasInternalJsDocTag) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8006_UNDERSCORE_INTERNAL.create(\n ts.getNameOfDeclaration(validateDeclaration) ?? validateDeclaration,\n symbol.name,\n ),\n );\n }\n }\n\n return true;\n }\n\n private _visitEnum(type: ts.Type, ctx: EmitContext): spec.EnumType | undefined {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing enum: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan(type.symbol.name)}`);\n }\n\n // Forcefully resolving to the EnumDeclaration symbol for single-valued enums\n let decl: ts.Node | undefined = type.symbol.declarations?.[0];\n let symbol: ts.Symbol | undefined;\n if (decl && ts.isEnumMember(decl)) {\n decl = decl?.parent;\n }\n if (decl && ts.isEnumDeclaration(decl)) {\n symbol = getSymbolFromDeclaration(decl, this._typeChecker);\n }\n if (!decl || !symbol || !ts.isEnumDeclaration(decl)) {\n throw new JsiiError(`Unable to resolve enum declaration for ${type.symbol.name}!`);\n }\n\n if (_hasInternalJsDocTag(symbol)) {\n return undefined;\n }\n\n // check the enum to see if there are duplicate enum values\n this.assertNoDuplicateEnumValues(decl);\n\n this._warnAboutReservedWords(symbol);\n\n const flags = ts.getCombinedModifierFlags(decl);\n if (flags & ts.ModifierFlags.Const) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1000_NO_CONST_ENUM.create(\n decl.modifiers?.find((mod) => mod.kind === ts.SyntaxKind.ConstKeyword) ?? decl,\n ),\n );\n }\n\n const { docs } = this._visitDocumentation(symbol, ctx);\n\n const typeContext = ctx.replaceStability(docs?.stability);\n const members = type.isUnion() ? type.types : [type];\n\n if (Case.pascal(symbol.name) !== symbol.name) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8000_PASCAL_CASED_TYPE_NAMES.create(\n (symbol.valueDeclaration as ts.EnumDeclaration).name,\n symbol.name,\n ),\n );\n }\n\n const jsiiType: spec.EnumType = bindings.setEnumRelatedNode(\n {\n assembly: this.projectInfo.name,\n fqn: `${[this.projectInfo.name, ...ctx.namespace].join('.')}.${symbol.name}`,\n kind: spec.TypeKind.Enum,\n members: members.map((m) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { docs } = this._visitDocumentation(m.symbol, typeContext);\n return { name: m.symbol.name, docs };\n }),\n name: symbol.name,\n namespace: ctx.namespace.length > 0 ? ctx.namespace.join('.') : undefined,\n docs,\n\n // Set SymbolId here instead of later, as by default TS will pick single-enum members\n // as the target symbol if possible.\n symbolId: symbolIdentifier(this._typeChecker, symbol),\n },\n decl,\n );\n\n return jsiiType;\n }\n\n private assertNoDuplicateEnumValues(decl: ts.EnumDeclaration): void {\n type EnumValue = {\n name: string;\n value: string;\n decl: ts.DeclarationName | undefined;\n };\n\n const enumValues = decl.members\n .filter((m) => m.initializer)\n .map((member): EnumValue => {\n return {\n value: member.initializer!.getText(),\n name: member.name.getText(),\n decl: ts.getNameOfDeclaration(member),\n };\n });\n\n const hasDuplicateEnumValues = enumValues.some(\n (val, _, arr) => arr.filter((e) => val.value === e.value).length > 1,\n );\n\n if (hasDuplicateEnumValues) {\n const enumValueMap = enumValues.reduce<Record<string, EnumValue[]>>((acc, val) => {\n if (!acc[val.value]) {\n acc[val.value] = [];\n }\n acc[val.value].push(val);\n return acc;\n }, {});\n for (const duplicateValue of Object.keys(enumValueMap)) {\n if (enumValueMap[duplicateValue].length > 1) {\n const err = JsiiDiagnostic.JSII_1004_DUPLICATE_ENUM_VALUE.create(\n enumValueMap[duplicateValue][0].decl!,\n duplicateValue,\n enumValueMap[duplicateValue].map((v) => v.name),\n );\n for (let i = 1; i < enumValueMap[duplicateValue].length; i++) {\n err.addRelatedInformation(enumValueMap[duplicateValue][i].decl!, 'The conflicting declaration is here');\n }\n this._diagnostics.push(err);\n }\n }\n }\n }\n\n /**\n * Return docs for a symbol\n */\n private _visitDocumentation(\n sym: ts.Symbol,\n context: EmitContext,\n ): { readonly docs?: spec.Docs; readonly hints: TypeSystemHints } {\n const result = parseSymbolDocumentation(sym, this._typeChecker);\n\n for (const diag of result.diagnostics ?? []) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_7999_DOCUMENTATION_ERROR.create(sym.valueDeclaration ?? sym.declarations?.[0], diag),\n );\n }\n\n const decl = sym.valueDeclaration ?? sym.declarations?.[0];\n // The @struct hint is only valid for interface declarations\n if (decl && !ts.isInterfaceDeclaration(decl) && result.hints.struct) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_7001_ILLEGAL_HINT.create(\n _findHint(decl, 'struct')!,\n 'struct',\n 'interfaces with only readonly properties',\n ).addRelatedInformationIf(ts.getNameOfDeclaration(decl) ?? decl, 'The annotated declaration is here'),\n );\n // Clean up the bad hint...\n delete (result.hints as any).struct;\n }\n\n // Apply the current context's stability if none was specified locally.\n if (result.docs.stability == null) {\n result.docs.stability = context.stability;\n }\n\n const allUndefined = Object.values(result.docs).every((v) => v === undefined);\n return {\n docs: !allUndefined ? result.docs : undefined,\n hints: result.hints,\n };\n }\n\n /**\n * Check that all parameters the doc block refers to with a @param declaration actually exist\n */\n private _validateReferencedDocParams(method: spec.Method, methodSym: ts.Symbol) {\n const params = getReferencedDocParams(methodSym);\n const actualNames = new Set((method.parameters ?? []).map((p) => p.name));\n for (const param of params) {\n if (!actualNames.has(param)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_7000_NON_EXISTENT_PARAMETER.create(\n methodSym.valueDeclaration ?? methodSym.declarations?.[0],\n method,\n param,\n ),\n );\n }\n }\n }\n\n private _visitInterface(type: ts.Type, ctx: EmitContext): spec.InterfaceType | undefined {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing interface: ${chalk.gray(ctx.namespace.join('.'))}.${chalk.cyan(type.symbol.name)}`);\n }\n\n if (_hasInternalJsDocTag(type.symbol)) {\n return undefined;\n }\n\n this._warnAboutReservedWords(type.symbol);\n\n const fqn = `${[this.projectInfo.name, ...ctx.namespace].join('.')}.${type.symbol.name}`;\n\n const { docs, hints } = this._visitDocumentation(type.symbol, ctx);\n const jsiiType: spec.InterfaceType = bindings.setInterfaceRelatedNode(\n {\n assembly: this.projectInfo.name,\n fqn,\n kind: spec.TypeKind.Interface,\n name: type.symbol.name,\n namespace: ctx.namespace.length > 0 ? ctx.namespace.join('.') : undefined,\n docs,\n },\n type.symbol.declarations?.[0] as ts.InterfaceDeclaration | undefined,\n );\n\n const { interfaces, erasedBases } = this._processBaseInterfaces(fqn, type.getBaseTypes());\n jsiiType.interfaces = apply(interfaces, (arr) => arr.map((i) => i.fqn));\n\n const typeDecl = (type.symbol.valueDeclaration ?? type.symbol.declarations?.[0]) as\n | ts.ClassLikeDeclaration\n | ts.InterfaceDeclaration\n | undefined;\n\n for (const typeParam of typeDecl?.typeParameters ?? []) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1006_GENERIC_TYPE.create(typeParam));\n }\n\n for (const decl of (typeDecl?.members as ReadonlyArray<ts.ClassElement | ts.TypeElement> | undefined)?.filter(\n (mem) => ts.isIndexSignatureDeclaration(mem),\n ) ?? []) {\n const sym =\n type.symbol.members?.get(ts.InternalSymbolName.Index) ?? type.symbol.exports?.get(ts.InternalSymbolName.Index);\n if (sym != null && this._isPrivateOrInternal(sym, decl)) {\n continue;\n }\n\n // Index signatures (static or not) are not supported in the jsii type model.\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1999_UNSUPPORTED.create(decl, { what: 'Index signatures', suggestInternal: true }),\n );\n }\n\n for (const declaringType of [type, ...erasedBases]) {\n for (const member of declaringType.getProperties()) {\n const decl = member.valueDeclaration ?? (member.declarations?.[0] as ts.PropertyDeclaration | undefined);\n\n if (!(declaringType.symbol.getDeclarations() ?? []).find((d) => d === decl?.parent)) {\n continue;\n }\n\n if (this._isPrivateOrInternal(member, decl)) {\n continue;\n }\n\n if (decl && (ts.isMethodDeclaration(decl) || ts.isMethodSignature(decl))) {\n // eslint-disable-next-line no-await-in-loop\n this._visitMethod(member, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), typeDecl);\n } else if (decl && (ts.isPropertyDeclaration(decl) || ts.isPropertySignature(decl) || ts.isAccessor(decl))) {\n // eslint-disable-next-line no-await-in-loop\n this._visitProperty(member, jsiiType, ctx.replaceStability(jsiiType.docs?.stability), typeDecl);\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9998_UNSUPPORTED_NODE.create(\n _nameOrDeclarationNode(member),\n (member.valueDeclaration ?? member.declarations?.[0])?.kind ?? ts.SyntaxKind.Unknown,\n ),\n );\n }\n }\n }\n\n // Calculate datatype based on the datatypeness of this interface and all of its parents\n // To keep the spec minimal the actual values of the attribute are \"true\" or \"undefined\" (to represent \"false\").\n const declaration = type.symbol.valueDeclaration ?? type.symbol.declarations?.[0];\n this._deferUntilTypesAvailable(fqn, jsiiType.interfaces ?? [], declaration, (...bases: spec.Type[]) => {\n if ((jsiiType.methods ?? []).length === 0) {\n jsiiType.datatype = true;\n } else if (hints.struct) {\n this._diagnostics.push(\n jsiiType.methods!.reduce((diag, mthod) => {\n const node = bindings.getMethodRelatedNode(mthod);\n return node\n ? diag.addRelatedInformation(ts.getNameOfDeclaration(node) ?? node, 'A method is declared here')\n : diag;\n }, JsiiDiagnostic.JSII_7001_ILLEGAL_HINT.create(declaration && _findHint(declaration, 'struct')!, 'struct', 'interfaces with only readonly properties').addRelatedInformationIf(ts.getNameOfDeclaration(declaration) ?? declaration, 'The annotated declartion is here')),\n );\n }\n\n for (const base of bases) {\n if (spec.isInterfaceType(base) && !base.datatype) {\n jsiiType.datatype = undefined;\n }\n }\n\n const interfaceName = isInterfaceName(jsiiType.name);\n\n // If it's not a datatype the name must start with an \"I\".\n if (!jsiiType.datatype && !interfaceName) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8007_BEHAVIORAL_INTERFACE_NAME.create(\n ts.getNameOfDeclaration(declaration) ?? declaration,\n jsiiType.name,\n ),\n );\n }\n\n // NOTE: We need to be careful with the `I` prefix for behavioral interfaces, as this can mess with PascalCase\n // transformations, especially with short names such as `IA`, ...\n const expectedName = interfaceName ? `I${Case.pascal(type.symbol.name.slice(1))}` : Case.pascal(type.symbol.name);\n if (expectedName !== type.symbol.name) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_8000_PASCAL_CASED_TYPE_NAMES.create(\n (type.symbol.declarations?.[0] as ts.InterfaceDeclaration | undefined)?.name,\n type.symbol.name,\n expectedName,\n ),\n );\n }\n\n // If the name starts with an \"I\" it is not intended as a datatype, so switch that off,\n // unless a TSDoc hint was set to force this to be considered a behavioral interface.\n if (jsiiType.datatype && interfaceName && !hints.struct) {\n delete jsiiType.datatype;\n }\n\n // Okay, this is a data type, check that all properties are readonly\n if (jsiiType.datatype) {\n for (const prop of jsiiType.properties ?? []) {\n if (!prop.immutable) {\n const p = type.getProperty(prop.name)!;\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3008_STRUCT_PROPS_MUST_BE_READONLY.create(\n _nameOrDeclarationNode(p),\n p.name,\n jsiiType,\n ),\n );\n\n // force property to be \"readonly\" since jsii languages will pass this by-value\n prop.immutable = true;\n }\n }\n } else {\n // This is *NOT* a data type, so it may not extend something that is one.\n for (const base of bases) {\n if (!spec.isInterfaceType(base)) {\n // Invalid type we already warned about earlier, just ignoring it here..\n continue;\n }\n if (base.datatype) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3007_ILLEGAL_STRUCT_EXTENSION.create(\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n jsiiType,\n base,\n ),\n );\n }\n }\n }\n });\n\n // Check that no interface declares a member that's already declared\n // in a base type (not allowed in C#).\n const names = memberNames(jsiiType);\n const checkNoIntersection = (...bases: spec.Type[]) => {\n for (const base of bases) {\n if (!spec.isInterfaceType(base)) {\n continue;\n }\n\n const baseMembers = memberNames(base);\n for (const memberName of names) {\n if (baseMembers.includes(memberName)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5015_REDECLARED_INTERFACE_MEMBER.create(\n type.symbol.valueDeclaration ?? type.symbol.declarations?.[0],\n memberName,\n jsiiType,\n ),\n );\n }\n }\n // Recurse upwards\n this._deferUntilTypesAvailable(fqn, base.interfaces ?? [], type.symbol.valueDeclaration, checkNoIntersection);\n }\n };\n this._deferUntilTypesAvailable(fqn, jsiiType.interfaces ?? [], type.symbol.valueDeclaration, checkNoIntersection);\n\n return _sortMembers(jsiiType);\n }\n\n private _visitMethod(\n symbol: ts.Symbol,\n type: spec.ClassType | spec.InterfaceType,\n ctx: EmitContext,\n declaringTypeDecl: ts.ClassLikeDeclaration | ts.InterfaceDeclaration | undefined,\n ) {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing method: ${chalk.green(type.fqn)}#${chalk.cyan(symbol.name)}`);\n }\n\n const declaration = symbol.valueDeclaration as ts.MethodDeclaration | ts.MethodSignature;\n const signature = this._typeChecker.getSignatureFromDeclaration(declaration);\n if (!signature) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9004_UNABLE_TO_COMPUTE_SIGNATURE.create(declaration, symbol.name, type),\n );\n return;\n }\n\n if (type.name === Case.pascal(symbol.name)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5019_MEMBER_TYPE_NAME_CONFLICT.create(\n declaration.name,\n 'method',\n symbol,\n type,\n ).addRelatedInformationIf(\n declaringTypeDecl?.name ?? declaringTypeDecl,\n `The declaring ${type.kind} is introduced here`,\n ),\n );\n }\n\n if (isProhibitedMemberName(symbol.name)) {\n this._diagnostics.push(JsiiDiagnostic.JSII_5016_PROHIBITED_MEMBER_NAME.create(declaration.name, symbol.name));\n return;\n }\n this._warnAboutReservedWords(symbol);\n\n const parameters = signature.getParameters().map((p) => this._toParameter(p, ctx));\n const returnType = signature.getReturnType();\n const method: spec.Method = bindings.setMethodRelatedNode(\n {\n abstract: _isAbstract(symbol, type) || undefined,\n name: symbol.name,\n parameters: parameters.length > 0 ? parameters : undefined,\n protected: _isProtected(symbol) || undefined,\n returns: _isVoid(returnType)\n ? undefined\n : this._optionalValue(returnType, declaration.type ?? declaration.name, 'return type'),\n async: _isPromise(returnType) || undefined,\n static: _isStatic(symbol) || undefined,\n locationInModule: this.declarationLocation(declaration),\n },\n declaration,\n );\n method.variadic = method.parameters?.some((p) => !!p.variadic) === true ? true : undefined;\n\n this._verifyConsecutiveOptionals(declaration, method.parameters);\n\n method.docs = this._visitDocumentation(symbol, ctx).docs;\n\n // If the last parameter is a datatype, verify that it does not share any field names with\n // other function arguments, so that it can be turned into keyword arguments by jsii frontends\n // that support such.\n const lastParamTypeRef = apply(last(parameters), (x) => x.type);\n const lastParamSymbol = last(signature.getParameters());\n if (lastParamTypeRef && spec.isNamedTypeReference(lastParamTypeRef)) {\n this._deferUntilTypesAvailable(\n symbol.name,\n [lastParamTypeRef],\n lastParamSymbol!.declarations?.[0],\n (lastParamType) => {\n if (!spec.isInterfaceType(lastParamType) || !lastParamType.datatype) {\n return;\n }\n\n // Liftable datatype, make sure no parameter names match any of the properties in the datatype\n const propNames = this.allProperties(lastParamType);\n const paramNames = new Set(parameters.slice(0, parameters.length - 1).map((x) => x.name));\n const sharedNames = Sets.intersection(propNames, paramNames);\n\n for (const badName of sharedNames) {\n this._diagnostics.push(JsiiDiagnostic.JSII_5017_POSITIONAL_KEYWORD_CONFLICT.create(declaration, badName));\n }\n },\n );\n }\n\n this._validateReferencedDocParams(method, symbol);\n\n type.methods = type.methods ?? [];\n if (type.methods.find((m) => m.name === method.name && m.static === method.static) != null) {\n LOG.trace(`Dropping re-declaration of ${chalk.green(type.fqn)}#${chalk.cyan(method.name)}`);\n return;\n }\n type.methods.push(method);\n }\n\n private _warnAboutReservedWords(symbol: ts.Symbol) {\n if (!enabledWarnings['reserved-word']) {\n return;\n }\n\n const reservingLanguages = isReservedName(symbol.name);\n if (reservingLanguages) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5018_RESERVED_WORD.create(_nameOrDeclarationNode(symbol), symbol.name, reservingLanguages),\n );\n }\n }\n\n private _visitProperty(\n symbol: ts.Symbol,\n type: spec.ClassType | spec.InterfaceType,\n ctx: EmitContext,\n declaringTypeDecl: ts.ClassLikeDeclaration | ts.InterfaceDeclaration | undefined,\n ) {\n if (type.properties?.find((p) => p.name === symbol.name)) {\n /*\n * Second declaration of the same property. For example, if code specifies a getter & setter signature,\n * there will be one pass for each of the signatures, but we can process only the first encountered. The\n * typescript compiler will take care of making sure we don't have conflicting declarations, anyway.\n */\n return;\n }\n\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing property: ${chalk.green(type.fqn)}#${chalk.cyan(symbol.name)}`);\n }\n\n const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];\n const signature = declaration as\n | ts.PropertySignature\n | ts.PropertyDeclaration\n | ts.AccessorDeclaration\n | ts.ParameterPropertyDeclaration;\n\n if (type.name === Case.pascal(symbol.name)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5019_MEMBER_TYPE_NAME_CONFLICT.create(\n signature.name,\n 'property',\n symbol,\n type,\n ).addRelatedInformationIf(\n declaringTypeDecl?.name ?? declaringTypeDecl,\n `The declaring ${type.kind} is introduced here`,\n ),\n );\n }\n\n if (isProhibitedMemberName(symbol.name)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_5016_PROHIBITED_MEMBER_NAME.create(\n symbol.valueDeclaration ?? symbol.declarations?.[0],\n symbol.name,\n ),\n );\n return;\n }\n\n this._warnAboutReservedWords(symbol);\n\n const property: spec.Property = bindings.setPropertyRelatedNode(\n {\n ...this._optionalValue(\n this._typeChecker.getTypeOfSymbolAtLocation(symbol, signature),\n signature.type ?? signature.name,\n 'property type',\n ),\n abstract: _isAbstract(symbol, type) || undefined,\n name: symbol.name,\n protected: _isProtected(symbol) || undefined,\n static: _isStatic(symbol) || undefined,\n locationInModule: this.declarationLocation(signature),\n },\n signature,\n );\n\n if (ts.isGetAccessor(signature)) {\n property.immutable = true;\n for (const decl of symbol.getDeclarations() ?? []) {\n if (!ts.isSetAccessor(decl)) {\n continue;\n }\n delete property.immutable;\n\n // Verify the setter doesn't have a Separate Write Type (SWT)\n const valueParam = decl.parameters[0];\n if (valueParam?.type == null) {\n // If there is no type node, there can't be a SWT\n continue;\n }\n const paramType = this._typeChecker.getTypeFromTypeNode(valueParam.type);\n const paramOptionalValue = this._optionalValue(paramType, valueParam.type, 'parameter type');\n\n if (\n property.optional !== paramOptionalValue.optional ||\n describeTypeReference(property.type) !== describeTypeReference(paramOptionalValue.type)\n ) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1005_SEPARATE_WRITE_TYPE.create(valueParam.type).addRelatedInformation(\n signature.type ?? signature.name,\n 'The getter signature is declared here',\n ),\n );\n }\n }\n } else {\n property.immutable = (ts.getCombinedModifierFlags(signature) & ts.ModifierFlags.Readonly) !== 0 || undefined;\n }\n\n if (signature.questionToken) {\n property.optional = true;\n }\n\n if (property.static && property.immutable && ts.isPropertyDeclaration(signature) && signature.initializer) {\n property.const = true;\n }\n\n property.docs = this._visitDocumentation(symbol, ctx).docs;\n\n type.properties = type.properties ?? [];\n if (type.properties.find((prop) => prop.name === property.name && prop.static === property.static) != null) {\n LOG.trace(`Dropping re-declaration of ${chalk.green(type.fqn)}#${chalk.cyan(property.name)}`);\n return;\n }\n type.properties.push(property);\n }\n\n private _toParameter(paramSymbol: ts.Symbol, ctx: EmitContext): spec.Parameter {\n if (LOG.isTraceEnabled()) {\n LOG.trace(`Processing parameter: ${chalk.cyan(paramSymbol.name)}`);\n }\n const paramDeclaration = paramSymbol.valueDeclaration as ts.ParameterDeclaration;\n\n this._warnAboutReservedWords(paramSymbol);\n\n const parameter: spec.Parameter = bindings.setParameterRelatedNode(\n {\n ...this._optionalValue(\n this._typeChecker.getTypeAtLocation(paramDeclaration),\n paramDeclaration.type ?? paramDeclaration.name,\n 'parameter type',\n ),\n name: paramSymbol.name,\n variadic: paramDeclaration.dotDotDotToken && true,\n },\n paramDeclaration,\n );\n\n if (parameter.variadic && spec.isCollectionTypeReference(parameter.type)) {\n // TypeScript types variadic parameters as an array, but JSII uses the item-type instead.\n parameter.type = parameter.type.collection.elementtype;\n } else if (paramDeclaration.initializer || paramDeclaration.questionToken) {\n // Optional parameters have an inherently null-able type.\n parameter.optional = true;\n }\n\n parameter.docs = this._visitDocumentation(\n paramSymbol,\n ctx.removeStability(), // No inheritance on purpose\n ).docs;\n\n // Don't rewrite doc comment here on purpose -- instead, we add them as '@param'\n // into the parent's doc comment.\n\n return parameter;\n }\n\n private _typeReference(type: ts.Type, declaration: ts.Node | undefined, purpose: TypeUseKind): spec.TypeReference {\n const optionalValue = this._optionalValue(type, declaration, purpose);\n if (optionalValue.optional) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3999_INCOHERENT_TYPE_MODEL.create(\n declaration,\n 'Encountered optional value in location where a plain type reference is expected',\n ),\n );\n }\n return optionalValue.type;\n }\n\n private _optionalValue(type: ts.Type, declaration: ts.Node | undefined, purpose: TypeUseKind): spec.OptionalValue {\n const isThisType = _isThisType(type, this._typeChecker, declaration?.parent);\n\n if (type.isLiteral() && _isEnumLike(type)) {\n type = this._typeChecker.getBaseTypeOfLiteralType(type);\n } else {\n type = this._typeChecker.getApparentType(type);\n }\n\n const primitiveType = _tryMakePrimitiveType.call(this);\n if (primitiveType) {\n return { type: primitiveType };\n }\n\n if (type.isUnion() && !_isEnumLike(type)) {\n return _setType.call(this, 'union');\n }\n\n if (type.isIntersection()) {\n this.usedFeatures.add('intersection-types');\n const ret = _setType.call(this, 'intersection');\n const intersectionType = ret.type as spec.IntersectionTypeReference;\n\n this.validateIntersectionType(intersectionType, declaration);\n\n return ret;\n }\n\n if ((type.getFlags() & ts.TypeFlags.Never) !== 0) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1007_NEVER_TYPE.create(declaration));\n return { type: spec.CANONICAL_ANY };\n }\n\n if (!type.symbol) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1001_TYPE_HAS_NO_SYMBOL.create(declaration));\n return { type: spec.CANONICAL_ANY };\n }\n\n if (type.symbol.name === 'Array') {\n return { type: _arrayType.call(this) };\n }\n\n if (type.symbol.name === '__type' && type.symbol.members) {\n return { type: _mapType.call(this) };\n }\n\n if (type.symbol.escapedName === 'Promise') {\n const typeRef = type as ts.TypeReference;\n if (!typeRef.typeArguments || typeRef.typeArguments.length !== 1) {\n this._diagnostics.push(JsiiDiagnostic.JSII_1002_UNSPECIFIED_PROMISE.create(declaration));\n return { type: spec.CANONICAL_ANY };\n }\n return {\n type: this._typeReference(typeRef.typeArguments[0], declaration, purpose),\n };\n }\n\n const fqn = this._getFQN(type, declaration, purpose, isThisType);\n if (fqn == null) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_9997_UNKNOWN_ERROR.create(declaration, new Error('Could not determine FQN')),\n );\n return { type: { fqn: '' } };\n }\n\n return {\n type: { fqn },\n };\n\n function _arrayType(this: Assembler): spec.CollectionTypeReference {\n const typeRef = type as ts.TypeReference;\n let elementtype: spec.TypeReference;\n\n if (typeRef.typeArguments?.length === 1) {\n elementtype = this._typeReference(typeRef.typeArguments[0], declaration, 'list element type');\n } else {\n const count = typeRef.typeArguments ? typeRef.typeArguments.length : 'none';\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1003_UNSUPPORTED_TYPE.create(\n declaration,\n `Array references must have exactly one type argument (found ${count})`,\n ),\n );\n elementtype = spec.CANONICAL_ANY;\n }\n\n return {\n collection: {\n elementtype,\n kind: spec.CollectionKind.Array,\n },\n };\n }\n\n function _mapType(this: Assembler): spec.CollectionTypeReference {\n let elementtype: spec.TypeReference;\n const objectType = type.getStringIndexType();\n if (objectType) {\n elementtype = this._typeReference(objectType, declaration, 'map element type');\n } else {\n const typeDecl = type.symbol.declarations?.[0];\n if (\n typeDecl != null &&\n ts.isTypeLiteralNode(typeDecl) &&\n typeDecl.members.length == 1 &&\n ts.isIndexSignatureDeclaration(typeDecl.members[0]) &&\n typeDecl.members[0].parameters[0].type != null &&\n ts.isTemplateLiteralTypeNode(typeDecl.members[0].parameters[0].type)\n ) {\n const indexTypeNode = typeDecl.members[0].type;\n const indexType = this._typeChecker.getTypeFromTypeNode(indexTypeNode);\n elementtype = this._typeReference(indexType, indexTypeNode, 'map element type');\n } else {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1003_UNSUPPORTED_TYPE.create(\n declaration,\n 'Only string-indexed map types are supported',\n ),\n );\n elementtype = spec.CANONICAL_ANY;\n }\n }\n return {\n collection: {\n elementtype,\n kind: spec.CollectionKind.Map,\n },\n };\n }\n\n function _tryMakePrimitiveType(this: Assembler): spec.PrimitiveTypeReference | undefined {\n if (!type.symbol) {\n if (type.flags & ts.TypeFlags.Object) {\n if (isTupleType(type as ts.ObjectType)) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1999_UNSUPPORTED.create(declaration, { what: 'Tuple types', alternative: 'arrays' }),\n );\n }\n\n return { primitive: spec.PrimitiveType.Json };\n }\n if (type.flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) {\n return spec.CANONICAL_ANY;\n }\n } else if (\n type.symbol.valueDeclaration &&\n isUnder(type.symbol.valueDeclaration.getSourceFile().fileName, this.stdlib)\n ) {\n switch (type.symbol.name) {\n case 'Boolean':\n return { primitive: spec.PrimitiveType.Boolean };\n case 'Date':\n return { primitive: spec.PrimitiveType.Date };\n case 'Number':\n return { primitive: spec.PrimitiveType.Number };\n case 'String':\n return { primitive: spec.PrimitiveType.String };\n }\n }\n // Not a primitive type!\n return undefined;\n }\n\n function _setType(this: Assembler, field: 'union' | 'intersection'): spec.OptionalValue {\n const types = new Array<spec.TypeReference>();\n let optional: boolean | undefined;\n\n for (const subType of (type as ts.UnionType).types) {\n if (subType.flags & ts.TypeFlags.Undefined) {\n optional = true;\n continue;\n }\n // eslint-disable-next-line no-await-in-loop\n const resolvedType = this._typeReference(subType, declaration, purpose);\n if (types.some((ref) => deepEqual(ref, resolvedType))) {\n continue;\n }\n types.push(resolvedType);\n }\n\n const returnedType: spec.UnionTypeReference | spec.IntersectionTypeReference = {\n [field]: { types },\n } as any;\n return types.length === 1 ? { optional, type: types[0] } : { optional, type: returnedType };\n }\n }\n\n /**\n * Validate the restrictions on an intersection type reference\n *\n * - Type only consists of (behavioral) interface types\n * - For all types referenced in the intersection, the definitions of all shared\n * members must match exactly.\n */\n private validateIntersectionType(intersectionType: spec.IntersectionTypeReference, declaration: ts.Node | undefined) {\n // Validate that this intersection type only consists of interface types\n this._deferUntilTypesAvailable('', intersectionType.intersection.types, declaration, (...elementTypes) => {\n const requestedFqns = new Set(intersectionType.intersection.types.map(typeReferenceToString));\n const resolvedFqns = new Set(elementTypes.map((t) => t.fqn));\n\n const unresolved = Sets.diff(requestedFqns, resolvedFqns);\n if (unresolved.size > 0) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1008_ONLY_INTERFACE_INTERSECTION.create(declaration, Array.from(unresolved).join(', ')),\n );\n }\n\n const nonBehavioral = elementTypes.filter((t) => !isBehavioralInterfaceType(t));\n if (nonBehavioral.length > 0) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1008_ONLY_INTERFACE_INTERSECTION.create(\n declaration,\n nonBehavioral.map((t) => t.fqn).join(', '),\n ),\n );\n }\n\n // Check that shared members are the same\n const interfaces = elementTypes.filter(isBehavioralInterfaceType);\n const allProps = Sets.union(...interfaces.map((int) => this.allProperties(int)));\n const allMethods = Sets.union(...interfaces.map((int) => this.allMethods(int)));\n\n for (let i = 1; i < interfaces.length; i++) {\n let int0 = interfaces[0];\n let int1 = interfaces[i];\n\n for (const prop of allProps) {\n const p1 = int0.properties?.find((p) => p.name === prop);\n const p2 = int1.properties?.find((p) => p.name === prop);\n const diff = this.comparePropForIntersection(p1, p2);\n if (diff) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1011_INTERSECTION_MEMBER_DIFFERENT.create(\n declaration,\n prop,\n int0.name,\n diff[0],\n int1.name,\n diff[1],\n ),\n );\n }\n }\n\n for (const meth of allMethods) {\n const m1 = int0.methods?.find((p) => p.name === meth);\n const m2 = int1.methods?.find((p) => p.name === meth);\n const diff = this.compareMethodForIntersection(m1, m2);\n if (diff) {\n this._diagnostics.push(\n JsiiDiagnostic.JSII_1011_INTERSECTION_MEMBER_DIFFERENT.create(\n declaration,\n meth,\n int0.name,\n diff[0],\n int1.name,\n diff[1],\n ),\n );\n }\n }\n }\n });\n }\n\n private comparePropForIntersection(\n a: spec.Property | undefined,\n b: spec.Property | undefined,\n ): [string, string] | undefined {\n if (!a || !b) {\n return undefined;\n }\n\n if (!typeReferenceEqual(a.type, b.type)) {\n return [typeReferenceToString(a.type), typeReferenceToString(b.type)];\n }\n\n return (\n cmpDesc(a.static, b.static, (s) => (s ? 'static' : 'instance member')) ??\n cmpDesc(a.optional, b.optional, (o) => (o ? 'optional' : 'required')) ??\n cmpDesc(a.abstract, b.abstract, (s) => (s ? 'abstract' : 'concrete'))\n );\n }\n\n private compareMethodForIntersection(\n a: spec.Method | undefined,\n b: spec.Method | undefined,\n ): [string, string] | undefined {\n if (!a || !b) {\n return undefined;\n }\n\n if (a.returns && b.returns) {\n if (!typeReferenceEqual(a.returns.type, b.returns.type)) {\n return [typeReferenceToString(a.returns.type), typeReferenceToString(b.returns.type)];\n }\n\n const x = cmpDesc(a.returns.optional, b.returns.optional, (o) =>\n o ? 'return type optional' : 'return type required',\n );\n if (x) {\n return x;\n }\n }\n\n const paramsA = a.parameters ?? [];\n const paramsB = b.parameters ?? [];\n if (paramsA.length !== paramsB.length) {\n return [`${paramsA.length} parameters`, `${paramsB.length} parameters`];\n }\n for (let i = 0; i < paramsA.length; i++) {\n const p1 = paramsA[i];\n const p2 = paramsB[i];\n\n if (!typeReferenceEqual(p1.type, p2.type)) {\n return [typeReferenceToString(p1.type), typeReferenceToString(p2.type)];\n }\n\n const x =\n cmpDesc(p1.optional, p2.optional, (o) => (o ? `parameter ${i + 1} optional` : `parameter ${i + 1} required`)) ??\n cmpDesc(p1.variadic, p2.variadic, (v) =>\n v ? `parameter ${i + 1} variadic` : `parameter ${i + 1} not variadic`,\n );\n if (x) {\n return x;\n }\n }\n\n return (\n cmpDesc(a.abstract, b.abstract, (s) => (s ? 'abstract' : 'concrete')) ??\n cmpDesc(a.async, b.async, (s) => (s ? 'async' : 'async')) ??\n cmpDesc(a.protected, b.protected, (p) => (p ? 'protected' : 'public')) ??\n cmpDesc(a.variadic, b.variadic, (v) => (v ? 'variadic' : 'non-variadic')) ??\n cmpDesc(a.static, b.static, (s) => (s ? 'static' : 'instance member'))\n );\n }\n\n private callDeferredsInOrder() {\n // Do a topological call order of all deferreds.\n while (this._deferred.length > 0) {\n // All fqns in dependency lists that don't have any pending\n // deferreds themselves can be executed now, so are removed from\n // dependency lists.\n const pendingFqns = new Set<string>(this._deferred.map((x) => x.fqn).filter((x) => x));\n for (const deferred of this._deferred) {\n restrictDependenciesTo(deferred, pendingFqns);\n }\n\n // Invoke all deferreds with no more dependencies and remove them from the list.\n let invoked = false;\n for (let i = 0; i < this._deferred.length; i++) {\n if (this._deferred[i].dependedFqns.length === 0) {\n const deferred = this._deferred.splice(i, 1)[0];\n deferred.cb();\n invoked = true;\n }\n }\n\n if (!invoked) {\n // Apparently we're stuck. Complain loudly.\n throw new Error(\n `Could not invoke any more deferreds, cyclic dependency? Remaining: ${JSON.stringify(\n this._deferred,\n undefined,\n 2,\n )}`,\n );\n }\n }\n\n /**\n * Retain only elements in the dependencyfqn that are also in the set\n */\n function restrictDependenciesTo(def: DeferredRecord, fqns: Set<string>) {\n def.dependedFqns = def.dependedFqns.filter(fqns.has.bind(fqns));\n }\n }\n\n /**\n * Return the set of all (inherited) properties of an interface\n */\n private allProperties(root: spec.InterfaceType): Set<string> {\n return this.allInterfacesRecursively(root, (int) => {\n return (int.properties ?? []).map((p) => p.name);\n });\n }\n\n /**\n * Return the set of all (inherited) methods of an interface\n */\n private allMethods(root: spec.InterfaceType): Set<string> {\n return this.allInterfacesRecursively(root, (int) => {\n return (int.methods ?? []).map((p) => p.name);\n });\n }\n\n private allInterfacesRecursively<T>(root: spec.InterfaceType, cb: (x: spec.InterfaceType) => Iterable<T>): Set<T> {\n const ret = new Set<T>();\n recurse.call(this, root);\n return ret;\n\n function recurse(this: Assembler, int: spec.InterfaceType) {\n for (const x of cb(int)) {\n ret.add(x);\n }\n\n for (const baseRef of int.interfaces ?? []) {\n const base = this._dereference(baseRef, undefined, 'used-in-syntax');\n if (!base) {\n throw new Error('Impossible to have unresolvable base in allInterfacesRecursively()');\n }\n if (!spec.isInterfaceType(base)) {\n throw new Error('Impossible to have non-interface base in allInterfacesRecursively()');\n }\n\n recurse.call(this, base);\n }\n }\n }\n\n private _verifyConsecutiveOptionals(node: ts.Node, parameters?: spec.Parameter[]) {\n if (!parameters) {\n return;\n }\n\n const remaining = [...parameters].reverse();\n while (remaining.length > 0) {\n const current = remaining.pop()!;\n if (current.optional) {\n const offender = remaining.find((p) => !p.optional && !p.variadic);\n if (offender == null) {\n continue;\n }\n this._diagnostics.push(\n JsiiDiagnostic.JSII_3009_OPTIONAL_PARAMETER_BEFORE_REQUIRED.create(node, current, offender),\n );\n delete current.optional;\n }\n }\n }\n\n /**\n * Updates the runtime type info with the fully-qualified name for the current class definition.\n * Used by the runtime type info injector to add this information to the compiled file.\n */\n private registerExportedClassFqn(clazz: ts.ClassDeclaration, fqn: string) {\n this.runtimeTypeInfoInjector.registerClassFqn(clazz, fqn);\n }\n\n /**\n * Return only those submodules from the submodules list that are submodules inside this\n * assembly.\n */\n private mySubmodules() {\n return Array.from(this._submodules.values()).filter((m) => m.fqn.startsWith(`${this.projectInfo.name}.`));\n }\n\n private findPackageInfo(fromDir: string): PackageJson | undefined {\n if (this._packageInfoCache.has(fromDir)) {\n return this._packageInfoCache.get(fromDir);\n }\n\n const packageInfo = _findPackageInfo.call(this, fromDir);\n this._packageInfoCache.set(fromDir, packageInfo);\n return packageInfo;\n\n function _findPackageInfo(this: Assembler, dir: string): PackageJson | undefined {\n const filePath = path.join(dir, 'package.json');\n if (fs.existsSync(filePath)) {\n return JSON.parse(fs.readFileSync(filePath, 'utf-8'));\n }\n const parent = path.dirname(dir);\n if (parent === dir) {\n return undefined;\n }\n return this.findPackageInfo(parent);\n }\n }\n\n /**\n * Validate types against input/output positions in functions and APIs\n *\n * Currently used to validate that intersection types are only used in input position,\n * not output position\n */\n private validateTypesAgainstPositions() {\n const self = this;\n\n const validatedFqns = {\n in: new Set<string>(),\n out: new Set<string>(),\n };\n\n for (const type of this._types.values()) {\n if (spec.isClassType(type)) {\n for (const ctorParam of type.initializer?.parameters ?? []) {\n validateRefFor.call(this, 'in', ctorParam.type, `a constructor parameter of ${type.name}`);\n }\n }\n if (spec.isClassType(type) || isBehavioralInterfaceType(type)) {\n for (const property of type.properties ?? []) {\n validateRefFor.call(this, 'out', property.type, `type of property ${type.name}.${property.name}`);\n }\n\n for (const method of type.methods ?? []) {\n for (const param of method.parameters ?? []) {\n validateRefFor.call(this, 'in', param.type, `a parameter of method ${type.name}.${method.name}()`);\n }\n if (method.returns) {\n validateRefFor.call(\n this,\n 'out',\n method.returns.type,\n `return type of method ${type.name}.${method.name}()`,\n );\n }\n }\n }\n }\n\n function validateRefFor(dir: 'in' | 'out', typeRef: spec.TypeReference, reason: string) {\n visitTypeReference(typeRef, {\n named: (ref) => {\n // Named types we'll only validate once for every direction\n if (validatedFqns[dir].has(ref.fqn)) {\n return;\n }\n validatedFqns[dir].add(ref.fqn);\n\n const type = self._dereference(ref, undefined, 'just-validating');\n if (!type) {\n // Maybe this is an unexported type.\n return;\n }\n validateTypeFor(dir, type, reason);\n },\n primitive: () => {},\n collection: (ref) => {\n validateRefFor(dir, ref.collection.elementtype, reason);\n },\n union: (ref) => {\n for (const t of ref.union.types) {\n validateRefFor(dir, t, reason);\n }\n },\n intersection: (ref) => {\n if (dir === 'out') {\n self._diagnostics.push(JsiiDiagnostic.JSII_1009_INTERSECTION_ONLY_INPUT.createDetached(reason));\n }\n\n for (const t of ref.intersection.types) {\n validateRefFor(dir, t, reason);\n }\n },\n });\n }\n\n function validateTypeFor(dir: 'in' | 'out', type: spec.Type, reason: string) {\n visitType(type, {\n dataType: (t) => {\n // We only need to validate data types, because classes and interfaces\n // are done as part of the main loop.\n //\n // Recurse.\n for (const prop of t.properties ?? []) {\n validateRefFor(dir, prop.type, `type of property ${t.name}.${prop.name}, ${reason}`);\n }\n },\n classType: () => {},\n interfaceType: () => {},\n enumType: () => {},\n });\n }\n }\n}\n\nexport interface AssemblerOptions {\n /**\n * Whether to remove `@deprecated` members from the generated assembly.\n *\n * @default false\n */\n readonly stripDeprecated?: boolean;\n\n /**\n * If `stripDeprecated` is true, and a file is provided here, only the FQNs\n * present in the file will actually be removed. This can be useful when\n * you wish to deprecate some elements without actually removing them.\n *\n * @default undefined\n */\n readonly stripDeprecatedAllowListFile?: string;\n\n /**\n * Whether to inject code that warns when a deprecated element is used.\n *\n * @default false\n */\n readonly addDeprecationWarnings?: boolean;\n\n /**\n * Whether to compress the assembly.\n *\n * @default false\n */\n readonly compressAssembly?: boolean;\n}\n\ninterface SubmoduleSpec {\n /**\n * The submodule's fully qualified name.\n */\n readonly fqn: string;\n\n /**\n * The submodule's fully qualified name prefix to use when resolving type FQNs. This does not\n * include \"inline namespace\" names as those are already represented in the TypeCheckers' view of\n * the type names.\n */\n readonly fqnResolutionPrefix: string;\n\n /**\n * The location of the submodule definition in the source.\n */\n readonly locationInModule: spec.SourceLocation;\n\n /**\n * Symbol identifier of the root of the root file that represents this submodule\n */\n readonly symbolId?: string;\n\n /**\n * Any customized configuration for the currentl submodule.\n */\n readonly targets?: spec.AssemblyTargets;\n\n /**\n * Readme for this submodule (if found)\n */\n readonly readme?: spec.ReadMe;\n}\n\nfunction _fingerprint(assembly: spec.Assembly): spec.Assembly {\n delete (assembly as any).fingerprint;\n assembly = sortJson(assembly);\n const fingerprint = crypto.createHash('sha256').update(JSON.stringify(assembly)).digest('base64');\n return { ...assembly, fingerprint };\n}\n\nfunction _isAbstract(symbol: ts.Symbol, declaringType: spec.ClassType | spec.InterfaceType): boolean {\n // everything is abstract in interfaces\n if (declaringType.kind === spec.TypeKind.Interface) {\n return true;\n }\n\n return (\n !!symbol.valueDeclaration &&\n (ts.getCombinedModifierFlags(symbol.valueDeclaration) & ts.ModifierFlags.Abstract) !== 0\n );\n}\n\nfunction _isEnumLike(type: ts.Type): type is ts.EnumType {\n return (type.flags & ts.TypeFlags.EnumLike) !== 0;\n}\n\nfunction _isExported(node: ts.Declaration): boolean {\n return (ts.getCombinedModifierFlags(node) & ts.ModifierFlags.Export) !== 0;\n}\n\n/**\n * Members with names starting with `_` (and marked as @internal) and members\n * that are private are hidden.\n *\n * @param symbol the symbol which should be assessed\n *\n * @return `true` if the symbol should be hidden\n */\nfunction _isPrivate(symbol: ts.Symbol): boolean {\n // Private identifiers are always private...\n if (symbol.name.startsWith('#')) {\n return true;\n }\n\n const TYPE_DECLARATION_KINDS = new Set([\n ts.SyntaxKind.ClassDeclaration,\n ts.SyntaxKind.InterfaceDeclaration,\n ts.SyntaxKind.EnumDeclaration,\n ]);\n\n // if the symbol doesn't have a value declaration, we are assuming it's a type (enum/interface/class)\n // and check that it has an \"export\" modifier\n if (\n !isInternalSymbol(symbol) &&\n (!symbol.valueDeclaration || TYPE_DECLARATION_KINDS.has(symbol.valueDeclaration.kind))\n ) {\n let hasExport = false;\n for (const decl of symbol.declarations ?? []) {\n if (ts.getCombinedModifierFlags(decl) & ts.ModifierFlags.Export) {\n hasExport = true;\n break;\n }\n // Handle nested classes from project references\n if (ts.isModuleBlock(decl.parent)) {\n const moduleDeclaration = decl.parent.parent;\n const modifiers = ts.getCombinedModifierFlags(moduleDeclaration);\n // The trick is the module is declared as ambient & exported\n if ((modifiers & ts.ModifierFlags.Ambient) !== 0 && (modifiers & ts.ModifierFlags.Export) !== 0) {\n hasExport = true;\n break;\n }\n }\n }\n return !hasExport;\n }\n\n const decl = symbol.valueDeclaration ?? symbol.declarations?.[0];\n\n return decl != null && (ts.getCombinedModifierFlags(decl) & ts.ModifierFlags.Private) !== 0;\n}\n\nfunction _hasInternalJsDocTag(symbol: ts.Symbol) {\n return symbol.getJsDocTags().some((t: any) => t.name === 'internal');\n}\n\nfunction _isProtected(symbol: ts.Symbol): boolean {\n return (\n !!symbol.valueDeclaration &&\n (ts.getCombinedModifierFlags(symbol.valueDeclaration) & ts.ModifierFlags.Protected) !== 0\n );\n}\n\nfunction _isStatic(symbol: ts.Symbol): boolean {\n return (\n !!symbol.valueDeclaration && (ts.getCombinedModifierFlags(symbol.valueDeclaration) & ts.ModifierFlags.Static) !== 0\n );\n}\n\n/**\n * Determines whether a given type is void or Promise<void>.\n *\n * @param type the tested type\n *\n * @returns `true` if the type is void or Promise<void>\n */\nfunction _isVoid(type: ts.Type): boolean {\n if (_isPromise(type)) {\n const typeRef = type as ts.TypeReference;\n return typeRef.typeArguments != null && typeRef.typeArguments.length === 1 && _isVoid(typeRef.typeArguments[0]);\n }\n return (type.flags & ts.TypeFlags.Void) !== 0;\n}\n\nfunction _isPromise(type: ts.Type): boolean {\n return type.symbol?.escapedName === 'Promise';\n}\n\nfunction _sortMembers(type: spec.ClassType): spec.ClassType;\nfunction _sortMembers(type: spec.InterfaceType): spec.InterfaceType;\nfunction _sortMembers(type: spec.ClassType | spec.InterfaceType): spec.ClassType | spec.InterfaceType {\n type.methods = type.methods && _sort(type.methods);\n type.properties = type.properties && _sort(type.properties);\n return type;\n\n /**\n * Sorts a member array such that:\n * 1. Static members appear first\n * 2. Immutable members appear first\n * 3. Non-optional members appear first\n * 4. Members appear in lexicographical order\n *\n * @param values the array of members to be sorted\n *\n * @return a sorted copy of ``values``\n */\n function _sort<T extends TypeMember>(values: T[]): T[] {\n if (!values) {\n return values;\n }\n return values.sort(_comparator);\n\n function _comparator(lval: T, rval: T): number {\n return _format(lval).localeCompare(_format(rval));\n\n function _format(val: T): string {\n return [val.static ? '0' : '1', val.immutable ? '0' : '1', !val.optional ? '0' : '1', val.name].join('|');\n }\n }\n }\n type TypeMember = {\n name?: string; // Methods & Properties\n static?: boolean; // Methods & Properties\n immutable?: boolean; // Properties\n optional?: boolean; // Properties\n };\n}\n\n/**\n * Deferred processing that needs to happen in a second, ordered pass\n */\ninterface DeferredRecord {\n /**\n * The FQN of the type the action will be executed on\n */\n fqn: string;\n\n /**\n * Dependency FQNs of the types that need to be processed before analysis.\n *\n * All deferred analysis actions for the types listed here must be complete\n * before this analysis action can run.\n */\n dependedFqns: string[];\n\n /**\n * Callback representing the action to run.\n */\n cb: () => void;\n}\n\n/**\n * Return the last element from a list\n */\nfunction last<T>(xs: T[]): T | undefined {\n return xs.length > 0 ? xs[xs.length - 1] : undefined;\n}\n\n/**\n * Apply a function to a value if it's not equal to undefined\n */\nfunction apply<T, U>(x: T | undefined, fn: (x: T) => U | undefined): U | undefined {\n return x !== undefined ? fn(x) : undefined;\n}\n\n/**\n * Return all members names of a JSII interface type\n *\n * Returns empty string for a non-interface type.\n */\nfunction memberNames(jsiiType: spec.InterfaceType | spec.ClassType): string[] {\n return Object.keys(typeMembers(jsiiType)).filter((n) => n !== '');\n}\n\nfunction typeMembers(jsiiType: spec.InterfaceType | spec.ClassType): {\n [key: string]: spec.Property | spec.Method;\n} {\n const ret: { [key: string]: spec.Property | spec.Method } = {};\n\n for (const prop of jsiiType.properties ?? []) {\n ret[prop.name] = prop;\n }\n\n for (const method of jsiiType.methods ?? []) {\n ret[method.name ?? ''] = method;\n }\n\n return ret;\n}\n\n/**\n * Whether or not the given name is conventionally an interface name\n *\n * It's an interface name if it starts with I and has another capital\n * (so we don't mark IonicColumnProps as an interface).\n */\nfunction isInterfaceName(name: string) {\n return name.length >= 2 && name.startsWith('I') && name.charAt(1).toUpperCase() === name.charAt(1);\n}\n\nfunction getConstructor(type: ts.Type): ts.Symbol | undefined {\n return type.symbol.members?.get(ts.InternalSymbolName.Constructor);\n}\n\nfunction cmpDesc<T>(a: T, b: T, desc: (x: T) => string): [string, string] | undefined {\n const desc1 = desc(a);\n const desc2 = desc(b);\n return desc1 !== desc2 ? [desc1, desc2] : undefined;\n}\n\nfunction noEmptyDict<T>(xs: Record<string, T> | undefined): Record<string, T> | undefined {\n if (xs == null || Object.keys(xs).length === 0) {\n return undefined;\n }\n return xs;\n}\n\nfunction toDependencyClosure(assemblies: readonly spec.Assembly[]): {\n [name: string]: spec.DependencyConfiguration;\n} {\n const result: { [name: string]: spec.DependencyConfiguration } = {};\n for (const assembly of assemblies) {\n if (!assembly.targets) {\n continue;\n }\n result[assembly.name] = {\n submodules: cleanUp(assembly.submodules),\n targets: assembly.targets,\n };\n }\n return result;\n\n /**\n * Removes unneeded fields from the entries part of the `dependencyClosure`\n * property. Fields such as `readme` are not necessary and can bloat up the\n * assembly object.\n *\n * This removes the `readme` and `locationInModule` fields from the submodule\n * descriptios if present.\n *\n * @param submodules the submodules list to clean up.\n *\n * @returns the cleaned up submodules list.\n */\n function cleanUp(submodules: spec.Assembly['submodules']): spec.DependencyConfiguration['submodules'] {\n if (submodules == null) {\n return submodules;\n }\n const clean: spec.DependencyConfiguration['submodules'] = {};\n for (const [fqn, { targets }] of Object.entries(submodules)) {\n clean[fqn] = { targets };\n }\n return clean;\n }\n}\n\nfunction toSubmoduleDeclarations(submodules: Iterable<SubmoduleSpec>): spec.Assembly['submodules'] {\n const result: spec.Assembly['submodules'] = {};\n\n for (const submodule of submodules) {\n result[submodule.fqn] = {\n locationInModule: submodule.locationInModule,\n targets: submodule.targets,\n readme: submodule.readme,\n symbolId: submodule.symbolId,\n };\n }\n\n return result;\n}\n\n/**\n * Check whether this type is the intrinsic TypeScript \"error type\"\n *\n * This type is returned if type lookup fails. Unfortunately no public\n * accessors for it are exposed.\n */\nfunction isErrorType(t: ts.Type) {\n return (t as any).intrinsicName === 'error';\n}\n\n/**\n * Those have specific semantics in certain languages that don't always translate cleanly in others\n * (like how equals/hashCode are not a thing in Javascript, but carry meaning in Java and C#). The\n * `build` name is reserved for generated code (Java builders use that).\n */\nconst PROHIBITED_MEMBER_NAMES = ['build', 'equals', 'hashcode'];\n\n/**\n * Whether the given name is prohibited\n */\nfunction isProhibitedMemberName(name: string) {\n return PROHIBITED_MEMBER_NAMES.includes(name.toLowerCase());\n}\n\n/**\n * Information about the context in which a declaration is emitted.\n */\nclass EmitContext {\n public constructor(public readonly namespace: readonly string[], public readonly stability?: spec.Stability) {}\n\n /**\n * Create a new EmitContext by appending a namespace entry at the end.\n * @param element the new namespace entry.\n */\n public appendNamespace(element: string) {\n return new EmitContext([...this.namespace, element], this.stability);\n }\n\n /**\n * Create a new EmitContext by replacing the stability.\n * @param stability the new stability, if available.\n */\n public replaceStability(stability?: spec.Stability) {\n if (!stability) {\n return this;\n }\n return new EmitContext(this.namespace, stability);\n }\n\n /**\n * Create a new EmitContext without stability.\n */\n public removeStability() {\n return new EmitContext(this.namespace, undefined);\n }\n}\n\nfunction inferRootDir(program: ts.Program): string | undefined {\n const directories = program\n .getRootFileNames()\n .filter((fileName) => {\n const sourceFile = program.getSourceFile(fileName);\n return (\n sourceFile != null &&\n !program.isSourceFileFromExternalLibrary(sourceFile) &&\n !program.isSourceFileDefaultLibrary(sourceFile)\n );\n })\n .map((fileName) => path.relative(program.getCurrentDirectory(), path.dirname(fileName)))\n .map(segmentPath);\n\n const maxPrefix = Math.min(...directories.map((segments) => segments.length - 1));\n let commonIndex = -1;\n while (commonIndex < maxPrefix && new Set(directories.map((segments) => segments[commonIndex + 1])).size === 1) {\n commonIndex++;\n }\n\n if (commonIndex < 0) {\n return undefined;\n }\n\n return directories[0][commonIndex];\n\n function segmentPath(fileName: string): string[] {\n const result = new Array<string>();\n for (let parent = fileName; parent !== path.dirname(parent); parent = path.dirname(parent)) {\n result.unshift(parent);\n }\n return result;\n }\n}\n\n/**\n * Determines whether the provided type is a single-valued enum. It is necessary\n * to check as enums are union-like in the type model, and single-valued enum\n * types are actually reduced to the only available literal, which can trip\n * the assembler.\n *\n * @param type the type being checked.\n * @param typeChecker the type checker to use to get more information.\n *\n * @return `true` if `type` is a single-valued enum type.\n */\nfunction isSingleValuedEnum(type: ts.Type, typeChecker: ts.TypeChecker): type is ts.EnumType {\n if (type.isLiteral() && _isEnumLike(type)) {\n // Single-Valued enums are reduced to the only literal available.\n return type === typeChecker.getBaseTypeOfLiteralType(type);\n }\n return false;\n}\n\n/**\n * Checks is the provided type is \"this\" (as a type annotation).\n *\n * @param type the validated type.\n * @param typeChecker the type checker.\n *\n * @returns `true` iif the type is `this`\n */\nfunction _isThisType(type: ts.Type, typeChecker: ts.TypeChecker, enclosingDeclaration: ts.Node | undefined): boolean {\n return (\n typeChecker.typeToTypeNode(type, enclosingDeclaration, ts.NodeBuilderFlags.None)?.kind === ts.SyntaxKind.ThisKeyword\n );\n}\n\n/**\n * Gets the name node for a given symbol; or it's first declaration if no name can be found. This is\n * intended for use in placing problem markers on the right location.\n *\n * @param symbol the symbol for which the name node is needed.\n *\n * @returns the name node for the symbol, or the symbol's first declaration.\n */\nfunction _nameOrDeclarationNode(symbol: ts.Symbol): ts.Node | undefined {\n const declaration = symbol.valueDeclaration ?? symbol.declarations?.[0];\n if (declaration == null) {\n return undefined;\n }\n return ts.getNameOfDeclaration(declaration) ?? declaration;\n}\n\nfunction _findHint(decl: ts.Declaration, hint: string): ts.JSDocTag | undefined {\n const [node] = ts.getAllJSDocTags(decl, (tag): tag is ts.JSDocTag => tag.tagName.text === hint);\n return node;\n}\n\nfunction containsIntersection(type: spec.TypeReference): boolean {\n if (spec.isIntersectionTypeReference(type)) {\n return true;\n }\n if (spec.isUnionTypeReference(type)) {\n return type.union.types.some(containsIntersection);\n }\n if (spec.isCollectionTypeReference(type)) {\n return containsIntersection(type.collection.elementtype);\n }\n return false;\n}\n\n/**\n * A location where a type can be used.\n */\ntype TypeUseKind =\n | 'base class'\n | 'base interface'\n | 'list element type'\n | 'map element type'\n | 'parameter type'\n | 'property type'\n | 'return type';\n\n/**\n * Resolve a Type to Symbol, taking into account single-valued enums which have a bug\n *\n * Bug reference: https://github.com/microsoft/TypeScript/issues/46755\n */\nfunction symbolFromType(type: ts.Type, typeChecker: ts.TypeChecker): ts.Symbol {\n if ((type.flags & ts.TypeFlags.EnumLiteral) === 0) {\n return type.symbol;\n }\n\n const decl = type.symbol.declarations?.[0];\n if (!decl) {\n return type.symbol;\n }\n\n if (!ts.isEnumMember(decl)) {\n return type.symbol;\n }\n\n const parentDecl = decl.parent;\n if (!parentDecl || !ts.isEnumDeclaration(parentDecl)) {\n return type.symbol;\n }\n\n const name = ts.getNameOfDeclaration(parentDecl);\n if (!name) {\n return type.symbol;\n }\n return typeChecker.getSymbolAtLocation(name) ?? type.symbol;\n}\n\nconst SYMBOLID_CACHE = new WeakMap<spec.Assembly, Record<string, string>>();\n\n/**\n * Build and return an index of { symbolId -> fqn }\n *\n * Uses a cache for performance reasons.\n */\nfunction symbolIdIndex(asm: spec.Assembly): Record<string, string> {\n const existing = SYMBOLID_CACHE.get(asm);\n if (existing) {\n return existing;\n }\n\n const ret = buildIndex();\n SYMBOLID_CACHE.set(asm, ret);\n return ret;\n\n function buildIndex() {\n const index: Record<string, string> = {};\n for (const [fqn, type] of Object.entries(asm.types ?? {})) {\n if (type.symbolId) {\n index[type.symbolId] = fqn;\n }\n }\n return index;\n }\n}\n\nfunction getSymbolFromDeclaration(decl: ts.Declaration, typeChecker: ts.TypeChecker): ts.Symbol | undefined {\n const name = ts.getNameOfDeclaration(decl);\n return name ? typeChecker.getSymbolAtLocation(name) : undefined;\n}\n\nfunction isTupleType(type: ts.ObjectType): type is ts.TupleType {\n if (type.objectFlags & ts.ObjectFlags.Tuple) {\n return true;\n }\n\n if (type.objectFlags & ts.ObjectFlags.Reference) {\n return isTupleType((type as ts.TypeReference).target);\n }\n\n return false;\n}\n\nfunction isUnder(file: string, dir: string): boolean {\n const relative = path.relative(dir, file);\n return !relative.startsWith(path.sep) && !relative.startsWith('..');\n}\n\nfunction loadAndRenderReadme(readmePath: string, projectRoot: string) {\n if (!fs.existsSync(readmePath)) {\n return undefined;\n }\n\n return {\n markdown: literate\n .includeAndRenderExamples(\n literate.loadFromFile(readmePath),\n literate.fileSystemLoader(path.dirname(readmePath)),\n projectRoot,\n )\n .join('\\n'),\n };\n}\n\nconst INTERNAL_SYMBOLS = new Set(Object.values(ts.InternalSymbolName));\nfunction isInternalSymbol(symbol: ts.Symbol): boolean {\n return INTERNAL_SYMBOLS.has(symbol.name as ts.InternalSymbolName);\n}\n"]}