@whitemordred/react-native-bootstrap5
Version:
A complete React Native library that replicates Bootstrap 5.3 with 100% feature parity, full theming support, CSS variables, and dark/light mode
151 lines • 3.85 kB
TypeScript
import { ThemeMode, ThemePreferences } from './defaultTheme';
/**
* Theme storage utilities for persisting user preferences
*/
export declare class ThemeStorage {
/**
* Save theme preferences to storage
*/
static savePreferences(preferences: ThemePreferences): Promise<void>;
/**
* Load theme preferences from storage
*/
static loadPreferences(): Promise<ThemePreferences>;
/**
* Save current theme mode
*/
static saveThemeMode(mode: ThemeMode): Promise<void>;
/**
* Load saved theme mode
*/
static loadThemeMode(): Promise<ThemeMode | null>;
/**
* Clear all theme data
*/
static clearThemeData(): Promise<void>;
}
/**
* System theme detection utilities
*/
export declare class SystemTheme {
/**
* Get system preferred color scheme
*/
static getSystemTheme(): 'light' | 'dark';
/**
* Listen to system theme changes on web
*/
static addSystemThemeListener(callback: (theme: 'light' | 'dark') => void): (() => void) | null;
/**
* Check if user prefers reduced motion
*/
static prefersReducedMotion(): boolean;
/**
* Check if user prefers high contrast
*/
static prefersHighContrast(): boolean;
}
/**
* Color utilities for theme manipulation
*/
export declare class ColorUtils {
/**
* Convert hex color to rgba
*/
static hexToRgba(hex: string, alpha?: number): string;
/**
* Lighten a hex color by a percentage
*/
static lighten(hex: string, percent: number): string;
/**
* Darken a hex color by a percentage
*/
static darken(hex: string, percent: number): string;
/**
* Get contrast color (black or white) for a given background
*/
static getContrastColor(hex: string): string;
/**
* Check if a color is dark
*/
static isDark(hex: string): boolean;
/**
* Generate color variations (lighter and darker shades)
*/
static generateColorVariations(hex: string): {
50: string;
100: string;
200: string;
300: string;
400: string;
500: string;
600: string;
700: string;
800: string;
900: string;
950: string;
};
}
/**
* Animation utilities for theme transitions
*/
export declare class ThemeAnimationUtils {
/**
* Create smooth theme transition
*/
static createThemeTransition(duration?: number): void;
/**
* Disable animations if user prefers reduced motion
*/
static respectReducedMotion(): void;
}
/**
* Theme manager for advanced theme handling
*/
export declare class ThemeManager {
private static listeners;
private static systemListener;
private static currentMode;
private static followSystem;
/**
* Initialize theme manager
*/
static initialize(followSystemTheme?: boolean): Promise<ThemeMode>;
/**
* Set up system theme listener
*/
private static setupSystemListener;
/**
* Set theme mode
*/
static setMode(mode: ThemeMode, saveToStorage?: boolean): Promise<void>;
/**
* Toggle between light and dark mode
*/
static toggleMode(): Promise<void>;
/**
* Get current theme mode
*/
static getCurrentMode(): ThemeMode;
/**
* Check if following system theme
*/
static isFollowingSystem(): boolean;
/**
* Start following system theme
*/
static followSystemTheme(): Promise<void>;
/**
* Stop following system theme
*/
static stopFollowingSystem(): void;
/**
* Add theme change listener
*/
static addListener(listener: (mode: ThemeMode) => void): () => void;
/**
* Clean up all listeners
*/
static cleanup(): void;
}
//# sourceMappingURL=themeUtils.d.ts.map