Currently working on a brief .d.ts
for this library, but encountered an issue with the following:
class Issuer {
constructor(metadata) {
// ...
const self = this;
Object.defineProperty(this, 'Client', {
value: class Client extends BaseClient {
static get issuer() {
return self;
}
get issuer() {
return this.constructor.issuer;
}
},
});
}
// ...
}
In the user facing API, it is utilized like this (where googleIssuer
is an instance of Issuer).
const client = new googleIssuer.Client({
// ...
})
I attempted extending the Issuer class definition with a namespace of the same name, but it did not work as expected.
What would be the most straightforward way to represent this in my definition?