import type { CleanupRecord } from '../backend-contract/errors.js'; import type { SerializableRecord } from '../backend-contract/primitives.js'; import type { BoundedAsyncStream } from '../backend-contract/streams.js'; import type { ElectronConnectionEventCleanupReceipt } from './connection-event-codec.js'; import type { ElectronConnectionLifecycleEventV2, ElectronIpcOperationReceipt, ElectronIpcOperationRequest, ElectronRendererBootstrap, ElectronRendererIpcTransport } from './protocol.js'; export interface ElectronConnectionEventSubscription { readonly handle: string; readonly events: BoundedAsyncStream; unsubscribe(): Promise; } export type { ElectronConnectionEventCleanupReceipt } from './connection-event-codec.js'; /** * Renderer-side v2 IPC client. It can only use a preload-supplied transport; * selecting a radio or an Electron main resource is impossible from this API. */ export declare class ElectronRendererBleClient { private readonly transport; private bootstrapValue; private readonly eventsStream; private readonly unsubscribe; private nextOperation; private nextDispatchEpoch; private nextConnectionEventHandle; private lifecycle; private initializationResult; private readonly pendingAcknowledgementIds; private readonly pendingReleaseEventIds; private readonly connectionEventSubscriptions; private acknowledgementPumpRunning; private acknowledgementRetry; private releaseResult; constructor(transport: ElectronRendererIpcTransport); get events(): BoundedAsyncStream; get bootstrap(): ElectronRendererBootstrap; initialize(): Promise>; private invokeBootstrap; private releaseRejectedBootstrap; request(request: ElectronIpcOperationRequest): Promise; subscribeConnectionEvents(connectionHandle: string, identity?: SerializableRecord): Promise; destroy(): Promise; private releaseInitializedRenderer; private requestCancellation; private unsubscribeConnectionEvents; /** * Keeps the local registration as the cleanup owner until main confirms its * exclusive iterator has detached. This covers ambiguous two-phase admission * failures and malformed lifecycle records without leaking a remote consumer. */ private detachConnectionEventSubscription; private quarantineConnectionEventSubscription; private completeConnectionEventSubscriptionRelease; private scheduleConnectionEventDetachRetry; private clearConnectionEventDetachRetry; private receiveEvent; private routeConnectionEvent; private deliverConnectionEvent; private enqueueAcknowledgement; private pumpAcknowledgements; private scheduleAcknowledgementRetry; /** * Stops delivery after an acknowledgement proves that this renderer can no longer safely * consume its main-owned event stream. A missing registration already proves main released * every owned handle; other permanent protocol failures retain explicit destroy ownership. */ private terminateAfterPermanentAcknowledgementFailure; private restoreAfterFailedRelease; /** * Main release is ordered but its aggregate receipt does not identify which * resources completed before a later cleanup failed. Every local lifecycle * subscription was part of that teardown attempt, so none can safely resume * as active. Main retains any unfinished cleanup and a later client destroy * retries that aggregate ownership without retaining stale local iterators. */ private reconcileConnectionEventSubscriptionsAfterPartialRelease; private assertActive; private completeRelease; private clearAcknowledgementAccounting; } //# sourceMappingURL=renderer.d.ts.map