export type Result = T | Promise; export declare function isPromise(x: any): boolean; export declare function then(x: Result, f: (x: T) => Result, onError?: (e: any) => void): Result; export declare function thenF(f: () => Result, q: (x: T) => Result, onError?: (e: any) => void): Result;