import { ManagerContract, ExtendCallback } from './Contracts';
/**
 * Manager class implements the Builder pattern to make instance of similar
 * implementations using a fluent API vs importing each class by hand.
 *
 * This module is used extensively in AdonisJs. For example: `Mail`, `Sessions`,
 * `Auth` and so on.
 */
export declare abstract class Manager<Application extends any, DriverContract extends any, MappingValue extends any = DriverContract, MappingsList extends {
    [key: string]: MappingValue;
} = any> implements ManagerContract<Application, DriverContract, MappingValue, MappingsList> {
    application: Application;
    /**
     * Mappings cache (if caching is enabled)
     */
    private mappingsCache;
    /**
     * A cache to store the function names for initiating driver instances.
     */
    private driverCreatorNames;
    /**
     * List of drivers added at runtime
     */
    private extendedDrivers;
    /**
     * Whether or not to cache mappings
     */
    protected abstract singleton: boolean;
    /**
     * Getting the default mapping name, incase a mapping
     * is not defined
     */
    protected abstract getDefaultMappingName(): keyof MappingsList;
    /**
     * Getting config for the mapping. It is required for making
     * extended drivers
     */
    protected abstract getMappingConfig(mappingName: keyof MappingsList): any | undefined;
    /**
     * Getting the driver name for the mapping
     */
    protected abstract getMappingDriver(mappingName: keyof MappingsList): string | undefined;
    constructor(application: Application);
    /**
     * Returns the value saved inside cache, this method will check for
     * `cacheDrivers` attribute before entertaining the cache
     */
    private getFromCache;
    /**
     * Saves value to the cache with the driver name. This method will check for
     * `cacheDrivers` attribute before entertaining the cache.
     */
    private saveToCache;
    /**
     * Make the extended driver instance and save it to cache (if enabled)
     */
    private makeExtendedDriver;
    /**
     * Returns the creator function name for a given driver.
     */
    private getDriverCreatorName;
    /**
     * Make the custom driver instance by checking for function on the
     * parent class.
     *
     * For example: `stmp` as the driver name will look for `createSmtp`
     * method on the parent class.
     */
    private makeDriver;
    /**
     * Optional method to wrap the driver response
     */
    protected wrapDriverResponse(_: keyof MappingsList, value: DriverContract): MappingValue;
    /**
     * Returns the instance of a given driver. If `name` is not defined
     * the default driver will be resolved.
     */
    use<K extends keyof MappingsList & string>(name: K): MappingsList[K];
    use(): {
        [K in keyof MappingsList]: MappingsList[K];
    }[keyof MappingsList];
    /**
     * Removes the mapping from internal cache.
     */
    release<K extends keyof MappingsList & string>(name: K): void;
    release(name: string): void;
    /**
     * Extend by adding new driver. The compositon of driver
     * is the responsibility of the callback function
     */
    extend(name: string, callback: ExtendCallback<this, DriverContract, keyof MappingsList>): void;
}
