Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ebc2f17

Browse filesBrowse files
committed
fix(fetch): extend TypedResponse from Response
resolves #6
1 parent 8a22de4 commit ebc2f17
Copy full SHA for ebc2f17

1 file changed

+1-15Lines changed: 1 addition & 15 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/fetch.ts‎

Copy file name to clipboardExpand all lines: src/fetch.ts
+1-15Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@ export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS'
2525

2626
// type TypedHeadersClass<TypedHeaderValues extends Record<string, string>> = new (init?: TypedHeadersInit<TypedHeaderValues>) => TypedHeaders<TypedHeaderValues>
2727

28-
export interface TypedResponse<Body = unknown> {
29-
readonly body: ReadableStream<Uint8Array> | null
30-
readonly bodyUsed: boolean
31-
arrayBuffer: () => Promise<ArrayBuffer>
32-
blob: () => Promise<Blob>
33-
formData: () => Promise<FormData>
28+
export interface TypedResponse<Body = unknown> extends Omit<Response, 'json'> {
3429
json: () => Promise<Body>
35-
text: () => Promise<string>
36-
readonly headers: Headers
37-
readonly ok: boolean
38-
readonly redirected: boolean
39-
readonly status: number
40-
readonly statusText: string
41-
readonly type: ResponseType
42-
readonly url: string
43-
clone: () => Response
4430
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.