import type { AltEditorLiteLanguage } from '../core/alt-editor-lite-language.js'; import type { BeforeCloseReason } from '../core/alt-editor-lite-options.js'; /** * Callbacks owned by the editor while an operation dialog is open. */ export interface EditorDialogCallbacks { readonly onSubmit: () => void; readonly onRequestClose: (reason: BeforeCloseReason) => void; } /** * Native dialog controller used by an editor instance. */ export declare class EditorDialog { private readonly focusScope; private readonly shell; private callbacks; private formElement; private isBusy; private isDestroyed; private isSubmitAvailable; /** * Creates and attaches one reusable native dialog element. * * @param focusFallback - Host element used when the opening target disappears. * @param instanceId - Instance-scoped DOM prefix. * @param language - Complete resolved language. * @param className - Optional consumer classes for the dialog element. */ constructor(focusFallback: HTMLElement, instanceId: string, language: Readonly, className?: string); /** * Shows populated form content modally and establishes initial focus. * * @param formElement - Owned Create or Edit form. * @param title - Plain-text dialog title. * @param submitLabel - Plain-text primary action label. * @param callbacks - Submit and close request callbacks. */ openForm(formElement: HTMLFormElement, title: string, submitLabel: string, callbacks: EditorDialogCallbacks): void; /** * Shows Remove confirmation content without creating a FormController. * * @param contentElement - Owned plain-text confirmation content. * @param title - Plain-text dialog title. * @param submitLabel - Plain-text destructive action label. * @param callbacks - Confirm and close request callbacks. */ openConfirmation(contentElement: HTMLElement, title: string, submitLabel: string, callbacks: EditorDialogCallbacks): void; private configureOpenContent; private showConfiguredContent; /** * Prevents repeated submission and non-programmatic closure. * * @param isBusy - Whether an operation owns the dialog. */ setBusy(isBusy: boolean): void; /** * Controls whether the primary action can retry after a failure. * * @param isAvailable - Whether retrying can be meaningful. */ setSubmitAvailable(isAvailable: boolean): void; /** * Displays an operation-level error in the dialog alert region. * * @param message - Plain-text error message. */ showError(message: string): void; /** * Clears the operation-level alert region. */ clearError(): void; /** * Moves focus to the first field currently marked invalid. */ focusInvalidField(): void; /** Restores focus inside the active dialog after a close request is declined. */ ensureFocus(): void; /** * Closes the native dialog and restores the opening trigger. */ close(): void; /** * Removes all owned listeners and DOM. Repeated calls are harmless. */ destroy(): void; private detachForm; private readonly handleSubmit; private readonly handleConfirmation; private readonly handleCancelClick; private readonly handleNativeCancel; }