Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yudiel/react-qr-scanner

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yudiel/react-qr-scanner - npm Package Compare versions

Comparing version 2.0.0-beta.1 to 2.0.0-beta.2

40

dist/cjs/scanners/BrowserScanner.d.ts
import { DecodeContinuouslyCallback, BinaryBitmap, Reader, Result } from '@zxing/library';
import { HTMLVisualMediaElement } from '../types/HTMLVisualMediaElement';
import { IBrowserScannerOptions, IScannerControl } from '../types';

@@ -9,22 +8,2 @@ export declare class BrowserScanner {

constructor(reader: Reader, options: IBrowserScannerOptions);
static addVideoSource(videoElement: HTMLVideoElement, stream: MediaStream): void;
static mediaStreamSetTorch(track: MediaStreamTrack, onOff: boolean): Promise<void>;
static mediaStreamIsTorchCompatible(params: MediaStream): boolean;
static mediaStreamIsTorchCompatibleTrack(track: MediaStreamTrack): boolean;
static isVideoPlaying(video: HTMLVideoElement): boolean;
static getMediaElement(mediaElementId: string, type: string): HTMLVisualMediaElement;
static createVideoElement(videoThingy?: HTMLVideoElement | string): HTMLVideoElement;
static prepareVideoElement(videoElem?: HTMLVideoElement | string): HTMLVideoElement;
static createBinaryBitmapFromCanvas(canvas: HTMLCanvasElement): BinaryBitmap;
static drawImageOnCanvas(canvasElementContext: CanvasRenderingContext2D, srcElement: HTMLVisualMediaElement): void;
static getMediaElementDimensions(mediaElement: HTMLVisualMediaElement): {
height: number;
width: number;
};
static createCaptureCanvas(mediaElement: HTMLVisualMediaElement): HTMLCanvasElement;
static tryPlayVideo(videoElement: HTMLVideoElement): Promise<boolean>;
static cleanVideoSource(videoElement: HTMLVideoElement): void;
static releaseAllStreams(): void;
protected static playVideoOnLoadAsync(element: HTMLVideoElement, timeout: number): Promise<boolean>;
protected static attachStreamToVideo(stream: MediaStream, preview?: string | HTMLVideoElement, previewPlayTimeout?: number): Promise<HTMLVideoElement>;
decodeBitmap(binaryBitmap: BinaryBitmap): Result;

@@ -35,4 +14,21 @@ decodeFromCanvas(canvas: HTMLCanvasElement): Result;

decodeFromVideoDevice(deviceId: string | undefined, previewElem: string | HTMLVideoElement | undefined, callbackFn: DecodeContinuouslyCallback): Promise<IScannerControl>;
scan(element: HTMLVisualMediaElement, callbackFn: DecodeContinuouslyCallback, finalizeCallback?: (error?: Error) => void): IScannerControl;
static cleanVideoSource(videoElement: HTMLVideoElement): void;
static releaseAllStreams(): void;
static listVideoInputDevices(requestPermission?: boolean): Promise<MediaDeviceInfo[]>;
private static addVideoSource;
private static mediaStreamSetTorch;
private static mediaStreamIsTorchCompatible;
private static mediaStreamIsTorchCompatibleTrack;
private static isVideoPlaying;
private static getMediaElement;
private static createVideoElement;
private static prepareVideoElement;
private static createBinaryBitmapFromCanvas;
private static drawImageOnCanvas;
private static getMediaElementDimensions;
private static createCaptureCanvas;
private static tryPlayVideo;
private static playVideoOnLoadAsync;
private static attachStreamToVideo;
private scan;
private getUserMedia;

@@ -39,0 +35,0 @@ private static checkCallbackFnOrThrow;

interface IScannerControls {
stop: () => void;
stop: () => Promise<void>;
switchTorch?: (onOff: boolean) => Promise<void>;

@@ -4,0 +4,0 @@ setStreamVideoConstraints?: (constraints: MediaTrackConstraints, trackFilter?: (track: MediaStreamTrack) => MediaStreamTrack[]) => void;

import { DecodeContinuouslyCallback, BinaryBitmap, Reader, Result } from '@zxing/library';
import { HTMLVisualMediaElement } from '../types/HTMLVisualMediaElement';
import { IBrowserScannerOptions, IScannerControl } from '../types';

@@ -9,22 +8,2 @@ export declare class BrowserScanner {

constructor(reader: Reader, options: IBrowserScannerOptions);
static addVideoSource(videoElement: HTMLVideoElement, stream: MediaStream): void;
static mediaStreamSetTorch(track: MediaStreamTrack, onOff: boolean): Promise<void>;
static mediaStreamIsTorchCompatible(params: MediaStream): boolean;
static mediaStreamIsTorchCompatibleTrack(track: MediaStreamTrack): boolean;
static isVideoPlaying(video: HTMLVideoElement): boolean;
static getMediaElement(mediaElementId: string, type: string): HTMLVisualMediaElement;
static createVideoElement(videoThingy?: HTMLVideoElement | string): HTMLVideoElement;
static prepareVideoElement(videoElem?: HTMLVideoElement | string): HTMLVideoElement;
static createBinaryBitmapFromCanvas(canvas: HTMLCanvasElement): BinaryBitmap;
static drawImageOnCanvas(canvasElementContext: CanvasRenderingContext2D, srcElement: HTMLVisualMediaElement): void;
static getMediaElementDimensions(mediaElement: HTMLVisualMediaElement): {
height: number;
width: number;
};
static createCaptureCanvas(mediaElement: HTMLVisualMediaElement): HTMLCanvasElement;
static tryPlayVideo(videoElement: HTMLVideoElement): Promise<boolean>;
static cleanVideoSource(videoElement: HTMLVideoElement): void;
static releaseAllStreams(): void;
protected static playVideoOnLoadAsync(element: HTMLVideoElement, timeout: number): Promise<boolean>;
protected static attachStreamToVideo(stream: MediaStream, preview?: string | HTMLVideoElement, previewPlayTimeout?: number): Promise<HTMLVideoElement>;
decodeBitmap(binaryBitmap: BinaryBitmap): Result;

@@ -35,4 +14,21 @@ decodeFromCanvas(canvas: HTMLCanvasElement): Result;

decodeFromVideoDevice(deviceId: string | undefined, previewElem: string | HTMLVideoElement | undefined, callbackFn: DecodeContinuouslyCallback): Promise<IScannerControl>;
scan(element: HTMLVisualMediaElement, callbackFn: DecodeContinuouslyCallback, finalizeCallback?: (error?: Error) => void): IScannerControl;
static cleanVideoSource(videoElement: HTMLVideoElement): void;
static releaseAllStreams(): void;
static listVideoInputDevices(requestPermission?: boolean): Promise<MediaDeviceInfo[]>;
private static addVideoSource;
private static mediaStreamSetTorch;
private static mediaStreamIsTorchCompatible;
private static mediaStreamIsTorchCompatibleTrack;
private static isVideoPlaying;
private static getMediaElement;
private static createVideoElement;
private static prepareVideoElement;
private static createBinaryBitmapFromCanvas;
private static drawImageOnCanvas;
private static getMediaElementDimensions;
private static createCaptureCanvas;
private static tryPlayVideo;
private static playVideoOnLoadAsync;
private static attachStreamToVideo;
private scan;
private getUserMedia;

@@ -39,0 +35,0 @@ private static checkCallbackFnOrThrow;

interface IScannerControls {
stop: () => void;
stop: () => Promise<void>;
switchTorch?: (onOff: boolean) => Promise<void>;

@@ -4,0 +4,0 @@ setStreamVideoConstraints?: (constraints: MediaTrackConstraints, trackFilter?: (track: MediaStreamTrack) => MediaStreamTrack[]) => void;

{
"name": "@yudiel/react-qr-scanner",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"description": "A library to scan qr codes in react.",

@@ -5,0 +5,0 @@ "author": "Yudiel Curbelo",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc