UNPKG

rynex

Version:

A minimalist TypeScript framework for building reactive web applications with no virtual DOM

86 lines 2.33 kB
/** * Rynex Browser Compatibility Module * Ensures consistent behavior across all major browsers (Chrome, Firefox, Safari, Edge) * Modern browser support with native APIs only - no external dependencies */ /** * Browser detection and feature support */ export interface BrowserCapabilities { name: string; version: string; platform: string; engine: string; isChrome: boolean; isFirefox: boolean; isSafari: boolean; isEdge: boolean; isMobile: boolean; supportsProxy: boolean; supportsIntersectionObserver: boolean; supportsResizeObserver: boolean; supportsSmoothScroll: boolean; supportsFetch: boolean; supportsCustomElements: boolean; } /** * Detect browser and capabilities */ export declare function detectBrowser(): BrowserCapabilities; /** * Initialize browser fixes and optimizations * Should be called once at application startup */ export declare function initializeBrowserSupport(options?: { enableSmoothScroll?: boolean; verbose?: boolean; }): BrowserCapabilities; /** * Enhanced DOM operations with cross-browser support */ export declare const browserDOM: { /** * Cross-browser smooth scroll to element */ scrollToElement(element: HTMLElement, options?: ScrollIntoViewOptions): void; /** * Cross-browser smooth scroll to position */ scrollTo(x: number, y: number, smooth?: boolean): void; /** * Get accurate viewport dimensions */ getViewportSize(): { width: number; height: number; }; /** * Cross-browser element offset */ getElementOffset(element: HTMLElement): { top: number; left: number; }; /** * Check if element is in viewport */ isInViewport(element: HTMLElement, threshold?: number): boolean; }; /** * Enhanced state management with cross-browser support */ export declare const browserState: { /** * Check if Proxy is supported (required for reactive state) */ supportsProxy(): boolean; /** * Fallback for browsers without Proxy support */ createFallbackState<T extends object>(initialState: T): T; }; /** * Check if browser support is initialized */ export declare function isBrowserSupportInitialized(): boolean; //# sourceMappingURL=browsers.d.ts.map