[typescript]interface new as constructor

Thu Mar 27

typescript

Author:Noritaka

Astro
interface addFunc {
  new(num1: number, num2: number): object;
  foo: string;
}
function tmp(func: addFunc) {
  let data = new func(1, 2);
  console.log(data)
}

(
use new as constructor
and then
define function using new as constructor
)

typescript