import invoker,{CONTINUOUS_EVENT_LIST,PLATFORM_TYPE_ENUM}from"./invoker";function startShakeHandler(e,t){var n=t.resolve,a=t.reject,r=t.context,o=t.containerType,s=t.platformType,c=invoker.registerEvent(CONTINUOUS_EVENT_LIST.ON_SHAKE,(function(){e.onSuccess&&e.onSuccess()}));if(o){s===PLATFORM_TYPE_ENUM.ANDROID?r&&r((function(t){e.onSuccess&&e.onSuccess(),n()}),(function(e){a()}),"taurus.common","startWatchShake",e):s===PLATFORM_TYPE_ENUM.IOS&&r.callHandler("taurus.common.startWatchShake",Object.assign({},e),(function(e){n()}))}else r&&r.call("startWatchShake",e,(function(e){invoker.registerContinuesEvent("shake",c),invoker.handleBridgeResponse(e,n,a)}))}invoker.registerAPI("startWatchShake",{mobile:startShakeHandler}),startWatchShake.version={android:"1.6.2",ios:"1.6.2"};export default function startWatchShake(e){return invoker.invoke("startWatchShake",e)}