es4x
es4x copied to clipboard
Signature of WebClientSession in @vertx/web-client needs updating
As reported by tsc:
Class static side 'typeof WebClientSession' incorrectly extends base class static side 'typeof WebClient'.
Types of property 'create' are incompatible.
Type '(webClient: WebClient) => WebClientSession' is not assignable to type '{ (vertx: Vertx): WebClient; (vertx: Vertx, options: WebClientOptions): WebClient; }'.
Types of parameters 'webClient' and 'vertx' are incompatible.
Type 'Vertx' is missing the following properties from type 'WebClient': request, requestAbs, get, getAbs, and 10 more.
The code seems to build and work after I modified the following function signature in index.d.ts:
static create(webClient: WebClient) : WebClientSession;
to
static create(webClient: Vertx) : WebClientSession;
This is one of the limitations of vertx-codegen that needs manual patching. Thanks for reporting it!
The overload is tricky in this case, because it overlaps with a parent API interface... but it can be done with a override json