@@ -22,8 +22,11 @@ export interface IApiEntryPointOptions extends IApiItemContainerMixinOptions, IA
2222 * This is part of the {@link ApiModel} hierarchy of classes, which are serializable representations of
2323 * API declarations.
2424 *
25- * `ApiEntryPoint` represents the entry point to an NPM package. For example, suppose the package.json file
26- * looks like this:
25+ * `ApiEntryPoint` represents the entry point to an NPM package. API Extractor does not currently support
26+ * analysis of multiple entry points, but the `ApiEntryPoint` object is included to support a future feature.
27+ * In the current implementation, `ApiEntryPoint.importPath` is always the empty string.
28+ *
29+ * For example, suppose the package.json file looks like this:
2730 *
2831 * ```json
2932 * {
@@ -54,11 +57,27 @@ export class ApiEntryPoint extends ApiItemContainerMixin(ApiNameMixin(ApiItem))
5457 return this . name ;
5558 }
5659
60+ /**
61+ * The module path for this entry point, relative to the parent `ApiPackage`. In the current implementation,
62+ * this is always the empty string, indicating the default entry point.
63+ *
64+ * @remarks
65+ *
66+ * API Extractor does not currently support analysis of multiple entry points. If that feature is implemented
67+ * in the future, then the `ApiEntryPoint.importPath` will be used to distinguish different entry points,
68+ * for example: `controls/Button` in `import { Button } from "example-package/controls/Button";`.
69+ *
70+ * The `ApiEntryPoint.name` property stores the same value as `ApiEntryPoint.importPath`.
71+ */
72+ public get importPath ( ) : string {
73+ return this . name ;
74+ }
75+
5776 /** @beta @override */
5877 public buildCanonicalReference ( ) : DeclarationReference {
5978
6079 if ( this . parent instanceof ApiPackage ) {
61- return DeclarationReference . package ( this . parent . name , this . name ) ;
80+ return DeclarationReference . package ( this . parent . name , this . importPath ) ;
6281 }
6382
6483 return DeclarationReference . empty ( ) ;
0 commit comments