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.ApiParameterListMixin = ApiParameterListMixin;
/* eslint-disable @typescript-eslint/no-redeclare */
const node_core_library_1 = require("@rushstack/node-core-library");
const Parameter_1 = require("../model/Parameter");
const ApiDeclaredItem_1 = require("../items/ApiDeclaredItem");
const _overloadIndex = Symbol('ApiParameterListMixin._overloadIndex');
const _parameters = Symbol('ApiParameterListMixin._parameters');
/**
* Mixin function for {@link (ApiParameterListMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiParameterListMixin:interface)} functionality.
*
* @public
*/
function ApiParameterListMixin(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[_overloadIndex] = options.overloadIndex;
this[_parameters] = [];
if (this instanceof ApiDeclaredItem_1.ApiDeclaredItem) {
if (options.parameters) {
for (const parameterOptions of options.parameters) {
const parameter = new Parameter_1.Parameter({
name: parameterOptions.parameterName,
parameterTypeExcerpt: this.buildExcerpt(parameterOptions.parameterTypeTokenRange),
// Prior to ApiJsonSchemaVersion.V_1005 this input will be undefined
isOptional: !!parameterOptions.isOptional,
parent: this
});
this[_parameters].push(parameter);
}
}
}
else {
throw new node_core_library_1.InternalError('ApiReturnTypeMixin expects a base class that inherits from ApiDeclaredItem');
}
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
baseClass.onDeserializeInto(options, context, jsonObject);
options.overloadIndex = jsonObject.overloadIndex;
options.parameters = jsonObject.parameters || [];
}
get overloadIndex() {
return this[_overloadIndex];
}
get parameters() {
return this[_parameters];
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
jsonObject.overloadIndex = this.overloadIndex;
const parameterObjects = [];
for (const parameter of this.parameters) {
parameterObjects.push({
parameterName: parameter.name,
parameterTypeTokenRange: parameter.parameterTypeExcerpt.tokenRange,
isOptional: parameter.isOptional
});
}
jsonObject.parameters = parameterObjects;
}
}
return MixedClass;
}
/**
* Static members for {@link (ApiParameterListMixin:interface)}.
* @public
*/
(function (ApiParameterListMixin) {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiParameterListMixin` 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(_parameters);
}
ApiParameterListMixin.isBaseClassOf = isBaseClassOf;
})(ApiParameterListMixin || (exports.ApiParameterListMixin = ApiParameterListMixin = {}));
//# sourceMappingURL=ApiParameterListMixin.js.map
\ No newline at end of file
{"version":3,"file":"ApiParameterListMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiParameterListMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAqG3D,sDA4EC;AA/KD,oDAAoD;AAEpD,oEAA6D;AAG7D,kDAA+C;AAC/C,8DAA2D;AA4B3D,MAAM,cAAc,GAAkB,MAAM,CAAC,sCAAsC,CAAC,CAAC;AACrF,MAAM,WAAW,GAAkB,MAAM,CAAC,mCAAmC,CAAC,CAAC;AAwD/E;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,SAAqB;AACrB,8DAA8D;;IAE9D,MAAM,UAAW,SAAQ,SAAS;QAIhC,8DAA8D;QAC9D,YAAmB,GAAG,IAAW;YAC/B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAEf,MAAM,OAAO,GAAkC,IAAI,CAAC,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;YAE7C,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;YAEvB,IAAI,IAAI,YAAY,iCAAe,EAAE,CAAC;gBACpC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;oBACvB,KAAK,MAAM,gBAAgB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;wBAClD,MAAM,SAAS,GAAc,IAAI,qBAAS,CAAC;4BACzC,IAAI,EAAE,gBAAgB,CAAC,aAAa;4BACpC,oBAAoB,EAAE,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,uBAAuB,CAAC;4BACjF,oEAAoE;4BACpE,UAAU,EAAE,CAAC,CAAC,gBAAgB,CAAC,UAAU;4BACzC,MAAM,EAAE,IAAI;yBACb,CAAC,CAAC;wBAEH,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBACpC,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,iCAAa,CAAC,4EAA4E,CAAC,CAAC;YACxG,CAAC;QACH,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA+C,EAC/C,OAA4B,EAC5B,UAAiC;YAEjC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;YACjD,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,EAAE,CAAC;QACnD,CAAC;QAED,IAAW,aAAa;YACtB,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9B,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,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;YAE9C,MAAM,gBAAgB,GAA2B,EAAE,CAAC;YACpD,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACxC,gBAAgB,CAAC,IAAI,CAAC;oBACpB,aAAa,EAAE,SAAS,CAAC,IAAI;oBAC7B,uBAAuB,EAAE,SAAS,CAAC,oBAAoB,CAAC,UAAU;oBAClE,UAAU,EAAE,SAAS,CAAC,UAAU;iBACjC,CAAC,CAAC;YACL,CAAC;YAED,UAAU,CAAC,UAAU,GAAG,gBAAgB,CAAC;QAC3C,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,qBAAqB;IACpC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAFe,mCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,qBAAqB,qCAArB,qBAAqB,QAarC","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 { InternalError } from '@rushstack/node-core-library';\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport { Parameter } from '../model/Parameter';\nimport { ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport type { IExcerptTokenRange } from './Excerpt';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Represents parameter information that is part of {@link IApiParameterListMixinOptions}\n * @public\n */\nexport interface IApiParameterOptions {\n parameterName: string;\n parameterTypeTokenRange: IExcerptTokenRange;\n isOptional: boolean;\n}\n\n/**\n * Constructor options for {@link (ApiParameterListMixin:interface)}.\n * @public\n */\nexport interface IApiParameterListMixinOptions extends IApiItemOptions {\n overloadIndex: number;\n parameters: IApiParameterOptions[];\n}\n\nexport interface IApiParameterListJson extends IApiItemJson {\n overloadIndex: number;\n parameters: IApiParameterOptions[];\n}\n\nconst _overloadIndex: unique symbol = Symbol('ApiParameterListMixin._overloadIndex');\nconst _parameters: unique symbol = Symbol('ApiParameterListMixin._parameters');\n\n/**\n * The mixin base class for API items that can have function parameters (but not necessarily a return value).\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 ApiParameterListMixin extends ApiItem {\n /**\n * When a function has multiple overloaded declarations, this one-based integer index can be used to uniquely\n * identify them.\n *\n * @remarks\n *\n * Consider this overloaded declaration:\n *\n * ```ts\n * export namespace Versioning {\n * // TSDoc: Versioning.(addVersions:1)\n * export function addVersions(x: number, y: number): number;\n *\n * // TSDoc: Versioning.(addVersions:2)\n * export function addVersions(x: string, y: string): string;\n *\n * // (implementation)\n * export function addVersions(x: number|string, y: number|string): number|string {\n * // . . .\n * }\n * }\n * ```\n *\n * In the above example, there are two overloaded declarations. The overload using numbers will have\n * `overloadIndex = 1`. The overload using strings will have `overloadIndex = 2`. The third declaration that\n * accepts all possible inputs is considered part of the implementation, and is not processed by API Extractor.\n */\n readonly overloadIndex: number;\n\n /**\n * The function parameters.\n */\n readonly parameters: ReadonlyArray<Parameter>;\n\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiParameterListMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiParameterListMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiParameterListMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiParameterListMixin) {\n class MixedClass extends baseClass implements ApiParameterListMixin {\n public readonly [_overloadIndex]: number;\n public readonly [_parameters]: Parameter[];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiParameterListMixinOptions = args[0];\n this[_overloadIndex] = options.overloadIndex;\n\n this[_parameters] = [];\n\n if (this instanceof ApiDeclaredItem) {\n if (options.parameters) {\n for (const parameterOptions of options.parameters) {\n const parameter: Parameter = new Parameter({\n name: parameterOptions.parameterName,\n parameterTypeExcerpt: this.buildExcerpt(parameterOptions.parameterTypeTokenRange),\n // Prior to ApiJsonSchemaVersion.V_1005 this input will be undefined\n isOptional: !!parameterOptions.isOptional,\n parent: this\n });\n\n this[_parameters].push(parameter);\n }\n }\n } else {\n throw new InternalError('ApiReturnTypeMixin expects a base class that inherits from ApiDeclaredItem');\n }\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiParameterListMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiParameterListJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.overloadIndex = jsonObject.overloadIndex;\n options.parameters = jsonObject.parameters || [];\n }\n\n public get overloadIndex(): number {\n return this[_overloadIndex];\n }\n\n public get parameters(): ReadonlyArray<Parameter> {\n return this[_parameters];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiParameterListJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.overloadIndex = this.overloadIndex;\n\n const parameterObjects: IApiParameterOptions[] = [];\n for (const parameter of this.parameters) {\n parameterObjects.push({\n parameterName: parameter.name,\n parameterTypeTokenRange: parameter.parameterTypeExcerpt.tokenRange,\n isOptional: parameter.isOptional\n });\n }\n\n jsonObject.parameters = parameterObjects;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiParameterListMixin:interface)}.\n * @public\n */\nexport namespace ApiParameterListMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiParameterListMixin` 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 ApiParameterListMixin {\n return apiItem.hasOwnProperty(_parameters);\n }\n}\n"]}
\ No newline at end of file
import type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
/**
* Constructor options for {@link (IApiProtectedMixinOptions:interface)}.
* @public
*/
export interface IApiProtectedMixinOptions extends IApiItemOptions {
isProtected: boolean;
}
export interface IApiProtectedMixinJson extends IApiItemJson {
isProtected: boolean;
}
/**
* The mixin base class for API items that can have the TypeScript `protected` keyword applied to them.
*
* @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 ApiProtectedMixin extends ApiItem {
/**
* Whether the declaration has the TypeScript `protected` keyword.
*/
readonly isProtected: boolean;
/** @override */
serializeInto(jsonObject: Partial<IApiItemJson>): void;
}
/**
* Mixin function for {@link (ApiProtectedMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiProtectedMixin:interface)} functionality.
*
* @public
*/
export declare function ApiProtectedMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiProtectedMixin);
/**
* Static members for {@link (ApiProtectedMixin:interface)}.
* @public
*/
export declare namespace ApiProtectedMixin {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiProtectedMixin` 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 ApiProtectedMixin;
}
//# sourceMappingURL=ApiProtectedMixin.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiProtectedMixin.d.ts","sourceRoot":"","sources":["../../src/mixins/ApiProtectedMixin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGpG;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,eAAe;IAChE,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IAC1D,WAAW,EAAE,OAAO,CAAC;CACtB;AAID;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,iBAAkB,SAAQ,OAAO;IAChD;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAE9B,gBAAgB;IAChB,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,SAAS,mBAAmB,EACtE,SAAS,EAAE,UAAU,GAEpB,UAAU,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,iBAAiB,CAAC,CAoC1D;AAED;;;GAGG;AACH,yBAAiB,iBAAiB,CAAC;IACjC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,iBAAiB,CAE5E;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.ApiProtectedMixin = ApiProtectedMixin;
const _isProtected = Symbol('ApiProtectedMixin._isProtected');
/**
* Mixin function for {@link (ApiProtectedMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiProtectedMixin:interface)} functionality.
*
* @public
*/
function ApiProtectedMixin(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[_isProtected] = options.isProtected;
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
baseClass.onDeserializeInto(options, context, jsonObject);
options.isProtected = jsonObject.isProtected;
}
get isProtected() {
return this[_isProtected];
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
jsonObject.isProtected = this.isProtected;
}
}
return MixedClass;
}
/**
* Static members for {@link (ApiProtectedMixin:interface)}.
* @public
*/
(function (ApiProtectedMixin) {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiProtectedMixin` 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(_isProtected);
}
ApiProtectedMixin.isBaseClassOf = isBaseClassOf;
})(ApiProtectedMixin || (exports.ApiProtectedMixin = ApiProtectedMixin = {}));
//# sourceMappingURL=ApiProtectedMixin.js.map
\ No newline at end of file
{"version":3,"file":"ApiProtectedMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiProtectedMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAuD3D,8CAuCC;AA3ED,MAAM,YAAY,GAAkB,MAAM,CAAC,gCAAgC,CAAC,CAAC;AA4B7E;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC/B,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,GAA8B,IAAI,CAAC,CAAC,CAAC,CAAC;YACnD,IAAI,CAAC,YAAY,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;QAC3C,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA2C,EAC3C,OAA4B,EAC5B,UAAkC;YAElC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC/C,CAAC;QAED,IAAW,WAAW;YACpB,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA2C;YAC9D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,iBAAiB;IAChC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAC9C,CAAC;IAFe,+BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,iBAAiB,iCAAjB,iBAAiB,QAajC","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 (IApiProtectedMixinOptions:interface)}.\n * @public\n */\nexport interface IApiProtectedMixinOptions extends IApiItemOptions {\n isProtected: boolean;\n}\n\nexport interface IApiProtectedMixinJson extends IApiItemJson {\n isProtected: boolean;\n}\n\nconst _isProtected: unique symbol = Symbol('ApiProtectedMixin._isProtected');\n\n/**\n * The mixin base class for API items that can have the TypeScript `protected` keyword applied to them.\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 ApiProtectedMixin extends ApiItem {\n /**\n * Whether the declaration has the TypeScript `protected` keyword.\n */\n readonly isProtected: boolean;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiProtectedMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiProtectedMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiProtectedMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiProtectedMixin) {\n class MixedClass extends baseClass implements ApiProtectedMixin {\n public [_isProtected]: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiProtectedMixinOptions = args[0];\n this[_isProtected] = options.isProtected;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiProtectedMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiProtectedMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.isProtected = jsonObject.isProtected;\n }\n\n public get isProtected(): boolean {\n return this[_isProtected];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiProtectedMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.isProtected = this.isProtected;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiProtectedMixin:interface)}.\n * @public\n */\nexport namespace ApiProtectedMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiProtectedMixin` 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 ApiProtectedMixin {\n return apiItem.hasOwnProperty(_isProtected);\n }\n}\n"]}
\ No newline at end of file
import type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
/**
* Constructor options for {@link (ApiReadonlyMixin:interface)}.
* @public
*/
export interface IApiReadonlyMixinOptions extends IApiItemOptions {
isReadonly: boolean;
}
export interface IApiReadonlyMixinJson extends IApiItemJson {
isReadonly: boolean;
}
/**
* The mixin base class for API items that cannot be modified after instantiation.
* Examples such as the readonly modifier and only having a getter but no setter.
*
* @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 ApiReadonlyMixin extends ApiItem {
/**
* Indicates that the API item's value cannot be assigned by an external consumer.
*
* @remarks
* Examples of API items that would be considered "read only" by API Extractor:
*
* - A class or interface's property that has the `readonly` modifier.
*
* - A variable that has the `const` modifier.
*
* - A property or variable whose TSDoc comment includes the `@readonly` tag.
*
* - A property declaration with a getter but no setter.
*
* Note that if the `readonly` keyword appears in a type annotation, this does not
* guarantee that that the API item will be considered readonly. For example:
*
* ```ts
* declare class C {
* // isReadonly=false in this case, because C.x is assignable
* public x: readonly string[];
* }
* ```
*/
readonly isReadonly: boolean;
serializeInto(jsonObject: Partial<IApiItemJson>): void;
}
/**
* Mixin function for {@link (ApiReadonlyMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiReadonlyMixin:interface)}
* functionality.
*
* @public
*/
export declare function ApiReadonlyMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiReadonlyMixin);
/**
* Static members for {@link (ApiReadonlyMixin:interface)}.
* @public
*/
export declare namespace ApiReadonlyMixin {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReadonlyMixin` 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 ApiReadonlyMixin;
}
//# sourceMappingURL=ApiReadonlyMixin.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiReadonlyMixin.d.ts","sourceRoot":"","sources":["../../src/mixins/ApiReadonlyMixin.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;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC/C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;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.ApiReadonlyMixin = ApiReadonlyMixin;
const _isReadonly = Symbol('ApiReadonlyMixin._isReadonly');
/**
* Mixin function for {@link (ApiReadonlyMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiReadonlyMixin:interface)}
* functionality.
*
* @public
*/
function ApiReadonlyMixin(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[_isReadonly] = options.isReadonly;
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
baseClass.onDeserializeInto(options, context, jsonObject);
options.isReadonly = jsonObject.isReadonly || false;
}
get isReadonly() {
return this[_isReadonly];
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
jsonObject.isReadonly = this.isReadonly;
}
}
return MixedClass;
}
/**
* Static members for {@link (ApiReadonlyMixin:interface)}.
* @public
*/
(function (ApiReadonlyMixin) {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReadonlyMixin` 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(_isReadonly);
}
ApiReadonlyMixin.isBaseClassOf = isBaseClassOf;
})(ApiReadonlyMixin || (exports.ApiReadonlyMixin = ApiReadonlyMixin = {}));
//# sourceMappingURL=ApiReadonlyMixin.js.map
\ No newline at end of file
{"version":3,"file":"ApiReadonlyMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReadonlyMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AA6E3D,4CAuCC;AAjGD,MAAM,WAAW,GAAkB,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAiD1E;;;;;;;;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 (ApiReadonlyMixin:interface)}.\n * @public\n */\nexport interface IApiReadonlyMixinOptions extends IApiItemOptions {\n isReadonly: boolean;\n}\n\nexport interface IApiReadonlyMixinJson extends IApiItemJson {\n isReadonly: boolean;\n}\n\nconst _isReadonly: unique symbol = Symbol('ApiReadonlyMixin._isReadonly');\n\n/**\n * The mixin base class for API items that cannot be modified after instantiation.\n * Examples such as the readonly modifier and only having a getter but no setter.\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 ApiReadonlyMixin extends ApiItem {\n /**\n * Indicates that the API item's value cannot be assigned by an external consumer.\n *\n * @remarks\n * Examples of API items that would be considered \"read only\" by API Extractor:\n *\n * - A class or interface's property that has the `readonly` modifier.\n *\n * - A variable that has the `const` modifier.\n *\n * - A property or variable whose TSDoc comment includes the `@readonly` tag.\n *\n * - A property declaration with a getter but no setter.\n *\n * Note that if the `readonly` keyword appears in a type annotation, this does not\n * guarantee that that the API item will be considered readonly. For example:\n *\n * ```ts\n * declare class C {\n * // isReadonly=false in this case, because C.x is assignable\n * public x: readonly string[];\n * }\n * ```\n */\n readonly isReadonly: boolean;\n\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiReadonlyMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiReadonlyMixin:interface)}\n * functionality.\n *\n * @public\n */\nexport function ApiReadonlyMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiReadonlyMixin) {\n class MixedClass extends baseClass implements ApiReadonlyMixin {\n public [_isReadonly]: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiReadonlyMixinOptions = args[0];\n this[_isReadonly] = options.isReadonly;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiReadonlyMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiReadonlyMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.isReadonly = jsonObject.isReadonly || false;\n }\n\n public get isReadonly(): boolean {\n return this[_isReadonly];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiReadonlyMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.isReadonly = this.isReadonly;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiReadonlyMixin:interface)}.\n * @public\n */\nexport namespace ApiReadonlyMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReadonlyMixin` 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 ApiReadonlyMixin {\n return apiItem.hasOwnProperty(_isReadonly);\n }\n}\n"]}
\ No newline at end of file
import type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
import { ReleaseTag } from '../aedoc/ReleaseTag';
/**
* Constructor options for {@link (ApiReleaseTagMixin:interface)}.
* @public
*/
export interface IApiReleaseTagMixinOptions extends IApiItemOptions {
releaseTag: ReleaseTag;
}
export interface IApiReleaseTagMixinJson extends IApiItemJson {
releaseTag: string;
}
/**
* The mixin base class for API items that can be attributed with a TSDoc tag such as `@internal`,
* `@alpha`, `@beta`, or `@public`. These "release tags" indicate the support level for an API.
*
* @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 ApiReleaseTagMixin extends ApiItem {
/**
* The effective release tag for this declaration. If it is not explicitly specified, the value may be
* inherited from a containing declaration.
*
* @remarks
* For example, an `ApiEnumMember` may inherit its release tag from the containing `ApiEnum`.
*/
readonly releaseTag: ReleaseTag;
/** @override */
serializeInto(jsonObject: Partial<IApiItemJson>): void;
}
/**
* Mixin function for {@link (ApiReleaseTagMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiReleaseTagMixin:interface)} functionality.
*
* @public
*/
export declare function ApiReleaseTagMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiReleaseTagMixin);
/**
* Static members for {@link (ApiReleaseTagMixin:interface)}.
* @public
*/
export declare namespace ApiReleaseTagMixin {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReleaseTagMixin` 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 ApiReleaseTagMixin;
}
//# sourceMappingURL=ApiReleaseTagMixin.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiReleaseTagMixin.d.ts","sourceRoot":"","sources":["../../src/mixins/ApiReleaseTagMixin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IACjE,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,UAAU,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEhC,gBAAgB;IAChB,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,SAAS,mBAAmB,EACvE,SAAS,EAAE,UAAU,GAEpB,UAAU,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,kBAAkB,CAAC,CA4C3D;AAED;;;GAGG;AACH,yBAAiB,kBAAkB,CAAC;IAClC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,kBAAkB,CAE7E;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.ApiReleaseTagMixin = ApiReleaseTagMixin;
/* eslint-disable @typescript-eslint/no-redeclare */
const node_core_library_1 = require("@rushstack/node-core-library");
const ReleaseTag_1 = require("../aedoc/ReleaseTag");
const _releaseTag = Symbol('ApiReleaseTagMixin._releaseTag');
/**
* Mixin function for {@link (ApiReleaseTagMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiReleaseTagMixin:interface)} functionality.
*
* @public
*/
function ApiReleaseTagMixin(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[_releaseTag] = options.releaseTag;
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
baseClass.onDeserializeInto(options, context, jsonObject);
const deserializedReleaseTag = node_core_library_1.Enum.tryGetValueByKey(ReleaseTag_1.ReleaseTag, // eslint-disable-line
jsonObject.releaseTag);
if (deserializedReleaseTag === undefined) {
throw new Error(`Failed to deserialize release tag ${JSON.stringify(jsonObject.releaseTag)}`);
}
options.releaseTag = deserializedReleaseTag;
}
get releaseTag() {
return this[_releaseTag];
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
jsonObject.releaseTag = ReleaseTag_1.ReleaseTag[this.releaseTag];
}
}
return MixedClass;
}
/**
* Static members for {@link (ApiReleaseTagMixin:interface)}.
* @public
*/
(function (ApiReleaseTagMixin) {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReleaseTagMixin` 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(_releaseTag);
}
ApiReleaseTagMixin.isBaseClassOf = isBaseClassOf;
})(ApiReleaseTagMixin || (exports.ApiReleaseTagMixin = ApiReleaseTagMixin = {}));
//# sourceMappingURL=ApiReleaseTagMixin.js.map
\ No newline at end of file
{"version":3,"file":"ApiReleaseTagMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReleaseTagMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AA+D3D,gDA+CC;AA5GD,oDAAoD;AAEpD,oEAAoD;AAGpD,oDAAiD;AAejD,MAAM,WAAW,GAAkB,MAAM,CAAC,gCAAgC,CAAC,CAAC;AAiC5E;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAChC,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,GAA+B,IAAI,CAAC,CAAC,CAAC,CAAC;YACpD,IAAI,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;QACzC,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA4C,EAC5C,OAA4B,EAC5B,UAAmC;YAEnC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,MAAM,sBAAsB,GAA2B,wBAAI,CAAC,gBAAgB,CAC1E,uBAAiB,EAAE,sBAAsB;YACzC,UAAU,CAAC,UAAU,CACtB,CAAC;YACF,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;gBACzC,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAChG,CAAC;YAED,OAAO,CAAC,UAAU,GAAG,sBAAsB,CAAC;QAC9C,CAAC;QAED,IAAW,UAAU;YACnB,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA4C;YAC/D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,UAAU,GAAG,uBAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtD,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,kBAAkB;IACjC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;IAFe,gCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,kBAAkB,kCAAlB,kBAAkB,QAalC","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 { Enum } from '@rushstack/node-core-library';\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport { ReleaseTag } from '../aedoc/ReleaseTag';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (ApiReleaseTagMixin:interface)}.\n * @public\n */\nexport interface IApiReleaseTagMixinOptions extends IApiItemOptions {\n releaseTag: ReleaseTag;\n}\n\nexport interface IApiReleaseTagMixinJson extends IApiItemJson {\n releaseTag: string;\n}\n\nconst _releaseTag: unique symbol = Symbol('ApiReleaseTagMixin._releaseTag');\n\n/**\n * The mixin base class for API items that can be attributed with a TSDoc tag such as `@internal`,\n * `@alpha`, `@beta`, or `@public`. These \"release tags\" indicate the support level for an API.\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 ApiReleaseTagMixin extends ApiItem {\n /**\n * The effective release tag for this declaration. If it is not explicitly specified, the value may be\n * inherited from a containing declaration.\n *\n * @remarks\n * For example, an `ApiEnumMember` may inherit its release tag from the containing `ApiEnum`.\n */\n readonly releaseTag: ReleaseTag;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiReleaseTagMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiReleaseTagMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiReleaseTagMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiReleaseTagMixin) {\n class MixedClass extends baseClass implements ApiReleaseTagMixin {\n public [_releaseTag]: ReleaseTag;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiReleaseTagMixinOptions = args[0];\n this[_releaseTag] = options.releaseTag;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiReleaseTagMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiReleaseTagMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n const deserializedReleaseTag: ReleaseTag | undefined = Enum.tryGetValueByKey<ReleaseTag>(\n ReleaseTag as any, // eslint-disable-line\n jsonObject.releaseTag\n );\n if (deserializedReleaseTag === undefined) {\n throw new Error(`Failed to deserialize release tag ${JSON.stringify(jsonObject.releaseTag)}`);\n }\n\n options.releaseTag = deserializedReleaseTag;\n }\n\n public get releaseTag(): ReleaseTag {\n return this[_releaseTag];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiReleaseTagMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.releaseTag = ReleaseTag[this.releaseTag];\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiReleaseTagMixin:interface)}.\n * @public\n */\nexport namespace ApiReleaseTagMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReleaseTagMixin` 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 ApiReleaseTagMixin {\n return apiItem.hasOwnProperty(_releaseTag);\n }\n}\n"]}
\ No newline at end of file
import type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
import type { IExcerptTokenRange, Excerpt } from './Excerpt';
/**
* Constructor options for {@link (ApiReturnTypeMixin:interface)}.
* @public
*/
export interface IApiReturnTypeMixinOptions extends IApiItemOptions {
returnTypeTokenRange: IExcerptTokenRange;
}
export interface IApiReturnTypeMixinJson extends IApiItemJson {
returnTypeTokenRange: IExcerptTokenRange;
}
/**
* The mixin base class for API items that are functions that return a value.
*
* @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 ApiReturnTypeMixin extends ApiItem {
/**
* An {@link Excerpt} that describes the type of the function's return value.
*/
readonly returnTypeExcerpt: Excerpt;
/** @override */
serializeInto(jsonObject: Partial<IApiReturnTypeMixinJson>): void;
}
/**
* Mixin function for {@link (ApiReturnTypeMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiReturnTypeMixin:interface)} functionality.
*
* @public
*/
export declare function ApiReturnTypeMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiReturnTypeMixin);
/**
* Static members for {@link (ApiReturnTypeMixin:interface)}.
* @public
*/
export declare namespace ApiReturnTypeMixin {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReturnTypeMixin` 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 ApiReturnTypeMixin;
}
//# sourceMappingURL=ApiReturnTypeMixin.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiReturnTypeMixin.d.ts","sourceRoot":"","sources":["../../src/mixins/ApiReturnTypeMixin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAI7D;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IACjE,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C;AAED,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C;AAID;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,kBAAmB,SAAQ,OAAO;IACjD;;OAEG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IAEpC,gBAAgB;IAChB,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC;CACnE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,SAAS,mBAAmB,EACvE,SAAS,EAAE,UAAU,GAEpB,UAAU,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,kBAAkB,CAAC,CAyC3D;AAED;;;GAGG;AACH,yBAAiB,kBAAkB,CAAC;IAClC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,kBAAkB,CAE7E;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.ApiReturnTypeMixin = ApiReturnTypeMixin;
/* eslint-disable @typescript-eslint/no-redeclare */
const node_core_library_1 = require("@rushstack/node-core-library");
const ApiDeclaredItem_1 = require("../items/ApiDeclaredItem");
const _returnTypeExcerpt = Symbol('ApiReturnTypeMixin._returnTypeExcerpt');
/**
* Mixin function for {@link (ApiReturnTypeMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiReturnTypeMixin:interface)} functionality.
*
* @public
*/
function ApiReturnTypeMixin(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];
if (this instanceof ApiDeclaredItem_1.ApiDeclaredItem) {
this[_returnTypeExcerpt] = this.buildExcerpt(options.returnTypeTokenRange);
}
else {
throw new node_core_library_1.InternalError('ApiReturnTypeMixin expects a base class that inherits from ApiDeclaredItem');
}
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
baseClass.onDeserializeInto(options, context, jsonObject);
options.returnTypeTokenRange = jsonObject.returnTypeTokenRange;
}
get returnTypeExcerpt() {
return this[_returnTypeExcerpt];
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
jsonObject.returnTypeTokenRange = this.returnTypeExcerpt.tokenRange;
}
}
return MixedClass;
}
/**
* Static members for {@link (ApiReturnTypeMixin:interface)}.
* @public
*/
(function (ApiReturnTypeMixin) {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReturnTypeMixin` 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(_returnTypeExcerpt);
}
ApiReturnTypeMixin.isBaseClassOf = isBaseClassOf;
})(ApiReturnTypeMixin || (exports.ApiReturnTypeMixin = ApiReturnTypeMixin = {}));
//# sourceMappingURL=ApiReturnTypeMixin.js.map
\ No newline at end of file
{"version":3,"file":"ApiReturnTypeMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiReturnTypeMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AA2D3D,gDA4CC;AArGD,oDAAoD;AAEpD,oEAA6D;AAI7D,8DAA2D;AAe3D,MAAM,kBAAkB,GAAkB,MAAM,CAAC,uCAAuC,CAAC,CAAC;AA4B1F;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAChC,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,GAA+B,IAAI,CAAC,CAAC,CAAC,CAAC;YAEpD,IAAI,IAAI,YAAY,iCAAe,EAAE,CAAC;gBACpC,IAAI,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;YAC7E,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,iCAAa,CAAC,4EAA4E,CAAC,CAAC;YACxG,CAAC;QACH,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAA4C,EAC5C,OAA4B,EAC5B,UAAmC;YAEnC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC;QACjE,CAAC;QAED,IAAW,iBAAiB;YAC1B,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAClC,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAA4C;YAC/D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,oBAAoB,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;QACtE,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,kBAAkB;IACjC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC;IAFe,gCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,kBAAkB,kCAAlB,kBAAkB,QAalC","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 { InternalError } from '@rushstack/node-core-library';\n\nimport type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';\nimport type { IExcerptTokenRange, Excerpt } from './Excerpt';\nimport { ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Constructor options for {@link (ApiReturnTypeMixin:interface)}.\n * @public\n */\nexport interface IApiReturnTypeMixinOptions extends IApiItemOptions {\n returnTypeTokenRange: IExcerptTokenRange;\n}\n\nexport interface IApiReturnTypeMixinJson extends IApiItemJson {\n returnTypeTokenRange: IExcerptTokenRange;\n}\n\nconst _returnTypeExcerpt: unique symbol = Symbol('ApiReturnTypeMixin._returnTypeExcerpt');\n\n/**\n * The mixin base class for API items that are functions that return a value.\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 ApiReturnTypeMixin extends ApiItem {\n /**\n * An {@link Excerpt} that describes the type of the function's return value.\n */\n readonly returnTypeExcerpt: Excerpt;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiReturnTypeMixinJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiReturnTypeMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiReturnTypeMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiReturnTypeMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiReturnTypeMixin) {\n class MixedClass extends baseClass implements ApiReturnTypeMixin {\n public [_returnTypeExcerpt]: Excerpt;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiReturnTypeMixinOptions = args[0];\n\n if (this instanceof ApiDeclaredItem) {\n this[_returnTypeExcerpt] = this.buildExcerpt(options.returnTypeTokenRange);\n } else {\n throw new InternalError('ApiReturnTypeMixin expects a base class that inherits from ApiDeclaredItem');\n }\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiReturnTypeMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiReturnTypeMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.returnTypeTokenRange = jsonObject.returnTypeTokenRange;\n }\n\n public get returnTypeExcerpt(): Excerpt {\n return this[_returnTypeExcerpt];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiReturnTypeMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.returnTypeTokenRange = this.returnTypeExcerpt.tokenRange;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiReturnTypeMixin:interface)}.\n * @public\n */\nexport namespace ApiReturnTypeMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiReturnTypeMixin` 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 ApiReturnTypeMixin {\n return apiItem.hasOwnProperty(_returnTypeExcerpt);\n }\n}\n"]}
\ No newline at end of file
import type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
/**
* Constructor options for {@link (IApiStaticMixinOptions:interface)}.
* @public
*/
export interface IApiStaticMixinOptions extends IApiItemOptions {
isStatic: boolean;
}
export interface IApiStaticMixinJson extends IApiItemJson {
isStatic: boolean;
}
/**
* The mixin base class for API items that can have the TypeScript `static` keyword applied to them.
*
* @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 ApiStaticMixin extends ApiItem {
/**
* Whether the declaration has the TypeScript `static` keyword.
*/
readonly isStatic: boolean;
/** @override */
serializeInto(jsonObject: Partial<IApiItemJson>): void;
}
/**
* Mixin function for {@link (ApiStaticMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiStaticMixin:interface)} functionality.
*
* @public
*/
export declare function ApiStaticMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiStaticMixin);
/**
* Static members for {@link (ApiStaticMixin:interface)}.
* @public
*/
export declare namespace ApiStaticMixin {
/**
* A type guard that tests whether the specified `ApiItem` subclass extends the `ApiStaticMixin` 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 ApiStaticMixin;
}
//# sourceMappingURL=ApiStaticMixin.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiStaticMixin.d.ts","sourceRoot":"","sources":["../../src/mixins/ApiStaticMixin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGpG;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC7D,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAID;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B,gBAAgB;IAChB,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,UAAU,SAAS,mBAAmB,EACnE,SAAS,EAAE,UAAU,GAEpB,UAAU,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,cAAc,CAAC,CAoCvD;AAED;;;GAGG;AACH,yBAAiB,cAAc,CAAC;IAC9B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,cAAc,CAEzE;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