跳到内容
Tauri

@tauri-apps/plugin-barcode-scanner

Aztec: "AZTEC";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L30

Codabar: "CODABAR";

iOS 不支持。

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L28

Code128: "CODE_128";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L24

Code39: "CODE_39";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L22

Code93: "CODE_93";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L23

DataMatrix: "DATA_MATRIX";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L31

EAN13: "EAN_13";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L21

EAN8: "EAN_8";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L20

GS1DataBar: "GS1_DATA_BAR";

Android 不支持。需要 iOS 15.4+

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L36

GS1DataBarExpanded: "GS1_DATA_BAR_EXPANDED";

Android 不支持。需要 iOS 15.4+

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L44

GS1DataBarLimited: "GS1_DATA_BAR_LIMITED";

Android 不支持。需要 iOS 15.4+

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L40

ITF: "ITF";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L29

PDF417: "PDF_417";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L32

QRCode: "QR_CODE";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L14

UPC_A: "UPC_A";

iOS 不支持。

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L18

UPC_E: "UPC_E";

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L19

属性类型定义于
cameraDirection?"back" | "front"来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L48
formats?Format[]来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L49
windowed?布尔值 (boolean)来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L50

属性类型定义于
bounds未知来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L56
contentstring来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L54
formatFormat来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L55

type PermissionState: "granted" | "denied" | "prompt" | "prompt-with-rationale";

来源: 未定义

function cancel(): Promise<void>

取消当前扫描过程。

Promise<void>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L70


function checkPermissions(): Promise<PermissionState>

获取权限状态。

Promise<PermissionState>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L77


function openAppSettings(): Promise<void>

打开应用程序设置。如果权限被拒绝且用户必须手动启用它,则此功能很有用。

Promise<void>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L95


function requestPermissions(): Promise<PermissionState>

请求使用摄像头的权限。

Promise<PermissionState>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L86


function scan(options?): Promise<Scanned>

开始扫描。

参数类型描述
选项?ScanOptions

Promise<Scanned>

来源: https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/barcode-scanner/guest-js/index.ts#L63


© 2025 Tauri 贡献者。CC-BY / MIT