///
///
import { AppSignalCb } from "@holochain/client";
import { URL } from "node:url";
import { TryCpRequest, TryCpSuccessResponse } from "./types.js";
/**
* A factory class to create client connections to a running TryCP server.
*
* @public
*/
export declare class TryCpClient {
private readonly ws;
private requestPromises;
private signalHandlers;
private constructor();
setSignalHandler(port: number, signalHandler?: AppSignalCb): void;
/**
* Create a client connection to a running TryCP server.
*
* @param serverUrl - The URL of the TryCP server.
* @returns A client connection.
*/
static create(serverUrl: URL, timeout?: number): Promise;
private processSuccessResponse;
/**
* Closes the client connection.
*
* @returns A promise that resolves when the connection was closed.
*/
close(): Promise;
/**
* Send a ping with data.
*
* @param data - Data to send and receive with the ping-pong.
* @returns A promise that resolves when the pong was received.
*/
ping(data: unknown): Promise;
/**
* Send a call to the TryCP server.
*
* @param request - {@link TryCpRequest}
* @returns A promise that resolves to the {@link TryCpSuccessResponse}
*/
call(request: TryCpRequest): Promise;
private getFormattedResponseLog;
private getFormattedRequestLog;
}