import { AXStyleColorType, MXBaseComponent } from '@acorex/cdk/common';
import { ComponentType, Portal, CdkPortalOutletAttachedRef } from '@angular/cdk/portal';
import * as i0 from '@angular/core';
import { TemplateRef, OnInit, OnDestroy } from '@angular/core';
import * as rxjs from 'rxjs';
import { Subject } from 'rxjs';

interface AXActionSheetItem {
    name?: string;
    text: string;
    icon?: string;
    disabled?: boolean;
    color?: AXStyleColorType;
    onClick?: () => void;
    suffix?: {
        text: string;
    };
    break?: boolean;
    group?: {
        name?: string;
        title?: string;
    };
}
type AXActionSheetContentType = TemplateRef<unknown> | ComponentType<unknown>;
interface AXActionSheetConfig {
    title?: string;
    subTitle?: string;
    closeButton?: boolean;
    header?: boolean;
    data?: unknown;
    closeOnBackdropClick?: boolean;
    items?: AXActionSheetItem[];
    content?: AXActionSheetContentType;
    draggable?: boolean;
    dragUp?: boolean;
}
interface AXActionSheetEvent {
    dialogRef: any;
    nativeEvent?: Event;
    isUserInteraction: boolean;
    data: {
        state: 'open' | 'close' | 'dragStart' | 'dragEnd' | 'fullScreen' | 'normalSize';
    };
}

/**
 * A component for displaying an action sheet, which is a menu that slides up from the bottom of the screen.
 *
 * @category Components
 */
declare class AXActionSheetComponent extends MXBaseComponent implements OnInit, OnDestroy {
    protected data: AXActionSheetConfig;
    private dialogRef;
    private document;
    private platformID;
    private renderer;
    private actionSheetService;
    private onMouseMoveListenerFn;
    private onMouseUpListenerFn;
    private onTouchMoveListenerFn;
    private onTouchUpListenerFn;
    private isDragging;
    private isFullScreen;
    private curserOffset;
    private actionSheetHeight;
    private isActionSheetHeightSet;
    private transitionDuration;
    /**
     *  @ignore
     */
    protected _selectedPortal: Portal<any>;
    /**
     *  @ignore
     */
    private _componentRef;
    /**
     *  @ignore
     */
    ngOnInit(): void;
    ngOnDestroy(): void;
    protected handleMouseDown(e: MouseEvent): void;
    protected handleTouchDown(e: TouchEvent): void;
    private handleDown;
    private snapToFinalPosition;
    private heightCalculator;
    protected handleAttched(ref: CdkPortalOutletAttachedRef): void;
    /**
     * Handles click events on action sheet items.
     * This method is called when a user clicks on an action sheet item. It closes the action sheet
     * with the clicked item as the result data and executes the item's onClick callback if provided.
     *
     * @param item - The action sheet item that was clicked. Contains the item's data and optional onClick callback.
     * @returns void
     */
    onItemClick(item: AXActionSheetItem): void;
    /**
     * Closes the action sheet with optional result data.
     * This method initiates the closing animation of the action sheet and eventually closes the dialog.
     * The closing process includes a height animation and cleanup of event listeners.
     *
     * @param e - The result data to pass when closing the action sheet. Can be any value including null.
     *            If an AXActionSheetItem is passed, it represents the selected item.
     * @param isUserInteraction - Whether the close action was triggered by user interaction (default: true).
     *                           This affects how the action sheet handles accessibility and event tracking.
     * @returns void
     */
    close(e?: any, isUserInteraction?: boolean): void;
    /**
     *  @ignore
     */
    protected onKeydownHandler(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXActionSheetComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXActionSheetComponent, "ax-action-sheet", never, {}, {}, never, never, true, never>;
}

declare class AXActionSheetModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXActionSheetModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXActionSheetModule, never, [typeof AXActionSheetComponent], [typeof AXActionSheetComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXActionSheetModule>;
}

interface AXActionSheetDialogRef {
    close: (e?: any) => void;
    closed: Subject<any>;
}
declare class AXActionSheetService {
    private dialog;
    private readonly actionSheetEvent;
    actionSheetEvent$: rxjs.Observable<AXActionSheetEvent>;
    /**
     * Opens an action sheet with the specified configuration.
     * This method creates and displays an action sheet component with the provided options.
     * The action sheet will slide up from the bottom of the screen and can be dismissed
     * by tapping outside, pressing escape, or calling the close method.
     *
     * @param config - The configuration object that defines the action sheet's appearance and behavior.
     *                 Must include at least a title or content property. Will be merged with default config.
     * @param isUserInteraction - Whether the action sheet is opened by user interaction (default: true).
     *                           This affects how the action sheet handles accessibility and focus management.
     * @returns A promise that resolves to a dialog reference containing methods to control the action sheet.
     *          The reference includes methods like close() and a closed observable for tracking dialog state.
     * @example
     * ```typescript
     * const dialogRef = await actionSheetService.open({
     *   title: 'Choose an option',
     *   items: [
     *     { text: 'Option 1', value: 'opt1' },
     *     { text: 'Option 2', value: 'opt2' }
     *   ]
     * });
     *
     * dialogRef.closed.subscribe(result => {
     *   console.log('Action sheet closed with:', result.data);
     * });
     * ```
     */
    open(config: AXActionSheetConfig, isUserInteraction?: boolean): Promise<AXActionSheetDialogRef>;
    /**
     * Sets the current state of action sheet events.
     * This method is used internally to track action sheet lifecycle events such as open, close,
     * drag start, drag end, and full screen transitions. It emits events through the actionSheetEvent$
     * observable for external subscribers to monitor action sheet state changes.
     *
     * @param event - The action sheet event to emit. Contains information about the event type,
     *               associated data, user interaction status, and dialog reference.
     * @returns void
     */
    setActionSheetEventState(event: AXActionSheetEvent): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXActionSheetService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXActionSheetService>;
}

export { AXActionSheetComponent, AXActionSheetModule, AXActionSheetService };
export type { AXActionSheetConfig, AXActionSheetContentType, AXActionSheetDialogRef, AXActionSheetEvent, AXActionSheetItem };
