Skip to content

Latest commit

 

History

History

ConstructorParameters

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

ConstructorParameters

Obtains the parameter types of a constructor function type T.

Example

class C {
  constructor(a: number, b: string, c?: {
    d: boolean;
    e: Date;
  }) {}
}

type T0 = ConstructorParameters<typeof C>;

// output
type T0 = [number, string, {
    d: boolean;
    e: Date;
} | undefined]