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
Constructor | Modifiers | Description |
---|---|---|
(constructor)(options) | Constructs a new instance of the TypeParameter class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
constraintExcerpt | readonly | Excerpt | An Excerpt that describes the base constraint of the type parameter. |
defaultTypeExcerpt | readonly | Excerpt | An Excerpt that describes the default type of the type parameter. |
isOptional | boolean | Whether the type parameter is optional. True IFF there exists a defaultTypeExcerpt . | |
name | string | The parameter name. | |
tsdocTypeParamBlock | readonly | tsdoc.DocParamBlock | undefined | Returns the @typeParam documentation for this parameter, if present. |