import { ColorValue, HostComponent, ViewProps } from 'react-native'; import type { DirectEventHandler, Double, Float, Int32, WithDefault, } from 'react-native/Libraries/Types/CodegenTypes'; import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands'; import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; type Event = Readonly<{ result: string; }>; export interface NativeFormatConfigurations { _type?: string; regexFilter?: string; minimumSizeScore?: Double; addAdditionalQuietZone?: boolean; minimum1DQuietZoneSize?: Double; minimumTextLength?: Double; maximumTextLength?: Double; enableOneDBlurScanner?: boolean; returnStartEnd?: boolean; stripCheckDigits?: boolean; checksum?: boolean; code32?: boolean; code39?: boolean; pzn7?: boolean; pzn8?: boolean; tryCode39ExtendedMode?: boolean; useCode39CheckDigit?: boolean; gs1Handling?: string; iata2of5?: boolean; code25?: boolean; industrial2of5?: boolean; useIATA2OF5Checksum?: boolean; checksumAlgorithms?: string[]; ean8?: boolean; ean13?: boolean; upca?: boolean; upce?: boolean; extensions?: string; minimumValue?: Double; allowNarrowBarsOnly?: boolean; allowWideBarsOnly?: boolean; strictMode?: boolean; qr?: boolean; microQr?: boolean; rmqr?: boolean; australiaPostCustomerFormat?: string; formats?: string[]; minimumNumberOfRequiredFramesWithEqualRecognitionResult?: Double; minimumNumberOfRequiredFramesWithEqualRecognitionResultExtensionless?: Double; oneDConfirmationMode?: string; } export interface NativeBarcodeAccumulationConfiguration { accumulationTime?: WithDefault; removeUnconnectedResults?: WithDefault; method?: WithDefault; } interface NativeProps extends ViewProps { onBarcodeScannerResult?: DirectEventHandler; onSelectBarcodeResult: DirectEventHandler; onError: DirectEventHandler>; flashEnabled?: WithDefault; finderEnabled?: WithDefault; finderStrokeWidth?: WithDefault; finderStrokeColor?: ColorValue; finderOverlayColor?: ColorValue; finderMinPadding?: WithDefault; finderInset?: { left?: WithDefault; top?: WithDefault; bottom?: WithDefault; right?: WithDefault; }; finderRequiredAspectRatios?: { width?: WithDefault; height?: WithDefault; }; cameraZoomFactor?: WithDefault; cameraZoomRange?: { minZoom?: WithDefault; maxZoom?: WithDefault; }; cameraModule?: WithDefault; hardwareButtonsEnabled?: WithDefault; scanningEnabled?: WithDefault; minFocusDistanceLock?: WithDefault; overlayEnabled?: WithDefault; overlayPolygonColor?: ColorValue; overlayStrokeColor?: ColorValue; overlayTextColor?: ColorValue; overlayTextContainerColor?: ColorValue; overlayTextFormat?: WithDefault; overlayLoadingTextValue?: WithDefault; overlayBarcodeItemOverlayViewBinder?: WithDefault; configFormatConfigurations?: Array; configExtractedDocumentFormats?: Array; configOnlyAcceptDocuments?: WithDefault; configReturnBarcodeImage?: WithDefault; configEngineMode?: WithDefault; configAccumulation?: NativeBarcodeAccumulationConfiguration; configOptimizedForOverlays?: WithDefault; } export default codegenNativeComponent('ScanbotBarcodeScannerView'); interface NativeCommands { freezeCamera: (viewRef: React.ElementRef>) => void; unfreezeCamera: (viewRef: React.ElementRef>) => void; bindBarcodeItemOverlayView: ( viewRef: React.ElementRef>, barcodeItemUuid: string, bindingConfig: string ) => void; } export const Commands = codegenNativeCommands({ supportedCommands: ['freezeCamera', 'unfreezeCamera', 'bindBarcodeItemOverlayView'], });