import { type CleanupRecord } from '../backend-contract/errors.js'; import { type RendererLeaseIdentity, type TrustedIpcSender } from '../backend-contract/electron.js'; import type { HostNeutralBackendIdentity } from '../backend-contract/identity.js'; import { type IpcCompatibilityOffer, type IpcVersionAxes } from '../backend-contract/primitives.js'; import { BleManager } from '../manager/ble-manager.js'; import type { ElectronBleIpcEvent, ElectronBleIpcRequest, ElectronBleIpcSuccessResponse } from './protocol.js'; import { type ElectronEventDelivery } from './renderer-stream-registry.js'; export type { ElectronEventDelivery } from './renderer-stream-registry.js'; type MainManager = BleManager>; export interface ElectronMainBleRouterOptions { readonly manager: MainManager; readonly maximumMessageBytes: number; readonly maximumOutstandingOperations: number; readonly maximumRetainedBytes: number; readonly publish: (rendererClientId: string, event: ElectronBleIpcEvent) => Promise; /** Injected for deterministic expiry of lease-scoped cancellation correlation records. */ readonly cancellationClock?: () => number; } /** * Canonical Electron-main router for the v4 public manager. It owns all live * handles; renderer messages contain only opaque IDs and copied byte values. */ export declare class ElectronMainBleRouter { private readonly manager; private publish; private readonly maximumMessageBytes; private readonly maximumOutstandingOperations; private readonly cancellationClock; private readonly resources; private readonly arbiter; private readonly streams; private readonly connectionEvents; private nextHandle; private nextEvent; constructor(options: ElectronMainBleRouterOptions); dispatch(sender: TrustedIpcSender, request: ElectronBleIpcRequest): Promise>; /** Enforces the configured byte limit before any request reaches routing or acknowledgement state. */ validateRequest(request: ElectronBleIpcRequest): void; /** Releases the authenticated renderer after a host-owned WebContents lifetime event. */ releaseRenderer(sender: TrustedIpcSender, rendererLease: RendererLeaseIdentity): Promise; /** * Stops one stream after its authenticated renderer can no longer accept * events. The owning binding calls this only for its own renderer identity. */ terminateStream(rendererLease: RendererLeaseIdentity, streamId: string, reason: 'renderer-backpressure' | 'renderer-unavailable'): Promise; destroy(): Promise; /** Installs the application-owned event delivery binding after IPC authentication is configured. */ setEventPublisher(publish: ElectronMainBleRouterOptions['publish']): void; private bootstrap; private route; private startScan; private connect; private adapterState; private maximumWriteLength; private readRssi; private discover; private read; private write; private readDescriptor; private writeDescriptor; private subscribe; private stopScan; private disconnect; private subscribeConnectionEvents; private readyConnectionEvents; private unsubscribeConnectionEvents; private unsubscribe; private releaseDatabase; private cancel; private database; private characteristic; private descriptor; private releaseResources; private releaseResourcesOnce; private rollbackOperationResources; private rollbackOperationAdmission; private disconnectConnection; private cleanupResource; private releaseSubscriptionsForConnection; private releaseConnectionEventSubscriptionsForConnection; private isSubscriptionForConnection; private hasDependentResourcesForConnection; private deleteDatabasesForConnection; private retireDatabasesForRediscovery; private resourcesFor; private allocateHandle; private isAllocatedHandle; private pruneCancellationCorrelations; private recordSettledOperation; private event; } export declare function createElectronIpcVersionAxes(core: HostNeutralBackendIdentity['versions'], remoteOffer: IpcCompatibilityOffer): IpcVersionAxes; //# sourceMappingURL=main-router.d.ts.map