/** @product This is intended for internal use only within VertiGIS Studio products. */ export declare class Task implements PromiseLike { private _promise; private _reason; private _state; private _value; constructor(executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void); static attempt(myFunction: () => T | Task): Task; /** * Creates a Task that is resolved or rejected when any of the provided Tasks are resolved * or rejected. * @param values An array of Tasks. * @returns A new Task. */ static race(values: readonly (T | PromiseLike)[]): Task; /** * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The * resolved value cannot be modified from the callback. * * This polyfill is based on a Stack Overflow answer: * https://stackoverflow.com/a/53327815/5322405 * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). * @returns A Promise for the completion of the callback. */ finally(onfinally: () => void): Task; /** * Returns `true` if the task succeeded, `false` otherwise. */ isFulfilled(): boolean; /** * Returns `true` if the task is still running, `false` otherwise. */ isPending(): boolean; /** * Returns `true` if the task failed, `false` otherwise. */ isRejected(): boolean; /** * Returns `true` if the task's fate has been decided one way or the other. * It is no longer pending. */ isResolved(): boolean; /** * Returns the failure object (if any) if the task is rejected. * Otherwise throws an error. Call the `isRejected()` method to confirm * that a Task failed prior to calling this method. */ reason(): any; then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Task; /** * Returns the value (if any) if the task is resolved. * Otherwise throws an error. Call the `isResolved()` method to confirm * that a Task succeeded prior to calling this method. */ value(): T; }