PromptAPI
Constructors
new PromptAPI()
new PromptAPI(
apiInstance
):PromptAPI
Parameters
Parameter | Type |
---|---|
|
Returns
Defined in
Properties
apiInstance
readonly
apiInstance:API
Defined in
Methods
button()
button<
T
>(options
):Promise
<undefined
|T
>
Prompts the user with a modal containing a list of buttons. Returns the value of the button that was clicked, or undefined if the modal was closed.
Type Parameters
Type Parameter |
---|
|
Parameters
Parameter | Type |
---|---|
|
Returns
Promise
<undefined
| T
>
Example
Defined in
confirm()
confirm(
options
):Promise
<boolean
>
Prompts the user with a confirm/cancel dialog. Returns true if the user confirms, false if the user cancels or otherwise closes the modal.
Parameters
Parameter | Type |
---|---|
|
Returns
Promise
<boolean
>
Example
Defined in
number()
number(
options
):Promise
<undefined
|number
>
Prompts the user with a number input dialog.
Returns the value of the input field, or undefined if the user closes the modal.
While the input field is focused, the user can use enter
to submit the value and esc
to cancel and close the modal.
Parameters
Parameter | Type |
---|---|
|
Returns
Promise
<undefined
| number
>
Example
Defined in
suggester()
suggester<
T
>(options
):Promise
<undefined
|T
>
Prompts the user with a fuzzy finder suggester dialog. Returns the value of the selected option, or undefined if the user closes the modal.
Type Parameters
Type Parameter |
---|
|
Parameters
Parameter | Type |
---|---|
|
Returns
Promise
<undefined
| T
>
Example
Defined in
text()
text(
options
):Promise
<undefined
|string
>
Prompts the user with a text input dialog.
Returns the value of the input field, or undefined if the user closes the modal.
While the input field is focused, the user can use enter
to submit the value and esc
to cancel and close the modal.
Parameters
Parameter | Type |
---|---|
|
Returns
Promise
<undefined
| string
>
Example
Defined in
textarea()
textarea(
options
):Promise
<undefined
|string
>
Prompts the user with a textarea input dialog.
Returns the value of the input field, or undefined if the user closes the modal.
While the input field is focused, the user can use esc
to cancel and close the modal.
Parameters
Parameter | Type |
---|---|
|
Returns
Promise
<undefined
| string
>
Example
Defined in
yesNo()
yesNo(
options
):Promise
<undefined
|boolean
>
Prompts the user with a yes/no dialog. Returns true if the user selects yes, false if the user selects no, and undefined if the user otherwise closes the modal.
Parameters
Parameter | Type |
---|---|
|
Returns
Promise
<undefined
| boolean
>