From 40d3082f55d7a30ac331b805750f66648ccf4023 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 14 Jun 2019 15:22:16 -0700 Subject: [PATCH] Add UidGenerator for stable UID generation across projects --- apps/api-extractor-model/src/items/ApiItem.ts | 19 +- .../src/analyzer/TypeScriptInternals.ts | 33 + .../src/generators/ApiModelGenerator.ts | 56 +- .../src/generators/UidGenerator.ts | 710 ++++++++++++++++++ .../etc/api-documenter-test.api.json | 42 ++ .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 22 + .../api-extractor-scenarios.api.json | 6 + .../api-extractor-scenarios.api.json | 8 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 8 + .../api-extractor-scenarios.api.json | 10 + .../api-extractor-scenarios.api.json | 9 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 3 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 1 + .../api-extractor-scenarios.api.json | 4 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 2 + .../api-extractor-scenarios.api.json | 4 + .../api-extractor-scenarios.api.json | 1 + .../typeOf/api-extractor-scenarios.api.json | 3 + .../api-extractor-scenarios.api.json | 11 + common/reviews/api/api-extractor-model.api.md | 6 +- 29 files changed, 954 insertions(+), 21 deletions(-) create mode 100644 apps/api-extractor/src/generators/UidGenerator.ts diff --git a/apps/api-extractor-model/src/items/ApiItem.ts b/apps/api-extractor-model/src/items/ApiItem.ts index b09bba746a5..803daaf3075 100644 --- a/apps/api-extractor-model/src/items/ApiItem.ts +++ b/apps/api-extractor-model/src/items/ApiItem.ts @@ -40,11 +40,13 @@ export const enum ApiItemKind { * @public */ export interface IApiItemOptions { + uid?: string; } export interface IApiItemJson { kind: ApiItemKind; canonicalReference: string; + uid?: string; } /** @@ -65,6 +67,8 @@ export const ApiItem_parent: unique symbol = Symbol('ApiItem._parent'); export class ApiItem { public [ApiItem_parent]: ApiItem | undefined; + private _uid: string | undefined; + public static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem { // The Deserializer class is coupled with a ton of other classes, so we delay loading it // to avoid ES5 circular imports. @@ -73,19 +77,24 @@ export class ApiItem { } /** @virtual */ - public static onDeserializeInto(options: Partial, context: DeserializerContext, + public static onDeserializeInto(options: Partial, context: DeserializerContext, jsonObject: IApiItemJson): void { - // (implemented by subclasses) + if (jsonObject.uid !== undefined) { + options.uid = jsonObject.uid; + } } public constructor(options: IApiItemOptions) { - // ("options" is not used here, but part of the inheritance pattern) + this._uid = options.uid; } /** @virtual */ public serializeInto(jsonObject: Partial): void { jsonObject.kind = this.kind; jsonObject.canonicalReference = this.canonicalReference; + if (this._uid !== undefined) { + jsonObject.uid = this._uid; + } } /** @virtual */ @@ -98,6 +107,10 @@ export class ApiItem { throw new Error('ApiItem.canonicalReference was not implemented by the child class'); } + public get uid(): string { + return this._uid || ''; + } + /** * Returns a name for this object that can be used in diagnostic messages, for example. * diff --git a/apps/api-extractor/src/analyzer/TypeScriptInternals.ts b/apps/api-extractor/src/analyzer/TypeScriptInternals.ts index 1ff7912a1e7..894454930d4 100644 --- a/apps/api-extractor/src/analyzer/TypeScriptInternals.ts +++ b/apps/api-extractor/src/analyzer/TypeScriptInternals.ts @@ -5,6 +5,15 @@ import * as ts from 'typescript'; +export interface IMappedType extends ts.ObjectType { + declaration: ts.MappedTypeNode; + typeParameter?: ts.TypeParameter; + constraintType?: ts.Type; + templateType?: ts.Type; + modifiersType?: ts.Type; + resolvedApparentType?: ts.Type; +} + export class TypeScriptInternals { public static getImmediateAliasedSymbol(symbol: ts.Symbol, typeChecker: ts.TypeChecker): ts.Symbol { @@ -83,4 +92,28 @@ export class TypeScriptInternals { public static getSymbolParent(symbol: ts.Symbol): ts.Symbol | undefined { return (symbol as any).parent; } + + /** + * Determines whether a type is the 'this' type parameter. + */ + public static isThisType(type: ts.Type): boolean { + // tslint:disable-next-line:no-bitwise + return type.flags & ts.TypeFlags.TypeParameter + ? (type as any).isThisType || false + : false; + } + + public static getMappedType(type: ts.Type): IMappedType | undefined { + if (isMappedType(type)) { + return type; + } + return undefined; + } +} + +function isMappedType(type: ts.Type): boolean { + // tslint:disable-next-line:no-bitwise + return !!(type.flags & ts.TypeFlags.Object) + // tslint:disable-next-line:no-bitwise + && !!((type as ts.ObjectType).objectFlags & ts.ObjectFlags.Mapped); } diff --git a/apps/api-extractor/src/generators/ApiModelGenerator.ts b/apps/api-extractor/src/generators/ApiModelGenerator.ts index de0451e0f6e..7628da92c6e 100644 --- a/apps/api-extractor/src/generators/ApiModelGenerator.ts +++ b/apps/api-extractor/src/generators/ApiModelGenerator.ts @@ -37,16 +37,23 @@ import { Collector } from '../collector/Collector'; import { AstDeclaration } from '../analyzer/AstDeclaration'; import { ExcerptBuilder, IExcerptBuilderNodeToCapture } from './ExcerptBuilder'; import { AstSymbol } from '../analyzer/AstSymbol'; +import { UidGenerator } from './UidGenerator'; export class ApiModelGenerator { private readonly _collector: Collector; private readonly _cachedOverloadIndexesByDeclaration: Map; private readonly _apiModel: ApiModel; + private readonly _uidGenerator: UidGenerator; public constructor(collector: Collector) { this._collector = collector; this._cachedOverloadIndexesByDeclaration = new Map(); this._apiModel = new ApiModel(); + this._uidGenerator = new UidGenerator( + collector.packageJsonLookup, + collector.program, + collector.typeChecker, + collector.workingPackage.name); } public get apiModel(): ApiModel { @@ -56,9 +63,11 @@ export class ApiModelGenerator { public buildApiPackage(): ApiPackage { const packageDocComment: tsdoc.DocComment | undefined = this._collector.workingPackage.tsdocComment; + const name: string = this._collector.workingPackage.name; const apiPackage: ApiPackage = new ApiPackage({ - name: this._collector.workingPackage.name, - docComment: packageDocComment + name, + docComment: packageDocComment, + uid: `${name}/` }); this._apiModel.addMember(apiPackage); @@ -213,6 +222,7 @@ export class ApiModelGenerator { const overloadIndex: number = this._getOverloadIndex(astDeclaration); const canonicalReference: string = ApiConstructor.getCanonicalReference(overloadIndex); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiConstructor: ApiConstructor | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiConstructor; @@ -232,7 +242,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiConstructor = new ApiConstructor({ docComment, releaseTag, parameters, overloadIndex, + apiConstructor = new ApiConstructor({ uid, docComment, releaseTag, parameters, overloadIndex, excerptTokens }); parentApiItem.addMember(apiConstructor); @@ -244,6 +254,7 @@ export class ApiModelGenerator { const name: string = !!exportedName ? exportedName : astDeclaration.astSymbol.localName; const canonicalReference: string = ApiClass.getCanonicalReference(name); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiClass: ApiClass | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiClass; @@ -281,7 +292,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiClass = new ApiClass({ name, docComment, releaseTag, excerptTokens, typeParameters, extendsTokenRange, + apiClass = new ApiClass({ name, uid, docComment, releaseTag, excerptTokens, typeParameters, extendsTokenRange, implementsTokenRanges }); parentApiItem.addMember(apiClass); @@ -332,6 +343,7 @@ export class ApiModelGenerator { const name: string = !!exportedName ? exportedName : astDeclaration.astSymbol.localName; const canonicalReference: string = ApiEnum.getCanonicalReference(name); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiEnum: ApiEnum | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiEnum; @@ -344,7 +356,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiEnum = new ApiEnum({ name, docComment, releaseTag, excerptTokens }); + apiEnum = new ApiEnum({ name, uid, docComment, releaseTag, excerptTokens }); parentApiItem.addMember(apiEnum); } @@ -356,6 +368,7 @@ export class ApiModelGenerator { const name: string = !!exportedName ? exportedName : astDeclaration.astSymbol.localName; const canonicalReference: string = ApiEnumMember.getCanonicalReference(name); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiEnumMember: ApiEnumMember | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiEnumMember; @@ -375,7 +388,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiEnumMember = new ApiEnumMember({ name, docComment, releaseTag, + apiEnumMember = new ApiEnumMember({ name, uid, docComment, releaseTag, excerptTokens, initializerTokenRange }); parentApiItem.addMember(apiEnumMember); @@ -386,9 +399,9 @@ export class ApiModelGenerator { parentApiItem: ApiItemContainerMixin): void { const name: string = !!exportedName ? exportedName : astDeclaration.astSymbol.localName; - const overloadIndex: number = this._getOverloadIndex(astDeclaration); const canonicalReference: string = ApiFunction.getCanonicalReference(name, overloadIndex); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiFunction: ApiFunction | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiFunction; @@ -414,7 +427,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiFunction = new ApiFunction({ name, docComment, releaseTag, typeParameters, parameters, overloadIndex, + apiFunction = new ApiFunction({ name, uid, docComment, releaseTag, typeParameters, parameters, overloadIndex, excerptTokens, returnTypeTokenRange }); parentApiItem.addMember(apiFunction); @@ -459,6 +472,7 @@ export class ApiModelGenerator { const name: string = !!exportedName ? exportedName : astDeclaration.astSymbol.localName; const canonicalReference: string = ApiInterface.getCanonicalReference(name); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiInterface: ApiInterface | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiInterface; @@ -491,7 +505,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiInterface = new ApiInterface({ name, docComment, releaseTag, excerptTokens, typeParameters, + apiInterface = new ApiInterface({ name, uid, docComment, releaseTag, excerptTokens, typeParameters, extendsTokenRanges }); parentApiItem.addMember(apiInterface); @@ -508,6 +522,7 @@ export class ApiModelGenerator { const isStatic: boolean = (astDeclaration.modifierFlags & ts.ModifierFlags.Static) !== 0; const overloadIndex: number = this._getOverloadIndex(astDeclaration); const canonicalReference: string = ApiMethod.getCanonicalReference(name, isStatic, overloadIndex); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiMethod: ApiMethod | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiMethod; @@ -532,8 +547,8 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiMethod = new ApiMethod({ name, docComment, releaseTag, isStatic, typeParameters, parameters, overloadIndex, - excerptTokens, returnTypeTokenRange }); + apiMethod = new ApiMethod({ name, uid, docComment, releaseTag, isStatic, typeParameters, parameters, + overloadIndex, excerptTokens, returnTypeTokenRange }); parentApiItem.addMember(apiMethod); } @@ -546,6 +561,7 @@ export class ApiModelGenerator { const overloadIndex: number = this._getOverloadIndex(astDeclaration); const canonicalReference: string = ApiMethodSignature.getCanonicalReference(name, overloadIndex); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiMethodSignature: ApiMethodSignature | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiMethodSignature; @@ -570,7 +586,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiMethodSignature = new ApiMethodSignature({ name, docComment, releaseTag, typeParameters, parameters, + apiMethodSignature = new ApiMethodSignature({ name, uid, docComment, releaseTag, typeParameters, parameters, overloadIndex, excerptTokens, returnTypeTokenRange }); parentApiItem.addMember(apiMethodSignature); @@ -582,6 +598,7 @@ export class ApiModelGenerator { const name: string = !!exportedName ? exportedName : astDeclaration.astSymbol.localName; const canonicalReference: string = ApiNamespace.getCanonicalReference(name); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiNamespace: ApiNamespace | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiNamespace; @@ -594,7 +611,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiNamespace = new ApiNamespace({ name, docComment, releaseTag, excerptTokens }); + apiNamespace = new ApiNamespace({ name, uid, docComment, releaseTag, excerptTokens }); parentApiItem.addMember(apiNamespace); } @@ -609,6 +626,7 @@ export class ApiModelGenerator { const isStatic: boolean = (astDeclaration.modifierFlags & ts.ModifierFlags.Static) !== 0; const canonicalReference: string = ApiProperty.getCanonicalReference(name, isStatic); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiProperty: ApiProperty | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiProperty; @@ -628,7 +646,8 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiProperty = new ApiProperty({ name, docComment, releaseTag, isStatic, excerptTokens, propertyTypeTokenRange }); + apiProperty = new ApiProperty({ name, uid, docComment, releaseTag, isStatic, excerptTokens, + propertyTypeTokenRange }); parentApiItem.addMember(apiProperty); } else { // If the property was already declared before (via a merged interface declaration), @@ -641,6 +660,7 @@ export class ApiModelGenerator { const name: string = !!exportedName ? exportedName : astDeclaration.astSymbol.localName; const canonicalReference: string = ApiPropertySignature.getCanonicalReference(name); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiPropertySignature: ApiPropertySignature | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiPropertySignature; @@ -660,7 +680,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiPropertySignature = new ApiPropertySignature({ name, docComment, releaseTag, + apiPropertySignature = new ApiPropertySignature({ name, uid, docComment, releaseTag, excerptTokens, propertyTypeTokenRange }); parentApiItem.addMember(apiPropertySignature); } else { @@ -675,6 +695,7 @@ export class ApiModelGenerator { const name: string = !!exportedName ? exportedName : astDeclaration.astSymbol.localName; const canonicalReference: string = ApiTypeAlias.getCanonicalReference(name); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiTypeAlias: ApiTypeAlias | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiTypeAlias; @@ -697,7 +718,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiTypeAlias = new ApiTypeAlias({ name, docComment, typeParameters, releaseTag, excerptTokens, + apiTypeAlias = new ApiTypeAlias({ name, uid, docComment, typeParameters, releaseTag, excerptTokens, typeTokenRange }); parentApiItem.addMember(apiTypeAlias); @@ -710,6 +731,7 @@ export class ApiModelGenerator { const name: string = !!exportedName ? exportedName : astDeclaration.astSymbol.localName; const canonicalReference: string = ApiVariable.getCanonicalReference(name); + const uid: string = this._uidGenerator.getUidOfDeclaration(astDeclaration.declaration); let apiVariable: ApiVariable | undefined = parentApiItem.tryGetMember(canonicalReference) as ApiVariable; @@ -729,7 +751,7 @@ export class ApiModelGenerator { const docComment: tsdoc.DocComment | undefined = this._collector.fetchMetadata(astDeclaration).tsdocComment; const releaseTag: ReleaseTag = this._collector.fetchMetadata(astDeclaration.astSymbol).releaseTag; - apiVariable = new ApiVariable({ name, docComment, releaseTag, excerptTokens, variableTypeTokenRange }); + apiVariable = new ApiVariable({ name, uid, docComment, releaseTag, excerptTokens, variableTypeTokenRange }); parentApiItem.addMember(apiVariable); } diff --git a/apps/api-extractor/src/generators/UidGenerator.ts b/apps/api-extractor/src/generators/UidGenerator.ts new file mode 100644 index 00000000000..7d18a95d373 --- /dev/null +++ b/apps/api-extractor/src/generators/UidGenerator.ts @@ -0,0 +1,710 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +// tslint:disable:no-bitwise + +import * as ts from 'typescript'; +import { PackageJsonLookup, INodePackageJson } from '@microsoft/node-core-library'; +import { TypeScriptInternals, IMappedType } from '../analyzer/TypeScriptInternals'; +import { TypeScriptHelpers } from '../analyzer/TypeScriptHelpers'; + +interface ISymbolInfo { + readonly symbol: ts.Symbol; + readonly baseUid: string; + readonly meanings: ReadonlyMap; +} + +interface IMeaningInfo { + readonly arity: string; + readonly disambiguation: string; + readonly uid: string; +} + +/** + * An object that can generate UIDs for Declarations, Symbols, and Types in a program. + * + * @public + */ +export class UidGenerator { + private _packageJsonLookup: PackageJsonLookup; + private _program: ts.Program; + private _typeChecker: ts.TypeChecker; + private _declarationCache: WeakMap; + private _symbolCache: WeakMap; + private _typeCache: WeakMap; + private _inferTypeParameters: ts.TypeParameter[] | undefined; + private _workingPackageName: string; + + constructor(packageJsonLookup: PackageJsonLookup, program: ts.Program, typeChecker: ts.TypeChecker, + workingPackageName: string) { + this._packageJsonLookup = packageJsonLookup; + this._program = program; + this._typeChecker = typeChecker; + this._declarationCache = new WeakMap(); + this._symbolCache = new WeakMap(); + this._typeCache = new WeakMap(); + this._workingPackageName = workingPackageName; + } + + /** + * Get the UID for a declaration. + */ + public getUidOfDeclaration(node: ts.Declaration): string { + let uid: string | undefined = this._declarationCache.get(node); + if (uid === undefined) { + const symbol: ts.Symbol | undefined = TypeScriptInternals.tryGetSymbolForDeclaration(node, this._typeChecker); + if (symbol) { + uid = this.getUidOfSymbol(symbol, getMeaningOfDeclaration(node)); + if (ts.isFunctionLike(node)) { + const signature: ts.Signature | undefined = this._typeChecker.getSignatureFromDeclaration(node); + if (signature) { + uid += this.signatureToUidComponent(signature); + } + } + } else { + uid = ''; + } + this._declarationCache.set(node, uid); + } + return uid; + } + + /** + * Get the UID for a symbol given its meaning. + */ + public getUidOfSymbol(symbol: ts.Symbol, meaning: ts.SymbolFlags): string { + const exportSymbol: ts.Symbol = this._typeChecker.getExportSymbolOfSymbol(symbol); + if (!(symbol.flags & meaning) && !(exportSymbol.flags & meaning)) { + return ''; + } + const symbolInfo: ISymbolInfo = this.getSymbolInfoOfSymbol(exportSymbol); + return this.symbolInfoToUid(symbolInfo, meaning); + } + + /** + * Get the UID for a Type. + */ + public getUidOfType(type: ts.Type): string { + let uid: string | undefined = this._typeCache.get(type); + if (uid === undefined) { + uid = this.typeToUid(type); + this._typeCache.set(type, uid); + } + return uid; + } + + /** + * Gets the base uid of a symbol and the uids for all of the symbol's meanings. + */ + private getSymbolInfoOfSymbol(symbol: ts.Symbol): ISymbolInfo { + let symbolInfo: ISymbolInfo | undefined = this._symbolCache.get(symbol); + if (symbolInfo === undefined) { + symbolInfo = this.symbolToSymbolInfo(symbol); + this._symbolCache.set(symbol, symbolInfo); + } + return symbolInfo; + } + + /** + * Creates an ISymbolInfo containing the base uid of a symbol and the uids for all of the symbol's meanings. + */ + private symbolToSymbolInfo(symbol: ts.Symbol): ISymbolInfo { + // TODO: handle symbols from instantations of generics (preserve type arguments) + + const baseUid: string = this.symbolToBaseUid(symbol); + const meanings: Map = new Map(); + const seen: Set = new Set(); + for (const meaning of getPrioritizedMeanings(symbol.flags)) { + let uid: string = baseUid; + + // For types, add the generic arity. + const arity: string = getArityForMeaningOfSymbol(symbol, meaning); + uid += arity; + + // If necessary, disambiguate. + const disambiguation: string = disambiguateUid(uid, meaning, seen); + uid += disambiguation; + + // Track all of the components so that we can support generic instantiations. + meanings.set(meaning, { arity, disambiguation, uid }); + seen.add(uid); + } + + return { symbol, baseUid, meanings }; + } + + /** + * Generates the base UID of a symbol. + */ + private symbolToBaseUid(symbol: ts.Symbol): string { + // Module symbols do not have uids. + if (isExternalModuleSymbol(symbol)) { + return ''; + } + + if (symbol.flags & ts.SymbolFlags.TypeParameter) { + // TODO: local type parameters `n and ``n if this is feasable. This may require location + // information and may not be feasible. + return `{${symbol.name}}`; + } + + const baseUid: string = this.symbolNameToUidComponent(symbol); + const parent: ts.Symbol | undefined = TypeScriptInternals.getSymbolParent(symbol); + const parentInfo: ISymbolInfo | undefined = parent && !isExternalModuleSymbol(parent) + ? this.getSymbolInfoOfSymbol(parent) + : undefined; + + if (parentInfo) { + if (isTypeMemberOrNonStaticClassMember(symbol)) { + return `${parentInfo.baseUid}#${baseUid}`; + } + + return `${parentInfo.baseUid}.${baseUid}`; + } + + const sourceFile: ts.SourceFile | undefined = + symbol.declarations + && symbol.declarations[0] + && symbol.declarations[0].getSourceFile(); + + if (sourceFile && ts.isExternalModule(sourceFile)) { + return this.packageComponentOfSymbol(symbol) + baseUid; + } + + return baseUid; + } + + /** + * Gets the UID for a particular meaning of a symbol. + */ + private symbolInfoToUid(symbolInfo: ISymbolInfo, meaning: ts.SymbolFlags): string { + // First try to get the meaning directly... + let meaningInfo: IMeaningInfo | undefined = symbolInfo.meanings.get(symbolInfo.symbol.flags & meaning); + if (meaningInfo === undefined) { + // Failing that, scan each key to find a match for the meaning. + const matchingInfos: IMeaningInfo[] = []; + for (const [key, value] of symbolInfo.meanings) { + if (meaning & key) { + matchingInfos.push(value); + } + } + + // If there are no matches, there is no UID. + if (matchingInfos.length === 0) { + return ''; + } + + // If there are multiple matching uids, always pick the one with the highest precedence. + meaningInfo = matchingInfos[0]; + } + + return meaningInfo.uid; + } + + /** + * Gets the package component of a Symbol. + */ + private packageComponentOfSymbol(symbol: ts.Symbol): string { + const sourceFile: ts.SourceFile = symbol.declarations[0].getSourceFile(); + if (this._program.isSourceFileFromExternalLibrary(sourceFile)) { + const packageJson: INodePackageJson | undefined = this._packageJsonLookup + .tryLoadNodePackageJsonFor(sourceFile.fileName); + if (packageJson && packageJson.name) { + return packageJson.name + '/'; + } else { + return ''; + } + } else { + return this._workingPackageName + '/'; + } + } + + /** + * Gets the UID component for the name of a Symbol. + */ + private symbolNameToUidComponent(symbol: ts.Symbol): string { + let localName: string = symbol.name; + if (TypeScriptHelpers.isWellKnownSymbolName(localName)) { + // TypeScript binds well-known ECMAScript symbols like 'Symbol.iterator' as '__@iterator'. + // This converts a string like '__@iterator' into the property name '[Symbol.iterator]'. + localName = `[Symbol.${localName.slice(3)}]`; + } else if (TypeScriptHelpers.isUniqueSymbolName(localName)) { + for (const decl of symbol.declarations || []) { + const declName: ts.DeclarationName | undefined = ts.getNameOfDeclaration(decl); + if (declName && ts.isComputedPropertyName(declName)) { + const lateName: string | undefined = TypeScriptHelpers.tryGetLateBoundName(declName); + if (lateName !== undefined) { + localName = lateName; + break; + } + } + } + } + return localName; + } + + /** + * Gets the UID component for a signature. + */ + private signatureToUidComponent(signature: ts.Signature): string { + let uid: string = ''; + if (signature.typeParameters && signature.typeParameters.length) { + uid += `\`\`${signature.typeParameters.length}`; + } + if (signature.parameters.length) { + uid += `(${signature.parameters.map(p => this.parameterToUid(p)).join(',')})`; + } + return uid; + } + + /** + * Gets the UID component for a parameter. + */ + private parameterToUid(symbol: ts.Symbol): string { + const type: ts.Type = this._typeChecker.getTypeOfSymbolAtLocation(symbol, symbol.declarations[0]); + const uid: string = this.getUidOfType(type); + if (symbol.valueDeclaration && ts.isParameter(symbol.valueDeclaration)) { + if (symbol.valueDeclaration.dotDotDotToken) { + return '...' + uid; + } + if (symbol.valueDeclaration.questionToken) { + return '?' + uid; + } + } + return uid; + } + + /** + * Creates a UID from a Type. + */ + private typeToUid(type: ts.Type): string { + if (type.flags & ts.TypeFlags.Any) { + return 'any'; + } + if (type.flags & ts.TypeFlags.Unknown) { + return 'unknown'; + } + if (type.flags & ts.TypeFlags.String) { + return 'string'; + } + if (type.flags & ts.TypeFlags.Number) { + return 'number'; + } + if (type.flags & ts.TypeFlags.BigInt) { + return 'bigint'; + } + if (type.flags & ts.TypeFlags.Boolean) { + return 'boolean'; + } + if (type.flags & ts.TypeFlags.Void) { + return 'void'; + } + if (type.flags & ts.TypeFlags.Undefined) { + return 'undefined'; + } + if (type.flags & ts.TypeFlags.Null) { + return 'null'; + } + if (type.flags & ts.TypeFlags.Never) { + return 'never'; + } + if (type.flags & ts.TypeFlags.ESSymbol) { + return 'symbol'; + } + if (type.flags & ts.TypeFlags.NonPrimitive) { + return 'object'; + } + if (type.flags & ts.TypeFlags.TypeParameter && TypeScriptInternals.isThisType(type)) { + return 'this'; + } + if (type.flags & ts.TypeFlags.EnumLiteral && !(type.flags & ts.TypeFlags.Union)) { + const parent: ts.Symbol = TypeScriptInternals.getSymbolParent(type.symbol)!; + if (this._typeChecker.getDeclaredTypeOfSymbol(parent) === type) { + return this.getUidOfSymbol(parent, ts.SymbolFlags.Enum); + } + return this.getUidOfSymbol(type.symbol, ts.SymbolFlags.EnumMember); + } + if (type.flags & ts.TypeFlags.EnumLike) { + return this.getUidOfSymbol(type.symbol, ts.SymbolFlags.EnumMember); + } + if (type.flags & ts.TypeFlags.StringLiteral) { + return JSON.stringify((type as ts.StringLiteralType).value); + } + if (type.flags & ts.TypeFlags.NumberLiteral) { + return JSON.stringify((type as ts.NumberLiteralType).value); + } + if (type.flags & ts.TypeFlags.BigIntLiteral) { + const { negative, base10Value } = (type as ts.BigIntLiteralType).value; + return `${negative ? '-' : ''}${base10Value}u`; + } + if (type.flags & ts.TypeFlags.BooleanLiteral) { + return this._typeChecker.typeToString(type); + } + if (type.flags & ts.TypeFlags.UniqueESSymbol) { + return `typeof~${this.getUidOfSymbol(type.symbol, ts.SymbolFlags.Value)}`; + } + const objectFlags: ts.ObjectFlags = (type as ts.ObjectType).objectFlags; + if (objectFlags & ts.ObjectFlags.Reference) { + return this.typeReferenceToUid(type as ts.TypeReference); + } + if (type.flags & ts.TypeFlags.TypeParameter || objectFlags & ts.ObjectFlags.ClassOrInterface) { + if (type.flags & ts.TypeFlags.TypeParameter + && this._inferTypeParameters + && this._inferTypeParameters.indexOf(type) !== -1) { + return `infer~${this.typeParameterToUid(type as ts.TypeParameter)}`; + } + let uid: string = type.symbol ? this.getUidOfSymbol(type.symbol, ts.SymbolFlags.Type) : '?'; + if (objectFlags & ts.ObjectFlags.ClassOrInterface) { + if ((type as ts.GenericType).typeParameters && (type as ts.GenericType).typeParameters!.length) { + uid += `\`${(type as ts.GenericType).typeParameters!.length}`; + } + } + return uid; + } + if (type.aliasSymbol) { + return this.typeAliasToUid(type.aliasSymbol, type.aliasTypeArguments); + } + if (type.flags & ts.TypeFlags.Union) { + return (type as ts.UnionType).types.map(t => this.getUidOfType(t)).join('|'); + } + if (type.flags & ts.TypeFlags.Intersection) { + return (type as ts.IntersectionType).types.map(t => this.getUidOfType(t)).join('&'); + } + if (objectFlags & (ts.ObjectFlags.Anonymous | ts.ObjectFlags.Mapped)) { + return this.anonymousTypeToUid(type as ts.ObjectType); + } + if (type.flags & ts.TypeFlags.Index) { + return this.indexTypeToUid(type as ts.IndexType); + } + if (type.flags & ts.TypeFlags.IndexedAccess) { + return this.indexedAccessToUid(type as ts.IndexedAccessType); + } + if (type.flags & ts.TypeFlags.Conditional) { + return this.conditionalTypeToUid(type as ts.ConditionalType); + } + return escapeUidFragment(this._typeChecker.typeToString(type)); + } + + private typeReferenceToUid(type: ts.TypeReference): string { + let uid: string = this.getUidOfSymbol(type.symbol, ts.SymbolFlags.Type); + if (type.typeArguments && type.typeArguments.length) { + uid += `{${type.typeArguments.map(t => this.getUidOfType(t)).join(',')}}`; + } + return uid; + } + + private typeParameterToUid(type: ts.TypeParameter): string { + return this.getUidOfSymbol(type.symbol, ts.SymbolFlags.TypeParameter); + } + + private typeAliasToUid(aliasSymbol: ts.Symbol, typeArguments: ReadonlyArray | undefined): string { + let uid: string = this.getUidOfSymbol(aliasSymbol, ts.SymbolFlags.TypeAlias); + if (typeArguments && typeArguments.length) { + uid += `${typeArguments.map(t => this.getUidOfType(t)).join(',')}`; + } + return uid; + } + + private anonymousTypeToUid(type: ts.ObjectType): string { + const mappedType: IMappedType | undefined = TypeScriptInternals.getMappedType(type); + if (mappedType) { + const typeParameter: string = this.mappedTypeParameterToUid(mappedType); + const constraint: string = this.mappedTypeConstraintToUid(mappedType); + const template: string = this.mappedTypeTemplateToUid(mappedType); + const readonly: string = this.mappedTypeReadonlyTokenToUidComponent(mappedType); + const question: string = this.mappedTypeQuestionTokenToUidComponent(mappedType); + return `{{${readonly}[${typeParameter}~in~${constraint}]${question}:${template}}}`; + } + const properties: ts.Symbol[] = this._typeChecker.getPropertiesOfType(type); + const callSignatures: ReadonlyArray = + this._typeChecker.getSignaturesOfType(type, ts.SignatureKind.Call); + const constructSignatures: ReadonlyArray = + this._typeChecker.getSignaturesOfType(type, ts.SignatureKind.Construct); + const stringIndex: ts.IndexInfo | undefined = this._typeChecker.getIndexInfoOfType(type, ts.IndexKind.String); + const numberIndex: ts.IndexInfo | undefined = this._typeChecker.getIndexInfoOfType(type, ts.IndexKind.Number); + if (!properties.length && !stringIndex && !numberIndex) { + if (!callSignatures.length && !constructSignatures.length) { + return '{{}}'; + } + if (callSignatures.length === 1 && !constructSignatures.length) { + const signatureComponent: string = this.signatureToUidComponent(callSignatures[0]) || '()'; + const returnType: ts.Type = this._typeChecker.getReturnTypeOfSignature(callSignatures[0]); + const returnTypeComponent: string = this.getUidOfType(returnType); + return `${signatureComponent}~${returnTypeComponent}`; + } + if (constructSignatures.length === 1 && !callSignatures.length) { + const signatureComponent: string = this.signatureToUidComponent(constructSignatures[0]) || '()'; + const returnType: ts.Type = this._typeChecker.getReturnTypeOfSignature(constructSignatures[0]); + const returnTypeComponent: string = this.getUidOfType(returnType); + return `new${signatureComponent}~${returnTypeComponent}`; + } + } + // TODO: signatures, indexers + return `{{${properties.map(p => this.propertyToUidComponent(p)).join(',')}}}`; + } + + private mappedTypeReadonlyTokenToUidComponent(type: IMappedType): string { + const token: ts.MappedTypeNode['readonlyToken'] = type.declaration.readonlyToken; + return !token ? '' : + token.kind === ts.SyntaxKind.PlusToken ? '+readonly~' : + token.kind === ts.SyntaxKind.MinusToken ? '-readonly~' : + 'readonly~'; + } + + private mappedTypeQuestionTokenToUidComponent(type: IMappedType): string { + const token: ts.MappedTypeNode['questionToken'] = type.declaration.questionToken; + return !token ? '' : + token.kind === ts.SyntaxKind.PlusToken ? '+?' : + token.kind === ts.SyntaxKind.MinusToken ? '-?' : + '?'; + } + + private mappedTypeParameterToUid(type: IMappedType): string { + return type.typeParameter ? this.getUidOfSymbol(type.typeParameter.symbol, ts.SymbolFlags.TypeParameter) : + this.getUidOfDeclaration(type.declaration.typeParameter); + } + + private mappedTypeConstraintToUid(type: IMappedType): string { + return type.constraintType ? this.getUidOfType(type.constraintType) : + this.typeParameterConstraintToUidComponent(type.declaration.typeParameter); + } + + private mappedTypeTemplateToUid(type: IMappedType): string { + if (type.templateType) { + return this.getUidOfType(type.templateType); + } + if (type.declaration.type) { + return this.getUidOfType(this._typeChecker.getTypeFromTypeNode(type.declaration.type)); + } + return '?'; + } + + private typeParameterConstraintToUidComponent(node: ts.TypeParameterDeclaration): string { + const constraint: ts.TypeNode | undefined = ts.getEffectiveConstraintOfTypeParameter(node); + if (constraint) { + const type: ts.Type = this._typeChecker.getTypeFromTypeNode(constraint); + return this.getUidOfType(type); + } + return ''; + } + + /** + * Converts a property Symbol into a UID component. + * + * For example: `x?: T` -> `x?:T` + */ + private propertyToUidComponent(property: ts.Symbol): string { + const name: string = this.symbolNameToUidComponent(property); + const question: string = property.flags & ts.SymbolFlags.Optional ? '?' : ''; + const type: ts.Type = this._typeChecker.getTypeOfSymbolAtLocation(property, property.declarations[0]); + const typeUid: string = this.getUidOfType(type); + return `${name}${question}:${typeUid}`; + } + + /** + * Converts an IndexType into a UID. + * + * For example: `keyof T` becomes `keyof~T` + */ + private indexTypeToUid(type: ts.IndexType): string { + return `keyof~${this.getUidOfType(type.type)}`; + } + + /** + * Converts an IndexedAccessType into a UID. + * + * For example: `T[K]` -> `T[K]` (with transformations on `T` and `K`). + */ + private indexedAccessToUid(type: ts.IndexedAccessType): string { + return `${this.getUidOfType(type.objectType)}[${this.getUidOfType(type.indexType)}]`; + } + + /** + * Converts a ConditionalType into a UID. + * + * For example: `S extends T ? U : V` -> `S~extends~T?U:V`. + */ + private conditionalTypeToUid(type: ts.ConditionalType): string { + const checkUid: string = this.getUidOfType(type.checkType); + const savedInferTypeParameters: ts.TypeParameter[] | undefined = this._inferTypeParameters; + this._inferTypeParameters = type.root.inferTypeParameters; + const extendsUid: string = this.getUidOfType(type.extendsType); + this._inferTypeParameters = savedInferTypeParameters; + const trueUid: string = this.getUidOfType(type.trueType); + const falseUid: string = this.getUidOfType(type.falseType); + return `${checkUid}~extends~${extendsUid}?${trueUid}:${falseUid}`; + } +} + +function isExternalModuleSymbol(symbol: ts.Symbol): boolean { + return !!(symbol.flags & ts.SymbolFlags.ValueModule) + && symbol.valueDeclaration !== undefined + && ts.isSourceFile(symbol.valueDeclaration); +} + +function isTypeMemberOrNonStaticClassMember(symbol: ts.Symbol): boolean { + if (symbol.valueDeclaration) { + if (ts.isClassLike(symbol.valueDeclaration.parent)) { + return ts.isClassElement(symbol.valueDeclaration) + && !(ts.getCombinedModifierFlags(symbol.valueDeclaration) & ts.ModifierFlags.Static); + } + if (ts.isInterfaceDeclaration(symbol.valueDeclaration.parent)) { + return ts.isTypeElement(symbol.valueDeclaration); + } + } + return false; +} + +function getArityOfDeclaration(node: ts.Declaration): number { + if (ts.isClassDeclaration(node) + || ts.isClassExpression(node) + || ts.isInterfaceDeclaration(node) + || ts.isTypeAliasDeclaration(node)) { + if (node.typeParameters) { + return node.typeParameters.length; + } + } + return 0; +} + +/** + * Gets a disambiguation qualifier for a UID if one is needed. + */ +function disambiguateUid(baseUid: string, meaning: ts.SymbolFlags, seenUids: Set): string { + let meaningDisambiguation: string = ''; + if (seenUids.has(baseUid)) { + meaningDisambiguation = meaningToUidComponent(meaning); + } + + let attempt: number = 0; + let disambiguation: string; + do { + disambiguation = attempt === 0 ? meaningDisambiguation : `${meaningDisambiguation}@${attempt}`; + attempt++; + } while (seenUids.has(baseUid + disambiguation)); + + return disambiguation; +} + +function meaningToUidComponent(meaning: ts.SymbolFlags): string { + if (meaning & ts.SymbolFlags.Class) { + return ':class'; + } + if (meaning & ts.SymbolFlags.Enum) { + return ':enum'; + } + if (meaning & ts.SymbolFlags.Interface) { + return ':interface'; + } + if (meaning & ts.SymbolFlags.TypeAlias) { + return ':typealias'; + } + if (meaning & ts.SymbolFlags.TypeParameter) { + return ':typeparameter'; + } + if (meaning & ts.SymbolFlags.Function) { + return ':function'; + } + if (meaning & ts.SymbolFlags.Variable) { + return ':variable'; + } + if (meaning & ts.SymbolFlags.Module) { + return ':namespace'; + } + if (meaning & ts.SymbolFlags.ClassMember) { + return ':member'; + } + if (meaning & ts.SymbolFlags.Constructor) { + return ':constructor'; + } + if (meaning & ts.SymbolFlags.EnumMember) { + return ':enummember'; + } + return `:${meaning}`; // unknown meaning. Encode it as the number. +} + +function getMeaningOfDeclaration(node: ts.Declaration): ts.SymbolFlags { + const meaning: ts.SymbolFlags = + ts.isClassDeclaration(node) ? ts.SymbolFlags.Class : + ts.isClassExpression(node) ? ts.SymbolFlags.Class : + ts.isEnumDeclaration(node) ? ts.SymbolFlags.Enum : + ts.isInterfaceDeclaration(node) ? ts.SymbolFlags.Interface : + ts.isTypeAliasDeclaration(node) ? ts.SymbolFlags.TypeAlias : + ts.isTypeParameterDeclaration(node) ? ts.SymbolFlags.TypeParameter : + ts.isFunctionDeclaration(node) ? ts.SymbolFlags.Function : + ts.isFunctionExpression(node) ? ts.SymbolFlags.Function : + ts.isVariableDeclaration(node) ? ts.SymbolFlags.Variable : + ts.isParameter(node) ? ts.SymbolFlags.Variable : + ts.isBindingElement(node) ? ts.SymbolFlags.Variable : + ts.isModuleDeclaration(node) ? ts.SymbolFlags.Module : + ts.isSourceFile(node) ? ts.SymbolFlags.Module : + ts.isConstructorDeclaration(node) ? ts.SymbolFlags.Constructor : + ts.isClassElement(node) ? ts.SymbolFlags.ClassMember : + ts.isTypeElement(node) ? ts.SymbolFlags.ClassMember : + ts.isEnumMember(node) ? ts.SymbolFlags.EnumMember : + ~ts.SymbolFlags.None; + return meaning; +} + +function getPrioritizedMeanings(meaning: ts.SymbolFlags): ReadonlyArray { + // NOTE: These are added in order of precedence, with earlier elements having a higher + // precedence than later elements. + const meanings: ts.SymbolFlags[] = []; + if (meaning & ts.SymbolFlags.Class) { + meanings.push(ts.SymbolFlags.Class); + } + if (meaning & ts.SymbolFlags.Enum) { + meanings.push(meaning & ts.SymbolFlags.Enum); + } + if (meaning & ts.SymbolFlags.Interface) { + meanings.push(ts.SymbolFlags.Interface); + } + if (meaning & ts.SymbolFlags.TypeAlias) { + meanings.push(ts.SymbolFlags.TypeAlias); + } + if (meaning & ts.SymbolFlags.TypeParameter) { + meanings.push(ts.SymbolFlags.TypeParameter); + } + if (meaning & ts.SymbolFlags.Function) { + meanings.push(ts.SymbolFlags.Function); + } + if (meaning & ts.SymbolFlags.Variable) { + meanings.push(meaning & ts.SymbolFlags.Variable); + } + if (meaning & ts.SymbolFlags.Module) { + meanings.push(meaning & ts.SymbolFlags.Module); + } + if (meaning & ts.SymbolFlags.ClassMember) { + meanings.push(meaning & ts.SymbolFlags.ClassMember); + } + if (meaning & ts.SymbolFlags.Constructor) { + meanings.push(ts.SymbolFlags.Constructor); + } + if (meaning & ts.SymbolFlags.EnumMember) { + meanings.push(meaning); + } + return meanings; +} + +function getArityForMeaningOfSymbol(symbol: ts.Symbol, meaning: ts.SymbolFlags): string { + if (meaning & ts.SymbolFlags.Type) { + const arity: number = symbol.declarations.reduce((a, decl) => Math.max(a, getArityOfDeclaration(decl)), 0); + if (arity > 0) { + return `\`${arity}`; + } + } + return ''; +} + +function escapeUidFragment(text: string): string { + text = text.replace(/=>|[{}<>]/g, s => + s === '=>' ? '~' : + s === '{' ? '{{' : + s === '}' ? '}}' : + s === '<' ? '{' : + s === '>' ? '}' : + s); + text = text.replace(/\b\s+\b/g, '-'); + text = text.replace(/\s+/g, ''); + return text; +} \ No newline at end of file diff --git a/build-tests/api-documenter-test/etc/api-documenter-test.api.json b/build-tests/api-documenter-test/etc/api-documenter-test.api.json index 2dfaa01ce03..89518c433cd 100644 --- a/build-tests/api-documenter-test/etc/api-documenter-test.api.json +++ b/build-tests/api-documenter-test/etc/api-documenter-test.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-documenter-test", + "uid": "api-documenter-test/", "docComment": "/**\n * api-extractor-test-05\n *\n * This project tests various documentation generation scenarios and doc comment syntaxes.\n *\n * @packageDocumentation\n */\n", "name": "api-documenter-test", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(DocBaseClass:class)", + "uid": "api-documenter-test/DocBaseClass", "docComment": "/**\n * Example base class\n *\n * {@docCategory DocBaseClass}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -39,6 +41,7 @@ { "kind": "Constructor", "canonicalReference": "(:constructor,1)", + "uid": "api-documenter-test/DocBaseClass.__constructor", "docComment": "/**\n * The simple constructor for `DocBaseClass`\n */\n", "excerptTokens": [ { @@ -53,6 +56,7 @@ { "kind": "Constructor", "canonicalReference": "(:constructor,2)", + "uid": "api-documenter-test/DocBaseClass.__constructor(number)", "docComment": "/**\n * The overloaded constructor for `DocBaseClass`\n */\n", "excerptTokens": [ { @@ -94,6 +98,7 @@ { "kind": "Class", "canonicalReference": "(DocClass1:class)", + "uid": "api-documenter-test/DocClass1", "docComment": "/**\n * This is an example class.\n *\n * @remarks\n *\n * These are some remarks.\n *\n * The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `DocClass1` class.\n *\n * @defaultValue\n *\n * a default value for this function\n *\n * {@docCategory DocClass1}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -143,6 +148,7 @@ { "kind": "Method", "canonicalReference": "(deprecatedExample:instance,0)", + "uid": "api-documenter-test/DocClass1#deprecatedExample", "docComment": "/**\n * @deprecated\n *\n * Use `otherThing()` instead.\n */\n", "excerptTokens": [ { @@ -175,6 +181,7 @@ { "kind": "Method", "canonicalReference": "(exampleFunction:instance,1)", + "uid": "api-documenter-test/DocClass1#exampleFunction(string,string)", "docComment": "/**\n * This is an overloaded function.\n *\n * @param a - the first string\n *\n * @param b - the second string\n */\n", "excerptTokens": [ { @@ -254,6 +261,7 @@ { "kind": "Method", "canonicalReference": "(exampleFunction:instance,2)", + "uid": "api-documenter-test/DocClass1#exampleFunction(number)", "docComment": "/**\n * This is also an overloaded function.\n *\n * @param x - the number\n */\n", "excerptTokens": [ { @@ -310,6 +318,7 @@ { "kind": "Method", "canonicalReference": "(interestingEdgeCases:instance,0)", + "uid": "api-documenter-test/DocClass1#interestingEdgeCases", "docComment": "/**\n * Example: \"\\{ \\\\\"maxItemsToShow\\\\\": 123 \\}\"\n *\n * The regular expression used to validate the constraints is /^[a-zA-Z0-9\\\\-_]+$/\n */\n", "excerptTokens": [ { @@ -342,6 +351,7 @@ { "kind": "Property", "canonicalReference": "(malformedEvent:instance)", + "uid": "api-documenter-test/DocClass1#malformedEvent", "docComment": "/**\n * This event should have been marked as readonly.\n *\n * @eventProperty\n */\n", "excerptTokens": [ { @@ -372,6 +382,7 @@ { "kind": "Property", "canonicalReference": "(modifiedEvent:instance)", + "uid": "api-documenter-test/DocClass1#modifiedEvent", "docComment": "/**\n * This event is fired whenever the object is modified.\n *\n * @eventProperty\n */\n", "excerptTokens": [ { @@ -406,6 +417,7 @@ { "kind": "Property", "canonicalReference": "(regularProperty:instance)", + "uid": "api-documenter-test/DocClass1#regularProperty", "docComment": "/**\n * This is a regular property that happens to use the SystemEvent type.\n */\n", "excerptTokens": [ { @@ -436,6 +448,7 @@ { "kind": "Method", "canonicalReference": "(sumWithExample:static,0)", + "uid": "api-documenter-test/DocClass1.sumWithExample(number,number)", "docComment": "/**\n * Returns the sum of two numbers.\n *\n * @remarks\n *\n * This illustrates usage of the `@example` block tag.\n *\n * @param x - the first number to add\n *\n * @param y - the second number to add\n *\n * @returns the sum of the two numbers\n *\n * @example\n *\n * Here's a simple example:\n * ```\n * // Prints \"2\":\n * console.log(DocClass1.sumWithExample(1,1));\n * ```\n *\n * @example\n *\n * Here's an example with negative numbers:\n * ```\n * // Prints \"0\":\n * console.log(DocClass1.sumWithExample(1,-1));\n * ```\n *\n */\n", "excerptTokens": [ { @@ -519,6 +532,7 @@ { "kind": "Method", "canonicalReference": "(tableExample:instance,0)", + "uid": "api-documenter-test/DocClass1#tableExample", "docComment": "/**\n * An example with tables:\n *\n * @remarks\n *\n *
John Doe
\n */\n", "excerptTokens": [ { @@ -567,6 +581,7 @@ { "kind": "Enum", "canonicalReference": "(DocEnum:enum)", + "uid": "api-documenter-test/DocEnum", "docComment": "/**\n * Docs for DocEnum\n *\n * {@docCategory SystemEvent}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -588,6 +603,7 @@ { "kind": "EnumMember", "canonicalReference": "One", + "uid": "api-documenter-test/DocEnum.One", "docComment": "/**\n * These are some docs for One\n */\n", "excerptTokens": [ { @@ -613,6 +629,7 @@ { "kind": "EnumMember", "canonicalReference": "Two", + "uid": "api-documenter-test/DocEnum.Two", "docComment": "/**\n * These are some docs for Two\n */\n", "excerptTokens": [ { @@ -638,6 +655,7 @@ { "kind": "EnumMember", "canonicalReference": "Zero", + "uid": "api-documenter-test/DocEnum.Zero", "docComment": "/**\n * These are some docs for Zero\n */\n", "excerptTokens": [ { @@ -665,6 +683,7 @@ { "kind": "Class", "canonicalReference": "(Generic:class)", + "uid": "api-documenter-test/Generic`1", "docComment": "/**\n * Generic class.\n *\n * @public\n */\n", "excerptTokens": [ { @@ -709,6 +728,7 @@ { "kind": "Function", "canonicalReference": "(globalFunction:0)", + "uid": "api-documenter-test/globalFunction(number)", "docComment": "/**\n * An exported function\n *\n * @public\n */\n", "excerptTokens": [ { @@ -768,6 +788,7 @@ { "kind": "Interface", "canonicalReference": "(IDocInterface1:interface)", + "uid": "api-documenter-test/IDocInterface1", "docComment": "/**\n * {@docCategory DocBaseClass}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -789,6 +810,7 @@ { "kind": "PropertySignature", "canonicalReference": "regularProperty", + "uid": "api-documenter-test/IDocInterface1#regularProperty", "docComment": "/**\n * Does something\n */\n", "excerptTokens": [ { @@ -821,6 +843,7 @@ { "kind": "Interface", "canonicalReference": "(IDocInterface2:interface)", + "uid": "api-documenter-test/IDocInterface2", "docComment": "/**\n * {@docCategory DocBaseClass}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -850,6 +873,7 @@ { "kind": "MethodSignature", "canonicalReference": "(deprecatedExample:0)", + "uid": "api-documenter-test/IDocInterface2#deprecatedExample", "docComment": "/**\n * @deprecated\n *\n * Use `otherThing()` instead.\n */\n", "excerptTokens": [ { @@ -889,6 +913,7 @@ { "kind": "Interface", "canonicalReference": "(IDocInterface3:interface)", + "uid": "api-documenter-test/IDocInterface3", "docComment": "/**\n * Some less common TypeScript declaration kinds.\n *\n * {@docCategory DocClass1}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -1039,6 +1064,7 @@ { "kind": "Interface", "canonicalReference": "(IDocInterface4:interface)", + "uid": "api-documenter-test/IDocInterface4", "docComment": "/**\n * Type union in an interface.\n *\n * {@docCategory DocClass1}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -1060,6 +1086,7 @@ { "kind": "PropertySignature", "canonicalReference": "Context", + "uid": "api-documenter-test/IDocInterface4#Context", "docComment": "/**\n * Test newline rendering when code blocks are used in tables\n */\n", "excerptTokens": [ { @@ -1105,6 +1132,7 @@ { "kind": "PropertySignature", "canonicalReference": "generic", + "uid": "api-documenter-test/IDocInterface4#generic", "docComment": "/**\n * make sure html entities are escaped in tables.\n */\n", "excerptTokens": [ { @@ -1138,6 +1166,7 @@ { "kind": "PropertySignature", "canonicalReference": "numberOrFunction", + "uid": "api-documenter-test/IDocInterface4#numberOrFunction", "docComment": "/**\n * a union type with a function\n */\n", "excerptTokens": [ { @@ -1167,6 +1196,7 @@ { "kind": "PropertySignature", "canonicalReference": "stringOrNumber", + "uid": "api-documenter-test/IDocInterface4#stringOrNumber", "docComment": "/**\n * a union type\n */\n", "excerptTokens": [ { @@ -1199,6 +1229,7 @@ { "kind": "Interface", "canonicalReference": "(IDocInterface5:interface)", + "uid": "api-documenter-test/IDocInterface5", "docComment": "/**\n * Interface without inline tag to test custom TOC\n *\n * @public\n */\n", "excerptTokens": [ { @@ -1220,6 +1251,7 @@ { "kind": "PropertySignature", "canonicalReference": "regularProperty", + "uid": "api-documenter-test/IDocInterface5#regularProperty", "docComment": "/**\n * Property of type string that does something\n */\n", "excerptTokens": [ { @@ -1252,6 +1284,7 @@ { "kind": "Interface", "canonicalReference": "(IDocInterface6:interface)", + "uid": "api-documenter-test/IDocInterface6", "docComment": "/**\n * Interface without inline tag to test custom TOC with injection\n *\n * @public\n */\n", "excerptTokens": [ { @@ -1273,6 +1306,7 @@ { "kind": "PropertySignature", "canonicalReference": "regularProperty", + "uid": "api-documenter-test/IDocInterface6#regularProperty", "docComment": "/**\n * Property of type number that does something\n */\n", "excerptTokens": [ { @@ -1305,6 +1339,7 @@ { "kind": "Namespace", "canonicalReference": "(OuterNamespace:namespace)", + "uid": "api-documenter-test/OuterNamespace", "docComment": "/**\n * A top-level namespace\n *\n * @public\n */\n", "excerptTokens": [ { @@ -1326,6 +1361,7 @@ { "kind": "Namespace", "canonicalReference": "(InnerNamespace:namespace)", + "uid": "api-documenter-test/OuterNamespace.InnerNamespace", "docComment": "/**\n * A nested namespace\n */\n", "excerptTokens": [ { @@ -1347,6 +1383,7 @@ { "kind": "Function", "canonicalReference": "(nestedFunction:0)", + "uid": "api-documenter-test/OuterNamespace.InnerNamespace.nestedFunction(number)", "docComment": "/**\n * A function inside a namespace\n */\n", "excerptTokens": [ { @@ -1408,6 +1445,7 @@ { "kind": "Variable", "canonicalReference": "nestedVariable", + "uid": "api-documenter-test/OuterNamespace.nestedVariable", "docComment": "/**\n * A variable exported from within a namespace.\n */\n", "excerptTokens": [ { @@ -1435,6 +1473,7 @@ { "kind": "Class", "canonicalReference": "(SystemEvent:class)", + "uid": "api-documenter-test/SystemEvent", "docComment": "/**\n * A class used to exposed events.\n *\n * {@docCategory SystemEvent}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -1456,6 +1495,7 @@ { "kind": "Method", "canonicalReference": "(addHandler:instance,0)", + "uid": "api-documenter-test/SystemEvent#addHandler(()~void)", "docComment": "/**\n * Adds an handler for the event.\n */\n", "excerptTokens": [ { @@ -1515,6 +1555,7 @@ { "kind": "Variable", "canonicalReference": "constVariable", + "uid": "api-documenter-test/constVariable", "docComment": "/**\n * An exported variable declaration.\n *\n * @public\n */\n", "excerptTokens": [ { @@ -1540,6 +1581,7 @@ { "kind": "TypeAlias", "canonicalReference": "ExampleTypeAlias", + "uid": "api-documenter-test/ExampleTypeAlias", "docComment": "/**\n * A type alias\n *\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/ambientNameConflict/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/ambientNameConflict/api-extractor-scenarios.api.json index 3ae06e4c8f5..0c1973e89ad 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/ambientNameConflict/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/ambientNameConflict/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Function", "canonicalReference": "(ambientNameConflict:0)", + "uid": "api-extractor-scenarios/ambientNameConflict(Promise`1{void},api-extractor-scenarios/Promise`1{void})", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/apiItemKinds/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/apiItemKinds/api-extractor-scenarios.api.json index a9012a4cde8..a702c9b1de2 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/apiItemKinds/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/apiItemKinds/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(AbstractClass:class)", + "uid": "api-extractor-scenarios/AbstractClass", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -39,6 +41,7 @@ { "kind": "Method", "canonicalReference": "(member:instance,0)", + "uid": "api-extractor-scenarios/AbstractClass#member", "docComment": "", "excerptTokens": [ { @@ -78,6 +81,7 @@ { "kind": "Class", "canonicalReference": "(ClassWithTypeLiterals:class)", + "uid": "api-extractor-scenarios/ClassWithTypeLiterals", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -99,6 +103,7 @@ { "kind": "Method", "canonicalReference": "(method1:instance,0)", + "uid": "api-extractor-scenarios/ClassWithTypeLiterals#method1({{x:number,y:number}})", "docComment": "/**\n * type literal in\n */\n", "excerptTokens": [ { @@ -171,6 +176,7 @@ { "kind": "Method", "canonicalReference": "(method2:instance,0)", + "uid": "api-extractor-scenarios/ClassWithTypeLiterals#method2", "docComment": "/**\n * type literal output\n */\n", "excerptTokens": [ { @@ -230,6 +236,7 @@ { "kind": "Enum", "canonicalReference": "(ConstEnum:enum)", + "uid": "api-extractor-scenarios/ConstEnum", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -251,6 +258,7 @@ { "kind": "EnumMember", "canonicalReference": "One", + "uid": "api-extractor-scenarios/ConstEnum.One", "docComment": "", "excerptTokens": [ { @@ -276,6 +284,7 @@ { "kind": "EnumMember", "canonicalReference": "Two", + "uid": "api-extractor-scenarios/ConstEnum.Two", "docComment": "", "excerptTokens": [ { @@ -301,6 +310,7 @@ { "kind": "EnumMember", "canonicalReference": "Zero", + "uid": "api-extractor-scenarios/ConstEnum.Zero", "docComment": "", "excerptTokens": [ { @@ -328,6 +338,7 @@ { "kind": "Interface", "canonicalReference": "(IInterface:interface)", + "uid": "api-extractor-scenarios/IInterface", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -349,6 +360,7 @@ { "kind": "PropertySignature", "canonicalReference": "member", + "uid": "api-extractor-scenarios/IInterface#member", "docComment": "", "excerptTokens": [ { @@ -381,6 +393,7 @@ { "kind": "Namespace", "canonicalReference": "(NamespaceContainingVariable:namespace)", + "uid": "api-extractor-scenarios/NamespaceContainingVariable", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -402,6 +415,7 @@ { "kind": "Variable", "canonicalReference": "constVariable", + "uid": "api-extractor-scenarios/NamespaceContainingVariable.constVariable", "docComment": "", "excerptTokens": [ { @@ -427,6 +441,7 @@ { "kind": "Variable", "canonicalReference": "variable", + "uid": "api-extractor-scenarios/NamespaceContainingVariable.variable", "docComment": "", "excerptTokens": [ { @@ -454,6 +469,7 @@ { "kind": "Enum", "canonicalReference": "(RegularEnum:enum)", + "uid": "api-extractor-scenarios/RegularEnum", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -475,6 +491,7 @@ { "kind": "EnumMember", "canonicalReference": "One", + "uid": "api-extractor-scenarios/RegularEnum.One", "docComment": "/**\n * These are some docs for One\n */\n", "excerptTokens": [ { @@ -500,6 +517,7 @@ { "kind": "EnumMember", "canonicalReference": "Two", + "uid": "api-extractor-scenarios/RegularEnum.Two", "docComment": "/**\n * These are some docs for Two\n */\n", "excerptTokens": [ { @@ -525,6 +543,7 @@ { "kind": "EnumMember", "canonicalReference": "Zero", + "uid": "api-extractor-scenarios/RegularEnum.Zero", "docComment": "/**\n * These are some docs for Zero\n */\n", "excerptTokens": [ { @@ -552,6 +571,7 @@ { "kind": "Class", "canonicalReference": "(SimpleClass:class)", + "uid": "api-extractor-scenarios/SimpleClass", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -573,6 +593,7 @@ { "kind": "Method", "canonicalReference": "(member:instance,0)", + "uid": "api-extractor-scenarios/SimpleClass#member", "docComment": "", "excerptTokens": [ { @@ -608,6 +629,7 @@ { "kind": "Variable", "canonicalReference": "VARIABLE", + "uid": "api-extractor-scenarios/VARIABLE", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport/api-extractor-scenarios.api.json index ed365c2d8cb..1e09127405b 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(IFile:class)", + "uid": "api-extractor-scenarios/IFile", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -39,6 +41,7 @@ { "kind": "Property", "canonicalReference": "(containingFolder:instance)", + "uid": "api-extractor-scenarios/IFile#containingFolder", "docComment": "", "excerptTokens": [ { @@ -72,6 +75,7 @@ { "kind": "Class", "canonicalReference": "(IFolder:class)", + "uid": "api-extractor-scenarios/IFolder", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -93,6 +97,7 @@ { "kind": "Property", "canonicalReference": "(containingFolder:instance)", + "uid": "api-extractor-scenarios/IFolder#containingFolder", "docComment": "", "excerptTokens": [ { @@ -127,6 +132,7 @@ { "kind": "Property", "canonicalReference": "(files:instance)", + "uid": "api-extractor-scenarios/IFolder#files", "docComment": "", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport2/api-extractor-scenarios.api.json index 27e136e1887..cf5df1a962f 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/circularImport2/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(A:class)", + "uid": "api-extractor-scenarios/A", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -41,6 +43,7 @@ { "kind": "Class", "canonicalReference": "(B:class)", + "uid": "api-extractor-scenarios/B", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -64,6 +67,7 @@ { "kind": "Class", "canonicalReference": "(IFile:class)", + "uid": "api-extractor-scenarios/IFile", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -85,6 +89,7 @@ { "kind": "Property", "canonicalReference": "(containingFolder:instance)", + "uid": "api-extractor-scenarios/IFile#containingFolder", "docComment": "", "excerptTokens": [ { @@ -118,6 +123,7 @@ { "kind": "Class", "canonicalReference": "(IFolder:class)", + "uid": "api-extractor-scenarios/IFolder", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -139,6 +145,7 @@ { "kind": "Property", "canonicalReference": "(containingFolder:instance)", + "uid": "api-extractor-scenarios/IFolder#containingFolder", "docComment": "", "excerptTokens": [ { @@ -173,6 +180,7 @@ { "kind": "Property", "canonicalReference": "(files:instance)", + "uid": "api-extractor-scenarios/IFolder#files", "docComment": "", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint/api-extractor-scenarios.api.json index 23fca076dbd..4a5150debee 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(DefaultClass:class)", + "uid": "api-extractor-scenarios/default", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json index 8eee5bcd30c..685180be589 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint2/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Variable", "canonicalReference": "defaultFunctionStatement", + "uid": "api-extractor-scenarios/defaultFunctionStatement", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json index 6ca5a00eccf..16bd1cdfb88 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint3/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Function", "canonicalReference": "(defaultFunctionDeclaration:0)", + "uid": "api-extractor-scenarios/default", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json index 3ec101a288e..cac04472fb2 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/defaultExportOfEntryPoint4/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Variable", "canonicalReference": "_default", + "uid": "api-extractor-scenarios/_default", "docComment": "", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences/api-extractor-scenarios.api.json index 313bdf7277b..6a09f1e6632 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Function", "canonicalReference": "(failWithBrokenLink:0)", + "uid": "api-extractor-scenarios/failWithBrokenLink", "docComment": "/**\n * {@inheritDoc MyNamespace.MyClass.nonExistentMethod}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -53,6 +55,7 @@ { "kind": "Function", "canonicalReference": "(failWithMissingReference:0)", + "uid": "api-extractor-scenarios/failWithMissingReference", "docComment": "/**\n * {@inheritDoc}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -88,6 +91,7 @@ { "kind": "Namespace", "canonicalReference": "(MyNamespace:namespace)", + "uid": "api-extractor-scenarios/MyNamespace", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -109,6 +113,7 @@ { "kind": "Class", "canonicalReference": "(MyClass:class)", + "uid": "api-extractor-scenarios/MyNamespace.MyClass", "docComment": "", "excerptTokens": [ { @@ -130,6 +135,7 @@ { "kind": "Method", "canonicalReference": "(myMethod:instance,0)", + "uid": "api-extractor-scenarios/MyNamespace.MyClass#myMethod(number)", "docComment": "/**\n * Summary for myMethod\n *\n * @remarks\n *\n * Remarks for myMethod\n *\n * @param x - the parameter\n *\n * @returns a number\n *\n * @beta\n */\n", "excerptTokens": [ { @@ -191,6 +197,7 @@ { "kind": "Function", "canonicalReference": "(succeedForNow:0)", + "uid": "api-extractor-scenarios/succeedForNow", "docComment": "/**\n * {@inheritDoc nonexistent-package#MyNamespace.MyClass.nonExistentMethod}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -226,6 +233,7 @@ { "kind": "Function", "canonicalReference": "(testSimple:0)", + "uid": "api-extractor-scenarios/testSimple", "docComment": "/**\n * Summary for myMethod\n *\n * @remarks\n *\n * Remarks for myMethod\n *\n * @param x - the parameter\n *\n * @returns a number\n *\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences2/api-extractor-scenarios.api.json index 105b51dec33..dd38d6cf939 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences2/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(CyclicA:class)", + "uid": "api-extractor-scenarios/CyclicA", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -39,6 +41,7 @@ { "kind": "Method", "canonicalReference": "(methodA1:instance,0)", + "uid": "api-extractor-scenarios/CyclicA#methodA1", "docComment": "/**\n * THE COMMENT\n */\n", "excerptTokens": [ { @@ -71,6 +74,7 @@ { "kind": "Method", "canonicalReference": "(methodA3:instance,0)", + "uid": "api-extractor-scenarios/CyclicA#methodA3", "docComment": "/**\n * THE COMMENT\n */\n", "excerptTokens": [ { @@ -106,6 +110,7 @@ { "kind": "Class", "canonicalReference": "(CyclicB:class)", + "uid": "api-extractor-scenarios/CyclicB", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -127,6 +132,7 @@ { "kind": "Method", "canonicalReference": "(methodB2:instance,0)", + "uid": "api-extractor-scenarios/CyclicB#methodB2", "docComment": "/**\n * THE COMMENT\n */\n", "excerptTokens": [ { @@ -159,6 +165,7 @@ { "kind": "Method", "canonicalReference": "(methodB4:instance,0)", + "uid": "api-extractor-scenarios/CyclicB#methodB4", "docComment": "/**\n * THE COMMENT\n */\n", "excerptTokens": [ { @@ -194,6 +201,7 @@ { "kind": "Class", "canonicalReference": "(FailWithSelfReference:class)", + "uid": "api-extractor-scenarios/FailWithSelfReference", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -215,6 +223,7 @@ { "kind": "Method", "canonicalReference": "(method1:instance,0)", + "uid": "api-extractor-scenarios/FailWithSelfReference#method1", "docComment": "", "excerptTokens": [ { @@ -247,6 +256,7 @@ { "kind": "Method", "canonicalReference": "(method2:instance,0)", + "uid": "api-extractor-scenarios/FailWithSelfReference#method2", "docComment": "", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences3/api-extractor-scenarios.api.json index bbbad7ef58c..158db8b44c0 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/docReferences3/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Interface", "canonicalReference": "(A:interface)", + "uid": "api-extractor-scenarios/A", "docComment": "", "excerptTokens": [ { @@ -39,6 +41,7 @@ { "kind": "PropertySignature", "canonicalReference": "myProperty", + "uid": "api-extractor-scenarios/A#myProperty", "docComment": "", "excerptTokens": [ { @@ -71,6 +74,7 @@ { "kind": "Namespace", "canonicalReference": "(A:namespace)", + "uid": "api-extractor-scenarios/A:namespace", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -92,6 +96,7 @@ { "kind": "Class", "canonicalReference": "(B:class)", + "uid": "api-extractor-scenarios/A.B", "docComment": "", "excerptTokens": [ { @@ -113,6 +118,7 @@ { "kind": "Method", "canonicalReference": "(myMethod:instance,0)", + "uid": "api-extractor-scenarios/A.B#myMethod", "docComment": "", "excerptTokens": [ { @@ -150,6 +156,7 @@ { "kind": "Function", "canonicalReference": "(failWithAmbiguity:0)", + "uid": "api-extractor-scenarios/failWithAmbiguity", "docComment": "/**\n * {@link MyNamespace.MyClass.myMethod | the method}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -185,6 +192,7 @@ { "kind": "Function", "canonicalReference": "(succeedWithExternalReference:0)", + "uid": "api-extractor-scenarios/succeedWithExternalReference", "docComment": "/**\n * NOTE: The broken link checker currently is not able to validate references to external packages. Tracked by: https://github.com/Microsoft/web-build-tools/issues/1195 {@link nonexistent#nonexistent}\n *\n * @public\n */\n", "excerptTokens": [ { @@ -220,6 +228,7 @@ { "kind": "Function", "canonicalReference": "(succeedWithSelector:0)", + "uid": "api-extractor-scenarios/succeedWithSelector", "docComment": "/**\n * {@link (A:namespace).B.myMethod | the method} {@link (A:interface).myProperty | the property}\n *\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportDuplicate/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportDuplicate/api-extractor-scenarios.api.json index f230aebb5cc..aaf76f8f7df 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportDuplicate/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportDuplicate/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(X:class)", + "uid": "api-extractor-scenarios/X", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportEquals/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportEquals/api-extractor-scenarios.api.json index da37f7e3814..fd8831ff12a 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportEquals/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportEquals/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Interface", "canonicalReference": "(ITeamsContext:interface)", + "uid": "api-extractor-scenarios/ITeamsContext", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -39,6 +41,7 @@ { "kind": "PropertySignature", "canonicalReference": "context", + "uid": "api-extractor-scenarios/ITeamsContext#context", "docComment": "", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportedExternal/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportedExternal/api-extractor-scenarios.api.json index 9a30ab4fc4b..46818a5cebf 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportedExternal/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportedExternal/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportedExternal2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportedExternal2/api-extractor-scenarios.api.json index 9a30ab4fc4b..46818a5cebf 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportedExternal2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportedExternal2/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar/api-extractor-scenarios.api.json index b6ff28357a3..b4adf0bd4d2 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(A:class)", + "uid": "api-extractor-scenarios/A", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -41,6 +43,7 @@ { "kind": "Class", "canonicalReference": "(B:class)", + "uid": "api-extractor-scenarios/B", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -64,6 +67,7 @@ { "kind": "Class", "canonicalReference": "(C:class)", + "uid": "api-extractor-scenarios/C", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar2/api-extractor-scenarios.api.json index 2acd6a533de..a709be4d517 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar2/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar2/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(A:class)", + "uid": "api-extractor-scenarios/A", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar3/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar3/api-extractor-scenarios.api.json index 2acd6a533de..a709be4d517 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar3/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportStar3/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(A:class)", + "uid": "api-extractor-scenarios/A", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/importEquals/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/importEquals/api-extractor-scenarios.api.json index fad8fa6d6d7..2d6c89e3059 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/importEquals/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/importEquals/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Function", "canonicalReference": "(useColors:0)", + "uid": "api-extractor-scenarios/useColors", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/inconsistentReleaseTags/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/inconsistentReleaseTags/api-extractor-scenarios.api.json index 277cdf7ceb0..1a3bef9d73e 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/inconsistentReleaseTags/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/inconsistentReleaseTags/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Interface", "canonicalReference": "(IBeta:interface)", + "uid": "api-extractor-scenarios/IBeta", "docComment": "/**\n * @beta\n */\n", "excerptTokens": [ { @@ -39,6 +41,7 @@ { "kind": "PropertySignature", "canonicalReference": "x", + "uid": "api-extractor-scenarios/IBeta#x", "docComment": "", "excerptTokens": [ { @@ -71,6 +74,7 @@ { "kind": "Function", "canonicalReference": "(publicFunctionReturnsBeta:0)", + "uid": "api-extractor-scenarios/publicFunctionReturnsBeta", "docComment": "/**\n * It's not okay for a \"public\" function to reference a \"beta\" symbol, because \"beta\" is less public than \"public\".\n *\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/preapproved/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/preapproved/api-extractor-scenarios.api.json index 9a30ab4fc4b..46818a5cebf 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/preapproved/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/preapproved/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf/api-extractor-scenarios.api.json index 75aa467840d..22ddefd057d 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/typeOf/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Function", "canonicalReference": "(f:0)", + "uid": "api-extractor-scenarios/f", "docComment": "/**\n * Reference Lib1Class via \"typeof\"\n *\n * @public\n */\n", "excerptTokens": [ { @@ -61,6 +63,7 @@ { "kind": "Function", "canonicalReference": "(g:0)", + "uid": "api-extractor-scenarios/g", "docComment": "/**\n * Reference IForgottenExport via \"typeof\"\n *\n * @public\n */\n", "excerptTokens": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/typeParameters/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/typeParameters/api-extractor-scenarios.api.json index 11aa75c028f..d64e8b7913b 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/typeParameters/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/typeParameters/api-extractor-scenarios.api.json @@ -7,6 +7,7 @@ }, "kind": "Package", "canonicalReference": "api-extractor-scenarios", + "uid": "api-extractor-scenarios/", "docComment": "", "name": "api-extractor-scenarios", "members": [ @@ -18,6 +19,7 @@ { "kind": "Class", "canonicalReference": "(ClassWithGenericMethod:class)", + "uid": "api-extractor-scenarios/ClassWithGenericMethod", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -39,6 +41,7 @@ { "kind": "Method", "canonicalReference": "(method:instance,0)", + "uid": "api-extractor-scenarios/ClassWithGenericMethod#method``1", "docComment": "", "excerptTokens": [ { @@ -95,6 +98,7 @@ { "kind": "Class", "canonicalReference": "(GenericClass:class)", + "uid": "api-extractor-scenarios/GenericClass`1", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -139,6 +143,7 @@ { "kind": "Class", "canonicalReference": "(GenericClassWithConstraint:class)", + "uid": "api-extractor-scenarios/GenericClassWithConstraint`1", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -191,6 +196,7 @@ { "kind": "Class", "canonicalReference": "(GenericClassWithDefault:class)", + "uid": "api-extractor-scenarios/GenericClassWithDefault`1", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -243,6 +249,7 @@ { "kind": "Function", "canonicalReference": "(genericFunction:0)", + "uid": "api-extractor-scenarios/genericFunction``1", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -299,6 +306,7 @@ { "kind": "Interface", "canonicalReference": "(GenericInterface:interface)", + "uid": "api-extractor-scenarios/GenericInterface`1", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -343,6 +351,7 @@ { "kind": "Interface", "canonicalReference": "(InterfaceWithGenericCallSignature:interface)", + "uid": "api-extractor-scenarios/InterfaceWithGenericCallSignature", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -414,6 +423,7 @@ { "kind": "Interface", "canonicalReference": "(InterfaceWithGenericConstructSignature:interface)", + "uid": "api-extractor-scenarios/InterfaceWithGenericConstructSignature", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { @@ -485,6 +495,7 @@ { "kind": "TypeAlias", "canonicalReference": "GenericTypeAlias", + "uid": "api-extractor-scenarios/GenericTypeAlias`1", "docComment": "/**\n * @public\n */\n", "excerptTokens": [ { diff --git a/common/reviews/api/api-extractor-model.api.md b/common/reviews/api/api-extractor-model.api.md index dbe3c83a8cc..75c40fab5ae 100644 --- a/common/reviews/api/api-extractor-model.api.md +++ b/common/reviews/api/api-extractor-model.api.md @@ -235,7 +235,9 @@ export class ApiItem { readonly parent: ApiItem | undefined; // @virtual (undocumented) serializeInto(jsonObject: Partial): void; -} + // (undocumented) + readonly uid: string; + } // @public export function ApiItemContainerMixin(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiItemContainerMixin); @@ -662,6 +664,8 @@ export interface IApiItemContainerMixinOptions extends IApiItemOptions { // @public export interface IApiItemOptions { + // (undocumented) + uid?: string; } // @public