import invoker,{API_INVOKER_TYPE,PLATFORM_TYPE_ENUM}from"./invoker";function replacePageHandler(e,a){var n=a.resolve,r=a.reject,o=a.containerType,i=a.platformType,c=a.appType,l=a.context;if(o){var P=function(){e.onSuccess&&e.onSuccess(),n()},t=function(){e.onFail&&e.onFail(),r()};c===API_INVOKER_TYPE.MINI_APP?l&&l({m:"biz.navigation.replace",args:e,onSuccess:P,onFail:t}):i===PLATFORM_TYPE_ENUM.ANDROID?l&&l(P,t,"biz.navigation","replace",e):i===PLATFORM_TYPE_ENUM.IOS&&l.callHandler("taurus.common.replacePage",Object.assign({},e),(function(){n()}))}else l&&l.call("replacePage",e,(function(){n()}))}invoker.registerAPI("replacePage",{mini:replacePageHandler,mobile:replacePageHandler}),replacePage.version={android:"1.3.2",ios:"1.3.2"};export default function replacePage(e){return invoker.invoke("replacePage",e)}