forked from fable-compiler/fable-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Browser.XMLHttpRequest.fs
53 lines (45 loc) · 1.67 KB
/
Browser.XMLHttpRequest.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
namespace Browser.Types
open System
open Fable.Core
type ReadyState =
/// Client has been created. `open()` was not yet called.
| Unsent = 0
/// `open()` has been called.
| Opened = 1
/// `send()` has been called, and headers and status are available.
| HeadersReceived = 2
/// Downloading; responseText holds partial data.
| Loading = 3
/// The operation is complete.
| Done = 4
type [<AllowNullLiteral; Global>] XMLHttpRequestUpload =
inherit EventTarget
type [<AllowNullLiteral; Global>] XMLHttpRequest =
inherit EventTarget
abstract onreadystatechange: (unit -> unit) with get, set
abstract readyState: ReadyState
abstract response: obj
abstract responseText: string
abstract responseType: string with get, set
abstract responseURL: string
abstract responseXML: obj
abstract status: int
abstract statusText: string
abstract timeout: int with get, set
abstract upload: XMLHttpRequestUpload
abstract withCredentials: bool with get, set
abstract abort: unit -> unit
abstract getAllResponseHeaders: unit -> string
abstract getResponseHeader: header: string -> string
abstract ``open``: ``method``: string * url: string * ?async: bool * ?user: string * ?password: string -> unit
abstract overrideMimeType: mime: string -> unit
abstract send: ?data: obj -> unit
abstract setRequestHeader: header: string * value: string -> unit
type [<AllowNullLiteral>] XMLHttpRequestType =
[<Emit("new $0($1...)")>] abstract Create: unit -> XMLHttpRequest
namespace Browser
open Fable.Core
open Browser.Types
[<AutoOpen>]
module XMLHttpRequest =
let [<Global>] XMLHttpRequest: XMLHttpRequestType = jsNative