Skip to content

purescript-contrib/purescript-arraybuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Module Documentation

Module Data.ArrayBuffer.ArrayBuffer

create

create :: ByteLength -> ArrayBuffer

Create an ArrayBuffer with the given capacity.

byteLength

byteLength :: ArrayBuffer -> ByteLength

Represents the length of an ArrayBuffer in bytes.

sliceImpl

sliceImpl :: Fn3 ByteOffset ByteOffset ArrayBuffer ArrayBuffer

slice

slice :: ByteOffset -> ByteOffset -> ArrayBuffer -> ArrayBuffer

Returns a new ArrayBuffer whose contents are a copy of this ArrayBuffer's bytes from begin, inclusive, up to end, exclusive.

fromArray

fromArray :: [Number] -> ArrayBuffer

Convert an array into an ArrayBuffer representation.

fromString

fromString :: String -> ArrayBuffer

Convert a string into an ArrayBuffer representation.

Module Data.ArrayBuffer.DataView

Getter

type Getter r = forall e. DataView -> ByteOffset -> Eff (reader :: Reader | e) (Maybe r)

Type for all fetching functions.

Setter

type Setter r = forall e. DataView -> r -> ByteOffset -> Eff (writer :: Writer | e) Unit

Type for all storing functions.

whole

whole :: ArrayBuffer -> DataView

View mapping the whole ArrayBuffer.

slice

slice :: forall e. ByteOffset -> ByteLength -> ArrayBuffer -> Maybe DataView

View mapping a region of the ArrayBuffer.

buffer

buffer :: DataView -> ArrayBuffer

ArrayBuffer being mapped by the view.

byteOffset

byteOffset :: DataView -> ByteOffset

Represents the offset of this view from the start of its ArrayBuffer.

byteLength

byteLength :: DataView -> ByteLength

Represents the length of this view.

Reader

data Reader :: !

Writer

data Writer :: !

getInt8

getInt8 :: Getter Number

Fetch int8 value at a certain index in a DataView.

getInt16

getInt16 :: Getter Number

Fetch int16 value at a certain index in a DataView.

getInt32

getInt32 :: Getter Number

Fetch int32 value at a certain index in a DataView.

getUint8

getUint8 :: Getter Number

Fetch uint8 value at a certain index in a DataView.

getUint16

getUint16 :: Getter Number

Fetch uint16 value at a certain index in a DataView.

getUint32

getUint32 :: Getter Number

Fetch uint32 value at a certain index in a DataView.

getFloat32

getFloat32 :: Getter Number

Fetch float32 value at a certain index in a DataView.

getFloat64

getFloat64 :: Getter Number

Fetch float64 value at a certain index in a DataView.

setInt8

setInt8 :: Setter Number

Store int8 value at a certain index in a DataView.

setInt16

setInt16 :: Setter Number

Store int16 value at a certain index in a DataView.

setInt32

setInt32 :: Setter Number

Store int32 value at a certain index in a DataView.

setUint8

setUint8 :: Setter Number

Store uint8 value at a certain index in a DataView.

setUint16

setUint16 :: Setter Number

Store uint16 value at a certain index in a DataView.

setUint32

setUint32 :: Setter Number

Store uint32 value at a certain index in a DataView.

setFloat32

setFloat32 :: Setter Number

Store float32 value at a certain index in a DataView.

setFloat64

setFloat64 :: Setter Number

Store float64 value at a certain index in a DataView.

Module Data.ArrayBuffer.Show

showArrayView

instance showArrayView :: Show (ArrayView a)

showDataView

instance showDataView :: Show DataView

showArrayBuffer

instance showArrayBuffer :: Show ArrayBuffer

showImpl

showImpl :: forall a. ArrayView a -> String

Module Data.ArrayBuffer.Typed

Writer

data Writer :: !

asInt8Array

asInt8Array :: DataView -> Int8Array

Create typed int8 array viewing the buffer mapped by the DataView

asInt16Array

asInt16Array :: DataView -> Int16Array

Create typed int16 array viewing the buffer mapped by the DataView

asInt32Array

asInt32Array :: DataView -> Int32Array

Create typed int32 array viewing the buffer mapped by the DataView

asUint8Array

asUint8Array :: DataView -> Uint8Array

Create typed uint8 array viewing the buffer mapped by the DataView

asUint16Array

asUint16Array :: DataView -> Uint16Array

Create typed uint16 array viewing the buffer mapped by the DataView

asUint32Array

asUint32Array :: DataView -> Uint32Array

Create typed uint32 array viewing the buffer mapped by the DataView

asUint8ClampedArray

asUint8ClampedArray :: DataView -> Uint8ClampedArray

Create typed uint8 clamped array viewing the buffer mapped by the DataView

asFloat32Array

asFloat32Array :: DataView -> Float32Array

Create typed float32 array viewing the buffer mapped by the DataView

asFloat64Array

asFloat64Array :: DataView -> Float64Array

Create typed float64 array viewing the buffer mapped by the DataView

dataView

dataView :: forall a. ArrayView a -> DataView

Interpret typed array as a DataView.

set

set :: forall a e. ArrayView a -> ByteOffset -> ArrayView a -> Eff (writer :: Writer | e) Unit

Stores multiple values in the last typed array, reading input values from ther first typed array.

at

at :: forall a. ArrayView a -> Number -> Maybe Number

Fetch element at index.

toArray

toArray :: forall a. ArrayView a -> [Number]

Turn typed array into an array.

About

Bindings and implementation for mutable JavaScript ArrayBuffers.

Resources

License

Contributing

Stars

Watchers

Forks

Contributors 11