import React from 'react'; import { ViewProps, ViewStyle } from 'react-native'; /** * Aspect ratio for crop */ export type CropAspectRatio = { label: string; ratio: number | null; }; /** * UI Configuration for the Image Editor * Provides extensive control over the editor's appearance and behavior */ export interface ImageEditorUIConfig { /** Enable adjustment tools (brightness, contrast, etc.) */ enableAdjustments?: boolean; /** Enable filter gallery */ enableFilters?: boolean; /** Enable transform tools (crop, rotate, flip) */ enableTransforms?: boolean; /** Enable layer management */ enableLayers?: boolean; /** Enable drawing tools */ enableDrawing?: boolean; /** Enable text tool */ enableText?: boolean; /** Enable stickers */ enableStickers?: boolean; /** Enable LUT (color grading) support */ enableLUT?: boolean; /** Show top toolbar with controls */ showTopToolbar?: boolean; /** Show bottom toolbar with tools */ showBottomToolbar?: boolean; /** Enable undo button */ enableUndo?: boolean; /** Enable redo button */ enableRedo?: boolean; /** Enable reset button */ enableReset?: boolean; /** Enable export button */ enableExport?: boolean; /** Show close button */ showCloseButton?: boolean; /** Show load new image button */ showLoadButton?: boolean; /** Show share button */ showShareButton?: boolean; /** Show info/help button */ showInfoButton?: boolean; /** Allowed export formats */ allowedExportFormats?: ('jpeg' | 'png' | 'heic')[]; /** Default export format */ defaultExportFormat?: 'jpeg' | 'png' | 'heic'; /** Default export quality (0.0 - 1.0) */ defaultExportQuality?: number; /** Maximum dimension for export (width/height) */ maxExportDimension?: number; /** Show export progress indicator */ showExportProgress?: boolean; /** Export progress style */ exportProgressStyle?: 'bar' | 'circular' | 'minimal'; /** Embed metadata in exported image */ embedMetadata?: boolean; /** Preserve EXIF data */ preserveExif?: boolean; /** Compression method */ compressionMethod?: 'fast' | 'balanced' | 'best'; /** Automatically save to Photos */ exportToPhotos?: boolean; /** Show share sheet after export */ exportShareSheet?: boolean; /** Available filters (null = all) */ availableFilters?: string[]; /** Default filter intensity (0.0 - 1.0) */ defaultFilterIntensity?: number; /** Show intensity slider for filters */ showFilterIntensitySlider?: boolean; /** Filter intensity range */ filterIntensityRange?: { min: number; max: number; }; /** Show filter preview thumbnails */ showFilterPreviews?: boolean; /** Filter preview thumbnail size */ filterPreviewSize?: number; /** Enable before/after comparison */ enableFilterComparison?: boolean; /** Allow applying multiple filters */ allowMultipleFilters?: boolean; /** Available adjustments (null = all) */ availableAdjustments?: string[]; /** Custom adjustment ranges */ adjustmentRanges?: Record; /** Slider step increments per adjustment */ adjustmentSteps?: Record; /** Default values per adjustment */ adjustmentDefaults?: Record; /** Show adjustment values */ showAdjustmentValues?: boolean; /** Show reset button per adjustment */ showAdjustmentReset?: boolean; /** Live preview while adjusting */ adjustmentLivePreview?: boolean; /** Enable crop tool */ enableCrop?: boolean; /** Enable rotate tool */ enableRotate?: boolean; /** Enable flip tools */ enableFlip?: boolean; /** Enable resize tool */ enableResize?: boolean; /** Rotation step in degrees */ rotationStep?: number; /** Crop aspect ratio presets */ cropAspectRatios?: CropAspectRatio[]; /** Enable freeform crop */ enableFreeformCrop?: boolean; /** Show crop grid overlay */ showCropGrid?: boolean; /** Number of grid lines */ cropGridLines?: number; /** Allow rotation beyond step increments */ allowRotationBeyondStep?: boolean; /** Enable rotation gesture */ rotationGestureEnabled?: boolean; /** Default brush size */ defaultBrushSize?: number; /** Default brush opacity (0.0 - 1.0) */ defaultBrushOpacity?: number; /** Enable eraser tool */ enableEraser?: boolean; /** Minimum brush size */ minBrushSize?: number; /** Maximum brush size */ maxBrushSize?: number; /** Brush size step increment */ brushSizeStep?: number; /** Available brush colors (null = color picker) */ availableBrushColors?: string[]; /** Enable brush opacity control */ enableBrushOpacity?: boolean; /** Enable brush blending modes */ enableBrushBlending?: boolean; /** Show brush preview */ showBrushPreview?: boolean; /** Enable pressure sensitivity (Apple Pencil) */ enablePressureSensitivity?: boolean; /** Drawing smoothing (0.0 - 1.0) */ drawingSmoothing?: number; /** Maximum number of layers */ maxLayers?: number; /** Default layer opacity */ defaultLayerOpacity?: number; /** Available blend modes (null = all) */ availableBlendModes?: string[]; /** Default text size */ defaultTextSize?: number; /** Available fonts (null = system fonts) */ availableFonts?: string[]; /** Enable text shadow */ enableTextShadow?: boolean; /** Enable text stroke */ enableTextStroke?: boolean; /** Maximum undo/redo states */ maxHistoryStates?: number; /** Enable automatic memory monitoring */ enableMemoryMonitoring?: boolean; /** Maximum preview dimension (downsampling) */ maxPreviewDimension?: number; /** Enable GPU acceleration */ enableGPUAcceleration?: boolean; /** Enable auto-save */ autoSaveEnabled?: boolean; /** Auto-save interval in seconds */ autoSaveInterval?: number; /** Preload filters for faster application */ preloadFilters?: boolean; /** Cache processed images */ cacheProcessedImages?: boolean; /** Enable low memory mode (reduces quality) */ lowMemoryMode?: boolean; /** Enable haptic feedback */ enableHapticFeedback?: boolean; /** Enable animations */ enableAnimations?: boolean; /** Animation duration in seconds */ animationDuration?: number; /** Animate toolbar transitions */ toolbarAnimated?: boolean; /** Animate panel transitions */ panelAnimated?: boolean; /** Enable double tap to zoom */ enableDoubleTapToZoom?: boolean; /** Double tap zoom scale */ doubleTapZoomScale?: number; /** Maximum zoom scale */ maxZoomScale?: number; /** Minimum zoom scale */ minZoomScale?: number; /** Enable pinch to zoom */ enablePinchToZoom?: boolean; /** Enable pan gesture */ enablePanGesture?: boolean; /** Enable rotation gesture */ enableRotationGesture?: boolean; /** Enable swipe gestures */ enableSwipeGestures?: boolean; /** Swipe to undo/redo */ swipeToUndoEnabled?: boolean; /** Long press for additional options */ longPressForOptions?: boolean; /** Minimum image dimension (width or height) */ minImageDimension?: number; /** Maximum image dimension (width or height) */ maxImageDimension?: number; /** Allowed image file formats */ allowedImageFormats?: string[]; /** Maximum file size in bytes (null = no limit) */ maxFileSize?: number | null; /** Warn user about large images */ warnOnLargeImages?: boolean; /** Threshold for large image warning (pixels) */ largeImageThreshold?: number; /** Toolbar position */ toolbarPosition?: 'top' | 'bottom' | 'floating'; /** Toolbar height */ toolbarHeight?: number; /** Toolbar padding */ toolbarPadding?: number; /** Toolbar item spacing */ toolbarSpacing?: number; /** Bottom toolbar layout style */ bottomToolbarLayout?: 'scrollable' | 'grid' | 'grouped'; /** Make toolbar collapsible */ toolbarCollapsible?: boolean; /** Panel position */ panelPosition?: 'bottom' | 'side' | 'overlay'; /** Panel height */ panelHeight?: number; /** Allow panel dismissal */ panelDismissable?: boolean; /** Show panel drag handle */ panelDragHandle?: boolean; /** Apply blur effect to panel background */ panelBlurEffect?: boolean; /** Localized strings map */ localizedStrings?: Record; /** Date format string */ dateFormat?: string; /** Use system language */ useSystemLanguage?: boolean; } /** * Image source for loading */ export interface ImageSource { uri: string; } /** * Export result */ export interface ExportResult { uri: string; path: string; } /** * Error event */ export interface ErrorEvent { error: string; } /** * Props for ImageEditorUI component */ export interface ImageEditorUIProps extends ViewProps { /** * Image source to load */ source?: ImageSource; /** * UI configuration */ config?: ImageEditorUIConfig; /** * Called when the editor is ready */ onReady?: () => void; /** * Called when an image is loaded */ onImageLoaded?: () => void; /** * Called when the image is changed */ onImageChanged?: () => void; /** * Called when an image is exported */ onExport?: (result: ExportResult) => void; /** * Called when an error occurs */ onError?: (error: ErrorEvent) => void; /** * Called when the editor is closed */ onClose?: () => void; /** * Style for the view */ style?: ViewStyle; } /** * Ref methods for imperative API */ export interface ImageEditorUIRef { /** * Load an image from a source */ loadImage: (source: ImageSource) => Promise; /** * Update the configuration */ updateConfig: (config: ImageEditorUIConfig) => Promise; /** * Get the current image */ getCurrentImage: () => Promise; } /** * Image Editor UI Component * * A complete native image editing interface with all tools built-in. * This component provides a full-featured UI that can be configured via props. * * @example * ```tsx * import { ImageEditorUI } from 'react-native-image-editor-sdk'; * * function MyEditor() { * const editorRef = useRef(null); * * return ( * { * console.log('Exported:', result.uri); * }} * onError={(error) => { * console.error('Error:', error.error); * }} * style={{ flex: 1 }} * /> * ); * } * ``` */ export declare const ImageEditorUI: React.ForwardRefExoticComponent>; /** * Preset configurations for common use cases */ export declare const ImageEditorUIPresets: { /** * Minimal configuration with only essential features */ minimal: () => ImageEditorUIConfig; /** * Photo editor configuration */ photoEditor: () => ImageEditorUIConfig; /** * Social media configuration with popular filters */ socialMedia: () => ImageEditorUIConfig; /** * Professional configuration with all features */ professional: () => ImageEditorUIConfig; /** * Drawing-focused configuration */ drawing: () => ImageEditorUIConfig; /** * Quick edit - fast and simple adjustments */ quickEdit: () => ImageEditorUIConfig; /** * Performance optimized for large images */ performanceOptimized: () => ImageEditorUIConfig; /** * High quality export focused */ highQuality: () => ImageEditorUIConfig; }; export default ImageEditorUI;