// Generated by uniffi-bindgen-react-native
import installer from './NativeBarkReactNative';

// Register the rust crate with Hermes
// - the boolean flag ensures this loads exactly once, even if the JS
//   code is reloaded (e.g. during development with metro).
let rustInstalled = false;
if (!rustInstalled) {
  installer.installRustCrate();
  rustInstalled = true;
}

// Export the generated bindings to the app.
export * from './generated/bark';

// Now import the bindings so we can:
// - intialize them
// - export them as namespaced objects as the default export.
import * as bark from './generated/bark';

// Initialize the generated bindings: mostly checksums, but also callbacks.
// - the boolean flag ensures this loads exactly once, even if the JS code
//   is reloaded (e.g. during development with metro).
let initialized = false;
if (!initialized) {
  bark.default.initialize();
  initialized = true;
}

// This provides parity with the index.web.ts version of this file.
// The web version relies on an asynchronous fetch, which this doesn't
// need, so we just no-op.
export async function uniffiInitAsync() {
  // NOOP.
}

// Export the crates as individually namespaced objects.
export default {
  bark,
};


// Hand-written helpers (appended by patch-bindings.sh).
export * from './WalletNotifications';

// Hand-written helpers (appended by patch-bindings.sh).
export * from './Logger';
