BarcodeEvent
Tells a Camera's app which code came into view, what it encodes and where it is in the preview.
Utilização
Pause and resume a camera preview.
Este tipo é usado por 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>
</>
);
}Declaração do tipo
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 };
}
>;Membros 6
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
type | "barcode" | Sim | — |
target | unknown | Sim | — |
isTrusted | boolean | Sim | — |
format | BarcodeType | Sim | The event's type is barcodeScanned; this is the code's. |
data | string | Sim | — |
bounds | { x: number; y: number; width: number; height: number;} | Sim | In the view's points, from its top-left corner. |
bounds — campos aninhados
bounds campos
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
x | number | Sim | — |
y | number | Sim | — |
width | number | Sim | — |
height | number | Sim | — |
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.