import * as i0 from '@angular/core';
import { TemplateRef, ViewContainerRef, StaticProvider, OnInit, OnDestroy } from '@angular/core';
import * as i2 from '@acorex/cdk/common';
import { MXBaseComponent, AXComponentClosedPromise } from '@acorex/cdk/common';
import { AXComponentType, AXComponentInputs } from '@acorex/core/components';
import { Subject } from 'rxjs';
import * as i1 from '@angular/common';
import * as i3 from '@acorex/components/decorators';
import * as i4 from '@acorex/core/translation';

type AXPopupContentType = TemplateRef<unknown> | AXComponentType<unknown>;
type AXPopupSizeType = 'sm' | 'md' | 'lg' | 'full' | 'fit';
interface AXPopupConfig {
    title?: string;
    closeButton?: boolean;
    header?: boolean;
    maximizable?: boolean;
    size?: AXPopupSizeType;
    /** @deprecated Use `inputs` instead to pass data to the popup component. */
    data?: unknown;
    inputs?: unknown;
    draggable?: boolean;
    hasBackdrop?: boolean;
    backdropClass?: string;
    closeOnBackdropClick?: boolean;
    viewContainerRef?: ViewContainerRef;
    providers?: StaticProvider[];
    panelClass?: string[];
    direction?: 'rtl' | 'ltr';
}
interface AXPopupData {
    title: string;
    closeButton: boolean;
    header: boolean;
    maximizable: boolean;
    size: AXPopupSizeType;
    data?: unknown;
    draggable: boolean;
    content: AXPopupContentType;
}
interface AXPopupRef<TResult = any> {
    close: (data?: TResult) => void;
    setInputs: (values: AXComponentInputs) => void;
    setTitle: (title: string) => void;
    /** Brings this popup to the front of all other overlays */
    bringToFront: () => void;
    onClose: Subject<TResult>;
}
declare abstract class AXPopupComponentBase {
    __popup__: i0.InputSignal<AXPopupRef<any>>;
    close(data?: any): void;
    setTitle(title: string): void;
    bringToFront(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPopupComponentBase, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<AXPopupComponentBase, never, never, { "__popup__": { "alias": "__popup__"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

/**
 * The Popup is a component which displays content in a dialog overlay
 *
 * @category Components
 */
declare class AXPopupComponent extends MXBaseComponent implements OnInit, OnDestroy {
    private _zone;
    private loadingService;
    private _platform;
    private componentService;
    private contentContainerRef;
    private contentContainerEl;
    readonly __content__: i0.InputSignal<AXPopupContentType>;
    readonly __config__: i0.InputSignal<AXPopupConfig>;
    readonly __popupRef__: i0.InputSignal<AXPopupRef<any>>;
    readonly __id__: i0.InputSignal<number>;
    /**
     * Indicates whether the component is loading.
     * @defaultValue true
     */
    isLoading: boolean;
    /** @ignore */
    private _loadingId;
    /** @ignore */
    private _componentRef;
    /** Current title */
    protected title: i0.WritableSignal<string>;
    /** @ignore */
    protected isDragging: i0.WritableSignal<boolean>;
    /** @ignore */
    protected dragOffset: i0.WritableSignal<{
        x: number;
        y: number;
    }>;
    /** @ignore */
    private dragStartPos;
    /** @ignore */
    private elementStartPos;
    /** @ignore */
    ngOnInit(): void;
    /** @ignore */
    private renderContent;
    /** @ignore */
    private handleContentRendered;
    /** @ignore */
    onKeydownHandler(): void;
    /** @ignore */
    protected _handleCloseClick(): void;
    /** @ignore */
    ngOnDestroy(): void;
    /**
     * Sets focus on the `.ax-popup` element within the host element after a short delay.
     */
    focus(): void;
    /**
     * Closes the popup, emitting component reference, host element, and optional data.
     * @param {unknown} [data]
     */
    close(data?: unknown): void;
    /**
     * Sets inputs on the content component.
     * @param values - Object containing input values to set
     */
    setContentInputs(values: AXComponentInputs): void;
    /**
     * Sets the popup title.
     * @param title - The new title
     */
    setTitle(title: string): void;
    protected onDragStart(event: MouseEvent): void;
    onDragMove(event: MouseEvent): void;
    onDragEnd(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPopupComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXPopupComponent, "ax-popup", never, { "__content__": { "alias": "__content__"; "required": false; "isSignal": true; }; "__config__": { "alias": "__config__"; "required": false; "isSignal": true; }; "__popupRef__": { "alias": "__popupRef__"; "required": false; "isSignal": true; }; "__id__": { "alias": "__id__"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class AXPopupModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPopupModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXPopupModule, never, [typeof i1.CommonModule, typeof i2.AXCommonModule, typeof i3.AXDecoratorModule, typeof i4.AXTranslationModule, typeof AXPopupComponent], [typeof AXPopupComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXPopupModule>;
}

/**
 * This is a service which you can create popup with it
 *
 * @category Components
 */
declare class AXPopupService {
    private popupList;
    private overlayService;
    /**
     *  Open popup 1
     */
    open(content: AXPopupContentType, title: string): AXComponentClosedPromise;
    /**
     *  Open popup 2
     */
    open(content: AXPopupContentType, config?: AXPopupConfig): AXComponentClosedPromise;
    /**
     * Opens a popup with the specified content and configuration.
     * @param content - Component or template to display
     * @param config - Configuration options for the popup
     * @returns Promise<AXPopupRef> - Reference to the opened popup
     */
    private openInternal;
    /**
     * Closes a popup by its ID.
     * @param id - The popup ID to close
     * @param data - Optional data to pass to the close event
     */
    close<TResult = any>(id: number, data?: TResult): void;
    /**
     * Sets input values for a popup by its ID.
     * @param id - The popup ID
     * @param values - Object containing input values to set
     */
    setInputs(id: number, values: AXComponentInputs): void;
    /**
     * Sets the title for a popup by its ID.
     * @param id - The popup ID
     * @param title - The new title
     */
    setTitle(id: number, title: string): void;
    /**
     * Brings a popup to the front of all other overlays.
     * @param id - The popup ID to bring to front
     */
    bringToFront(id: number): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPopupService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXPopupService>;
}

export { AXPopupComponent, AXPopupComponentBase, AXPopupModule, AXPopupService };
export type { AXPopupConfig, AXPopupContentType, AXPopupData, AXPopupRef, AXPopupSizeType };
