import { ComponentPublicInstance, FunctionalComponent, VNode } from 'vue';
import { KdsButtonProps } from '../../buttons';
import { KdsModalLayoutProps, KdsModalProps } from './types';
type CommonButtonProps = {
    label: string;
    autofocus?: boolean;
    destructive?: boolean;
    variant?: KdsButtonProps["variant"];
    flushLeft?: boolean;
};
type ConfirmationButton = CommonButtonProps & {
    type: "confirm";
    customHandler?: (actions: {
        confirm: () => void;
    }) => void;
};
type CancellationButton = CommonButtonProps & {
    type: "cancel";
    customHandler?: (actions: {
        cancel: () => void;
    }) => void;
};
export type ConfirmModalButton = ConfirmationButton | CancellationButton;
type CommonConfig = Omit<KdsModalProps, "active">;
type PropertyBasedConfirmModalConfig = CommonConfig & {
    /**
     * The message displayed in the modal body
     */
    message: string;
    /**
     * The label and subText to be rendered for the "do not ask again" checkbox option.
     * The checkbox will only be present when an object is supplied. The value will be returned on the modal result.
     * Defaults to empty undefined.
     */
    doNotAskAgain?: {
        label: string;
        subText?: string;
    };
    /**
     * Confirmation or cancellation buttons if omitted default ones are set
     */
    buttons?: Array<ConfirmModalButton>;
};
type TemplateBasedConfirmModalConfig = CommonConfig & {
    /**
     * the dynamic component to be used as the confirmation modal body
     */
    component: FunctionalComponent | ComponentPublicInstance | VNode;
    /**
     * Confirmation or cancellation buttons if omitted default ones are set
     */
    buttons?: Array<ConfirmModalButton>;
};
export type KdsDynamicDialogConfirmConfig = PropertyBasedConfirmModalConfig | TemplateBasedConfirmModalConfig;
type UpdateConfigType = Partial<Omit<KdsDynamicModalTemplateConfig, "component" | "context">>;
/**
 * Define a props api which dynamic template components can optionally
 * define to get access to the configuration the dynamic modal was called with
 */
export type KdsDynamicModalPropsAPI<T = any> = KdsModalLayoutProps & {
    context: T;
    updateConfig: (config: UpdateConfigType) => void;
};
type DynamicModalComponent<T> = abstract new (...args: unknown[]) => {
    $props: KdsDynamicModalPropsAPI<T>;
};
export type KdsDynamicModalTemplateConfig<T = any> = CommonConfig & {
    component: DynamicModalComponent<T> | FunctionalComponent<KdsDynamicModalPropsAPI<T>>;
    context?: T;
};
type ConfirmResult = {
    confirmed: boolean;
    doNotAskAgain?: boolean;
};
export declare const internal: {
    confirm: (doNotAskAgain?: boolean) => void;
    close: () => void;
    isTemplateBasedConfirm: (config: KdsDynamicDialogConfirmConfig) => config is TemplateBasedConfirmModalConfig;
    onClosed: () => void;
    updateConfig: (config: UpdateConfigType) => void;
};
declare function askConfirmation(config: PropertyBasedConfirmModalConfig): Promise<ConfirmResult>;
declare function askConfirmation(config: TemplateBasedConfirmModalConfig): Promise<ConfirmResult>;
export declare const useKdsDynamicModal: () => {
    askConfirmation: typeof askConfirmation;
    showByTemplate: <T>(config: KdsDynamicModalTemplateConfig<T>) => Promise<void>;
    config: import('vue').ComputedRef<{
        type: "confirm";
        value: {
            variant?: import('./types').KdsModalVariant | undefined;
            leadingIcon?: import('../..').KdsIconName | undefined;
            headline?: string | undefined;
            height?: import('./types').KdsModalHeight | undefined;
            width?: import('./types').KdsModalWidth | undefined;
            overflow?: "hidden" | "auto" | "visible" | undefined;
            closedby?: import('./types').KdsModalClosedBy | undefined;
            message: string;
            doNotAskAgain?: {
                label: string;
                subText?: string | undefined;
            } | undefined;
            buttons?: ({
                label: string;
                autofocus?: boolean | undefined;
                destructive?: boolean | undefined;
                variant?: import('../..').KdsButtonVariant | undefined;
                flushLeft?: boolean | undefined;
                type: "confirm";
                customHandler?: ((actions: {
                    confirm: () => void;
                }) => void) | undefined;
            } | {
                label: string;
                autofocus?: boolean | undefined;
                destructive?: boolean | undefined;
                variant?: import('../..').KdsButtonVariant | undefined;
                flushLeft?: boolean | undefined;
                type: "cancel";
                customHandler?: ((actions: {
                    cancel: () => void;
                }) => void) | undefined;
            })[] | undefined;
        } | {
            variant?: import('./types').KdsModalVariant | undefined;
            leadingIcon?: import('../..').KdsIconName | undefined;
            headline?: string | undefined;
            height?: import('./types').KdsModalHeight | undefined;
            width?: import('./types').KdsModalWidth | undefined;
            overflow?: "hidden" | "auto" | "visible" | undefined;
            closedby?: import('./types').KdsModalClosedBy | undefined;
            component: FunctionalComponent | ComponentPublicInstance | VNode;
            buttons?: ({
                label: string;
                autofocus?: boolean | undefined;
                destructive?: boolean | undefined;
                variant?: import('../..').KdsButtonVariant | undefined;
                flushLeft?: boolean | undefined;
                type: "confirm";
                customHandler?: ((actions: {
                    confirm: () => void;
                }) => void) | undefined;
            } | {
                label: string;
                autofocus?: boolean | undefined;
                destructive?: boolean | undefined;
                variant?: import('../..').KdsButtonVariant | undefined;
                flushLeft?: boolean | undefined;
                type: "cancel";
                customHandler?: ((actions: {
                    cancel: () => void;
                }) => void) | undefined;
            })[] | undefined;
        };
    } | {
        type: "dynamic";
        value: {
            variant?: import('./types').KdsModalVariant | undefined;
            leadingIcon?: import('../..').KdsIconName | undefined;
            headline?: string | undefined;
            height?: import('./types').KdsModalHeight | undefined;
            width?: import('./types').KdsModalWidth | undefined;
            overflow?: "hidden" | "auto" | "visible" | undefined;
            closedby?: import('./types').KdsModalClosedBy | undefined;
            component: DynamicModalComponent<any> | FunctionalComponent<KdsDynamicModalPropsAPI<any>, {}, any, {}>;
            context?: any;
        };
    } | null>;
    isActive: import('vue').ComputedRef<boolean>;
    close: () => void;
};
export {};
//# sourceMappingURL=useKdsDynamicModal.d.ts.map