import * as _babel_core from '@babel/core'; import { PluginObj } from '@babel/core'; type OptimizationState = 'on' | 'off'; type OptimizationSetting = OptimizationState | [state: OptimizationState, options: Options]; interface PluginOptimizationOptions { /** * Replaces the React Native `Text` wrapper with its native host. * @default 'on' */ 'native-text'?: OptimizationSetting; /** * Replaces the React Native `View` wrapper with its native host. * @default 'on' */ 'native-view'?: OptimizationSetting; /** * Replaces the React Native `Image` wrapper with its native host. * @default 'on' */ 'native-image'?: OptimizationSetting; /** * Replaces the React Native `ActivityIndicator` wrapper with its native hosts. * @default 'on' */ 'native-activity-indicator'?: OptimizationSetting; /** Creates persistent `Animated` values lazily instead of recreating unused values on each render. @default 'on' for detected RN 0.83+ */ 'animated-value-initialization'?: OptimizationSetting; /** Removes built-in `Animated` wrappers whose props contain no animated values. @default 'on' for RN 0.83–0.86, 'off' otherwise */ 'animated-wrapper-removal'?: OptimizationSetting; /** Evaluates static React Native `StyleSheet` operations at build time. @default 'on' */ 'stylesheet-operations'?: OptimizationSetting; /** Folds React Native `Platform.select` calls and `Platform.OS` branches at build time. @default 'on' */ 'platform-folding'?: OptimizationSetting; } interface PluginAssumptions { /** * Assume unresolved ancestors and runtime parents do not provide a React Native `Text` context. * * This increases optimization coverage, but can emit the wrong native host when the assumption is false. * Enable it only after you verify this behavior across the project. * @default false */ unknownAncestorsDoNotRenderText?: boolean; } type IntegrationState = 'auto' | 'on' | 'off'; interface PluginIntegrationOptions { /** * Preserves free Uniwind 1.12.x styles on optimized components. Requires Metro. * `auto` detects an active `withUniwindConfig`. Apply `withBoostConfig` after it. * `on` requires that configuration. Use `off` only when transformed code does not use Uniwind. * @default 'auto' */ uniwind?: IntegrationState; /** * Keeps `react-native-unistyles` reactivity working on optimized elements. * * `auto` detects an installed `react-native-unistyles` package and logs a warning when found. Use `on` * when the project uses Unistyles, or `off` when the package is installed but not used in transformed code. * @default 'auto' */ unistyles?: IntegrationState; } type LogLevel = 'silent' | 'warn' | 'info' | 'debug'; interface PluginOptions { /** * Resolves imported component ancestors through Metro's module graph. This uses private/internal Metro APIs until Metro supports cross-file transform inputs (https://github.com/react/metro/issues/1902). * Set this to `false` to use same-file ancestor analysis only. * * @default true in supported Metro versions */ crossFileAncestorResolution?: boolean; /** Configures individual optimizations. */ optimizations?: PluginOptimizationOptions; /** Declares project-wide facts that enable additional optimizations. */ assumptions?: PluginAssumptions; /** Configures supported third-party libraries. */ integrations?: PluginIntegrationOptions; /** Paths to ignore from optimization. */ ignores?: string[]; /** Controls plugin logging. */ logLevel?: LogLevel; /** Supplies the React Native target when automatic detection is unsuitable. */ target?: { reactNative?: ReactNativeTargetOption; }; } type ReactNativeTargetOption = { packageJson: string; }; declare const _default: (api: object, options: Record | null | undefined, dirname: string) => PluginObj<_babel_core.PluginPass>; export { _default as default }; export type { IntegrationState, LogLevel, OptimizationSetting, OptimizationState, PluginAssumptions, PluginIntegrationOptions, PluginOptimizationOptions, PluginOptions, ReactNativeTargetOption };