import type { Callable } from '../types'; /** * @internal */ export type Delegated = (Awaited extends Callable ? (...args: Parameters>) => ReturnType> : { readonly [K in keyof Awaited & string as `$${K}`]: Delegated[K]>; }) & Promise>; /** * Delegates method calls and member access to the resolved value * * @alpha not verified in production use * @param value - value to delegate to, must be a promise and should not be resolved with primitives * @returns the delegated object, access delegated properties with `${key}` * @example * ```typescript * const promise = Promise.resolve({ foo: { bar: 'baz' } }) * const delegated = delegate(promise) * await delegated.$foo.$bar // 'baz' * ``` */ export declare function delegate>(value: T): Delegated; //# sourceMappingURL=delegate.d.ts.map