Commit 107cdd2d authored by DatHV's avatar DatHV
Browse files

update build x-app-sdk

parent 9bb8aadd
Pipeline #2082 failed with stages
in 0 seconds
"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiDeclaredItem = void 0;
const DeclarationReference_1 = require("@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference");
const ApiDocumentedItem_1 = require("./ApiDocumentedItem");
const Excerpt_1 = require("../mixins/Excerpt");
const SourceLocation_1 = require("../model/SourceLocation");
/**
* The base class for API items that have an associated source code excerpt containing a TypeScript declaration.
*
* @remarks
*
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
* API declarations.
*
* Most `ApiItem` subclasses have declarations and thus extend `ApiDeclaredItem`. Counterexamples include
* `ApiModel` and `ApiPackage`, which do not have any corresponding TypeScript source code.
*
* @public
*/
class ApiDeclaredItem extends ApiDocumentedItem_1.ApiDocumentedItem {
constructor(options) {
super(options);
this._excerptTokens = options.excerptTokens.map((token) => {
const canonicalReference = token.canonicalReference === undefined
? undefined
: DeclarationReference_1.DeclarationReference.parse(token.canonicalReference);
return new Excerpt_1.ExcerptToken(token.kind, token.text, canonicalReference);
});
this._excerpt = new Excerpt_1.Excerpt(this.excerptTokens, { startIndex: 0, endIndex: this.excerptTokens.length });
this._fileUrlPath = options.fileUrlPath;
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
super.onDeserializeInto(options, context, jsonObject);
options.excerptTokens = jsonObject.excerptTokens;
options.fileUrlPath = jsonObject.fileUrlPath;
}
/**
* The source code excerpt where the API item is declared.
*/
get excerpt() {
return this._excerpt;
}
/**
* The individual source code tokens that comprise the main excerpt.
*/
get excerptTokens() {
return this._excerptTokens;
}
/**
* The file URL path relative to the `projectFolder` and `projectFolderURL` fields
* as defined in the `api-extractor.json` config. Is `undefined` if the path is
* the same as the parent API item's.
*/
get fileUrlPath() {
return this._fileUrlPath;
}
/**
* Returns the source location where the API item is declared.
*/
get sourceLocation() {
if (!this._sourceLocation) {
this._sourceLocation = this._buildSourceLocation();
}
return this._sourceLocation;
}
/**
* If the API item has certain important modifier tags such as `@sealed`, `@virtual`, or `@override`,
* this prepends them as a doc comment above the excerpt.
*/
getExcerptWithModifiers() {
const excerpt = this.excerpt.text;
const modifierTags = [];
if (excerpt.length > 0) {
if (this instanceof ApiDocumentedItem_1.ApiDocumentedItem) {
if (this.tsdocComment) {
if (this.tsdocComment.modifierTagSet.isSealed()) {
modifierTags.push('@sealed');
}
if (this.tsdocComment.modifierTagSet.isVirtual()) {
modifierTags.push('@virtual');
}
if (this.tsdocComment.modifierTagSet.isOverride()) {
modifierTags.push('@override');
}
}
if (modifierTags.length > 0) {
return '/** ' + modifierTags.join(' ') + ' */\n' + excerpt;
}
}
}
return excerpt;
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
jsonObject.excerptTokens = this.excerptTokens.map((x) => {
const excerptToken = { kind: x.kind, text: x.text };
if (x.canonicalReference !== undefined) {
excerptToken.canonicalReference = x.canonicalReference.toString();
}
return excerptToken;
});
// Only serialize this API item's file URL path if it exists and it's different from its parent's
// (a little optimization to keep the doc model succinct).
if (this.fileUrlPath) {
if (!(this.parent instanceof ApiDeclaredItem) || this.fileUrlPath !== this.parent.fileUrlPath) {
jsonObject.fileUrlPath = this.fileUrlPath;
}
}
}
/**
* Constructs a new {@link Excerpt} corresponding to the provided token range.
*/
buildExcerpt(tokenRange) {
return new Excerpt_1.Excerpt(this.excerptTokens, tokenRange);
}
/**
* Builds the cached object used by the `sourceLocation` property.
*/
_buildSourceLocation() {
var _a;
const projectFolderUrl = (_a = this.getAssociatedPackage()) === null || _a === void 0 ? void 0 : _a.projectFolderUrl;
let fileUrlPath;
for (let current = this; current !== undefined; current = current.parent) {
if (current instanceof ApiDeclaredItem && current.fileUrlPath) {
fileUrlPath = current.fileUrlPath;
break;
}
}
return new SourceLocation_1.SourceLocation({
projectFolderUrl: projectFolderUrl,
fileUrlPath: fileUrlPath
});
}
}
exports.ApiDeclaredItem = ApiDeclaredItem;
//# sourceMappingURL=ApiDeclaredItem.js.map
\ No newline at end of file
{"version":3,"file":"ApiDeclaredItem.js","sourceRoot":"","sources":["../../src/items/ApiDeclaredItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAA+F;AAE/F,2DAI6B;AAE7B,+CAAuG;AAEvG,4DAAyD;AAgBzD;;;;;;;;;;;;GAYG;AACH,MAAa,eAAgB,SAAQ,qCAAiB;IAMpD,YAAmB,OAAgC;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACxD,MAAM,kBAAkB,GACtB,KAAK,CAAC,kBAAkB,KAAK,SAAS;gBACpC,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,2CAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YAC3D,OAAO,IAAI,sBAAY,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC;QACxG,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAAyC,EACzC,OAA4B,EAC5B,UAAgC;QAEhC,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,OAAO,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;QACjD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GAAwB,IAAI,EAAE,OAAO,KAAK,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAC9F,IAAI,OAAO,YAAY,eAAe,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;gBAC9D,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;gBAClC,MAAM;YACR,CAAC;QACH,CAAC;QAED,OAAO,IAAI,+BAAc,CAAC;YACxB,gBAAgB,EAAE,gBAAgB;YAClC,WAAW,EAAE,WAAW;SACzB,CAAC,CAAC;IACL,CAAC;CACF;AA7ID,0CA6IC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\n\nimport {\n ApiDocumentedItem,\n type IApiDocumentedItemJson,\n type IApiDocumentedItemOptions\n} from './ApiDocumentedItem';\nimport type { ApiItem } from './ApiItem';\nimport { Excerpt, ExcerptToken, type IExcerptTokenRange, type IExcerptToken } from '../mixins/Excerpt';\nimport type { DeserializerContext } from '../model/DeserializerContext';\nimport { SourceLocation } from '../model/SourceLocation';\n\n/**\n * Constructor options for {@link ApiDeclaredItem}.\n * @public\n */\nexport interface IApiDeclaredItemOptions extends IApiDocumentedItemOptions {\n excerptTokens: IExcerptToken[];\n fileUrlPath?: string;\n}\n\nexport interface IApiDeclaredItemJson extends IApiDocumentedItemJson {\n excerptTokens: IExcerptToken[];\n fileUrlPath?: string;\n}\n\n/**\n * The base class for API items that have an associated source code excerpt containing a TypeScript declaration.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * Most `ApiItem` subclasses have declarations and thus extend `ApiDeclaredItem`. Counterexamples include\n * `ApiModel` and `ApiPackage`, which do not have any corresponding TypeScript source code.\n *\n * @public\n */\nexport class ApiDeclaredItem extends ApiDocumentedItem {\n private _excerptTokens: ExcerptToken[];\n private _excerpt: Excerpt;\n private _fileUrlPath?: string;\n private _sourceLocation?: SourceLocation;\n\n public constructor(options: IApiDeclaredItemOptions) {\n super(options);\n\n this._excerptTokens = options.excerptTokens.map((token) => {\n const canonicalReference: DeclarationReference | undefined =\n token.canonicalReference === undefined\n ? undefined\n : DeclarationReference.parse(token.canonicalReference);\n return new ExcerptToken(token.kind, token.text, canonicalReference);\n });\n this._excerpt = new Excerpt(this.excerptTokens, { startIndex: 0, endIndex: this.excerptTokens.length });\n this._fileUrlPath = options.fileUrlPath;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiDeclaredItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiDeclaredItemJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.excerptTokens = jsonObject.excerptTokens;\n options.fileUrlPath = jsonObject.fileUrlPath;\n }\n\n /**\n * The source code excerpt where the API item is declared.\n */\n public get excerpt(): Excerpt {\n return this._excerpt;\n }\n\n /**\n * The individual source code tokens that comprise the main excerpt.\n */\n public get excerptTokens(): ReadonlyArray<ExcerptToken> {\n return this._excerptTokens;\n }\n\n /**\n * The file URL path relative to the `projectFolder` and `projectFolderURL` fields\n * as defined in the `api-extractor.json` config. Is `undefined` if the path is\n * the same as the parent API item's.\n */\n public get fileUrlPath(): string | undefined {\n return this._fileUrlPath;\n }\n\n /**\n * Returns the source location where the API item is declared.\n */\n public get sourceLocation(): SourceLocation {\n if (!this._sourceLocation) {\n this._sourceLocation = this._buildSourceLocation();\n }\n return this._sourceLocation;\n }\n\n /**\n * If the API item has certain important modifier tags such as `@sealed`, `@virtual`, or `@override`,\n * this prepends them as a doc comment above the excerpt.\n */\n public getExcerptWithModifiers(): string {\n const excerpt: string = this.excerpt.text;\n const modifierTags: string[] = [];\n\n if (excerpt.length > 0) {\n if (this instanceof ApiDocumentedItem) {\n if (this.tsdocComment) {\n if (this.tsdocComment.modifierTagSet.isSealed()) {\n modifierTags.push('@sealed');\n }\n if (this.tsdocComment.modifierTagSet.isVirtual()) {\n modifierTags.push('@virtual');\n }\n if (this.tsdocComment.modifierTagSet.isOverride()) {\n modifierTags.push('@override');\n }\n }\n if (modifierTags.length > 0) {\n return '/** ' + modifierTags.join(' ') + ' */\\n' + excerpt;\n }\n }\n }\n\n return excerpt;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiDeclaredItemJson>): void {\n super.serializeInto(jsonObject);\n jsonObject.excerptTokens = this.excerptTokens.map((x) => {\n const excerptToken: IExcerptToken = { kind: x.kind, text: x.text };\n if (x.canonicalReference !== undefined) {\n excerptToken.canonicalReference = x.canonicalReference.toString();\n }\n return excerptToken;\n });\n\n // Only serialize this API item's file URL path if it exists and it's different from its parent's\n // (a little optimization to keep the doc model succinct).\n if (this.fileUrlPath) {\n if (!(this.parent instanceof ApiDeclaredItem) || this.fileUrlPath !== this.parent.fileUrlPath) {\n jsonObject.fileUrlPath = this.fileUrlPath;\n }\n }\n }\n\n /**\n * Constructs a new {@link Excerpt} corresponding to the provided token range.\n */\n public buildExcerpt(tokenRange: IExcerptTokenRange): Excerpt {\n return new Excerpt(this.excerptTokens, tokenRange);\n }\n\n /**\n * Builds the cached object used by the `sourceLocation` property.\n */\n private _buildSourceLocation(): SourceLocation {\n const projectFolderUrl: string | undefined = this.getAssociatedPackage()?.projectFolderUrl;\n\n let fileUrlPath: string | undefined;\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (current instanceof ApiDeclaredItem && current.fileUrlPath) {\n fileUrlPath = current.fileUrlPath;\n break;\n }\n }\n\n return new SourceLocation({\n projectFolderUrl: projectFolderUrl,\n fileUrlPath: fileUrlPath\n });\n }\n}\n"]}
\ No newline at end of file
import * as tsdoc from '@microsoft/tsdoc';
import { ApiItem, type IApiItemOptions, type IApiItemJson } from './ApiItem';
import type { DeserializerContext } from '../model/DeserializerContext';
/**
* Constructor options for {@link ApiDocumentedItem}.
* @public
*/
export interface IApiDocumentedItemOptions extends IApiItemOptions {
docComment: tsdoc.DocComment | undefined;
}
export interface IApiDocumentedItemJson extends IApiItemJson {
docComment: string;
}
/**
* An abstract base class for API declarations that can have an associated TSDoc comment.
*
* @remarks
*
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
* API declarations.
*
* @public
*/
export declare class ApiDocumentedItem extends ApiItem {
private _tsdocComment;
constructor(options: IApiDocumentedItemOptions);
/** @override */
static onDeserializeInto(options: Partial<IApiDocumentedItemOptions>, context: DeserializerContext, jsonObject: IApiItemJson): void;
get tsdocComment(): tsdoc.DocComment | undefined;
/** @override */
serializeInto(jsonObject: Partial<IApiDocumentedItemJson>): void;
}
//# sourceMappingURL=ApiDocumentedItem.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiDocumentedItem.d.ts","sourceRoot":"","sources":["../../src/items/ApiDocumentedItem.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExE;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,eAAe;IAChE,UAAU,EAAE,KAAK,CAAC,UAAU,GAAG,SAAS,CAAC;CAC1C;AAED,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C,OAAO,CAAC,aAAa,CAA+B;gBAEjC,OAAO,EAAE,yBAAyB;IAKrD,gBAAgB;WACF,iBAAiB,CAC7B,OAAO,EAAE,OAAO,CAAC,yBAAyB,CAAC,EAC3C,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,YAAY,GACvB,IAAI;IAkBP,IAAW,YAAY,IAAI,KAAK,CAAC,UAAU,GAAG,SAAS,CAEtD;IAED,gBAAgB;IACT,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,IAAI;CAQxE"}
\ No newline at end of file
"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiDocumentedItem = void 0;
const tsdoc = __importStar(require("@microsoft/tsdoc"));
const ApiItem_1 = require("./ApiItem");
/**
* An abstract base class for API declarations that can have an associated TSDoc comment.
*
* @remarks
*
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
* API declarations.
*
* @public
*/
class ApiDocumentedItem extends ApiItem_1.ApiItem {
constructor(options) {
super(options);
this._tsdocComment = options.docComment;
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
super.onDeserializeInto(options, context, jsonObject);
const documentedJson = jsonObject;
if (documentedJson.docComment) {
const tsdocParser = new tsdoc.TSDocParser(context.tsdocConfiguration);
// 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.
// However, they could also arise if the JSON file was edited manually, or if the file was saved
// using a different release of the software that used an incompatible syntax.
const parserContext = tsdocParser.parseString(documentedJson.docComment);
options.docComment = parserContext.docComment;
}
}
get tsdocComment() {
return this._tsdocComment;
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
if (this.tsdocComment !== undefined) {
jsonObject.docComment = this.tsdocComment.emitAsTsdoc();
}
else {
jsonObject.docComment = '';
}
}
}
exports.ApiDocumentedItem = ApiDocumentedItem;
//# sourceMappingURL=ApiDocumentedItem.js.map
\ No newline at end of file
{"version":3,"file":"ApiDocumentedItem.js","sourceRoot":"","sources":["../../src/items/ApiDocumentedItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,wDAA0C;AAE1C,uCAA6E;AAe7E;;;;;;;;;GASG;AACH,MAAa,iBAAkB,SAAQ,iBAAO;IAG5C,YAAmB,OAAkC;QACnD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IAC1C,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAA2C,EAC3C,OAA4B,EAC5B,UAAwB;QAExB,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,MAAM,cAAc,GAA2B,UAAoC,CAAC;QAEpF,IAAI,cAAc,CAAC,UAAU,EAAE,CAAC;YAC9B,MAAM,WAAW,GAAsB,IAAI,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;YAEzF,8EAA8E;YAC9E,2FAA2F;YAC3F,gGAAgG;YAChG,8EAA8E;YAC9E,MAAM,aAAa,GAAwB,WAAW,CAAC,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;YAE9F,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC;QAChD,CAAC;IACH,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAA2C;QAC9D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACpC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;QAC1D,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,UAAU,GAAG,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;CACF;AA5CD,8CA4CC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as tsdoc from '@microsoft/tsdoc';\n\nimport { ApiItem, type IApiItemOptions, type IApiItemJson } from './ApiItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link ApiDocumentedItem}.\n * @public\n */\nexport interface IApiDocumentedItemOptions extends IApiItemOptions {\n docComment: tsdoc.DocComment | undefined;\n}\n\nexport interface IApiDocumentedItemJson extends IApiItemJson {\n docComment: string;\n}\n\n/**\n * An abstract base class for API declarations that can have an associated TSDoc comment.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * @public\n */\nexport class ApiDocumentedItem extends ApiItem {\n private _tsdocComment: tsdoc.DocComment | undefined;\n\n public constructor(options: IApiDocumentedItemOptions) {\n super(options);\n this._tsdocComment = options.docComment;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiDocumentedItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiItemJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n const documentedJson: IApiDocumentedItemJson = jsonObject as IApiDocumentedItemJson;\n\n if (documentedJson.docComment) {\n const tsdocParser: tsdoc.TSDocParser = new tsdoc.TSDocParser(context.tsdocConfiguration);\n\n // NOTE: For now, we ignore TSDoc errors found in a serialized .api.json file.\n // Normally these errors would have already been reported by API Extractor during analysis.\n // However, they could also arise if the JSON file was edited manually, or if the file was saved\n // using a different release of the software that used an incompatible syntax.\n const parserContext: tsdoc.ParserContext = tsdocParser.parseString(documentedJson.docComment);\n\n options.docComment = parserContext.docComment;\n }\n }\n\n public get tsdocComment(): tsdoc.DocComment | undefined {\n return this._tsdocComment;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiDocumentedItemJson>): void {\n super.serializeInto(jsonObject);\n if (this.tsdocComment !== undefined) {\n jsonObject.docComment = this.tsdocComment.emitAsTsdoc();\n } else {\n jsonObject.docComment = '';\n }\n }\n}\n"]}
\ No newline at end of file
import type { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
import type { Constructor, PropertiesOf } from '../mixins/Mixin';
import type { ApiPackage } from '../model/ApiPackage';
import type { DeserializerContext } from '../model/DeserializerContext';
import type { ApiModel } from '../model/ApiModel';
/**
* The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of
* {@link ApiItem}.
*
* @public
*/
export declare enum ApiItemKind {
CallSignature = "CallSignature",
Class = "Class",
Constructor = "Constructor",
ConstructSignature = "ConstructSignature",
EntryPoint = "EntryPoint",
Enum = "Enum",
EnumMember = "EnumMember",
Function = "Function",
IndexSignature = "IndexSignature",
Interface = "Interface",
Method = "Method",
MethodSignature = "MethodSignature",
Model = "Model",
Namespace = "Namespace",
Package = "Package",
Property = "Property",
PropertySignature = "PropertySignature",
TypeAlias = "TypeAlias",
Variable = "Variable",
None = "None"
}
/**
* Constructor options for {@link ApiItem}.
* @public
*/
export interface IApiItemOptions {
}
export interface IApiItemJson {
kind: ApiItemKind;
canonicalReference: string;
}
export declare const apiItem_onParentChanged: unique symbol;
/**
* The abstract base class for all members of an `ApiModel` object.
*
* @remarks
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
* API declarations.
* @public
*/
export declare class ApiItem {
private _canonicalReference;
private _parent;
constructor(options: IApiItemOptions);
static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem;
/** @virtual */
static onDeserializeInto(options: Partial<IApiItemOptions>, context: DeserializerContext, jsonObject: IApiItemJson): void;
/** @virtual */
serializeInto(jsonObject: Partial<IApiItemJson>): void;
/**
* Identifies the subclass of the `ApiItem` base class.
* @virtual
*/
get kind(): ApiItemKind;
/**
* Warning: This API is used internally by API extractor but is not yet ready for general usage.
*
* @remarks
*
* Returns a `DeclarationReference` object using the experimental new declaration reference notation.
*
* @beta
*/
get canonicalReference(): DeclarationReference;
/**
* Returns a string key that can be used to efficiently retrieve an `ApiItem` from an `ApiItemContainerMixin`.
* The key is unique within the container. Its format is undocumented and may change at any time.
*
* @remarks
* Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation
* of this function, according to the aspects that are important for identifying it.
*
* @virtual
*/
get containerKey(): string;
/**
* Returns a name for this object that can be used in diagnostic messages, for example.
*
* @remarks
* For an object that inherits ApiNameMixin, this will return the declared name (e.g. the name of a TypeScript
* function). Otherwise, it will return a string such as "(call signature)" or "(model)".
*
* @virtual
*/
get displayName(): string;
/**
* If this item was added to a ApiItemContainerMixin item, then this returns the container item.
* If this is an Parameter that was added to a method or function, then this returns the function item.
* Otherwise, it returns undefined.
* @virtual
*/
get parent(): ApiItem | undefined;
/**
* This property supports a visitor pattern for walking the tree.
* For items with ApiItemContainerMixin, it returns the contained items, sorted alphabetically.
* Otherwise it returns an empty array.
* @virtual
*/
get members(): ReadonlyArray<ApiItem>;
/**
* If this item has a name (i.e. extends `ApiNameMixin`), then return all items that have the same parent
* and the same name. Otherwise, return all items that have the same parent and the same `ApiItemKind`.
*
* @remarks
* Examples: For a function, this would return all overloads for the function. For a constructor, this would
* return all overloads for the constructor. For a merged declaration (e.g. a `namespace` and `enum` with the
* same name), this would return both declarations. If this item does not have a parent, or if it is the only
* item of its name/kind, then the result is an array containing only this item.
*/
getMergedSiblings(): ReadonlyArray<ApiItem>;
/**
* Returns the chain of ancestors, starting from the root of the tree, and ending with the this item.
*/
getHierarchy(): ReadonlyArray<ApiItem>;
/**
* This returns a scoped name such as `"Namespace1.Namespace2.MyClass.myMember()"`. It does not include the
* package name or entry point.
*
* @remarks
* If called on an ApiEntrypoint, ApiPackage, or ApiModel item, the result is an empty string.
*/
getScopedNameWithinPackage(): string;
/**
* If this item is an ApiPackage or has an ApiPackage as one of its parents, then that object is returned.
* Otherwise undefined is returned.
*/
getAssociatedPackage(): ApiPackage | undefined;
/**
* If this item is an ApiModel or has an ApiModel as one of its parents, then that object is returned.
* Otherwise undefined is returned.
*/
getAssociatedModel(): ApiModel | undefined;
/**
* A text string whose value determines the sort order that is automatically applied by the
* {@link (ApiItemContainerMixin:interface)} class.
*
* @remarks
* The value of this string is undocumented and may change at any time.
* If {@link (ApiItemContainerMixin:interface).preserveMemberOrder} is enabled for the `ApiItem`'s parent,
* then no sorting is performed, and this key is not used.
*
* @virtual
*/
getSortKey(): string;
/**
* PRIVATE
*
* @privateRemarks
* Allows ApiItemContainerMixin to assign the parent when the item is added to a container.
*
* @internal
*/
[apiItem_onParentChanged](parent: ApiItem | undefined): void;
/**
* Builds the cached object used by the `canonicalReference` property.
* @virtual
*/
protected buildCanonicalReference(): DeclarationReference;
}
/**
* This abstraction is used by the mixin pattern.
* It describes a class type that inherits from {@link ApiItem}.
*
* @public
*/
export interface IApiItemConstructor extends Constructor<ApiItem>, PropertiesOf<typeof ApiItem> {
}
//# sourceMappingURL=ApiItem.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiItem.d.ts","sourceRoot":"","sources":["../../src/items/ApiItem.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAGpG,OAAO,KAAK,EAAE,WAAW,EAAE,YAA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AK7D;;;OAGG;IACH,IAAW,IAAI,IAAI,WAAW,CAE7B;IAED;;;;;;;;OAQG;IACH,IAAW,kBAAkB,IAAI,oBAAoB,CAUpD;IAED;;;;;;;;;OASG;IACH,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED;;;;;;;;OAQG;IACH,IAAW,WAAW,IAAI,MAAM,CAc/B;IAED;;;;;OAKG;IACH,IAAW,MAAM,IAAI,OAAO,GAAG,SAAS,CAEvC;IAED;;;;;OAKG;IACH,IAAW,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,CAE3C;IAED;;;;;;;;;OASG;IACI,iBAAiB,IAAI,aAAa,CAAC,OAAO,CAAC;IAQlD;;OAEG;IACI,YAAY,IAAI,aAAa,CAAC,OAAO,CAAC;IAS7C;;;;;;OAMG;IACI,0BAA0B,IAAI,MAAM;IAiC3C;;;OAGG;IACI,oBAAoB,IAAI,UAAU,GAAG,SAAS;IASrD;;;OAGG;IACI,kBAAkB,IAAI,QAAQ,GAAG,SAAS;IASjD;;;;;;;;;;OAUG;IACI,UAAU,IAAI,MAAM;IAI3B;;;;;;;OAOG;IACI,CAAC,uBAAuB,CAAC,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;IAKnE;;;OAGG;IACH,SAAS,CAAC,uBAAuB,IAAI,oBAAoB;CAG1D;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,OAAO,CAAC;CAAG"}
\ No newline at end of file
"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiItem = exports.apiItem_onParentChanged = exports.ApiItemKind = void 0;
const node_core_library_1 = require("@rushstack/node-core-library");
const ApiParameterListMixin_1 = require("../mixins/ApiParameterListMixin");
const ApiItemContainerMixin_1 = require("../mixins/ApiItemContainerMixin");
/**
* The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of
* {@link ApiItem}.
*
* @public
*/
var ApiItemKind;
(function (ApiItemKind) {
ApiItemKind["CallSignature"] = "CallSignature";
ApiItemKind["Class"] = "Class";
ApiItemKind["Constructor"] = "Constructor";
ApiItemKind["ConstructSignature"] = "ConstructSignature";
ApiItemKind["EntryPoint"] = "EntryPoint";
ApiItemKind["Enum"] = "Enum";
ApiItemKind["EnumMember"] = "EnumMember";
ApiItemKind["Function"] = "Function";
ApiItemKind["IndexSignature"] = "IndexSignature";
ApiItemKind["Interface"] = "Interface";
ApiItemKind["Method"] = "Method";
ApiItemKind["MethodSignature"] = "MethodSignature";
ApiItemKind["Model"] = "Model";
ApiItemKind["Namespace"] = "Namespace";
ApiItemKind["Package"] = "Package";
ApiItemKind["Property"] = "Property";
ApiItemKind["PropertySignature"] = "PropertySignature";
ApiItemKind["TypeAlias"] = "TypeAlias";
ApiItemKind["Variable"] = "Variable";
ApiItemKind["None"] = "None";
})(ApiItemKind || (exports.ApiItemKind = ApiItemKind = {}));
// PRIVATE - Allows ApiItemContainerMixin to assign the parent.
//
exports.apiItem_onParentChanged = Symbol('ApiItem._onAddToContainer');
/**
* The abstract base class for all members of an `ApiModel` object.
*
* @remarks
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
* API declarations.
* @public
*/
class ApiItem {
constructor(options) {
// ("options" is not used here, but part of the inheritance pattern)
}
static deserialize(jsonObject, context) {
// The Deserializer class is coupled with a ton of other classes, so we delay loading it
// to avoid ES5 circular imports.
const deserializerModule = require('../model/Deserializer');
return deserializerModule.Deserializer.deserialize(context, jsonObject);
}
/** @virtual */
static onDeserializeInto(options, context, jsonObject) {
// (implemented by subclasses)
}
/** @virtual */
serializeInto(jsonObject) {
jsonObject.kind = this.kind;
jsonObject.canonicalReference = this.canonicalReference.toString();
}
/**
* Identifies the subclass of the `ApiItem` base class.
* @virtual
*/
get kind() {
throw new Error('ApiItem.kind was not implemented by the child class');
}
/**
* Warning: This API is used internally by API extractor but is not yet ready for general usage.
*
* @remarks
*
* Returns a `DeclarationReference` object using the experimental new declaration reference notation.
*
* @beta
*/
get canonicalReference() {
if (!this._canonicalReference) {
try {
this._canonicalReference = this.buildCanonicalReference();
}
catch (e) {
const name = this.getScopedNameWithinPackage() || this.displayName;
throw new node_core_library_1.InternalError(`Error building canonical reference for ${name}:\n` + e.message);
}
}
return this._canonicalReference;
}
/**
* Returns a string key that can be used to efficiently retrieve an `ApiItem` from an `ApiItemContainerMixin`.
* The key is unique within the container. Its format is undocumented and may change at any time.
*
* @remarks
* Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation
* of this function, according to the aspects that are important for identifying it.
*
* @virtual
*/
get containerKey() {
throw new node_core_library_1.InternalError('ApiItem.containerKey was not implemented by the child class');
}
/**
* Returns a name for this object that can be used in diagnostic messages, for example.
*
* @remarks
* For an object that inherits ApiNameMixin, this will return the declared name (e.g. the name of a TypeScript
* function). Otherwise, it will return a string such as "(call signature)" or "(model)".
*
* @virtual
*/
get displayName() {
switch (this.kind) {
case ApiItemKind.CallSignature:
return '(call)';
case ApiItemKind.Constructor:
return '(constructor)';
case ApiItemKind.ConstructSignature:
return '(new)';
case ApiItemKind.IndexSignature:
return '(indexer)';
case ApiItemKind.Model:
return '(model)';
}
return '(???)'; // All other types should inherit ApiNameMixin which will override this property
}
/**
* If this item was added to a ApiItemContainerMixin item, then this returns the container item.
* If this is an Parameter that was added to a method or function, then this returns the function item.
* Otherwise, it returns undefined.
* @virtual
*/
get parent() {
return this._parent;
}
/**
* This property supports a visitor pattern for walking the tree.
* For items with ApiItemContainerMixin, it returns the contained items, sorted alphabetically.
* Otherwise it returns an empty array.
* @virtual
*/
get members() {
return [];
}
/**
* If this item has a name (i.e. extends `ApiNameMixin`), then return all items that have the same parent
* and the same name. Otherwise, return all items that have the same parent and the same `ApiItemKind`.
*
* @remarks
* Examples: For a function, this would return all overloads for the function. For a constructor, this would
* return all overloads for the constructor. For a merged declaration (e.g. a `namespace` and `enum` with the
* same name), this would return both declarations. If this item does not have a parent, or if it is the only
* item of its name/kind, then the result is an array containing only this item.
*/
getMergedSiblings() {
const parent = this._parent;
if (parent && ApiItemContainerMixin_1.ApiItemContainerMixin.isBaseClassOf(parent)) {
return parent._getMergedSiblingsForMember(this);
}
return [];
}
/**
* Returns the chain of ancestors, starting from the root of the tree, and ending with the this item.
*/
getHierarchy() {
const hierarchy = [];
for (let current = this; current !== undefined; current = current.parent) {
hierarchy.push(current);
}
hierarchy.reverse();
return hierarchy;
}
/**
* This returns a scoped name such as `"Namespace1.Namespace2.MyClass.myMember()"`. It does not include the
* package name or entry point.
*
* @remarks
* If called on an ApiEntrypoint, ApiPackage, or ApiModel item, the result is an empty string.
*/
getScopedNameWithinPackage() {
const reversedParts = [];
for (let current = this; current !== undefined; current = current.parent) {
if (current.kind === ApiItemKind.Model ||
current.kind === ApiItemKind.Package ||
current.kind === ApiItemKind.EntryPoint) {
break;
}
if (reversedParts.length !== 0) {
reversedParts.push('.');
}
else {
switch (current.kind) {
case ApiItemKind.CallSignature:
case ApiItemKind.ConstructSignature:
case ApiItemKind.Constructor:
case ApiItemKind.IndexSignature:
// These functional forms don't have a proper name, so we don't append the "()" suffix
break;
default:
if (ApiParameterListMixin_1.ApiParameterListMixin.isBaseClassOf(current)) {
reversedParts.push('()');
}
}
}
reversedParts.push(current.displayName);
}
return reversedParts.reverse().join('');
}
/**
* If this item is an ApiPackage or has an ApiPackage as one of its parents, then that object is returned.
* Otherwise undefined is returned.
*/
getAssociatedPackage() {
for (let current = this; current !== undefined; current = current.parent) {
if (current.kind === ApiItemKind.Package) {
return current;
}
}
return undefined;
}
/**
* If this item is an ApiModel or has an ApiModel as one of its parents, then that object is returned.
* Otherwise undefined is returned.
*/
getAssociatedModel() {
for (let current = this; current !== undefined; current = current.parent) {
if (current.kind === ApiItemKind.Model) {
return current;
}
}
return undefined;
}
/**
* A text string whose value determines the sort order that is automatically applied by the
* {@link (ApiItemContainerMixin:interface)} class.
*
* @remarks
* The value of this string is undocumented and may change at any time.
* If {@link (ApiItemContainerMixin:interface).preserveMemberOrder} is enabled for the `ApiItem`'s parent,
* then no sorting is performed, and this key is not used.
*
* @virtual
*/
getSortKey() {
return this.containerKey;
}
/**
* PRIVATE
*
* @privateRemarks
* Allows ApiItemContainerMixin to assign the parent when the item is added to a container.
*
* @internal
*/
[exports.apiItem_onParentChanged](parent) {
this._parent = parent;
this._canonicalReference = undefined;
}
/**
* Builds the cached object used by the `canonicalReference` property.
* @virtual
*/
buildCanonicalReference() {
throw new node_core_library_1.InternalError('ApiItem.canonicalReference was not implemented by the child class');
}
}
exports.ApiItem = ApiItem;
//# sourceMappingURL=ApiItem.js.map
\ No newline at end of file
{"version":3,"file":"ApiItem.js","sourceRoot":"","sources":["../../src/items/ApiItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,oEAA6D;AAI7D,2EAAwE;AAExE,2EAAwE;AAGxE;;;;;GAKG;AACH,IAAY,WAqBX;AArBD,WAAY,WAAW;IACrB,8CAA+B,CAAA;IAC/B,8BAAe,CAAA;IACf,0CAA2B,CAAA;IAC3B,wDAAyC,CAAA;IACzC,wCAAyB,CAAA;IACzB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,kDAAmC,CAAA;IACnC,8BAAe,CAAA;IACf,sCAAuB,CAAA;IACvB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,sDAAuC,CAAA;IACvC,sCAAuB,CAAA;IACvB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;AACf,CAAC,EArBW,WAAW,2BAAX,WAAW,QAqBtB;AAaD,+DAA+D;AAC/D,EAAE;AACW,QAAA,uBAAuB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAE1F;;;;;;;GAOG;AACH,MAAa,OAAO;IAIlB,YAAmB,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,IAAI,OAAO,GAAwB,IAAI,EAAE,OAAO,KAAK,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAC9F,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,KAAK,EAAE,CAAC;gBACvC,OAAO,OAAmB,CAAC;YAC7B,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;;;;;OAUG;IACI,UAAU;QACf,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED;;;;;;;OAOG;IACI,CAAC,+BAAuB,CAAC,CAAC,MAA2B;QAC1D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;IACvC,CAAC;IAED;;;OAGG;IACO,uBAAuB;QAC/B,MAAM,IAAI,iCAAa,CAAC,mEAAmE,CAAC,CAAC;IAC/F,CAAC;CACF;AAzPD,0BAyPC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { InternalError } from '@rushstack/node-core-library';\n\nimport type { Constructor, PropertiesOf } from '../mixins/Mixin';\nimport type { ApiPackage } from '../model/ApiPackage';\nimport { ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\nimport type { DeserializerContext } from '../model/DeserializerContext';\nimport { ApiItemContainerMixin } from '../mixins/ApiItemContainerMixin';\nimport type { ApiModel } from '../model/ApiModel';\n\n/**\n * The type returned by the {@link ApiItem.kind} property, which can be used to easily distinguish subclasses of\n * {@link ApiItem}.\n *\n * @public\n */\nexport enum ApiItemKind {\n CallSignature = 'CallSignature',\n Class = 'Class',\n Constructor = 'Constructor',\n ConstructSignature = 'ConstructSignature',\n EntryPoint = 'EntryPoint',\n Enum = 'Enum',\n EnumMember = 'EnumMember',\n Function = 'Function',\n IndexSignature = 'IndexSignature',\n Interface = 'Interface',\n Method = 'Method',\n MethodSignature = 'MethodSignature',\n Model = 'Model',\n Namespace = 'Namespace',\n Package = 'Package',\n Property = 'Property',\n PropertySignature = 'PropertySignature',\n TypeAlias = 'TypeAlias',\n Variable = 'Variable',\n None = 'None'\n}\n\n/**\n * Constructor options for {@link ApiItem}.\n * @public\n */\nexport interface IApiItemOptions {}\n\nexport interface IApiItemJson {\n kind: ApiItemKind;\n canonicalReference: string;\n}\n\n// PRIVATE - Allows ApiItemContainerMixin to assign the parent.\n//\nexport const apiItem_onParentChanged: unique symbol = Symbol('ApiItem._onAddToContainer');\n\n/**\n * The abstract base class for all members of an `ApiModel` object.\n *\n * @remarks\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n * @public\n */\nexport class ApiItem {\n private _canonicalReference: DeclarationReference | undefined;\n private _parent: ApiItem | undefined;\n\n public constructor(options: IApiItemOptions) {\n // (\"options\" is not used here, but part of the inheritance pattern)\n }\n\n public static deserialize(jsonObject: IApiItemJson, context: DeserializerContext): ApiItem {\n // The Deserializer class is coupled with a ton of other classes, so we delay loading it\n // to avoid ES5 circular imports.\n const deserializerModule: typeof import('../model/Deserializer') = require('../model/Deserializer');\n return deserializerModule.Deserializer.deserialize(context, jsonObject);\n }\n\n /** @virtual */\n public static onDeserializeInto(\n options: Partial<IApiItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiItemJson\n ): void {\n // (implemented by subclasses)\n }\n\n /** @virtual */\n public serializeInto(jsonObject: Partial<IApiItemJson>): void {\n jsonObject.kind = this.kind;\n jsonObject.canonicalReference = this.canonicalReference.toString();\n }\n\n /**\n * Identifies the subclass of the `ApiItem` base class.\n * @virtual\n */\n public get kind(): ApiItemKind {\n throw new Error('ApiItem.kind was not implemented by the child class');\n }\n\n /**\n * Warning: This API is used internally by API extractor but is not yet ready for general usage.\n *\n * @remarks\n *\n * Returns a `DeclarationReference` object using the experimental new declaration reference notation.\n *\n * @beta\n */\n public get canonicalReference(): DeclarationReference {\n if (!this._canonicalReference) {\n try {\n this._canonicalReference = this.buildCanonicalReference();\n } catch (e) {\n const name: string = this.getScopedNameWithinPackage() || this.displayName;\n throw new InternalError(`Error building canonical reference for ${name}:\\n` + (e as Error).message);\n }\n }\n return this._canonicalReference;\n }\n\n /**\n * Returns a string key that can be used to efficiently retrieve an `ApiItem` from an `ApiItemContainerMixin`.\n * The key is unique within the container. Its format is undocumented and may change at any time.\n *\n * @remarks\n * Use the `getContainerKey()` static member to construct the key. Each subclass has a different implementation\n * of this function, according to the aspects that are important for identifying it.\n *\n * @virtual\n */\n public get containerKey(): string {\n throw new InternalError('ApiItem.containerKey was not implemented by the child class');\n }\n\n /**\n * Returns a name for this object that can be used in diagnostic messages, for example.\n *\n * @remarks\n * For an object that inherits ApiNameMixin, this will return the declared name (e.g. the name of a TypeScript\n * function). Otherwise, it will return a string such as \"(call signature)\" or \"(model)\".\n *\n * @virtual\n */\n public get displayName(): string {\n switch (this.kind) {\n case ApiItemKind.CallSignature:\n return '(call)';\n case ApiItemKind.Constructor:\n return '(constructor)';\n case ApiItemKind.ConstructSignature:\n return '(new)';\n case ApiItemKind.IndexSignature:\n return '(indexer)';\n case ApiItemKind.Model:\n return '(model)';\n }\n return '(???)'; // All other types should inherit ApiNameMixin which will override this property\n }\n\n /**\n * If this item was added to a ApiItemContainerMixin item, then this returns the container item.\n * If this is an Parameter that was added to a method or function, then this returns the function item.\n * Otherwise, it returns undefined.\n * @virtual\n */\n public get parent(): ApiItem | undefined {\n return this._parent;\n }\n\n /**\n * This property supports a visitor pattern for walking the tree.\n * For items with ApiItemContainerMixin, it returns the contained items, sorted alphabetically.\n * Otherwise it returns an empty array.\n * @virtual\n */\n public get members(): ReadonlyArray<ApiItem> {\n return [];\n }\n\n /**\n * If this item has a name (i.e. extends `ApiNameMixin`), then return all items that have the same parent\n * and the same name. Otherwise, return all items that have the same parent and the same `ApiItemKind`.\n *\n * @remarks\n * Examples: For a function, this would return all overloads for the function. For a constructor, this would\n * return all overloads for the constructor. For a merged declaration (e.g. a `namespace` and `enum` with the\n * same name), this would return both declarations. If this item does not have a parent, or if it is the only\n * item of its name/kind, then the result is an array containing only this item.\n */\n public getMergedSiblings(): ReadonlyArray<ApiItem> {\n const parent: ApiItem | undefined = this._parent;\n if (parent && ApiItemContainerMixin.isBaseClassOf(parent)) {\n return parent._getMergedSiblingsForMember(this);\n }\n return [];\n }\n\n /**\n * Returns the chain of ancestors, starting from the root of the tree, and ending with the this item.\n */\n public getHierarchy(): ReadonlyArray<ApiItem> {\n const hierarchy: ApiItem[] = [];\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n hierarchy.push(current);\n }\n hierarchy.reverse();\n return hierarchy;\n }\n\n /**\n * This returns a scoped name such as `\"Namespace1.Namespace2.MyClass.myMember()\"`. It does not include the\n * package name or entry point.\n *\n * @remarks\n * If called on an ApiEntrypoint, ApiPackage, or ApiModel item, the result is an empty string.\n */\n public getScopedNameWithinPackage(): string {\n const reversedParts: string[] = [];\n\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (\n current.kind === ApiItemKind.Model ||\n current.kind === ApiItemKind.Package ||\n current.kind === ApiItemKind.EntryPoint\n ) {\n break;\n }\n if (reversedParts.length !== 0) {\n reversedParts.push('.');\n } else {\n switch (current.kind) {\n case ApiItemKind.CallSignature:\n case ApiItemKind.ConstructSignature:\n case ApiItemKind.Constructor:\n case ApiItemKind.IndexSignature:\n // These functional forms don't have a proper name, so we don't append the \"()\" suffix\n break;\n default:\n if (ApiParameterListMixin.isBaseClassOf(current)) {\n reversedParts.push('()');\n }\n }\n }\n reversedParts.push(current.displayName);\n }\n\n return reversedParts.reverse().join('');\n }\n\n /**\n * If this item is an ApiPackage or has an ApiPackage as one of its parents, then that object is returned.\n * Otherwise undefined is returned.\n */\n public getAssociatedPackage(): ApiPackage | undefined {\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (current.kind === ApiItemKind.Package) {\n return current as ApiPackage;\n }\n }\n return undefined;\n }\n\n /**\n * If this item is an ApiModel or has an ApiModel as one of its parents, then that object is returned.\n * Otherwise undefined is returned.\n */\n public getAssociatedModel(): ApiModel | undefined {\n for (let current: ApiItem | undefined = this; current !== undefined; current = current.parent) {\n if (current.kind === ApiItemKind.Model) {\n return current as ApiModel;\n }\n }\n return undefined;\n }\n\n /**\n * A text string whose value determines the sort order that is automatically applied by the\n * {@link (ApiItemContainerMixin:interface)} class.\n *\n * @remarks\n * The value of this string is undocumented and may change at any time.\n * If {@link (ApiItemContainerMixin:interface).preserveMemberOrder} is enabled for the `ApiItem`'s parent,\n * then no sorting is performed, and this key is not used.\n *\n * @virtual\n */\n public getSortKey(): string {\n return this.containerKey;\n }\n\n /**\n * PRIVATE\n *\n * @privateRemarks\n * Allows ApiItemContainerMixin to assign the parent when the item is added to a container.\n *\n * @internal\n */\n public [apiItem_onParentChanged](parent: ApiItem | undefined): void {\n this._parent = parent;\n this._canonicalReference = undefined;\n }\n\n /**\n * Builds the cached object used by the `canonicalReference` property.\n * @virtual\n */\n protected buildCanonicalReference(): DeclarationReference {\n throw new InternalError('ApiItem.canonicalReference was not implemented by the child class');\n }\n}\n\n/**\n * This abstraction is used by the mixin pattern.\n * It describes a class type that inherits from {@link ApiItem}.\n *\n * @public\n */\nexport interface IApiItemConstructor extends Constructor<ApiItem>, PropertiesOf<typeof ApiItem> {}\n"]}
\ No newline at end of file
import type { Excerpt, IExcerptTokenRange } from '../mixins/Excerpt';
import { type IApiDeclaredItemOptions, ApiDeclaredItem, type IApiDeclaredItemJson } from './ApiDeclaredItem';
import { ApiReleaseTagMixin, type IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';
import { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';
import type { DeserializerContext } from '../model/DeserializerContext';
import { ApiOptionalMixin, type IApiOptionalMixinOptions } from '../mixins/ApiOptionalMixin';
import { ApiReadonlyMixin, type IApiReadonlyMixinOptions } from '../mixins/ApiReadonlyMixin';
/**
* Constructor options for {@link ApiPropertyItem}.
* @public
*/
export interface IApiPropertyItemOptions extends IApiNameMixinOptions, IApiReleaseTagMixinOptions, IApiOptionalMixinOptions, IApiReadonlyMixinOptions, IApiDeclaredItemOptions {
propertyTypeTokenRange: IExcerptTokenRange;
}
export interface IApiPropertyItemJson extends IApiDeclaredItemJson {
propertyTypeTokenRange: IExcerptTokenRange;
}
declare const ApiPropertyItem_base: typeof ApiDeclaredItem & (new (...args: any[]) => ApiReadonlyMixin) & (new (...args: any[]) => ApiOptionalMixin) & (new (...args: any[]) => ApiReleaseTagMixin) & (new (...args: any[]) => ApiNameMixin);
/**
* The abstract base class for {@link ApiProperty} and {@link ApiPropertySignature}.
*
* @public
*/
export declare class ApiPropertyItem extends ApiPropertyItem_base {
/**
* An {@link Excerpt} that describes the type of the property.
*/
readonly propertyTypeExcerpt: Excerpt;
constructor(options: IApiPropertyItemOptions);
/** @override */
static onDeserializeInto(options: Partial<IApiPropertyItemOptions>, context: DeserializerContext, jsonObject: IApiPropertyItemJson): void;
/**
* Returns true if this property should be documented as an event.
*
* @remarks
* The `@eventProperty` TSDoc modifier can be added to readonly properties to indicate that they return an
* event object that event handlers can be attached to. The event-handling API is implementation-defined, but
* typically the return type would be a class with members such as `addHandler()` and `removeHandler()`.
* The documentation should display such properties under an "Events" heading instead of the
* usual "Properties" heading.
*/
get isEventProperty(): boolean;
/** @override */
serializeInto(jsonObject: Partial<IApiPropertyItemJson>): void;
}
export {};
//# sourceMappingURL=ApiPropertyItem.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiPropertyItem.d.ts","sourceRoot":"","sources":["../../src/items/ApiPropertyItem.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,KAAK,uBAAuB,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC7G,OAAO,EAAE,kBAAkB,EAAE,KAAK,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAE,KAAK,oBAAoB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,KAAK,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAE,KAAK,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE7F;;;GAGG;AACH,MAAM,WAAW,uBACf,SAAQ,oBAAoB,EAC1B,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB;IACzB,sBAAsB,EAAE,kBAAkB,CAAC;CAC5C;AAED,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,sBAAsB,EAAE,kBAAkB,CAAC;CAC5C;;AAED;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,oBAEpC;IACC;;OAEG;IACH,SAAgB,mBAAmB,EAAE,OAAO,CAAC;gBAE1B,OAAO,EAAE,uBAAuB;IAMnD,gBAAgB;WACF,iBAAiB,CAC7B,OAAO,EAAE,OAAO,CAAC,uBAAuB,CAAC,EACzC,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,oBAAoB,GAC/B,IAAI;IAMP;;;;;;;;;OASG;IACH,IAAW,eAAe,IAAI,OAAO,CAKpC;IAED,gBAAgB;IACT,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,IAAI;CAKtE"}
\ No newline at end of file
"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiPropertyItem = void 0;
const ApiDeclaredItem_1 = require("./ApiDeclaredItem");
const ApiReleaseTagMixin_1 = require("../mixins/ApiReleaseTagMixin");
const ApiNameMixin_1 = require("../mixins/ApiNameMixin");
const ApiOptionalMixin_1 = require("../mixins/ApiOptionalMixin");
const ApiReadonlyMixin_1 = require("../mixins/ApiReadonlyMixin");
/**
* The abstract base class for {@link ApiProperty} and {@link ApiPropertySignature}.
*
* @public
*/
class ApiPropertyItem extends (0, ApiNameMixin_1.ApiNameMixin)((0, ApiReleaseTagMixin_1.ApiReleaseTagMixin)((0, ApiOptionalMixin_1.ApiOptionalMixin)((0, ApiReadonlyMixin_1.ApiReadonlyMixin)(ApiDeclaredItem_1.ApiDeclaredItem)))) {
constructor(options) {
super(options);
this.propertyTypeExcerpt = this.buildExcerpt(options.propertyTypeTokenRange);
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
super.onDeserializeInto(options, context, jsonObject);
options.propertyTypeTokenRange = jsonObject.propertyTypeTokenRange;
}
/**
* Returns true if this property should be documented as an event.
*
* @remarks
* The `@eventProperty` TSDoc modifier can be added to readonly properties to indicate that they return an
* event object that event handlers can be attached to. The event-handling API is implementation-defined, but
* typically the return type would be a class with members such as `addHandler()` and `removeHandler()`.
* The documentation should display such properties under an "Events" heading instead of the
* usual "Properties" heading.
*/
get isEventProperty() {
if (this.tsdocComment) {
return this.tsdocComment.modifierTagSet.isEventProperty();
}
return false;
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
jsonObject.propertyTypeTokenRange = this.propertyTypeExcerpt.tokenRange;
}
}
exports.ApiPropertyItem = ApiPropertyItem;
//# sourceMappingURL=ApiPropertyItem.js.map
\ No newline at end of file
{"version":3,"file":"ApiPropertyItem.js","sourceRoot":"","sources":["../../src/items/ApiPropertyItem.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAG3D,uDAA6G;AAC7G,qEAAmG;AACnG,yDAAiF;AAEjF,iEAA6F;AAC7F,iEAA6F;AAmB7F;;;;GAIG;AACH,MAAa,eAAgB,SAAQ,IAAA,2BAAY,EAC/C,IAAA,uCAAkB,EAAC,IAAA,mCAAgB,EAAC,IAAA,mCAAgB,EAAC,iCAAe,CAAC,CAAC,CAAC,CACxE;IAMC,YAAmB,OAAgC;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC/E,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAAyC,EACzC,OAA4B,EAC5B,UAAgC;QAEhC,KAAK,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEtD,OAAO,CAAC,sBAAsB,GAAG,UAAU,CAAC,sBAAsB,CAAC;IACrE,CAAC;IAED;;;;;;;;;OASG;IACH,IAAW,eAAe;QACxB,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,EAAE,CAAC;QAC5D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gBAAgB;IACT,aAAa,CAAC,UAAyC;QAC5D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAEhC,UAAU,CAAC,sBAAsB,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,CAAC;IAC1E,CAAC;CACF;AAhDD,0CAgDC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { Excerpt, IExcerptTokenRange } from '../mixins/Excerpt';\nimport { type IApiDeclaredItemOptions, ApiDeclaredItem, type IApiDeclaredItemJson } from './ApiDeclaredItem';\nimport { ApiReleaseTagMixin, type IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport type { DeserializerContext } from '../model/DeserializerContext';\nimport { ApiOptionalMixin, type IApiOptionalMixinOptions } from '../mixins/ApiOptionalMixin';\nimport { ApiReadonlyMixin, type IApiReadonlyMixinOptions } from '../mixins/ApiReadonlyMixin';\n\n/**\n * Constructor options for {@link ApiPropertyItem}.\n * @public\n */\nexport interface IApiPropertyItemOptions\n extends IApiNameMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiOptionalMixinOptions,\n IApiReadonlyMixinOptions,\n IApiDeclaredItemOptions {\n propertyTypeTokenRange: IExcerptTokenRange;\n}\n\nexport interface IApiPropertyItemJson extends IApiDeclaredItemJson {\n propertyTypeTokenRange: IExcerptTokenRange;\n}\n\n/**\n * The abstract base class for {@link ApiProperty} and {@link ApiPropertySignature}.\n *\n * @public\n */\nexport class ApiPropertyItem extends ApiNameMixin(\n ApiReleaseTagMixin(ApiOptionalMixin(ApiReadonlyMixin(ApiDeclaredItem)))\n) {\n /**\n * An {@link Excerpt} that describes the type of the property.\n */\n public readonly propertyTypeExcerpt: Excerpt;\n\n public constructor(options: IApiPropertyItemOptions) {\n super(options);\n\n this.propertyTypeExcerpt = this.buildExcerpt(options.propertyTypeTokenRange);\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiPropertyItemOptions>,\n context: DeserializerContext,\n jsonObject: IApiPropertyItemJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.propertyTypeTokenRange = jsonObject.propertyTypeTokenRange;\n }\n\n /**\n * Returns true if this property should be documented as an event.\n *\n * @remarks\n * The `@eventProperty` TSDoc modifier can be added to readonly properties to indicate that they return an\n * event object that event handlers can be attached to. The event-handling API is implementation-defined, but\n * typically the return type would be a class with members such as `addHandler()` and `removeHandler()`.\n * The documentation should display such properties under an \"Events\" heading instead of the\n * usual \"Properties\" heading.\n */\n public get isEventProperty(): boolean {\n if (this.tsdocComment) {\n return this.tsdocComment.modifierTagSet.isEventProperty();\n }\n return false;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiPropertyItemJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.propertyTypeTokenRange = this.propertyTypeExcerpt.tokenRange;\n }\n}\n"]}
\ No newline at end of file
import type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
/**
* Constructor options for {@link (ApiAbstractMixin:interface)}.
* @public
*/
export interface IApiAbstractMixinOptions extends IApiItemOptions {
isAbstract: boolean;
}
export interface IApiAbstractMixinJson extends IApiItemJson {
isAbstract: boolean;
}
/**
* The mixin base class for API items that have an abstract modifier.
*
* @remarks
*
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
* API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use
* TypeScript "mixin" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various
* features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class
* to extend more than one base class). The "mixin" is a TypeScript merged declaration with three components:
* the function that generates a subclass, an interface that describes the members of the subclass, and
* a namespace containing static members of the class.
*
* @public
*/
export interface ApiAbstractMixin extends ApiItem {
/**
* Indicates that the API item's value has an 'abstract' modifier.
*/
readonly isAbstract: boolean;
serializeInto(jsonObject: Partial<IApiItemJson>): void;
}
/**
* Mixin function for {@link (ApiAbstractMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiAbstractMixin:interface)}
* functionality.
*
* @public
*/
export declare function ApiAbstractMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiAbstractMixin);
/**
* Static members for {@link (ApiAbstractMixin:interface)}.
* @public
*/
export declare namespace ApiAbstractMixin {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiAbstractMixin` mixin.
*
* @remarks
*
* The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
* the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
* the TypeScript type system cannot invoke a runtime test.)
*/
function isBaseClassOf(apiItem: ApiItem): apiItem is ApiAbstractMixin;
}
//# sourceMappingURL=ApiAbstractMixin.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiAbstractMixin.d.ts","sourceRoot":"","sources":["../../src/mixins/ApiAbstractMixin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGpG;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,eAAe;IAC/D,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD,UAAU,EAAE,OAAO,CAAC;CACrB;AAID;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC/C;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,SAAS,mBAAmB,EACrE,SAAS,EAAE,UAAU,GAEpB,UAAU,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,gBAAgB,CAAC,CAoCzD;AAED;;;GAGG;AACH,yBAAiB,gBAAgB,CAAC;IAChC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB,CAE3E;CACF"}
\ No newline at end of file
"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiAbstractMixin = ApiAbstractMixin;
const _isAbstract = Symbol('ApiAbstractMixin._isAbstract');
/**
* Mixin function for {@link (ApiAbstractMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiAbstractMixin:interface)}
* functionality.
*
* @public
*/
function ApiAbstractMixin(baseClass
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) {
class MixedClass extends baseClass {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(...args) {
super(...args);
const options = args[0];
this[_isAbstract] = options.isAbstract;
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
baseClass.onDeserializeInto(options, context, jsonObject);
options.isAbstract = jsonObject.isAbstract || false;
}
get isAbstract() {
return this[_isAbstract];
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
jsonObject.isAbstract = this.isAbstract;
}
}
return MixedClass;
}
/**
* Static members for {@link (ApiAbstractMixin:interface)}.
* @public
*/
(function (ApiAbstractMixin) {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiAbstractMixin` mixin.
*
* @remarks
*
* The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
* the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
* the TypeScript type system cannot invoke a runtime test.)
*/
function isBaseClassOf(apiItem) {
return apiItem.hasOwnProperty(_isAbstract);
}
ApiAbstractMixin.isBaseClassOf = isBaseClassOf;
})(ApiAbstractMixin || (exports.ApiAbstractMixin = ApiAbstractMixin = {}));
//# sourceMappingURL=ApiAbstractMixin.js.map
\ No newline at end of file
{"version":3,"file":"ApiAbstractMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiAbstractMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAuD3D,4CAuCC;AA3ED,MAAM,WAAW,GAAkB,MAAM,CAAC,8BAA8B,CAAC,CAAC;AA2B1E;;;;;;;;GAQG;AACH,SAAgB,gBAAgB,CAC9B,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAGhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAA6B,IAAI,CAAC,CAAC,CAAC,CAAC;YAClD,IAAI,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;QACzC,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA0C,EAC1C,OAA4B,EAC5B,UAAiC;YAEjC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,KAAK,CAAC;QACtD,CAAC;QAED,IAAW,UAAU;YACnB,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA0C;YAC7D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAC1C,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAFe,8BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,gBAAgB,gCAAhB,gBAAgB,QAahC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (ApiAbstractMixin:interface)}.\n * @public\n */\nexport interface IApiAbstractMixinOptions extends IApiItemOptions {\n isAbstract: boolean;\n}\n\nexport interface IApiAbstractMixinJson extends IApiItemJson {\n isAbstract: boolean;\n}\n\nconst _isAbstract: unique symbol = Symbol('ApiAbstractMixin._isAbstract');\n\n/**\n * The mixin base class for API items that have an abstract modifier.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use\n * TypeScript \"mixin\" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various\n * features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class\n * to extend more than one base class). The \"mixin\" is a TypeScript merged declaration with three components:\n * the function that generates a subclass, an interface that describes the members of the subclass, and\n * a namespace containing static members of the class.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface ApiAbstractMixin extends ApiItem {\n /**\n * Indicates that the API item's value has an 'abstract' modifier.\n */\n readonly isAbstract: boolean;\n\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiAbstractMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiAbstractMixin:interface)}\n * functionality.\n *\n * @public\n */\nexport function ApiAbstractMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiAbstractMixin) {\n class MixedClass extends baseClass implements ApiAbstractMixin {\n public [_isAbstract]: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiAbstractMixinOptions = args[0];\n this[_isAbstract] = options.isAbstract;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiAbstractMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiAbstractMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.isAbstract = jsonObject.isAbstract || false;\n }\n\n public get isAbstract(): boolean {\n return this[_isAbstract];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiAbstractMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.isAbstract = this.isAbstract;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiAbstractMixin:interface)}.\n * @public\n */\nexport namespace ApiAbstractMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiAbstractMixin` mixin.\n *\n * @remarks\n *\n * The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of\n * the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however\n * the TypeScript type system cannot invoke a runtime test.)\n */\n export function isBaseClassOf(apiItem: ApiItem): apiItem is ApiAbstractMixin {\n return apiItem.hasOwnProperty(_isAbstract);\n }\n}\n"]}
\ No newline at end of file
import type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
/**
* Constructor options for {@link (IApiExportedMixinOptions:interface)}.
* @public
*/
export interface IApiExportedMixinOptions extends IApiItemOptions {
isExported: boolean;
}
export interface IApiExportedMixinJson extends IApiItemJson {
isExported: boolean;
}
/**
* The mixin base class for API items that can be exported.
*
* @remarks
*
* This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
* API declarations. The non-abstract classes (e.g. `ApiClass`, `ApiEnum`, `ApiInterface`, etc.) use
* TypeScript "mixin" functions (e.g. `ApiDeclaredItem`, `ApiItemContainerMixin`, etc.) to add various
* features that cannot be represented as a normal inheritance chain (since TypeScript does not allow a child class
* to extend more than one base class). The "mixin" is a TypeScript merged declaration with three components:
* the function that generates a subclass, an interface that describes the members of the subclass, and
* a namespace containing static members of the class.
*
* @public
*/
export interface ApiExportedMixin extends ApiItem {
/**
* Whether the declaration is exported from its parent item container (i.e. either an `ApiEntryPoint` or an
* `ApiNamespace`).
*
* @remarks
* Suppose `index.ts` is your entry point:
*
* ```ts
* // index.ts
*
* export class A {}
* class B {}
*
* namespace n {
* export class C {}
* class D {}
* }
*
* // file.ts
* export class E {}
* ```
*
* Classes `A` and `C` are both exported, while classes `B`, `D`, and `E` are not. `E` is exported from its
* local file, but not from its parent item container (i.e. the entry point).
*
*/
readonly isExported: boolean;
/** @override */
serializeInto(jsonObject: Partial<IApiItemJson>): void;
}
/**
* Mixin function for {@link (ApiExportedMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiExportedMixin:interface)} functionality.
*
* @public
*/
export declare function ApiExportedMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiExportedMixin);
/**
* Static members for {@link (ApiExportedMixin:interface)}.
* @public
*/
export declare namespace ApiExportedMixin {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiExportedMixin` mixin.
*
* @remarks
*
* The JavaScript `instanceof` operator cannot be used to test for mixin inheritance, because each invocation of
* the mixin function produces a different subclass. (This could be mitigated by `Symbol.hasInstance`, however
* the TypeScript type system cannot invoke a runtime test.)
*/
function isBaseClassOf(apiItem: ApiItem): apiItem is ApiExportedMixin;
}
//# sourceMappingURL=ApiExportedMixin.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiExportedMixin.d.ts","sourceRoot":"","sources":["../../src/mixins/ApiExportedMixin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGpG;;;GAGG;AACH,MAAM,WAAW,wBAAyB,SAAQ,eAAe;IAC/D,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD,UAAU,EAAE,OAAO,CAAC;CACrB;AAID;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC/C;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAE7B,gBAAgB;IAChB,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,SAAS,mBAAmB,EACrE,SAAS,EAAE,UAAU,GAEpB,UAAU,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,gBAAgB,CAAC,CAyCzD;AAED;;;GAGG;AACH,yBAAiB,gBAAgB,CAAC;IAChC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB,CAE3E;CACF"}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment