UNPKG

@beenotung/tslib

Version:
5 lines (4 loc) 325 B
export type Result<T> = T | Promise<T>; export declare function isPromise(x: any): boolean; export declare function then<T, R>(x: Result<T>, f: (x: T) => Result<R>, onError?: (e: any) => void): Result<R>; export declare function thenF<T, R>(f: () => Result<T>, q: (x: T) => Result<R>, onError?: (e: any) => void): Result<R>;