forked from purescript-contrib/purescript-arraybuffer-types
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypes.purs
More file actions
38 lines (30 loc) · 1.22 KB
/
Copy pathTypes.purs
File metadata and controls
38 lines (30 loc) · 1.22 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
module Data.ArrayBuffer.Types where
-- | Represents a JS ArrayBuffer object
foreign import data ArrayBuffer :: Type
-- | Represents a JS DataView on an ArrayBuffer (a slice into the ArrayBuffer)
foreign import data DataView :: Type
-- | The unifying representation for the different typed arrays
foreign import data ArrayView :: ArrayViewType -> Type
-- | Offset in bytes into a DataView or ArrayBufer
type ByteOffset = Int
-- | Length in bytes of a DataView or ArrayBuffer
type ByteLength = Int
data ArrayViewType
foreign import data Int8 :: ArrayViewType
foreign import data Int16 :: ArrayViewType
foreign import data Int32 :: ArrayViewType
foreign import data Uint8 :: ArrayViewType
foreign import data Uint16 :: ArrayViewType
foreign import data Uint32 :: ArrayViewType
foreign import data Uint8Clamped :: ArrayViewType
foreign import data Float32 :: ArrayViewType
foreign import data Float64 :: ArrayViewType
type Int8Array = ArrayView Int8
type Int16Array = ArrayView Int16
type Int32Array = ArrayView Int32
type Uint8Array = ArrayView Uint8
type Uint16Array = ArrayView Uint16
type Uint32Array = ArrayView Uint32
type Uint8ClampedArray = ArrayView Uint8Clamped
type Float32Array = ArrayView Float32
type Float64Array = ArrayView Float64