-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add graphqlas a dev dependency and peer dependency for having the TypeScript typings available. * add typescript typings for the exported modules. * feat: Remove the graphql-js dependency and use generics instead.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
"version": "2.1.0", | ||
"description": "Cross browser function to fetch and parse streaming multipart graphql responses.", | ||
"main": "dist/index.js", | ||
"types": "./typings.d.ts", | ||
"repository": "[email protected]:relay-tools/fetch-multipart-graphql.git", | ||
"author": "Rob Richard <[email protected]>", | ||
"license": "MIT", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Minimum TypeScript Version: 3.0 | ||
|
||
declare class PatchResolver<T = unknown> { | ||
constructor(params?: { | ||
onResponse: (result: T[]) => void | ||
boundary?: string; | ||
}) | ||
} | ||
|
||
declare function MultipartFetchFunction<T = unknown>(url: string, params: { | ||
method?: string; | ||
headers?: Record<string, string>; | ||
credentials?: string; | ||
body?: string; | ||
onNext: (result: T[]) => void; | ||
onError: (error: unknown) => void; | ||
onComplete : () => void | ||
}): void | ||
|
||
|
||
export { PatchResolver} | ||
export default MultipartFetchFunction |