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BAAqB,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"]}
{"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"]}
{"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"]}
{"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"]}
{"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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B,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"]}