import { ViewStyle } from 'react-native';

import { ScannerMode } from '~/models/app-settings';

export interface ChildComponentProps {
  /**
   * Timeout to read next barcode
   */
  cameraBarcodeReadTimeout?: number;

  /**
   * Enable flashlight camera
   */
  flashlight?: boolean;

  /**
   * Callback executed when the device detects a barcode
   */
  onBarcodeDetected: (barcode: string) => void;

  /*
   * Container style overrides.
   */
  style?: ViewStyle;
}

export interface ScannerProps extends ChildComponentProps {
  /**
   * Do you want to use the ir scanner or a device camera
   */
  mode?: ScannerMode;
}
