最近在学习ts,算是一个笔记吧。
class chinesePeople {
constructor(public name:string, public sex:string,public phone:string) {
}
}
type test<T> = T extends new (...args:infer P)=> any ? P : never;
const ttt:test<typeof chinesePeople> = ['ss','asd','123'];
到最后ttt的类型为一个元组