TypeScript 4.2 no longer contains type definitions for readable byte streams (UnderlyingByteSource, ReadableStreamBYOBReader, or ReadableByteStreamController), since they are not widely supported. We now define these types ourselves as part of this project.
Note that TypeScript may not be able to select the correct overload. For example, this currently needs an explicit type cast:
import { ReadableStream } from 'web-streams-polyfill';
import { createReadableStreamWrapper, ReadableByteStreamLikeConstructor } from 'web-streams-adapter';
const wrapper = createReadableStreamWrapper(ReadableStreamPolyfill as ReadableByteStreamLikeConstructor);
(We may want to consider creating a separate createReadableByteStreamWrapper helper to avoid this... 🤔)
While we're at it, also update to the latest version of the web platform tests and the WPT runner. (We still don't pass all of the tests, but at least we run them. 😛)
TypeScript 4.2 no longer contains type definitions for readable byte streams (
UnderlyingByteSource
,ReadableStreamBYOBReader
, orReadableByteStreamController
), since they are not widely supported. We now define these types ourselves as part of this project.Note that TypeScript may not be able to select the correct overload. For example, this currently needs an explicit type cast:
(We may want to consider creating a separate
createReadableByteStreamWrapper
helper to avoid this... 🤔)While we're at it, also update to the latest version of the web platform tests and the WPT runner. (We still don't pass all of the tests, but at least we run them. 😛)
Fixes #17.