RoadmapShopEvents
Skip to main content

Home > @microsoft/api-extractor-model > TypeParameter

TypeParameter class

Represents a named type parameter for a generic declaration.

Signature:
export declare class TypeParameter

Remarks

TypeParameter represents a TypeScript declaration such as T in this example:

interface IIdentifier {
getCode(): string;
}

class BarCode implements IIdentifier {
private _value: number;
public getCode(): string {
return this._value.toString();
}
}

class Book<TIdentifier extends IIdentifier = BarCode> {
public identifier: TIdentifier;
}

TypeParameter objects belong to the ApiTypeParameterListMixin.typeParameters collection.

Constructors

ConstructorModifiersDescription
(constructor)(options)Constructs a new instance of the TypeParameter class

Properties

PropertyModifiersTypeDescription
constraintExcerptExcerptAn Excerpt that describes the base constraint of the type parameter.
defaultTypeExcerptExcerptAn Excerpt that describes the default type of the type parameter.
namestringThe parameter name.
tsdocTypeParamBlocktsdoc.DocParamBlock | undefinedReturns the @typeParam documentation for this parameter, if present.