import type { ContextConstraint, JsonRpcEngineV2 } from '@metamask/json-rpc-engine/v2';
import { JsonRpcServer } from '@metamask/json-rpc-engine/v2';
import type { z, ZodMiniObject } from 'zod/mini';
import type { RpcSchemaMap } from '../types/index.js';
import type { RpcTransport } from './RpcTransport.js';
/**
 * Engine type the transport accepts. `Request` is `any` because the two production engines differ
 * irreconcilably in it — the generic dispatch engine handles `JsonRpcCall`, the composed/typed
 * engine handles `JsonRpcRequest` — and no concrete Request type is assignable from both (the
 * notification-vs-request parameter variance fights in opposite directions). `Context` uses the
 * library's `ContextConstraint` (`MiddlewareContext<any>`), which accepts any middleware stack's
 * context — including the composed engine's narrowed `{ params, schema }`. The transport never
 * inspects request shape or context; it only forwards a `JsonRpcRequest` to the server.
 */
type AnyMiddlewareEngine = JsonRpcEngineV2<any, ContextConstraint>;
/** In-process RPC transport that dispatches requests directly through a JSON-RPC engine. */
export declare class MemoryRpcTransport<T extends RpcSchemaMap> implements RpcTransport<T> {
    protected readonly _rpcEngine: AnyMiddlewareEngine;
    protected readonly _rpcServer: JsonRpcServer;
    protected readonly _schemas: T;
    protected readonly requestSchemas: Record<keyof T, ZodMiniObject>;
    protected readonly responseSchemas: Record<keyof T, ZodMiniObject>;
    /** Creates an instance with the supplied configuration. */
    constructor(rpcEngine: AnyMiddlewareEngine, schemas: T);
    /** Validates and dispatches a request through the in-memory engine, then parses its response. */
    sendRequest<TMethod extends keyof T>(method: TMethod, params?: z.input<T[TMethod]['params']['to']>): Promise<z.output<T[TMethod]['result']['from']>>;
}
export {};
//# sourceMappingURL=MemoryRpcTransport.d.ts.map