import { EventSubscription } from "expo-modules-core";

export type BarcodeReadEvent = {
  data: string;
  timestamp: number;
};

export type BarcodeManagerModuleEvents = {
  onBarcodeRead: (event: BarcodeReadEvent) => void;
};

export type BarcodeManagerModule = {
  addReadListener(): void;
  removeReadListener(): void;
  addListener(
    eventName: "onBarcodeRead",
    listener: (event: BarcodeReadEvent) => void
  ): EventSubscription;
};
