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

Inconsistent signatures for alert() vs prompt()/confirm() #1626

Open
Gaelan opened this issue Oct 4, 2023 · 1 comment
Open

Inconsistent signatures for alert() vs prompt()/confirm() #1626

Gaelan opened this issue Oct 4, 2023 · 1 comment

Comments

@Gaelan
Copy link

Gaelan commented Oct 4, 2023

Currently, we have:

declare function alert(message?: any): void;
declare function prompt(message?: string, _default?: string): string | null;
declare function confirm(message?: string): boolean;

Presumably alert is typed as taking any because it accepts input of any type and implicitly casts it to a string. However, testing in Chrome, Safari, and Firefox, prompt and confirm both do the same thing.

@saschanaz
Copy link
Contributor

I guess it can be string too, yeah. PRs welcome.

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

No branches or pull requests

2 participants