import * as reactNativeModule from 'react-native'; import { TextProps, ViewProps, ImageProps, ActivityIndicatorProps, TextStyle, ColorValue, ProcessedColorValue } from 'react-native'; import { ComponentType, ComponentPropsWithRef } from 'react'; /** * Recursive style prop shape accepted by runtime style helpers. * * @template T - Style object type. */ type GenericStyleProp = null | void | T | false | '' | ReadonlyArray>; /** * Maps CSS-like `userSelect` values to React Native's `selectable` prop. */ declare const userSelectToSelectableMap: { auto: boolean; text: boolean; none: boolean; contain: boolean; all: boolean; }; /** * Maps CSS-like `verticalAlign` values to React Native's `textAlignVertical`. */ declare const verticalAlignToTextAlignVerticalMap: { auto: string; top: string; bottom: string; middle: string; }; /** * Clamps a `numberOfLines` value exactly as `Text` does at runtime: a negative number (or `NaN`) becomes * `0`, while `null`/`undefined` pass through untouched (`!(value >= 0)` is `true` for negatives and `NaN`, * `false` otherwise). */ declare const clampNumberOfLines: (value?: number | null) => number | null | undefined; /** * Native Text component with graceful fallback. */ declare const NativeText: ComponentType; /** * Native View component with graceful fallback. */ declare const NativeView: ComponentType; declare const View: (props: Omit | undefined; }> & { ref?: React.Ref | undefined; }) => React.ReactNode; declare const NativeViewWithContext: ComponentType>; /** * Native Image component with graceful fallback. */ declare const NativeImage: ComponentType; /** * Native ActivityIndicator component with graceful fallback. */ declare const NativeActivityIndicator: ComponentType; declare const textDefaultOverflowStyle: { readonly overflow: "hidden"; }; declare const activityIndicatorStyles: { readonly container: { readonly alignItems: "center"; readonly justifyContent: "center"; }; readonly small: { readonly width: 20; readonly height: 20; }; readonly large: { readonly width: 36; readonly height: 36; }; }; /** * The default style `Text` prepends to every element's `style` — `{ overflow: 'hidden' }` on RN ≥ * 0.85, and `undefined` otherwise. The plugin uses this fallback when the build target is unknown. */ declare function getDefaultTextStyle(): TextStyle | undefined; /** * Gates a plain OBJECT source's inline `headers` for the top-level Android `headers` prop when the * build target is unknown. See {@link liftsObjectSourceHeaders}. */ declare function processImageObjectSourceHeaders(headers: T): T | undefined; /** * Gates a single-entry ARRAY source's intrinsic dimensions when the build target is unknown. An * `undefined` entry is ignored by style flattening, exactly like the wrapper's `false`. * See {@link propagatesArraySourceDimensions}. */ declare function processImageArraySourceDimensions(dimensions: T): T | undefined; /** * Normalizes `Text` style values for `NativeText`. * * @param style - Style prop passed to a text-like component. * @param includesDefaultStyle - Build-time release default. Omit it to detect the runtime version. * @returns Native text props with the authored style and wrapper overrides preserved. * @remarks * - Inspects style arrays via `StyleSheet.flatten`, without replacing the authored style * - Converts numeric `fontWeight` values to string values * - Maps `userSelect` and `verticalAlign` to native-compatible props * - Applies the build-time default-style setting, or uses {@link getDefaultTextStyle} as a fallback */ declare function processTextStyle(style: GenericStyleProp, includesDefaultStyle?: boolean): Partial; /** * Mirrors the `selectionColor` normalization `Text` performs before handing off to its native host: * `selectionColor != null ? processColor(selectionColor) : undefined` (Text.js). Returns a spreadable * prop bag so the plugin can inline it at the JSX call site like {@link processTextStyle}. * * @param selectionColor - The raw `selectionColor` prop (CSS color string, int, or `PlatformColor`). * @returns `{ selectionColor }` with the processed value, or an empty object when nothing should be * emitted: a `null`/`undefined` input collapses to `{}`, and a value `processColor` rejects (returns * `undefined`, e.g. an unparseable color string) is likewise omitted, mirroring `Text`'s * `if (_selectionColor !== undefined)` guard. A `null` from `processColor` (a rejected `PlatformColor`) * is preserved, since `Text` forwards that. * @remarks * No caching: keys are commonly primitives (`'red'`, `0xff0000ff`) that a `WeakMap` rejects, and * `processColor` is already cheap. When `processColor` is unavailable (a non-RN host) the raw value is * passed through rather than dropped, the least-surprising degradation. */ declare function processSelectionColor(selectionColor?: ColorValue | number | null): { selectionColor?: ColorValue | ProcessedColorValue | null; }; declare function resolveActivityIndicatorDefault(value: T | undefined, fallback: T): T; declare function processActivityIndicatorStyle(style: ActivityIndicatorProps['style']): unknown; declare function processActivityIndicatorSize(size?: ActivityIndicatorProps['size']): { style: (typeof activityIndicatorStyles)["small"]; size: "small"; } | { style: (typeof activityIndicatorStyles)["large"]; size: "large"; } | { style: { height: number; width: number; }; size: undefined; }; type ImageSourceHelperProps = Record; /** * Normalizes dynamic `Image` source/style props for `NativeImage`. * * @remarks * Static Image cases are still rewritten at build time. This helper is only emitted when the source * or style cannot be safely flattened by Babel, so it mirrors the RN wrapper's runtime work: * `resolveAssetSource`, `src`/request-header synthesis, object-vs-array source style construction, * `objectFit`/`resizeMode`, and iOS tint fallback. */ declare function processImageSourceProps(props: ImageSourceHelperProps): Record; /** * The default value `Text` resolves for `accessible` when the prop is omitted: `true` on iOS (text is * an accessibility element unless opted out), `false` on Android, and `undefined` elsewhere. * * @remarks * Runtime fallback for the common optimized `` path (no accessibility props) when the target * platform is unknown at build time. When it is known (Metro reports it on the Babel caller), the * plugin inlines the literal instead and this is not emitted. Evaluated per render — like `Text`'s own * `Platform.select` — rather than hoisted to a constant, so it always reflects the current platform. */ declare const getDefaultTextAccessible: () => boolean | undefined; /** * Normalizes accessibility and ARIA props for runtime native components, mirroring the reconciliation * `Text` performs before handing off to its native host. * * @param props - Accessibility and ARIA props. * @returns Props with normalized accessibility fields. * @remarks * - Merges `aria-label` with `accessibilityLabel` * - Merges ARIA state fields into `accessibilityState` * - Reconciles `disabled` with `accessibilityState.disabled` (the explicit `disabled` prop wins) * - Translates `aria-hidden` into `accessibilityElementsHidden` / `importantForAccessibility` (see * {@link applyAriaHidden}); `aria-hidden` wins over an explicitly-passed value * - Resolves the platform-specific `accessible` default (see {@link getDefaultTextAccessible}) */ declare function processTextAccessibilityProps(props: Record): Record; /** * Normalizes accessibility and ARIA props for an optimized `NativeView`, mirroring the reconciliation * the `View` wrapper performs before handing off to its native host. * * @param props - Accessibility and ARIA props. * @returns Props with the ARIA cluster translated/aggregated into their native counterparts. * @remarks * Unlike {@link processTextAccessibilityProps} (the `Text` helper) there is no `accessible` default and no * `disabled` reconciliation — the `View` wrapper does neither. A static `tabIndex` is folded to * `focusable` at build time; only a dynamic `tabIndex` reaches this helper. * - `aria-labelledby` → `accessibilityLabelledBy` (comma-split into a string array) * - `aria-label` → `accessibilityLabel` * - `aria-live` → `accessibilityLiveRegion` (`'off'` → `'none'`) * - `aria-hidden` → `accessibilityElementsHidden` (+ `importantForAccessibility` when strictly `true`) * - `tabIndex` → `focusable` (`!tabIndex`) * - ARIA state fields aggregated into `accessibilityState` (`ariaX ?? accessibilityState?.x`) * - ARIA value fields aggregated into `accessibilityValue` (`ariaX ?? accessibilityValue?.x`) */ declare function processViewAccessibilityProps(props: Record): Record; /** * Normalizes the Image wrapper's accessibility aliases before props reach `NativeImage`. * * @remarks * Image's rules are close to View's ARIA merge, but not identical: `alt` is an accessibilityLabel * fallback and also forces `accessible` on. Keep this separate from `processViewAccessibilityProps` * so those Image-only precedence rules stay explicit. */ declare function processImageAccessibilityProps(props: Record): Record; export { NativeActivityIndicator, NativeImage, NativeText, NativeView, NativeViewWithContext, activityIndicatorStyles, clampNumberOfLines, getDefaultTextAccessible, getDefaultTextStyle, processActivityIndicatorSize, processActivityIndicatorStyle, processImageAccessibilityProps, processImageArraySourceDimensions, processImageObjectSourceHeaders, processImageSourceProps, processSelectionColor, processTextAccessibilityProps, processTextStyle, processViewAccessibilityProps, resolveActivityIndicatorDefault, textDefaultOverflowStyle, userSelectToSelectableMap, verticalAlignToTextAlignVerticalMap }; export type { GenericStyleProp };