scandit-capacitor-datacapture-barcode
Advanced tools
Comparing version 6.16.2 to 6.17.0-beta.1
@@ -28,3 +28,3 @@ export declare type Optional<T> = T | null; | ||
export interface ScanditBarcodePluginInterface { | ||
initialize(): Promise<any>; | ||
initialize(coreDefaults: any): Promise<any>; | ||
} | ||
@@ -274,4 +274,4 @@ declare module Scandit { | ||
export interface BarcodeCaptureListener { | ||
didScan?(barcodeCapture: BarcodeCapture, session: BarcodeCaptureSession): void; | ||
didUpdateSession?(barcodeCapture: BarcodeCapture, session: BarcodeCaptureSession): void; | ||
didScan?(barcodeCapture: BarcodeCapture, session: BarcodeCaptureSession, getFrameData: () => Promise<FrameData>): void; | ||
didUpdateSession?(barcodeCapture: BarcodeCapture, session: BarcodeCaptureSession, getFrameData: () => Promise<FrameData>): void; | ||
} | ||
@@ -429,4 +429,4 @@ export class BarcodeCaptureFeedback { | ||
export interface BarcodeSelectionListener { | ||
didUpdateSelection?(barcodeSelection: BarcodeSelection, session: BarcodeSelectionSession): void; | ||
didUpdateSession?(barcodeSelection: BarcodeSelection, session: BarcodeSelectionSession): void; | ||
didUpdateSelection?(barcodeSelection: BarcodeSelection, session: BarcodeSelectionSession, getFrameData: () => Promise<FrameData>): void; | ||
didUpdateSession?(barcodeSelection: BarcodeSelection, session: BarcodeSelectionSession, getFrameData: () => Promise<FrameData>): void; | ||
} | ||
@@ -551,3 +551,3 @@ interface PrivateBarcodeSelectionBasicOverlay { | ||
export interface BarcodeTrackingListener { | ||
didUpdateSession?(barcodeTracking: BarcodeTracking, session: BarcodeTrackingSession): void; | ||
didUpdateSession?(barcodeTracking: BarcodeTracking, session: BarcodeTrackingSession, getFrameData: () => Promise<FrameData>): void; | ||
} | ||
@@ -828,4 +828,86 @@ export interface BarcodeTrackingBasicOverlayListener { | ||
} | ||
export interface FrameDataJSON { | ||
imageBuffers: ImageBufferJSON[]; | ||
orientation: number; | ||
} | ||
export interface ImageBufferJSON { | ||
width: number; | ||
height: number; | ||
data: string; | ||
} | ||
interface PrivateImageBuffer { | ||
_width: number; | ||
_height: number; | ||
_data: string; | ||
} | ||
export interface FrameData { | ||
readonly imageBuffers: ImageBuffer[]; | ||
readonly orientation: number; | ||
} | ||
export class ImageBuffer { | ||
private _width; | ||
private _height; | ||
private _data; | ||
get width(): number; | ||
get height(): number; | ||
get data(): string; | ||
} | ||
class PrivateFrameData implements FrameData { | ||
private _imageBuffers; | ||
private _orientation; | ||
get imageBuffers(): ImageBuffer[]; | ||
get orientation(): number; | ||
static fromJSON(json: FrameDataJSON): FrameData; | ||
} | ||
interface PrivateCamera { | ||
context: Optional<DataCaptureContext>; | ||
position: CameraPosition; | ||
_desiredState: FrameSourceState; | ||
desiredTorchState: TorchState; | ||
settings: CameraSettings; | ||
listeners: FrameSourceListener[]; | ||
_proxy: CameraProxy; | ||
proxy: CameraProxy; | ||
initialize: () => void; | ||
didChange: () => Promise<void>; | ||
} | ||
export class Camera implements FrameSource { | ||
private type; | ||
private settings; | ||
private position; | ||
private _desiredTorchState; | ||
private _desiredState; | ||
private listeners; | ||
private context; | ||
private _proxy; | ||
private get proxy(); | ||
static get default(): Optional<Camera>; | ||
static atPosition(cameraPosition: CameraPosition): Optional<Camera>; | ||
get desiredState(): FrameSourceState; | ||
set desiredTorchState(desiredTorchState: TorchState); | ||
get desiredTorchState(): TorchState; | ||
switchToDesiredState(state: FrameSourceState): Promise<void>; | ||
getCurrentState(): Promise<FrameSourceState>; | ||
getIsTorchAvailable(): Promise<boolean>; | ||
addListener(listener: Optional<FrameSourceListener>): void; | ||
removeListener(listener: Optional<FrameSourceListener>): void; | ||
applySettings(settings: CameraSettings): Promise<void>; | ||
private initialize; | ||
private didChange; | ||
} | ||
export class CameraProxy { | ||
private camera; | ||
static forCamera(camera: Camera): CameraProxy; | ||
static getLastFrame(): Promise<FrameData>; | ||
static getLastFrameOrNull(): Promise<FrameData | null>; | ||
getCurrentState(): Promise<FrameSourceState>; | ||
getIsTorchAvailable(): Promise<boolean>; | ||
} | ||
export class DataCaptureContextProxy { | ||
@@ -832,0 +914,0 @@ private context; |
@@ -10,3 +10,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
import { DefaultSerializeable, ignoreFromSerialization, nameForSerialization, } from '../../../scandit-capacitor-datacapture-core/src/ts/Serializeable'; | ||
import { AimerViewfinder, Brush } from '../../../scandit-capacitor-datacapture-core/src/ts/Viewfinder'; | ||
import { AimerViewfinder, Brush, } from '../../../scandit-capacitor-datacapture-core/src/ts/Viewfinder'; | ||
export class BarcodeSelectionFeedback extends DefaultSerializeable { | ||
@@ -13,0 +13,0 @@ constructor() { |
@@ -0,3 +1,3 @@ | ||
import { CameraProxy } from '../../../../scandit-capacitor-datacapture-core/src/ts/Capacitor/CameraProxy'; | ||
import { BarcodeCaptureSession } from '../BarcodeCapture+Related'; | ||
import { Plugins } from '@capacitor/core'; | ||
import { Capacitor, CapacitorFunction } from './Capacitor'; | ||
@@ -20,9 +20,9 @@ var BarcodeCaptureListenerEvent; | ||
reset() { | ||
return Plugins[Capacitor.pluginName][CapacitorFunction.ResetBarcodeCaptureSession](); | ||
return window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.ResetBarcodeCaptureSession](); | ||
} | ||
subscribeListener() { | ||
Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeCaptureListener](); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeCaptureListener](); | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(BarcodeCaptureListenerEvent.DidScan, this.notifyListeners.bind(this)); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(BarcodeCaptureListenerEvent.DidUpdateSession, this.notifyListeners.bind(this)); | ||
@@ -33,3 +33,3 @@ } | ||
this.barcodeCapture.isInListenerCallback = false; | ||
Plugins[Capacitor.pluginName].finishCallback({ | ||
window.Capacitor.Plugins[Capacitor.pluginName].finishCallback({ | ||
result: { | ||
@@ -55,3 +55,3 @@ enabled: this.barcodeCapture.isEnabled, | ||
listener.didScan(this.barcodeCapture, BarcodeCaptureSession | ||
.fromJSON(JSON.parse(event.session))); | ||
.fromJSON(JSON.parse(event.session)), CameraProxy.getLastFrame); | ||
} | ||
@@ -62,3 +62,3 @@ break; | ||
listener.didUpdateSession(this.barcodeCapture, BarcodeCaptureSession | ||
.fromJSON(JSON.parse(event.session))); | ||
.fromJSON(JSON.parse(event.session)), CameraProxy.getLastFrame); | ||
} | ||
@@ -65,0 +65,0 @@ break; |
@@ -0,3 +1,3 @@ | ||
import { CameraProxy } from '../../../../scandit-capacitor-datacapture-core/src/ts/Capacitor/CameraProxy'; | ||
import { BarcodeSelectionSession, } from '../BarcodeSelection+Related'; | ||
import { Plugins } from '@capacitor/core'; | ||
import { Capacitor, CapacitorFunction } from './Capacitor'; | ||
@@ -24,3 +24,3 @@ var BarcodeSelectionListenerEvent; | ||
reset() { | ||
return Plugins[Capacitor.pluginName][CapacitorFunction.ResetBarcodeSelectionSession](); | ||
return window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.ResetBarcodeSelectionSession](); | ||
} | ||
@@ -31,6 +31,6 @@ initialize() { | ||
subscribeListener() { | ||
Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeSelectionListener](); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeSelectionListener](); | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(BarcodeSelectionListenerEvent.DidUpdateSession, this.notifyListeners.bind(this)); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(BarcodeSelectionListenerEvent.DidUpdateSelection, this.notifyListeners.bind(this)); | ||
@@ -41,3 +41,3 @@ } | ||
this.barcodeSelection.isInListenerCallback = false; | ||
Plugins[Capacitor.pluginName].finishCallback({ | ||
window.Capacitor.Plugins[Capacitor.pluginName].finishCallback({ | ||
result: { | ||
@@ -65,3 +65,3 @@ enabled: this.barcodeSelection.isEnabled, | ||
session.listenerProxy = this; | ||
listener.didUpdateSelection(this.barcodeSelection, session); | ||
listener.didUpdateSelection(this.barcodeSelection, session, CameraProxy.getLastFrame); | ||
} | ||
@@ -74,3 +74,3 @@ break; | ||
session.listenerProxy = this; | ||
listener.didUpdateSession(this.barcodeSelection, session); | ||
listener.didUpdateSession(this.barcodeSelection, session, CameraProxy.getLastFrame); | ||
} | ||
@@ -77,0 +77,0 @@ break; |
import { TrackedBarcode } from '../Barcode'; | ||
import { Plugins } from '@capacitor/core'; | ||
import { doReturnWithFinish } from '../../../../scandit-capacitor-datacapture-core/src/ts/Capacitor/CommonCapacitor'; | ||
@@ -60,7 +59,7 @@ import { Capacitor, CapacitorFunction } from './Capacitor'; | ||
subscribeListener() { | ||
Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeTrackingAdvancedOverlayListener](); | ||
Plugins[Capacitor.pluginName].addListener(BarcodeTrackingAdvancedOverlayListenerEvent.AnchorForTrackedBarcode, this.notifyListeners.bind(this)); | ||
Plugins[Capacitor.pluginName].addListener(BarcodeTrackingAdvancedOverlayListenerEvent.DidTapViewForTrackedBarcode, this.notifyListeners.bind(this)); | ||
Plugins[Capacitor.pluginName].addListener(BarcodeTrackingAdvancedOverlayListenerEvent.OffsetForTrackedBarcode, this.notifyListeners.bind(this)); | ||
Plugins[Capacitor.pluginName].addListener(BarcodeTrackingAdvancedOverlayListenerEvent.ViewForTrackedBarcode, this.notifyListeners.bind(this)); | ||
window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeTrackingAdvancedOverlayListener](); | ||
window.Capacitor.Plugins[Capacitor.pluginName].addListener(BarcodeTrackingAdvancedOverlayListenerEvent.AnchorForTrackedBarcode, this.notifyListeners.bind(this)); | ||
window.Capacitor.Plugins[Capacitor.pluginName].addListener(BarcodeTrackingAdvancedOverlayListenerEvent.DidTapViewForTrackedBarcode, this.notifyListeners.bind(this)); | ||
window.Capacitor.Plugins[Capacitor.pluginName].addListener(BarcodeTrackingAdvancedOverlayListenerEvent.OffsetForTrackedBarcode, this.notifyListeners.bind(this)); | ||
window.Capacitor.Plugins[Capacitor.pluginName].addListener(BarcodeTrackingAdvancedOverlayListenerEvent.ViewForTrackedBarcode, this.notifyListeners.bind(this)); | ||
} | ||
@@ -67,0 +66,0 @@ notifyListeners(event) { |
import { TrackedBarcode } from '../Barcode'; | ||
import { Plugins } from '@capacitor/core'; | ||
import { doReturnWithFinish } from '../../../../scandit-capacitor-datacapture-core/src/ts/Capacitor/CommonCapacitor'; | ||
@@ -32,6 +31,6 @@ import { Capacitor, CapacitorFunction } from './Capacitor'; | ||
subscribeListener() { | ||
Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeTrackingBasicOverlayListener](); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeTrackingBasicOverlayListener](); | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(BarcodeTrackingBasicOverlayListenerEvent.BrushForTrackedBarcode, this.notifyListeners.bind(this)); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(BarcodeTrackingBasicOverlayListenerEvent.DidTapTrackedBarcode, this.notifyListeners.bind(this)); | ||
@@ -38,0 +37,0 @@ } |
@@ -0,3 +1,3 @@ | ||
import { CameraProxy } from '../../../../scandit-capacitor-datacapture-core/src/ts/Capacitor/CameraProxy'; | ||
import { BarcodeTrackingSession, } from '../BarcodeTracking+Related'; | ||
import { Plugins } from '@capacitor/core'; | ||
import { Capacitor, CapacitorFunction } from './Capacitor'; | ||
@@ -19,8 +19,8 @@ var BarcodeTrackingListenerEvent; | ||
subscribeListener() { | ||
Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeTrackingListener](); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeBarcodeTrackingListener](); | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(BarcodeTrackingListenerEvent.DidUpdateSession, this.notifyListeners.bind(this)); | ||
} | ||
reset() { | ||
return Plugins[Capacitor.pluginName][CapacitorFunction.ResetBarcodeTrackingSession](); | ||
return window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.ResetBarcodeTrackingSession](); | ||
} | ||
@@ -30,3 +30,3 @@ notifyListeners(event) { | ||
this.barcodeTracking.isInListenerCallback = false; | ||
Plugins[Capacitor.pluginName].finishCallback({ | ||
window.Capacitor.Plugins[Capacitor.pluginName].finishCallback({ | ||
result: { | ||
@@ -52,3 +52,3 @@ enabled: this.barcodeTracking.isEnabled, | ||
listener.didUpdateSession(this.barcodeTracking, BarcodeTrackingSession | ||
.fromJSON(JSON.parse(event.session))); | ||
.fromJSON(JSON.parse(event.session)), CameraProxy.getLastFrame); | ||
} | ||
@@ -55,0 +55,0 @@ break; |
@@ -27,2 +27,6 @@ import { Defaults } from './Defaults'; | ||
}; | ||
export declare const getDefaults: Promise<Defaults>; | ||
export interface CapacitorWindow extends Window { | ||
Scandit: any; | ||
Capacitor: any; | ||
} | ||
export declare const getDefaults: () => Promise<Defaults>; |
@@ -1,2 +0,10 @@ | ||
import { Plugins } from '@capacitor/core'; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
import { capacitorExec } from '../../../../scandit-capacitor-datacapture-core/src/ts/Capacitor/CommonCapacitor'; | ||
@@ -33,9 +41,16 @@ import { SymbologyDescription } from '../Barcode'; | ||
}; | ||
export const getDefaults = new Promise((resolve, reject) => Plugins[Capacitor.pluginName][CapacitorFunction.GetDefaults]().then((defaultsJSON) => { | ||
const defaults = defaultsFromJSON(defaultsJSON); | ||
Capacitor.defaults = defaults; | ||
resolve(defaults); | ||
}, reject)); | ||
export const getDefaults = () => __awaiter(void 0, void 0, void 0, function* () { | ||
yield window.Capacitor.Plugins[pluginName][CapacitorFunction.GetDefaults]() | ||
.then((defaultsJSON) => { | ||
const defaults = defaultsFromJSON(defaultsJSON); | ||
Capacitor.defaults = defaults; | ||
}) | ||
.catch((error) => { | ||
// tslint:disable-next-line:no-console | ||
console.warn(error); | ||
}); | ||
return Capacitor.defaults; | ||
}); | ||
// To circumvent a circular dependency | ||
SymbologyDescription.defaults = () => Capacitor.defaults; | ||
//# sourceMappingURL=Capacitor.js.map |
import { ScanditBarcodePluginInterface } from './definitions'; | ||
export * from './definitions'; | ||
export declare class ScanditBarcodePluginImplementation implements ScanditBarcodePluginInterface { | ||
initialize(): Promise<any>; | ||
initialize(coreDefaults: any): Promise<any>; | ||
} | ||
export declare const ScanditBarcodePlugin: ScanditBarcodePluginImplementation; |
@@ -11,3 +11,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { registerPlugin } from '@capacitor/core'; | ||
import { getDefaults } from './ts/Capacitor/Capacitor'; | ||
import { Capacitor as CapacitorCore } from '../../scandit-capacitor-datacapture-core/src/ts/Capacitor/Capacitor'; | ||
import { Capacitor as CapacitorBarcode, getDefaults } from './ts/Capacitor/Capacitor'; | ||
import { Barcode, Checksum, CompositeFlag, CompositeType, EncodingRange, LocalizedOnlyBarcode, Range, Symbology, SymbologyDescription, SymbologySettings, TrackedBarcode, } from './ts/Barcode'; | ||
@@ -25,3 +26,3 @@ import { BarcodeCapture, } from './ts/BarcodeCapture'; | ||
export class ScanditBarcodePluginImplementation { | ||
initialize() { | ||
initialize(coreDefaults) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -67,5 +68,6 @@ const api = { | ||
}; | ||
return new Promise((resolve, reject) => getDefaults.then(() => { | ||
resolve(api); | ||
}, reject)); | ||
CapacitorCore.defaults = coreDefaults; | ||
const barcodeDefaults = yield getDefaults(); | ||
CapacitorBarcode.defaults = barcodeDefaults; | ||
return api; | ||
}); | ||
@@ -78,2 +80,3 @@ } | ||
ios: () => new ScanditBarcodePluginImplementation(), | ||
web: () => new ScanditBarcodePluginImplementation(), | ||
}); | ||
@@ -80,0 +83,0 @@ // tslint:disable-next-line:variable-name |
@@ -107,2 +107,33 @@ import { Capacitor } from './Capacitor/Capacitor'; | ||
} | ||
export class ImageBuffer { | ||
get width() { | ||
return this._width; | ||
} | ||
get height() { | ||
return this._height; | ||
} | ||
get data() { | ||
return this._data; | ||
} | ||
} | ||
export class PrivateFrameData { | ||
get imageBuffers() { | ||
return this._imageBuffers; | ||
} | ||
get orientation() { | ||
return this._orientation; | ||
} | ||
static fromJSON(json) { | ||
const frameData = new PrivateFrameData(); | ||
frameData._imageBuffers = json.imageBuffers.map((imageBufferJSON) => { | ||
const imageBuffer = new ImageBuffer(); | ||
imageBuffer._width = imageBufferJSON.width; | ||
imageBuffer._height = imageBufferJSON.height; | ||
imageBuffer._data = imageBufferJSON.data; | ||
return imageBuffer; | ||
}); | ||
frameData._orientation = json.orientation; | ||
return frameData; | ||
} | ||
} | ||
//# sourceMappingURL=Camera+Related.js.map |
@@ -17,2 +17,4 @@ import { Defaults } from './Defaults'; | ||
GetIsTorchAvailable = "getIsTorchAvailable", | ||
GetLastFrame = "getLastFrame", | ||
GetLastFrameOrNull = "getLastFrameOrNull", | ||
EmitFeedback = "emitFeedback", | ||
@@ -22,2 +24,6 @@ SubscribeVolumeButtonObserver = "subscribeVolumeButtonObserver", | ||
} | ||
export interface CapacitorWindow extends Window { | ||
Scandit: any; | ||
Capacitor: any; | ||
} | ||
export declare const pluginName = "ScanditCaptureCoreNative"; | ||
@@ -29,2 +35,2 @@ export declare const Capacitor: { | ||
}; | ||
export declare const getDefaults: Promise<Defaults>; | ||
export declare const getDefaults: () => Promise<Defaults>; |
@@ -1,2 +0,10 @@ | ||
import { Plugins } from '@capacitor/core'; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
import { capacitorExec } from './CommonCapacitor'; | ||
@@ -20,2 +28,4 @@ import { defaultsFromJSON } from './Defaults'; | ||
CapacitorFunction["GetIsTorchAvailable"] = "getIsTorchAvailable"; | ||
CapacitorFunction["GetLastFrame"] = "getLastFrame"; | ||
CapacitorFunction["GetLastFrameOrNull"] = "getLastFrameOrNull"; | ||
CapacitorFunction["EmitFeedback"] = "emitFeedback"; | ||
@@ -32,7 +42,14 @@ CapacitorFunction["SubscribeVolumeButtonObserver"] = "subscribeVolumeButtonObserver"; | ||
}; | ||
export const getDefaults = new Promise((resolve, reject) => Plugins[Capacitor.pluginName][CapacitorFunction.GetDefaults]().then((defaultsJSON) => { | ||
const defaults = defaultsFromJSON(defaultsJSON); | ||
Capacitor.defaults = defaults; | ||
resolve(defaults); | ||
}, reject)); | ||
export const getDefaults = () => __awaiter(void 0, void 0, void 0, function* () { | ||
yield window.Capacitor.Plugins[pluginName][CapacitorFunction.GetDefaults]() | ||
.then((defaultsJSON) => { | ||
const defaults = defaultsFromJSON(defaultsJSON); | ||
Capacitor.defaults = defaults; | ||
}) | ||
.catch((error) => { | ||
// tslint:disable-next-line:no-console | ||
console.warn(error); | ||
}); | ||
return Capacitor.defaults; | ||
}); | ||
//# sourceMappingURL=Capacitor.js.map |
@@ -1,2 +0,1 @@ | ||
import { Plugins } from '@capacitor/core'; | ||
export class CapacitorError { | ||
@@ -36,3 +35,3 @@ constructor(code, message) { | ||
} | ||
Plugins[pluginName].finishCallback([{ | ||
window.Capacitor.Plugins[pluginName].finishCallback([{ | ||
finishCallbackID, | ||
@@ -52,10 +51,10 @@ result: callbackResult, | ||
}; | ||
Plugins[pluginName][functionName](args).then(extendedSuccessCallback, extendedErrorCallback); | ||
window.Capacitor.Plugins[pluginName][functionName](args).then(extendedSuccessCallback, extendedErrorCallback); | ||
}; | ||
export const doReturnWithFinish = (finishCallbackID, result) => { | ||
if (Plugins.ScanditBarcodeNative) { | ||
Plugins.ScanditBarcodeNative.finishCallback({ result: Object.assign({ finishCallbackID }, result) }); | ||
if (window.Capacitor.Plugins.ScanditBarcodeNative) { | ||
window.Capacitor.Plugins.ScanditBarcodeNative.finishCallback({ result: Object.assign({ finishCallbackID }, result) }); | ||
} | ||
else if (Plugins.ScanditIdNative) { | ||
Plugins.ScanditIdNative.finishCallback({ result: Object.assign({ finishCallbackID }, result) }); | ||
else if (window.Capacitor.Plugins.ScanditIdNative) { | ||
window.Capacitor.Plugins.ScanditIdNative.finishCallback({ result: Object.assign({ finishCallbackID }, result) }); | ||
} | ||
@@ -62,0 +61,0 @@ return result; |
@@ -1,2 +0,1 @@ | ||
import { Plugins } from '@capacitor/core'; | ||
import { ContextStatus } from '../DataCaptureContext+Related'; | ||
@@ -23,3 +22,3 @@ import { Capacitor, CapacitorFunction } from './Capacitor'; | ||
updateContextFromJSON() { | ||
return new Promise((resolve, reject) => Plugins[Capacitor.pluginName][CapacitorFunction.UpdateContextFromJSON]({ | ||
return new Promise((resolve, reject) => window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.UpdateContextFromJSON]({ | ||
context: JSON.stringify(this.context.toJSON()), | ||
@@ -29,3 +28,3 @@ }).then(resolve.bind(this), reject.bind(this))); | ||
dispose() { | ||
Plugins[Capacitor.pluginName][CapacitorFunction.DisposeContext](); | ||
window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.DisposeContext](); | ||
} | ||
@@ -39,3 +38,3 @@ initialize() { | ||
initializeContextFromJSON() { | ||
return new Promise((resolve, reject) => Plugins[Capacitor.pluginName][CapacitorFunction.ContextFromJSON]({ | ||
return new Promise((resolve, reject) => window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.ContextFromJSON]({ | ||
context: JSON.stringify(this.context.toJSON()), | ||
@@ -45,6 +44,6 @@ }).then(resolve.bind(this), reject.bind(this))); | ||
subscribeListener() { | ||
Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeContextListener](); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeContextListener](); | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(DataCaptureContextListenerEvent.DidChangeContextStatus, this.notifyListeners.bind(this)); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(DataCaptureContextListenerEvent.DidStartObservingContext, this.notifyListeners.bind(this)); | ||
@@ -54,3 +53,3 @@ } | ||
// private subscribeFrameListener() { | ||
// Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeContextFrameListener]() | ||
// window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeContextFrameListener]() | ||
// .then(this.notifyFrameListeners.bind(this), null) | ||
@@ -57,0 +56,0 @@ // } |
@@ -1,3 +0,2 @@ | ||
import { Plugins } from '@capacitor/core'; | ||
import { Point, Quadrilateral, Size } from '../Common'; | ||
import { Point, Quadrilateral, Size, } from '../Common'; | ||
import { Capacitor, CapacitorFunction } from './Capacitor'; | ||
@@ -17,3 +16,3 @@ import { doReturnWithFinish } from './CommonCapacitor'; | ||
setPositionAndSize(top, left, width, height, shouldBeUnderWebView) { | ||
return new Promise((resolve, reject) => Plugins[Capacitor.pluginName][CapacitorFunction.SetViewPositionAndSize]({ | ||
return new Promise((resolve, reject) => window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.SetViewPositionAndSize]({ | ||
position: { top, left, width, height, shouldBeUnderWebView }, | ||
@@ -23,9 +22,9 @@ }).then(resolve.bind(this), reject.bind(this))); | ||
show() { | ||
return Plugins[Capacitor.pluginName][CapacitorFunction.ShowView](); | ||
return window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.ShowView](); | ||
} | ||
hide() { | ||
return Plugins[Capacitor.pluginName][CapacitorFunction.HideView](); | ||
return window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.HideView](); | ||
} | ||
viewPointForFramePoint(point) { | ||
return new Promise((resolve, reject) => Plugins[Capacitor.pluginName][CapacitorFunction.ViewPointForFramePoint]({ | ||
return new Promise((resolve, reject) => window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.ViewPointForFramePoint]({ | ||
point: point.toJSON(), | ||
@@ -35,3 +34,3 @@ }).then((convertedPoint) => resolve(Point.fromJSON(convertedPoint)), reject.bind(this))); | ||
viewQuadrilateralForFrameQuadrilateral(quadrilateral) { | ||
return new Promise((resolve, reject) => Plugins[Capacitor.pluginName][CapacitorFunction.ViewQuadrilateralForFrameQuadrilateral]({ | ||
return new Promise((resolve, reject) => window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.ViewQuadrilateralForFrameQuadrilateral]({ | ||
point: quadrilateral.toJSON(), | ||
@@ -42,4 +41,4 @@ }).then((convertedQuadrilateral) => resolve(Quadrilateral | ||
subscribeListener() { | ||
Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeViewListener](); | ||
Plugins[Capacitor.pluginName] | ||
window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.SubscribeViewListener](); | ||
window.Capacitor.Plugins[Capacitor.pluginName] | ||
.addListener(DataCaptureViewListenerEvent.DidChangeSizeOrientation, this.notifyListeners.bind(this)); | ||
@@ -46,0 +45,0 @@ } |
@@ -1,2 +0,1 @@ | ||
import { Plugins } from '@capacitor/core'; | ||
import { Capacitor, CapacitorFunction } from './Capacitor'; | ||
@@ -10,5 +9,5 @@ export class FeedbackProxy { | ||
emit() { | ||
Plugins[Capacitor.pluginName][CapacitorFunction.EmitFeedback]({ feedback: this.feedback.toJSON() }); | ||
window.Capacitor.Plugins[Capacitor.pluginName][CapacitorFunction.EmitFeedback]({ feedback: this.feedback.toJSON() }); | ||
} | ||
} | ||
//# sourceMappingURL=FeedbackProxy.js.map |
{ | ||
"name": "scandit-capacitor-datacapture-barcode", | ||
"version": "6.16.2", | ||
"version": "6.17.0-beta.1", | ||
"description": "Scandit Data Capture SDK for Capacitor", | ||
@@ -25,3 +25,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"scandit-capacitor-datacapture-core": "6.16.2" | ||
"scandit-capacitor-datacapture-core": "6.17.0-beta.1" | ||
}, | ||
@@ -34,10 +34,10 @@ "devDependencies": { | ||
"@ionic/swiftlint-config": "^1.0.0", | ||
"@rollup/plugin-node-resolve": "^8.1.0", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"prettier": "^2.0.5", | ||
"prettier-plugin-java": "^0.8.0", | ||
"rimraf": "^3.0.0", | ||
"rollup": "^2.21.0", | ||
"prettier-plugin-java": "^2.0.0", | ||
"rimraf": "^4.1.2", | ||
"rollup": "^2.79.1", | ||
"swiftlint": "^1.0.1", | ||
"typescript": "~3.8.3", | ||
"tslint": "^5.16.0" | ||
"eslint": "^7.32.0" | ||
}, | ||
@@ -44,0 +44,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
1023979
157
9188
1
+ Addedscandit-capacitor-datacapture-core@6.17.0-beta.1(transitive)
- Removedscandit-capacitor-datacapture-core@6.16.2(transitive)