import { RenderFunction } from 'vue';

export declare const DEFAULT_TIMEOUT = 5000;

declare enum StatusSeverities {
    Error = "error",
    Warning = "warning",
    Info = "info",
    Success = "success"
}

declare type StatusSeverity = `${StatusSeverities}`;

export declare type Toast = {
    id: string;
    text: string | RenderFunction;
    status: StatusSeverity;
    offsetTop?: string;
};

declare type ToastIdOrUndefined<O extends ToastOptions | undefined> = O extends {
    id: string;
} ? Toast['id'] | undefined : Toast['id'];

export declare interface ToastOptions {
    /**
     * The timeout in milliseconds before the toast is automatically dismissed. If set to `false`, the toast will persist until the user clicks on it.
     * @default DEFAULT_TIMEOUT
     */
    timeout?: number | boolean;
    /**
     * A group name ensures only one toast with the same group and status is visible at any given time.
     * Toasts with the same group but different statuses will be treated as separate and will display concurrently.
     */
    group?: string;
    /**
     * The container distance from the top of the viewport.
     */
    offsetTop?: string;
}

declare function useToasts(globalOptions?: Omit<ToastOptions, 'group'>): {
    active: readonly {
        readonly id: string;
        readonly text: string | RenderFunction;
        readonly status: StatusSeverity;
        readonly offsetTop?: string | undefined;
    }[];
    remove: {
        (toastId: Toast["id"]): void;
        (options: {
            group: string;
            status: StatusSeverity;
        }): void;
    };
    create: {
        (text: Toast["text"], status: StatusSeverity, options?: Omit<ToastOptions, "group">): Toast["id"];
        (text: Toast["text"], status: StatusSeverity, options: ToastOptions & {
            id: string;
        }): Toast["id"] | undefined;
    };
    removeAll: () => void;
    error: <O extends ToastOptions>(text: Toast["text"], options?: O) => ToastIdOrUndefined<O>;
    info: <O extends ToastOptions>(text: Toast["text"], options?: O) => ToastIdOrUndefined<O>;
    success: <O extends ToastOptions>(text: Toast["text"], options?: O) => ToastIdOrUndefined<O>;
    warning: <O extends ToastOptions>(text: Toast["text"], options?: O) => ToastIdOrUndefined<O>;
};
export default useToasts;

export { }
