_Blob
[<Interface>]
type _Blob =
abstract member size: float
abstract member type: string
static member Create (size: float, type: string, arrayBuffer: unit -> Promise<ArrayBuffer>, bytes: unit -> Promise<Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>>, slice: Func<float option,float option,string option,_Blob>, text: unit -> Promise<string>, stream: unit -> ReadableStream<obj>) : _Blob
abstract member arrayBuffer () : Promise<ArrayBuffer>
abstract member bytes () : Promise<Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>>
abstract member slice (?start: float, ?end: float, ?type: string) : _Blob
abstract member stream () : ReadableStream<obj>
abstract member text () : Promise<string>| Assembly | Xantham.Fable.Node |
| Attributes | [<Interface>] |
A Blob encapsulates immutable, raw data that can be safely shared across multiple worker threads.
@since v15.7.0, v14.18.0
Properties
Methods
abstract member arrayBuffer () : Promise<ArrayBuffer>
abstract member arrayBuffer () : Promise<ArrayBuffer>Returns a promise that fulfills with an ArrayBuffer containing a copy of the Blob data.
@since v15.7.0, v14.18.0
abstract member bytes () : Promise<Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>>
abstract member bytes () : Promise<Uint8Array<U2<ArrayBuffer,SharedArrayBuffer>>>The blob.bytes() method returns the byte of the Blob object as a Promise<Uint8Array>.
const blob = new Blob(['hello']);
blob.bytes().then((bytes) => {
console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
});
abstract member slice (?start: float, ?end: float, ?type: string) : _Blob
abstract member slice (?start: float, ?end: float, ?type: string) : _BlobCreates and returns a new Blob containing a subset of this Blob objects data. The original Blob is not altered.
@since v15.7.0, v14.18.0
| Parameter | |
|---|---|
start | The starting index. |
end | The ending index. |
type | The content-type for the new Blob |