Skip to content

Commit f20bdf6

Browse files
committed
Setup codegen
1 parent 1ff58d6 commit f20bdf6

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,13 @@
7373
]
7474
]
7575
},
76-
"dependencies": {}
76+
"dependencies": {},
77+
"codegenConfig": {
78+
"name": "RNQuickSQLite",
79+
"type": "modules",
80+
"jsSrcsDir": "src",
81+
"android": {
82+
"javaPackageName": "com.reactnativequicksqlite"
83+
}
84+
}
7785
}

src/NativeRNQuickSQLite.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import type { TurboModule } from 'react-native';
2+
import { TurboModuleRegistry } from 'react-native';
3+
4+
export interface Spec extends TurboModule {}
5+
6+
export default TurboModuleRegistry.getEnforcing<Spec>('RNQuickSQLite');

src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ if (global.__QuickSQLiteProxy == null) {
4343
const proxy = global.__QuickSQLiteProxy;
4444
export const QuickSQLite = proxy as ISQLite;
4545

46+
export const {
47+
IOS_DOCUMENT_PATH,
48+
IOS_LIBRARY_PATH,
49+
ANDROID_DATABASE_PATH,
50+
ANDROID_FILES_PATH,
51+
ANDROID_EXTERNAL_FILES_PATH
52+
} = !!NativeModules.RNQuickSQLite.getConstants
53+
? NativeModules.RNQuickSQLite.getConstants()
54+
: NativeModules.RNQuickSQLite;
55+
4656
export const { open } = setupOpen(QuickSQLite);
4757

4858
export const typeORMDriver = setupTypeORMDriver(open);

0 commit comments

Comments
 (0)