Module

Web.File.Blob

#Blob

data Blob

#fromString

fromString :: String -> MediaType -> Blob

Creates a String with the given Mediatype For example:

myBlob = fromString (unsafeStringify { name: "Carl", age: 25 }) (MediaType "application/json")

#fromArray

fromArray :: Array String -> MediaType -> Blob

Creates a Blob from an Array of strings with the given Mediatype

#type_

type_ :: Blob -> Maybe MediaType

MediaType of the data contained in the Blob. Returns Nothing if the MediaType is unknown.

#size

size :: Blob -> Number

The size (in bytes) of the data contained in the Blob.

#StartByte

newtype StartByte

An index into the Blob indicating the first byte to include in the new Blob. If you specify a negative value, it's treated as an offset from the end of the string toward the beginning. For example, -10 would be the 10th from last byte in the Blob. If you specify a value for start that is larger than the size of the source Blob, the returned Blob has size 0 and contains no data.

Constructors

#EndByte

newtype EndByte

An index into the Blob indicating the first byte that will not be included in the new Blob (i.e. the byte exactly at this index is not included). If you specify a negative value, it's treated as an offset from the end of the string toward the beginning. For example, -10 would be the 10th from last byte in the Blob. The default value is size.

Constructors

#ByteIdx

data ByteIdx

#idxFromInt

idxFromInt :: Int -> ByteIdx

Creates ByteIdx from Int value

#idxFromNumber

idxFromNumber :: Number -> ByteIdx

Creates ByteIdx from Number value using Math.round.

#slice

slice :: MediaType -> StartByte -> EndByte -> Blob -> Blob

Creates a new Blob object (with specified MediaType), containing the data in the specified range of bytes of the source Blob, by setting .

#slice'

slice' :: StartByte -> EndByte -> Blob -> Blob

Creates a new Blob object containing the data in the specified range of bytes of the source Blob.

Modules