@capturebridge/sdk 0.7.0 → 0.8.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/Camera.js +63 -68
- package/CanonCamera.js +25 -25
- package/CaptureBridge.js +160 -162
- package/CapturePlugin.js +68 -79
- package/Common.js +182 -98
- package/Device.js +547 -451
- package/ICAO.js +70 -70
- package/IFace.js +278 -274
- package/Logs.js +129 -129
- package/MockCamera.js +17 -10
- package/Plugin.js +299 -298
- package/Scanner.js +55 -64
- package/SignatureTablet.js +108 -109
- package/SignatureTabletWidgets.js +164 -153
- package/StreamingCapturePlugin.js +129 -121
- package/TopazSigGem.js +25 -25
- package/Version.js +8 -0
- package/WindowsScanner.js +25 -0
- package/examples/canon.html +66 -0
- package/examples/canon_getframe.html +68 -0
- package/examples/canon_lan.html +68 -0
- package/examples/canon_minimal.html +37 -0
- package/examples/mockcamera.html +61 -0
- package/examples/mockcamera_getframe.html +63 -0
- package/examples/mockcamera_minimal.html +31 -0
- package/examples/windows_scanner_minimal.html +32 -0
- package/package.json +2 -2
package/Camera.js
CHANGED
|
@@ -1,68 +1,63 @@
|
|
|
1
|
-
import StreamingCapturePlugin from './StreamingCapturePlugin.js'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
20
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
asyncToCallback(this, this.fullCapture, callback, kind, deviceOpt)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export default Camera
|
|
1
|
+
import StreamingCapturePlugin from './StreamingCapturePlugin.js'
|
|
2
|
+
import {
|
|
3
|
+
BASE_URL,
|
|
4
|
+
DEFAULT_CAPTURE_OPT,
|
|
5
|
+
DEPRECATION_01,
|
|
6
|
+
asyncToCallback
|
|
7
|
+
} from './Common.js'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Camera
|
|
11
|
+
* @classdesc Class for invoking methods on a Camera
|
|
12
|
+
* @extends StreamingCapturePlugin
|
|
13
|
+
* @see {@link CanonCamera}
|
|
14
|
+
*/
|
|
15
|
+
class Camera extends StreamingCapturePlugin {
|
|
16
|
+
/**
|
|
17
|
+
* Instantiate a Generic Camera
|
|
18
|
+
* @constructor
|
|
19
|
+
* @param {string} pluginId - The Id of the desired plugin to use for this
|
|
20
|
+
* camera instance. The plugin must support the `start_feed`, `stop_feed`,
|
|
21
|
+
* `devices`, and `capture` methods.
|
|
22
|
+
* @param {string} [baseURL] - Protocol, domain, and port for the service.
|
|
23
|
+
* @example
|
|
24
|
+
* const camera = new Camera('capture_camera_canon')
|
|
25
|
+
*/
|
|
26
|
+
constructor (pluginId, baseUrl = BASE_URL) {
|
|
27
|
+
super(pluginId, baseUrl)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Capture a photo
|
|
32
|
+
* @param {CaptureOptions} [captureOpt] - Additional options for capturing a
|
|
33
|
+
* photo.
|
|
34
|
+
* @param {string|object} [deviceOpt] - Take the photo using either a specific
|
|
35
|
+
* Device ID or a Device Object. The default is the first available device.
|
|
36
|
+
*
|
|
37
|
+
* @async
|
|
38
|
+
* @example
|
|
39
|
+
* // Capture a photo as an ObjectURL, add it to an img element and append to
|
|
40
|
+
* // the document's body.
|
|
41
|
+
* const img = document.createElement('img')
|
|
42
|
+
* img.src = await camera.takePhoto()
|
|
43
|
+
* document.body.appendChild(img)
|
|
44
|
+
*/
|
|
45
|
+
async takePhoto (captureOpt = {}, deviceOpt) {
|
|
46
|
+
if (typeof captureOpt === 'string' && DEPRECATION_01) {
|
|
47
|
+
captureOpt = { kind: captureOpt }
|
|
48
|
+
console.warn('CaptureBridge SDK Deprecation Warning: ' +
|
|
49
|
+
'`Camera.takePhoto()` converted the `captureOpt` argument from a ' +
|
|
50
|
+
'string (%s) to an object (%s). This conversion may not be performed ' +
|
|
51
|
+
'in future SDK versions.',
|
|
52
|
+
captureOpt.kind, JSON.stringify(captureOpt))
|
|
53
|
+
}
|
|
54
|
+
const mergedOpt = Object.assign({}, DEFAULT_CAPTURE_OPT, captureOpt)
|
|
55
|
+
return await this.fullCapture(mergedOpt, deviceOpt)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
takePhotoHandler (captureOpt = {}, deviceOpt, callback) {
|
|
59
|
+
asyncToCallback(this, this.fullCapture, callback, captureOpt, deviceOpt)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default Camera
|
package/CanonCamera.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import Camera from './Camera.js'
|
|
2
|
-
import { BASE_URL } from './Common.js'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* CanonCamera
|
|
6
|
-
* @classdesc Convenience class for instantiating a Canon Camera Object.
|
|
7
|
-
* Inherits all methods on the {@link Camera} class.
|
|
8
|
-
*
|
|
9
|
-
* @see {@link Camera}
|
|
10
|
-
*/
|
|
11
|
-
class CanonCamera extends Camera {
|
|
12
|
-
/**
|
|
13
|
-
* Instantiate a Canon Camera
|
|
14
|
-
* @constructor
|
|
15
|
-
* @param {string} [baseURL] - Protocol, domain, and port for the service.
|
|
16
|
-
* @example
|
|
17
|
-
* const camera = new CanonCamera()
|
|
18
|
-
* const base64 = await camera.takePhoto('base64')
|
|
19
|
-
*/
|
|
20
|
-
constructor (baseUrl = BASE_URL) {
|
|
21
|
-
super('capture_camera_canon', baseUrl)
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default CanonCamera
|
|
1
|
+
import Camera from './Camera.js'
|
|
2
|
+
import { BASE_URL } from './Common.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CanonCamera
|
|
6
|
+
* @classdesc Convenience class for instantiating a Canon Camera Object.
|
|
7
|
+
* Inherits all methods on the {@link Camera} class.
|
|
8
|
+
* @extends Camera
|
|
9
|
+
* @see {@link Camera}
|
|
10
|
+
*/
|
|
11
|
+
class CanonCamera extends Camera {
|
|
12
|
+
/**
|
|
13
|
+
* Instantiate a Canon Camera
|
|
14
|
+
* @constructor
|
|
15
|
+
* @param {string} [baseURL] - Protocol, domain, and port for the service.
|
|
16
|
+
* @example
|
|
17
|
+
* const camera = new CanonCamera()
|
|
18
|
+
* const base64 = await camera.takePhoto({kind: 'base64'})
|
|
19
|
+
*/
|
|
20
|
+
constructor (baseUrl = BASE_URL) {
|
|
21
|
+
super('capture_camera_canon', baseUrl)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default CanonCamera
|
package/CaptureBridge.js
CHANGED
|
@@ -1,162 +1,160 @@
|
|
|
1
|
-
import Plugin from './Plugin.js'
|
|
2
|
-
import { BASE_URL, asyncToCallback } from './Common.js'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Capture Bridge
|
|
6
|
-
*
|
|
7
|
-
* @classdesc Class for interacting with the HTTP API's base methods.
|
|
8
|
-
*/
|
|
9
|
-
class CaptureBridge {
|
|
10
|
-
baseUrl
|
|
11
|
-
/**
|
|
12
|
-
* Instantiate a client for interacting with the Capture Bridge service.
|
|
13
|
-
* @constructor
|
|
14
|
-
* @param {string} [baseURL] - Protocol, domain, and port for the service.
|
|
15
|
-
* @example
|
|
16
|
-
* const captureBridge = new CaptureBridge()
|
|
17
|
-
*/
|
|
18
|
-
constructor (baseUrl = BASE_URL) {
|
|
19
|
-
this.baseUrl = baseUrl
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Get service version info
|
|
24
|
-
* @method
|
|
25
|
-
* @async
|
|
26
|
-
* @returns {object} Service version info.
|
|
27
|
-
* @see {@link https://
|
|
28
|
-
* @example
|
|
29
|
-
* const captureBridge = new CaptureBridge()
|
|
30
|
-
* const {version} = await captureBridge.version()
|
|
31
|
-
* console.log(version)
|
|
32
|
-
*/
|
|
33
|
-
async version () {
|
|
34
|
-
const response = await fetch(`${this.baseUrl}/version`)
|
|
35
|
-
return await response.json()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Get service version info (Callback)
|
|
40
|
-
* @method
|
|
41
|
-
* @see {@link https://
|
|
42
|
-
* @param {function} callback - Invoked with two arguments. The first argument
|
|
43
|
-
* is an Error object (if an error occurred) or null. The second argument is
|
|
44
|
-
* the version info.
|
|
45
|
-
* @example
|
|
46
|
-
* captureBridge.versionHandler((error, {version}) => {
|
|
47
|
-
* if (error) {
|
|
48
|
-
* console.error('Error fetching version:', error)
|
|
49
|
-
* } else {
|
|
50
|
-
* console.log(`Version: ${version}`)
|
|
51
|
-
* }
|
|
52
|
-
* })
|
|
53
|
-
*/
|
|
54
|
-
versionHandler (callback) {
|
|
55
|
-
asyncToCallback(this, this.version, callback)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Get service status information
|
|
60
|
-
* @method
|
|
61
|
-
* @async
|
|
62
|
-
* @see {@link https://
|
|
63
|
-
* @returns {object} Service status information.
|
|
64
|
-
* @example
|
|
65
|
-
* const captureBridge = new CaptureBridge()
|
|
66
|
-
* const statusInfo = await captureBridge.status()
|
|
67
|
-
* console.log(statusInfo)
|
|
68
|
-
*/
|
|
69
|
-
async status () {
|
|
70
|
-
const response = await fetch(`${this.baseUrl}/status`)
|
|
71
|
-
return await response.json()
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Get service status information (Callback)
|
|
76
|
-
* @method
|
|
77
|
-
* @see {@link https://
|
|
78
|
-
* @param {function} callback - Invoked with two arguments. The first argument
|
|
79
|
-
* is an Error object (if an error occurred) or null. The second argument is
|
|
80
|
-
* the status info.
|
|
81
|
-
* object.
|
|
82
|
-
* @example
|
|
83
|
-
* const captureBridge = new CaptureBridge()
|
|
84
|
-
* captureBridge.statusHandler(statusInfo => console.log(statusInfo))
|
|
85
|
-
*/
|
|
86
|
-
statusHandler (callback) {
|
|
87
|
-
asyncToCallback(this, this.status, callback)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Get all installed plugins
|
|
92
|
-
* @method
|
|
93
|
-
* @async
|
|
94
|
-
* @see {@link https://
|
|
95
|
-
* @see {@link Plugin}
|
|
96
|
-
* @returns {object[]} Array of {@link Plugin} objects.
|
|
97
|
-
* @example
|
|
98
|
-
* const plugins = await captureBridge.plugins()
|
|
99
|
-
*/
|
|
100
|
-
async plugins () {
|
|
101
|
-
const response = await fetch(`${this.baseUrl}/plugin`)
|
|
102
|
-
const plugins = await response.json()
|
|
103
|
-
return plugins.map(p => new Plugin(p, this.baseUrl))
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Get all installed plugins (Callback)
|
|
108
|
-
* @method
|
|
109
|
-
* @see {@link https://
|
|
110
|
-
* @see {@link Plugin}
|
|
111
|
-
* @param {function} callback - Invoked with two arguments. The first argument
|
|
112
|
-
* is an Error object (if an error occurred) or null. The second argument is
|
|
113
|
-
* an Array of {@link Plugin} objects. If no plugins are installed the second
|
|
114
|
-
* argument will be an empty Array.
|
|
115
|
-
* @example
|
|
116
|
-
* captureBridge.pluginsHandler(plugins => console.log(plugins))
|
|
117
|
-
*/
|
|
118
|
-
pluginsHandler (callback) {
|
|
119
|
-
asyncToCallback(this, this.plugins, callback)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Get a single plugin by ID
|
|
124
|
-
* @method
|
|
125
|
-
* @async
|
|
126
|
-
* @see {@link https://
|
|
127
|
-
* @see {@link Plugin}
|
|
128
|
-
* @param {string} id - Plugin ID
|
|
129
|
-
* @returns {object?} {@link Plugin} object or null
|
|
130
|
-
* @example
|
|
131
|
-
* const plugin = await captureBridge.plugin('capture_camera_canon')
|
|
132
|
-
*/
|
|
133
|
-
async plugin (id) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
*
|
|
144
|
-
* @
|
|
145
|
-
* @
|
|
146
|
-
* @
|
|
147
|
-
*
|
|
148
|
-
* @
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
export default CaptureBridge
|
|
1
|
+
import Plugin from './Plugin.js'
|
|
2
|
+
import { BASE_URL, asyncToCallback, checkResponse } from './Common.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Capture Bridge
|
|
6
|
+
*
|
|
7
|
+
* @classdesc Class for interacting with the HTTP API's base methods.
|
|
8
|
+
*/
|
|
9
|
+
class CaptureBridge {
|
|
10
|
+
baseUrl
|
|
11
|
+
/**
|
|
12
|
+
* Instantiate a client for interacting with the Capture Bridge service.
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {string} [baseURL] - Protocol, domain, and port for the service.
|
|
15
|
+
* @example
|
|
16
|
+
* const captureBridge = new CaptureBridge()
|
|
17
|
+
*/
|
|
18
|
+
constructor (baseUrl = BASE_URL) {
|
|
19
|
+
this.baseUrl = baseUrl
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Get service version info
|
|
24
|
+
* @method
|
|
25
|
+
* @async
|
|
26
|
+
* @returns {object} Service version info.
|
|
27
|
+
* @see {@link https://local.capturebridge.net:9001/doc/#api-Service-GetVersion|API Endpoint (/version)}
|
|
28
|
+
* @example
|
|
29
|
+
* const captureBridge = new CaptureBridge()
|
|
30
|
+
* const {version} = await captureBridge.version()
|
|
31
|
+
* console.log(version)
|
|
32
|
+
*/
|
|
33
|
+
async version () {
|
|
34
|
+
const response = await fetch(`${this.baseUrl}/version`)
|
|
35
|
+
return await response.json()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get service version info (Callback)
|
|
40
|
+
* @method
|
|
41
|
+
* @see {@link https://local.capturebridge.net:9001/doc/#api-Service-GetVersion|API Endpoint (/version)}
|
|
42
|
+
* @param {function} callback - Invoked with two arguments. The first argument
|
|
43
|
+
* is an Error object (if an error occurred) or null. The second argument is
|
|
44
|
+
* the version info.
|
|
45
|
+
* @example
|
|
46
|
+
* captureBridge.versionHandler((error, {version}) => {
|
|
47
|
+
* if (error) {
|
|
48
|
+
* console.error('Error fetching version:', error)
|
|
49
|
+
* } else {
|
|
50
|
+
* console.log(`Version: ${version}`)
|
|
51
|
+
* }
|
|
52
|
+
* })
|
|
53
|
+
*/
|
|
54
|
+
versionHandler (callback) {
|
|
55
|
+
asyncToCallback(this, this.version, callback)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get service status information
|
|
60
|
+
* @method
|
|
61
|
+
* @async
|
|
62
|
+
* @see {@link https://local.capturebridge.net:9001/doc/#api-Service-GetStatus|API Endpoint (/status)}
|
|
63
|
+
* @returns {object} Service status information.
|
|
64
|
+
* @example
|
|
65
|
+
* const captureBridge = new CaptureBridge()
|
|
66
|
+
* const statusInfo = await captureBridge.status()
|
|
67
|
+
* console.log(statusInfo)
|
|
68
|
+
*/
|
|
69
|
+
async status () {
|
|
70
|
+
const response = await fetch(`${this.baseUrl}/status`)
|
|
71
|
+
return await response.json()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Get service status information (Callback)
|
|
76
|
+
* @method
|
|
77
|
+
* @see {@link https://local.capturebridge.net:9001/doc/#api-Service-GetStatus|API Endpoint (/status)}
|
|
78
|
+
* @param {function} callback - Invoked with two arguments. The first argument
|
|
79
|
+
* is an Error object (if an error occurred) or null. The second argument is
|
|
80
|
+
* the status info.
|
|
81
|
+
* object.
|
|
82
|
+
* @example
|
|
83
|
+
* const captureBridge = new CaptureBridge()
|
|
84
|
+
* captureBridge.statusHandler(statusInfo => console.log(statusInfo))
|
|
85
|
+
*/
|
|
86
|
+
statusHandler (callback) {
|
|
87
|
+
asyncToCallback(this, this.status, callback)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get all installed plugins
|
|
92
|
+
* @method
|
|
93
|
+
* @async
|
|
94
|
+
* @see {@link https://local.capturebridge.net:9001/doc/#api-Plugin-GetPlugins|API Endpoint (/plugin)}
|
|
95
|
+
* @see {@link Plugin}
|
|
96
|
+
* @returns {object[]} Array of {@link Plugin} objects.
|
|
97
|
+
* @example
|
|
98
|
+
* const plugins = await captureBridge.plugins()
|
|
99
|
+
*/
|
|
100
|
+
async plugins () {
|
|
101
|
+
const response = await fetch(`${this.baseUrl}/plugin`)
|
|
102
|
+
const plugins = await response.json()
|
|
103
|
+
return plugins.map(p => new Plugin(p, this.baseUrl))
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Get all installed plugins (Callback)
|
|
108
|
+
* @method
|
|
109
|
+
* @see {@link https://local.capturebridge.net:9001/doc/#api-Plugin-GetPlugins|API Endpoint (/plugin)}
|
|
110
|
+
* @see {@link Plugin}
|
|
111
|
+
* @param {function} callback - Invoked with two arguments. The first argument
|
|
112
|
+
* is an Error object (if an error occurred) or null. The second argument is
|
|
113
|
+
* an Array of {@link Plugin} objects. If no plugins are installed the second
|
|
114
|
+
* argument will be an empty Array.
|
|
115
|
+
* @example
|
|
116
|
+
* captureBridge.pluginsHandler(plugins => console.log(plugins))
|
|
117
|
+
*/
|
|
118
|
+
pluginsHandler (callback) {
|
|
119
|
+
asyncToCallback(this, this.plugins, callback)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Get a single plugin by ID
|
|
124
|
+
* @method
|
|
125
|
+
* @async
|
|
126
|
+
* @see {@link https://local.capturebridge.net:9001/doc/#api-Plugin-GetPlugins|API Endpoint (/plugin)}
|
|
127
|
+
* @see {@link Plugin}
|
|
128
|
+
* @param {string} id - Plugin ID
|
|
129
|
+
* @returns {object?} {@link Plugin} object or null
|
|
130
|
+
* @example
|
|
131
|
+
* const plugin = await captureBridge.plugin('capture_camera_canon')
|
|
132
|
+
*/
|
|
133
|
+
async plugin (id) {
|
|
134
|
+
const response = await fetch(`${this.baseUrl}/plugin/${id}`)
|
|
135
|
+
await checkResponse(response)
|
|
136
|
+
const pluginJSON = await response.json()
|
|
137
|
+
return new Plugin(pluginJSON)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Get a single plugin by ID (Callback version).
|
|
142
|
+
* @method
|
|
143
|
+
* @see {@link https://local.capturebridge.net:9001/doc/#api-Plugin-GetPlugins|API Endpoint (/plugin)}
|
|
144
|
+
* @see {@link Plugin}
|
|
145
|
+
* @param {string} id - Plugin ID
|
|
146
|
+
* @param {function} callback - Invoked with two arguments. The first argument
|
|
147
|
+
* is an Error object (if an error occurred) or null. The second argument is
|
|
148
|
+
* the requested {@link Plugin} object. If no matching plugin was found the
|
|
149
|
+
* second argument will be null.
|
|
150
|
+
* @example
|
|
151
|
+
* captureBridge.pluginHandler('capture_camera_canon', (error, plugin) => {
|
|
152
|
+
* console.log(error, plugin)
|
|
153
|
+
* })
|
|
154
|
+
*/
|
|
155
|
+
pluginHandler (id, callback) {
|
|
156
|
+
asyncToCallback(this, this.plugin, callback, id)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export default CaptureBridge
|