@@ -63,9 +63,28 @@ export interface InputPromptOptions extends ModalPromptOptions {
6363 */
6464 content ?: string ;
6565 /**
66- * The placeholder text for the input field.
66+ * The placeholder text for the input field. This will show when the input field is empty.
6767 */
6868 placeholder ?: string ;
69+ /**
70+ * The initial value of the input field that is pre-filled when the modal is opened.
71+ */
72+ initialValue ?: string ;
73+ }
74+
75+ export interface NumberInputPromptOptions extends ModalPromptOptions {
76+ /**
77+ * Text content to display in the modal.
78+ */
79+ content ?: string ;
80+ /**
81+ * The placeholder text for the input field. This will show when the input field is empty.
82+ */
83+ placeholder ?: string ;
84+ /**
85+ * The initial value of the input field that is pre-filled when the modal is opened.
86+ */
87+ initialValue ?: number ;
6988}
7089
7190export class PromptAPI {
@@ -225,6 +244,7 @@ export class PromptAPI {
225244 /**
226245 * Prompts the user with a text input dialog.
227246 * Returns the value of the input field, or undefined if the user closes the modal.
247+ * While the input field is focused, the user can use `enter` to submit the value and `esc` to cancel and close the modal.
228248 *
229249 * @example
230250 * ```typescript
@@ -263,6 +283,7 @@ export class PromptAPI {
263283 /**
264284 * Prompts the user with a textarea input dialog.
265285 * Returns the value of the input field, or undefined if the user closes the modal.
286+ * While the input field is focused, the user can use `esc` to cancel and close the modal.
266287 *
267288 * @example
268289 * ```typescript
@@ -302,6 +323,7 @@ export class PromptAPI {
302323 /**
303324 * Prompts the user with a number input dialog.
304325 * Returns the value of the input field, or undefined if the user closes the modal.
326+ * While the input field is focused, the user can use `enter` to submit the value and `esc` to cancel and close the modal.
305327 *
306328 * @example
307329 * ```typescript
@@ -313,7 +335,7 @@ export class PromptAPI {
313335 * });
314336 * ```
315337 */
316- public number ( options : InputPromptOptions ) : Promise < number | undefined > {
338+ public number ( options : NumberInputPromptOptions ) : Promise < number | undefined > {
317339 return new Promise < number | undefined > ( ( resolve , reject ) => {
318340 try {
319341 new SvelteModal < AnySvelteComponent , unknown > (
0 commit comments