/**
 * 业务中间层
 * 1.用于加载SDK & 实例化真实实例对象
 * 2.解耦Proxy层与Wrapper层
 * 3.预留给业务定制逻辑
 * 4.类型适配
 */

import { AMSCashierPayment, AMSEasyPay } from "../main";
import { EConstructorName } from "./constant";
import { createBaseProxy } from "./Proxy";

// 合并接口声明,让各Wrapper既是类型又是值,模拟class

// 真实创建proxy类
var AMSCashierPaymentWrapper = createBaseProxy(EConstructorName.AMSCashierPayment);
var AMSEasyPayWrapper = createBaseProxy(EConstructorName.AMSEasyPay);
var AMSElementWrapper = createBaseProxy(EConstructorName.AMSElement);

// 由于preload是静态方法, 需要直接挂载到构造函数上，这里不进行代理直接进行调用
AMSCashierPaymentWrapper.preload = AMSCashierPayment.preload;
AMSEasyPayWrapper.preload = AMSEasyPay.preload;
export { AMSCashierPaymentWrapper, AMSEasyPayWrapper, AMSElementWrapper };