This is admittedly a particularly bizzarre example of TypeScript syntax, but it's our current workaround for some TypeScript limitations with subclassing ES6 built-ins.
// Our hacky helper function:
function safeSubclass<T>(klasstype : T) : T {
// Bunch of stuff to use Reflect.construct, but essentially:
return klasstype;
}
// Our subclass:
class MyPromise<T> extends safeSubclass(Promise)<T> { /* ... */ }
When running through dgeni, this results in an unresolved TypeScript symbol:
This is admittedly a particularly bizzarre example of TypeScript syntax, but it's our current workaround for some TypeScript limitations with subclassing ES6 built-ins.
When running through dgeni, this results in an unresolved TypeScript symbol:
The syntax for the generic type on the promise is super weird, but is correct (and does work exactly as intended).