1 line
3.8 KiB
Plaintext
1 line
3.8 KiB
Plaintext
{"version":3,"file":"ApiEntryPoint.js","sourceRoot":"","sources":["../../src/model/ApiEntryPoint.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,kGAA+F;AAC/F,8CAAwD;AACxD,2EAA4G;AAC5G,yDAAiF;AACjF,6CAA0C;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAa,aAAc,SAAQ,IAAA,6CAAqB,EAAC,IAAA,2BAAY,EAAC,iBAAO,CAAC,CAAC;IAC7E,YAAmB,OAA8B;QAC/C,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,gBAAgB;IAChB,IAAW,IAAI;QACb,OAAO,qBAAW,CAAC,UAAU,CAAC;IAChC,CAAC;IAED,gBAAgB;IAChB,IAAW,YAAY;QACrB,uFAAuF;QACvF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,sBAAsB;IACf,uBAAuB;QAC5B,IAAI,IAAI,CAAC,MAAM,YAAY,uBAAU,EAAE;YACrC,OAAO,2CAAoB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;SACxE;QAED,OAAO,2CAAoB,CAAC,KAAK,EAAE,CAAC;IACtC,CAAC;CACF;AAxCD,sCAwCC","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 { DeclarationReference } from '@microsoft/tsdoc/lib-commonjs/beta/DeclarationReference';\nimport { ApiItem, ApiItemKind } from '../items/ApiItem';\nimport { ApiItemContainerMixin, type IApiItemContainerMixinOptions } from '../mixins/ApiItemContainerMixin';\nimport { type IApiNameMixinOptions, ApiNameMixin } from '../mixins/ApiNameMixin';\nimport { ApiPackage } from './ApiPackage';\n\n/**\n * Constructor options for {@link ApiEntryPoint}.\n * @public\n */\nexport interface IApiEntryPointOptions extends IApiItemContainerMixinOptions, IApiNameMixinOptions {}\n\n/**\n * Represents the entry point for an NPM package.\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 * `ApiEntryPoint` represents the entry point to an NPM package. API Extractor does not currently support\n * analysis of multiple entry points, but the `ApiEntryPoint` object is included to support a future feature.\n * In the current implementation, `ApiEntryPoint.importPath` is always the empty string.\n *\n * For example, suppose the package.json file looks like this:\n *\n * ```json\n * {\n * \"name\": \"example-library\",\n * \"version\": \"1.0.0\",\n * \"main\": \"./lib/index.js\",\n * \"typings\": \"./lib/index.d.ts\"\n * }\n * ```\n *\n * In this example, the `ApiEntryPoint` would represent the TypeScript module for `./lib/index.js`.\n *\n * @public\n */\nexport class ApiEntryPoint extends ApiItemContainerMixin(ApiNameMixin(ApiItem)) {\n public constructor(options: IApiEntryPointOptions) {\n super(options);\n }\n\n /** @override */\n public get kind(): ApiItemKind {\n return ApiItemKind.EntryPoint;\n }\n\n /** @override */\n public get containerKey(): string {\n // No prefix needed, because ApiEntryPoint is the only possible member of an ApiPackage\n return this.name;\n }\n\n /**\n * The module path for this entry point, relative to the parent `ApiPackage`. In the current implementation,\n * this is always the empty string, indicating the default entry point.\n *\n * @remarks\n *\n * API Extractor does not currently support analysis of multiple entry points. If that feature is implemented\n * in the future, then the `ApiEntryPoint.importPath` will be used to distinguish different entry points,\n * for example: `controls/Button` in `import { Button } from \"example-package/controls/Button\";`.\n *\n * The `ApiEntryPoint.name` property stores the same value as `ApiEntryPoint.importPath`.\n */\n public get importPath(): string {\n return this.name;\n }\n\n /** @beta @override */\n public buildCanonicalReference(): DeclarationReference {\n if (this.parent instanceof ApiPackage) {\n return DeclarationReference.package(this.parent.name, this.importPath);\n }\n\n return DeclarationReference.empty();\n }\n}\n"]} |