-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataTransferItem.cljs
99 lines (70 loc) · 2.92 KB
/
DataTransferItem.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
91
92
93
94
95
96
97
98
(ns web.drag.DataTransferItem
"The DataTransferItem object represents one drag data item. During
drag operation, each `drag event` has a `dataTransfer` property
contains a `list` of drag data items. Each item in the list is
DataTransferItem object."
(:refer-clojure :exclude [type]))
(defn get-as-file
"Method.
If the item is a file, the DataTransferItem.getAsFile() method
the drag data item's `web.files.File` object. If the item is
a file, this method returns null.
`File = DataTransferItem.getAsFile();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsFile`"
[this ]
(-> this (.getAsFile)))
(defn get-as-string
"Method.
The DataTransferItem.getAsString() method invokes the given callback
the drag data item's string data as the argument if the item's
is a Plain unicode string (i.e. kind is string).
`dataTransferItem.getAsString(callback);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsString`"
[this callback]
(-> this (.getAsString callback)))
(defn webkit-get-as-entry
"Method.
If the item described by the `web.drag.DataTransferItem` is a
webkitGetAsEntry() returns a `web.files.FileSystemFileEntry`
`web.files.FileSystemDirectoryEntry` representing it. If the
isn't a file, null is returned.
`DataTransferItem.webkitGetAsEntry();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry`"
[this ]
(-> this (.webkitGetAsEntry)))
(defn kind
"Property.
The read-only DataTransferItem.kind property returns a `web.drag.DataTransferItem`
the drag data item kind: some text or some file.
`var itemKind = DataTransferItem.kind;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/kind`"
[this]
(-> this (.-kind)))
(defn set-kind!
"Property.
The read-only DataTransferItem.kind property returns a `web.drag.DataTransferItem`
the drag data item kind: some text or some file.
`var itemKind = DataTransferItem.kind;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/kind`"
[this val]
(aset this "kind" val))
(defn type
"Property.
The read-only DataTransferItem.type property returns the type
of the `web.drag.DataTransferItem` object representing the drag
item. The type is a Unicode string generally given by a MIME
although a MIME type is not required.
`dataItem.type;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/type`"
[this]
(-> this (.-type)))
(defn set-type!
"Property.
The read-only DataTransferItem.type property returns the type
of the `web.drag.DataTransferItem` object representing the drag
item. The type is a Unicode string generally given by a MIME
although a MIME type is not required.
`dataItem.type;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/type`"
[this val]
(aset this "type" val))