I could be misunderstanding something but I'm having trouble getting Typescript to pass checks on my use of this library. Using the following very minimal example based on the demo:
import { BarcodeScanner } from 'react-barcode-scanner'
import 'react-barcode-scanner/polyfill'
function QrScanner({onDetect}: {onDetect: (value: string) => void}) {
const onCapture = (detected) => {
if (detected) {
const value = detected.rawValue
onDetect(value)
}
}
return (
<BarcodeScanner onCapture={onCapture} />
)
}
I'd like to declare detected as a DetectedBarcode but it looks like this type is not exported? Happy to be corrected if I'm mistaken.
I could be misunderstanding something but I'm having trouble getting Typescript to pass checks on my use of this library. Using the following very minimal example based on the demo:
I'd like to declare
detected
as aDetectedBarcode
but it looks like this type is not exported? Happy to be corrected if I'm mistaken.