I don't know much about TypeScript, and I need help with the definition file. In the last version was added this definition:
type AnyConstructor<A = any> = new (...input: any[]) => A
Can someone explain to me what this does?
AnyConstructor
as the type suggest is a function, that can be used with the new
keyword - a class constructor. A class instantiates into the A
type.
StoreCRUD
is a mixin - a function, which, when called with the 1st argument being a class constructor (class extends the Base), returns a class constructor, which is a subclass of the 1st argument with the StoreCRUDClass
definitions added.
See this blog post for more details: https://www.bryntum.com/blog/the-mixin-pattern-in-typescript-all-you-need-to-know/
Read the API documentation