declare function awaitYield(value: T | Promise): Generator, T, T>; declare function awaitYieldOf(generator: Generator, T, Yielded>): Generator, T, T>; export type AwaitYield = typeof awaitYield & { of: typeof awaitYieldOf; }; /** * Create a function that may or may not be async, using a generator * * Within the generator, call `yield* awaited(maybePromise)` to await a value * that may or may not be a promise. * * If the inner function never yields a promise, it will return synchronously. */ export declare function maybeAsyncFn< /** Function arguments */ Args extends any[], This, /** Function return type */ Return, /** Yields to unwrap */ Yielded>(that: This, fn: (this: This, awaited: AwaitYield, ...args: Args) => Generator, Return, Yielded>): (...args: Args) => Return | Promise; export type MaybeAsyncBlock = (this: This, awaited: AwaitYield, ...args: Args) => Generator, Return, Yielded>; export declare function maybeAsync(that: This, startGenerator: (this: This, await: AwaitYield) => Generator, Return, Yielded>): Return | Promise; export declare function awaitEachYieldedPromise(gen: Generator, Returned, Yielded>): Returned | Promise; export {};