interface ExampleInterface{
foo: string;
bar: number;
}
class Example implements ExampleInterface{
foo: string;
bar: number;
constructor(init: ExampleInterface){
this.foo = init.foo;
this.bar = init.bar;
}
}class Example<T>{
item: T;
constructor(item: T){
this.item = item;
}
}class Example<T = {}>{
item: T;
constructor(item: T){
this.item = item;
}
}Get array item type
export type ArrayElement<T> = T extends (infer U)[] ? U : null;