///
import { PendingOperation } from './PendingOperation';
import { Resource } from './Resource';
export interface PoolOptions {
create: CallbackOrPromise;
destroy: (resource: T) => any;
min: number;
max: number;
acquireTimeoutMillis?: number;
createTimeoutMillis?: number;
destroyTimeoutMillis?: number;
idleTimeoutMillis?: number;
createRetryIntervalMillis?: number;
reapIntervalMillis?: number;
log?: (msg: string) => any;
validate?: (resource: T) => boolean;
propagateCreateError?: boolean;
}
export declare class Pool {
protected min: number;
protected max: number;
protected used: Resource[];
protected free: Resource[];
protected pendingCreates: PendingOperation[];
protected pendingAcquires: PendingOperation[];
protected interval: NodeJS.Timer | null;
protected destroyed: boolean;
protected propagateCreateError: boolean;
protected idleTimeoutMillis: number;
protected createRetryIntervalMillis: number;
protected reapIntervalMillis: number;
protected createTimeoutMillis: number;
protected destroyTimeoutMillis: number;
protected acquireTimeoutMillis: number;
protected log: (msg: string, level: 'warn') => any;
protected creator: CallbackOrPromise;
protected destroyer: (resource: T) => any;
protected validate: (resource: T) => boolean;
constructor(opt: PoolOptions);
numUsed(): number;
numFree(): number;
numPendingAcquires(): number;
numPendingCreates(): number;
acquire(): PendingOperation;
release(resource: T): boolean;
isEmpty(): boolean;
check(): void;
destroy(): Promise | import("./PromiseInspection").PromiseInspection>;
_tryAcquireOrCreate(): void;
_hasFreeResources(): boolean;
_doAcquire(): void;
_canAcquire(): boolean;
_validateResource(resource: T): boolean;
_shouldCreateMoreResources(): boolean;
_doCreate(): void;
_create(): PendingOperation;
_destroy(resource: T): Promise;
_logError(err: Error): void;
_startReaping(): void;
_stopReaping(): void;
}
export declare type Callback = (err: Error | null, resource: T) => any;
export declare type CallbackOrPromise = (cb: Callback) => any | (() => Promise);