import { type IByteStream } from '../../srpc/SrpcByteStream'; import { type SrpcConnection } from '../../srpc/types'; export interface MeshRemoteConnectionTransport { reserveSenderIds(connection: MeshRemoteSrpcConnection): Promise; releaseSenderIds?(connection: MeshRemoteSrpcConnection, ids: number[]): Promise; disconnect(connection: MeshRemoteSrpcConnection, reason?: string): Promise; writeStream(connection: MeshRemoteSrpcConnection, streamId: number, data: Uint8Array): Promise; finishStream(connection: MeshRemoteSrpcConnection, streamId: number): Promise; destroyStream(connection: MeshRemoteSrpcConnection, streamId: number, error?: unknown): Promise; attachReceiver(connection: MeshRemoteSrpcConnection, streamId: number): Promise; /** Optional v2 signal that an allocated sender ID became a live stream. */ activateSender?(connection: MeshRemoteSrpcConnection, streamId: number): Promise; } export interface MeshRemoteSrpcConnectionOptions { id: string; clientId: string; meta: TMeta; connectedAt: number; ownerNodeId: number; ownerProcessId?: string; ownerEndpointId?: string; ownerEndpointPublicKey?: string; /** Opaque v2 handle capability minted by the remote owner. */ capability?: string; senderIds: number[]; /** Whether the owning mesh link supports returning unused reservations. */ supportsSenderIdRelease?: boolean; transport: MeshRemoteConnectionTransport; } export declare class MeshRemoteSrpcConnection implements SrpcConnection { readonly id: string; readonly clientId: string; readonly connectedAt: number; readonly ownerNodeId: number; readonly ownerProcessId?: string; readonly ownerEndpointId?: string; readonly ownerEndpointPublicKey?: string; readonly capability?: string; readonly byteStream: IByteStream; private readonly senderIds; private readonly activeSenderIds; private readonly transport; private readonly supportsSenderIdRelease; private readonly disconnectHandlers; private readonly backpressuredReceivers; private readonly receiverBufferedBytes; private _meta; private stale; private refillPending?; private lastUsedAt; constructor(options: MeshRemoteSrpcConnectionOptions); get connected(): boolean; resolveByteStream(): IByteStream; get meta(): TMeta; get idleSince(): number; get hasActiveStreams(): boolean; touch(): void; applyMetadata(metadata: unknown): void; close(reason?: string): Promise; receiveWrite(streamId: number, data: Uint8Array): boolean; receiveFinish(streamId: number): void; receiveDestroy(streamId: number, error?: string): void; markStale(): void; takeReservedSenderIds(): number[]; private finishStream; private destroyStream; private activateSender; private refillSenderIds; private assertConnected; private updateReceiverBufferedBytes; private clearReceiverPressure; private totalReceiverBufferedBytes; private releaseReservedSenderIds; } //# sourceMappingURL=mesh-srpc-remote-connection.d.ts.map