/** * Converts an object type to a promisified version where: * - Methods return `Promise>` (no double-wrapping) * - Properties become `Promise>` */ type Promisified = { [K in keyof T]: T[K] extends (...args: infer A) => infer R ? (...args: A) => Promise> : Promise>; }; /** * The type returned by `createObjectPoolProxy`. All method calls and * property accesses are wrapped in promises because acquiring a free * pool instance is inherently async. * * Dispose/asyncDispose symbols are omitted because the pool proxy * forwards calls to a single random instance — disposing one * instance out of the pool is never the intended behavior. Pool * lifecycle should be managed by the code that created the pool. */ export type Pooled = Omit, typeof Symbol.dispose | typeof Symbol.asyncDispose>; /** * Creates a proxy that distributes method calls and property accesses * across a pool of object instances. Only one ongoing access per * instance is allowed at a time. If all instances are busy, accesses * wait until one becomes free. * * The returned proxy provides a promisified version of the original * interface: method calls and property accesses all return promises. */ export declare function createObjectPoolProxy(instances: T[]): Pooled; export {};