Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: declare web types as global #12497

Merged
merged 9 commits into from
Oct 21, 2021

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Oct 19, 2021

Closes #12484
Closes #9957
Closes #12387

I checked that denoland/std#1430 passes type check with this PR

@@ -590,6 +614,8 @@ interface WritableStreamDefaultController {
error(error?: any): void;
}

declare var WritableStreamDefaultController: WritableStreamDefaultController;
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if this one is correct - there's no WritableStreamDefaultController global available, it's just an interface

Copy link
Member

Choose a reason for hiding this comment

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

That global is available:

~ ❯❯❯ deno                                                              11:28:34
Deno 1.14.3
exit using ctrl+d or close()
> WritableStreamDefaultController
[Function: WritableStreamDefaultController]

@@ -630,6 +656,8 @@ interface TransformStreamDefaultController<O = any> {
terminate(): void;
}

declare var TransformStreamDefaultController: TransformStreamDefaultController;
Copy link
Member Author

Choose a reason for hiding this comment

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

Ditto

Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above, they are both exposed in the global scope, though they don't have constructors. They are exposed for prototype comparison purposes.

Copy link
Contributor

@kitsonk kitsonk left a comment

Choose a reason for hiding this comment

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

LGTM

@bartlomieju bartlomieju merged commit 2997021 into denoland:main Oct 21, 2021
@bartlomieju bartlomieju deleted the update_web_types branch October 21, 2021 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants