import { Platform } from 'react-native'; import { createContext } from 'react'; import { defaultContext } from '../Consts'; const Context = createContext({}); const ApplicationContext = createContext(defaultContext); const MiniAppContext = (Platform as any).MiniAppContext ?? Context; const ScreenContext = (Platform as any).ScreenContext ?? Context; const ComponentContext = (Platform as any).ComponentContext ?? Context; const SkeletonContext = createContext({ loading: false }); const ScaleSizeContext = createContext<{ scaleSizeMaxRate?: number }>({ scaleSizeMaxRate: undefined, }); const TrackingScopeContext = createContext<{ scopeName?: string }>({ scopeName: undefined, }); export { ApplicationContext, MiniAppContext, ScreenContext, ComponentContext, SkeletonContext, TrackingScopeContext, ScaleSizeContext, };