From 2782401d882122c88f41f50f785869c652f0a2f5 Mon Sep 17 00:00:00 2001 From: Alberto Juan Date: Tue, 9 Apr 2019 13:37:18 +0200 Subject: [PATCH 1/2] [@types/react-request] Added responseType prop to the types --- types/react-request/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-request/index.d.ts b/types/react-request/index.d.ts index a161ff9339..ed13bb1337 100644 --- a/types/react-request/index.d.ts +++ b/types/react-request/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Danny Cochran // Angus Fretwell // Jonathan Ly +// Alberto Juan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 @@ -33,6 +34,7 @@ export interface FetchRequestProps extends RequestInit { export interface FetchProps extends FetchRequestProps { afterFetch?: (args: FetchResponse) => void; transformData?: (data: any) => T; + responseType?: string; children?: (renderProps: RenderProps) => React.ReactNode; } From 00d1a2dd4815d4db2d92ffc6ce7c6d5a0ebd1825 Mon Sep 17 00:00:00 2001 From: Alberto Juan Date: Tue, 9 Apr 2019 14:53:15 +0200 Subject: [PATCH 2/2] [@types/react-request] Added ResponseType --- types/react-request/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/react-request/index.d.ts b/types/react-request/index.d.ts index ed13bb1337..d54c067215 100644 --- a/types/react-request/index.d.ts +++ b/types/react-request/index.d.ts @@ -31,10 +31,12 @@ export interface FetchRequestProps extends RequestInit { url: string; } +export type ResponseType = 'arrayBuffer' | 'blob' | 'formData' | 'json' | 'text'; + export interface FetchProps extends FetchRequestProps { afterFetch?: (args: FetchResponse) => void; transformData?: (data: any) => T; - responseType?: string; + responseType?: ResponseType; children?: (renderProps: RenderProps) => React.ReactNode; }