@neuroequality/neuroadapt-mobile
Version:
Mobile accessibility features for React Native and cross-platform apps
80 lines (79 loc) • 2.63 kB
TypeScript
import { default as React, ReactNode } from 'react';
import { Preferences } from '@neuroadapt/core';
export interface MobileAccessibilityState {
screenReader: {
enabled: boolean;
type: 'voiceover' | 'talkback' | 'other' | null;
};
reduceMotion: boolean;
reduceTransparency: boolean;
boldText: boolean;
largeText: boolean;
highContrast: boolean;
colorScheme: 'light' | 'dark' | null;
deviceOrientation: 'portrait' | 'landscape';
screenSize: 'small' | 'medium' | 'large' | 'xlarge';
hapticFeedback: boolean;
voiceControl: boolean;
grayscale: boolean;
}
export interface MobileAccessibilityActions {
updatePreferences: (preferences: Partial<Preferences>) => void;
announceForAccessibility: (message: string) => void;
setFocusToElement: (elementRef: any) => void;
triggerHapticFeedback: (type: 'light' | 'medium' | 'heavy' | 'selection') => void;
adjustFontSize: (scale: number) => void;
toggleHighContrast: () => void;
toggleReduceMotion: () => void;
}
interface MobileAccessibilityContextType {
state: MobileAccessibilityState;
actions: MobileAccessibilityActions;
preferences: Preferences | null;
isLoading: boolean;
}
export interface MobileAccessibilityProviderProps {
children: ReactNode;
initialPreferences?: Preferences;
onPreferencesChange?: (preferences: Preferences) => void;
hapticEnabled?: boolean;
announcements?: boolean;
}
/**
* Mobile Accessibility Provider Component
*/
export declare const MobileAccessibilityProvider: React.FC<MobileAccessibilityProviderProps>;
/**
* Hook to use mobile accessibility context
*/
export declare const useMobileAccessibility: () => MobileAccessibilityContextType;
/**
* Hook for screen reader specific functionality
*/
export declare const useScreenReader: () => {
isEnabled: boolean;
type: "voiceover" | "talkback" | "other" | null;
announce: (message: string) => void;
setFocus: (elementRef: any) => void;
};
/**
* Hook for haptic feedback
*/
export declare const useHapticFeedback: () => {
isEnabled: boolean;
trigger: (type: "light" | "medium" | "heavy" | "selection") => void;
};
/**
* Hook for device orientation and screen size
*/
export declare const useDeviceContext: () => {
orientation: "portrait" | "landscape";
screenSize: "medium" | "small" | "large" | "xlarge";
isLandscape: boolean;
isPortrait: boolean;
isSmallScreen: boolean;
isMediumScreen: boolean;
isLargeScreen: boolean;
};
export default MobileAccessibilityProvider;
//# sourceMappingURL=accessibility-provider.d.ts.map