import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
import { UntypedFormGroup, ValidatorFn } from '@angular/forms';
import { ButtonType } from '../../controls/button/button.component';
import { TextboxType } from '../../controls/textbox/textbox.component';
import { DialogContent } from '../dialog/dialog-content';
import { Overlay } from '../view-overlay/view-overlay.component';
import * as i0 from "@angular/core";
type SaveSource = 'primary' | 'alternate';
export type CustomActionResult = {
    message: string;
    isSuccess: boolean;
};
export declare class ConfirmDialogContext {
    /** Id to distinguish between confirm component contexts emitted by the dialog service */
    id: string;
    /** Optional title of the confirm */
    title?: string;
    /** Optional message */
    message?: string;
    /** Optional checkConfirm
     * this will determine if ec-checkbox is available or no
     * in order to delete or move to no parent the entity
     */
    checkConfirm?: boolean;
    /**
     * checkboxContent
     * Determine the label next to the checkbox
     * if checkConfirm is true otherwise is not visible
     */
    checkboxText?: string;
    /**
     * Optional textbox type, this will determine whether
     * an input is visible or not
     */
    textboxType?: TextboxType;
    /** Optional textbox label */
    textboxLabel?: string;
    /**
     * Optional required flag for the textbox, will set
     * a validator on the input if true
     */
    textboxRequired?: boolean;
    /** Optional array of validators to add to the textbox form control. */
    textboxValidators?: ValidatorFn[];
    /** Sets the textbox's uppercase parameter */
    textboxUppercase?: boolean;
    /**
     * Optional textbox height (in rows).
     * Only applies to multi-line type.
     * Default 3.
     */
    textareaRows?: number;
    /** Optional textbox placeholder text */
    textboxPlaceholder?: string;
    /** Optional error message to display when textbox */
    validationErrorMessage?: string;
    /** Value returned from the input if enabled */
    textboxValue?: string;
    checkboxValue?: boolean;
    confirmLabel?: string;
    /** Optional save button label */
    saveLabel?: string;
    /** Optional save button type */
    saveButtonType?: ButtonType;
    /** Optional cancel button label */
    cancelLabel?: string;
    /** Optional flag for hiding the cancel (secondary) button */
    hideCancel?: boolean;
    /** When true, adds the submit tag to the save button so hitting enter triggers the save */
    saveOnEnter?: boolean;
    /** Optional alternate save button label */
    alternateSaveLabel?: string;
    /** Optional alternate save button type */
    alternateSaveButtonType?: ButtonType;
    /**
     * Used to know which save button was selected in case the calling component
     * is utilizing the alternate save button
     */
    saveSource?: SaveSource;
    /**
     * When provided, the confirm will show a pending state and call this, then upon
     * completion display the result message and a close button. If the promise is resolved
     * successfully, the close button will emit onDialogSave. If the promise is rejected,
     * the close button will emit onDialogCancel.
     */
    inlineConfirmAction?: () => Promise<CustomActionResult>;
    /** The message to be displayed while inlineConfirmAction is pending. */
    inlineConfirmPendingMessage?: string;
}
export declare class ConfirmComponent implements OnInit, DialogContent<ConfirmDialogContext>, OnDestroy {
    dialogId: string;
    /** Form Group to hold any form controls needed */
    formGroup: UntypedFormGroup;
    status: Overlay;
    showTextBox: boolean;
    private destroyed;
    /**
     * Provided by the calling component to tell the confirm what to show
     * and is used on save to send back any entered values from the user
     */
    context: ConfirmDialogContext;
    onDialogSave: EventEmitter<ConfirmDialogContext>;
    onDialogCancel: EventEmitter<void>;
    onOpen(openContext?: ConfirmDialogContext): void;
    /** Error to be displayed in the error banner */
    error?: string;
    constructor();
    ngOnInit(): void;
    onSave(source: SaveSource): void;
    onCancel(): void;
    ngOnDestroy(): void;
    listenCheckBox(): void;
    private setValidations;
    /**
     * Adds the textbox form control to our form group if its configured to be visible
     * Will also add the required validator if requested
     */
    private addFormControls;
    private doInlineConfirmAction;
    static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmComponent, "ec-confirm", never, { "context": { "alias": "context"; "required": false; }; }, { "onDialogSave": "onDialogSave"; "onDialogCancel": "onDialogCancel"; }, never, never, false, never>;
}
export {};
