
import { getToastCommand } from '../common/command-component/toast';

import Toast from './toast';

type Content = string | {
  content: string;
  lineClampNum?: number | string;
};

type IHandler =  (content: Content, duration?: number, clickWrap?: (toast: ToastOptions) => void) => void;
const DEFAULT_DURATION = 1500;

type ToastOptions = {
  className: string;
  container: any;
  root: any;
  timer: any;

  init: () => void;

  show: IHandler;

  close: () => void;
};

const {
  toast,
  showToast,
} = getToastCommand(Toast, {
  defaultDuration: DEFAULT_DURATION,
});

export {
  toast,
  showToast,
};

