type BasicTypeProxy = { await: () => Promise; }; type AwaitBinding = { [key in keyof X]: X[key] extends object ? X[key] extends (...args: infer X) => infer R ? R extends object ? (...args: X) => AwaitBinding : (...args: X) => BasicTypeProxy : AwaitBinding : BasicTypeProxy; } & BasicTypeProxy; /** ## `Future` : 对Promise的调用封装 + 优化Promise的调用逻辑 `(await Promise).method()` --> `await Promise.method().await()` @example Usage ```ts const fetch_result = result.async(async () => { const response = await fetch('https://jsonplaceholder.typicode.com/todos/1') return await response.json() }) // == `(await fetch_result).replace_err(HttpError[500].default()).unwrap()` const res = await Future(fetch_result).replace_err(HttpError[500].default()).unwrap().await() assert.equal(typeof res, 'object') ``` @category Function */ export declare function Future(promise: Promise): AwaitBinding; export {}; //# sourceMappingURL=future.d.ts.map