We want to define mixin classes in regular .js files using jsDoc comments instead of .ts files.
An important aspect of mixin classes is the restriction of the generic type parameter to the constructor of the class using extends. For example, the above page has the following TypeScript:
type Constructor<T> = new(...args: any[]) => T;
function Tagged<T extends Constructor<{}>>(Base: T) { ... }
TypeScript jsDoc support allows declaration @template T, but we see no way to limit it T, for example, to the constructor of the class. Is there any way to do this?
We will be ready to create / use files .d.tsto support this, if the mixin declaration can itself exist in the .js file and that it checkJswill accordingly type the verification type of this process. js.
source
share