import { Any, AnyObject, BrickModule, BrickModuleSpec } from 'brick-module'; import { CodegenTypes } from 'react-native'; /** * MiniAppModule Spec * Unified type definition for MiniAppModule (formerly AppsInTossModule) */ export interface MiniAppModuleSpec extends BrickModuleSpec { readonly moduleName: 'MiniAppModule'; getConstants(): { groupId: string; operationalEnvironment: string; tossAppVersion: string; deviceId: string; }; // All async/sync methods are now handled via postMessage/postMessageSync postMessage(name: string, params: AnyObject, callbacks: AnyObject): Promise; postMessageSync(name: string, params: AnyObject, callbacks: AnyObject): Any; // readonly supportedEvents: ['sendEvent']; readonly onSendEvent: CodegenTypes.EventEmitter<{ eventName: string; // updateLocation, visibilityChangedByTransparentServiceWeb, appBridgeCallback body: AnyObject; }>; } export const MiniAppModule = BrickModule.get('MiniAppModule');