From 781037800c9c94bfb35a89ee758151f2cb879b70 Mon Sep 17 00:00:00 2001 From: Elizabeth Craig Date: Tue, 12 Nov 2019 18:57:06 -0800 Subject: [PATCH] API Extractor: Add support for custom TSDoc tags --- .../src/aedoc/AedocDefinitions.ts | 78 +++++++++++-------- .../src/items/ApiDocumentedItem.ts | 3 +- .../api-extractor-model/src/model/ApiModel.ts | 23 +++++- .../src/model/ApiPackage.ts | 6 +- .../src/model/DeserializerContext.ts | 8 ++ apps/api-extractor/src/api/ExtractorConfig.ts | 32 +++++++- apps/api-extractor/src/api/IConfigFile.ts | 52 +++++++++++++ apps/api-extractor/src/collector/Collector.ts | 2 +- .../src/schemas/api-extractor-template.json | 34 ++++++++ .../src/schemas/api-extractor.schema.json | 37 +++++++++ .../custom-tags_2019-11-13-02-57.json | 11 +++ .../custom-tags_2019-11-13-02-57.json | 11 +++ common/reviews/api/api-extractor-model.api.md | 13 ++-- common/reviews/api/api-extractor.api.md | 6 ++ 14 files changed, 267 insertions(+), 49 deletions(-) create mode 100644 common/changes/@microsoft/api-extractor-model/custom-tags_2019-11-13-02-57.json create mode 100644 common/changes/@microsoft/api-extractor/custom-tags_2019-11-13-02-57.json diff --git a/apps/api-extractor-model/src/aedoc/AedocDefinitions.ts b/apps/api-extractor-model/src/aedoc/AedocDefinitions.ts index e0625903318..f860dc43926 100644 --- a/apps/api-extractor-model/src/aedoc/AedocDefinitions.ts +++ b/apps/api-extractor-model/src/aedoc/AedocDefinitions.ts @@ -27,44 +27,56 @@ export class AedocDefinitions { syntaxKind: TSDocTagSyntaxKind.ModifierTag }); + /** + * @deprecated Use `AedocDefinitions.getTsdocConfiguration()` instead, to allow customization of supported tags + * without polluting a global object. + */ public static get tsdocConfiguration(): TSDocConfiguration { if (!AedocDefinitions._tsdocConfiguration) { - const configuration: TSDocConfiguration = new TSDocConfiguration(); - configuration.addTagDefinitions([ - AedocDefinitions.betaDocumentation, - AedocDefinitions.internalRemarks, - AedocDefinitions.preapprovedTag - ], true); - - configuration.setSupportForTags( - [ - StandardTags.alpha, - StandardTags.beta, - StandardTags.defaultValue, - StandardTags.deprecated, - StandardTags.eventProperty, - StandardTags.example, - StandardTags.inheritDoc, - StandardTags.internal, - StandardTags.link, - StandardTags.override, - StandardTags.packageDocumentation, - StandardTags.param, - StandardTags.privateRemarks, - StandardTags.public, - StandardTags.readonly, - StandardTags.remarks, - StandardTags.returns, - StandardTags.sealed, - StandardTags.virtual - ], - true - ); - - AedocDefinitions._tsdocConfiguration = configuration; + AedocDefinitions._tsdocConfiguration = AedocDefinitions.getTsdocConfiguration([]); } return AedocDefinitions._tsdocConfiguration; } private static _tsdocConfiguration: TSDocConfiguration | undefined; + + /** + * Gets a TSDoc configuration, optionally with additional supported tags. + */ + public static getTsdocConfiguration(additionalTags: ReadonlyArray = []): TSDocConfiguration { + const configuration: TSDocConfiguration = new TSDocConfiguration(); + configuration.addTagDefinitions([ + AedocDefinitions.betaDocumentation, + AedocDefinitions.internalRemarks, + AedocDefinitions.preapprovedTag, + ...additionalTags + ], true); + + configuration.setSupportForTags( + [ + StandardTags.alpha, + StandardTags.beta, + StandardTags.defaultValue, + StandardTags.deprecated, + StandardTags.eventProperty, + StandardTags.example, + StandardTags.inheritDoc, + StandardTags.internal, + StandardTags.link, + StandardTags.override, + StandardTags.packageDocumentation, + StandardTags.param, + StandardTags.privateRemarks, + StandardTags.public, + StandardTags.readonly, + StandardTags.remarks, + StandardTags.returns, + StandardTags.sealed, + StandardTags.virtual + ], + true + ); + + return configuration; + } } diff --git a/apps/api-extractor-model/src/items/ApiDocumentedItem.ts b/apps/api-extractor-model/src/items/ApiDocumentedItem.ts index 9316d479dc5..f32c5b1d80f 100644 --- a/apps/api-extractor-model/src/items/ApiDocumentedItem.ts +++ b/apps/api-extractor-model/src/items/ApiDocumentedItem.ts @@ -3,7 +3,6 @@ import * as tsdoc from '@microsoft/tsdoc'; import { ApiItem, IApiItemOptions, IApiItemJson } from './ApiItem'; -import { AedocDefinitions } from '../aedoc/AedocDefinitions'; import { DeserializerContext } from '../model/DeserializerContext'; /** @@ -45,7 +44,7 @@ export class ApiDocumentedItem extends ApiItem { const documentedJson: IApiDocumentedItemJson = jsonObject as IApiDocumentedItemJson; if (documentedJson.docComment) { - const tsdocParser: tsdoc.TSDocParser = new tsdoc.TSDocParser(AedocDefinitions.tsdocConfiguration); + const tsdocParser: tsdoc.TSDocParser = new tsdoc.TSDocParser(context.tsdocConfig); // NOTE: For now, we ignore TSDoc errors found in a serialized .api.json file. // Normally these errors would have already been reported by API Extractor during analysis. diff --git a/apps/api-extractor-model/src/model/ApiModel.ts b/apps/api-extractor-model/src/model/ApiModel.ts index 6697aaccc76..63383d6423a 100644 --- a/apps/api-extractor-model/src/model/ApiModel.ts +++ b/apps/api-extractor-model/src/model/ApiModel.ts @@ -2,12 +2,24 @@ // See LICENSE in the project root for license information. import { DeclarationReference } from '@microsoft/tsdoc/lib/beta/DeclarationReference'; +import * as tsdoc from '@microsoft/tsdoc'; import { ApiItem, ApiItemKind } from '../items/ApiItem'; import { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin'; import { ApiPackage } from './ApiPackage'; import { PackageName } from '@microsoft/node-core-library'; import { ModelReferenceResolver, IResolveDeclarationReferenceResult } from './ModelReferenceResolver'; -import { DocDeclarationReference } from '@microsoft/tsdoc'; +import { AedocDefinitions } from '../aedoc/AedocDefinitions'; + +/** + * Constructor options for {@link ApiModel}. + * @public + */ +export interface IApiModelOptions { + /** + * Custom TSDoc tags to support when parsing documentation comments. + */ + tsdocTags?: ReadonlyArray; +} /** * A serializable representation of a collection of API declarations. @@ -51,17 +63,19 @@ import { DocDeclarationReference } from '@microsoft/tsdoc'; */ export class ApiModel extends ApiItemContainerMixin(ApiItem) { private readonly _resolver: ModelReferenceResolver; + private readonly _tsdocConfig: tsdoc.TSDocConfiguration; private _packagesByName: Map | undefined = undefined; - public constructor() { + public constructor(options: IApiModelOptions = {}) { super({ }); this._resolver = new ModelReferenceResolver(this); + this._tsdocConfig = AedocDefinitions.getTsdocConfiguration(options.tsdocTags || []); } public loadPackage(apiJsonFilename: string): ApiPackage { - const apiPackage: ApiPackage = ApiPackage.loadFromJsonFile(apiJsonFilename); + const apiPackage: ApiPackage = ApiPackage.loadFromJsonFile(apiJsonFilename, this._tsdocConfig); this.addMember(apiPackage); return apiPackage; } @@ -137,8 +151,9 @@ export class ApiModel extends ApiItemContainerMixin(ApiItem) { return this._packagesByName.get(packageName); } - public resolveDeclarationReference(declarationReference: DocDeclarationReference, + public resolveDeclarationReference(declarationReference: tsdoc.DocDeclarationReference, contextApiItem: ApiItem | undefined): IResolveDeclarationReferenceResult { + return this._resolver.resolve(declarationReference, contextApiItem); } diff --git a/apps/api-extractor-model/src/model/ApiPackage.ts b/apps/api-extractor-model/src/model/ApiPackage.ts index 6af923b337d..bfd8f4f6bf4 100644 --- a/apps/api-extractor-model/src/model/ApiPackage.ts +++ b/apps/api-extractor-model/src/model/ApiPackage.ts @@ -2,6 +2,7 @@ // See LICENSE in the project root for license information. import { DeclarationReference } from '@microsoft/tsdoc/lib/beta/DeclarationReference'; +import * as tsdoc from '@microsoft/tsdoc'; import { ApiItem, ApiItemKind, IApiItemJson } from '../items/ApiItem'; import { ApiItemContainerMixin, IApiItemContainerMixinOptions } from '../mixins/ApiItemContainerMixin'; import { JsonFile, IJsonFileSaveOptions, PackageJsonLookup, IPackageJson } from '@microsoft/node-core-library'; @@ -106,7 +107,7 @@ export class ApiPackage extends ApiItemContainerMixin(ApiNameMixin(ApiDocumented super(options); } - public static loadFromJsonFile(apiJsonFilename: string): ApiPackage { + public static loadFromJsonFile(apiJsonFilename: string, tsdocConfig?: tsdoc.TSDocConfiguration): ApiPackage { const jsonObject: IApiPackageJson = JsonFile.load(apiJsonFilename); if (!jsonObject @@ -152,7 +153,8 @@ export class ApiPackage extends ApiItemContainerMixin(ApiNameMixin(ApiDocumented apiJsonFilename, toolPackage: jsonObject.metadata.toolPackage, toolVersion: jsonObject.metadata.toolVersion, - versionToDeserialize: versionToDeserialize + versionToDeserialize: versionToDeserialize, + tsdocConfig }); return ApiItem.deserialize(jsonObject, context) as ApiPackage; diff --git a/apps/api-extractor-model/src/model/DeserializerContext.ts b/apps/api-extractor-model/src/model/DeserializerContext.ts index 62fa4f81391..2a29703e142 100644 --- a/apps/api-extractor-model/src/model/DeserializerContext.ts +++ b/apps/api-extractor-model/src/model/DeserializerContext.ts @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import * as tsdoc from '@microsoft/tsdoc'; + export enum ApiJsonSchemaVersion { /** * The initial release. @@ -72,10 +74,16 @@ export class DeserializerContext { */ public readonly versionToDeserialize: ApiJsonSchemaVersion; + /** + * TSDoc configuration to use when deserializing documentation comments. + */ + public readonly tsdocConfig?: tsdoc.TSDocConfiguration; + public constructor(options: DeserializerContext) { this.apiJsonFilename = options.apiJsonFilename; this.toolPackage = options.toolPackage; this.toolVersion = options.toolVersion; this.versionToDeserialize = options.versionToDeserialize; + this.tsdocConfig = options.tsdocConfig; } } diff --git a/apps/api-extractor/src/api/ExtractorConfig.ts b/apps/api-extractor/src/api/ExtractorConfig.ts index b76272a46b6..4af477c0f6f 100644 --- a/apps/api-extractor/src/api/ExtractorConfig.ts +++ b/apps/api-extractor/src/api/ExtractorConfig.ts @@ -4,6 +4,7 @@ import * as path from 'path'; import * as resolve from 'resolve'; import lodash = require('lodash'); +import * as tsdoc from '@microsoft/tsdoc'; import { JsonFile, @@ -18,10 +19,12 @@ import { } from '@microsoft/node-core-library'; import { IConfigFile, - IExtractorMessagesConfig + IExtractorMessagesConfig, + IConfigTsdocTagDefinition } from './IConfigFile'; import { PackageMetadataManager } from '../analyzer/PackageMetadataManager'; import { MessageRouter } from '../collector/MessageRouter'; +import { AedocDefinitions } from '@microsoft/api-extractor-model'; /** * Tokens used during variable expansion of path fields from api-extractor.json. @@ -111,6 +114,7 @@ interface IExtractorConfigParameters { omitTrimmingComments: boolean; tsdocMetadataEnabled: boolean; tsdocMetadataFilePath: string; + tsdocConfig: tsdoc.TSDocConfiguration; messages: IExtractorMessagesConfig; testMode: boolean; } @@ -195,6 +199,11 @@ export class ExtractorConfig { /** {@inheritDoc IConfigTsdocMetadata.tsdocMetadataFilePath} */ public readonly tsdocMetadataFilePath: string; + /** + * Configuration to use when parsing TSDoc comments. + */ + public readonly tsdocConfig: tsdoc.TSDocConfiguration; + /** {@inheritDoc IConfigFile.messages} */ public readonly messages: IExtractorMessagesConfig; @@ -222,6 +231,7 @@ export class ExtractorConfig { this.omitTrimmingComments = parameters.omitTrimmingComments; this.tsdocMetadataEnabled = parameters.tsdocMetadataEnabled; this.tsdocMetadataFilePath = parameters.tsdocMetadataFilePath; + this.tsdocConfig = parameters.tsdocConfig; this.messages = parameters.messages; this.testMode = parameters.testMode; } @@ -654,6 +664,25 @@ export class ExtractorConfig { omitTrimmingComments = !!configObject.dtsRollup.omitTrimmingComments; } + let tsdocConfig: tsdoc.TSDocConfiguration = AedocDefinitions.tsdocConfiguration; + if (configObject.tsdoc && configObject.tsdoc.tagDefinitions) { + const customTags: tsdoc.TSDocTagDefinition[] = configObject.tsdoc.tagDefinitions.map( + (tag: IConfigTsdocTagDefinition): tsdoc.TSDocTagDefinition => { + const tagParams: tsdoc.ITSDocTagDefinitionParameters = { + tagName: tag.tagName, + syntaxKind: tsdoc.TSDocTagSyntaxKind.BlockTag, + allowMultiple: tag.allowMultiple + }; + if (tag.syntaxKind === 'inline') { + tagParams.syntaxKind = tsdoc.TSDocTagSyntaxKind.InlineTag; + } else if (tag.syntaxKind === 'modifier') { + tagParams.syntaxKind = tsdoc.TSDocTagSyntaxKind.ModifierTag; + } + return new tsdoc.TSDocTagDefinition(tagParams); + }); + tsdocConfig = AedocDefinitions.getTsdocConfiguration(customTags); + } + return new ExtractorConfig({ projectFolder: projectFolder, packageJson, @@ -675,6 +704,7 @@ export class ExtractorConfig { omitTrimmingComments, tsdocMetadataEnabled, tsdocMetadataFilePath, + tsdocConfig, messages: configObject.messages || { }, testMode: !!configObject.testMode }); diff --git a/apps/api-extractor/src/api/IConfigFile.ts b/apps/api-extractor/src/api/IConfigFile.ts index ec33b17f157..7f13ac682f5 100644 --- a/apps/api-extractor/src/api/IConfigFile.ts +++ b/apps/api-extractor/src/api/IConfigFile.ts @@ -208,6 +208,53 @@ export interface IConfigTsdocMetadata { tsdocMetadataFilePath?: string; } +/** + * Additional tags to support when parsing documentation comments with TSDoc. + * + * @remarks + * This is part of the {@link IConfigFile} structure. + + * @public + */ +export interface IConfigTsdocTagDefinition { + /** + * Name of the custom tag. TSDoc tag names start with an at-sign (`@`) followed + * by ASCII letters using "camelCase" capitalization. + */ + tagName: string; + + /** + * Syntax kind of the custom tag. + * + * @remarks + * `"inline"` means that this tag can appear inside other documentation sections (example: `{@link}`). + * `"block"` means that this tag starts a new documentation section (example: `@remarks`). + * `"modifier"` means that this tag's presence indicates an aspect of the associated API item (example: `@internal`). + */ + syntaxKind: 'inline' | 'block' | 'modifier'; + + /** + * If true, then this tag may appear multiple times in a doc comment. + * By default, a tag may only appear once. + */ + allowMultiple?: boolean; +} + +/** + * Custom configuration for TSDoc, including custom supported tags. + * + * @remarks + * This is part of the {@link IConfigFile} structure. + + * @public + */ +export interface IConfigTsdoc { + /** + * {@inheritDoc IConfigTsdocTagDefinition} + */ + tagDefinitions?: ReadonlyArray; +} + /** * Configures reporting for a given message identifier. * @@ -367,6 +414,11 @@ export interface IConfigFile { */ tsdocMetadata?: IConfigTsdocMetadata; + /** + * {@inheritDoc IConfigTsdoc} + */ + tsdoc?: IConfigTsdoc; + /** * {@inheritDoc IExtractorMessagesConfig} */ diff --git a/apps/api-extractor/src/collector/Collector.ts b/apps/api-extractor/src/collector/Collector.ts index ca395d348ce..008d769de24 100644 --- a/apps/api-extractor/src/collector/Collector.ts +++ b/apps/api-extractor/src/collector/Collector.ts @@ -112,7 +112,7 @@ export class Collector { this.program = options.program; this.typeChecker = options.program.getTypeChecker(); - this._tsdocParser = new tsdoc.TSDocParser(AedocDefinitions.tsdocConfiguration); + this._tsdocParser = new tsdoc.TSDocParser(this.extractorConfig.tsdocConfig); const bundledPackageNames: Set = new Set(this.extractorConfig.bundledPackages); diff --git a/apps/api-extractor/src/schemas/api-extractor-template.json b/apps/api-extractor/src/schemas/api-extractor-template.json index 6ffa28e85a3..acd7d87bfe1 100644 --- a/apps/api-extractor/src/schemas/api-extractor-template.json +++ b/apps/api-extractor/src/schemas/api-extractor-template.json @@ -263,6 +263,40 @@ // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" }, + /** + * Custom configuration for TSDoc, including custom supported tags. + */ + "tsdoc": { + /** + * Additional tags to support when parsing documentation comments with TSDoc. + */ + "tagDefinitions": [ + // { + /** + * Name of the custom tag (required). TSDoc tag names start with an at-sign (`@`) followed + * by ASCII letters using "camelCase" capitalization. + */ + // "tagName": "@default", + + /** + * Syntax kind of the custom tag (required). + * + * Possible values: + * - "inline" means that this tag can appear inside other documentation sections (example: `{@link}`). + * - "block" means that this tag starts a new documentation section (example: `@remarks`). + * - "modifier" means that this tag's presence indicates an aspect of the associated API item (example: `@internal`). + */ + // "syntaxKind": "block", + + /** + * If true, then this tag may appear multiple times in a doc comment. + * By default, a tag may only appear once. + */ + // "allowMultiple": false + // } + ] + }, + /** * Configures how API Extractor reports error and warning messages produced during analysis. * diff --git a/apps/api-extractor/src/schemas/api-extractor.schema.json b/apps/api-extractor/src/schemas/api-extractor.schema.json index 87db7d948cc..bf527cc5f60 100644 --- a/apps/api-extractor/src/schemas/api-extractor.schema.json +++ b/apps/api-extractor/src/schemas/api-extractor.schema.json @@ -142,6 +142,21 @@ "additionalProperties": false }, + "tsdoc": { + "description": "Custom configuration for TSDoc.", + "type": "object", + "properties": { + "tagDefinitions": { + "description": "Additional tags to support when parsing documentation comments with TSDoc.", + "type": "array", + "items": { + "$ref": "#/definitions/tsdocTagDefinition" + } + } + }, + "additionalProperties": false + }, + "messages": { "description": "Configures how API Extractor reports error and warning messages produced during analysis.", "type": "object", @@ -171,6 +186,28 @@ "additionalProperties": false, "definitions": { + "tsdocTagDefinition": { + "description": "Configuration for a custom supported TSDoc tag.", + "type": "object", + "properties": { + "tagName": { + "description": "Name of the custom tag. TSDoc tag names start with an at-sign (@) followed by ASCII letters using camelCase capitalization.", + "type": "string" + }, + "syntaxKind": { + "description": "Syntax kind of the custom tag. \"inline\" means that this tag can appear inside other documentation sections (example: {@link}). \"block\" means that this tag starts a new documentation section (example: @remarks). \"modifier\" means that this tag's presence indicates an aspect of the associated API item (example: @internal).", + "type": "string", + "enum": ["inline", "block", "modifier"] + }, + "allowMultiple": { + "description": "If true, then this tag may appear multiple times in a doc comment. By default, a tag may only appear once.", + "type": "boolean" + } + }, + "required": ["tagName", "syntaxKind"], + "additionalProperties": false + }, + "extractorMessageReportingTable": { "type":"object", "description": "Specifies a table of reporting rules for different message identifiers, and also the default rule used for identifiers that do not appear in the table. The key is a message identifier for the associated type of message, or \"default\" to specify the default policy. For example, the key might be \"TS2551\" (a compiler message), \"tsdoc-link-tag-unescaped-text\" (a TSDOc message), or \"ae-extra-release-tag\" (a message related to the API Extractor analysis).", diff --git a/common/changes/@microsoft/api-extractor-model/custom-tags_2019-11-13-02-57.json b/common/changes/@microsoft/api-extractor-model/custom-tags_2019-11-13-02-57.json new file mode 100644 index 00000000000..80210943032 --- /dev/null +++ b/common/changes/@microsoft/api-extractor-model/custom-tags_2019-11-13-02-57.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@microsoft/api-extractor-model", + "comment": "Add support for custom TSDoc tags", + "type": "minor" + } + ], + "packageName": "@microsoft/api-extractor-model", + "email": "ecraig12345@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/changes/@microsoft/api-extractor/custom-tags_2019-11-13-02-57.json b/common/changes/@microsoft/api-extractor/custom-tags_2019-11-13-02-57.json new file mode 100644 index 00000000000..6967628d451 --- /dev/null +++ b/common/changes/@microsoft/api-extractor/custom-tags_2019-11-13-02-57.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@microsoft/api-extractor", + "comment": "Add support for custom TSDoc tags", + "type": "minor" + } + ], + "packageName": "@microsoft/api-extractor", + "email": "ecraig12345@users.noreply.github.com" +} \ No newline at end of file diff --git a/common/reviews/api/api-extractor-model.api.md b/common/reviews/api/api-extractor-model.api.md index ca9aa8744c8..55d026f47e1 100644 --- a/common/reviews/api/api-extractor-model.api.md +++ b/common/reviews/api/api-extractor-model.api.md @@ -5,7 +5,6 @@ ```ts import { DeclarationReference } from '@microsoft/tsdoc/lib/beta/DeclarationReference'; -import { DocDeclarationReference } from '@microsoft/tsdoc'; import { IJsonFileSaveOptions } from '@microsoft/node-core-library'; import * as tsdoc from '@microsoft/tsdoc'; import { TSDocConfiguration } from '@microsoft/tsdoc'; @@ -17,11 +16,12 @@ import { TSDocTagDefinition } from '@microsoft/tsdoc'; export class AedocDefinitions { // (undocumented) static readonly betaDocumentation: TSDocTagDefinition; + static getTsdocConfiguration(additionalTags?: ReadonlyArray): TSDocConfiguration; // (undocumented) static readonly internalRemarks: TSDocTagDefinition; // (undocumented) static readonly preapprovedTag: TSDocTagDefinition; - // (undocumented) + // @deprecated (undocumented) static readonly tsdocConfiguration: TSDocConfiguration; } @@ -362,7 +362,8 @@ export class ApiMethodSignature extends ApiMethodSignature_base { // // @public export class ApiModel extends ApiModel_base { - constructor(); + // Warning: (ae-forgotten-export) The symbol "IApiModelOptions" needs to be exported by the entry point index.d.ts + constructor(options?: IApiModelOptions); // @override (undocumented) addMember(member: ApiPackage): void; // @beta @override (undocumented) @@ -376,9 +377,9 @@ export class ApiModel extends ApiModel_base { // (undocumented) readonly packages: ReadonlyArray; // (undocumented) - resolveDeclarationReference(declarationReference: DocDeclarationReference, contextApiItem: ApiItem | undefined): IResolveDeclarationReferenceResult; + resolveDeclarationReference(declarationReference: tsdoc.DocDeclarationReference, contextApiItem: ApiItem | undefined): IResolveDeclarationReferenceResult; tryGetPackageByName(packageName: string): ApiPackage | undefined; -} + } // @public export function ApiNameMixin(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiNameMixin); @@ -428,7 +429,7 @@ export class ApiPackage extends ApiPackage_base { // @override (undocumented) readonly kind: ApiItemKind; // (undocumented) - static loadFromJsonFile(apiJsonFilename: string): ApiPackage; + static loadFromJsonFile(apiJsonFilename: string, tsdocConfig?: tsdoc.TSDocConfiguration): ApiPackage; // (undocumented) saveToJsonFile(apiJsonFilename: string, options?: IApiPackageSaveOptions): void; } diff --git a/common/reviews/api/api-extractor.api.md b/common/reviews/api/api-extractor.api.md index 47864b50ab9..8793fc3455b 100644 --- a/common/reviews/api/api-extractor.api.md +++ b/common/reviews/api/api-extractor.api.md @@ -65,6 +65,7 @@ export class ExtractorConfig { readonly skipLibCheck: boolean; readonly testMode: boolean; readonly tsconfigFilePath: string; + readonly tsdocConfig: tsdoc.TSDocConfiguration; readonly tsdocMetadataEnabled: boolean; readonly tsdocMetadataFilePath: string; readonly untrimmedFilePath: string; @@ -186,6 +187,11 @@ export interface IConfigFile { messages?: IExtractorMessagesConfig; projectFolder?: string; testMode?: boolean; + // Warning: (ae-forgotten-export) The symbol "IConfigTsdoc" needs to be exported by the entry point index.d.ts + // Warning: (ae-unresolved-inheritdoc-reference) The @inheritDoc reference could not be resolved: The package "@microsoft/api-extractor" does not have an export "IConfigTsdoc" + // + // (undocumented) + tsdoc?: IConfigTsdoc; // @beta tsdocMetadata?: IConfigTsdocMetadata; }