File tree Expand file tree Collapse file tree 5 files changed +19
-28
lines changed
Expand file tree Collapse file tree 5 files changed +19
-28
lines changed Original file line number Diff line number Diff line change 11#ifdef RCT_NEW_ARCH_ENABLED
22
33#import " RNTfliteSpec.h"
4- @interface Tflite : NSObject <NativeTfliteSpec >
4+ @interface Tflite : NSObject <NativeRNTfliteSpec >
55@end
66
77#else
Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ @interface RCTBridge (RCTTurboModule)
1515using namespace facebook ;
1616
1717@implementation Tflite
18- RCT_EXPORT_MODULE ()
18+ RCT_EXPORT_MODULE (Tflite )
1919
20- RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install) {
20+ - ( NSNumber *)install {
2121 RCTBridge* bridge = [RCTBridge currentBridge ];
2222 RCTCxxBridge* cxxBridge = (RCTCxxBridge*)bridge;
2323 if (!cxxBridge.runtime ) {
@@ -50,7 +50,7 @@ @implementation Tflite
5050#ifdef RCT_NEW_ARCH_ENABLED
5151- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule :
5252 (const facebook::react::ObjCTurboModule::InitParams&)params {
53- return std::make_shared<facebook::react::NativeTfliteSpecJSI >(params);
53+ return std::make_shared<facebook::react::NativeRNTfliteSpecJSI >(params);
5454}
5555#endif
5656
Original file line number Diff line number Diff line change 138138 ]
139139 ]
140140 },
141- "packageManager" : " yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
141+ "packageManager" : " yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" ,
142+ "codegenConfig" : {
143+ "name" : " RNTfliteSpec" ,
144+ "type" : " modules" ,
145+ "jsSrcsDir" : " spec"
146+ }
142147}
Original file line number Diff line number Diff line change 1+ import type { TurboModule } from 'react-native'
2+ import { TurboModuleRegistry } from 'react-native'
3+
4+ export interface Spec extends TurboModule {
5+ install ( ) : boolean
6+ }
7+
8+ export default TurboModuleRegistry . getEnforcing < Spec > ( 'Tflite' )
Original file line number Diff line number Diff line change 1- import { NativeModules , Platform } from 'react-native'
2-
3- const LINKING_ERROR =
4- "The package 'react-native-fast-tflite' doesn't seem to be linked. Make sure: \n\n" +
5- Platform . select ( { ios : "- You have run 'pod install'\n" , default : '' } ) +
6- '- You rebuilt the app after installing the package\n' +
7- '- You are not using Expo Go\n'
8-
9- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10- const Tflite =
11- NativeModules . Tflite != null
12- ? NativeModules . Tflite
13- : new Proxy (
14- { } ,
15- {
16- get ( ) {
17- throw new Error ( LINKING_ERROR )
18- } ,
19- }
20- )
21-
22- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
23- export const TensorflowModule = Tflite
1+ export { default as TensorflowModule } from '../spec/NativeRNTflite'
You can’t perform that action at this time.
0 commit comments