Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 333 Bytes

File metadata and controls

23 lines (17 loc) · 333 Bytes

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]