import type { SecurityPairOptions } from '../backend-contract/security'; import { type ConnectionControlCapabilities, type ConnectionPriority, type PhyPreference } from '../backend-contract/connection-controls'; import type { NativeAttachmentIdentity, Spec as NativeProtocolControl } from '../NativeUnifiedBleProtocolControl'; import type { CoreBluetoothAdapterSnapshot, CoreBluetoothAdvertisement, CoreBluetoothBoundary, CoreBluetoothCharacteristicAddress, CoreBluetoothDescriptorAddress, CoreBluetoothGattSnapshot, CoreBluetoothNotificationDeliveryMode, CoreBluetoothPhyObservation, CoreBluetoothPhyRequestResult, CoreBluetoothScanPlatformOptions } from '../backends/corebluetooth/corebluetooth-boundary'; import type { ConnectionIntent } from '../backend-contract/backend'; export type AndroidSecurityBondState = 'bonded' | 'bonding' | 'not-bonded' | 'unknown' | 'unsupported'; export interface AndroidSecurityState { readonly bond: AndroidSecurityBondState; readonly encryption: 'encrypted' | 'not-encrypted' | 'unknown' | 'unsupported'; readonly authentication: 'authenticated' | 'unauthenticated' | 'unknown' | 'unsupported'; readonly secureConnections: 'yes' | 'no' | 'unknown' | 'unsupported'; readonly pairingPossible: boolean | null; } export interface AndroidSecurityStateChangedRecord { readonly nativePeerId: string; readonly state: AndroidSecurityState; } export interface AndroidBondedPeerSnapshot { readonly nativePeerId: string; readonly displayName: string | null; } /** * The React Native Android boundary owns the versioned JSI command/event transport. * It preserves native-only identifiers inside this file and exposes only the typed * direct-boundary interface consumed by the shared backend. */ export declare class ReactNativeAndroidProtocolBoundary implements CoreBluetoothBoundary { private readonly control; private readonly ownerId; readonly connectionIntentCapabilities: Readonly<{ whenAvailable: 'available' | 'unsupported'; }>; readonly descriptorOperationsAvailable: boolean; private phyExtensionAvailable; private securityExtensionAvailable; private securityCancellationExtensionAvailable; private readonly securityListeners; get connectionControlCapabilities(): ConnectionControlCapabilities; get securityAvailable(): boolean; get securityCancellationAvailable(): boolean; private readonly pending; /** * Correlations explicitly rejected by connection loss may still terminalize * in native code. Keep only those exact, peer-scoped correlations so one * expected late terminal is quiet while unknown or duplicate terminals stay * diagnostic. */ private readonly expectedLateTerminals; private readonly connections; private readonly databases; private readonly subscriptionsByAddress; private readonly scanListeners; private readonly scanFailureListeners; private readonly disconnectListeners; private readonly databaseChangedListeners; private readonly adapterListeners; private readonly nativeReleaseRetryLedger; private latestAdapterState; private attachmentRecord; private maximumInputPayloadBytes; private nextEpoch; private nextConnection; private nextDatabase; private nextSubscription; private consumerListenerFailureCount; private opened; private closing; private nativeAttachmentOpened; private nativeDestroyCompleted; private destroyRequested; private destroyResult; private fatalTeardownObservation; private preJavaScriptEventBufferOverflowed; constructor(control: NativeProtocolControl, ownerId: string); /** Binds this one native radio boundary to the backend attachment before its control handshake. */ bindAttachment(attachment: NativeAttachmentIdentity): void; adapterSnapshot(): CoreBluetoothAdapterSnapshot; open(): Promise; startScan(onAdvertisement: (advertisement: CoreBluetoothAdvertisement) => void, serviceUuids: readonly string[], deviceAddresses?: readonly string[], platform?: CoreBluetoothScanPlatformOptions): Promise; stopScan(): Promise; /** Reads the current Android system bond table without creating GATT ownership. */ enumerateBondedPeers(): Promise; connect(nativePeerId: string, intent?: ConnectionIntent): Promise; disconnect(nativePeerId: string): Promise; connectionState(nativePeerId: string): 'connecting' | 'connected' | 'disconnected'; readRssi(nativePeerId: string): Promise; requestMtu(nativePeerId: string, requestedMtu: number): Promise; effectiveMtu(nativePeerId: string): Promise; requestPriority(nativePeerId: string, priority: ConnectionPriority): Promise; readPhy(nativePeerId: string): Promise; requestPhy(nativePeerId: string, preference: PhyPreference): Promise; securityState(nativePeerId: string): Promise; pair(nativePeerId: string, transport: SecurityPairOptions['transport'], signal?: AbortSignal | null): Promise<{ readonly outcome: 'paired' | 'already-paired' | 'rejected'; readonly state: AndroidSecurityState; }>; cancelPairing(nativePeerId: string): Promise; cleanupPairing(nativePeerId: string): Promise; unpair(_nativePeerId: string): Promise<'unsupported'>; onSecurityState(listener: (record: AndroidSecurityStateChangedRecord) => void): () => void; discover(nativePeerId: string): Promise; read(address: CoreBluetoothCharacteristicAddress): Promise; write(address: CoreBluetoothCharacteristicAddress, bytes: Uint8Array, withResponse: boolean): Promise; readDescriptor(address: CoreBluetoothDescriptorAddress): Promise; writeDescriptor(address: CoreBluetoothDescriptorAddress, bytes: Uint8Array): Promise; startNotify(address: CoreBluetoothCharacteristicAddress, onValue: (bytes: Uint8Array) => void): Promise; startNotifyWithMode(address: CoreBluetoothCharacteristicAddress, mode: CoreBluetoothNotificationDeliveryMode, onValue: (bytes: Uint8Array) => void): Promise; stopNotify(address: CoreBluetoothCharacteristicAddress): Promise; onDisconnect(listener: (nativePeerId: string, safeMessage: string | null) => void): () => void; onDatabaseChanged(listener: (nativePeerId: string) => void): () => void; onScanFailure(listener: (safeMessage: string) => void): () => void; onAdapterState(listener: (state: CoreBluetoothAdapterSnapshot) => void): () => void; destroy(): Promise; private destroyInternal; private closeNativeAttachment; private dispatch; private submit; private receiveRecord; private rejectMalformedNativeRecord; private receiveResult; private receiveEvent; private takeAdvertisementBytes; private takeOutputBytes; private invokeConsumerListener; private releaseOrRetainForTeardown; private retryNativeReleaseLedger; private failAttachment; private nextCorrelation; private createConnection; private createDatabase; private characteristicPath; private descriptorPath; private assertDescriptorResultPath; private requireConnection; private requireOpen; private requireSecurityExtension; private requirePhyExtension; private requireSecurityCancellationExtension; private assertCurrentAttachment; private requireAttachmentRecord; private rejectPending; private invalidateConnection; private rejectPendingForPeer; private recordExpectedLateTerminal; } //# sourceMappingURL=rn-android-boundary.d.ts.map