forked from fable-compiler/fable-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrowser.Blob.fs
More file actions
52 lines (42 loc) · 1.74 KB
/
Copy pathBrowser.Blob.fs
File metadata and controls
52 lines (42 loc) · 1.74 KB
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
namespace Browser.Types
open System
open Fable.Core
open Fable.Core.JS
[<StringEnum; RequireQualifiedAccess>]
type BlobEndings =
/// Endings are stored in the blob without change
| [<CompiledName("transparent")>] Transparent
/// Line ending characters are changed to match host OS filesystem convention
| [<CompiledName("native")>] Native
type [<AllowNullLiteral>] BlobPropertyBag =
abstract ``type``: string with get, set
abstract endings: BlobEndings with get, set
type [<AllowNullLiteral; Global>] Blob =
abstract arrayBuffer: unit -> Promise<ArrayBuffer>
abstract size: int
abstract ``type``: string
abstract slice: ?start: int * ?``end``: int * ?contentType: string -> Blob
abstract text: unit -> Promise<string>
type [<AllowNullLiteral>] BlobType =
[<Emit("new $0($1...)")>] abstract Create: ?blobParts: obj[] * ?options: BlobPropertyBag -> Blob
type [<AllowNullLiteral; Global>] FormData =
abstract append: name: string * value: string -> unit
abstract append: name: string * value: Blob * ?filename: string -> unit
abstract delete: name: string -> unit
abstract entries: unit -> (string * obj) seq
abstract get: name: string -> obj
abstract getAll: name: string -> obj[]
abstract has: name: string -> bool
abstract keys: unit -> string seq
abstract set: name: string * value: string -> unit
abstract set: name: string * value: Blob * ?filename: string -> unit
abstract values: unit -> obj seq
type [<AllowNullLiteral>] FormDataType =
[<Emit("new $0($1...)")>] abstract Create: unit -> FormData
namespace Browser
open Fable.Core
open Browser.Types
[<AutoOpen>]
module Blob =
let [<Global>] Blob: BlobType = jsNative
let [<Global>] FormData: FormDataType = jsNative