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B,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":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AAU,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,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"]}
{"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"]}
{"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,CA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c,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"]}