react-native-neuroscan 0.1.1 → 0.1.5
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/README.md +2 -2
- package/android/src/main/java/com/neuroscan/NeuroscanPackage.kt +0 -1
- package/lib/module/NativeNeuroscan.js +15 -0
- package/lib/module/NativeNeuroscan.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeNeuroscan.d.ts +14 -0
- package/lib/typescript/src/NativeNeuroscan.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/NativeNeuroscan.ts +28 -0
- package/src/index.tsx +6 -2
- package/android/app/build/generated/source/codegen/RCTAppDependencyProvider.h +0 -25
- package/android/app/build/generated/source/codegen/RCTAppDependencyProvider.mm +0 -35
- package/android/app/build/generated/source/codegen/RCTModuleProviders.h +0 -16
- package/android/app/build/generated/source/codegen/RCTModuleProviders.mm +0 -51
- package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.h +0 -18
- package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.mm +0 -54
- package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.h +0 -16
- package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.mm +0 -30
- package/android/app/build/generated/source/codegen/ReactAppDependencyProvider.podspec +0 -34
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeNeuroscanSpec.java +0 -67
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/NeuroScanCameraViewManagerDelegate.java +0 -72
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/NeuroScanCameraViewManagerInterface.java +0 -29
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +0 -36
- package/android/app/build/generated/source/codegen/jni/RNNeuroScanSpec-generated.cpp +0 -74
- package/android/app/build/generated/source/codegen/jni/RNNeuroScanSpec.h +0 -31
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/ComponentDescriptors.cpp +0 -22
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/ComponentDescriptors.h +0 -24
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/EventEmitters.cpp +0 -62
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/EventEmitters.h +0 -54
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/Props.cpp +0 -32
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/Props.h +0 -34
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/RNNeuroScanSpecJSI-generated.cpp +0 -80
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/RNNeuroScanSpecJSI.h +0 -134
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/ShadowNodes.cpp +0 -17
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/ShadowNodes.h +0 -32
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/States.cpp +0 -16
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNNeuroScanSpec/States.h +0 -29
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ Camera permission is declared in the library's `AndroidManifest.xml` and will be
|
|
|
57
57
|
### Scan documents
|
|
58
58
|
|
|
59
59
|
```tsx
|
|
60
|
-
import { NeuroScan } from 'react-native-neuroscan';
|
|
60
|
+
import { NeuroScan, isNeuroScanError } from 'react-native-neuroscan';
|
|
61
61
|
|
|
62
62
|
async function scan() {
|
|
63
63
|
try {
|
|
@@ -68,7 +68,7 @@ async function scan() {
|
|
|
68
68
|
console.log(`Scanned ${result.pageCount} pages`);
|
|
69
69
|
console.log(result.imageUrls); // ['file:///...page1.jpg', ...]
|
|
70
70
|
} catch (error) {
|
|
71
|
-
if (error.code === 'SCANNER_CANCELLED') {
|
|
71
|
+
if (isNeuroScanError(error) && error.code === 'SCANNER_CANCELLED') {
|
|
72
72
|
// User dismissed the scanner
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
@@ -5,7 +5,6 @@ import com.facebook.react.bridge.NativeModule
|
|
|
5
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
6
|
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
7
|
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
|
-
@Suppress("unused")
|
|
9
8
|
import com.facebook.react.uimanager.ViewManager
|
|
10
9
|
|
|
11
10
|
class NeuroscanPackage : BaseReactPackage() {
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Error codes thrown by NeuroScan methods.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Typed error thrown by NeuroScan methods.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Type guard to check if an unknown error is a NeuroScanError.
|
|
15
|
+
*/
|
|
16
|
+
export function isNeuroScanError(error) {
|
|
17
|
+
return error instanceof Error && 'code' in error && typeof error.code === 'string';
|
|
18
|
+
}
|
|
4
19
|
export default TurboModuleRegistry.getEnforcing('Neuroscan');
|
|
5
20
|
//# sourceMappingURL=NativeNeuroscan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeNeuroscan.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","isNeuroScanError","error","Error","code","getEnforcing"],"sourceRoot":"../../src","sources":["NativeNeuroscan.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;AACA;AACA;;AAQA;AACA;AACA;;AAKA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,KAAc,EAA2B;EACxE,OACEA,KAAK,YAAYC,KAAK,IACtB,MAAM,IAAID,KAAK,IACf,OAAQA,KAAK,CAAoBE,IAAI,KAAK,QAAQ;AAEtD;AAkDA,eAAeJ,mBAAmB,CAACK,YAAY,CAAO,WAAW,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","NeuroScan"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,SAAS,QAAQ,sBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["default","NeuroScan","isNeuroScanError"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,SAAS,EAAEC,gBAAgB,QAAQ,sBAAmB","ignoreList":[]}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Error codes thrown by NeuroScan methods.
|
|
4
|
+
*/
|
|
5
|
+
export type NeuroScanErrorCode = 'CAMERA_UNAVAILABLE' | 'SCANNER_CANCELLED' | 'SCANNER_FAILED' | 'PROCESS_FAILED' | 'CLEANUP_FAILED';
|
|
6
|
+
/**
|
|
7
|
+
* Typed error thrown by NeuroScan methods.
|
|
8
|
+
*/
|
|
9
|
+
export interface NeuroScanError extends Error {
|
|
10
|
+
code: NeuroScanErrorCode;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Type guard to check if an unknown error is a NeuroScanError.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isNeuroScanError(error: unknown): error is NeuroScanError;
|
|
2
16
|
export interface Spec extends TurboModule {
|
|
3
17
|
/**
|
|
4
18
|
* Launch native document scanner UI
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeNeuroscan.d.ts","sourceRoot":"","sources":["../../../src/NativeNeuroscan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,GAAG,OAAO,CAAC;QACV,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IAEH;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IAEH;;OAEG;IACH,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAGrC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;;AAED,wBAAmE"}
|
|
1
|
+
{"version":3,"file":"NativeNeuroscan.d.ts","sourceRoot":"","sources":["../../../src/NativeNeuroscan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,oBAAoB,GACpB,mBAAmB,GACnB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,KAAK;IAC3C,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAMxE;AAED,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B,GAAG,OAAO,CAAC;QACV,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IAEH;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IAEH;;OAEG;IACH,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAGrC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;;AAED,wBAAmE"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as NeuroScan } from './NativeNeuroscan';
|
|
2
|
-
export type { Spec as NeuroScanSpec } from './NativeNeuroscan';
|
|
1
|
+
export { default as NeuroScan, isNeuroScanError } from './NativeNeuroscan';
|
|
2
|
+
export type { Spec as NeuroScanSpec, NeuroScanError, NeuroScanErrorCode, } from './NativeNeuroscan';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,YAAY,EACV,IAAI,IAAI,aAAa,EACrB,cAAc,EACd,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-neuroscan",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "React Native native document scanner with edge detection, perspective correction, and advanced image processing",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
7
|
"exports": {
|
package/src/NativeNeuroscan.ts
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
2
|
import { TurboModuleRegistry } from 'react-native';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Error codes thrown by NeuroScan methods.
|
|
6
|
+
*/
|
|
7
|
+
export type NeuroScanErrorCode =
|
|
8
|
+
| 'CAMERA_UNAVAILABLE'
|
|
9
|
+
| 'SCANNER_CANCELLED'
|
|
10
|
+
| 'SCANNER_FAILED'
|
|
11
|
+
| 'PROCESS_FAILED'
|
|
12
|
+
| 'CLEANUP_FAILED';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Typed error thrown by NeuroScan methods.
|
|
16
|
+
*/
|
|
17
|
+
export interface NeuroScanError extends Error {
|
|
18
|
+
code: NeuroScanErrorCode;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Type guard to check if an unknown error is a NeuroScanError.
|
|
23
|
+
*/
|
|
24
|
+
export function isNeuroScanError(error: unknown): error is NeuroScanError {
|
|
25
|
+
return (
|
|
26
|
+
error instanceof Error &&
|
|
27
|
+
'code' in error &&
|
|
28
|
+
typeof (error as NeuroScanError).code === 'string'
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
4
32
|
export interface Spec extends TurboModule {
|
|
5
33
|
/**
|
|
6
34
|
* Launch native document scanner UI
|
package/src/index.tsx
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export { default as NeuroScan } from './NativeNeuroscan';
|
|
2
|
-
export type {
|
|
1
|
+
export { default as NeuroScan, isNeuroScanError } from './NativeNeuroscan';
|
|
2
|
+
export type {
|
|
3
|
+
Spec as NeuroScanSpec,
|
|
4
|
+
NeuroScanError,
|
|
5
|
+
NeuroScanErrorCode,
|
|
6
|
+
} from './NativeNeuroscan';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
|
|
11
|
-
#if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
|
|
12
|
-
#import <React-RCTAppDelegate/RCTDependencyProvider.h>
|
|
13
|
-
#elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
|
|
14
|
-
#import <React_RCTAppDelegate/RCTDependencyProvider.h>
|
|
15
|
-
#else
|
|
16
|
-
#import "RCTDependencyProvider.h"
|
|
17
|
-
#endif
|
|
18
|
-
|
|
19
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
20
|
-
|
|
21
|
-
@interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import "RCTAppDependencyProvider.h"
|
|
9
|
-
#import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
|
|
10
|
-
#import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
|
|
11
|
-
#import <ReactCodegen/RCTModuleProviders.h>
|
|
12
|
-
|
|
13
|
-
@implementation RCTAppDependencyProvider
|
|
14
|
-
|
|
15
|
-
- (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
|
|
16
|
-
return RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
- (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
|
|
20
|
-
return RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
- (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
|
|
24
|
-
return RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
- (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
|
|
28
|
-
return RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
- (nonnull NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders {
|
|
32
|
-
return RCTModuleProviders.moduleProviders;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
@protocol RCTModuleProvider;
|
|
11
|
-
|
|
12
|
-
@interface RCTModuleProviders: NSObject
|
|
13
|
-
|
|
14
|
-
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders;
|
|
15
|
-
|
|
16
|
-
@end
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
#import "RCTModuleProviders.h"
|
|
11
|
-
#import <ReactCommon/RCTTurboModule.h>
|
|
12
|
-
#import <React/RCTLog.h>
|
|
13
|
-
|
|
14
|
-
@implementation RCTModuleProviders
|
|
15
|
-
|
|
16
|
-
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders
|
|
17
|
-
{
|
|
18
|
-
static NSDictionary<NSString *, id<RCTModuleProvider>> *providers = nil;
|
|
19
|
-
static dispatch_once_t onceToken;
|
|
20
|
-
|
|
21
|
-
dispatch_once(&onceToken, ^{
|
|
22
|
-
NSDictionary<NSString *, NSString *> * moduleMapping = @{
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:moduleMapping.count];
|
|
27
|
-
|
|
28
|
-
for (NSString *key in moduleMapping) {
|
|
29
|
-
NSString * moduleProviderName = moduleMapping[key];
|
|
30
|
-
Class klass = NSClassFromString(moduleProviderName);
|
|
31
|
-
if (!klass) {
|
|
32
|
-
RCTLogError(@"Module provider %@ cannot be found in the runtime", moduleProviderName);
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
id instance = [klass new];
|
|
37
|
-
if (![instance respondsToSelector:@selector(getTurboModule:)]) {
|
|
38
|
-
RCTLogError(@"Module provider %@ does not conform to RCTModuleProvider", moduleProviderName);
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
[dict setObject:instance forKey:key];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
providers = dict;
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
return providers;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@end
|
package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.h
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
@interface RCTModulesConformingToProtocolsProvider: NSObject
|
|
11
|
-
|
|
12
|
-
+(NSArray<NSString *> *)imageURLLoaderClassNames;
|
|
13
|
-
|
|
14
|
-
+(NSArray<NSString *> *)imageDataDecoderClassNames;
|
|
15
|
-
|
|
16
|
-
+(NSArray<NSString *> *)URLRequestHandlerClassNames;
|
|
17
|
-
|
|
18
|
-
@end
|
package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.mm
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import "RCTModulesConformingToProtocolsProvider.h"
|
|
9
|
-
|
|
10
|
-
@implementation RCTModulesConformingToProtocolsProvider
|
|
11
|
-
|
|
12
|
-
+(NSArray<NSString *> *)imageURLLoaderClassNames
|
|
13
|
-
{
|
|
14
|
-
static NSArray<NSString *> *classNames = nil;
|
|
15
|
-
static dispatch_once_t onceToken;
|
|
16
|
-
|
|
17
|
-
dispatch_once(&onceToken, ^{
|
|
18
|
-
classNames = @[
|
|
19
|
-
|
|
20
|
-
];
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
return classNames;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
+(NSArray<NSString *> *)imageDataDecoderClassNames
|
|
27
|
-
{
|
|
28
|
-
static NSArray<NSString *> *classNames = nil;
|
|
29
|
-
static dispatch_once_t onceToken;
|
|
30
|
-
|
|
31
|
-
dispatch_once(&onceToken, ^{
|
|
32
|
-
classNames = @[
|
|
33
|
-
|
|
34
|
-
];
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
return classNames;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
+(NSArray<NSString *> *)URLRequestHandlerClassNames
|
|
41
|
-
{
|
|
42
|
-
static NSArray<NSString *> *classNames = nil;
|
|
43
|
-
static dispatch_once_t onceToken;
|
|
44
|
-
|
|
45
|
-
dispatch_once(&onceToken, ^{
|
|
46
|
-
classNames = @[
|
|
47
|
-
|
|
48
|
-
];
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
return classNames;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
@protocol RCTComponentViewProtocol;
|
|
11
|
-
|
|
12
|
-
@interface RCTThirdPartyComponentsProvider: NSObject
|
|
13
|
-
|
|
14
|
-
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
|
|
15
|
-
|
|
16
|
-
@end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
|
|
11
|
-
#import "RCTThirdPartyComponentsProvider.h"
|
|
12
|
-
#import <React/RCTComponentViewProtocol.h>
|
|
13
|
-
|
|
14
|
-
@implementation RCTThirdPartyComponentsProvider
|
|
15
|
-
|
|
16
|
-
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
|
|
17
|
-
{
|
|
18
|
-
static NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *thirdPartyComponents = nil;
|
|
19
|
-
static dispatch_once_t nativeComponentsToken;
|
|
20
|
-
|
|
21
|
-
dispatch_once(&nativeComponentsToken, ^{
|
|
22
|
-
thirdPartyComponents = @{
|
|
23
|
-
@"NeuroScanCameraView": NSClassFromString(@"NeuroScanCameraViewComponentView"), // react-native-neuroscan
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return thirdPartyComponents;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
version = "0.79.0"
|
|
7
|
-
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
-
if version == '1000.0.0'
|
|
9
|
-
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
-
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
-
else
|
|
12
|
-
source[:tag] = "v#{version}"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
Pod::Spec.new do |s|
|
|
16
|
-
s.name = "ReactAppDependencyProvider"
|
|
17
|
-
s.version = version
|
|
18
|
-
s.summary = "The third party dependency provider for the app"
|
|
19
|
-
s.homepage = "https://reactnative.dev/"
|
|
20
|
-
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
-
s.license = "MIT"
|
|
22
|
-
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
-
s.platforms = min_supported_versions
|
|
24
|
-
s.source = source
|
|
25
|
-
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
-
|
|
27
|
-
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
-
s.pod_target_xcconfig = {
|
|
29
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
-
"DEFINES_MODULE" => "YES"
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
s.dependency "ReactCodegen"
|
|
34
|
-
end
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
-
*
|
|
5
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
-
* once the code is regenerated.
|
|
7
|
-
*
|
|
8
|
-
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
-
*
|
|
10
|
-
* @nolint
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
package com.facebook.fbreact.specs;
|
|
14
|
-
|
|
15
|
-
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
-
import com.facebook.react.bridge.Promise;
|
|
17
|
-
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
-
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
-
import com.facebook.react.bridge.ReadableMap;
|
|
21
|
-
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
22
|
-
import javax.annotation.Nonnull;
|
|
23
|
-
|
|
24
|
-
public abstract class NativeNeuroscanSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
25
|
-
public static final String NAME = "Neuroscan";
|
|
26
|
-
|
|
27
|
-
public NativeNeuroscanSpec(ReactApplicationContext reactContext) {
|
|
28
|
-
super(reactContext);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@Override
|
|
32
|
-
public @Nonnull String getName() {
|
|
33
|
-
return NAME;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@ReactMethod
|
|
37
|
-
@DoNotStrip
|
|
38
|
-
public abstract void scanDocument(ReadableMap options, Promise promise);
|
|
39
|
-
|
|
40
|
-
@ReactMethod
|
|
41
|
-
@DoNotStrip
|
|
42
|
-
public abstract void detectEdges(String imageUri, Promise promise);
|
|
43
|
-
|
|
44
|
-
@ReactMethod
|
|
45
|
-
@DoNotStrip
|
|
46
|
-
public abstract void cropDocument(String imageUri, ReadableMap corners, Promise promise);
|
|
47
|
-
|
|
48
|
-
@ReactMethod
|
|
49
|
-
@DoNotStrip
|
|
50
|
-
public abstract void processImage(String imageUri, ReadableMap options, Promise promise);
|
|
51
|
-
|
|
52
|
-
@ReactMethod
|
|
53
|
-
@DoNotStrip
|
|
54
|
-
public abstract void scanAndProcess(String imageUri, ReadableMap processOptions, Promise promise);
|
|
55
|
-
|
|
56
|
-
@ReactMethod
|
|
57
|
-
@DoNotStrip
|
|
58
|
-
public abstract void cleanupTempFiles(Promise promise);
|
|
59
|
-
|
|
60
|
-
@ReactMethod
|
|
61
|
-
@DoNotStrip
|
|
62
|
-
public abstract void addListener(String eventType);
|
|
63
|
-
|
|
64
|
-
@ReactMethod
|
|
65
|
-
@DoNotStrip
|
|
66
|
-
public abstract void removeListeners(double count);
|
|
67
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.bridge.ReadableArray;
|
|
15
|
-
import com.facebook.react.uimanager.BaseViewManager;
|
|
16
|
-
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
17
|
-
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
18
|
-
|
|
19
|
-
public class NeuroScanCameraViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & NeuroScanCameraViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
20
|
-
public NeuroScanCameraViewManagerDelegate(U viewManager) {
|
|
21
|
-
super(viewManager);
|
|
22
|
-
}
|
|
23
|
-
@Override
|
|
24
|
-
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
25
|
-
switch (propName) {
|
|
26
|
-
case "enableAutoCapture":
|
|
27
|
-
mViewManager.setEnableAutoCapture(view, value == null ? false : (boolean) value);
|
|
28
|
-
break;
|
|
29
|
-
case "showOverlay":
|
|
30
|
-
mViewManager.setShowOverlay(view, value == null ? false : (boolean) value);
|
|
31
|
-
break;
|
|
32
|
-
case "overlayColor":
|
|
33
|
-
mViewManager.setOverlayColor(view, value == null ? null : (String) value);
|
|
34
|
-
break;
|
|
35
|
-
case "overlayStrokeWidth":
|
|
36
|
-
mViewManager.setOverlayStrokeWidth(view, value == null ? 0f : ((Double) value).floatValue());
|
|
37
|
-
break;
|
|
38
|
-
case "autoCaptureDelay":
|
|
39
|
-
mViewManager.setAutoCaptureDelay(view, value == null ? 0 : ((Double) value).intValue());
|
|
40
|
-
break;
|
|
41
|
-
case "cameraPosition":
|
|
42
|
-
mViewManager.setCameraPosition(view, value == null ? null : (String) value);
|
|
43
|
-
break;
|
|
44
|
-
case "flashMode":
|
|
45
|
-
mViewManager.setFlashMode(view, value == null ? null : (String) value);
|
|
46
|
-
break;
|
|
47
|
-
case "resolution":
|
|
48
|
-
mViewManager.setResolution(view, value == null ? null : (String) value);
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
super.setProperty(view, propName, value);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@Override
|
|
56
|
-
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
|
|
57
|
-
switch (commandName) {
|
|
58
|
-
case "capturePhoto":
|
|
59
|
-
mViewManager.capturePhoto(view);
|
|
60
|
-
break;
|
|
61
|
-
case "startDetection":
|
|
62
|
-
mViewManager.startDetection(view);
|
|
63
|
-
break;
|
|
64
|
-
case "stopDetection":
|
|
65
|
-
mViewManager.stopDetection(view);
|
|
66
|
-
break;
|
|
67
|
-
case "setFlashMode":
|
|
68
|
-
mViewManager.setFlashMode(view, args.getString(0));
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.viewmanagers;
|
|
11
|
-
|
|
12
|
-
import android.view.View;
|
|
13
|
-
import androidx.annotation.Nullable;
|
|
14
|
-
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
15
|
-
|
|
16
|
-
public interface NeuroScanCameraViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
17
|
-
void setEnableAutoCapture(T view, boolean value);
|
|
18
|
-
void setShowOverlay(T view, boolean value);
|
|
19
|
-
void setOverlayColor(T view, @Nullable String value);
|
|
20
|
-
void setOverlayStrokeWidth(T view, float value);
|
|
21
|
-
void setAutoCaptureDelay(T view, int value);
|
|
22
|
-
void setCameraPosition(T view, @Nullable String value);
|
|
23
|
-
void setFlashMode(T view, @Nullable String value);
|
|
24
|
-
void setResolution(T view, @Nullable String value);
|
|
25
|
-
void capturePhoto(T view);
|
|
26
|
-
void startDetection(T view);
|
|
27
|
-
void stopDetection(T view);
|
|
28
|
-
void setFlashMode(T view, String mode);
|
|
29
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
cmake_minimum_required(VERSION 3.13)
|
|
7
|
-
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
-
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNNeuroScanSpec/*.cpp)
|
|
10
|
-
|
|
11
|
-
add_library(
|
|
12
|
-
react_codegen_RNNeuroScanSpec
|
|
13
|
-
OBJECT
|
|
14
|
-
${react_codegen_SRCS}
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
target_include_directories(react_codegen_RNNeuroScanSpec PUBLIC . react/renderer/components/RNNeuroScanSpec)
|
|
18
|
-
|
|
19
|
-
target_link_libraries(
|
|
20
|
-
react_codegen_RNNeuroScanSpec
|
|
21
|
-
fbjni
|
|
22
|
-
jsi
|
|
23
|
-
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
-
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
-
reactnative
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
target_compile_options(
|
|
29
|
-
react_codegen_RNNeuroScanSpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|