utils/node_modules/@microsoft/api-extractor-model/lib/model/ApiEnum.js.map

1 line
4.2 KiB
Plaintext
Raw Normal View History

2024-02-07 01:33:07 -05:00
{"version":3,"file":"ApiEnum.js","sourceRoot":"","sources":["../../src/model/ApiEnum.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAKiE;AACjE,8CAA+C;AAC/C,8DAAyF;AACzF,qEAAmG;AACnG,2EAA4G;AAE5G,yDAAiF;AACjF,iEAA6F;AAa7F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,OAAQ,SAAQ,IAAA,6CAAqB,EAChD,IAAA,2BAAY,EAAC,IAAA,uCAAkB,EAAC,IAAA,mCAAgB,EAAC,iCAAe,CAAC,CAAC,CAAC,CACpE;IACC,YAAmB,OAAwB;QACzC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,OAAO,GAAG,IAAI,IAAI,qBAAW,CAAC,IAAI,EAAE,CAAC;IACvC,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,gBAAgB;IAChB,IAAW,OAAO;QAChB,OAAO,KAAK,CAAC,OAAuC,CAAC;IACvD,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,gBAAgB;IACT,SAAS,CAAC,MAAqB;QACpC,IAAI,MAAM,CAAC,IAAI,KAAK,qBAAW,CAAC,UAAU,EAAE;YAC1C,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;SAC1E;QACD,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,aAAa,GAAc,2CAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,MAAM,UAAU,GAAe,IAAI,CAAC,UAAU,CAAC,CAAC,8BAAoB,CAAC,4BAAkB,CAAC;QACxF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,2CAAoB,CAAC,KAAK,EAAE,CAAC;aACjF,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC;aAC5C,WAAW,2BAAc,CAAC;IAC/B,CAAC;CACF;AA1CD,0BA0CC","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 { ApiDeclaredItem, type IApiDeclaredItemOptions } from '../items/ApiDeclaredItem';\nimport { ApiReleaseTagMixin, type IApiReleaseTagMixinOptions } from '../mixins/ApiReleaseTagMixin';\nimport { ApiItemContainerMixin, type IApiItemContainerMixinOptions } from '../mixins/ApiItemContainerMixin';\nimport type { ApiEnumMember } from './ApiEnumMember';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport { type IApiExportedMixinOptions, ApiExportedMixin } from '../mixins/ApiExportedMixin';\n\n/**\n * Constructor options for {@link ApiEnum}.\n * @public\n */\nexport interface IApiEnumOptions\n extends IApiItemContainerMixinOptions,\n IApiNameMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiDeclaredItemOptions,\n IApiExportedMixinOptions {}\n\n/**\n * Represents a TypeScript enum 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 * `ApiEnum` represents an enum declaration such as `FontSizes` in the example below:\n *\n * ```ts\n * export enum FontSizes {\n * Small = 100,\n * Medium = 200,\n * Large = 300\n * }\n * ```\n *\n * @public\n */\nexport class ApiEnum extends ApiItemContainerMixin(\n ApiNameMixin(ApiReleaseTagMixin(ApiExportedMixin(ApiDeclaredItem)))\n) {\n public constructor(options: IApiEnumOptions) {\n super(options);\n }\n\n public static getContainerKey(name: string): string {\n return `${name}|${ApiItemKind.Enum}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.Enum;\n }\n\n /** @override */\n public get members(): ReadonlyArray<ApiEnumMember> {\n return super.members as ReadonlyArray<ApiEnumMember>;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiEnum.getContainerKey(this.name);\n }\n\n /** @override */\n public addMember(member: ApiEnumMember): void {\n if (member.kind !== ApiItemKind.EnumMember) {\n throw new Error('Only ApiEnumMember objects can be added to an ApiEnum');\n }\n super.addMember(member);\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