export function emitEvent(eventName: string, height?: number): void { const postedMessage = { type: eventName, payload: height ? height + 'px' : null }; if (typeof window !== 'undefined' && window.parent) { window.parent.postMessage(postedMessage, '*'); } if (typeof window !== 'undefined' && (window as any).ReactNativeWebView) { (window as any).ReactNativeWebView.postMessage(postedMessage, '*'); } }