AI Disclosure: This page was generated by an LLM and may contain inaccuracies. Hand-crafted documentation will be implemented over time on the road to 1.0
ModalAPI
Since Plugin API: 1.0.0
Modal dialog API
Signature
interface ModalAPI {
confirm(opts: {
title: string;
message: string;
confirmLabel?: string;
cancelLabel?: string;
danger?: boolean;
}): Promise<boolean>;
prompt(opts: {
title: string;
message: string;
defaultValue?: string;
placeholder?: string;
confirmLabel?: string;
cancelLabel?: string;
validate?: (value: string) => string | null | undefined | Promise<string | null | undefined>;
}): Promise<string | null>;
alert(opts: {
title: string;
message: string;
}): Promise<void>;
choose<T extends string>(opts: {
title: string;
message: string;
choices: Array<{
id: T;
label: string;
description?: string;
variant?: "primary" | "secondary" | "danger";
}>;
cancelLabel?: string;
}): Promise<T | null>;
}Members
| Name | Type | Required | Description |
|---|---|---|---|
confirm | (opts: { … }) => Promise<boolean> | yes | - |
prompt | (opts: { … }) => Promise<string | null> | yes | - |
alert | (opts: { … }) => Promise<void> | yes | - |
choose | (opts: { … }) => Promise<T | null> | yes | - |