RedomComponentConstructor type definition bug
touho opened this issue · comments
Marko Rintamäki commented
I migrating my game engine project that uses ReDOM to use TypeScript. I'm glad you have made type definitions in ReDOM!
But I found a bug.
export function list(parent: RedomQuery, View: RedomComponentConstructor, key?: string, initData?: any): List;
...
export interface RedomComponentConstructor {
new (): RedomComponent;
}
This means that all RedomComponent classes that I pass to list()
must have a constructor without any parameters. However, List has this useful feature of passing initData: new View(initData, item, i, data)
.
So, I think it would be good if RedomComponentConstructor
interface would have those four optional parameters defined. 🙏
Juha Lindstedt commented
Juha Lindstedt commented
I'm closing this here, since definitely typed is separate project.