Rush StackShopBlogEvents
Skip to main content

@packageDocumentation

Tag type: modifier

TSDoc standardization: core

This tag identifies the doc comment that describes an entire NPM package (as opposed to an individual declaration that is exported by the package). API Documenter will display the @packageDocumentation content on the page for the package.

If present, the @packageDocumentation comment must appear in the *.d.ts file acts as the entry point for the package, and it should be the first /** comment encountered in that file. The @packageDocumentation modifier should not be used in any other type of doc comment.

The @packageDocumentation comment should NOT have a release tag such as @public or @internal.

If the @packageDocumentation comment is not found, API Extractor will add the following message to the API report file:

// (No @packageDocumentation comment for this package)

Usage example:

Suppose our NPM package is called widget-lib, and its main entry point is ./src/index.ts. The source code might look like this:

// Copyright (c) Example Company. All rights reserved. Licensed under the MIT license.

/**
* A library for building widgets.
*
* @remarks
* The `widget-lib` defines the {@link IWidget} interface and {@link Widget} class,
* which are used to build widgets.
*
* @packageDocumentation
*/

/**
* Interface implemented by all widgets.
* @public
*/
export interface IWidget {
/**
* Draws the widget on the screen.
*/
render(): void;
}

/**
* The standard implementation of the `IWidget` contract.
* @public
*/
export class Widget implements IWidget {
/** {@inheritDoc IWidget.render} */
public render(): void {
. . .
}
}

See also