-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReadableStreamDefaultController.cljs
84 lines (59 loc) · 2.96 KB
/
ReadableStreamDefaultController.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
(ns web.fetch.ReadableStreamDefaultController
"The ReadableStreamDefaultController interface of the Streams
represents a controller allowing control of a `web.files.ReadableStream`'s
and internal queue. Default controllers are for streams that
not byte streams."
(:refer-clojure :exclude []))
(def constructor
"Constructor.
The ReadableStreamDefaultController() constructor creates and returns a ReadableStreamDefaultController() object instance.
stream
The `web.files.ReadableStream` to be controlled.
underlyingSource
An object containing methods and properties that define how the constructed stream instance will behave. See the ReadableStream() constructor's parameters definitions for more information.
size
A method containing a parameter chunk — this indicates the size to use for each chunk, in bytes.
highWaterMark
A non-negative integer — this defines the total number of chunks that can be contained in the internal queue before backpressure is applied.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/ReadableStreamDefaultController`"
js/ReadableStreamDefaultController)
(defn close
"Method.
The close() method of the `web.fetch.ReadableStreamDefaultController`
closes the associated stream.
`readableStreamDefaultControllerInstance.close();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/close`"
[this ]
(-> this (.close)))
(defn enqueue
"Method.
The enqueue() method of the `web.fetch.ReadableStreamDefaultController`
enqueues a given chunk in the associated stream.
`readableStreamDefaultControllerInstance.enqueue(chunk);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/enqueue`"
[this chunk]
(-> this (.enqueue chunk)))
(defn error
"Method.
The error() method of the `web.fetch.ReadableStreamDefaultController`
causes any future interactions with the associated stream to
`readableStreamDefaultControllerInstance.error(e);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error`"
[this e]
(-> this (.error e)))
(defn desired-size
"Property.
The desiredSize getter property of the `web.fetch.ReadableStreamDefaultController`
returns the desired size required to fill the stream's internal
`var desiredSize = readableStreamDefaultControllerInstance.desiredSize;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/desiredSize`"
[this]
(-> this (.-desiredSize)))
(defn set-desired-size!
"Property.
The desiredSize getter property of the `web.fetch.ReadableStreamDefaultController`
returns the desired size required to fill the stream's internal
`var desiredSize = readableStreamDefaultControllerInstance.desiredSize;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/desiredSize`"
[this val]
(aset this "desiredSize" val))