Verwendung

Pause and resume a camera preview.

Dieser Typ wird verwendet von Camera

tsx
// 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

ts
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

NameTypErforderlichBeschreibung
type"barcode"Ja—
targetunknownJa—
isTrustedbooleanJa—
formatBarcodeTypeJaThe event's type is barcodeScanned; this is the code's.
datastringJa—
bounds{ x: number; y: number; width: number; height: number;}JaIn the view's points, from its top-left corner.
bounds — verschachtelte Felder

bounds Felder

NameTypErforderlichBeschreibung
xnumberJa—
ynumberJa—
widthnumberJa—
heightnumberJa—
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.