1 line
4.4 KiB
Plaintext
1 line
4.4 KiB
Plaintext
{"version":3,"file":"ApiEnumMember.js","sourceRoot":"","sources":["../../src/model/ApiEnumMember.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAKiE;AACjE,8CAA+C;AAC/C,8DAAyF;AACzF,qEAAmG;AACnG,yDAAiF;AACjF,uEAAsG;AAYtG;;;;;;;;;;;GAWG;AACH,IAAY,eAcX;AAdD,WAAY,eAAe;IACzB;;;;;OAKG;IACH,qCAAkB,CAAA;IAElB;;;OAGG;IACH,wCAAqB,CAAA;AACvB,CAAC,EAdW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAc1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,aAAc,SAAQ,IAAA,2BAAY,EAAC,IAAA,uCAAkB,EAAC,IAAA,yCAAmB,EAAC,iCAAe,CAAC,CAAC,CAAC;IACvG,YAAmB,OAA8B;QAC/C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,IAAY;QACxC,oFAAoF;QACpF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,UAAU,CAAC;IAChC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,aAAa,GAAc,2CAAoB,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,2CAAoB,CAAC,KAAK,EAAE,CAAC;aACjF,iBAAiB,+BAAqB,aAAa,CAAC;aACpD,WAAW,+BAAgB,CAAC;IACjC,CAAC;CACF;AA3BD,sCA2BC","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 { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport { ApiInitializerMixin, type IApiInitializerMixinOptions } from '../mixins/ApiInitializerMixin';\n\n/**\n * Constructor options for {@link ApiEnumMember}.\n * @public\n */\nexport interface IApiEnumMemberOptions\n extends IApiNameMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiDeclaredItemOptions,\n IApiInitializerMixinOptions {}\n\n/**\n * Options for customizing the sort order of {@link ApiEnum} members.\n *\n * @privateRemarks\n * This enum is currently only used by the `@microsoft/api-extractor` package; it is declared here\n * because we anticipate that if more options are added in the future, their sorting will be implemented\n * by the `@microsoft/api-extractor-model` package.\n *\n * See https://github.com/microsoft/rushstack/issues/918 for details.\n *\n * @public\n */\nexport enum EnumMemberOrder {\n /**\n * `ApiEnumMember` items are sorted according to their {@link ApiItem.getSortKey}. The order is\n * basically alphabetical by identifier name, but otherwise unspecified to allow for cosmetic improvements.\n *\n * This is the default behavior.\n */\n ByName = 'by-name',\n\n /**\n * `ApiEnumMember` items preserve the original order of the declarations in the source file.\n * (This disables the automatic sorting that is normally applied based on {@link ApiItem.getSortKey}.)\n */\n Preserve = 'preserve'\n}\n\n/**\n * Represents a member of 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 * `ApiEnumMember` represents an enum member such as `Small = 100` 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 ApiEnumMember extends ApiNameMixin(ApiReleaseTagMixin(ApiInitializerMixin(ApiDeclaredItem))) {\n public constructor(options: IApiEnumMemberOptions) {\n super(options);\n }\n\n public static getContainerKey(name: string): string {\n // No prefix needed, because ApiEnumMember is the only possible member of an ApiEnum\n return name;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.EnumMember;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiEnumMember.getContainerKey(this.name);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const nameComponent: Component = DeclarationReference.parseComponent(this.name);\n return (this.parent ? this.parent.canonicalReference : DeclarationReference.empty())\n .addNavigationStep(Navigation.Exports, nameComponent)\n .withMeaning(Meaning.Member);\n }\n}\n"]} |