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

feat: add alert, confirm, and prompt #7507

Merged
merged 6 commits into from
Oct 13, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(prompt): add documents of irregular cases
  • Loading branch information
kt3k committed Oct 12, 2020
commit 190b47ca8c8c2b572eeb323530d769a54e8cb0cc
4 changes: 4 additions & 0 deletions cli/dts/lib.deno.window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ declare var onunload: ((this: Window, ev: Event) => any) | null;

/**
* Shows the given message and waits for the enter key pressed.
* If the stdin is not interactive, it does nothing.
* @param message
*/
declare function alert(message?: string): void;

/**
* Shows the given message and waits for the answer. Returns the user's answer as boolean.
* If the stdin is not interactive, it returns false.
* @param message
*/
declare function confirm(message?: string): boolean;
Expand All @@ -42,6 +44,8 @@ declare function confirm(message?: string): boolean;
* Shows the given message and waits for the user's input. Returns the user's input as string.
* If the default value is given and the user inputs the empty string, then it returns the given
bartlomieju marked this conversation as resolved.
Show resolved Hide resolved
* default value.
* If the default value is not given and the user inputs the empty string, it returns null.
* If the stdin is not interactive, it returns null.
* @param message
* @param defaultValue
*/
Expand Down