import { StandardKeyboardEvent } from "../../keyboardEvent.js"; import { IButton, IButtonStyles, IButtonWithDropdownOptions } from "../button/button.js"; import { ICheckboxStyles } from "../toggle/toggle.js"; import { IInputBoxStyles } from "../inputbox/inputBox.js"; import { ThemeIcon } from "../../../common/themables.js"; import { Disposable } from "../../../common/lifecycle.js"; export interface IDialogInputOptions { readonly placeholder?: string; readonly type?: "text" | "password"; readonly value?: string; } export declare enum DialogContentsAlignment { /** * Dialog contents align from left to right (icon, message, buttons on a separate row). * * Note: this is the default alignment for dialogs. */ Horizontal = 0, /** * Dialog contents align from top to bottom (icon, message, buttons stack on top of each other) */ Vertical = 1 } export interface IDialogOptions { readonly cancelId?: number; readonly detail?: string; /** * A pre-rendered element to show in place of the plain-text {@link detail}. * Used to present rich detail content (e.g. rendered Markdown) since this * base widget has no Markdown rendering capability of its own. Takes * precedence over {@link detail} when both are provided. Any `` element * within is made keyboard-focusable and participates in tab order like * links rendered via {@link renderBody}. */ readonly detailElement?: HTMLElement; readonly alignment?: DialogContentsAlignment; readonly checkboxLabel?: string; readonly checkboxChecked?: boolean; readonly type?: "none" | "info" | "error" | "question" | "warning" | "pending"; readonly extraClasses?: string[]; /** Classes to add to the full-window modal blocker. */ readonly modalBlockExtraClasses?: string[]; readonly inputs?: IDialogInputOptions[]; readonly keyEventProcessor?: (event: StandardKeyboardEvent) => void; readonly renderBody?: (container: HTMLElement) => void; readonly renderFooter?: (container: HTMLElement) => void; readonly icon?: ThemeIcon; /** Renders an icon of the owner's, such as an app's image, in place of {@link icon} and the {@link type}'s codicon. */ readonly renderIcon?: (container: HTMLElement) => void; readonly buttonOptions?: Array void; }>; readonly primaryButtonDropdown?: IButtonWithDropdownOptions; readonly disableCloseAction?: boolean; readonly disableCloseButton?: boolean; readonly disableDefaultAction?: boolean; /** * Temporary escape hatch for dialogs that embed widgets whose popups mount * at window root (outside the dialog DOM). Needed because the focus trap * would otherwise immediately reclaim focus from context views and pickers. * See https://github.com/microsoft/vscode/issues/323920 for removal plan. */ readonly isExternalFocusAllowed?: (relatedTarget: HTMLElement) => boolean; readonly onVisibilityChange?: (window: Window, visible: boolean) => void; readonly buttonStyles: IButtonStyles; readonly checkboxStyles: ICheckboxStyles; readonly inputBoxStyles: IInputBoxStyles; readonly dialogStyles: IDialogStyles; } export interface IDialogResult { readonly button: number; readonly checkboxChecked?: boolean; readonly values?: string[]; } export interface IDialogStyles { readonly dialogForeground: string | undefined; readonly dialogBackground: string | undefined; readonly dialogShadow: string | undefined; readonly dialogBorder: string | undefined; readonly errorIconForeground: string | undefined; readonly warningIconForeground: string | undefined; readonly infoIconForeground: string | undefined; readonly textLinkForeground: string | undefined; } export declare class Dialog extends Disposable { private container; private message; private readonly options; private readonly element; private readonly shadowElement; private modalElement; private readonly buttonsContainer; private readonly messageDetailElement; private readonly messageContainer; private readonly footerContainer; private footerActionToFocus; private readonly iconElement; private readonly checkbox; private readonly toolbarContainer; private buttonBar; private focusToReturn; private readonly inputs; private readonly buttons; private readonly buttonStyles; constructor(container: HTMLElement, message: string, buttons: string[] | undefined, options: IDialogOptions); private getIconAriaLabel; updateMessage(message: string): void; show(): Promise; private applyStyles; dispose(): void; private rearrangeButtons; }