import React, { ReactNode } from 'react'; /** * Direction type - left-to-right or right-to-left */ export type Direction = 'ltr' | 'rtl'; /** * Direction context value interface */ export interface DirectionContextValue { /** Current text direction */ dir: Direction; /** Whether current direction is RTL */ isRTL: boolean; /** Set the text direction */ setDirection: (direction: Direction) => void; /** Toggle between LTR and RTL */ toggleDirection: () => void; } /** * Storage controller interface for persisting direction preference */ export interface StorageController { getItem: (key: string) => Promise; setItem: (key: string, value: string) => Promise; } /** * DirectionProvider props */ export interface DirectionProviderProps { /** Initial direction. If not provided, will auto-detect from platform */ initialDirection?: Direction; /** Optional storage controller for persisting direction */ storage?: StorageController; /** Storage key for persisting direction preference */ storageKey?: string; /** Children to render */ children: ReactNode; } /** * Direction Context */ declare const DirectionContext: React.Context; /** * DirectionProvider Component * * Provides direction context for the entire app. Manages LTR/RTL state * and syncs with platform-specific direction settings. * * @example * ```tsx * import { DirectionProvider } from '@platform-blocks/ui'; * * function App() { * return ( * * * * ); * } * ``` */ export declare const DirectionProvider: React.FC; /** * Hook to access direction context * * @throws Error if used outside DirectionProvider * * @example * ```tsx * function MyComponent() { * const { dir, isRTL, setDirection, toggleDirection } = useDirection(); * * return ( * * Direction: {dir} * * * ); * } * ``` */ export declare const useDirection: () => DirectionContextValue; /** * Hook to safely access direction context with fallback * Use this if you want to support components outside DirectionProvider */ export declare const useDirectionSafe: () => DirectionContextValue; export { DirectionContext };