Class WebHareBlobAbstract
Implements
- Blob
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Parameters
- size: number
- type: string
Returns WebHareBlob
Properties
Protected_ path
Path if blob is on disk. Any WebHare blob can be serialized by a database upload and its path will then be updated to reflect this
Accessors
path
- get path(): string
Returns string
size
- get size(): number
The
sizeread-only property of the Blob interface returns the size of the Blob or File in bytes.Returns number
type
- get type(): string
The
typeread-only property of the Blob interface returns the MIME type of the file.Returns string
Methods
__ get As Sync U Int8 Array
Returns Readonly<Uint8Array<ArrayBuffer>>
array Buffer
Get the blob contents as an ArrayBuffer. You should be careful with this API on large blobs (especially 10MB and above) as they will be fully loaded into the JavaScript heap and may cause memory pressure.
Returns Promise<ArrayBuffer>
bytes
The
bytes()method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.Returns Promise<Uint8Array<ArrayBuffer>>
get Stream
set Blob Path
Parameters
- path: string
Returns void
Abstractslice
The
slice()method of the Blob interface creates and returns a newBlobobject which contains data from a subset of the blob on which it's called.Parameters
Optionalstart: numberOptionalend: numberOptionalcontentType: string
Returns Blob
Abstractstream
The
stream()method of the Blob interface returns a ReadableStream which upon reading returns the data contained within theBlob.Returns ReadableStream<Uint8Array<ArrayBuffer>>
text
The
text()method of the string containing the contents of the blob, interpreted as UTF-8.Returns Promise<string>
Staticfrom
- from(
str:
| string
| ArrayBuffer
| Buffer<ArrayBuffer>
| Uint8Array<ArrayBuffer>
| DataView<ArrayBuffer>
| ArrayBufferView<ArrayBuffer>,
__namedParameters?: { type?: string },
): WebHareBlobCreate a in-memory WebHareBlob from a string or buffer
Parameters
- str:
| string
| ArrayBuffer
| Buffer<ArrayBuffer>
| Uint8Array<ArrayBuffer>
| DataView<ArrayBuffer>
| ArrayBufferView<ArrayBuffer> - __namedParameters: { type?: string } = {}
Returns WebHareBlob
- str:
Staticfrom Blob
Create a WebHare blob from a JavaScript Blob, copying the data
Parameters
- blob: Blob
- __namedParameters: { type?: string } = {}
Returns Promise<WebHareBlob>
Staticfrom Disk
Staticfrom Disk Unchecked
Create a WebHare blob from a file on disk, given path and length, without checking if the file exists
Parameters
- path: string
- len: number
Returns WebHareBlob
Staticis Web Hare Blob
Parameters
- thingy: unknown
Returns thingy is WebHareBlob
Interface to streamable binary buffers that may come from eg. disk, memory or database