@bennyblader/ddk-rn 0.2.2 → 0.2.3
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/cpp/ddk_ffi.cpp +36 -0
- package/cpp/ddk_ffi.hpp +2 -0
- package/lib/commonjs/ddk_ffi-ffi.js.map +1 -1
- package/lib/commonjs/ddk_ffi.js +47 -47
- package/lib/commonjs/ddk_ffi.js.map +1 -1
- package/lib/module/ddk_ffi-ffi.js.map +1 -1
- package/lib/module/ddk_ffi.js +47 -48
- package/lib/module/ddk_ffi.js.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts +2 -0
- package/lib/typescript/commonjs/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts +3 -2
- package/lib/typescript/commonjs/src/ddk_ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts +2 -0
- package/lib/typescript/module/src/ddk_ffi-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/ddk_ffi.d.ts +3 -2
- package/lib/typescript/module/src/ddk_ffi.d.ts.map +1 -1
- package/package.json +7 -4
- package/react-native.config.js +13 -0
- package/scripts/postinstall.js +226 -173
- package/src/ddk_ffi-ffi.ts +199 -49
- package/src/ddk_ffi.ts +1509 -1303
- package/ubrn.config.yaml +23 -0
- package/cpp/bennyblader-ddk-rn.cpp +0 -16
- package/cpp/bennyblader-ddk-rn.h +0 -15
- package/src/NativeDdkRn.ts +0 -10
- package/src/index.tsx +0 -41
package/ubrn.config.yaml
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
rust:
|
|
2
|
+
directory: ../ddk-ffi
|
|
3
|
+
manifestPath: Cargo.toml
|
|
4
|
+
|
|
5
|
+
bindings:
|
|
6
|
+
cpp: cpp
|
|
7
|
+
ts: src
|
|
8
|
+
|
|
9
|
+
android:
|
|
10
|
+
directory: android
|
|
11
|
+
packageName: com.ddkrn
|
|
12
|
+
|
|
13
|
+
ios:
|
|
14
|
+
directory: ios
|
|
15
|
+
targets:
|
|
16
|
+
- aarch64-apple-ios
|
|
17
|
+
- aarch64-apple-ios-sim
|
|
18
|
+
frameworkName: ios/DdkRn
|
|
19
|
+
|
|
20
|
+
turboModule:
|
|
21
|
+
cpp: cpp
|
|
22
|
+
ts: src
|
|
23
|
+
spec: NativeDdkRn
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Generated by uniffi-bindgen-react-native
|
|
2
|
-
#include "bennyblader-ddk-rn.h"
|
|
3
|
-
#include "ddk_ffi.hpp"
|
|
4
|
-
|
|
5
|
-
namespace bennyblader_ddkrn {
|
|
6
|
-
using namespace facebook;
|
|
7
|
-
|
|
8
|
-
uint8_t installRustCrate(jsi::Runtime &runtime, std::shared_ptr<react::CallInvoker> callInvoker) {
|
|
9
|
-
NativeDdkFfi::registerModule(runtime, callInvoker);
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
uint8_t cleanupRustCrate(jsi::Runtime &runtime) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
}
|
package/cpp/bennyblader-ddk-rn.h
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#ifndef BENNYBLADER_DDKRN_H
|
|
2
|
-
#define BENNYBLADER_DDKRN_H
|
|
3
|
-
// Generated by uniffi-bindgen-react-native
|
|
4
|
-
#include <cstdint>
|
|
5
|
-
#include <jsi/jsi.h>
|
|
6
|
-
#include <ReactCommon/CallInvoker.h>
|
|
7
|
-
|
|
8
|
-
namespace bennyblader_ddkrn {
|
|
9
|
-
using namespace facebook;
|
|
10
|
-
|
|
11
|
-
uint8_t installRustCrate(jsi::Runtime &runtime, std::shared_ptr<react::CallInvoker> callInvoker);
|
|
12
|
-
uint8_t cleanupRustCrate(jsi::Runtime &runtime);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
#endif /* BENNYBLADER_DDKRN_H */
|
package/src/NativeDdkRn.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Generated by uniffi-bindgen-react-native
|
|
2
|
-
import type { TurboModule } from 'react-native';
|
|
3
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
-
|
|
5
|
-
export interface Spec extends TurboModule {
|
|
6
|
-
installRustCrate(): boolean;
|
|
7
|
-
cleanupRustCrate(): boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default TurboModuleRegistry.getEnforcing<Spec>('DdkRn');
|
package/src/index.tsx
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// Generated by uniffi-bindgen-react-native
|
|
2
|
-
import installer from './NativeDdkRn';
|
|
3
|
-
|
|
4
|
-
// Register the rust crate with Hermes
|
|
5
|
-
// - the boolean flag ensures this loads exactly once, even if the JS
|
|
6
|
-
// code is reloaded (e.g. during development with metro).
|
|
7
|
-
let rustInstalled = false;
|
|
8
|
-
if (!rustInstalled) {
|
|
9
|
-
installer.installRustCrate();
|
|
10
|
-
rustInstalled = true;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Export the generated bindings to the app.
|
|
14
|
-
export * from './/ddk_ffi';
|
|
15
|
-
|
|
16
|
-
// Now import the bindings so we can:
|
|
17
|
-
// - intialize them
|
|
18
|
-
// - export them as namespaced objects as the default export.
|
|
19
|
-
import * as ddk_ffi from './/ddk_ffi';
|
|
20
|
-
|
|
21
|
-
// Initialize the generated bindings: mostly checksums, but also callbacks.
|
|
22
|
-
// - the boolean flag ensures this loads exactly once, even if the JS code
|
|
23
|
-
// is reloaded (e.g. during development with metro).
|
|
24
|
-
let initialized = false;
|
|
25
|
-
if (!initialized) {
|
|
26
|
-
ddk_ffi.default.initialize();
|
|
27
|
-
initialized = true;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// This provides parity with the index.web.ts version of this file.
|
|
31
|
-
// The web version relies on an asynchronous fetch, which this doesn't
|
|
32
|
-
// need, so we just no-op.
|
|
33
|
-
export async function uniffiInitAsync() {
|
|
34
|
-
// NOOP.
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Export the crates as individually namespaced objects.
|
|
38
|
-
export default {
|
|
39
|
-
ddk_ffi,
|
|
40
|
-
};
|
|
41
|
-
|