@primno/core
Version:
Front-end framework for Model-Driven Apps of Power Apps and Dynamics 365.
17 lines (16 loc) • 663 B
TypeScript
import { CanBePromise } from '../typing';
/**
* Makes synchronous calls as much as possible, otherwise builds a promise of fulfillment.
* Returns the direct return value if possible otherwise a promise returning the value.
*/
export declare class MaybePromise<T> {
private returnValue;
/** Error in synchrone call */
private syncException;
get isPromise(): boolean;
static new<T>(func: () => CanBePromise<T>): MaybePromise<T>;
private constructor();
then<TResult>(onfulfilled: (value: T) => CanBePromise<TResult>): MaybePromise<TResult>;
catch(onrejected: (except: any) => void): MaybePromise<T>;
done(): CanBePromise<T>;
}