import { ContentType, Message, MessageFromClient, CreateMailboxResponse, KeyValPair, MessageEnvelope, SendReceipt } from "./proto/wsmessages";
export interface ContentTypeHandler {
    readonly webSocketUrlPath: string;
    sendMessageFromClient(mfc: MessageFromClient, ws: WebSocket): void;
}
export declare const ContentTypeHandler: {
    Json: ContentTypeHandler;
    Protobuf: ContentTypeHandler;
};
export declare function newHermesClient(rootUrl: string, contentTypeHandler: ContentTypeHandler): HermesClient;
export interface ChangeDataCaptureEvent {
    id: string;
    schema: string;
    table: string;
    action: string;
    data: any;
    commitTime: string;
}
interface RawRpcRequest {
    to: string;
    endPoint: string;
    body?: Uint8Array;
    contentType?: ContentType;
    headers?: KeyValPair[];
    state?: Uint8Array;
}
export declare class RpcRequestResponse {
    correlationId: string;
    sendReceiptEnvelope: MessageEnvelope | undefined;
    sendReceipt: SendReceipt | undefined;
    sentMessage: Message | undefined;
    inboxEnvelope: MessageEnvelope | undefined;
    inboxMessage: Message | undefined;
    constructor(correlationId: string);
    role(): string | undefined;
    contentType(): ContentType;
    isProtobuf(): boolean;
    isJson(): boolean;
    isClient(): boolean | undefined;
    hasRequestAndResponse(): boolean;
    timeStarted(): Date | undefined;
    timeStartedL(): number | undefined;
    timeCompleted(): Date | undefined;
    durationInMillis(): number | undefined;
    endPoint(): string | undefined;
    requestMessage(): Message | undefined;
    requestEnvelope(): MessageEnvelope | undefined;
    responseMessage(): Message | undefined;
    responseEnvelope(): MessageEnvelope | undefined;
    status(): string;
    processSchema(reqOrResp: "request" | "response", data?: Uint8Array): Promise<any>;
    responseObj(): Promise<any>;
    requestObj(): Promise<any>;
}
declare const GlobalClient: {
    get: () => HermesClient;
};
export default GlobalClient;
export declare function runHermesClientTest(): void;
export declare function runHermesClientTest2(): void;
export interface CdcSubscription {
    tables: CdcTable[];
    startSeq?: string;
}
export interface CdcTable {
    database: string;
    table: string;
}
export interface HermesClient {
    readonly rootUrl: string;
    mailbox(): Promise<CreateMailboxResponse>;
    rawRpcCall(request: RawRpcRequest): Promise<Message>;
    cdcSubscribe<A>(cdcs: CdcSubscription, listener: (cdcEvent: ChangeDataCaptureEvent, a: A) => void): void;
    rpcObserverSubscribe(readerKey: string, listener: (correlation: RpcRequestResponse) => void): void;
}
