import { IBetterLogger, IRepoOptions } from "@codiac.io/codiac-common";
import * as cont from "@codiac.io/codiac-common/contracts";
import { ApiUserCreds, CodiacRestClient, CodiacRestClientConfig } from "../codiac-api";
import { CrudEndpointInfo } from "../codiac-api/common/api-crud-client-base";
import { RelayClient as GenRelayClient } from "../codiac-relay";
import { ICodiacClient } from '../codiac-api/i-client';
export declare class ApiClientPlusLocalConfig {
    /** The local data api mimics the remote api endpoints and routes,
     * but may have those endpoint routes prefixed to avoid any collisions or ambiguity.
     * When that is true, this prefix will need to be applied
     * when rerouting a remote endpoint call to a local one. */
    localDataRoutePrefix?: string | undefined;
}
/** Wrapper for the Codiac Api that redirects calls from the remote codiac api
 * to the to the local api endpoints (in the relay),
 * based on whether the entity is flagged as a local entity or not.
 */
export declare class ApiClientPlusLocal extends CodiacRestClient implements ICodiacClient {
    private settings?;
    /** This factory method is just for convenience and hasty backward compatibility with consumers not using ioc. */
    static createPlus(relayClient: GenRelayClient, logger: IBetterLogger, localDataRoutePrefix?: string, apiRootUrl?: string, authToken?: string): ApiClientPlusLocal;
    constructor(relayClientWithLocalData: GenRelayClient, logger: IBetterLogger, remoteApiSettings?: CodiacRestClientConfig, settings?: ApiClientPlusLocalConfig | undefined, credentials?: ApiUserCreds);
    private entityMergers;
    private localDataClient;
    tryMakeRestCall<TReq extends Object, TRes extends cont.Result>(ep: CrudEndpointInfo, request: TReq, options?: IRepoOptions): Promise<TRes>;
    makeAnyRestCall<TReq extends Object, TRes>(ep: CrudEndpointInfo, request: TReq, options?: IRepoOptions): Promise<TRes>;
    /** Both params MUST be of the SAME RESULT TYPE.
     *
     * Ignores additional if original has an error.
     *
     * Mutates the original by appending the output of the additional.
     * NOTE: `error`, `success`, and `message` from the additional ARE IGNORED by default.
     *
     * @param absorbErrors (default: false) When true, error, success, and message from the additional shall be brought forward in the ultimate result.
     */
    private absorbOutput;
    /** Merges the two objects as arrays or based on a custom merger
     * or falling back to a raw object merge. */
    protected merge<T>(operationId: string, responseRemote: T, localResponse: T | undefined): T;
}
