import { AsyncFactory, BindAs, OnErrorCallback, OnSuccessCallback, SyncFactory } from './binding';
import { ClassConstructor, InjectableId, Injector } from './injector';
import { Provider } from './provider';
/**
 * @inheritDoc
 * This abstraction is for Providers that can be additionally configured as Singletons and/or configured with error and/or success handling callback(s).
 */
export declare abstract class BindableProvider<T, M = ClassConstructor<T> | SyncFactory<T> | AsyncFactory<T>> extends Provider<T> {
    protected injector: Injector;
    protected id: InjectableId<T>;
    protected maker: M;
    protected constructor(injector: Injector, id: InjectableId<T>, maker: M);
    /**
     * A user supplied success handling function.
     * Default value is undefined.
     */
    protected successHandler?: OnSuccessCallback<T, any>;
    /**
     * A user supplied error handling function.
     * Default value is undefined.
     */
    protected errorHandler?: OnErrorCallback<T, any>;
    /**
     * Invoked by the Container to create chain-able configuration
     *
     * @see BindAs
     */
    makeBindAs(): BindAs<T, M>;
    /**
     * Encapsulate the logic of invoking any configured error handler, and processing it's result.
     *
     * @see OnErrorCallback
     *
     * @returns The object substituted by the callback (otherwise this method throws the appropriate error).
     */
    protected queryErrorHandler(err: unknown, obj?: T): T;
    /**
     * This is like a retry mechanism that uses the Provider's errorHandler (if any) to attempt recovery whenever the supplied Promise rejects.
     * This method returns a Promise that rejects if recovery was not possible.
     * If the supplied Promise resolves, then this method passes the result to the callback, and then resolve as whatever that callback returns.
     *
     * @param waitFor   The supplied Promise.
     * @param cb    Callback to be invoked if the supplied Promise resolves.
     */
    protected makePromiseForObj<R>(waitFor: Promise<R>, cb: (result: R) => T): Promise<T>;
}
