Skip to content

Commit

Permalink
Merge pull request #69 from duclet/typescript-typings
Browse files Browse the repository at this point in the history
Adding Typescript definition file
  • Loading branch information
qubyte committed Feb 18, 2018
2 parents 3ac11d1 + 584fca5 commit 5956d71
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
declare module "fetch-ponyfill" {
export default function fetchPonyfill(options?: FetchPonyfill.BootstrapOptions): FetchPonyfill.BootstrapRetVal;
}

declare namespace FetchPonyfill {
interface BootstrapOptions {
Promise?: Function;
XMLHttpRequest?: Function;
}

interface BootstrapRetVal {
fetch: typeof fetch,
Headers: typeof Headers,
Request: typeof Request,
Response: typeof Response
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"files": [
"fetch-node.js",
"build/fetch-browser.js"
"build/fetch-browser.js",
"index.d.ts"
]
}

0 comments on commit 5956d71

Please sign in to comment.