/
FileRequest.cljs
91 lines (62 loc) · 2.67 KB
/
FileRequest.cljs
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
(ns web.files.FileRequest
"The FileRequest interface extends the `DOMRequest` interface
provide some extra properties necessary for the `web.files.LockedFile`"
(:refer-clojure :exclude []))
(defn locked-file
"Property.
The lockedFile property represents the `web.files.LockedFile`
from which the request was started.
`var lockedFile = instanceOfFileRequest.lockedFile`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/FileRequest/lockedFile`"
[this]
(-> this (.lockedFile)))
(defn set-locked-file!
"Property.
The lockedFile property represents the `web.files.LockedFile`
from which the request was started.
`var lockedFile = instanceOfFileRequest.lockedFile`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/FileRequest/lockedFile`"
[this val]
(aset this "lockedFile" val))
(defn onsuccess
"Property.
A callback handler called when the operation represented by the
is completed."
[this]
(-> this (.onsuccess)))
(defn set-onsuccess!
"Property.
A callback handler called when the operation represented by the
is completed."
[this val]
(aset this "onsuccess" val))
(defn onprogress
"Property.
This property specifies a callback function to be run repeatedly
the operation represented by a `web.files.FileRequest` object
in progress.
`instanceOfFileRequest.onprogress = function;
Where instanceOfFileRequest is a `web.files.FileRequest` object and function is the JavaScript function to execute.
Each time the function callback is called, it gets an object as its first parameter. Those objects contain two properties:
loaded
A number representing the current amount of bytes processed by the operation.
total
A number representing the total amount of bytes that will be processed by the operation.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/FileRequest/onprogress`"
[this]
(-> this (.onprogress)))
(defn set-onprogress!
"Property.
This property specifies a callback function to be run repeatedly
the operation represented by a `web.files.FileRequest` object
in progress.
`instanceOfFileRequest.onprogress = function;
Where instanceOfFileRequest is a `web.files.FileRequest` object and function is the JavaScript function to execute.
Each time the function callback is called, it gets an object as its first parameter. Those objects contain two properties:
loaded
A number representing the current amount of bytes processed by the operation.
total
A number representing the total amount of bytes that will be processed by the operation.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/FileRequest/onprogress`"
[this val]
(aset this "onprogress" val))