diff --git a/packages/angular/src/http-request.builder.ts b/packages/angular/src/http-request.builder.ts index be49fece..df8a6a40 100644 --- a/packages/angular/src/http-request.builder.ts +++ b/packages/angular/src/http-request.builder.ts @@ -62,7 +62,11 @@ export class HttpRequestBuilder { return mapper.map(responseItem); } - private mapResponse(res: HttpResponse): T | T[] | undefined { + // HACK: This is problematic but it's the best we can do right now. + // Let's assume that `T` equals to the return type of this `mapResponse`. + // See: https://app.asana.com/0/1109863238977521/1203450043003508/f + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private mapResponse(res: HttpResponse): any { if (!res.body) { return undefined; } @@ -80,19 +84,19 @@ export class HttpRequestBuilder { return this.mapItem(res.body); } - public get(): Observable { + public get(): Observable { return this.http .get(this.urlBuilder.getUrl(), { observe: 'response', headers: this.headers }) .pipe(map((res) => this.mapResponse(res))); } - public post(): Observable { + public post(): Observable { return this.http .post(this.urlBuilder.getUrl(), this.body, { observe: 'response', headers: this.headers }) .pipe(map((res) => this.mapResponse(res))); } - public put(): Observable { + public put(): Observable { return this.http .put(this.urlBuilder.getUrl(), this.body, { observe: 'response', headers: this.headers }) .pipe(map((res) => this.mapResponse(res))); diff --git a/packages/core/src/helpers/types.ts b/packages/core/src/helpers/types.ts index d67c90a6..ead26bb2 100644 --- a/packages/core/src/helpers/types.ts +++ b/packages/core/src/helpers/types.ts @@ -3,7 +3,9 @@ * @see https://stackoverflow.com/a/52183279/379923 */ export interface Type extends Function { - new (...args: unknown[]): T; + // In this case, it must be `any`. Using `unknown` give compile errors. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + new (...args: any[]): T; } /**