forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStdlib_DataView.res
More file actions
53 lines (39 loc) · 2.47 KB
/
Stdlib_DataView.res
File metadata and controls
53 lines (39 loc) · 2.47 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
53
@notUndefined
type t
@new
external fromBuffer: (Stdlib_ArrayBuffer.t, ~byteOffset: int=?, ~length: int=?) => t = "DataView"
@new external fromBufferToEnd: (Stdlib_ArrayBuffer.t, ~byteOffset: int) => t = "DataView"
@new
external fromBufferWithRange: (Stdlib_ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
"DataView"
@get external buffer: t => Stdlib_ArrayBuffer.t = "buffer"
@get external byteLength: t => int = "byteLength"
@get external byteOffset: t => int = "byteOffset"
@send external getInt8: (t, int) => int = "getInt8"
@send external getUint8: (t, int) => int = "getUint8"
@send external getInt16: (t, int, ~littleEndian: bool=?) => int = "getInt16"
@send external getUint16: (t, int, ~littleEndian: bool=?) => int = "getUint16"
@send external getInt32: (t, int, ~littleEndian: bool=?) => int = "getInt32"
@send external getUint32: (t, int, ~littleEndian: bool=?) => int = "getUint32"
@send external getFloat16: (t, int, ~littleEndian: bool=?) => float = "getFloat16"
@send external getFloat32: (t, int, ~littleEndian: bool=?) => float = "getFloat32"
@send external getFloat64: (t, int, ~littleEndian: bool=?) => float = "getFloat64"
@send external getBigInt64: (t, int, ~littleEndian: bool=?) => bigint = "getBigInt64"
@send external getBigUint64: (t, int, ~littleEndian: bool=?) => bigint = "getBigUint64"
@send external setInt8: (t, int, int) => unit = "setInt8"
@send external setUint8: (t, int, int) => unit = "setUint8"
@send external setInt16: (t, int, int, ~littleEndian: bool=?) => unit = "setInt16"
@send external setUint16: (t, int, int, ~littleEndian: bool=?) => unit = "setUint16"
@send external setInt32: (t, int, int, ~littleEndian: bool=?) => unit = "setInt32"
@send external setUint32: (t, int, int, ~littleEndian: bool=?) => unit = "setUint32"
@send external setFloat16: (t, int, float, ~littleEndian: bool=?) => unit = "setFloat16"
@send external setFloat32: (t, int, float, ~littleEndian: bool=?) => unit = "setFloat32"
@send external setFloat64: (t, int, float, ~littleEndian: bool=?) => unit = "setFloat64"
@send external setBigInt64: (t, int, bigint, ~littleEndian: bool=?) => unit = "setBigInt64"
@send external setBigUint64: (t, int, bigint, ~littleEndian: bool=?) => unit = "setBigUint64"
/**
`ignore(dataView)` ignores the provided dataView and returns unit.
This helper is useful when you want to discard a value (for example, the result of an operation with side effects)
without having to store or process it further.
*/
external ignore: t => unit = "%ignore"