{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/25255","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/25255/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/25255/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/25255/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25255","id":317217707,"number":25255,"title":"Add missing fetch types compatible with TS 2.6+","user":{"login":"newyankeecodeshop","id":445421,"avatar_url":"https://avatars1.githubusercontent.com/u/445421?v=4","gravatar_id":"","url":"https://api.github.com/users/newyankeecodeshop","html_url":"https://github.com/newyankeecodeshop","followers_url":"https://api.github.com/users/newyankeecodeshop/followers","following_url":"https://api.github.com/users/newyankeecodeshop/following{/other_user}","gists_url":"https://api.github.com/users/newyankeecodeshop/gists{/gist_id}","starred_url":"https://api.github.com/users/newyankeecodeshop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newyankeecodeshop/subscriptions","organizations_url":"https://api.github.com/users/newyankeecodeshop/orgs","repos_url":"https://api.github.com/users/newyankeecodeshop/repos","events_url":"https://api.github.com/users/newyankeecodeshop/events{/privacy}","received_events_url":"https://api.github.com/users/newyankeecodeshop/received_events","type":"User","site_admin":false},"labels":[{"id":397523192,"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels/Awaiting%20reviewer%20feedback","name":"Awaiting reviewer feedback","color":"0052cc","default":false},{"id":684321576,"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/labels/Popular%20package","name":"Popular package","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-24T13:08:29Z","updated_at":"2018-04-24T17:25:49Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/25255","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25255","diff_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25255.diff","patch_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25255.patch"},"body":"This PR addresses the missing Fetch interfaces (see #19840): `RequestInfo`, `RequestInit`, and  `Response`.\r\nIt uses definitions taken from TypeScript 2.8 libraries. It's important to note that the type declaration for `body` on `RequestInit` changed between TypeScript 2.7 and 2.8. I chose the 2.8 declaration because that will be the declaration going forward, and it seems more correct to target the current and future declaration. This means that applications using TypeScript 2.6 and 2.7 might need to remove the \"dom\" library from `tsconfig.json` to fix compile errors. This is recommended anyway since the DOM API has never been available in React Native. \r\n\r\n- [x] Use a meaningful title for the pull request. Include the name of the package modified.\r\n- [x] Test the change in your own code. (Compile and run.)\r\n- [x] Add or edit tests to reflect the change. (Run with `npm test`.)\r\n- [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).\r\n- [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).\r\n- [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).\r\n\r\n\r\n- [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://facebook.github.io/react-native/docs/network.html\r\n- [ ] Increase the version number in the header if appropriate.\r\n- [ ] If you are making substantial changes, consider adding a `tslint.json` containing `{ \"extends\": \"dtslint/dt.json\" }`."},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/384014164","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25255#issuecomment-384014164","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/25255","id":384014164,"user":{"login":"stephenh","id":6401,"avatar_url":"https://avatars1.githubusercontent.com/u/6401?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenh","html_url":"https://github.com/stephenh","followers_url":"https://api.github.com/users/stephenh/followers","following_url":"https://api.github.com/users/stephenh/following{/other_user}","gists_url":"https://api.github.com/users/stephenh/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenh/subscriptions","organizations_url":"https://api.github.com/users/stephenh/orgs","repos_url":"https://api.github.com/users/stephenh/repos","events_url":"https://api.github.com/users/stephenh/events{/privacy}","received_events_url":"https://api.github.com/users/stephenh/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T17:25:49Z","updated_at":"2018-04-24T17:25:49Z","author_association":"CONTRIBUTOR","body":"I pulled this into my local app. Disclaimer I'm not actually using the `fetch` API calls, but just running `tsc` with this + the dom lib still referenced only has one error:\r\n\r\n```\r\ntypings/react-native/globals.d.ts(62,3): error TS2403: Subsequent variable declarations must have the same type.  Variable 'body' must be of type 'any', but here has type 'string | ArrayBuffer | Uint8Array | Float32Array | Blob | FormData | Uint8ClampedArray | Int32Arr...'.\r\ntypings/react-native/globals.d.ts(105,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'Response' must be of type '{ new (body?: any, init?: ResponseInit | undefined): Response; prototype: Response; error: () => ...', but here has type '{ new (body?: string | ArrayBuffer | Uint8Array | Float32Array | Blob | FormData | Uint8ClampedAr...'.\r\n```\r\n"}}
{"actor":{"display_login":"stephenh"}}