@yudiel/react-qr-scanner
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5077338
4491