Binary data or Promise thereof (including Blob)
Promise resolving to Result.Ok with Uint8Array or Result.Err
// Blob support
const blob = new Blob(['Hello, World!']);
const result1 = await asyncCoerceIntoUint8(blob);
if (result1.isOk()) {
const bytes = result1.unwrap();
}
// Promise-wrapped
const promise = fetch('/data').then(r => r.arrayBuffer());
const result2 = await asyncCoerceIntoUint8(promise);
// Result-wrapped Promise
const wrapped = Promise.resolve(Result.Ok(new ArrayBuffer(10)));
const result3 = await asyncCoerceIntoUint8(wrapped);
Asynchronously coerces various binary types including Blob into Uint8Array.
Handles all types supported by coerceIntoUint8 plus async operations: