Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript-fetch: Fix compatibility with noImplicitAny TS rule #4711

Merged
merged 9 commits into from
Dec 6, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -275,31 +275,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value() : Promise<any> {
dngconsulting marked this conversation as resolved.
Show resolved Hide resolved
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<any> {
dngconsulting marked this conversation as resolved.
Show resolved Hide resolved
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<Blob>{
dngconsulting marked this conversation as resolved.
Show resolved Hide resolved
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<string>{
dngconsulting marked this conversation as resolved.
Show resolved Hide resolved
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value() : Promise<any> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<any> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<Blob>{
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<string>{
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value() : Promise<any> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<any> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<Blob>{
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<string>{
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value() : Promise<any> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<any> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<Blob>{
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<string>{
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value() : Promise<any> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<any> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<Blob>{
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<string>{
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value() : Promise<any> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<any> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<Blob>{
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<string>{
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value() : Promise<any> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<any> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<Blob>{
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<string>{
return await this.raw.text();
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,31 +286,31 @@ export interface ResponseTransformer<T> {
export class JSONApiResponse<T> {
constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}

async value() {
async value() : Promise<any> {
return this.transformer(await this.raw.json());
}
}

export class VoidApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<any> {
return undefined;
}
}

export class BlobApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<Blob>{
return await this.raw.blob();
};
}

export class TextApiResponse {
constructor(public raw: Response) {}

async value() {
async value() : Promise<string>{
return await this.raw.text();
};
}