You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: mark fetch init properties required in typings
This makes it easier for people to pass custom headers without having to
use optional chaining/guard for undefined values which will never
actually be undefined, as we know we are passing certain values to it.
/** A Headers object, an object literal, or an array of two-item arrays to set request's headers. */
22
-
headers?: Record<string,string>
27
+
headers: {
28
+
[key: string]: string
29
+
Accept: 'text/event-stream'
30
+
}
23
31
24
32
/** A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. */
25
-
mode?: 'cors'|'no-cors'|'same-origin'
33
+
mode: 'cors'|'no-cors'|'same-origin'
26
34
27
35
/** A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. */
28
36
credentials?: 'include'|'omit'|'same-origin'
29
37
30
38
/** Controls how the request is cached. */
31
-
cache?: 'no-store'
39
+
cache: 'no-store'
32
40
33
41
/** A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */
34
-
redirect?: 'error'|'follow'|'manual'
42
+
redirect: 'error'|'follow'|'manual'
35
43
}
36
44
45
+
/**
46
+
* @public
47
+
* @deprecated Use `EventSourceFetchInit` instead.
48
+
* This type is only here for backwards compatibility and will be removed in a future version.
49
+
*/
50
+
exporttypeFetchLikeInit=EventSourceFetchInit
51
+
37
52
/**
38
53
* Stripped down version of `ReadableStreamDefaultReader`, only defining the parts we care about.
0 commit comments