import { IPromise } from './IPromise' export const enum IPooledObjectStatus { READY = 'ready', ACTIVE = 'active', INVALID = 'invalid', } export interface IPooledObject { ref: T status: IPooledObjectStatus activate(): void passivate(): void destroy(): void validate(): boolean [key: string]: any } export interface IPooledObjectFactory { (...args: any[]): IPooledObject } export interface IPool { factory: IPooledObjectFactory borrow(): IPromise release(instance: T): void invalidate(instance: T): void [key: string]: any }