import type { IPortalElementProps } from '../../Primitives/Portal/IPortalElementProps';
import type { PortalProjectionElement } from '../../Primitives/Portal/PortalProjectionElement';
import { DialogElement } from './DialogElement';
import type { IDialogElementProps } from './IDialogElementProps';
import { type IDialogServiceConfig, type IDialogBehavior } from './IDialogServiceConfig';
/**
 * CSS class name applied to dialogs that are stacked (have another dialog on top).
 *
 * @public
 */
export declare const DIALOG_STACKED_CLASS = "stacked";
/**
 * Function type for resolving dialog results.
 *
 * @public
 */
export type DialogResolveFunction = (result: unknown) => void;
/**
 * Represents the `IDialogRef` interface.
 *
 * @public
 */
export interface IDialogRef {
    readonly dialogId: string;
    readonly dialogElement: DialogElement;
    readonly portalProjectionElement: PortalProjectionElement;
    readonly wrapperElement: HTMLElement;
    readonly stackLevel: number;
    readonly computedWidth: string;
    readonly computedHeight: string;
    readonly options?: IDialogOptions;
    resolve?: DialogResolveFunction;
}
/**
 * Represents the properties of a dialog element.
 *
 * @public
 */
export interface IDialogOptions extends Partial<IDialogElementProps>, Partial<IPortalElementProps> {
    /**
     * Whether to close the dialog when navigating away.
     */
    navigateToClose?: boolean;
    /**
     * Enable stack mode for this dialog.
     * When enabled, the dialog size will be calculated based on its position in the stack.
     */
    enableStack?: boolean;
    /**
     * Override the base width for this specific dialog in the stack.
     * If not provided, uses the service's stack configuration.
     */
    stackBaseWidth?: string;
    /**
     * Override the base height for this specific dialog in the stack.
     * If not provided, uses the service's stack configuration.
     */
    stackBaseHeight?: string;
}
/**
 * Service for managing the display and behavior of dialog elements.
 * Provides methods to open and close dialog elements within a portal structure.
 * Supports extensible behavior pattern for customizing dialog interactions.
 *
 * @example
 * ```typescript
 * // Configure service globally before use
 * DialogService.configure({
 *     behaviors: [withDialogStackBehavior({ baseWidth: '80%', baseHeight: '60%' })],
 *     closeOnNavigation: true
 * });
 *
 * // Use the singleton instance
 * const result = await DialogService.instance.open('myDialog', MyDialogWrapper, options);
 * ```
 *
 * @public
 */
export declare class DialogService {
    private static _instance;
    private static _config;
    private static _isConfigured;
    private readonly _dialogMap;
    private readonly _dialogStack;
    private readonly _behaviors;
    private _portalElement?;
    /**
     * Constructs a new instance of the `DialogService` class.
     * Use {@link DialogService.instance} to access the singleton instance.
     *
     * @private
     */
    private constructor();
    /**
     * Returns the singleton instance of the DialogService.
     * Creates the instance on first access using the current configuration.
     *
     * @public
     * @readonly
     */
    static get instance(): DialogService;
    /**
     * Returns the current number of open dialogs in the stack.
     *
     * @public
     * @readonly
     */
    get stackSize(): number;
    /**
     * Returns an array of all dialog references in stack order (oldest first).
     *
     * @public
     * @readonly
     */
    get stack(): ReadonlyArray<IDialogRef>;
    /**
     * Returns the registered behaviors for this service instance.
     *
     * @public
     * @readonly
     */
    get behaviors(): ReadonlyArray<IDialogBehavior>;
    /**
     * Configures the dialog service globally.
     * Must be called before accessing the singleton instance.
     *
     * @public
     * @static
     * @param config - Configuration options for the dialog service.
     * @returns The DialogService class for chaining.
     * @throws Error if called after the instance has already been created.
     *
     * @example
     * ```typescript
     * DialogService.configure({
     *     behaviors: [withDialogStackBehavior({ baseWidth: '80%' })],
     *     closeOnNavigation: true
     * });
     * ```
     */
    static configure(config: Partial<IDialogServiceConfig>): typeof DialogService;
    /**
     * Opens a custom wrapper component containing a dialog within a portal.
     *
     * @public
     * @template T - Type of the wrapper component extending HTMLElement.
     * @template TResult - Expected return type of the resolved dialog result.
     * @param dialogId - Unique identifier for the dialog instance.
     * @param wrapperClass - Class of the wrapper component containing the dialog.
     * @param options - Properties for portal and dialog.
     * @returns A promise resolving with the dialog result.
     */
    open<T extends HTMLElement, TResult>(dialogId: string, wrapperClass: new () => T, options?: IDialogOptions): Promise<TResult>;
    /**
     * Opens a custom wrapper component containing a dialog within a portal.
     *
     * @public
     * @template T - Type of the wrapper component extending HTMLElement.
     * @template TData - Type of data provided to the wrapper component.
     * @template TResult - Expected return type of the resolved dialog result.
     * @param dialogId - Unique identifier for the dialog instance.
     * @param wrapperClass - Class of the wrapper component containing the dialog.
     * @param data - Data passed to the wrapper component.
     * @param options - Properties for portal and dialog.
     * @returns A promise resolving with the dialog result.
     */
    open<T extends HTMLElement, TData, TResult>(dialogId: string, wrapperClass: new (args: TData) => T, data: TData, options?: IDialogOptions): Promise<TResult>;
    /**
     * Closes the dialog in the wrapper component and optionally removes the wrapper from the DOM.
     *
     * @public
     * @template TResult - Type of result returned when the dialog is closed.
     * @param dialogId - Unique identifier for the dialog instance.
     * @param result - Optional result returned when closing the dialog.
     * @returns A promise resolving once the dialog is fully closed.
     */
    close<TResult>(dialogId: string, result?: TResult): Promise<void>;
    /**
     * Closes the topmost dialog in the stack.
     *
     * @public
     * @template TResult - Type of result returned when the dialog is closed.
     * @param result - Optional result returned when closing the dialog.
     * @returns A promise resolving once the dialog is fully closed.
     */
    closeTop<TResult>(result?: TResult): Promise<void>;
    /**
     * Closes all open dialogs in the stack, from top to bottom.
     *
     * @public
     * @returns A promise resolving once all dialogs are closed.
     */
    closeAll(): Promise<void>;
    /**
     * Creates a new dialog reference.
     *
     * @private
     */
    private createDialogRef;
    /**
     * Extends the dialog component by placing it within a portal structure.
     *
     * @private
     * @param element - The element to place within the portal.
     * @param props - Properties to set on the portal.
     * @returns The created PortalElement containing the dialog.
     */
    private extendToPortal;
}
//# sourceMappingURL=DialogService.d.ts.map