Merge pull request #34577 from albertojuanL/master

[@types/react-request] Added responseType prop
This commit is contained in:
Benjamin Lichtman
2019-04-10 10:30:35 -07:00
committed by GitHub

View File

@@ -3,6 +3,7 @@
// Definitions by: Danny Cochran <https://github.com/dannycochran>
// Angus Fretwell <https://github.com/angusfretwell>
// Jonathan Ly <https://github.com/jonathanly>
// Alberto Juan <https://github.com/albertojuanl>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
@@ -30,9 +31,12 @@ export interface FetchRequestProps extends RequestInit {
url: string;
}
export type ResponseType = 'arrayBuffer' | 'blob' | 'formData' | 'json' | 'text';
export interface FetchProps<T = any> extends FetchRequestProps {
afterFetch?: (args: FetchResponse<T>) => void;
transformData?: (data: any) => T;
responseType?: ResponseType;
children?: (renderProps: RenderProps<T>) => React.ReactNode;
}