just-scripts 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1022 +0,0 @@
1
- /**
2
- * This class represents the TypeScript compiler state. This allows an optimization where multiple invocations
3
- * of API Extractor can reuse the same TypeScript compiler analysis.
4
- *
5
- * @public
6
- */
7
- export declare class CompilerState {
8
- /**
9
- * The TypeScript compiler's `Program` object, which represents a complete scope of analysis.
10
- */
11
- readonly program: unknown;
12
- private constructor();
13
- /**
14
- * Create a compiler state for use with the specified `IExtractorInvokeOptions`.
15
- */
16
- static create(extractorConfig: ExtractorConfig, options?: ICompilerStateCreateOptions): CompilerState;
17
- /**
18
- * Given a list of absolute file paths, return a list containing only the declaration
19
- * files. Duplicates are also eliminated.
20
- *
21
- * @remarks
22
- * The tsconfig.json settings specify the compiler's input (a set of *.ts source files,
23
- * plus some *.d.ts declaration files used for legacy typings). However API Extractor
24
- * analyzes the compiler's output (a set of *.d.ts entry point files, plus any legacy
25
- * typings). This requires API Extractor to generate a special file list when it invokes
26
- * the compiler.
27
- *
28
- * Duplicates are removed so that entry points can be appended without worrying whether they
29
- * may already appear in the tsconfig.json file list.
30
- */
31
- private static _generateFilePathsForAnalysis;
32
- private static _createCompilerHost;
33
- }
34
- /**
35
- * Unique identifiers for console messages reported by API Extractor.
36
- *
37
- * @remarks
38
- *
39
- * These strings are possible values for the {@link ExtractorMessage.messageId} property
40
- * when the `ExtractorMessage.category` is {@link ExtractorMessageCategory.Console}.
41
- *
42
- * @public
43
- */
44
- export declare const enum ConsoleMessageId {
45
- /**
46
- * "Found metadata in ___"
47
- */
48
- FoundTSDocMetadata = "console-found-tsdoc-metadata",
49
- /**
50
- * "Writing: ___"
51
- */
52
- WritingDocModelFile = "console-writing-doc-model-file",
53
- /**
54
- * "Writing package typings: ___"
55
- */
56
- WritingDtsRollup = "console-writing-dts-rollup",
57
- /**
58
- * "You have changed the public API signature for this project.
59
- * Please copy the file ___ to ___, or perform a local build (which does this automatically).
60
- * See the Git repo documentation for more info."
61
- *
62
- * OR
63
- *
64
- * "The API report file is missing.
65
- * Please copy the file ___ to ___, or perform a local build (which does this automatically).
66
- * See the Git repo documentation for more info."
67
- */
68
- ApiReportNotCopied = "console-api-report-not-copied",
69
- /**
70
- * "You have changed the public API signature for this project. Updating ___"
71
- */
72
- ApiReportCopied = "console-api-report-copied",
73
- /**
74
- * "The API report is up to date: ___"
75
- */
76
- ApiReportUnchanged = "console-api-report-unchanged",
77
- /**
78
- * "The API report file was missing, so a new file was created. Please add this file to Git: ___"
79
- */
80
- ApiReportCreated = "console-api-report-created",
81
- /**
82
- * "Unable to create the API report file. Please make sure the target folder exists: ___"
83
- */
84
- ApiReportFolderMissing = "console-api-report-folder-missing",
85
- /**
86
- * Used for the information printed when the "--diagnostics" flag is enabled.
87
- */
88
- Diagnostics = "console-diagnostics"
89
- }
90
- /**
91
- * The starting point for invoking the API Extractor tool.
92
- * @public
93
- */
94
- export declare class Extractor {
95
- /**
96
- * Returns the version number of the API Extractor NPM package.
97
- */
98
- static readonly version: string;
99
- /**
100
- * Returns the package name of the API Extractor NPM package.
101
- */
102
- static readonly packageName: string;
103
- private static _getPackageJson;
104
- /**
105
- * Load the api-extractor.json config file from the specified path, and then invoke API Extractor.
106
- */
107
- static loadConfigAndInvoke(configFilePath: string, options?: IExtractorInvokeOptions): ExtractorResult;
108
- /**
109
- * Invoke API Extractor using an already prepared `ExtractorConfig` object.
110
- */
111
- static invoke(extractorConfig: ExtractorConfig, options?: IExtractorInvokeOptions): ExtractorResult;
112
- private static _generateRollupDtsFile;
113
- }
114
- /**
115
- * The `ExtractorConfig` class loads, validates, interprets, and represents the api-extractor.json config file.
116
- * @public
117
- */
118
- export declare class ExtractorConfig {
119
- /**
120
- * The JSON Schema for API Extractor config file (api-extractor.schema.json).
121
- * Actual type is `JsonSchema` from `@rushstack/node-core-library`.
122
- */
123
- static readonly jsonSchema: unknown;
124
- /**
125
- * The config file name "api-extractor.json".
126
- */
127
- static readonly FILENAME: string;
128
- private static readonly _defaultConfig;
129
- private static readonly _declarationFileExtensionRegExp;
130
- /** {@inheritDoc IConfigFile.projectFolder} */
131
- readonly projectFolder: string;
132
- /**
133
- * The parsed package.json file for the working package, or undefined if API Extractor was invoked without
134
- * a package.json file.
135
- * Actual type is `INodePackageJson` from `@rushstack/node-core-library`.
136
- */
137
- readonly packageJson: unknown | undefined;
138
- /**
139
- * The absolute path of the folder containing the package.json file for the working package, or undefined
140
- * if API Extractor was invoked without a package.json file.
141
- */
142
- readonly packageFolder: string | undefined;
143
- /** {@inheritDoc IConfigFile.mainEntryPointFilePath} */
144
- readonly mainEntryPointFilePath: string;
145
- /** {@inheritDoc IConfigFile.bundledPackages} */
146
- readonly bundledPackages: string[];
147
- /** {@inheritDoc IConfigCompiler.tsconfigFilePath} */
148
- readonly tsconfigFilePath: string;
149
- /** {@inheritDoc IConfigCompiler.overrideTsconfig} */
150
- readonly overrideTsconfig: {} | undefined;
151
- /** {@inheritDoc IConfigCompiler.skipLibCheck} */
152
- readonly skipLibCheck: boolean;
153
- /** {@inheritDoc IConfigApiReport.enabled} */
154
- readonly apiReportEnabled: boolean;
155
- /** The `reportFolder` path combined with the `reportFileName`. */
156
- readonly reportFilePath: string;
157
- /** The `reportTempFolder` path combined with the `reportFileName`. */
158
- readonly reportTempFilePath: string;
159
- /** {@inheritDoc IConfigDocModel.enabled} */
160
- readonly docModelEnabled: boolean;
161
- /** {@inheritDoc IConfigDocModel.apiJsonFilePath} */
162
- readonly apiJsonFilePath: string;
163
- /** {@inheritDoc IConfigDtsRollup.enabled} */
164
- readonly rollupEnabled: boolean;
165
- /** {@inheritDoc IConfigDtsRollup.untrimmedFilePath} */
166
- readonly untrimmedFilePath: string;
167
- /** {@inheritDoc IConfigDtsRollup.betaTrimmedFilePath} */
168
- readonly betaTrimmedFilePath: string;
169
- /** {@inheritDoc IConfigDtsRollup.publicTrimmedFilePath} */
170
- readonly publicTrimmedFilePath: string;
171
- /** {@inheritDoc IConfigDtsRollup.omitTrimmingComments} */
172
- readonly omitTrimmingComments: boolean;
173
- /** {@inheritDoc IConfigTsdocMetadata.enabled} */
174
- readonly tsdocMetadataEnabled: boolean;
175
- /** {@inheritDoc IConfigTsdocMetadata.tsdocMetadataFilePath} */
176
- readonly tsdocMetadataFilePath: string;
177
- /**
178
- * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files
179
- * will be written with Windows-style newlines.
180
- */
181
- readonly newlineKind: '\r\n' | '\n' | 'os';
182
- /** {@inheritDoc IConfigFile.messages} */
183
- readonly messages: IExtractorMessagesConfig;
184
- /** {@inheritDoc IConfigFile.testMode} */
185
- readonly testMode: boolean;
186
- private constructor();
187
- /**
188
- * Returns a JSON-like string representing the `ExtractorConfig` state, which can be printed to a console
189
- * for diagnostic purposes.
190
- *
191
- * @remarks
192
- * This is used by the "--diagnostics" command-line option. The string is not intended to be deserialized;
193
- * its format may be changed at any time.
194
- */
195
- getDiagnosticDump(): string;
196
- /**
197
- * Returns a simplified file path for use in error messages.
198
- * @internal
199
- */
200
- _getShortFilePath(absolutePath: string): string;
201
- /**
202
- * Loads the api-extractor.json config file from the specified file path, and prepares an `ExtractorConfig` object.
203
- *
204
- * @remarks
205
- * Loads the api-extractor.json config file from the specified file path. If the "extends" field is present,
206
- * the referenced file(s) will be merged. For any omitted fields, the API Extractor default values are merged.
207
- *
208
- * The result is prepared using `ExtractorConfig.prepare()`.
209
- */
210
- static loadFileAndPrepare(configJsonFilePath: string): ExtractorConfig;
211
- /**
212
- * Performs only the first half of {@link ExtractorConfig.loadFileAndPrepare}, providing an opportunity to
213
- * modify the object before it is passed to {@link ExtractorConfig.prepare}.
214
- *
215
- * @remarks
216
- * Loads the api-extractor.json config file from the specified file path. If the "extends" field is present,
217
- * the referenced file(s) will be merged. For any omitted fields, the API Extractor default values are merged.
218
- */
219
- static loadFile(jsonFilePath: string): IConfigFile;
220
- private static _resolveConfigFileRelativePaths;
221
- private static _resolveConfigFileRelativePath;
222
- /**
223
- * Prepares an `ExtractorConfig` object using a configuration that is provided as a runtime object,
224
- * rather than reading it from disk. This allows configurations to be constructed programmatically,
225
- * loaded from an alternate source, and/or customized after loading.
226
- */
227
- static prepare(options: IExtractorConfigPrepareOptions): ExtractorConfig;
228
- private static _resolvePathWithTokens;
229
- private static _expandStringWithTokens;
230
- /**
231
- * Returns true if the specified file path has the ".d.ts" file extension.
232
- */
233
- static hasDtsFileExtension(filePath: string): boolean;
234
- /**
235
- * Given a path string that may have originally contained expandable tokens such as `<projectFolder>"`
236
- * this reports an error if any token-looking substrings remain after expansion (e.g. `c:\blah\<invalid>\blah`).
237
- */
238
- private static _rejectAnyTokensInPath;
239
- }
240
- /**
241
- * Used with {@link IConfigMessageReportingRule.logLevel} and {@link IExtractorInvokeOptions.messageCallback}.
242
- *
243
- * @remarks
244
- * This is part of the {@link IConfigFile} structure.
245
- *
246
- * @public
247
- */
248
- export declare const enum ExtractorLogLevel {
249
- /**
250
- * The message will be displayed as an error.
251
- *
252
- * @remarks
253
- * Errors typically cause the build to fail and return a nonzero exit code.
254
- */
255
- Error = "error",
256
- /**
257
- * The message will be displayed as an warning.
258
- *
259
- * @remarks
260
- * Warnings typically cause a production build fail and return a nonzero exit code. For a non-production build
261
- * (e.g. using the `--local` option with `api-extractor run`), the warning is displayed but the build will not fail.
262
- */
263
- Warning = "warning",
264
- /**
265
- * The message will be displayed as an informational message.
266
- *
267
- * @remarks
268
- * Informational messages may contain newlines to ensure nice formatting of the output,
269
- * however word-wrapping is the responsibility of the message handler.
270
- */
271
- Info = "info",
272
- /**
273
- * The message will be displayed only when "verbose" output is requested, e.g. using the `--verbose`
274
- * command line option.
275
- */
276
- Verbose = "verbose",
277
- /**
278
- * The message will be discarded entirely.
279
- */
280
- None = "none"
281
- }
282
- /**
283
- * This object is used to report an error or warning that occurred during API Extractor's analysis.
284
- *
285
- * @public
286
- */
287
- export declare class ExtractorMessage {
288
- private _handled;
289
- private _logLevel;
290
- /**
291
- * The category of issue.
292
- */
293
- readonly category: ExtractorMessageCategory;
294
- /**
295
- * A text string that uniquely identifies the issue type. This identifier can be used to suppress
296
- * or configure the reporting of issues, and also to search for help about an issue.
297
- * Actual type includes `tsdoc.TSDocMessageId`.
298
- */
299
- readonly messageId: unknown | ExtractorMessageId | ConsoleMessageId | string;
300
- /**
301
- * The text description of this issue.
302
- */
303
- readonly text: string;
304
- /**
305
- * The absolute path to the affected input source file, if there is one.
306
- */
307
- readonly sourceFilePath: string | undefined;
308
- /**
309
- * The line number where the issue occurred in the input source file. This is not used if `sourceFilePath`
310
- * is undefined. The first line number is 1.
311
- */
312
- readonly sourceFileLine: number | undefined;
313
- /**
314
- * The column number where the issue occurred in the input source file. This is not used if `sourceFilePath`
315
- * is undefined. The first column number is 1.
316
- */
317
- readonly sourceFileColumn: number | undefined;
318
- /**
319
- * Additional contextual information about the message that may be useful when reporting errors.
320
- * All properties are optional.
321
- */
322
- readonly properties: IExtractorMessageProperties;
323
- /** @internal */
324
- constructor(options: IExtractorMessageOptions);
325
- /**
326
- * If the {@link IExtractorInvokeOptions.messageCallback} sets this property to true, it will prevent the message
327
- * from being displayed by API Extractor.
328
- *
329
- * @remarks
330
- * If the `messageCallback` routes the message to a custom handler (e.g. a toolchain logger), it should
331
- * assign `handled = true` to prevent API Extractor from displaying it. Assigning `handled = true` for all messages
332
- * would effectively disable all console output from the `Extractor` API.
333
- *
334
- * If `handled` is set to true, the message will still be included in the count of errors/warnings;
335
- * to discard a message entirely, instead assign `logLevel = none`.
336
- */
337
- handled: boolean;
338
- /**
339
- * Specifies how the message should be reported.
340
- *
341
- * @remarks
342
- * If the {@link IExtractorInvokeOptions.messageCallback} handles the message (i.e. sets `handled = true`),
343
- * it can use the `logLevel` to determine how to display the message.
344
- *
345
- * Alternatively, if API Extractor is handling the message, the `messageCallback` could assign `logLevel` to change
346
- * how it will be processed. However, in general the recommended practice is to configure message routing
347
- * using the `messages` section in api-extractor.json.
348
- *
349
- * To discard a message entirely, assign `logLevel = none`.
350
- */
351
- logLevel: ExtractorLogLevel;
352
- /**
353
- * Returns the message formatted with its identifier and file position.
354
- * @remarks
355
- * Example:
356
- * ```
357
- * src/folder/File.ts:123:4 - (ae-extra-release-tag) The doc comment should not contain more than one release tag.
358
- * ```
359
- */
360
- formatMessageWithLocation(workingPackageFolderPath: string | undefined): string;
361
- formatMessageWithoutLocation(): string;
362
- }
363
- /**
364
- * Specifies a category of messages for use with {@link ExtractorMessage}.
365
- * @public
366
- */
367
- export declare const enum ExtractorMessageCategory {
368
- /**
369
- * Messages originating from the TypeScript compiler.
370
- *
371
- * @remarks
372
- * These strings begin with the prefix "TS" and have a numeric error code.
373
- * Example: `TS2551`
374
- */
375
- Compiler = "Compiler",
376
- /**
377
- * Messages related to parsing of TSDoc comments.
378
- *
379
- * @remarks
380
- * These strings begin with the prefix "tsdoc-".
381
- * Example: `tsdoc-link-tag-unescaped-text`
382
- */
383
- TSDoc = "TSDoc",
384
- /**
385
- * Messages related to API Extractor's analysis.
386
- *
387
- * @remarks
388
- * These strings begin with the prefix "ae-".
389
- * Example: `ae-extra-release-tag`
390
- */
391
- Extractor = "Extractor",
392
- /**
393
- * Console messages communicate the progress of the overall operation. They may include newlines to ensure
394
- * nice formatting. They are output in real time, and cannot be routed to the API Report file.
395
- *
396
- * @remarks
397
- * These strings begin with the prefix "console-".
398
- * Example: `console-writing-typings-file`
399
- */
400
- Console = "console"
401
- }
402
- /**
403
- * Unique identifiers for messages reported by API Extractor during its analysis.
404
- *
405
- * @remarks
406
- *
407
- * These strings are possible values for the {@link ExtractorMessage.messageId} property
408
- * when the `ExtractorMessage.category` is {@link ExtractorMessageCategory.Extractor}.
409
- *
410
- * @public
411
- */
412
- export declare const enum ExtractorMessageId {
413
- /**
414
- * "The doc comment should not contain more than one release tag."
415
- */
416
- ExtraReleaseTag = "ae-extra-release-tag",
417
- /**
418
- * "This symbol has another declaration with a different release tag."
419
- */
420
- DifferentReleaseTags = "ae-different-release-tags",
421
- /**
422
- * "The symbol ___ is marked as ___, but its signature references ___ which is marked as ___."
423
- */
424
- IncompatibleReleaseTags = "ae-incompatible-release-tags",
425
- /**
426
- * "___ is exported by the package, but it is missing a release tag (`@alpha`, `@beta`, `@public`, or `@internal`)."
427
- */
428
- MissingReleaseTag = "ae-missing-release-tag",
429
- /**
430
- * "The `@packageDocumentation` comment must appear at the top of entry point *.d.ts file."
431
- */
432
- MisplacedPackageTag = "ae-misplaced-package-tag",
433
- /**
434
- * "The symbol ___ needs to be exported by the entry point ___."
435
- */
436
- ForgottenExport = "ae-forgotten-export",
437
- /**
438
- * "The name ___ should be prefixed with an underscore because the declaration is marked as `@internal`."
439
- */
440
- InternalMissingUnderscore = "ae-internal-missing-underscore",
441
- /**
442
- * "Mixed release tags are not allowed for ___ because one of its declarations is marked as `@internal`."
443
- */
444
- InternalMixedReleaseTag = "ae-internal-mixed-release-tag",
445
- /**
446
- * "The `@preapproved` tag cannot be applied to ___ because it is not a supported declaration type."
447
- */
448
- PreapprovedUnsupportedType = "ae-preapproved-unsupported-type",
449
- /**
450
- * "The `@preapproved` tag cannot be applied to ___ without an `@internal` release tag."
451
- */
452
- PreapprovedBadReleaseTag = "ae-preapproved-bad-release-tag",
453
- /**
454
- * "The `@inheritDoc` reference could not be resolved."
455
- */
456
- UnresolvedInheritDocReference = "ae-unresolved-inheritdoc-reference",
457
- /**
458
- * "The `@inheritDoc` tag needs a TSDoc declaration reference; signature matching is not supported yet."
459
- *
460
- * @privateRemarks
461
- * In the future, we will implement signature matching so that you can write `{@inheritDoc}` and API Extractor
462
- * will find a corresponding member from a base class (or implemented interface). Until then, the tag
463
- * always needs an explicit declaration reference such as `{@inhertDoc MyBaseClass.sameMethod}`.
464
- */
465
- UnresolvedInheritDocBase = "ae-unresolved-inheritdoc-base",
466
- /**
467
- * "The `@inheritDoc` tag for ___ refers to its own declaration."
468
- */
469
- CyclicInheritDoc = "ae-cyclic-inherit-doc",
470
- /**
471
- * "The `@link` reference could not be resolved."
472
- */
473
- UnresolvedLink = "ae-unresolved-link",
474
- /**
475
- * "The doc comment for the property ___ must appear on the getter, not the setter."
476
- */
477
- SetterWithDocs = "ae-setter-with-docs",
478
- /**
479
- * "The property ___ has a setter but no getter."
480
- */
481
- MissingGetter = "ae-missing-getter"
482
- }
483
- /**
484
- * This object represents the outcome of an invocation of API Extractor.
485
- *
486
- * @public
487
- */
488
- export declare class ExtractorResult {
489
- /**
490
- * The TypeScript compiler state that was used.
491
- */
492
- readonly compilerState: CompilerState;
493
- /**
494
- * The API Extractor configuration that was used.
495
- */
496
- readonly extractorConfig: ExtractorConfig;
497
- /**
498
- * Whether the invocation of API Extractor was successful. For example, if `succeeded` is false, then the build task
499
- * would normally return a nonzero process exit code, indicating that the operation failed.
500
- *
501
- * @remarks
502
- *
503
- * Normally the operation "succeeds" if `errorCount` and `warningCount` are both zero. However if
504
- * {@link IExtractorInvokeOptions.localBuild} is `true`, then the operation "succeeds" if `errorCount` is zero
505
- * (i.e. warnings are ignored).
506
- */
507
- readonly succeeded: boolean;
508
- /**
509
- * Returns true if the API report was found to have changed.
510
- */
511
- readonly apiReportChanged: boolean;
512
- /**
513
- * Reports the number of errors encountered during analysis.
514
- *
515
- * @remarks
516
- * This does not count exceptions, where unexpected issues prematurely abort the operation.
517
- */
518
- readonly errorCount: number;
519
- /**
520
- * Reports the number of warnings encountered during analysis.
521
- *
522
- * @remarks
523
- * This does not count warnings that are emitted in the API report file.
524
- */
525
- readonly warningCount: number;
526
- /** @internal */
527
- constructor(properties: ExtractorResult);
528
- }
529
- /**
530
- * Options for {@link CompilerState.create}
531
- * @public
532
- */
533
- export declare interface ICompilerStateCreateOptions {
534
- /** {@inheritDoc IExtractorInvokeOptions.typescriptCompilerFolder} */
535
- typescriptCompilerFolder?: string;
536
- /**
537
- * Additional .d.ts files to include in the analysis.
538
- */
539
- additionalEntryPoints?: string[];
540
- }
541
- /**
542
- * Configures how the API report files (*.api.md) will be generated.
543
- *
544
- * @remarks
545
- * This is part of the {@link IConfigFile} structure.
546
- *
547
- * @public
548
- */
549
- export declare interface IConfigApiReport {
550
- /**
551
- * Whether to generate an API report.
552
- */
553
- enabled: boolean;
554
- /**
555
- * The filename for the API report files. It will be combined with `reportFolder` or `reportTempFolder` to produce
556
- * a full output filename.
557
- *
558
- * @remarks
559
- * The file extension should be ".api.md", and the string should not contain a path separator such as `\` or `/`.
560
- */
561
- reportFileName?: string;
562
- /**
563
- * Specifies the folder where the API report file is written. The file name portion is determined by
564
- * the `reportFileName` setting.
565
- *
566
- * @remarks
567
- * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,
568
- * e.g. for an API review.
569
- *
570
- * The path is resolved relative to the folder of the config file that contains the setting; to change this,
571
- * prepend a folder token such as `<projectFolder>`.
572
- */
573
- reportFolder?: string;
574
- /**
575
- * Specifies the folder where the temporary report file is written. The file name portion is determined by
576
- * the `reportFileName` setting.
577
- *
578
- * @remarks
579
- * After the temporary file is written to disk, it is compared with the file in the `reportFolder`.
580
- * If they are different, a production build will fail.
581
- *
582
- * The path is resolved relative to the folder of the config file that contains the setting; to change this,
583
- * prepend a folder token such as `<projectFolder>`.
584
- */
585
- reportTempFolder?: string;
586
- }
587
- /**
588
- * Determines how the TypeScript compiler engine will be invoked by API Extractor.
589
- *
590
- * @remarks
591
- * This is part of the {@link IConfigFile} structure.
592
- *
593
- * @public
594
- */
595
- export declare interface IConfigCompiler {
596
- /**
597
- * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
598
- *
599
- * @remarks
600
- * The path is resolved relative to the folder of the config file that contains the setting; to change this,
601
- * prepend a folder token such as `<projectFolder>`.
602
- *
603
- * Note: This setting will be ignored if `overrideTsconfig` is used.
604
- */
605
- tsconfigFilePath?: string;
606
- /**
607
- * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
608
- *
609
- * @remarks
610
- * The value must conform to the TypeScript tsconfig schema:
611
- *
612
- * http://json.schemastore.org/tsconfig
613
- *
614
- * If omitted, then the tsconfig.json file will instead be read from the projectFolder.
615
- */
616
- overrideTsconfig?: {};
617
- /**
618
- * This option causes the compiler to be invoked with the `--skipLibCheck` option.
619
- *
620
- * @remarks
621
- * This option is not recommended and may cause API Extractor to produce incomplete or incorrect declarations,
622
- * but it may be required when dependencies contain declarations that are incompatible with the TypeScript engine
623
- * that API Extractor uses for its analysis. Where possible, the underlying issue should be fixed rather than
624
- * relying on skipLibCheck.
625
- */
626
- skipLibCheck?: boolean;
627
- }
628
- /**
629
- * Configures how the doc model file (*.api.json) will be generated.
630
- *
631
- * @remarks
632
- * This is part of the {@link IConfigFile} structure.
633
- *
634
- * @public
635
- */
636
- export declare interface IConfigDocModel {
637
- /**
638
- * Whether to generate a doc model file.
639
- */
640
- enabled: boolean;
641
- /**
642
- * The output path for the doc model file. The file extension should be ".api.json".
643
- *
644
- * @remarks
645
- * The path is resolved relative to the folder of the config file that contains the setting; to change this,
646
- * prepend a folder token such as `<projectFolder>`.
647
- */
648
- apiJsonFilePath?: string;
649
- }
650
- /**
651
- * Configures how the .d.ts rollup file will be generated.
652
- *
653
- * @remarks
654
- * This is part of the {@link IConfigFile} structure.
655
- *
656
- * @public
657
- */
658
- export declare interface IConfigDtsRollup {
659
- /**
660
- * Whether to generate the .d.ts rollup file.
661
- */
662
- enabled: boolean;
663
- /**
664
- * Specifies the output path for a .d.ts rollup file to be generated without any trimming.
665
- *
666
- * @remarks
667
- * This file will include all declarations that are exported by the main entry point.
668
- *
669
- * If the path is an empty string, then this file will not be written.
670
- *
671
- * The path is resolved relative to the folder of the config file that contains the setting; to change this,
672
- * prepend a folder token such as `<projectFolder>`.
673
- */
674
- untrimmedFilePath?: string;
675
- /**
676
- * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
677
- *
678
- * @remarks
679
- * This file will include only declarations that are marked as `@public` or `@beta`.
680
- *
681
- * The path is resolved relative to the folder of the config file that contains the setting; to change this,
682
- * prepend a folder token such as `<projectFolder>`.
683
- */
684
- betaTrimmedFilePath?: string;
685
- /**
686
- * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
687
- *
688
- * @remarks
689
- * This file will include only declarations that are marked as `@public`.
690
- *
691
- * If the path is an empty string, then this file will not be written.
692
- *
693
- * The path is resolved relative to the folder of the config file that contains the setting; to change this,
694
- * prepend a folder token such as `<projectFolder>`.
695
- */
696
- publicTrimmedFilePath?: string;
697
- /**
698
- * When a declaration is trimmed, by default it will be replaced by a code comment such as
699
- * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the
700
- * declaration completely.
701
- */
702
- omitTrimmingComments?: boolean;
703
- }
704
- /**
705
- * Configuration options for the API Extractor tool. These options can be constructed programmatically
706
- * or loaded from the api-extractor.json config file using the {@link ExtractorConfig} class.
707
- *
708
- * @public
709
- */
710
- export declare interface IConfigFile {
711
- /**
712
- * Optionally specifies another JSON config file that this file extends from. This provides a way for
713
- * standard settings to be shared across multiple projects.
714
- *
715
- * @remarks
716
- * If the path starts with `./` or `../`, the path is resolved relative to the folder of the file that contains
717
- * the `extends` field. Otherwise, the first path segment is interpreted as an NPM package name, and will be
718
- * resolved using NodeJS `require()`.
719
- */
720
- extends?: string;
721
- /**
722
- * Determines the `<projectFolder>` token that can be used with other config file settings. The project folder
723
- * typically contains the tsconfig.json and package.json config files, but the path is user-defined.
724
- *
725
- * @remarks
726
- *
727
- * The path is resolved relative to the folder of the config file that contains the setting.
728
- *
729
- * The default value for `projectFolder` is the token `<lookup>`, which means the folder is determined by traversing
730
- * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder
731
- * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error
732
- * will be reported.
733
- */
734
- projectFolder?: string;
735
- /**
736
- * Specifies the .d.ts file to be used as the starting point for analysis. API Extractor
737
- * analyzes the symbols exported by this module.
738
- *
739
- * @remarks
740
- *
741
- * The file extension must be ".d.ts" and not ".ts".
742
- * The path is resolved relative to the "projectFolder" location.
743
- */
744
- mainEntryPointFilePath: string;
745
- /**
746
- * A list of NPM package names whose exports should be treated as part of this package.
747
- *
748
- * @remarks
749
- *
750
- * For example, suppose that Webpack is used to generate a distributed bundle for the project `library1`,
751
- * and another NPM package `library2` is embedded in this bundle. Some types from `library2` may become part
752
- * of the exported API for `library1`, but by default API Extractor would generate a .d.ts rollup that explicitly
753
- * imports `library2`. To avoid this, we can specify:
754
- *
755
- * ```js
756
- * "bundledPackages": [ "library2" ],
757
- * ```
758
- *
759
- * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been
760
- * local files for `library1`.
761
- */
762
- bundledPackages?: string[];
763
- /**
764
- * {@inheritDoc IConfigCompiler}
765
- */
766
- compiler?: IConfigCompiler;
767
- /**
768
- * {@inheritDoc IConfigApiReport}
769
- */
770
- apiReport?: IConfigApiReport;
771
- /**
772
- * {@inheritDoc IConfigDocModel}
773
- */
774
- docModel?: IConfigDocModel;
775
- /**
776
- * {@inheritDoc IConfigDtsRollup}
777
- * @beta
778
- */
779
- dtsRollup?: IConfigDtsRollup;
780
- /**
781
- * {@inheritDoc IConfigTsdocMetadata}
782
- * @beta
783
- */
784
- tsdocMetadata?: IConfigTsdocMetadata;
785
- /**
786
- * Specifies what type of newlines API Extractor should use when writing output files.
787
- *
788
- * @remarks
789
- * By default, the output files will be written with Windows-style newlines.
790
- * To use POSIX-style newlines, specify "lf" instead.
791
- * To use the OS's default newline kind, specify "os".
792
- */
793
- newlineKind?: 'crlf' | 'lf' | 'os';
794
- /**
795
- * {@inheritDoc IExtractorMessagesConfig}
796
- */
797
- messages?: IExtractorMessagesConfig;
798
- /**
799
- * Set to true when invoking API Extractor's test harness.
800
- * @remarks
801
- * When `testMode` is true, the `toolVersion` field in the .api.json file is assigned an empty string
802
- * to prevent spurious diffs in output files tracked for tests.
803
- */
804
- testMode?: boolean;
805
- }
806
- /**
807
- * Configures reporting for a given message identifier.
808
- *
809
- * @remarks
810
- * This is part of the {@link IConfigFile} structure.
811
- *
812
- * @public
813
- */
814
- export declare interface IConfigMessageReportingRule {
815
- /**
816
- * Specifies whether the message should be written to the the tool's output log.
817
- *
818
- * @remarks
819
- * Note that the `addToApiReportFile` property may supersede this option.
820
- */
821
- logLevel: ExtractorLogLevel;
822
- /**
823
- * When `addToApiReportFile` is true: If API Extractor is configured to write an API report file (.api.md),
824
- * then the message will be written inside that file; otherwise, the message is instead logged according to
825
- * the `logLevel` option.
826
- */
827
- addToApiReportFile?: boolean;
828
- }
829
- /**
830
- * Specifies a table of reporting rules for different message identifiers, and also the default rule used for
831
- * identifiers that do not appear in the table.
832
- *
833
- * @remarks
834
- * This is part of the {@link IConfigFile} structure.
835
- *
836
- * @public
837
- */
838
- export declare interface IConfigMessageReportingTable {
839
- /**
840
- * The key is a message identifier for the associated type of message, or "default" to specify the default policy.
841
- * For example, the key might be `TS2551` (a compiler message), `tsdoc-link-tag-unescaped-text` (a TSDOc message),
842
- * or `ae-extra-release-tag` (a message related to the API Extractor analysis).
843
- */
844
- [messageId: string]: IConfigMessageReportingRule;
845
- }
846
- /**
847
- * Configures how the tsdoc-metadata.json file will be generated.
848
- *
849
- * @remarks
850
- * This is part of the {@link IConfigFile} structure.
851
- *
852
- * @public
853
- */
854
- export declare interface IConfigTsdocMetadata {
855
- /**
856
- * Whether to generate the tsdoc-metadata.json file.
857
- */
858
- enabled: boolean;
859
- /**
860
- * Specifies where the TSDoc metadata file should be written.
861
- *
862
- * @remarks
863
- * The path is resolved relative to the folder of the config file that contains the setting; to change this,
864
- * prepend a folder token such as `<projectFolder>`.
865
- *
866
- * The default value is `<lookup>`, which causes the path to be automatically inferred from the `tsdocMetadata`,
867
- * `typings` or `main` fields of the project's package.json. If none of these fields are set, the lookup
868
- * falls back to `tsdoc-metadata.json` in the package folder.
869
- */
870
- tsdocMetadataFilePath?: string;
871
- }
872
- /**
873
- * Options for {@link ExtractorConfig.prepare}.
874
- *
875
- * @public
876
- */
877
- export declare interface IExtractorConfigPrepareOptions {
878
- /**
879
- * A configuration object as returned by {@link ExtractorConfig.loadFile}.
880
- */
881
- configObject: IConfigFile;
882
- /**
883
- * The absolute path of the file that the `configObject` object was loaded from. This is used for error messages
884
- * and when probing for `tsconfig.json`.
885
- *
886
- * @remarks
887
- *
888
- * If this is omitted, then the `projectFolder` must not be specified using the `<lookup>` token.
889
- */
890
- configObjectFullPath: string | undefined;
891
- /**
892
- * The parsed package.json file for the working package, or undefined if API Extractor was invoked without
893
- * a package.json file.
894
- * Actual type is `INodePackageJson` from `@rushstack/node-core-library`.
895
- *
896
- * @remarks
897
- *
898
- * If omitted, then the `<unscopedPackageName>` and `<packageName>` tokens will have default values.
899
- */
900
- packageJson?: unknown | undefined;
901
- /**
902
- * The absolute path of the file that the `packageJson` object was loaded from, or undefined if API Extractor
903
- * was invoked without a package.json file.
904
- *
905
- * @remarks
906
- *
907
- * This is used for error messages and when resolving paths found in package.json.
908
- *
909
- * If `packageJsonFullPath` is specified but `packageJson` is omitted, the file will be loaded automatically.
910
- */
911
- packageJsonFullPath: string | undefined;
912
- }
913
- /**
914
- * Runtime options for Extractor.
915
- *
916
- * @public
917
- */
918
- export declare interface IExtractorInvokeOptions {
919
- /**
920
- * An optional TypeScript compiler state. This allows an optimization where multiple invocations of API Extractor
921
- * can reuse the same TypeScript compiler analysis.
922
- */
923
- compilerState?: CompilerState;
924
- /**
925
- * Indicates that API Extractor is running as part of a local build, e.g. on developer's
926
- * machine.
927
- *
928
- * @remarks
929
- * This disables certain validation that would normally be performed for a ship/production build. For example,
930
- * the *.api.md report file is automatically updated in a local build.
931
- *
932
- * The default value is false.
933
- */
934
- localBuild?: boolean;
935
- /**
936
- * If true, API Extractor will include {@link ExtractorLogLevel.Verbose} messages in its output.
937
- */
938
- showVerboseMessages?: boolean;
939
- /**
940
- * If true, API Extractor will print diagnostic information used for troubleshooting problems.
941
- * These messages will be included as {@link ExtractorLogLevel.Verbose} output.
942
- *
943
- * @remarks
944
- * Setting `showDiagnostics=true` forces `showVerboseMessages=true`.
945
- */
946
- showDiagnostics?: boolean;
947
- /**
948
- * Specifies an alternate folder path to be used when loading the TypeScript system typings.
949
- *
950
- * @remarks
951
- * API Extractor uses its own TypeScript compiler engine to analyze your project. If your project
952
- * is built with a significantly different TypeScript version, sometimes API Extractor may report compilation
953
- * errors due to differences in the system typings (e.g. lib.dom.d.ts). You can use the "--typescriptCompilerFolder"
954
- * option to specify the folder path where you installed the TypeScript package, and API Extractor's compiler will
955
- * use those system typings instead.
956
- */
957
- typescriptCompilerFolder?: string;
958
- /**
959
- * An optional callback function that will be called for each `ExtractorMessage` before it is displayed by
960
- * API Extractor. The callback can customize the message, handle it, or discard it.
961
- *
962
- * @remarks
963
- * If a `messageCallback` is not provided, then by default API Extractor will print the messages to
964
- * the STDERR/STDOUT console.
965
- */
966
- messageCallback?: (message: ExtractorMessage) => void;
967
- }
968
- /**
969
- * Constructor options for `ExtractorMessage`.
970
- */
971
- declare interface IExtractorMessageOptions {
972
- category: ExtractorMessageCategory;
973
- /** Actual type includes `tsdoc.TSDocMessageId`. */
974
- messageId: unknown | ExtractorMessageId | ConsoleMessageId | string;
975
- text: string;
976
- sourceFilePath?: string;
977
- sourceFileLine?: number;
978
- sourceFileColumn?: number;
979
- properties?: IExtractorMessageProperties;
980
- logLevel?: ExtractorLogLevel;
981
- }
982
- /**
983
- * Used by {@link ExtractorMessage.properties}.
984
- *
985
- * @public
986
- */
987
- export declare interface IExtractorMessageProperties {
988
- /**
989
- * A declaration can have multiple names if it is exported more than once.
990
- * If an `ExtractorMessage` applies to a specific export name, this property can indicate that.
991
- *
992
- * @remarks
993
- *
994
- * Used by {@link ExtractorMessageId.InternalMissingUnderscore}.
995
- */
996
- readonly exportName?: string;
997
- }
998
- /**
999
- * Configures how API Extractor reports error and warning messages produced during analysis.
1000
- *
1001
- * @remarks
1002
- * This is part of the {@link IConfigFile} structure.
1003
- *
1004
- * @public
1005
- */
1006
- export declare interface IExtractorMessagesConfig {
1007
- /**
1008
- * Configures handling of diagnostic messages generating the TypeScript compiler while analyzing the
1009
- * input .d.ts files.
1010
- */
1011
- compilerMessageReporting?: IConfigMessageReportingTable;
1012
- /**
1013
- * Configures handling of messages reported by API Extractor during its analysis.
1014
- */
1015
- extractorMessageReporting?: IConfigMessageReportingTable;
1016
- /**
1017
- * Configures handling of messages reported by the TSDoc parser when analyzing code comments.
1018
- */
1019
- tsdocMessageReporting?: IConfigMessageReportingTable;
1020
- }
1021
- export {};
1022
- //# sourceMappingURL=apiExtractorTypes.d.ts.map