Skip to content

Conversation

@petamoriken
Copy link
Contributor

@petamoriken petamoriken commented Jul 16, 2024

Fix #24578
Fix #21981

@Hajime-san
Copy link
Contributor

Will this also fix?
#21981

@petamoriken petamoriken marked this pull request as draft July 16, 2024 05:07
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. Could you please add some tests like I did in #24489 to ensure we don't regress again?

@bartlomieju
Copy link
Member

@petamoriken do you need any help with this PR? I'd like to land it before v1.45.3 release that will happen on Monday, July 22nd.

@petamoriken
Copy link
Contributor Author

@bartlomieju Finally, I am going to add type aliases for users who refer to old types. It shouldn't take that long.

Comment on lines -610 to -625
/** @category Streams */
declare interface ReadableStreamBYOBReadDoneResult<V extends ArrayBufferView> {
done: true;
value?: V;
}

/** @category Streams */
declare interface ReadableStreamBYOBReadValueResult<V extends ArrayBufferView> {
done: false;
value: V;
}

/** @category Streams */
declare type ReadableStreamBYOBReadResult<V extends ArrayBufferView> =
| ReadableStreamBYOBReadDoneResult<V>
| ReadableStreamBYOBReadValueResult<V>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be reland when supported by upstream (microsoft/TypeScript-DOM-lib-generator#1676)

extends GenericTransformStream, TextDecoderCommon {
readonly readable: ReadableStream<string>;
readonly writable: WritableStream<BufferSource>;
readonly [Symbol.toStringTag]: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petamoriken petamoriken marked this pull request as ready for review July 22, 2024 01:39
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReadableStream.from method fails type-checking in v1.45.0+ if you import openai package The dom lib is missing typings for ReadableStream.from

4 participants