Commit 956c501c authored by DatHV's avatar DatHV
Browse files

update build x-app-sdk

parent 9bb8aadd
"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
"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.ApiStaticMixin = ApiStaticMixin;
const _isStatic = Symbol('ApiStaticMixin._isStatic');
/**
* 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
*/
function ApiStaticMixin(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[_isStatic] = options.isStatic;
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
baseClass.onDeserializeInto(options, context, jsonObject);
options.isStatic = jsonObject.isStatic;
}
get isStatic() {
return this[_isStatic];
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
jsonObject.isStatic = this.isStatic;
}
}
return MixedClass;
}
/**
* Static members for {@link (ApiStaticMixin:interface)}.
* @public
*/
(function (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) {
return apiItem.hasOwnProperty(_isStatic);
}
ApiStaticMixin.isBaseClassOf = isBaseClassOf;
})(ApiStaticMixin || (exports.ApiStaticMixin = ApiStaticMixin = {}));
//# sourceMappingURL=ApiStaticMixin.js.map
\ No newline at end of file
{"version":3,"file":"ApiStaticMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiStaticMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAuD3D,wCAuCC;AA3ED,MAAM,SAAS,GAAkB,MAAM,CAAC,0BAA0B,CAAC,CAAC;AA4BpE;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,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,GAA2B,IAAI,CAAC,CAAC,CAAC,CAAC;YAChD,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;QACrC,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAAwC,EACxC,OAA4B,EAC5B,UAA+B;YAE/B,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACzC,CAAC;QAED,IAAW,QAAQ;YACjB,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC;QACzB,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAAwC;YAC3D,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QACtC,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,cAAc;IAC7B;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;IAFe,4BAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,cAAc,8BAAd,cAAc,QAa9B","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 (IApiStaticMixinOptions:interface)}.\n * @public\n */\nexport interface IApiStaticMixinOptions extends IApiItemOptions {\n isStatic: boolean;\n}\n\nexport interface IApiStaticMixinJson extends IApiItemJson {\n isStatic: boolean;\n}\n\nconst _isStatic: unique symbol = Symbol('ApiStaticMixin._isStatic');\n\n/**\n * The mixin base class for API items that can have the TypeScript `static` 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 ApiStaticMixin extends ApiItem {\n /**\n * Whether the declaration has the TypeScript `static` keyword.\n */\n readonly isStatic: boolean;\n\n /** @override */\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiStaticMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiStaticMixin:interface)} functionality.\n *\n * @public\n */\nexport function ApiStaticMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiStaticMixin) {\n class MixedClass extends baseClass implements ApiStaticMixin {\n public [_isStatic]: boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiStaticMixinOptions = args[0];\n this[_isStatic] = options.isStatic;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiStaticMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiStaticMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.isStatic = jsonObject.isStatic;\n }\n\n public get isStatic(): boolean {\n return this[_isStatic];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiStaticMixinJson>): void {\n super.serializeInto(jsonObject);\n\n jsonObject.isStatic = this.isStatic;\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiStaticMixin:interface)}.\n * @public\n */\nexport namespace ApiStaticMixin {\n /**\n * A type guard that tests whether the specified `ApiItem` subclass extends the `ApiStaticMixin` 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 ApiStaticMixin {\n return apiItem.hasOwnProperty(_isStatic);\n }\n}\n"]}
\ No newline at end of file
import type { ApiItem, IApiItemJson, IApiItemConstructor, IApiItemOptions } from '../items/ApiItem';
import type { IExcerptTokenRange } from './Excerpt';
import { TypeParameter } from '../model/TypeParameter';
/**
* Represents parameter information that is part of {@link IApiTypeParameterListMixinOptions}
* @public
*/
export interface IApiTypeParameterOptions {
typeParameterName: string;
constraintTokenRange: IExcerptTokenRange;
defaultTypeTokenRange: IExcerptTokenRange;
}
/**
* Constructor options for {@link (ApiTypeParameterListMixin:interface)}.
* @public
*/
export interface IApiTypeParameterListMixinOptions extends IApiItemOptions {
typeParameters: IApiTypeParameterOptions[];
}
export interface IApiTypeParameterListMixinJson extends IApiItemJson {
typeParameters: IApiTypeParameterOptions[];
}
/**
* The mixin base class for API items that can have type parameters.
*
* @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 ApiTypeParameterListMixin extends ApiItem {
/**
* The type parameters.
*/
readonly typeParameters: ReadonlyArray<TypeParameter>;
serializeInto(jsonObject: Partial<IApiItemJson>): void;
}
/**
* Mixin function for {@link (ApiTypeParameterListMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiTypeParameterListMixin:interface)}
* functionality.
*
* @public
*/
export declare function ApiTypeParameterListMixin<TBaseClass extends IApiItemConstructor>(baseClass: TBaseClass): TBaseClass & (new (...args: any[]) => ApiTypeParameterListMixin);
/**
* Static members for {@link (ApiTypeParameterListMixin:interface)}.
* @public
*/
export declare namespace ApiTypeParameterListMixin {
/**
* 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: ApiItem): apiItem is ApiTypeParameterListMixin;
}
//# sourceMappingURL=ApiTypeParameterListMixin.d.ts.map
\ No newline at end of file
{"version":3,"file":"ApiTypeParameterListMixin.d.ts","sourceRoot":"","sources":["../../src/mixins/ApiTypeParameterListMixin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,KAAK,EAAW,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,kBAAkB,CAAC;IACzC,qBAAqB,EAAE,kBAAkB,CAAC;CAC3C;AAED;;;GAGG;AACH,MAAM,WAAW,iCAAkC,SAAQ,eAAe;IACxE,cAAc,EAAE,wBAAwB,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,8BAA+B,SAAQ,YAAY;IAClE,cAAc,EAAE,wBAAwB,EAAE,CAAC;CAC5C;AAID;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,yBAA0B,SAAQ,OAAO;IACxD;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAEtD,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;CACxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,SAAS,mBAAmB,EAC9E,SAAS,EAAE,UAAU,GAEpB,UAAU,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,yBAAyB,CAAC,CAqElE;AAED;;;GAGG;AACH,yBAAiB,yBAAyB,CAAC;IACzC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,yBAAyB,CAEpF;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.ApiTypeParameterListMixin = ApiTypeParameterListMixin;
/* eslint-disable @typescript-eslint/no-redeclare */
const node_core_library_1 = require("@rushstack/node-core-library");
const TypeParameter_1 = require("../model/TypeParameter");
const ApiDeclaredItem_1 = require("../items/ApiDeclaredItem");
const _typeParameters = Symbol('ApiTypeParameterListMixin._typeParameters');
/**
* Mixin function for {@link (ApiTypeParameterListMixin:interface)}.
*
* @param baseClass - The base class to be extended
* @returns A child class that extends baseClass, adding the {@link (ApiTypeParameterListMixin:interface)}
* functionality.
*
* @public
*/
function ApiTypeParameterListMixin(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[_typeParameters] = [];
if (this instanceof ApiDeclaredItem_1.ApiDeclaredItem) {
if (options.typeParameters) {
for (const typeParameterOptions of options.typeParameters) {
const defaultTypeExcerpt = this.buildExcerpt(typeParameterOptions.defaultTypeTokenRange);
const typeParameter = new TypeParameter_1.TypeParameter({
name: typeParameterOptions.typeParameterName,
constraintExcerpt: this.buildExcerpt(typeParameterOptions.constraintTokenRange),
defaultTypeExcerpt,
isOptional: !defaultTypeExcerpt.isEmpty,
parent: this
});
this[_typeParameters].push(typeParameter);
}
}
}
else {
throw new node_core_library_1.InternalError('ApiTypeParameterListMixin expects a base class that inherits from ApiDeclaredItem');
}
}
/** @override */
static onDeserializeInto(options, context, jsonObject) {
baseClass.onDeserializeInto(options, context, jsonObject);
options.typeParameters = jsonObject.typeParameters || [];
}
get typeParameters() {
return this[_typeParameters];
}
/** @override */
serializeInto(jsonObject) {
super.serializeInto(jsonObject);
const typeParameterObjects = [];
for (const typeParameter of this.typeParameters) {
typeParameterObjects.push({
typeParameterName: typeParameter.name,
constraintTokenRange: typeParameter.constraintExcerpt.tokenRange,
defaultTypeTokenRange: typeParameter.defaultTypeExcerpt.tokenRange
});
}
if (typeParameterObjects.length > 0) {
jsonObject.typeParameters = typeParameterObjects;
}
}
}
return MixedClass;
}
/**
* Static members for {@link (ApiTypeParameterListMixin:interface)}.
* @public
*/
(function (ApiTypeParameterListMixin) {
/**
* 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(_typeParameters);
}
ApiTypeParameterListMixin.isBaseClassOf = isBaseClassOf;
})(ApiTypeParameterListMixin || (exports.ApiTypeParameterListMixin = ApiTypeParameterListMixin = {}));
//# sourceMappingURL=ApiTypeParameterListMixin.js.map
\ No newline at end of file
{"version":3,"file":"ApiTypeParameterListMixin.js","sourceRoot":"","sources":["../../src/mixins/ApiTypeParameterListMixin.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAsE3D,8DAwEC;AA5ID,oDAAoD;AAEpD,oEAA6D;AAI7D,0DAAuD;AACvD,8DAA2D;AAyB3D,MAAM,eAAe,GAAkB,MAAM,CAAC,2CAA2C,CAAC,CAAC;AA2B3F;;;;;;;;GAQG;AACH,SAAgB,yBAAyB,CACvC,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,GAAsC,IAAI,CAAC,CAAC,CAAC,CAAC;YAE3D,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC;YAE3B,IAAI,IAAI,YAAY,iCAAe,EAAE,CAAC;gBACpC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;oBAC3B,KAAK,MAAM,oBAAoB,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;wBAC1D,MAAM,kBAAkB,GAAY,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;wBAClG,MAAM,aAAa,GAAkB,IAAI,6BAAa,CAAC;4BACrD,IAAI,EAAE,oBAAoB,CAAC,iBAAiB;4BAC5C,iBAAiB,EAAE,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,oBAAoB,CAAC;4BAC/E,kBAAkB;4BAClB,UAAU,EAAE,CAAC,kBAAkB,CAAC,OAAO;4BACvC,MAAM,EAAE,IAAI;yBACb,CAAC,CAAC;wBAEH,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;oBAC5C,CAAC;gBACH,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,iCAAa,CACrB,mFAAmF,CACpF,CAAC;YACJ,CAAC;QACH,CAAC;QAED,gBAAgB;QACT,MAAM,CAAC,iBAAiB,CAC7B,OAAmD,EACnD,OAA4B,EAC5B,UAA0C;YAE1C,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;YAE1D,OAAO,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,IAAI,EAAE,CAAC;QAC3D,CAAC;QAED,IAAW,cAAc;YACvB,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC;QAC/B,CAAC;QAED,gBAAgB;QACT,aAAa,CAAC,UAAmD;YACtE,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAEhC,MAAM,oBAAoB,GAA+B,EAAE,CAAC;YAC5D,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBAChD,oBAAoB,CAAC,IAAI,CAAC;oBACxB,iBAAiB,EAAE,aAAa,CAAC,IAAI;oBACrC,oBAAoB,EAAE,aAAa,CAAC,iBAAiB,CAAC,UAAU;oBAChE,qBAAqB,EAAE,aAAa,CAAC,kBAAkB,CAAC,UAAU;iBACnE,CAAC,CAAC;YACL,CAAC;YAED,IAAI,oBAAoB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACpC,UAAU,CAAC,cAAc,GAAG,oBAAoB,CAAC;YACnD,CAAC;QACH,CAAC;KACF;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,WAAiB,yBAAyB;IACxC;;;;;;;;OAQG;IACH,SAAgB,aAAa,CAAC,OAAgB;QAC5C,OAAO,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IACjD,CAAC;IAFe,uCAAa,gBAE5B,CAAA;AACH,CAAC,EAbgB,yBAAyB,yCAAzB,yBAAyB,QAazC","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 { Excerpt, IExcerptTokenRange } from './Excerpt';\nimport { TypeParameter } from '../model/TypeParameter';\nimport { ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport type { DeserializerContext } from '../model/DeserializerContext';\n\n/**\n * Represents parameter information that is part of {@link IApiTypeParameterListMixinOptions}\n * @public\n */\nexport interface IApiTypeParameterOptions {\n typeParameterName: string;\n constraintTokenRange: IExcerptTokenRange;\n defaultTypeTokenRange: IExcerptTokenRange;\n}\n\n/**\n * Constructor options for {@link (ApiTypeParameterListMixin:interface)}.\n * @public\n */\nexport interface IApiTypeParameterListMixinOptions extends IApiItemOptions {\n typeParameters: IApiTypeParameterOptions[];\n}\n\nexport interface IApiTypeParameterListMixinJson extends IApiItemJson {\n typeParameters: IApiTypeParameterOptions[];\n}\n\nconst _typeParameters: unique symbol = Symbol('ApiTypeParameterListMixin._typeParameters');\n\n/**\n * The mixin base class for API items that can have type parameters.\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 ApiTypeParameterListMixin extends ApiItem {\n /**\n * The type parameters.\n */\n readonly typeParameters: ReadonlyArray<TypeParameter>;\n\n serializeInto(jsonObject: Partial<IApiItemJson>): void;\n}\n\n/**\n * Mixin function for {@link (ApiTypeParameterListMixin:interface)}.\n *\n * @param baseClass - The base class to be extended\n * @returns A child class that extends baseClass, adding the {@link (ApiTypeParameterListMixin:interface)}\n * functionality.\n *\n * @public\n */\nexport function ApiTypeParameterListMixin<TBaseClass extends IApiItemConstructor>(\n baseClass: TBaseClass\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): TBaseClass & (new (...args: any[]) => ApiTypeParameterListMixin) {\n class MixedClass extends baseClass implements ApiTypeParameterListMixin {\n public readonly [_typeParameters]: TypeParameter[];\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public constructor(...args: any[]) {\n super(...args);\n\n const options: IApiTypeParameterListMixinOptions = args[0];\n\n this[_typeParameters] = [];\n\n if (this instanceof ApiDeclaredItem) {\n if (options.typeParameters) {\n for (const typeParameterOptions of options.typeParameters) {\n const defaultTypeExcerpt: Excerpt = this.buildExcerpt(typeParameterOptions.defaultTypeTokenRange);\n const typeParameter: TypeParameter = new TypeParameter({\n name: typeParameterOptions.typeParameterName,\n constraintExcerpt: this.buildExcerpt(typeParameterOptions.constraintTokenRange),\n defaultTypeExcerpt,\n isOptional: !defaultTypeExcerpt.isEmpty,\n parent: this\n });\n\n this[_typeParameters].push(typeParameter);\n }\n }\n } else {\n throw new InternalError(\n 'ApiTypeParameterListMixin expects a base class that inherits from ApiDeclaredItem'\n );\n }\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiTypeParameterListMixinOptions>,\n context: DeserializerContext,\n jsonObject: IApiTypeParameterListMixinJson\n ): void {\n baseClass.onDeserializeInto(options, context, jsonObject);\n\n options.typeParameters = jsonObject.typeParameters || [];\n }\n\n public get typeParameters(): ReadonlyArray<TypeParameter> {\n return this[_typeParameters];\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiTypeParameterListMixinJson>): void {\n super.serializeInto(jsonObject);\n\n const typeParameterObjects: IApiTypeParameterOptions[] = [];\n for (const typeParameter of this.typeParameters) {\n typeParameterObjects.push({\n typeParameterName: typeParameter.name,\n constraintTokenRange: typeParameter.constraintExcerpt.tokenRange,\n defaultTypeTokenRange: typeParameter.defaultTypeExcerpt.tokenRange\n });\n }\n\n if (typeParameterObjects.length > 0) {\n jsonObject.typeParameters = typeParameterObjects;\n }\n }\n }\n\n return MixedClass;\n}\n\n/**\n * Static members for {@link (ApiTypeParameterListMixin:interface)}.\n * @public\n */\nexport namespace ApiTypeParameterListMixin {\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 ApiTypeParameterListMixin {\n return apiItem.hasOwnProperty(_typeParameters);\n }\n}\n"]}
\ No newline at end of file
import type { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';
/** @public */
export declare enum ExcerptTokenKind {
/**
* Generic text without any special properties
*/
Content = "Content",
/**
* A reference to an API declaration
*/
Reference = "Reference"
}
/**
* Used by {@link Excerpt} to indicate a range of indexes within an array of `ExcerptToken` objects.
*
* @public
*/
export interface IExcerptTokenRange {
/**
* The starting index of the span.
*/
startIndex: number;
/**
* The index of the last member of the span, plus one.
*
* @remarks
*
* If `startIndex` and `endIndex` are the same number, then the span is empty.
*/
endIndex: number;
}
/** @public */
export interface IExcerptToken {
readonly kind: ExcerptTokenKind;
text: string;
canonicalReference?: string;
}
/**
* Represents a fragment of text belonging to an {@link Excerpt} object.
*
* @public
*/
export declare class ExcerptToken {
private readonly _kind;
private readonly _text;
private readonly _canonicalReference;
constructor(kind: ExcerptTokenKind, text: string, canonicalReference?: DeclarationReference);
/**
* Indicates the kind of token.
*/
get kind(): ExcerptTokenKind;
/**
* The text fragment.
*/
get text(): string;
/**
* The hyperlink target for a token whose type is `ExcerptTokenKind.Reference`. For other token types,
* this property will be `undefined`.
*/
get canonicalReference(): DeclarationReference | undefined;
}
/**
* The `Excerpt` class is used by {@link ApiDeclaredItem} to represent a TypeScript code fragment that may be
* annotated with hyperlinks to declared types (and in the future, source code locations).
*
* @remarks
* API Extractor's .api.json file format stores excerpts compactly as a start/end indexes into an array of tokens.
* Every `ApiDeclaredItem` has a "main excerpt" corresponding to the full list of tokens. The declaration may
* also have have "captured" excerpts that correspond to subranges of tokens.
*
* For example, if the main excerpt is:
*
* ```
* function parse(s: string): Vector | undefined;
* ```
*
* ...then this entire signature is the "main excerpt", whereas the function's return type `Vector | undefined` is a
* captured excerpt. The `Vector` token might be a hyperlink to that API item.
*
* An excerpt may be empty (i.e. a token range containing zero tokens). For example, if a function's return value
* is not explicitly declared, then the returnTypeExcerpt will be empty. By contrast, a class constructor cannot
* have a return value, so ApiConstructor has no returnTypeExcerpt property at all.
*
* @public
*/
export declare class Excerpt {
/**
* The complete list of tokens for the source code fragment that this excerpt is based upon.
* If this object is the main excerpt, then it will span all of the tokens; otherwise, it will correspond to
* a range within the array.
*/
readonly tokens: ReadonlyArray<ExcerptToken>;
/**
* Specifies the excerpt's range within the `tokens` array.
*/
readonly tokenRange: Readonly<IExcerptTokenRange>;
/**
* The tokens spanned by this excerpt. It is the range of the `tokens` array as specified by the `tokenRange`
* property.
*/
readonly spannedTokens: ReadonlyArray<ExcerptToken>;
private _text;
constructor(tokens: ReadonlyArray<ExcerptToken>, tokenRange: IExcerptTokenRange);
/**
* The excerpted text, formed by concatenating the text of the `spannedTokens` strings.
*/
get text(): string;
/**
* Returns true if the excerpt is an empty range.
*/
get isEmpty(): boolean;
}
//# sourceMappingURL=Excerpt.d.ts.map
\ No newline at end of file
{"version":3,"file":"Excerpt.d.ts","sourceRoot":"","sources":["../../src/mixins/Excerpt.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yDAAyD,CAAC;AAGpG,cAAc;AACd,oBAAY,gBAAgB;IAC1B;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,SAAS,cAAc;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,cAAc;AACd,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;IACzC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAmC;gBAEpD,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,oBAAoB;IAUlG;;OAEG;IACH,IAAW,IAAI,IAAI,gBAAgB,CAElC;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;;OAGG;IACH,IAAW,kBAAkB,IAAI,oBAAoB,GAAG,SAAS,CAEhE;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,OAAO;IAClB;;;;OAIG;IACH,SAAgB,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAEpD;;OAEG;IACH,SAAgB,UAAU,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAEzD;;;OAGG;IACH,SAAgB,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAE3D,OAAO,CAAC,KAAK,CAAqB;gBAEf,MAAM,EAAE,aAAa,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,kBAAkB;IAetF;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAKxB;IAED;;OAEG;IACH,IAAW,OAAO,IAAI,OAAO,CAE5B;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