From b6c91649b43859a56fe80ab1adbc9fc159bc8a8b Mon Sep 17 00:00:00 2001 From: Shrey Jain Date: Mon, 22 Jan 2018 10:28:54 -0500 Subject: [PATCH] Different parser functions signatures for browser and node. --- types/superagent/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/superagent/index.d.ts b/types/superagent/index.d.ts index 08d27a75c6..200046d439 100644 --- a/types/superagent/index.d.ts +++ b/types/superagent/index.d.ts @@ -17,7 +17,11 @@ type CallbackHandler = (err: any, res: request.Response) => void; type Serializer = (obj: any) => string; -type Parser = (res: request.Response, callback: (err: Error | null, body: any) => void) => void; +type BrowserParser = (str: string) => any; + +type NodeParser = (res: request.Response, callback: (err: Error | null, body: any) => void) => void; + +type Parser = BrowserParser | NodeParser; type MultipartValueSingle = Blob | Buffer | fs.ReadStream | string | boolean | number;