Skip to content

Commit

Permalink
fix(prompt): correct type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed Sep 16, 2020
1 parent e368eff commit 749c3d8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
21 changes: 0 additions & 21 deletions cli/dts/lib.deno.shared_globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1532,24 +1532,3 @@ declare var WebSocket: {
};

type BinaryType = "arraybuffer" | "blob";

/**
* Shows the given message and waits for the enter key pressed.
* @param message
*/
declare function alert(message?: string): void;

/**
* Shows the given message and waits for the answer. Returns the user's answer as boolean.
* @param message
*/
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
* default value.
* @param message
* @param defaultValue
*/
declare function prompt(message?: string, defaultValue?: string): string | null;
21 changes: 21 additions & 0 deletions cli/dts/lib.deno.window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,25 @@ declare const self: Window & typeof globalThis;
declare const onload: ((this: Window, ev: Event) => any) | null;
declare const onunload: ((this: Window, ev: Event) => any) | null;

/**
* Shows the given message and waits for the enter key pressed.
* @param message
*/
declare function alert(message?: string): void;

/**
* Shows the given message and waits for the answer. Returns the user's answer as boolean.
* @param message
*/
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
* default value.
* @param message
* @param defaultValue
*/
declare function prompt(message?: string, defaultValue?: string): string | null;

/* eslint-enable @typescript-eslint/no-explicit-any */

0 comments on commit 749c3d8

Please sign in to comment.