utils/node_modules/@microsoft/api-extractor-model/lib/model/ApiClass.js.map
2024-02-07 01:33:07 -05:00

1 line
7.1 KiB
Plaintext

{"version":3,"file":"ApiClass.js","sourceRoot":"","sources":["../../src/model/ApiClass.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAKiE;AACjE,8CAA+C;AAC/C,8DAIkC;AAClC,2EAA4G;AAC5G,qEAAmG;AAEnG,iDAA8C;AAC9C,yDAAiF;AACjF,mFAI6C;AAE7C,iEAIoC;AACpC,iEAIoC;AA2BpC;;;;;;;;;;;;;;;GAeG;AACH,MAAa,QAAS,SAAQ,IAAA,6CAAqB,EACjD,IAAA,2BAAY,EACV,IAAA,mCAAgB,EAAC,IAAA,qDAAyB,EAAC,IAAA,uCAAkB,EAAC,IAAA,mCAAgB,EAAC,iCAAe,CAAC,CAAC,CAAC,CAAC,CACnG,CACF;IAQC,YAAmB,OAAyB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QAHA,qBAAgB,GAAmB,EAAE,CAAC;QAKrD,IAAI,OAAO,CAAC,iBAAiB,EAAE;YAC7B,IAAI,CAAC,WAAW,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;SACnF;aAAM;YACL,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;SAC9B;QAED,KAAK,MAAM,oBAAoB,IAAI,OAAO,CAAC,qBAAqB,EAAE;YAChE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,2BAAY,CAAC,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;SACvF;IACH,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,OAAO,GAAG,IAAI,IAAI,qBAAW,CAAC,KAAK,EAAE,CAAC;IACxC,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAC7B,OAAkC,EAClC,OAA4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E,aAAa,CAAC;aAC5C,WAAW,6BAAe,CAAC;IAChC,CAAC;CACF;AA/ED,4BA+EC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport {\n DeclarationReference,\n Meaning,\n Navigation,\n type Component\n} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { ApiItemKind } from '../items/ApiItem';\nimport {\n ApiDeclaredItem,\n type IApiDeclaredItemOptions,\n type IApiDeclaredItemJson\n} from '../items/ApiDeclaredItem';\nimport { ApiItemContainerMixin, type IApiItemContainerMixinOptions } from '../mixins/ApiItemContainerMixin';\nimport { ApiReleaseTagMixin, type IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\nimport type { IExcerptTokenRange } from '../mixins/Excerpt';\nimport { HeritageType } from './HeritageType';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport {\n ApiTypeParameterListMixin,\n type IApiTypeParameterListMixinOptions,\n type IApiTypeParameterListMixinJson\n} from '../mixins/ApiTypeParameterListMixin';\nimport type { DeserializerContext } from './DeserializerContext';\nimport {\n type IApiExportedMixinJson,\n type IApiExportedMixinOptions,\n ApiExportedMixin\n} from '../mixins/ApiExportedMixin';\nimport {\n ApiAbstractMixin,\n type IApiAbstractMixinJson,\n type IApiAbstractMixinOptions\n} from '../mixins/ApiAbstractMixin';\n\n/**\n * Constructor options for {@link ApiClass}.\n * @public\n */\nexport interface IApiClassOptions\n extends IApiItemContainerMixinOptions,\n IApiNameMixinOptions,\n IApiAbstractMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiDeclaredItemOptions,\n IApiTypeParameterListMixinOptions,\n IApiExportedMixinOptions {\n extendsTokenRange: IExcerptTokenRange | undefined;\n implementsTokenRanges: IExcerptTokenRange[];\n}\n\nexport interface IApiClassJson\n extends IApiDeclaredItemJson,\n IApiAbstractMixinJson,\n IApiTypeParameterListMixinJson,\n IApiExportedMixinJson {\n extendsTokenRange?: IExcerptTokenRange;\n implementsTokenRanges: IExcerptTokenRange[];\n}\n\n/**\n * Represents a TypeScript class declaration.\n *\n * @remarks\n *\n * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of\n * API declarations.\n *\n * `ApiClass` represents a TypeScript declaration such as this:\n *\n * ```ts\n * export class X { }\n * ```\n *\n * @public\n */\nexport class ApiClass extends ApiItemContainerMixin(\n ApiNameMixin(\n ApiAbstractMixin(ApiTypeParameterListMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem))))\n )\n) {\n /**\n * The base class that this class inherits from (using the `extends` keyword), or undefined if there is no base class.\n */\n public readonly extendsType: HeritageType | undefined;\n\n private readonly _implementsTypes: HeritageType[] = [];\n\n public constructor(options: IApiClassOptions) {\n super(options);\n\n if (options.extendsTokenRange) {\n this.extendsType = new HeritageType(this.buildExcerpt(options.extendsTokenRange));\n } else {\n this.extendsType = undefined;\n }\n\n for (const implementsTokenRange of options.implementsTokenRanges) {\n this._implementsTypes.push(new HeritageType(this.buildExcerpt(implementsTokenRange)));\n }\n }\n\n public static getContainerKey(name: string): string {\n return `${name}|${ApiItemKind.Class}`;\n }\n\n /** @override */\n public static onDeserializeInto(\n options: Partial<IApiClassOptions>,\n context: DeserializerContext,\n jsonObject: IApiClassJson\n ): void {\n super.onDeserializeInto(options, context, jsonObject);\n\n options.extendsTokenRange = jsonObject.extendsTokenRange;\n options.implementsTokenRanges = jsonObject.implementsTokenRanges;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Class;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiClass.getContainerKey(this.name);\n }\n\n /**\n * The list of interfaces that this class implements using the `implements` keyword.\n */\n public get implementsTypes(): ReadonlyArray<HeritageType> {\n return this._implementsTypes;\n }\n\n /** @override */\n public serializeInto(jsonObject: Partial<IApiClassJson>): void {\n super.serializeInto(jsonObject);\n\n // Note that JSON does not support the \"undefined\" value, so we simply omit the field entirely if it is undefined\n if (this.extendsType) {\n jsonObject.extendsTokenRange = this.extendsType.excerpt.tokenRange;\n }\n\n jsonObject.implementsTokenRanges = this.implementsTypes.map((x) => x.excerpt.tokenRange);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const nameComponent: Component = DeclarationReference.parseComponent(this.name);\n const navigation: Navigation = this.isExported ? Navigation.Exports : Navigation.Locals;\n return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())\n .addNavigationStep(navigation, nameComponent)\n .withMeaning(Meaning.Class);\n }\n}\n"]}