import { CSSProperties } from "react";

//#region src/components/eftposPay/const.d.ts
declare enum EftposEnum {
  /** 后端支付 - 仅支付  */
  Payo = "payo",
  /** 前端支付 */
  Tyro = "tyro",
  /** 后端支付 - 支付 + 退款  */
  Windcave = "windcave",
  Stripe = "stripe",
  /** 后端支付 - 支付 + 退款  */
  Linkly = "linkly",
  /** mx51支付 - 支付 + 退款  */
  MX51 = "mx51",
  /** 汇付天下 */
  Huifu = "huifu",
  /** Adyen 刷卡机支付 */
  AdyenPos = "adyenpos",
  /** Adyen 支付宝支付 - 商家被扫模式 */
  AdyenAlipay = "adyenalipay",
  /** Adyen 微信支付 - 商家被扫模式 */
  AdyenWechat = "adyenwechat"
}
declare enum StatusEnum {
  Init = "init",
  Loading = "loading",
  Warn = "warn",
  Fail = "fail",
  Success = "success",
  Pedding = "pedding",
  Resove = "resove",
  Reject = "reject",
  Question = "question"
}
declare enum ModeEnum {
  /** 支付 */
  Pay = "pay",
  /** 完整支付 */
  FullPay = "fullPay",
  /** 退款 */
  Refund = "refund",
  /** 查询 */
  Query = "query"
}
type DeviceStatusType = `${EftposEnum}`;
interface PosProps {
  /** 厂商类型 */
  type: DeviceStatusType;
  getApi: () => {
    [key: string]: (...agrn: unknown[]) => Promise<unknown>;
  };
  params: {
    [key: string]: unknown;
  };
  /** 回调 */
  onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page' | 'print' | 'mark_tx_processed', params?: {
    [keys: string]: unknown;
  } | string, other?: any) => void;
  onChangeParams(...agrn: unknown[]): void;
  terminal: {
    network: boolean;
  };
  device?: {
    [key: string]: unknown;
  };
  mode: ModeEnum;
  tyroUrl?: string;
  tyroVersion?: string;
  source: 'normal' | 'restore';
  styles?: {
    device?: CSSProperties;
    [key: string]: CSSProperties | undefined;
  };
  isWebPos?: boolean;
}
//#endregion
export { PosProps };