import type { Dictionary } from '@brandingbrand/fsfoundation' ; import type { AppConfig , WebApplication } from './types' ; import { AppRegistry } from 'react-native' ; import { EnvSwitcher } from '../lib/env-switcher' ; export const getVersion = async ( config ) : Promise < string > => { return `${ config . version ?? '' }\nenv:${ EnvSwitcher . envName ?? 'prod' }` ; } ; const isWebRegistry = ( registry ) : registry is typeof AppRegistry & { getApplication ( app , props ? ) : WebApplication ; } => { return 'getApplication' in registry ; } ; export const getApp = ( ) : WebApplication | undefined => { return isWebRegistry ( AppRegistry ) ? AppRegistry . getApplication ( 'Flagship' , { } ) : undefined ; } ;