Up

module File

: sig

File API

See also https://developer.mozilla.org/en-US/docs/Web/API/File the documentation of the API.
#
class type blob =
#
method size : int Js.readonly_prop
#
method _type : Js.js_string Js.t Js.readonly_prop
#
method slice : int -> int -> blob Js.meth
#
method slice_withContentType : int -> int -> Js.js_string Js.t -> blob Js.meth
#
class type file =
inherit blob
#
method name : Js.js_string Js.t Js.readonly_prop
#
method lastModifiedDate : Js.js_string Js.t Js.readonly_prop
#
type file_any
#
module CoerceTo : sig
#
val string : file_any -> Js.js_string Js.t Js.Opt.t
#
val arrayBuffer : file_any -> Typed_array.arrayBuffer Js.t Js.Opt.t
end
#
class type fileList =
inherit [file] Dom.nodeList
#
class type fileError =
#
method code : int Js.readonly_prop
#
class type ['a] progressEvent =
inherit ['a] Dom.event
#
method lengthComputable : bool Js.t Js.readonly_prop
#
method loaded : int Js.readonly_prop
#
method total : int Js.readonly_prop
#
class type progressEventTarget = ('self)
#
method onloadstart : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onprogress : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onload : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onabort : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onerror : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onloadend : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
type readyState =
# | EMPTY
# | LOADING
# | DONE
#
class type fileReader = ('self)
#
method readAsArrayBuffer : blob Js.t -> unit Js.meth
#
method readAsBinaryString : blob Js.t -> unit Js.meth
#
method readAsText : blob Js.t -> unit Js.meth
#
method readAsText_withEncoding : blob Js.t -> Js.js_string Js.t -> unit Js.meth
#
method readAsDataURL : blob Js.t -> unit Js.meth
#
method abort : unit Js.meth
#
method readyState : readyState Js.readonly_prop
#
method result : file_any Js.readonly_prop
#
method error : fileError Js.t Js.readonly_prop
#
method onloadstart : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onprogress : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onload : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onabort : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onerror : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
method onloadend : ('self Js.t, 'self progressEvent Js.t) Dom.event_listener Js.writeonly_prop
#
module ReaderEvent : sig
#
val loadstart : typ
#
val progress : typ
#
val abort : typ
#
val error : typ
#
val load : typ
#
val loadend : typ
end
#
val filename : file Js.t -> Js.js_string Js.t

filename handles old firefox without name property

#
val fileReader : fileReader Js.t Js.constr
#
val readAsBinaryString : blob Js.t -> Js.js_string Js.t Lwt.t
#
val readAsText : blob Js.t -> Js.js_string Js.t Lwt.t
#
val readAsText_withEncoding : blob Js.t -> Js.js_string Js.t -> Js.js_string Js.t Lwt.t
#
val readAsDataURL : blob Js.t -> Js.js_string Js.t Lwt.t
#
val addEventListener : (progressEventTarget Js.t as 'a) -> 'b Dom.Event.typ -> ('a, 'b) Dom.event_listener -> bool Js.t -> Dom.event_listener_id

Add an event listener. This function matches the addEventListener DOM method, except that it returns an id for removing the listener.

end