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

ApiConstructor class

Represents a TypeScript class constructor declaration that belongs to an ApiClass.


export declare class ApiConstructor extends ApiConstructor_base 


Constructor Modifiers Description
(constructor)(options)   Constructs a new instance of the ApiConstructor class


Property Modifiers Type Description
containerKey   string  
kind   ApiItemKind  


Method Modifiers Description
buildCanonicalReference()   (BETA)
getContainerKey(overloadIndex) static  


This is part of the ApiModel hierarchy of classes, which are serializable representations of API declarations.

ApiConstructor represents a declaration using the constructor keyword such as in this example:

export class Vector {
  public x: number;
  public y: number;

  // A class constructor:
  public constructor(x: number, y: number) {
    this.x = x;
    this.y = y;

Compare with ApiConstructSignature, which describes the construct signature for a class constructor.