You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a really roundabout way to say extends null, but the types don't check out, which is awkward. You have to annotate the IIFE with a dummy ctor type like StringConstructor to satisfy the checker.
The text was updated successfully, but these errors were encountered:
This is by design. the only supported form of extending null is extends null anything else, has to return a value whose type has a construct signature. We have excluded any as a wildcard in this scenario, just because it is more likely a user error here than intended. it would be interesting to see if there are actual use cases where this would be needed.
Here is an interesting case, in TypeScript 2.0 I declare a module swagger-client like:declare module 'swagger-client';. However, when I try to use it like:
import * as Swagger from 'swagger-client';
class Swagger extends Swagger {
pet: any;
constructor() {
super({
url: config.get('spec.petstore'),
usePromise: true
});
}
}
I get the error Type 'any' is not a constructor function type.
It's a really roundabout way to say
extends null
, but the types don't check out, which is awkward. You have to annotate the IIFE with a dummy ctor type likeStringConstructor
to satisfy the checker.The text was updated successfully, but these errors were encountered: