Rush StackShopBlogEvents
Skip to main content

Home > @microsoft/api-extractor-model > ApiParameterListMixin > overloadIndex

ApiParameterListMixin.overloadIndex property

When a function has multiple overloaded declarations, this one-based integer index can be used to uniquely identify them.

Signature:

readonly overloadIndex: number;

Remarks

Consider this overloaded declaration:

export namespace Versioning {
// TSDoc: Versioning.(addVersions:1)
export function addVersions(x: number, y: number): number;

// TSDoc: Versioning.(addVersions:2)
export function addVersions(x: string, y: string): string;

// (implementation)
export function addVersions(x: number|string, y: number|string): number|string {
// . . .
}
}

In the above example, there are two overloaded declarations. The overload using numbers will have overloadIndex = 1. The overload using strings will have overloadIndex = 2. The third declaration that accepts all possible inputs is considered part of the implementation, and is not processed by API Extractor.