import Operation from "../metadata/operation.js";
import Package from "../metadata/package.js";
import { HTTPRequest } from "./http.js";
import { GenericProperties, Struct } from "./struct.js";
export declare function parseHTTPResult(pkg: Package, contentType: string, parseBody: () => Promise<any>): Promise<Struct>;
export type Submission = {
    operation: Operation;
    request: HTTPRequest;
};
/**
 * ClientConfig is the configuration of a client
 */
export type ClientConfig = {
    /**
     * The endpoint to connect to. This should be the base URL of the service. E.g("http://localhost:3000/svc1")
     */
    endpoint?: string;
    requestConfigurators?: RequestConfigurationHook[];
};
/**
 * Returns a copy of original with any overrides applied. If overrides is null, the original is returned.
 * @param a is the original configuration
 * @param more is the configuration to add more to the original.
 * @returns
 */
export declare function MergeClientConfig(a?: ClientConfig, more?: ClientConfig): ClientConfig;
/**
 * Called before every request to allow the caller to configure the request
 */
export type RequestConfigurationHook = (sub: Submission) => Promise<void>;
export default class Client {
    private readonly endpoint;
    private readonly requestConfigurators;
    constructor(config: ClientConfig);
    private configureRequest;
    postOperation(operation: Operation, inputProps: GenericProperties, abortController: AbortController): Promise<Response>;
    /**
     * Executes an operation and returns its single result
     * @param operation
     * @param input
     * @returns the output struct of the operation
     */
    execute(operation: Operation, inputProps: GenericProperties): Promise<Struct>;
    /**
     * Execute an operation and stream the results to the provided awaited callback.
     * The returned promise resolves when the stream is complete.
     * @param operation
     * @param input
     * @param outputCallback returns a promise that resolves when the given output has been processed and the next output can be streamed
     * @throws Error if the operation fails or the stream fails. The stream will be aborted if the callback throws an error which is the recommended way to stop the stream.
     */
    stream(operation: Operation, input: GenericProperties, outputCallback: (struct: GenericProperties) => Promise<void>): Promise<void>;
}
