import type { ConnectionOptions as TlsConnectionOptions } from 'node:tls';
import { type ConnectOptions, Connection } from 'thrift';
import type { Client, ServiceModule, ThriftOptions } from './interfaces.js';
/** 客户端选项 */
export interface ClientOptions extends ThriftOptions, Pick<ConnectOptions, 'debug' | 'max_attempts' | 'retry_max_delay' | 'connect_timeout' | 'timeout'> {
    /** 默认为 `localhost` */
    host?: string;
    /** RPC 端口 */
    port: number;
    /** 启用 TLS */
    tls?: TlsConnectionOptions | boolean;
}
/** 表示 Thrift RPC 客户端 */
export interface ThriftClient extends Connection {
    /** 添加或获取一个服务 */
    get<TClient>(service: ServiceModule<TClient>): Client<TClient>;
    /** 添加或获取一个服务 */
    get<TClient>(name: string, service: ServiceModule<TClient>): Client<TClient>;
    /**
     * 获取一个服务
     * @throws 没有找到该服务
     */
    get<TClient>(name: string): Client<TClient>;
    /** 查看服务是否存在 */
    has(name: string): boolean;
    /** 结束 */
    end(): Promise<void>;
}
/** 创建客户端 */
export declare function createClient(options: ClientOptions): ThriftClient;
//# sourceMappingURL=client.d.ts.map