MCPcopy Create free account
hub / github.com/dariyd/react-native-document-scanner / launchScanner

Function launchScanner

index.js:28–48  ·  view source on GitHub ↗
(options = {}, callback)

Source from the content-addressed store, hash-verified

26};
27
28export function launchScanner(options = {}, callback) {
29 return new Promise((resolve, reject) => {
30 if (!DocumentScannerModule) {
31 const error = {
32 error: true,
33 errorMessage: 'DocumentScanner module is not available',
34 };
35 if (callback) callback(error);
36 reject(error);
37 return;
38 }
39
40 DocumentScannerModule.launchScanner(
41 {...DEFAULT_OPTIONS, ...options},
42 (result) => {
43 if (callback) callback(result);
44 resolve(result);
45 },
46 );
47 });
48}

Callers 1

handleScanFunction · 0.85

Calls 1

launchScannerMethod · 0.65

Tested by

no test coverage detected