
"use client";
import { ToastPosition, ToastVariant } from "../../../types/dist/index.js";
import { ToastProps } from "./Toast.js";
import { ReactNode } from "react";
import { ToastContentProps, ToastOptions } from "react-toastify";

//#region src/components/client/Toast/createToast.d.ts
type CreateToastProps = Pick<ToastProps, 'actionButton' | 'onClickActionButton' | 'startIcon' | 'closeIcon' | 'className' | 'id'>;
type CreateToastOptions<Data = unknown> = Pick<ToastOptions, 'closeOnClick' | 'pauseOnHover' | 'containerId' | 'onClose'> & {
  data?: Data;
  position?: ToastPosition;
  autoClose?: number | false;
};
type ToastLoadingPromise = Promise<{
  result: 'success' | 'error';
  message: ReactNode;
}>;
type CreateToastData<Data = unknown> = CreateToastProps & ({
  variant: Exclude<ToastVariant, 'loading'>;
  message: ReactNode;
} | {
  variant: 'loading';
  message: ReactNode;
  promise: ToastLoadingPromise;
} | {
  variant: 'custom';
  content?: (props: Pick<ToastContentProps<Data>, 'closeToast' | 'data'>) => ReactNode;
});
type CreateToastArgs<Data = unknown> = CreateToastProps & CreateToastOptions<Data> & CreateToastData<Data>;
declare const POSTION_MAP: Record<ToastPosition, ToastOptions['position']>;
interface ToastAPI<Data = unknown> {
  update(args: Partial<CreateToastArgs<Data>>): void;
  close(): void;
}
declare function createToast<Data = unknown>(args: CreateToastArgs<Data>): ToastAPI<Data>;
//#endregion
export { POSTION_MAP, type ToastLoadingPromise, createToast };