export type Dual = T & PromiseLike; export declare const DUAL_PENDING: unique symbol; export declare const throwDualPending: () => never; export type AsyncMethodKeys = { [K in keyof T]-?: T[K] extends (...args: any[]) => Promise ? K : never; }[keyof T]; export interface DualizeOptions { /** 这些方法在 undecided/pending 时会返回延迟执行函数,等待对象 Promise 完成后再调用 */ asyncMethods?: readonly (keyof T)[]; } export declare function dualizeAny(sync: () => T, // 同步构造;若抛错则视为 rejected asyncFn: () => Promise, // 异步构造 options?: DualizeOptions): Dual;