mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
Merge pull request #34577 from albertojuanL/master
[@types/react-request] Added responseType prop
This commit is contained in:
4
types/react-request/index.d.ts
vendored
4
types/react-request/index.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user