UNPKG

@neuroequality/neuroadapt-mobile

Version:

Mobile accessibility features for React Native and cross-platform apps

118 lines (117 loc) 3.4 kB
import { Preferences } from '@neuroadapt/core'; export interface MobilePlatform { name: 'ios' | 'android' | 'web' | 'windows' | 'macos'; version: string; capabilities: PlatformCapabilities; } export interface PlatformCapabilities { screenReader: boolean; hapticFeedback: boolean; voiceControl: boolean; reduceMotion: boolean; highContrast: boolean; boldText: boolean; largeText: boolean; grayscale: boolean; invertColors: boolean; reduceTransparency: boolean; buttonShapes: boolean; onOffLabels: boolean; systemWideTextScaling: boolean; magnifier: boolean; speakSelection: boolean; speakScreen: boolean; guidedAccess: boolean; switchControl: boolean; assistiveTouch: boolean; liveRegions: boolean; semanticLabels: boolean; customActions: boolean; } export interface MobileAdaptation { type: 'visual' | 'motor' | 'cognitive' | 'sensory'; feature: string; enabled: boolean; value?: any; platformSpecific: boolean; implementation: AdaptationImplementation; } export interface AdaptationImplementation { ios?: () => Promise<void>; android?: () => Promise<void>; web?: () => Promise<void>; universal?: () => Promise<void>; } /** * Mobile Platform Adapter */ export declare class MobileAdapter { private platform; private adaptations; constructor(); /** * Get current platform information */ getPlatform(): MobilePlatform; /** * Check if a feature is supported on current platform */ isFeatureSupported(feature: string): boolean; /** * Apply accessibility preferences to mobile platform */ applyPreferences(preferences: Preferences): Promise<void>; /** * Get platform-specific recommendations */ getPlatformRecommendations(preferences: Preferences): { feature: string; recommendation: string; priority: 'low' | 'medium' | 'high'; reason: string; }[]; /** * Test platform capabilities */ testCapabilities(): Promise<{ feature: string; supported: boolean; tested: boolean; error?: string; }[]>; /** * Get accessibility information for current platform */ getAccessibilityInfo(): Promise<{ screenReader: boolean; screenReaderType?: string; reduceMotion: boolean; highContrast: boolean; textScale: number; isDarkMode: boolean; isLandscape: boolean; }>; private detectPlatform; private getPlatformCapabilities; private initializeAdaptations; private getApplicableAdaptations; private executeAdaptation; private applyReduceMotionIOS; private applyReduceMotionAndroid; private applyReduceMotionWeb; private applyReduceMotionUniversal; private applyHighContrastIOS; private applyHighContrastAndroid; private applyHighContrastWeb; private applyHighContrastUniversal; private applyLargeTextUniversal; private applyLargerTargetsUniversal; private applyHapticFeedbackIOS; private applyHapticFeedbackAndroid; private applySimplifiedInterfaceUniversal; private applySoundEnhancementIOS; private applySoundEnhancementAndroid; private applySoundEnhancementUniversal; } export default MobileAdapter; //# sourceMappingURL=mobile-adapter.d.ts.map