import EventBus from "../applications/EventBus"; import FunctionApplication, { IContext, IFunct } from "../applications/FunctionApplication"; export const prefix = 'miniapp-'; class SdkApp { public initSdk(context: IContext, func: IFunct) { FunctionApplication.funct = func; FunctionApplication.context = context; } public updateCompass(degree: number) { EventBus.getInstance().postEvent(`${prefix}compass`, { type: "resolve", data: degree, }); } public updateLocation(coordinate: any) { EventBus.getInstance().postEvent(`${prefix}onLocationChange`, { type: "resolve", data: coordinate, }); } } export default SdkApp;