3 | import Web.Internal.FetchPrim
4 | import Web.Internal.Types
19 | [Array (Array ByteString), Record ByteString ByteString]))
21 | new' a = primJS $
Headers.prim__new (toFFI a)
25 | new = primJS $
Headers.prim__new undef
31 | -> (name : ByteString)
32 | -> (value : ByteString)
34 | append a b c = primJS $
Headers.prim__append a b c
38 | delete : (obj : Headers) -> (name : ByteString) -> JSIO ()
39 | delete a b = primJS $
Headers.prim__delete a b
43 | get : (obj : Headers) -> (name : ByteString) -> JSIO (Maybe ByteString)
44 | get a b = tryJS "Headers.get" $
Headers.prim__get a b
48 | has : (obj : Headers) -> (name : ByteString) -> JSIO Bool
49 | has a b = tryJS "Headers.has" $
Headers.prim__has a b
55 | -> (name : ByteString)
56 | -> (value : ByteString)
58 | set a b c = primJS $
Headers.prim__set a b c
66 | {auto 0 _ : JSType t2}
67 | -> {auto 0 _ : Elem RequestInit (Types t2)}
68 | -> (input : HSum [Request, String])
69 | -> (init : Optional t2)
71 | new' a b = primJS $
Request.prim__new (toFFI a) (optUp b)
74 | new : (input : HSum [Request, String]) -> JSIO Request
75 | new a = primJS $
Request.prim__new (toFFI a) undef
79 | cache : (obj : Request) -> JSIO RequestCache
80 | cache a = tryJS "Request.cache" $
Request.prim__cache a
84 | credentials : (obj : Request) -> JSIO RequestCredentials
85 | credentials a = tryJS "Request.credentials" $
Request.prim__credentials a
89 | destination : (obj : Request) -> JSIO RequestDestination
90 | destination a = tryJS "Request.destination" $
Request.prim__destination a
94 | headers : (obj : Request) -> JSIO Headers
95 | headers a = primJS $
Request.prim__headers a
99 | integrity : (obj : Request) -> JSIO String
100 | integrity a = primJS $
Request.prim__integrity a
104 | isHistoryNavigation : (obj : Request) -> JSIO Bool
105 | isHistoryNavigation a = tryJS "Request.isHistoryNavigation" $
106 | Request.prim__isHistoryNavigation a
110 | isReloadNavigation : (obj : Request) -> JSIO Bool
111 | isReloadNavigation a = tryJS "Request.isReloadNavigation" $
112 | Request.prim__isReloadNavigation a
116 | keepalive : (obj : Request) -> JSIO Bool
117 | keepalive a = tryJS "Request.keepalive" $
Request.prim__keepalive a
121 | method : (obj : Request) -> JSIO ByteString
122 | method a = primJS $
Request.prim__method a
126 | mode : (obj : Request) -> JSIO RequestMode
127 | mode a = tryJS "Request.mode" $
Request.prim__mode a
131 | redirect : (obj : Request) -> JSIO RequestRedirect
132 | redirect a = tryJS "Request.redirect" $
Request.prim__redirect a
136 | referrer : (obj : Request) -> JSIO String
137 | referrer a = primJS $
Request.prim__referrer a
141 | referrerPolicy : (obj : Request) -> JSIO ReferrerPolicy
142 | referrerPolicy a = tryJS "Request.referrerPolicy" $
143 | Request.prim__referrerPolicy a
147 | signal : (obj : Request) -> JSIO AbortSignal
148 | signal a = primJS $
Request.prim__signal a
152 | url : (obj : Request) -> JSIO String
153 | url a = primJS $
Request.prim__url a
157 | clone : (obj : Request) -> JSIO Request
158 | clone a = primJS $
Request.prim__clone a
166 | {auto 0 _ : JSType t2}
167 | -> {auto 0 _ : Elem ResponseInit (Types t2)}
168 | -> (body : Optional
179 | , UInt8ClampedArray
188 | -> (init : Optional t2)
190 | new' a b = primJS $
Response.prim__new (toFFI a) (optUp b)
193 | new : JSIO Response
194 | new = primJS $
Response.prim__new undef undef
198 | error : JSIO Response
199 | error = primJS $
Response.prim__error
203 | redirect' : (url : String) -> (status : Optional Bits16) -> JSIO Response
204 | redirect' a b = primJS $
Response.prim__redirect a (toFFI b)
207 | redirect : (url : String) -> JSIO Response
208 | redirect a = primJS $
Response.prim__redirect a undef
212 | headers : (obj : Response) -> JSIO Headers
213 | headers a = primJS $
Response.prim__headers a
217 | ok : (obj : Response) -> JSIO Bool
218 | ok a = tryJS "Response.ok" $
Response.prim__ok a
222 | redirected : (obj : Response) -> JSIO Bool
223 | redirected a = tryJS "Response.redirected" $
Response.prim__redirected a
227 | status : (obj : Response) -> JSIO Bits16
228 | status a = primJS $
Response.prim__status a
232 | statusText : (obj : Response) -> JSIO ByteString
233 | statusText a = primJS $
Response.prim__statusText a
237 | type : (obj : Response) -> JSIO ResponseType
238 | type a = tryJS "Response.type" $
Response.prim__type a
242 | url : (obj : Response) -> JSIO String
243 | url a = primJS $
Response.prim__url a
247 | clone : (obj : Response) -> JSIO Response
248 | clone a = primJS $
Response.prim__clone a
261 | {auto 0 _ : JSType t1}
262 | -> {auto 0 _ : Elem Body (Types t1)}
264 | -> JSIO (Maybe ReadableStream)
265 | body a = tryJS "Body.body" $
Body.prim__body (up a)
270 | {auto 0 _ : JSType t1}
271 | -> {auto 0 _ : Elem Body (Types t1)}
274 | bodyUsed a = tryJS "Body.bodyUsed" $
Body.prim__bodyUsed (up a)
279 | {auto 0 _ : JSType t1}
280 | -> {auto 0 _ : Elem Body (Types t1)}
282 | -> JSIO (Promise ArrayBuffer)
283 | arrayBuffer a = primJS $
Body.prim__arrayBuffer (up a)
288 | {auto 0 _ : JSType t1}
289 | -> {auto 0 _ : Elem Body (Types t1)}
291 | -> JSIO (Promise Blob)
292 | blob a = primJS $
Body.prim__blob (up a)
297 | {auto 0 _ : JSType t1}
298 | -> {auto 0 _ : Elem Body (Types t1)}
300 | -> JSIO (Promise FormData)
301 | formData a = primJS $
Body.prim__formData (up a)
306 | {auto 0 _ : JSType t1}
307 | -> {auto 0 _ : Elem Body (Types t1)}
309 | -> JSIO (Promise AnyPtr)
310 | json a = primJS $
Body.prim__json (up a)
315 | {auto 0 _ : JSType t1}
316 | -> {auto 0 _ : Elem Body (Types t1)}
318 | -> JSIO (Promise String)
319 | text a = primJS $
Body.prim__text (up a)
328 | namespace RequestInit
332 | (method : Optional ByteString)
333 | -> (headers : Optional
335 | [ Array (Array ByteString)
336 | , Record ByteString ByteString
338 | -> (body : Optional
349 | , UInt8ClampedArray
358 | -> (referrer : Optional String)
359 | -> (referrerPolicy : Optional ReferrerPolicy)
360 | -> (mode : Optional RequestMode)
361 | -> (credentials : Optional RequestCredentials)
362 | -> (cache : Optional RequestCache)
363 | -> (redirect : Optional RequestRedirect)
364 | -> (integrity : Optional String)
365 | -> (keepalive : Optional Bool)
366 | -> (signal : Optional (Maybe AbortSignal))
367 | -> (window : Optional Any)
368 | -> JSIO RequestInit
369 | new' a b c d e f g h i j k l m = primJS $
370 | RequestInit.prim__new
386 | new : JSIO RequestInit
388 | RequestInit.prim__new
406 | {auto 0 _ : JSType t}
407 | -> {auto 0 _ : Elem RequestInit (Types t)}
409 | -> Attribute False Optional (Maybe
427 | body v = fromUndefOrPrimNoDefault
428 | "RequestInit.getbody"
436 | {auto 0 _ : JSType t}
437 | -> {auto 0 _ : Elem RequestInit (Types t)}
439 | -> Attribute False Optional RequestCache
440 | cache v = fromUndefOrPrimNoDefault
441 | "RequestInit.getcache"
449 | {auto 0 _ : JSType t}
450 | -> {auto 0 _ : Elem RequestInit (Types t)}
452 | -> Attribute False Optional RequestCredentials
453 | credentials v = fromUndefOrPrimNoDefault
454 | "RequestInit.getcredentials"
456 | prim__setCredentials
462 | {auto 0 _ : JSType t}
463 | -> {auto 0 _ : Elem RequestInit (Types t)}
465 | -> Attribute False Optional (Union2
466 | (Array (Array ByteString))
467 | (Record ByteString ByteString))
468 | headers v = fromUndefOrPrimNoDefault
469 | "RequestInit.getheaders"
477 | {auto 0 _ : JSType t}
478 | -> {auto 0 _ : Elem RequestInit (Types t)}
480 | -> Attribute False Optional String
481 | integrity v = fromUndefOrPrimNoDefault
482 | "RequestInit.getintegrity"
490 | {auto 0 _ : JSType t}
491 | -> {auto 0 _ : Elem RequestInit (Types t)}
493 | -> Attribute False Optional Bool
494 | keepalive v = fromUndefOrPrimNoDefault
495 | "RequestInit.getkeepalive"
503 | {auto 0 _ : JSType t}
504 | -> {auto 0 _ : Elem RequestInit (Types t)}
506 | -> Attribute False Optional ByteString
507 | method v = fromUndefOrPrimNoDefault
508 | "RequestInit.getmethod"
516 | {auto 0 _ : JSType t}
517 | -> {auto 0 _ : Elem RequestInit (Types t)}
519 | -> Attribute False Optional RequestMode
520 | mode v = fromUndefOrPrimNoDefault
521 | "RequestInit.getmode"
529 | {auto 0 _ : JSType t}
530 | -> {auto 0 _ : Elem RequestInit (Types t)}
532 | -> Attribute False Optional RequestRedirect
533 | redirect v = fromUndefOrPrimNoDefault
534 | "RequestInit.getredirect"
542 | {auto 0 _ : JSType t}
543 | -> {auto 0 _ : Elem RequestInit (Types t)}
545 | -> Attribute False Optional String
546 | referrer v = fromUndefOrPrimNoDefault
547 | "RequestInit.getreferrer"
555 | {auto 0 _ : JSType t}
556 | -> {auto 0 _ : Elem RequestInit (Types t)}
558 | -> Attribute False Optional ReferrerPolicy
559 | referrerPolicy v = fromUndefOrPrimNoDefault
560 | "RequestInit.getreferrerPolicy"
561 | prim__referrerPolicy
562 | prim__setReferrerPolicy
568 | {auto 0 _ : JSType t}
569 | -> {auto 0 _ : Elem RequestInit (Types t)}
571 | -> Attribute False Optional (Maybe AbortSignal)
572 | signal v = fromUndefOrPrimNoDefault
573 | "RequestInit.getsignal"
581 | {auto 0 _ : JSType t}
582 | -> {auto 0 _ : Elem RequestInit (Types t)}
584 | -> Attribute False Optional Any
585 | window v = fromUndefOrPrimNoDefault
586 | "RequestInit.getwindow"
593 | namespace ResponseInit
597 | (status : Optional Bits16)
598 | -> (statusText : Optional ByteString)
599 | -> (headers : Optional
601 | [ Array (Array ByteString)
602 | , Record ByteString ByteString
604 | -> JSIO ResponseInit
605 | new' a b c = primJS $
ResponseInit.prim__new (toFFI a) (toFFI b) (toFFI c)
608 | new : JSIO ResponseInit
609 | new = primJS $
ResponseInit.prim__new undef undef undef
614 | {auto 0 _ : JSType t}
615 | -> {auto 0 _ : Elem ResponseInit (Types t)}
617 | -> Attribute False Optional (Union2
618 | (Array (Array ByteString))
619 | (Record ByteString ByteString))
620 | headers v = fromUndefOrPrimNoDefault
621 | "ResponseInit.getheaders"
624 | (v :> ResponseInit)
629 | {auto 0 _ : JSType t}
630 | -> {auto 0 _ : Elem ResponseInit (Types t)}
632 | -> Attribute True Optional Bits16
633 | status v = fromUndefOrPrim
634 | "ResponseInit.getstatus"
638 | (v :> ResponseInit)
643 | {auto 0 _ : JSType t}
644 | -> {auto 0 _ : Elem ResponseInit (Types t)}
646 | -> Attribute False Optional ByteString
647 | statusText v = fromUndefOrPrimNoDefault
648 | "ResponseInit.getstatusText"
650 | prim__setStatusText
651 | (v :> ResponseInit)