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 Oct 12, 2020
1 parent c3b0b8d commit b582991
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 @@ -977,24 +977,3 @@ declare class WebSocket extends EventTarget {
}

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 @@ -26,4 +26,25 @@ declare var self: Window & typeof globalThis;
declare var onload: ((this: Window, ev: Event) => any) | null;
declare var 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 b582991

Please sign in to comment.