-
Notifications
You must be signed in to change notification settings - Fork 464
/
Copy pathDataView.res
36 lines (28 loc) · 1.58 KB
/
DataView.res
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
type t
@new external fromBuffer: ArrayBuffer.t => t = "DataView"
@new external fromBufferToEnd: (ArrayBuffer.t, ~byteOffset: int) => t = "DataView"
@new
external fromBufferWithRange: (ArrayBuffer.t, ~byteOffset: int, ~length: int) => t = "DataView"
@get external buffer: t => 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) => int = "getInt16"
@send external getUint16: (t, int) => int = "getUint16"
@send external getInt32: (t, int) => int = "getInt32"
@send external getUint32: (t, int) => int = "getUint32"
@send external getFloat32: (t, int) => float = "getFloat32"
@send external getFloat64: (t, int) => float = "getFloat64"
@send external getBigInt64: (t, int) => bigint = "getBigInt64"
@send external getBigUint64: (t, int) => bigint = "getBigUint64"
@send external setInt8: (t, int, int) => unit = "setInt8"
@send external setUint8: (t, int, int) => unit = "setUint8"
@send external setInt16: (t, int, int) => unit = "setInt16"
@send external setUint16: (t, int, int) => unit = "setUint16"
@send external setInt32: (t, int, int) => unit = "setInt32"
@send external setUint32: (t, int, int) => unit = "setUint32"
@send external setFloat32: (t, int, float) => unit = "setFloat32"
@send external setFloat64: (t, int, float) => unit = "setFloat64"
@send external setBigInt64: (t, int, bigint) => unit = "setBigInt64"
@send external setBigUint64: (t, int, bigint) => unit = "setBigUint64"