BarcodeEvent
Tells a Camera's app which code came into view, what it encodes and where it is in the preview.
Verwendung
Pause and resume a camera preview.
Dieser Typ wird verwendet von Camera
// Pause and resume a camera preview.
import { Button, Camera, ref, type CameraHandle } from 'kuito';
function Scanner() {
// A plain ref holds the handle; cameraRef() adds ready and error signals.
const camera = ref<CameraHandle>();
return (
<>
<Camera ref={camera} flex={1} />
<Button onPress={() => void camera.current?.pausePreview()}>Pause</Button>
<Button onPress={() => void camera.current?.resumePreview()}>Resume</Button>
</>
);
}Typdeklaration
export type BarcodeEvent = NativeViewEvent<
'barcode',
{
/** The event's `type` is `barcodeScanned`; this is the code's. */
format: BarcodeType;
data: string;
/** In the view's points, from its top-left corner. */
bounds: { x: number; y: number; width: number; height: number };
}
>;Mitglieder 6
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
type | "barcode" | Ja | — |
target | unknown | Ja | — |
isTrusted | boolean | Ja | — |
format | BarcodeType | Ja | The event's type is barcodeScanned; this is the code's. |
data | string | Ja | — |
bounds | { x: number; y: number; width: number; height: number;} | Ja | In the view's points, from its top-left corner. |
bounds — verschachtelte Felder
bounds Felder
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
x | number | Ja | — |
y | number | Ja | — |
width | number | Ja | — |
height | number | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.