nano-scan 0.0.1

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.
@@ -0,0 +1,35 @@
1
+ import { ReaderOptions, ReadResult } from 'zxing-wasm/reader';
2
+ export declare function checkCameraConstraintsCapabilities(video: HTMLVideoElement, key: string): boolean;
3
+ export declare function getCameraCapabilitiesZoomRange(video: HTMLVideoElement): {
4
+ min: number;
5
+ max: number;
6
+ };
7
+ export declare function applyVideoZoom(video: HTMLVideoElement, zoom: number): Promise<void>;
8
+ export declare function listCameras(): Promise<MediaDeviceInfo[]>;
9
+ export declare function closeStream(stream: MediaStream): void;
10
+ export declare function requestCameraPermission(): Promise<void>;
11
+ export declare const resolutions: {
12
+ width: number;
13
+ height: number;
14
+ }[];
15
+ export declare function openCamera({ width, height, video }: {
16
+ width: number;
17
+ height: number;
18
+ video: HTMLVideoElement;
19
+ }): Promise<void>;
20
+ export declare function closeCamera(video: HTMLVideoElement): Promise<void>;
21
+ export declare function scanCanvas(ctx?: CanvasRenderingContext2D | null, readerOptions?: ReaderOptions): Promise<ReadResult>;
22
+ export declare function drawTargetRectangle(ctx: CanvasRenderingContext2D, position?: ReadResult['position'] & {
23
+ color?: string;
24
+ }): void;
25
+ export declare function drawTargetRectangleRotated(ctx: CanvasRenderingContext2D, position?: ReadResult['position'] & {
26
+ degree?: number;
27
+ color?: string;
28
+ }): void;
29
+ export declare function drawCameraFrame(ctx: CanvasRenderingContext2D, { size, length, color, }: {
30
+ size?: number;
31
+ length?: number;
32
+ color?: string;
33
+ }): void;
34
+ export declare const fixedFPSCall: (call: () => void, fps?: number) => () => void;
35
+ export declare const noop: () => void;
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "nano-scan",
3
+ "version": "0.0.1",
4
+ "description": "A browser scanning component based on zxing-wasm",
5
+ "main": "dist/umd/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "rolldown -c rolldown.config.ts",
13
+ "dev": "cd examples/react && vite",
14
+ "build:example": "cd examples/react && vite build",
15
+ "preview:example": "cd examples/react && vite preview"
16
+ },
17
+ "homepage": "https://github.com/PEDx/nano-scan",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/PEDx/nano-scan"
21
+ },
22
+ "keywords": [
23
+ "scan",
24
+ "qrcode",
25
+ "barcode",
26
+ "zxing",
27
+ "scanner"
28
+ ],
29
+ "author": "alan.ped",
30
+ "license": "MIT",
31
+ "dependencies": {
32
+ "zxing-wasm": "^2.1.2"
33
+ },
34
+ "devDependencies": {
35
+ "@rollup/plugin-typescript": "^12.1.2",
36
+ "rolldown": "^1.0.0-beta.8",
37
+ "tslib": "^2.8.1"
38
+ }
39
+ }