unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Blob` full Node.js compatibility

pi0 opened this issue · comments

Currently, we alias Node.js buffer.Blob to Web Blob. Types are not fully compatible.

Conversion of type '{ new (blobParts?: BlobPart[] | undefined, options?: BlobPropertyBag | undefined): Blob; prototype: Blob; }' to type 'typeof Blob' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  Types of construct signatures are incompatible.
    Type 'new (blobParts?: BlobPart[] | undefined, options?: BlobPropertyBag | undefined) => Blob' is not assignable to type 'new (sources: (Blob | BinaryLike)[], options?: BlobOptions | undefined) => Blob'.
      Construct signature return types 'Blob' and 'Blob' are incompatible.
        The types returned by 'stream()' are incompatible between these types.
          Type 'ReadableStream<Uint8Array>' is missing the following properties from type 'ReadableStream<any>': values, [Symbol.asyncIterator]