import React from 'react'; import * as ReactNative from 'react-native'; import type { ColorValue, StyleProp, ViewStyle } from 'react-native'; import RaTeXViewNativeComponent from './RaTeXViewNativeComponent'; export declare const RaTeXColorContext: React.Context; export interface RaTeXProviderProps { color?: ColorValue; children: React.ReactNode; } export declare function RaTeXProvider({ color, children, }: RaTeXProviderProps): React.JSX.Element; /** * `depth` is DRAWN (fit-scale and centering gap applied — never multiply by * `scale`); `width`/`height` are NATURAL ink size; `scale` bridges the two. */ export interface RaTeXTexMetrics { /** View bottom edge → drawn ink baseline, dp. */ depth: number; /** Fit scale k (≤ 1). */ scale: number; /** Natural ink width, dp. */ width: number; /** Natural ink height, dp. */ height: number; } type NativeRaTeXViewInstance = React.ComponentRef; /** The genuine host instance (measure, …) plus `getTexMetrics()`. */ export type RaTeXViewRef = NativeRaTeXViewInstance & { /** * Sync TeX metrics at the committed layout (parse-cache-backed); null when * unmounted, empty, or parse failed. Call from `useLayoutEffect` or later. */ getTexMetrics(): RaTeXTexMetrics | null; }; export interface RaTeXViewProps { latex: string; /** Ref to the underlying native view (React 19 ref-as-prop). */ ref?: React.Ref; fontSize?: number; /** true (default) = display/block style ($$...$$); false = inline/text style ($...$). */ displayMode?: boolean; color?: ColorValue; style?: StyleProp; onError?: (e: { nativeEvent: { error: string; }; }) => void; /** Called when content size is measured (e.g. for scroll layout). */ onContentSizeChange?: (e: { nativeEvent: { width: number; height: number; }; }) => void; } export declare function RaTeXView({ latex, fontSize, displayMode, color, style, onError, onContentSizeChange, ref, }: RaTeXViewProps): React.JSX.Element; export {};