import type { Server } from 'node:net';
import type { Server as TlsServer, TlsOptions } from 'node:tls';
import type { ServiceModule, Handler, ThriftOptions } from './interfaces.js';
declare module 'thrift' {
    function createMultiplexServer<THandler>(processor: MultiplexedProcessor, options?: ServerOptions<MultiplexedProcessor, THandler>): Server | TlsServer;
    /** @inheritdoc */
    interface MultiplexedProcessor {
        /** 已注册的服务 */
        readonly services: Readonly<Record<string, unknown>>;
        /** 注册服务 */
        registerProcessor<THandler>(name: string, processor: THandler): void;
    }
}
/** 服务端选项 */
export interface ServerOptions extends ThriftOptions {
    /** 启用 TLS */
    tls?: TlsOptions;
}
/** 表示 Thrift RPC 服务端 */
interface ThriftServerBase {
    /** 添加一个服务 */
    route<TClient>(name: string, service: ServiceModule<TClient>, handler: Handler<TClient>): this;
    /** 添加一个服务 */
    route<TClient>(service: ServiceModule<TClient>, handler: Handler<TClient>): this;
}
/** 表示 Thrift RPC 服务端 */
export interface ThriftServer extends Server, ThriftServerBase {
}
/** 表示 Thrift RPC 服务端 */
export interface ThriftTlsServer extends TlsServer, ThriftServerBase {
}
/** 创建服务端 */
export declare function createServer(options?: ServerOptions & {
    tls?: undefined;
}): ThriftServer;
/** 创建服务端 */
export declare function createServer(options?: ServerOptions & {
    tls: object;
}): ThriftTlsServer;
export {};
//# sourceMappingURL=server.d.ts.map