@octane-xplat/barcode-scanner 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -25
- package/package.json +91 -97
- package/src/BarcodeScanner.macos.tsrx +15 -0
- package/src/BarcodeScanner.tsrx +98 -87
- package/src/BarcodeScanner.web.tsrx +127 -108
- package/src/barcode-scanner.macos.ts +175 -9
- package/src/barcode-scanner.ts +115 -94
- package/src/barcode-scanner.web.ts +49 -39
- package/src/barcode-scanner.windows.ts +6 -3
- package/src/format-map.ts +16 -16
- package/src/format-map.web.ts +16 -16
- package/src/index.macos.ts +1 -0
- package/src/native-elements.d.ts +5 -6
- package/src/props.ts +32 -23
- package/src/types.ts +29 -26
- package/types/generated/.tsrx-typegen-manifest.json +0 -9
- package/types/generated/barcode-scanner.d.ts +1 -0
- package/types/generated/props.d.ts +9 -0
- package/types/generated/types.d.ts +3 -0
- package/LICENSE +0 -21
- package/types/generated/BarcodeScanner.web.d.ts +0 -5
- package/types/generated/barcode-scanner.linux.d.ts +0 -1
- package/types/generated/barcode-scanner.macos.d.ts +0 -2
- package/types/generated/barcode-scanner.web.d.ts +0 -2
- package/types/generated/barcode-scanner.windows.d.ts +0 -2
- package/types/generated/format-map.web.d.ts +0 -3
- package/types/generated/index.macos.d.ts +0 -3
- package/types/generated/index.web.d.ts +0 -4
- package/types/generated/native-elements.d.ts +0 -8
|
@@ -5,52 +5,62 @@ import type { BarcodeFormat, BarcodeScannerService, PermissionResult, ScannedCod
|
|
|
5
5
|
import { fromDetectorFormat, toDetectorFormats } from './format-map.web'
|
|
6
6
|
|
|
7
7
|
const detector = () => {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const Detector = (globalThis as any).BarcodeDetector
|
|
9
|
+
|
|
10
|
+
return typeof Detector === 'function' ? Detector : null
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
async function toImageSource(image: unknown): Promise<any> {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
if (typeof image === 'string') {
|
|
15
|
+
const response = await fetch(image)
|
|
16
|
+
|
|
17
|
+
return createImageBitmap(await response.blob())
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return image
|
|
18
21
|
}
|
|
19
22
|
|
|
23
|
+
/** Headless barcode service — permission + still-image decode. See BarcodeScannerService. */
|
|
20
24
|
export const barcodeScanner: BarcodeScannerService = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
25
|
+
supported: detector() !== null,
|
|
26
|
+
|
|
27
|
+
ensure(): Promise<PermissionResult> {
|
|
28
|
+
return Promise.resolve(detector() ? 'granted' : 'unsupported')
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
async scanImage(image: unknown, formats?: BarcodeFormat[]): Promise<ScannedCode[]> {
|
|
32
|
+
const Detector = detector()
|
|
33
|
+
|
|
34
|
+
if (!Detector) {
|
|
35
|
+
throw new Error('unsupported: BarcodeDetector is not available')
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let d: any
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
d = new Detector({ formats: toDetectorFormats(formats) })
|
|
42
|
+
} catch {
|
|
43
|
+
d = new Detector()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const source = await toImageSource(image)
|
|
47
|
+
const codes = await d.detect(source)
|
|
48
|
+
|
|
49
|
+
return (codes ?? []).map((code: any) => ({
|
|
50
|
+
type: fromDetectorFormat(code.format),
|
|
51
|
+
data: String(code.rawValue ?? ''),
|
|
52
|
+
bounds: code.boundingBox
|
|
53
|
+
? {
|
|
54
|
+
x: code.boundingBox.x,
|
|
55
|
+
y: code.boundingBox.y,
|
|
56
|
+
width: code.boundingBox.width,
|
|
57
|
+
height: code.boundingBox.height,
|
|
58
|
+
}
|
|
59
|
+
: undefined,
|
|
60
|
+
}))
|
|
61
|
+
},
|
|
53
62
|
}
|
|
54
63
|
|
|
55
64
|
const permissionOwners = ((globalThis as any).__xplatPermissionOwners ??= {})
|
|
65
|
+
|
|
56
66
|
permissionOwners.camera = () => barcodeScanner.ensure()
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
// Windows leaf — no ML Kit/BarcodeDetector backend; report unsupported.
|
|
2
2
|
import type { BarcodeScannerService, PermissionResult } from './types'
|
|
3
3
|
|
|
4
|
+
/** Headless barcode service — permission + still-image decode. See BarcodeScannerService. */
|
|
4
5
|
export const barcodeScanner: BarcodeScannerService = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
supported: false,
|
|
7
|
+
ensure: async (): Promise<PermissionResult> => 'unsupported',
|
|
8
|
+
scanImage: () =>
|
|
9
|
+
Promise.reject(new Error('unsupported: barcode scanning is not available on windows')),
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
const permissionOwners = ((globalThis as any).__xplatPermissionOwners ??= {})
|
|
13
|
+
|
|
11
14
|
permissionOwners.camera = () => barcodeScanner.ensure()
|
package/src/format-map.ts
CHANGED
|
@@ -3,29 +3,29 @@ import { BarcodeFormats } from '@nativescript/mlkit-core'
|
|
|
3
3
|
import type { BarcodeFormat } from './types'
|
|
4
4
|
|
|
5
5
|
const TO_MLKIT: Record<BarcodeFormat, BarcodeFormats> = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
qr: BarcodeFormats.QR_CODE,
|
|
7
|
+
ean13: BarcodeFormats.EAN_13,
|
|
8
|
+
ean8: BarcodeFormats.EAN_8,
|
|
9
|
+
upc_a: BarcodeFormats.UPC_A,
|
|
10
|
+
upc_e: BarcodeFormats.UPC_E,
|
|
11
|
+
code128: BarcodeFormats.CODE_128,
|
|
12
|
+
code39: BarcodeFormats.CODE_39,
|
|
13
|
+
code93: BarcodeFormats.CODE_93,
|
|
14
|
+
codabar: BarcodeFormats.CODABAR,
|
|
15
|
+
itf: BarcodeFormats.ITF,
|
|
16
|
+
datamatrix: BarcodeFormats.DATA_MATRIX,
|
|
17
|
+
pdf417: BarcodeFormats.PDF417,
|
|
18
|
+
aztec: BarcodeFormats.AZTEC,
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const FROM_MLKIT: Record<string, string> = Object.fromEntries(
|
|
22
|
-
|
|
22
|
+
Object.entries(TO_MLKIT).map(([ours, theirs]) => [String(theirs), ours]),
|
|
23
23
|
)
|
|
24
24
|
|
|
25
25
|
export function toNativeFormats(formats?: BarcodeFormat[]): BarcodeFormats[] {
|
|
26
|
-
|
|
26
|
+
return formats?.length ? formats.map((f) => TO_MLKIT[f]) : [BarcodeFormats.ALL]
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export function fromNativeFormat(format: unknown): string {
|
|
30
|
-
|
|
30
|
+
return FROM_MLKIT[String(format)] ?? String(format ?? 'unknown')
|
|
31
31
|
}
|
package/src/format-map.web.ts
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
import type { BarcodeFormat } from './types'
|
|
3
3
|
|
|
4
4
|
const TO_DETECTOR: Record<BarcodeFormat, string> = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
qr: 'qr_code',
|
|
6
|
+
ean13: 'ean_13',
|
|
7
|
+
ean8: 'ean_8',
|
|
8
|
+
upc_a: 'upc_a',
|
|
9
|
+
upc_e: 'upc_e',
|
|
10
|
+
code128: 'code_128',
|
|
11
|
+
code39: 'code_39',
|
|
12
|
+
code93: 'code_93',
|
|
13
|
+
codabar: 'codabar',
|
|
14
|
+
itf: 'itf',
|
|
15
|
+
datamatrix: 'data_matrix',
|
|
16
|
+
pdf417: 'pdf417',
|
|
17
|
+
aztec: 'aztec',
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const FROM_DETECTOR: Record<string, string> = Object.fromEntries(
|
|
21
|
-
|
|
21
|
+
Object.entries(TO_DETECTOR).map(([ours, theirs]) => [theirs, ours]),
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
export function toDetectorFormats(formats?: BarcodeFormat[]): string[] | undefined {
|
|
25
|
-
|
|
25
|
+
return formats?.length ? formats.map((f) => TO_DETECTOR[f]) : undefined
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function fromDetectorFormat(format: unknown): string {
|
|
29
|
-
|
|
29
|
+
return FROM_DETECTOR[String(format)] ?? String(format ?? 'unknown')
|
|
30
30
|
}
|
package/src/index.macos.ts
CHANGED
package/src/native-elements.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Attributes } from '@nativescript-community/octane/intrinsics'
|
|
1
|
+
import type { Attributes } from '@octane-xplat/jsx/intrinsics'
|
|
3
2
|
|
|
4
|
-
declare module '@
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
declare module '@octane-xplat/jsx/intrinsics' {
|
|
4
|
+
interface NativeElements<TElement> {
|
|
5
|
+
xplatbarcodescanner: Attributes<TElement>
|
|
6
|
+
}
|
|
8
7
|
}
|
package/src/props.ts
CHANGED
|
@@ -1,34 +1,43 @@
|
|
|
1
1
|
import type { Octane } from 'octane/jsx-runtime'
|
|
2
2
|
import type { BarcodeFormat, ScannedCode } from './types'
|
|
3
3
|
|
|
4
|
+
/** Imperative handle exposed through the BarcodeScanner `ref`. */
|
|
4
5
|
export interface BarcodeScannerHandle {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/** Pause/resume preview processing (not the camera feed itself). */
|
|
7
|
+
setPaused(paused: boolean): void
|
|
8
|
+
/** Switch between the front and back cameras while scanning. */
|
|
9
|
+
toggleCamera(): void
|
|
10
|
+
/** The underlying MLKitView on native, the <video> element on web. */
|
|
11
|
+
native: unknown
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
/** Live barcode/QR scanning view — ML Kit on native, BarcodeDetector on web.
|
|
13
15
|
* Decoding only: photo capture stays in `@octane-xplat/camera`, gallery
|
|
14
16
|
* picking in `@octane-xplat/media`. */
|
|
15
17
|
export interface BarcodeScannerProps {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
/** Class list applied to the preview element. */
|
|
19
|
+
className?: any
|
|
20
|
+
/** Inline style applied to the preview element (string CSS or object). */
|
|
21
|
+
style?: any
|
|
22
|
+
/** Restrict decoded symbologies — all supported formats by default. */
|
|
23
|
+
formats?: BarcodeFormat[]
|
|
24
|
+
/** Fires for each detected code (the OS may deliver batches). */
|
|
25
|
+
onCodeScanned?: (e: { type: string; data: string; bounds?: ScannedCode['bounds'] }) => void
|
|
26
|
+
/** Freeze detection; preview keeps running. Default false. */
|
|
27
|
+
paused?: boolean
|
|
28
|
+
/** Illuminate the camera torch while scanning. Default false. */
|
|
29
|
+
torch?: boolean
|
|
30
|
+
/** 'back' | 'front'. Default 'back'. */
|
|
31
|
+
facing?: 'back' | 'front'
|
|
32
|
+
/** Detector/preview failures (permission is requested separately via the
|
|
33
|
+
* `barcodeScanner` service, not surfaced here). */
|
|
34
|
+
onError?: (e: { message: string }) => void
|
|
35
|
+
/** Imperative handle — see BarcodeScannerHandle. */
|
|
36
|
+
ref?: Octane.Ref<BarcodeScannerHandle>
|
|
37
|
+
/** Platform escape hatches, applied after the shared props. */
|
|
38
|
+
ios?: Record<string, any>
|
|
39
|
+
/** Platform escape hatch — same bag contract as `ios`. */
|
|
40
|
+
android?: Record<string, any>
|
|
41
|
+
/** Platform escape hatch — same bag contract as `ios`. */
|
|
42
|
+
web?: Record<string, any>
|
|
34
43
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
|
+
/** Result of ensure(): 'unsupported' means the platform has no camera/permission path. */
|
|
1
2
|
export type PermissionResult = 'granted' | 'denied' | 'unsupported'
|
|
2
3
|
|
|
3
4
|
/** Code symbologies — expo-camera spellings; each platform maps them onto
|
|
4
5
|
* its own detector vocabulary (ML Kit BarcodeFormats / BarcodeDetector). */
|
|
5
6
|
export type BarcodeFormat =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
| 'qr'
|
|
8
|
+
| 'ean13'
|
|
9
|
+
| 'ean8'
|
|
10
|
+
| 'upc_a'
|
|
11
|
+
| 'upc_e'
|
|
12
|
+
| 'code128'
|
|
13
|
+
| 'code39'
|
|
14
|
+
| 'code93'
|
|
15
|
+
| 'codabar'
|
|
16
|
+
| 'itf'
|
|
17
|
+
| 'datamatrix'
|
|
18
|
+
| 'pdf417'
|
|
19
|
+
| 'aztec'
|
|
19
20
|
|
|
21
|
+
/** One decoded barcode/QR value. */
|
|
20
22
|
export interface ScannedCode {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
/** The symbology, in our BarcodeFormat spelling. */
|
|
24
|
+
type: string
|
|
25
|
+
/** Decoded payload. */
|
|
26
|
+
data: string
|
|
27
|
+
/** Corner points / bounding rect where the detector reports it. */
|
|
28
|
+
bounds?: { x: number; y: number; width: number; height: number }
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
/** Headless decode + permission service — the scanning view is
|
|
30
32
|
* `<BarcodeScanner>` from the same package. */
|
|
31
33
|
export interface BarcodeScannerService {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
/** Synchronous fast check — a detector backend exists on this platform. */
|
|
35
|
+
readonly supported: boolean
|
|
36
|
+
/** Ensure camera permission for live scanning. */
|
|
37
|
+
ensure(): Promise<PermissionResult>
|
|
38
|
+
/** Decode codes from a still image (platform image ref: a path or
|
|
39
|
+
* ImageSource on native, Blob/HTMLImageElement/data URL on web).
|
|
40
|
+
* Returns [] when the detector finds nothing. */
|
|
41
|
+
scanImage(image: unknown, formats?: BarcodeFormat[]): Promise<ScannedCode[]>
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
export declare const barcodeScanner: BarcodeScannerService
|
|
@@ -2,18 +2,9 @@
|
|
|
2
2
|
"version": 1,
|
|
3
3
|
"files": [
|
|
4
4
|
"BarcodeScanner.d.ts",
|
|
5
|
-
"BarcodeScanner.web.d.ts",
|
|
6
5
|
"barcode-scanner.d.ts",
|
|
7
|
-
"barcode-scanner.linux.d.ts",
|
|
8
|
-
"barcode-scanner.macos.d.ts",
|
|
9
|
-
"barcode-scanner.web.d.ts",
|
|
10
|
-
"barcode-scanner.windows.d.ts",
|
|
11
6
|
"format-map.d.ts",
|
|
12
|
-
"format-map.web.d.ts",
|
|
13
7
|
"index.d.ts",
|
|
14
|
-
"index.macos.d.ts",
|
|
15
|
-
"index.web.d.ts",
|
|
16
|
-
"native-elements.d.ts",
|
|
17
8
|
"props.d.ts",
|
|
18
9
|
"types.d.ts"
|
|
19
10
|
]
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Octane } from 'octane/jsx-runtime';
|
|
2
2
|
import type { BarcodeFormat, ScannedCode } from './types.js';
|
|
3
|
+
/** Imperative handle exposed through the BarcodeScanner `ref`. */
|
|
3
4
|
export interface BarcodeScannerHandle {
|
|
4
5
|
/** Pause/resume preview processing (not the camera feed itself). */
|
|
5
6
|
setPaused(paused: boolean): void;
|
|
7
|
+
/** Switch between the front and back cameras while scanning. */
|
|
6
8
|
toggleCamera(): void;
|
|
7
9
|
/** The underlying MLKitView on native, the <video> element on web. */
|
|
8
10
|
native: unknown;
|
|
@@ -11,7 +13,9 @@ export interface BarcodeScannerHandle {
|
|
|
11
13
|
* Decoding only: photo capture stays in `@octane-xplat/camera`, gallery
|
|
12
14
|
* picking in `@octane-xplat/media`. */
|
|
13
15
|
export interface BarcodeScannerProps {
|
|
16
|
+
/** Class list applied to the preview element. */
|
|
14
17
|
className?: any;
|
|
18
|
+
/** Inline style applied to the preview element (string CSS or object). */
|
|
15
19
|
style?: any;
|
|
16
20
|
/** Restrict decoded symbologies — all supported formats by default. */
|
|
17
21
|
formats?: BarcodeFormat[];
|
|
@@ -27,12 +31,17 @@ export interface BarcodeScannerProps {
|
|
|
27
31
|
torch?: boolean;
|
|
28
32
|
/** 'back' | 'front'. Default 'back'. */
|
|
29
33
|
facing?: 'back' | 'front';
|
|
34
|
+
/** Detector/preview failures (permission is requested separately via the
|
|
35
|
+
* `barcodeScanner` service, not surfaced here). */
|
|
30
36
|
onError?: (e: {
|
|
31
37
|
message: string;
|
|
32
38
|
}) => void;
|
|
39
|
+
/** Imperative handle — see BarcodeScannerHandle. */
|
|
33
40
|
ref?: Octane.Ref<BarcodeScannerHandle>;
|
|
34
41
|
/** Platform escape hatches, applied after the shared props. */
|
|
35
42
|
ios?: Record<string, any>;
|
|
43
|
+
/** Platform escape hatch — same bag contract as `ios`. */
|
|
36
44
|
android?: Record<string, any>;
|
|
45
|
+
/** Platform escape hatch — same bag contract as `ios`. */
|
|
37
46
|
web?: Record<string, any>;
|
|
38
47
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
/** Result of ensure(): 'unsupported' means the platform has no camera/permission path. */
|
|
1
2
|
export type PermissionResult = 'granted' | 'denied' | 'unsupported';
|
|
2
3
|
/** Code symbologies — expo-camera spellings; each platform maps them onto
|
|
3
4
|
* its own detector vocabulary (ML Kit BarcodeFormats / BarcodeDetector). */
|
|
4
5
|
export type BarcodeFormat = 'qr' | 'ean13' | 'ean8' | 'upc_a' | 'upc_e' | 'code128' | 'code39' | 'code93' | 'codabar' | 'itf' | 'datamatrix' | 'pdf417' | 'aztec';
|
|
6
|
+
/** One decoded barcode/QR value. */
|
|
5
7
|
export interface ScannedCode {
|
|
6
8
|
/** The symbology, in our BarcodeFormat spelling. */
|
|
7
9
|
type: string;
|
|
@@ -18,6 +20,7 @@ export interface ScannedCode {
|
|
|
18
20
|
/** Headless decode + permission service — the scanning view is
|
|
19
21
|
* `<BarcodeScanner>` from the same package. */
|
|
20
22
|
export interface BarcodeScannerService {
|
|
23
|
+
/** Synchronous fast check — a detector backend exists on this platform. */
|
|
21
24
|
readonly supported: boolean;
|
|
22
25
|
/** Ensure camera permission for live scanning. */
|
|
23
26
|
ensure(): Promise<PermissionResult>;
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Alec Larson
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { BarcodeScannerProps } from './props.js';
|
|
2
|
-
/** Live barcode/QR scanner — getUserMedia + the BarcodeDetector API
|
|
3
|
-
* (Chromium/Safari 18.4+; Firefox lacks the detector). Polling runs on
|
|
4
|
-
* requestVideoFrameCallback where available, else a 250ms interval. */
|
|
5
|
-
export declare function BarcodeScanner(props: BarcodeScannerProps): import("octane/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { barcodeScanner } from './barcode-scanner.web.js';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { MLKitView } from '@nativescript/mlkit-core'
|
|
2
|
-
import type { Attributes } from '@nativescript-community/octane/intrinsics'
|
|
3
|
-
|
|
4
|
-
declare module '@nativescript-community/octane/intrinsics' {
|
|
5
|
-
interface NativeScriptElements {
|
|
6
|
-
xplatbarcodescanner: Attributes<typeof MLKitView>
|
|
7
|
-
}
|
|
8
|
-
}
|