import { FakePromise } from './asyncFactory'; export type Trappable = object | Function; export type AsyncTrap = T & FakePromise; /** * Creates a trap for the `await` keyword by wrapping an object in a fake promise. * - `value` can be accessed via `.value` * - `.then`, `.catch` and `.finally` return a `Future` * - property access is propagated to `value` (e.g. `.foo` is equal to `.value.foo`) * - property modification does **not** mutate `value` * - calling methods on the trap directly is undefined behaviour */ export declare function asyncTrap( value: T, toStringTag?: string ): AsyncTrap; export default asyncTrap;