@arcgis/api-extractor 5.0.0-next.98 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +2 -3
  2. package/dist/ApiExtractor-DIxlsiLk.js +2664 -0
  3. package/dist/apiHelpers-BYzO767m.js +161 -0
  4. package/dist/apiJson.d.ts +706 -760
  5. package/dist/cli-7PX_wNxb.js +34 -0
  6. package/dist/cli.js +50 -7
  7. package/dist/compilerHints.d.ts +62 -0
  8. package/dist/diff/apiDiffToMarkdown.d.ts +9 -0
  9. package/dist/diff/apiDiffToMarkdown.js +140 -0
  10. package/dist/diff/diffApiJson.d.ts +8 -5
  11. package/dist/diff/diffApiJson.js +260 -0
  12. package/dist/diff/fetchApiJsonFromNpm.d.ts +5 -2
  13. package/dist/diff/fetchApiJsonFromNpm.js +9 -0
  14. package/dist/diff/types.d.ts +71 -56
  15. package/dist/diffTypes/index.d.ts +20 -23
  16. package/dist/diffTypes/index.js +4 -2
  17. package/dist/extractor/ApiExtractor.d.ts +64 -137
  18. package/dist/extractor/ApiExtractor.js +9 -0
  19. package/dist/extractor/config.d.ts +459 -39
  20. package/dist/extractor/config.js +18 -0
  21. package/dist/extractor/extractors/copyDoc.d.ts +25 -0
  22. package/dist/extractor/processing/links.d.ts +15 -0
  23. package/dist/extractor/processing/links.js +172 -0
  24. package/dist/extractor/types.d.ts +19 -0
  25. package/dist/extractor/webComponent/findComponents.d.ts +19 -0
  26. package/dist/extractor/webComponent/findComponents.js +36 -0
  27. package/dist/extractor/webComponent/pathMapping.d.ts +11 -0
  28. package/dist/extractor/webComponent/pathMapping.js +44 -0
  29. package/dist/index.d.ts +164 -12
  30. package/dist/index.js +3 -837
  31. package/dist/typeScript-Dsim-EQC.js +64 -0
  32. package/dist/uiUtils/index.d.ts +10 -19
  33. package/dist/uiUtils/index.js +3 -55
  34. package/dist/utils/apiHelpers.d.ts +28 -61
  35. package/dist/utils/apiHelpers.js +17 -0
  36. package/dist/utils/astHelpers.d.ts +22 -21
  37. package/dist/utils/astHelpers.js +67 -0
  38. package/dist/utils/createIndex.d.ts +30 -0
  39. package/dist/utils/createIndex.js +81 -0
  40. package/dist/utils/hydrateApiType.d.ts +26 -0
  41. package/dist/utils/hydrateApiType.js +62 -0
  42. package/dist/utils/inferEntrypoints.d.ts +17 -0
  43. package/dist/utils/inferEntrypoints.js +26 -0
  44. package/dist/utils/internalTypeScriptApis.d.ts +92 -0
  45. package/dist/utils/internalTypeScriptApis.js +58 -0
  46. package/dist/utils/partPrinter.d.ts +25 -19
  47. package/dist/utils/partPrinter.js +82 -0
  48. package/dist/vite/plugin.d.ts +53 -0
  49. package/dist/vite/plugin.js +107 -0
  50. package/dist/vite/typeScript.d.ts +16 -0
  51. package/dist/vite/typeScript.js +6 -0
  52. package/dist/worker-1ouniZM0.js +3680 -0
  53. package/package.json +43 -9
  54. package/dist/cli.d.ts +0 -2
  55. package/dist/config/typeReferences/docLinkAdditions.d.ts +0 -51
  56. package/dist/config/typeReferences/globals.d.ts +0 -11
  57. package/dist/config/typeReferences/stringDocLinkAdditions.d.ts +0 -17
  58. package/dist/config/typeReferences/typeScriptGlobals.json.d.ts +0 -3
  59. package/dist/diff/index.d.ts +0 -3
  60. package/dist/diff/index.js +0 -149
  61. package/dist/ensureCemCompatibility.d.ts +0 -1
  62. package/dist/internalTypeScriptApis.d.ts +0 -31
  63. package/dist/types.d.ts +0 -22
  64. package/dist/utils/error.d.ts +0 -17
  65. package/dist/utils/jsDocHelpers.d.ts +0 -2
  66. package/dist/utils/jsDocParser.d.ts +0 -46
  67. package/dist/utils/jsDocPrinter.d.ts +0 -13
  68. package/dist/utils/print.d.ts +0 -6
@@ -1,41 +1,259 @@
1
- import { CopyDocDefinitions } from '../types.ts';
1
+ import type ts from "typescript";
2
+ import type { PackageJson } from "@arcgis/components-build-utils";
3
+ import type { CopyDocDefinitions } from "./extractors/copyDoc.js";
4
+ import type { ApiExtractor } from "./ApiExtractor.js";
5
+ import type { TypeScriptConfigResult } from "../vite/typeScript.js";
6
+ import type { ApiModule } from "../apiJson.js";
7
+ import type { ApiExtractorResult } from "./types.js";
8
+
2
9
  export interface ApiExtractorConfig {
3
- /**
4
- * The environment in which the extractor is running.
5
- *
6
- * @public
7
- * @default "production"
8
- */
9
- readonly environment?: "development" | "production";
10
- /**
11
- * The path to the root of the project to extract.
12
- *
13
- * @public
14
- * @default process.cwd()
15
- */
16
- readonly cwd?: string;
17
- /**
18
- * @public
19
- * @default undefined
20
- */
21
- readonly copyDocDefinitions?: CopyDocDefinitions;
22
- /** @public */
23
- readonly typeReplacements?: TypeReplacements;
24
- /**
25
- * api-extractor automatically discovers files that contain `@public`. Not
26
- * having to manually maintain a list of entries saves labor.
27
- *
28
- * As a performance optimization, you can exclude some directories from
29
- * `@public` file discovery. This should be a flat list of folders inside
30
- * basePath without slashes or deep paths.
31
- *
32
- * @public
33
- * @example ["tests"]
34
- */
35
- readonly excludedDirectories?: Set<string>;
36
- /** @public */
37
- readonly noInheritMembers?: NoInheritMembers;
10
+ readonly context?: ApiExtractorContextConfig;
11
+ readonly types?: ApiExtractorTypesConfig;
12
+ readonly documentation?: ApiExtractorDocumentationConfig;
13
+ readonly verify?: ApiExtractorVerifyConfig;
14
+ readonly watch?: ApiExtractorWatchConfig;
15
+ /**
16
+ * API Extractor is strict about ensuring public APIs only reference types
17
+ * that were in turn explicitly marked as public. This avoids unintentionally
18
+ * exposing private details. For packages in the process of transition to this
19
+ * stricter syntax, you can temporarily disable the strictness.
20
+ *
21
+ * Under strict:false, the following checks are relaxed:
22
+ * - Web components, and their `@property()`, `@method()`, and events are
23
+ * implicitly public. The types referenced by them are also implicitly
24
+ * public. This behavior is suppressed if `@private` JSDoc tag is present.
25
+ * - If public function/method doesn't have explicit `@param` for each
26
+ * parameter, an error is suppressed.
27
+ *
28
+ * @default // false in Lumina web component projects (temporary). true otherwise.
29
+ */
30
+ readonly strict?: boolean;
31
+ /**
32
+ * This function will be called after the api.json is created but before it is
33
+ * used to generate any output files.
34
+ *
35
+ * You can mutate the api.json to affect the types, lazy component metadata
36
+ * and documentation.
37
+ *
38
+ * @param result
39
+ */
40
+ afterApiJsonCreate?(result: Pick<ApiExtractorResult, "apiJson">): void;
38
41
  }
42
+
43
+ /**
44
+ * Extraction context. Tells what to do and how. If running inside Vite, most
45
+ * of these options will be set automatically.
46
+ */
47
+ export interface ApiExtractorContextConfig {
48
+ /**
49
+ * The path for emitting .d.ts files
50
+ *
51
+ * @default // "" (do not emit) if running standalone. "dist/" if running in Vite.
52
+ * @example "dist/"
53
+ */
54
+ readonly dtsEmitPath?: string;
55
+ /**
56
+ * Whether to delete any existing .d.ts files in dtsEmitPath before emitting
57
+ * new ones.
58
+ *
59
+ * @default config.dtsEmitPath !== undefined && config.environment === "production"
60
+ */
61
+ readonly emptyDtsEmitPath?: boolean;
62
+ /**
63
+ * The path for emitting api.json.
64
+ *
65
+ * @default "" // (do not emit)
66
+ * @example "dist/docs/api.json"
67
+ */
68
+ readonly apiJsonEmitPath?: string;
69
+ /**
70
+ * The environment in which the extractor is running.
71
+ *
72
+ * @default // "production" if running standalone. Inherits Vite environment if running in Vite.
73
+ */
74
+ readonly environment?: "development" | "production";
75
+ /**
76
+ * The path to the root of the project to extract.
77
+ *
78
+ * @default // process.cwd() if running standalone. Vite's root if running in Vite.
79
+ */
80
+ readonly cwd?: string;
81
+ /**
82
+ * The cwd-relative folder inside which all public API lives. Extractor will
83
+ * look at public declarations only inside this folder. All JSDoc links should
84
+ * be relative to this folder. The path must not start with ./ and must use
85
+ * / over \ as path separators.
86
+ *
87
+ * @default "src/"
88
+ */
89
+ readonly basePath?: string;
90
+ /**
91
+ * The project's package.json dependencies.
92
+ * This will be used to verify that public declarations only depend on
93
+ * packages that are declared as runtime dependencies in the package.json.
94
+ *
95
+ * @default // Will be retrieved from the nearest package.json
96
+ */
97
+ readonly packageJson?: Pick<PackageJson, "dependencies" | "exports" | "name" | "peerDependencies">;
98
+ /**
99
+ * Customize where the log messages are sent.
100
+ * Defaults to console.log and console.error.
101
+ *
102
+ * @default // If running in Vite, will use Vite's configured logger. Otherwise, uses console.
103
+ */
104
+ readonly logger?: {
105
+ info: (message: string) => void;
106
+ error: (message: string) => void;
107
+ };
108
+ /**
109
+ * API Extractor automatically discovers files that contain `@public`. Not
110
+ * having to manually maintain a list of entries saves labor.
111
+ *
112
+ * As a performance optimization, you can exclude some directories from
113
+ * `@public` file discovery. This should be a flat list of folders inside
114
+ * basePath without slashes or nested paths.
115
+ *
116
+ * @example ["tests"]
117
+ */
118
+ readonly excludedDirectories?: Set<string>;
119
+ /**
120
+ * A flag to enable the bare minimal extraction in a Lumina web component
121
+ * project. This powers lazy-loading in the Lumina development server.
122
+ * It skips resolving types, does not use type checker, and only extracts
123
+ * web components.
124
+ *
125
+ * @default false
126
+ */
127
+ readonly isLuminaMinimalExtraction?: boolean;
128
+ /**
129
+ * To produce lazy-loading metadata, Lumina sets this flag to make api.json
130
+ * include private components as well. Such private components are filtered
131
+ * out before the api.json is written, and never appear in .d.ts files.
132
+ *
133
+ * @default false
134
+ */
135
+ readonly includeLuminaPrivateComponents?: boolean;
136
+ /**
137
+ * @deprecated
138
+ * @default false
139
+ */
140
+ readonly supportApplyMixinsSyntax?: boolean;
141
+ }
142
+
143
+ /** Options that primarily impact type checking and the types output. */
144
+ export interface ApiExtractorTypesConfig {
145
+ /**
146
+ * If type checker is used for extraction, fewer type annotations will be
147
+ * required.
148
+ * For example, given `property = myHelper()`, without type checking, the
149
+ * public type will look like `property: ReturnType<typeof myHelper>`. However,
150
+ * this is not very pretty in the docs, and extractor will error if `myHelper`
151
+ * is not public. For such cases, you either need to provide an explicit type
152
+ * annotation (`property: MyType = myHelper()`) or enable type checked
153
+ * extraction, and the type will be inferred by the type checker.
154
+ *
155
+ * Type checked extraction is slower. However, if you are type checking your
156
+ * project anyway as part of build, you can deduplicate that work by enabling
157
+ * type checked extraction and the ApiExtractorTypesConfig.fullTypeCheck
158
+ * option.
159
+ *
160
+ * Example performance impact:
161
+ * If doing full type check, typed extraction is practically free:
162
+ *
163
+ * ```log
164
+ * [@arcgis/api-extractor] Type checked in 0.911s
165
+ * [@arcgis/api-extractor] Extracted 5 \@public files in 0.008s
166
+ * ```
167
+ *
168
+ * Otherwise, on-the-fly type checking adds some overhead, but still cheaper
169
+ * than full type check:
170
+ *
171
+ * ```log
172
+ * [@arcgis/api-extractor] Extracted 5 \@public files in 0.248s
173
+ * ```
174
+ *
175
+ * The impact of typed extraction is negligible on most projects. However, on
176
+ * larger codebases, especially with many non-public files it can make a 10x
177
+ * difference.
178
+ *
179
+ * @default // false if running standalone. true if running in Vite.
180
+ */
181
+ readonly typeCheckedExtraction?: boolean;
182
+ /**
183
+ * Do a full type check of the codebase. This is equivalent of running
184
+ * `npx tsc`. It type checks even non-public APIs, thus is slower than
185
+ * `typeCheckedExtraction`, but if you are type checking as part of build
186
+ * anyway, this option deduplicates work by removing the need for you to run
187
+ * type checking separately.
188
+ *
189
+ * @default // false if running standalone. true if running in Vite.
190
+ */
191
+ readonly fullTypeCheck?: boolean;
192
+ /**
193
+ * If ApiExtractorTypesConfig.fullTypeCheck is enabled, this callback will
194
+ * be invoked if any errors were console logged by TypeScript.
195
+ *
196
+ * @param diagnostics
197
+ */
198
+ afterDiagnostic?(diagnostics: readonly ts.Diagnostic[]): void;
199
+ /**
200
+ * A callback for getting reference to the TypeScript Program and TypeScript
201
+ * host instances created by the compiler.
202
+ *
203
+ * When running in Vite, this will only be called during build or Storybook
204
+ * dev server, as TypeScript program is not created when running in serve mode.
205
+ *
206
+ * @param program
207
+ * @param host
208
+ */
209
+ typeScriptInstanceCreated?(program: ts.Program, host: ts.CompilerHost): void;
210
+ /**
211
+ * Path to the tsconfig.json file.
212
+ * This is used if ApiExtractorTypesConfig.typeScriptConfig is not provided.
213
+ *
214
+ * @default "tsconfig.json"
215
+ */
216
+ readonly typeScriptConfigPath?: string;
217
+ /**
218
+ * A resolved config returned by [loadTypeScriptConfig()](https://developers.arcgis.com/javascript/latest/references/api-extractor/vite/typeScript/#loadTypeScriptConfig).
219
+ * Useful if you already resolved the config for other purposes and wish to
220
+ * deduplicate the work.
221
+ */
222
+ readonly typeScriptConfig?: TypeScriptConfigResult;
223
+ /**
224
+ * TypeScript compiler options to override the tsconfig.json settings.
225
+ * Keep these minimal to ensure extractor reports same errors as your IDE and
226
+ * standalone `npx tsc`
227
+ */
228
+ readonly compilerOptions?: ts.CompilerOptions;
229
+ /** Allows to modify the content of .d.ts files before they are emitted. */
230
+ readonly declarationTextTransformers?: DeclarationTextTransformer[];
231
+ readonly typeReplacements?: TypeReplacements;
232
+ /**
233
+ * Produce .d.ts files even if dtsEmitPath is not set. If dtsEmitPath is not
234
+ * set, the produced .d.ts will not be written to disk but will be accessible
235
+ * inside [ApiExtractorResult](https://developers.arcgis.com/javascript/latest/references/api-extractor/extractor/types/#ApiExtractorResult).
236
+ *
237
+ * This is useful if you need in-memory access to the .d.ts files or wish to
238
+ * write them yourself.
239
+ */
240
+ readonly forceProduceDts?: boolean;
241
+ }
242
+
243
+ /**
244
+ * @param original - The original declaration file.
245
+ * @param apiModule - The ApiModule corresponding to the declaration file.
246
+ * @param extractor - The ApiExtractor instance.
247
+ * @returns The transformed declaration file, or false to skip emitting this file.
248
+ */
249
+ export type DeclarationTextTransformer = (original: DeclarationFile, apiModule: ApiModule, extractor: ApiExtractor) => DeclarationFile | false;
250
+
251
+ export interface DeclarationFile {
252
+ /** Absolute file path */
253
+ filePath: string;
254
+ content: string;
255
+ }
256
+
39
257
  /**
40
258
  * Privately, arcgis-js-api has interfaces that mirror some of the most widely
41
259
  * used types. They are in the process of refactoring out many of them. Until
@@ -51,16 +269,218 @@ export interface ApiExtractorConfig {
51
269
  * there will be a collision. Detecting such collisions is tricky - extractor
52
270
  * does it minimally.
53
271
  *
54
- * @public
55
272
  * @see https://devtopia.esri.com/WebGIS/arcgis-js-api/discussions/60843
56
273
  * @see https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/69911
57
274
  * @see https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/73395
58
275
  */
59
276
  export type TypeReplacements = Record<string, Record<string, readonly [modulePath: string, name: string, type: "default" | "named"] | undefined> | undefined>;
277
+
278
+ /** Options that primarily impact the api.json and the JSDocs in .d.ts files. */
279
+ export interface ApiExtractorDocumentationConfig {
280
+ readonly copyDocDefinitions?: CopyDocDefinitions;
281
+ readonly noInheritMembers?: NoInheritMembers;
282
+ /**
283
+ * Get a prefix for a public-facing URL for each component story.
284
+ *
285
+ * @see https://webgis.esri.com/references/support-packages/storybook
286
+ * @example
287
+ * Set this to "https://developers.arcgis.com/javascript/latest/storybook/map-components/".
288
+ * This will produce URLs like
289
+ * "https://developers.arcgis.com/javascript/latest/storybook/map-components/?path=/story/arcgis-area-measurement-2d--demo&singleStory=true"
290
+ */
291
+ readonly publicStoryUrlPrefix?: string | false;
292
+ /**
293
+ * Provide a URL to a page that documents the component.
294
+ * This URL will be visible in VS Code and IntelliJ when hovering over a
295
+ * component tag in an .html file
296
+ *
297
+ * @example (tagName) => `https://developers.arcgis.com/javascript/latest/references/map-components/components/${tagName}/`
298
+ */
299
+ readonly getComponentDocsUrl?: false | ((tagName: string, className: string) => string | undefined);
300
+ /**
301
+ * Provide a URL to a page that documents the component.
302
+ * This URL will be visible in VS Code and IntelliJ when hovering over a
303
+ * component tag in an .html file
304
+ *
305
+ * If you wish to provide multiple URLs, use "getPublicStoryUrl" instead.
306
+ *
307
+ * @example (tagName) => `https://developers.arcgis.com/javascript/latest/storybook/map-components/?path=/story/${tagName}--demo&singleStory=true`
308
+ */
309
+ readonly getComponentDemoUrl?: false | ((tagName: string, className: string) => string | undefined);
310
+ /**
311
+ * Host name of the documentation site for the current environment.
312
+ *
313
+ * @default // "next.gha.afd.arcgis.com" if context.environment is "development". "developers.arcgis.com" otherwise
314
+ */
315
+ readonly host?: string;
316
+ /**
317
+ * Host name of the documentation site that is targeting the non-current environment.
318
+ * Any references to this hostname in the code will be replaced by
319
+ * [ApiExtractorDocumentationConfig](https://developers.arcgis.com/javascript/latest/references/api-extractor/extractor/config/#ApiExtractorDocumentationConfig-host).
320
+ *
321
+ * Use cases:
322
+ * - In the source code, link to internal docs only. This gives more up to date
323
+ * docs and avoids 404 errors for pages that are not yet part of public
324
+ * release.
325
+ * - In production builds, the URLs are replaced with the public docs hostname.
326
+ *
327
+ * @default // "developers.arcgis.com" if context.environment is "development". "next.gha.afd.arcgis.com" otherwise
328
+ */
329
+ readonly alternativeHost?: string;
330
+ /**
331
+ * The path inside the
332
+ * [ApiExtractorDocumentationConfig](https://developers.arcgis.com/javascript/latest/references/api-extractor/extractor/config/#ApiExtractorDocumentationConfig-host) that is used
333
+ * as the base of all documentation reference pages. Make sure this starts and
334
+ * ends with "/".
335
+ *
336
+ * @default `/javascript/latest/references/${packageJson.name.split("/").at(-1)}/`
337
+ */
338
+ readonly basePath?: string;
339
+ }
340
+
341
+ export interface ApiExtractorVerifyConfig {
342
+ /**
343
+ * Run a type checker on the emitted types to verify correctness.
344
+ *
345
+ * This is slower, but it catches many kinds of issues.
346
+ * Because emitted types strip non-public APIs, this option catches when
347
+ * public type accesses non-public properties (in this["test"], or
348
+ * Pick<this, "test">). It also catches if a class or interface is extended
349
+ * incorrectly.
350
+ *
351
+ * If your users don't have skipLibCheck:true enabled, they will see the same
352
+ * errors as what this option catches, thus this check is valuable.
353
+ *
354
+ * It is recommended to run this as part of CI or as a manual pre-release check.
355
+ *
356
+ * @default false
357
+ */
358
+ readonly typeCheckTypes?: boolean;
359
+ /**
360
+ * If there are type errors in types of dependencies you do not control,
361
+ * you can silence such errors by returning false. Ideally, you should also
362
+ * report such errors to the upstream dependency so that these errors don't
363
+ * affect your users.
364
+ *
365
+ * @param diagnostic
366
+ * @example
367
+ * ```ts
368
+ * filterTypeCheckDiagnostic: (diagnostic) =>
369
+ * !diagnostic.file?.fileName?.endsWith("node_modules/vite/dist/node/index.d.ts"),
370
+ * ```
371
+ */
372
+ filterTypeCheckDiagnostic?(diagnostic: ts.Diagnostic): boolean;
373
+ /**
374
+ * @deprecated REFACTOR: Drop this flag in 5.1
375
+ * @default false
376
+ */
377
+ readonly detectBrokenLinks?: boolean;
378
+ }
379
+
60
380
  /**
61
381
  * Don't include these members in each subclass to keep api reference pages cleaner.
62
- * These has no typings impact since their inheritance is still done by TypeScript.
382
+ * These has no types impact since their inheritance is still done by TypeScript.
63
383
  *
64
- * @public
384
+ * The structure maps module path to the list of class members inside that module.
65
385
  */
66
386
  export type NoInheritMembers = Readonly<Record<string, readonly string[]>>;
387
+
388
+ export interface ApiExtractorWatchConfig {
389
+ /**
390
+ * A callback that is invoked when any file change is detected.
391
+ * This schedules an extractor rerun. The callback is called with a promise
392
+ * that resolves with the result of the rerun. If the change that triggered
393
+ * the rerun didn't impact api.json, the promise resolves with `undefined`.
394
+ *
395
+ * @param promise
396
+ */
397
+ onUpdate?(promise: Promise<ApiExtractorWatchResult | undefined>): Promise<void> | void;
398
+ /**
399
+ * When saving multiple files in VSCode or doing Git operations, many file
400
+ * changes may trigger in a short time. To avoid excessive re-runs, we
401
+ * wait a few milliseconds before starting the re-run. If another file is
402
+ * changed during the wait, the wait restarts.
403
+ *
404
+ * @default // 50 if using type-checked extraction or full-type-check, 20 otherwise
405
+ */
406
+ readonly debounceTime?: number;
407
+ /**
408
+ * Whether to clear the console output between re-runs.
409
+ *
410
+ * @default // true if running standalone. false if running in Vite
411
+ */
412
+ readonly clearScreen?: boolean;
413
+ /**
414
+ * Whether it is safe to skip writing .d.ts for unchanged files between re-runs.
415
+ *
416
+ * @default
417
+ * // true if ApiExtractorContextConfig.emptyDtsEmitPath is false
418
+ * // and not running inside Vite or Vite's build.emptyOutDir is false.
419
+ */
420
+ readonly skipWritingUnchanged?: boolean;
421
+ }
422
+
423
+ /**
424
+ * On each re-run in watch mode, a new api.json is produced. Unchanged
425
+ * ApiModules are copied as is by reference. Changed modules are re-created,
426
+ * without mutating the old api.json.
427
+ */
428
+ export interface ApiExtractorWatchResult extends ApiExtractorResult {
429
+ /**
430
+ * The names of modules that were directly or indirectly affected by the
431
+ * changes to any watched files.
432
+ */
433
+ readonly changedModules: readonly {
434
+ readonly old: ApiModule;
435
+ readonly new: ApiModule;
436
+ }[];
437
+ /** This is empty on the first watch run. */
438
+ readonly addedModules: readonly ApiModule[];
439
+ /** > Rename is treated as removed + added. */
440
+ readonly removedModules: readonly ApiModule[];
441
+ }
442
+
443
+ /** An ApiExtractor config with all default values filled in. */
444
+ export interface ResolvedApiExtractorConfig extends MarkPropertiesNonNullable<ApiExtractorConfig> {
445
+ readonly isResolvedConfig: true;
446
+ readonly context: MarkPropertiesNonNullable<ApiExtractorContextConfig>;
447
+ readonly documentation: MarkPropertiesNonNullable<ApiExtractorDocumentationConfig>;
448
+ readonly types: MarkPropertiesNonNullable<ApiExtractorTypesConfig>;
449
+ readonly verify: MarkPropertiesNonNullable<ApiExtractorVerifyConfig>;
450
+ readonly watch: MarkPropertiesNonNullable<ApiExtractorWatchConfig>;
451
+ }
452
+
453
+ /** @experimental */
454
+ export type MarkPropertiesNonNullable<T> = {
455
+ readonly [K in keyof T]-?: NonNullable<T[K]>;
456
+ };
457
+
458
+ /**
459
+ * Find and load an ApiExtractor config file.
460
+ *
461
+ * @param cwd - If configFilePath was not provided, will load
462
+ * `api-extractor.config.ts` from this folder.
463
+ * @param configFilePath - Relative or absolute path to the config file.
464
+ * By default, will load `api-extractor.config.ts` from the cwd
465
+ * @returns The loaded config file. If configFilePath is provided but does not
466
+ * exist, throws. Otherwise, if no config exists, returns an empty config.
467
+ */
468
+ export function loadApiExtractorConfig(cwd?: string, configFilePath?: string): Promise<ApiExtractorConfig>;
469
+
470
+ /**
471
+ * @param baseConfig
472
+ * @param overrideConfig
473
+ */
474
+ export function mergeApiExtractorConfigs(baseConfig: ResolvedApiExtractorConfig, overrideConfig: ApiExtractorConfig): ResolvedApiExtractorConfig;
475
+
476
+ /**
477
+ * @param baseConfig
478
+ * @param overrideConfig
479
+ */
480
+ export function mergeApiExtractorConfigs(baseConfig: ApiExtractorConfig, overrideConfig: ResolvedApiExtractorConfig): ResolvedApiExtractorConfig;
481
+
482
+ /**
483
+ * @param baseConfig
484
+ * @param overrideConfig
485
+ */
486
+ export function mergeApiExtractorConfigs(baseConfig: ApiExtractorConfig, overrideConfig: ApiExtractorConfig): ApiExtractorConfig;
@@ -0,0 +1,18 @@
1
+ import "@arcgis/components-build-utils";
2
+ import "../typeScript-Dsim-EQC.js";
3
+ import { l as n, m as A, r as C } from "../worker-1ouniZM0.js";
4
+ import "./processing/links.js";
5
+ import "typescript";
6
+ import "fs/promises";
7
+ import "chalk";
8
+ import "util";
9
+ import "@arcgis/toolkit/string";
10
+ import "../apiHelpers-BYzO767m.js";
11
+ import "@arcgis/toolkit/function";
12
+ import "node:fs";
13
+ import "node:url";
14
+ export {
15
+ n as loadApiExtractorConfig,
16
+ A as mergeApiExtractorConfigs,
17
+ C as resolveApiExtractorConfig
18
+ };
@@ -0,0 +1,25 @@
1
+ import type { ApiClassDeclaration, ApiClassMethod, ApiCustomElementDeclaration, ApiCustomElementField, ApiEvent, ApiFunctionDeclaration, ApiInterfaceDeclaration, ApiModule, ApiVariableDeclaration } from "../../apiJson.js";
2
+
3
+ /** [Documentation](https://webgis.esri.com/webgis/core/core/documenting-api#copydoc) */
4
+ export interface CopyDocDefinitions {
5
+ properties?: CopyDocMemberDeclarations<ApiCustomElementField>;
6
+ methods?: CopyDocMemberDeclarations<ApiClassMethod>;
7
+ /**
8
+ * This is only called for web component events.
9
+ * Non-web component classes define events using the `@eventTypes` property,
10
+ * and can copy doc by creating and extending common interfaces.
11
+ */
12
+ events?: CopyDocMemberDeclarations<ApiEvent>;
13
+ classes?: CopyDocDeclarations<ApiClassDeclaration>;
14
+ customElements?: CopyDocDeclarations<ApiCustomElementDeclaration>;
15
+ functions?: CopyDocDeclarations<ApiFunctionDeclaration>;
16
+ variables?: CopyDocDeclarations<ApiVariableDeclaration>;
17
+ /** This includes both type aliases and interfaces */
18
+ interfaces?: CopyDocDeclarations<ApiInterfaceDeclaration>;
19
+ }
20
+
21
+ export type CopiableFields = "deprecated" | "description" | "docsTags" | "readonly" | "return";
22
+
23
+ export type CopyDocDeclarations<ApiType extends Partial<Record<CopiableFields, unknown>>> = Record<string, Partial<Pick<ApiType, CopiableFields>> | ((apiDeclaration: ApiType, module: ApiModule) => Partial<Pick<ApiType, CopiableFields>>) | undefined>;
24
+
25
+ export type CopyDocMemberDeclarations<ApiType extends Partial<Record<CopiableFields, unknown>>> = Record<string, Partial<Pick<ApiType, CopiableFields>> | ((apiDeclaration: ApiType, classOrComponent: ApiClassDeclaration | ApiCustomElementDeclaration, module: ApiModule) => Partial<Pick<ApiType, CopiableFields>>) | undefined>;
@@ -0,0 +1,15 @@
1
+ import type { ApiExtractor } from "../ApiExtractor.js";
2
+
3
+ /**
4
+ * Resolve a documentation view URL for a module, declaration, or member.
5
+ *
6
+ * @param modulePath
7
+ * @param apiName - Name of a declaration inside the module.
8
+ * @param memberName - Name of a member inside the declaration.
9
+ * @param extractor
10
+ * @experimental
11
+ */
12
+ export function getViewUrl(modulePath: string, apiName: string | undefined, memberName: string | undefined, extractor: Pick<ApiExtractor & {
13
+ isComponentProject: boolean;
14
+ normalizedApiReferencePrefix: string;
15
+ }, "config" | "isComponentProject" | "normalizedApiReferencePrefix">): string;