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
Show file tree
Hide file tree
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
fix: address further issues
  • Loading branch information
kt3k committed Oct 12, 2020
commit c3b0b8d13bf045c1ab3e1db9c3f66127a1285467
2 changes: 1 addition & 1 deletion cli/dts/lib.deno.shared_globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,4 +997,4 @@ declare function confirm(message?: string): boolean;
* @param message
* @param defaultValue
*/
declare function prompt(message?: string, defaultValue?: string): string;
declare function prompt(message?: string, defaultValue?: string): string | null;
2 changes: 1 addition & 1 deletion cli/dts/lib.deno.window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare class Window extends EventTarget {
readonly closed: boolean;
alert: (message?: string) => void;
confirm: (message?: string) => boolean;
prompt: (message?: string, defaultValue?: string) => string;
prompt: (message?: string, defaultValue?: string) => string | null;
Deno: typeof Deno;
}

Expand Down
2 changes: 1 addition & 1 deletion cli/rt/41_prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
defaultValue ??= null;

if (!isatty(stdin.rid)) {
return defaultValue;
return null;
}

stdout.writeSync(encoder.encode(`${message} `));
Expand Down