import type Accessor from "./Accessor.js"; /** Promise mixin. */ export abstract class EsriPromiseMixin { constructor(...args: any[]); /** * `isFulfilled()` may be used to verify whether the promise has been fulfilled (either resolved or rejected). * * @returns Whether the promise has been fulfilled (either resolved or rejected). */ isFulfilled(): boolean; /** * `isRejected()` may be used to verify whether the promise has been rejected. * * @returns Whether the promise has been rejected. */ isRejected(): boolean; /** * `isResolved()` may be used to verify whether the promise has resolved. * * @returns Whether the promise has resolved. */ isResolved(): boolean; /** * `when()` may be used with an instance of this class. This method takes two input parameters: an `onFulfilled` function and an `onRejected` function. * The `onFulfilled` function executes when the promise resolves. The * `onRejected` function executes if the promise is rejected. * * @param onFulfilled - The function to call when the promise resolves. * @param onRejected - The function to execute when the promise fails. * @returns Returns a new promise for the result of `onFulfilled` that may be used to chain additional functions. * @since 4.6 * @example * // Although this example uses MapView, any class instance that is a promise may use when() in the same way * let view = new MapView(); * view.when(function(){ * // This function will execute once the promise is resolved * }, function(error){ * // This function will execute if the promise is rejected due to an error * }); */ when(onFulfilled?: OnFulfilledCallback | null | undefined, onRejected?: OnRejectedCallback | null | undefined): Promise; } export abstract class EsriPromise extends EsriPromiseSuperclass {} declare const EsriPromiseSuperclass: & typeof Accessor & typeof EsriPromiseMixin /** @since 5.0 */ export type OnFulfilledCallback = ((value: T) => TResult | PromiseLike) | null | undefined; /** @since 5.0 */ export type OnRejectedCallback = ((reason: any) => TResult | PromiseLike) | null | undefined;