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

1 line
4.3 KiB
Plaintext

{"version":3,"file":"ApiConstructSignature.js","sourceRoot":"","sources":["../../src/model/ApiConstructSignature.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAIiE;AACjE,8CAA+C;AAC/C,8DAAyF;AACzF,2EAA4G;AAC5G,qEAAmG;AACnG,qEAAmG;AACnG,mFAG6C;AAa7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAa,qBAAsB,SAAQ,IAAA,qDAAyB,EAClE,IAAA,6CAAqB,EAAC,IAAA,uCAAkB,EAAC,IAAA,uCAAkB,EAAC,iCAAe,CAAC,CAAC,CAAC,CAC/E;IACC,YAAmB,OAAsC;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,aAAqB;QACjD,OAAO,IAAI,qBAAW,CAAC,kBAAkB,IAAI,aAAa,EAAE,CAAC;IAC/D,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,kBAAkB,CAAC;IACxC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,OAAO,qBAAqB,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACnE,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,MAAM,MAAM,GAAyB,IAAI,CAAC,MAAM;YAC9C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB;YAChC,CAAC,CAAC,iDAAiD;gBACjD,2CAAoB,CAAC,KAAK,EAAE,CAAC,iBAAiB,+BAAqB,UAAU,CAAC,CAAC;QACnF,OAAO,MAAM,CAAC,WAAW,wCAA4B,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC9F,CAAC;CACF;AA7BD,sDA6BC","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} from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { ApiItemKind } from '../items/ApiItem';\nimport { type IApiDeclaredItemOptions, ApiDeclaredItem } from '../items/ApiDeclaredItem';\nimport { type IApiParameterListMixinOptions, ApiParameterListMixin } from '../mixins/ApiParameterListMixin';\nimport { type IApiReleaseTagMixinOptions, ApiReleaseTagMixin } from '../mixins/ApiReleaseTagMixin';\nimport { type IApiReturnTypeMixinOptions, ApiReturnTypeMixin } from '../mixins/ApiReturnTypeMixin';\nimport {\n ApiTypeParameterListMixin,\n type IApiTypeParameterListMixinOptions\n} from '../mixins/ApiTypeParameterListMixin';\n\n/**\n * Constructor options for {@link ApiConstructor}.\n * @public\n */\nexport interface IApiConstructSignatureOptions\n extends IApiTypeParameterListMixinOptions,\n IApiParameterListMixinOptions,\n IApiReleaseTagMixinOptions,\n IApiReturnTypeMixinOptions,\n IApiDeclaredItemOptions {}\n\n/**\n * Represents a TypeScript construct signature that belongs to an `ApiInterface`.\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 * `ApiConstructSignature` represents a construct signature using the `new` keyword such as in this example:\n *\n * ```ts\n * export interface IVector {\n * x: number;\n * y: number;\n * }\n *\n * export interface IVectorConstructor {\n * // A construct signature:\n * new(x: number, y: number): IVector;\n * }\n *\n * export function createVector(vectorConstructor: IVectorConstructor,\n * x: number, y: number): IVector {\n * return new vectorConstructor(x, y);\n * }\n *\n * class Vector implements IVector {\n * public x: number;\n * public y: number;\n * public constructor(x: number, y: number) {\n * this.x = x;\n * this.y = y;\n * }\n * }\n *\n * let vector: Vector = createVector(Vector, 1, 2);\n * ```\n *\n * Compare with {@link ApiConstructor}, which describes the class constructor itself.\n *\n * @public\n */\nexport class ApiConstructSignature extends ApiTypeParameterListMixin(\n ApiParameterListMixin(ApiReleaseTagMixin(ApiReturnTypeMixin(ApiDeclaredItem)))\n) {\n public constructor(options: IApiConstructSignatureOptions) {\n super(options);\n }\n\n public static getContainerKey(overloadIndex: number): string {\n return `|${ApiItemKind.ConstructSignature}|${overloadIndex}`;\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.ConstructSignature;\n }\n\n /** @override */\n public get containerKey(): string {\n return ApiConstructSignature.getContainerKey(this.overloadIndex);\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n const parent: DeclarationReference = this.parent\n ? this.parent.canonicalReference\n : // .withMeaning() requires some kind of component\n DeclarationReference.empty().addNavigationStep(Navigation.Members, '(parent)');\n return parent.withMeaning(Meaning.ConstructSignature).withOverloadIndex(this.overloadIndex);\n }\n}\n"]}