jsii 6.0.21 → 7.1.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/lib/assembler.d.ts +254 -196
  2. package/lib/assembler.js +2105 -2327
  3. package/lib/assembler.js.map +1 -1
  4. package/lib/case.js.map +1 -1
  5. package/lib/common/find-utils.js.map +1 -1
  6. package/lib/common/index.d.ts +1 -1
  7. package/lib/common/index.js +2 -1
  8. package/lib/common/index.js.map +1 -1
  9. package/lib/common/symbol-id.d.ts +23 -4
  10. package/lib/common/symbol-id.js +13 -9
  11. package/lib/common/symbol-id.js.map +1 -1
  12. package/lib/compiler-host.d.ts +60 -0
  13. package/lib/compiler-host.js +201 -0
  14. package/lib/compiler-host.js.map +1 -0
  15. package/lib/compiler.d.ts +74 -62
  16. package/lib/compiler.js +332 -254
  17. package/lib/compiler.js.map +1 -1
  18. package/lib/diagnostic.d.ts +34 -0
  19. package/lib/diagnostic.js +141 -0
  20. package/lib/diagnostic.js.map +1 -0
  21. package/lib/emitter.d.ts +40 -10
  22. package/lib/emitter.js +188 -0
  23. package/lib/emitter.js.map +1 -1
  24. package/lib/helpers.d.ts +1 -1
  25. package/lib/helpers.js +2 -2
  26. package/lib/helpers.js.map +1 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/jsii-diagnostic.d.ts +27 -22
  29. package/lib/jsii-diagnostic.js +22 -38
  30. package/lib/jsii-diagnostic.js.map +1 -1
  31. package/lib/literate.js.map +1 -1
  32. package/lib/main.js +3 -2
  33. package/lib/main.js.map +1 -1
  34. package/lib/project-info.d.ts +23 -4
  35. package/lib/project-info.js +5 -5
  36. package/lib/project-info.js.map +1 -1
  37. package/lib/support-types.d.ts +2 -0
  38. package/lib/support-types.js +3 -0
  39. package/lib/support-types.js.map +1 -0
  40. package/lib/support.js.map +1 -1
  41. package/lib/tsconfig/compiler-options.d.ts +12 -46
  42. package/lib/tsconfig/compiler-options.js +45 -87
  43. package/lib/tsconfig/compiler-options.js.map +1 -1
  44. package/lib/tsconfig/index.d.ts +24 -5
  45. package/lib/tsconfig/index.js.map +1 -1
  46. package/lib/tsconfig/read.d.ts +15 -0
  47. package/lib/tsconfig/read.js +196 -0
  48. package/lib/tsconfig/read.js.map +1 -0
  49. package/lib/tsconfig/rule-set-format.js.map +1 -1
  50. package/lib/tsconfig/rulesets/configurable-options.js.map +1 -1
  51. package/lib/tsconfig/rulesets/deprecated-options.js.map +1 -1
  52. package/lib/tsconfig/rulesets/generated.public.js.map +1 -1
  53. package/lib/tsconfig/rulesets/incompatible-options.js.map +1 -1
  54. package/lib/tsconfig/rulesets/jsii-configured-options.js.map +1 -1
  55. package/lib/tsconfig/rulesets/minimal.public.js.map +1 -1
  56. package/lib/tsconfig/rulesets/strict-family-options.js.map +1 -1
  57. package/lib/tsconfig/rulesets/strict.public.js.map +1 -1
  58. package/lib/tsconfig/tsconfig-validator.js +2 -50
  59. package/lib/tsconfig/tsconfig-validator.js.map +1 -1
  60. package/lib/tsconfig/validator.js.map +1 -1
  61. package/lib/type-analysis.js.map +1 -1
  62. package/lib/type-reference.js.map +1 -1
  63. package/lib/type-visitor.js.map +1 -1
  64. package/lib/utils.d.ts +6 -6
  65. package/lib/utils.js +8 -13
  66. package/lib/utils.js.map +1 -1
  67. package/lib/version.d.ts +3 -3
  68. package/lib/version.js +4 -4
  69. package/lib/version.js.map +1 -1
  70. package/lib/warnings.d.ts +2 -2
  71. package/lib/warnings.js +3 -77
  72. package/lib/warnings.js.map +1 -1
  73. package/package.json +15 -10
  74. package/scripts/ts7-compare-jsii.mjs +101 -0
  75. package/lib/directives.d.ts +0 -24
  76. package/lib/directives.js +0 -139
  77. package/lib/directives.js.map +0 -1
  78. package/lib/docs.d.ts +0 -64
  79. package/lib/docs.js +0 -293
  80. package/lib/docs.js.map +0 -1
  81. package/lib/node-bindings.d.ts +0 -19
  82. package/lib/node-bindings.js +0 -49
  83. package/lib/node-bindings.js.map +0 -1
  84. package/lib/reserved-words.d.ts +0 -6
  85. package/lib/reserved-words.js +0 -258
  86. package/lib/reserved-words.js.map +0 -1
  87. package/lib/sets.d.ts +0 -16
  88. package/lib/sets.js +0 -41
  89. package/lib/sets.js.map +0 -1
  90. package/lib/transforms/deprecated-remover.d.ts +0 -44
  91. package/lib/transforms/deprecated-remover.js +0 -545
  92. package/lib/transforms/deprecated-remover.js.map +0 -1
  93. package/lib/transforms/deprecation-warnings.d.ts +0 -37
  94. package/lib/transforms/deprecation-warnings.js +0 -616
  95. package/lib/transforms/deprecation-warnings.js.map +0 -1
  96. package/lib/transforms/runtime-info.d.ts +0 -39
  97. package/lib/transforms/runtime-info.js +0 -128
  98. package/lib/transforms/runtime-info.js.map +0 -1
  99. package/lib/transforms/utils.d.ts +0 -11
  100. package/lib/transforms/utils.js +0 -31
  101. package/lib/transforms/utils.js.map +0 -1
  102. package/lib/type-tracker.d.ts +0 -13
  103. package/lib/type-tracker.js +0 -67
  104. package/lib/type-tracker.js.map +0 -1
  105. package/lib/validator.d.ts +0 -19
  106. package/lib/validator.js +0 -602
  107. package/lib/validator.js.map +0 -1
@@ -1,249 +1,307 @@
1
- import * as ts from 'typescript';
2
- import { Emitter } from './emitter';
3
- import { ProjectInfo } from './project-info';
4
- /**
5
- * The JSII Assembler consumes a ``ts.Program`` instance and emits a JSII assembly.
6
- */
7
- export declare class Assembler implements Emitter {
1
+ import * as spec from '@jsii/spec';
2
+ import { TypeScriptApi, TypeScriptProject } from './compiler-host';
3
+ import { JsiiDiagnostic } from './jsii-diagnostic';
4
+ import { type ProjectInfo } from './project-info';
5
+ export interface AssemblerOptions {
6
+ /** package.json contents of the package being assembled. */
7
+ readonly packageJson: any;
8
+ /** The fully-resolved jsii project info (targets, metadata, dependency closure, ...). */
8
9
  readonly projectInfo: ProjectInfo;
9
- private readonly system;
10
- readonly program: ts.Program;
11
- readonly stdlib: string;
12
- private readonly runtimeTypeInfoInjector;
13
- private readonly deprecatedRemover?;
14
- private readonly warningsInjector?;
15
- private readonly mainFile;
16
- private readonly tscRootDir?;
17
- private readonly tscOutDir?;
18
- private readonly compressAssembly?;
19
- private readonly usedFeatures;
20
- private readonly _typeChecker;
21
- private _diagnostics;
22
- private _deferred;
23
- private readonly _types;
24
- private readonly _packageInfoCache;
25
- /** Map of Symbol to namespace export Symbol */
26
- private readonly _submoduleMap;
27
- /**
28
- * Submodule information
29
- *
30
- * Contains submodule information for all namespaces that have been seen
31
- * across all assemblies (this and dependencies).
32
- *
33
- * Filtered to local submodules only at time of writing the assembly out to disk.
34
- */
35
- private readonly _submodules;
36
- private readonly _typeTracker;
10
+ /** The rendered package README, when one exists. */
11
+ readonly readme?: spec.ReadMe;
12
+ /** Absolute path to the package root. */
13
+ readonly projectRoot: string;
14
+ /** Absolute path to the entrypoint .ts (derived from `types`/`main`). */
15
+ readonly entry: string;
16
+ /** Assembly name (package name). */
17
+ readonly assemblyName: string;
18
+ /** Default stability for the package. */
19
+ readonly defaultStability?: spec.Stability;
20
+ /** Whether to strip deprecated members (cdk-build.stripDeprecated). */
21
+ readonly stripDeprecated?: boolean;
22
+ /** Optional allowlist file of FQNs to strip (one per line). */
23
+ readonly stripDeprecatedAllowListFile?: string;
37
24
  /**
38
- * @param projectInfo information about the package being assembled
39
- * @param program the TypeScript program to be assembled from
40
- * @param stdlib the directory where the TypeScript stdlib is rooted
25
+ * The effective tsc `rootDir`/`outDir` of the compilation, recorded in the
26
+ * assembly metadata. Defaults to the values of the jsii config.
41
27
  */
42
- constructor(projectInfo: ProjectInfo, system: ts.System, program: ts.Program, stdlib: string, options?: AssemblerOptions);
43
- get customTransformers(): ts.CustomTransformers;
28
+ readonly tscRootDir?: string;
29
+ readonly tscOutDir?: string;
30
+ }
31
+ export declare class Assembler {
32
+ private readonly options;
33
+ private readonly ts;
34
+ private readonly checker;
35
+ private readonly program;
36
+ private readonly project;
37
+ private readonly root;
38
+ private readonly assemblyName;
39
+ private readonly entry;
40
+ private readonly defaultStability?;
41
+ private currentStability?;
42
+ private readonly types;
43
+ private readonly submodules;
44
+ private readonly typeFqnBySymbolId;
45
+ private readonly exported;
46
+ private readonly _jsDocTagsCache;
47
+ private readonly _docCommentCache;
48
+ private readonly _sourceTextCache;
49
+ private _docCacheHits;
50
+ /** Number of doc-read cache hits (RPCs avoided). Exposed for perf reporting. */
51
+ get docCacheHits(): number;
52
+ /** The jsii diagnostics (warnings and errors) collected while assembling. */
53
+ get diagnostics(): readonly JsiiDiagnostic[];
54
+ private readonly _diagnostics;
55
+ /** The jsii features the assembly makes use of (classic `usedFeatures`). */
56
+ private readonly usedFeatures;
57
+ /** FQNs of classes without their own constructor, whose initializer is the base type's. */
58
+ private readonly inheritsInitializer;
59
+ /** Declaration rank of each own type FQN, for ordering union constituents (see _declarationRank). */
60
+ private readonly declarationRanks;
61
+ private programFileIndex?;
62
+ private readonly externalDeps;
63
+ private readonly externalTypeByFqn;
64
+ private readonly externalFqnBySymbolId;
65
+ private readonly externalAssemblies;
66
+ private readonly externalDepDirs;
67
+ private readonly stripDeprecated;
68
+ private stripAllowList?;
69
+ private readonly strippedTypeSymIds;
70
+ constructor(ts: TypeScriptApi, project: TypeScriptProject, options: AssemblerOptions);
44
71
  /**
45
- * Attempt emitting the JSII assembly for the program.
46
- *
47
- * @return the result of the assembly emission.
72
+ * Build the assembly. Mirrors strada `Assembler.emit()`'s high-level flow:
73
+ * load dependency assemblies, walk module exports, register types, visit each.
48
74
  */
49
- emit(): ts.EmitResult;
50
- private _afterEmit;
75
+ assemble(): spec.Assembly;
76
+ private _resolveAlias;
51
77
  /**
52
- * Defer a callback until a (set of) types are available
53
- *
54
- * This is a helper function around _defer() which encapsulates the _dereference
55
- * action (which is basically the majority use case for _defer anyway).
56
- *
57
- * Will not invoke the function with any 'undefined's; an error will already have been emitted in
58
- * that case anyway.
59
- *
60
- * @param fqn FQN of the current type (the type that has a dependency on baseTypes)
61
- * @param baseTypes Array of type references to be looked up
62
- * @param referencingNode Node to report a diagnostic on if we fail to look up a type
63
- * @param cb Callback to be invoked with the Types corresponding to the TypeReferences in baseTypes
78
+ * Whether every declaration of the symbol carries the `@jsii ignore` directive.
79
+ * All declarations must be ignored so that a partially-ignored merged
80
+ * declaration stays a visible part of the public API, as in the classic
81
+ * compiler. The tags of a symbol are aggregated over its declarations, so a
82
+ * merged declaration is checked per declaration on the raw JSDoc text.
64
83
  */
65
- private _deferUntilTypesAvailable;
84
+ private _isIgnored;
85
+ private _isDeprecated;
66
86
  /**
67
- * Defer checks for after the program has been entirely processed; useful for verifying type references that may not
68
- * have been discovered yet, and verifying properties about them.
69
- *
70
- * The callback is guaranteed to be executed only after all deferreds for all types in 'dependedFqns' have
71
- * been executed.
72
- *
73
- * @param fqn FQN of the current type.
74
- * @param dependedFqns List of FQNs of types this callback depends on. All deferreds for all
75
- * @param cb the function to be called in a deferred way. It will be bound with ``this``, so it can depend on using
76
- * ``this``.
87
+ * Memoized `symbol.getJsDocTags(checker)`. The same symbol's tags are consulted
88
+ * multiple times per member (isInternal + isDeprecated + _visitDocumentation),
89
+ * and each call is an out-of-process round-trip. Keyed by the symbol's first
90
+ * declaration coordinate `path:index` (a NodeHandle field readable WITHOUT a
91
+ * resolve() RPC and stable across re-materialization — unlike `symbol.id`,
92
+ * which is undefined/unstable here and made the previous cache inert). Results
93
+ * are value-identical to the uncached call (pure read), so parity is unaffected.
77
94
  */
78
- private _defer;
95
+ private _jsDocTags;
79
96
  /**
80
- * Obtains the ``spec.Type`` for a given ``spec.NamedTypeReference``.
81
- *
82
- * @param ref the type reference to be de-referenced
83
- *
84
- * @returns the de-referenced type, if it was found, otherwise ``undefined``.
97
+ * The documentation comment of a symbol with `{@link ...}` references rendered
98
+ * the way the classic language service did (`buildLinkParts`): a link whose
99
+ * name resolves keeps its text verbatim, `{@link Name text}`; a link that does
100
+ * not resolve (or uses a `#member` name, which the classic checker never
101
+ * resolved) is rendered as `{@link Name` + ' ' + `text}`, which is where the
102
+ * trailing space in `{@link Foo }` comes from. The TypeScript 7 checker renders
103
+ * links as plain text, so the raw JSDoc block is consulted when it has links.
85
104
  */
86
- private _dereference;
105
+ private _docCommentWithClassicLinks;
106
+ /** Whether a `{@link A.b.c}` name resolves at `location` (classic `getSymbolAtLocation` on the link name). */
107
+ private _resolvesLinkName;
108
+ /** Memoized `symbol.getDocumentationComment(checker)` (keyed by declaration coordinate). */
109
+ private _docComment;
110
+ /** Stable per-symbol key from its first declaration's (path, index); undefined if none. */
111
+ private _symbolDocKey;
87
112
  /**
88
- * Compute the JSII fully qualified name corresponding to a ``ts.Type`` instance. If for any reason a name cannot be
89
- * computed for the type, a marker is returned instead, and an ``ts.DiagnosticCategory.Error`` diagnostic is
90
- * inserted in the assembler context.
91
- *
92
- * @param type the type for which a JSII fully qualified name is needed.
93
- * @param typeAnnotationNode the type annotation for which this FQN is generated. This is used for attaching the error
94
- * marker. When there is no explicit type annotation (e.g: inferred method return type), the
95
- * preferred substitute is the "type-inferred" element's name.
96
- * @param typeUse the reason why this type was resolved (e.g: "return type")
97
- * @param isThisType whether this type was specified or inferred as "this" or not
98
- *
99
- * @returns the FQN of the type, or some "unknown" marker.
113
+ * Documentation is read per symbol: on TypeScript 7.1 the request-batching
114
+ * combinator was measured slower than individual requests for this workload.
115
+ * Kept as a no-op hook so call sites document where a prefetch would go.
100
116
  */
101
- private _getFQN;
117
+ private _prefetchDocs;
118
+ private _shouldStrip;
119
+ private _loadDependencyAssemblies;
102
120
  /**
103
- * For all modules in the dependency closure, crawl their exports to register
104
- * the submodules they contain.
105
- *
106
- * @param entryPoint the main source file for the currently compiled module.
121
+ * The (alias-resolved) symbol of a heritage-clause entry (`extends X` /
122
+ * `implements X`). Newer API clients materialize some resolved child nodes
123
+ * (e.g. the `expression` of ExpressionWithTypeArguments) as local-only
124
+ * objects that `getSymbolAtLocation` rejects, so prefer resolving the base
125
+ * TYPE at the heritage node itself and taking its symbol.
107
126
  */
108
- private _registerDependenciesNamespaces;
109
- private _registerNamespaces;
127
+ private _heritageBaseSymbol;
128
+ /** `checker.getSymbolAtLocation` that tolerates local-only / missing nodes. */
129
+ private _symbolAtNodeSafe;
130
+ /** The alias symbol of the type at a node (e.g. a TypeReference to a type alias). */
131
+ private _aliasSymbolAt;
110
132
  /**
111
- * Registers Symbols to a particular submodule. This is used to associate
112
- * declarations exported by an `export * as ns from 'moduleLike';` statement
113
- * so that they can subsequently be correctly namespaced.
114
- *
115
- * @param ns the symbol that identifies the submodule.
116
- * @param moduleLike the module-like symbol bound to the submodule.
117
- * @param packageRoot the root of the package being traversed.
133
+ * The loaded jsii dependency a declaration path belongs to, if any: the
134
+ * dependency whose (real) directory is a prefix of the path, falling back to
135
+ * the `node_modules/<name>/` segment for paths that were not resolved.
118
136
  */
119
- private _addToSubmodule;
137
+ private _dependencyOfPath;
138
+ private _externalFqnOf;
139
+ private _registerModuleExports;
140
+ private _registerType;
120
141
  /**
121
- * Register exported types in ``this.types``.
142
+ * The assembly entry for a submodule (classic `_registerNamespaces`): the
143
+ * location of the `export * as ns from '...'` (or `export namespace ns`)
144
+ * declaration, its symbolId and, for module-file submodules, the targets
145
+ * configured in the module's `.jsiirc.json` and its README.
122
146
  *
123
- * @param node a node found in a module
124
- * @param namePrefix the prefix for the types' namespaces
147
+ * @param exportSym the (alias) symbol the submodule is exported as
148
+ * @param moduleSym the resolved module-like symbol
149
+ * @param isModuleFile whether the submodule is a source file (vs an inline namespace)
125
150
  */
126
- private _visitNode;
127
- private getSymbolId;
128
- private _validateHeritageClauses;
129
- private declarationLocation;
130
- private _processBaseInterfaces;
131
- private _visitClass;
132
- /**
133
- * Use the TypeChecker's getTypeFromTypeNode, but throw a descriptive error if it fails
134
- */
135
- private _getTypeFromTypeNode;
151
+ private _submoduleSpec;
136
152
  /**
137
- * Check that this class doesn't declare any members that are of different staticness in itself or any of its bases
153
+ * Make sure that no 2 submodules are emitting into the same target namespaces
154
+ * (classic `validateSubmoduleConfigs`).
138
155
  */
139
- private _verifyNoStaticMixing;
156
+ private _validateSubmoduleConfigs;
140
157
  /**
141
- * Wrapper around _deferUntilTypesAvailable, invoke the callback with the given classes' base type
158
+ * Records the inheritance relationships of members and the jsii features the
159
+ * assembly uses, then returns the sorted feature list (or `undefined` when
160
+ * there is none; classic `_assemblyFeatures`).
142
161
  *
143
- * Does nothing if the given class doesn't have a base class.
144
- *
145
- * The second argument will be a `recurse` function for easy recursion up the inheritance tree
146
- * (no messing around with binding 'self' and 'this' and doing multiple calls to _withBaseClass.)
162
+ * This is the data-producing half of the classic validator's
163
+ * `_inheritanceDoesNotChangeContracts` pass: every member of a class that
164
+ * redeclares a member of a base class gets `overrides` set to that base, and
165
+ * members (own or inherited) that implement an interface member get
166
+ * `overrides` set to that interface, with class overrides taking precedence.
167
+ * `class-covariant-overrides` is recorded when an override changes the type
168
+ * of a non-static member in an allowed covariant way (immutable properties and
169
+ * method return types only). The diagnostics half of that pass (contract
170
+ * violations) is not performed here.
147
171
  */
148
- private _withBaseClass;
172
+ private _finalizeInheritance;
149
173
  /**
150
- * Whether a symbol is marked with the `@jsii ignore` directive on *all* of its
151
- * declarations. We require every declaration to be ignored so that emission
152
- * (`_visitNode`) and reference resolution (`_isPrivateOrInternal`) agree: a
153
- * partially-ignored merged declaration stays a visible part of the public API.
174
+ * Declaration rank of a type FQN for union ordering: own types by (program file
175
+ * order, position in file); types of dependencies before them, by name.
154
176
  */
155
- private _isIgnored;
177
+ private _declarationRank;
178
+ private _registerDeclarationRank;
156
179
  /**
157
- * @returns true if this member is internal and should be omitted from the type manifest
180
+ * The symbolId of a symbol, computed by the same `symbolIdentifier` the
181
+ * classic compiler (and jsii-rosetta) use: the path is made relative to the
182
+ * package the declaration lives in, with the package's `jsii.outdir` and, when
183
+ * an assembly is given, its tscOutDir -> tscRootDir mapping applied.
158
184
  */
159
- private _isPrivateOrInternal;
185
+ private _symbolIdOf;
186
+ private _visitNode;
160
187
  private _visitEnum;
161
- private assertNoDuplicateEnumValues;
162
- /**
163
- * Return docs for a symbol
164
- */
165
- private _visitDocumentation;
166
- /**
167
- * Check that all parameters the doc block refers to with a @param declaration actually exist
168
- */
169
- private _validateReferencedDocParams;
170
188
  private _visitInterface;
171
- private _visitMethod;
172
- private _warnAboutReservedWords;
173
- private _visitProperty;
174
- private _toParameter;
175
- private _typeReference;
176
- private _optionalValue;
177
- /**
178
- * Validate the restrictions on an intersection type reference
179
- *
180
- * - Type only consists of (behavioral) interface types
181
- * - For all types referenced in the intersection, the definitions of all shared
182
- * members must match exactly.
183
- */
184
- private validateIntersectionType;
185
- private comparePropForIntersection;
186
- private compareMethodForIntersection;
187
- private callDeferredsInOrder;
188
189
  /**
189
- * Return the set of all (inherited) properties of an interface
190
+ * Fixpoint post-pass for datatype propagation: an interface loses `datatype`
191
+ * when any of its base interfaces is not a datatype (classic Assembler's
192
+ * "Calculate datatype based on the datatypeness of this interface and all of
193
+ * its parents", run via _deferUntilTypesAvailable). External bases are looked
194
+ * up in the loaded dependency assemblies.
190
195
  */
191
- private allProperties;
196
+ private _propagateDatatype;
192
197
  /**
193
- * Return the set of all (inherited) methods of an interface
198
+ * Flatten a type's base interfaces the way strada's `_processBaseInterfaces`
199
+ * does: keep public/exported base interfaces as `interfaces` entries, but for
200
+ * private/internal bases, erase them and recurse into *their* bases (so their
201
+ * public ancestors surface, and their members get re-listed on this type).
202
+ *
203
+ * `getBaseTypes()` alone under-reports for interfaces whose heritage goes
204
+ * through erased/aliased/multi-`extends` chains — recursion fixes that.
194
205
  */
195
- private allMethods;
196
- private allInterfacesRecursively;
197
- private _verifyConsecutiveOptionals;
206
+ private _processBaseInterfaces;
207
+ private _visitClass;
208
+ private _visitMembers;
198
209
  /**
199
- * Updates the runtime type info with the fully-qualified name for the current class definition.
200
- * Used by the runtime type info injector to add this information to the compiled file.
210
+ * Documentation of a class/interface member, inherited like the classic
211
+ * services did it (`findBaseOfDeclaration`): a member without JSDoc of its own
212
+ * takes the documentation of the same-named member of the first super type
213
+ * (`extends` then `implements`, recursively) that documents it. The TypeScript 7
214
+ * checker already follows base classes, but not implemented interfaces, so the
215
+ * walk is done here when the checker returns nothing.
201
216
  */
202
- private registerExportedClassFqn;
217
+ private _visitMemberDocumentation;
218
+ private _visitMethod;
219
+ private _visitProperty;
220
+ private _visitParameter;
203
221
  /**
204
- * Return only those submodules from the submodules list that are submodules inside this
205
- * assembly.
222
+ * Extract the `@param <name>` description for a parameter from the JSDoc
223
+ * block that immediately precedes its owning function declaration. Returns
224
+ * undefined when the declaration has no JSDoc or no matching @param tag.
206
225
  */
207
- private mySubmodules;
208
- private findPackageInfo;
226
+ private _paramDocComment;
227
+ /** Source text of a declaration's file (client-side cache; no RPC). */
228
+ private _sourceTextOf;
229
+ /** The last JSDoc block in a node's leading trivia, or undefined. */
230
+ private _leadingJsDocBlock;
231
+ /** Margin-stripped lines of a JSDoc block. */
232
+ private _jsDocLines;
233
+ /** Full text of an inline JSDoc block attached to a declaration, or undefined. */
234
+ private _inlineJsDocText;
209
235
  /**
210
- * Validate types against input/output positions in functions and APIs
211
- *
212
- * Currently used to validate that intersection types are only used in input position,
213
- * not output position
236
+ * Build a jsii docs object from a declaration's leading JSDoc, mirroring what
237
+ * `_visitDocumentation` produces from the symbol doc APIs (summary/remarks +
238
+ * the doc tags jsii consumes). Used for constructor (initializer) docs, where
239
+ * no symbol-level doc read exists on the ts path.
214
240
  */
215
- private validateTypesAgainstPositions;
241
+ private _docsFromDeclJsDoc;
216
242
  /**
217
- * Make sure that no 2 submodules are emitting into the same target namespaces
243
+ * TS5 `findBaseOfDeclaration` fallback for constructor parameters: the first
244
+ * super type (extends/implements, in source order) that has a PROPERTY named
245
+ * like the parameter contributes that property's documentation; the search
246
+ * stops at the first super type owning such a property even when its docs
247
+ * are empty. Method parameters have no such fallback.
218
248
  */
219
- private validateSubmoduleConfigs;
220
- }
221
- export interface AssemblerOptions {
249
+ private _inheritedCtorParamDoc;
222
250
  /**
223
- * Whether to remove `@deprecated` members from the generated assembly.
224
- *
225
- * @default false
251
+ * TS5 `findBaseOfDeclaration` search: the first super type (extends /
252
+ * implements, in source order) of a class/interface declaration that has a
253
+ * property with the given name contributes that property's documentation —
254
+ * even when empty (the search stops there). Doc resolution for the found
255
+ * property is itself recursive: a class element with no own JSDoc inherits
256
+ * from ITS super types (e.g. a getter overriding an interface property).
226
257
  */
227
- readonly stripDeprecated?: boolean;
258
+ private _inheritedPropDocFromBases;
228
259
  /**
229
- * If `stripDeprecated` is true, and a file is provided here, only the FQNs
230
- * present in the file will actually be removed. This can be useful when
231
- * you wish to deprecate some elements without actually removing them.
232
- *
233
- * @default undefined
260
+ * Documentation text of a member symbol, read from source (the tsgo doc APIs
261
+ * return an empty comment for several of these members — one of the JSDoc
262
+ * behaviour gaps this backend works around). A constructor parameter
263
+ * property's docs come from an inline JSDoc on the parameter or the
264
+ * constructor's `@param` tag; other members use their leading JSDoc. Empty
265
+ * own docs recurse into the owner's super types.
234
266
  */
235
- readonly stripDeprecatedAllowListFile?: string;
267
+ private _symbolDocTextFromSource;
268
+ private _unionNodeOf;
236
269
  /**
237
- * Whether to inject code that warns when a deprecated element is used.
238
- *
239
- * @default false
270
+ * Client-side array-type check to avoid an out-of-process `checker.isArrayType`
271
+ * RPC on every type reference (~85k on aws-cdk-lib). `type.isTypeReference()`
272
+ * is a local objectFlags bit; the target's symbol name (`Array`/`ReadonlyArray`
273
+ * from a `lib.*.d.ts`) is resolved client-side after the global Array type is
274
+ * fetched once. Verified to produce identical `.jsii` vs `checker.isArrayType`.
240
275
  */
241
- readonly addDeprecationWarnings?: boolean;
276
+ private _isArrayType;
277
+ /** Whether the symbol's first declaration lives in a standard-library lib.*.d.ts. */
278
+ private _isStdlibDecl;
279
+ private _typeReference;
280
+ private _unionTypeReference;
242
281
  /**
243
- * Whether to compress the assembly.
244
- *
245
- * @default false
282
+ * Build an intersection type reference (`A & B`), e.g. jsii models
283
+ * `IFooRef & IGrantable` as `{ intersection: { types: [...] } }`. Mirrors
284
+ * strada's `type.isIntersection()` branch: each constituent is turned into a
285
+ * type reference, deduplicated.
246
286
  */
247
- readonly compressAssembly?: boolean;
287
+ private _intersectionTypeReference;
288
+ private _visitDocumentation;
289
+ private _splitSummary;
290
+ private _withDefaultDocs;
291
+ private _locationOf;
292
+ private _buildAssembly;
248
293
  }
294
+ /**
295
+ * Port of the classic Assembler's `isInterfaceName`: a name denotes a
296
+ * behavioral interface when it starts with `I` and the second character is
297
+ * uppercase (so `IonicColumnProps` is not treated as one).
298
+ */
299
+ export declare function isInterfaceName(name: string): boolean;
300
+ /** Whether a declaration path points into a TypeScript standard-library `lib.*.d.ts`. */
301
+ export declare function isStdlibDeclPath(declPath: string): boolean;
302
+ /** Split a doc comment block into the summary sentence and the remaining remarks. */
303
+ export declare function splitSummary(docBlock: string): {
304
+ summary?: string;
305
+ remarks?: string;
306
+ };
249
307
  //# sourceMappingURL=assembler.d.ts.map