import invoker,{PLATFORM_TYPE_ENUM}from"./invoker";invoker.registerAPI("subscribe",{mobile:function(e,o){var n=o.resolve,s=o.reject,r=o.context,i=o.containerType,c=o.platformType,u=!1;if(i){c===PLATFORM_TYPE_ENUM.ANDROID?r&&r((function(o){u?(e.onSuccess||e.onFail)&&("0"!==o.errorCode?e.onFail&&e.onFail(o):e.onSuccess&&e.onSuccess(o.result)):(u=!0,invoker.handleBridgeResponse(o,n,s))}),(function(o){u?e.onFail&&e.onFail(o):(u=!0,invoker.handleBridgeResponse(o,n,s))}),"taurus.common","subscribe",e):c===PLATFORM_TYPE_ENUM.IOS&&r.callHandler("taurus.common.subscribe",Object.assign({},e),(function(o){u?(e.onSuccess||e.onFail)&&("0"!==o.errorCode?e.onFail&&e.onFail(o):e.onSuccess&&e.onSuccess(o.result)):(u=!0,invoker.handleBridgeResponse(o,n,s))}))}else r&&r.call("subscribe",e,(function(o){u?(e.onSuccess||e.onFail)&&("0"!==o.errorCode?e.onFail&&e.onFail(o):e.onSuccess&&e.onSuccess(o.result)):(u=!0,invoker.handleBridgeResponse(o,n,s))}))}}),subscribe.version={android:"1.6.0",ios:"1.6.0"};export default function subscribe(e){return invoker.invoke("subscribe",e)}