Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add signal to
Request
type (#38536)
Summary: The `Request` interface provided by `types/react-native` doesn't have a `signal` property when it should as this is something that is accessible on the `Request` object. ![image](https://github.com/facebook/react-native/assets/10697889/f2d75973-61ff-4874-ad8e-2c0898b82d27) For example, running the following: #### Without providing a `signal` ```ts console.log(new Request('https://www.facebook.com')); ``` will result in the following: ```ts {"_bodyInit": undefined, "_bodyText": "", "bodyUsed": false, "credentials": "same-origin", "headers": {"map": {}}, "method": "GET", "mode": null, "referrer": null, "signal": {}, "url": "https://www.facebook.com"} ``` ## Changelog: [GENERAL] [FIXED] - Fixed missing property `signal` for the `Request` interface ## Reproduce 1. Add `new Request('https://www.facebook.com').signal` to a typescript file 2. TS will error `Property 'signal' does not exist on type 'Request'` Pull Request resolved: #38536 Test Plan: Adding to `global.d.ts` in a file will resolve the problem, demonstrating that this works. ```ts interface Request { readonly signal: AbortSignal | undefined } ``` Reviewed By: NickGerleman Differential Revision: D47660506 Pulled By: jacdebug fbshipit-source-id: ef1459fbaca5d8f31bf8539bd61ac5e447111fec
- Loading branch information