UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

50 lines (47 loc) 2.75 kB
/** * DevExtreme (core/utils/deferred.d.ts) * Version: 21.1.4 * Build date: Mon Jun 21 2021 * * Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ interface Callback<T> { (value?: T, ...args: T[]): void; } /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ declare class DeferredObj<T> { constructor(); state(): string; always(alwaysCallback?: Callback<T>): DeferredObj<T>; catch(catchCallback?: Callback<T>): DeferredObj<T>; then(resolveCallback?: Callback<T>, rejectCallback?: Callback<T>): DeferredObj<T>; done(doneCallback?: Callback<T>): DeferredObj<T>; fail(failCallback?: Callback<T>): DeferredObj<T>; progress(progressCallback?: Callback<T>): DeferredObj<T>; notify(value?: T, ...args: T[]): DeferredObj<T>; notifyWith(context: DeferredObj<T>, args?: T[]): DeferredObj<T>; reject(value?: T, ...args: T[]): DeferredObj<T>; rejectWith(context: DeferredObj<T>, args?: T[]): DeferredObj<T>; resolve(value?: T, ...args: T[]): DeferredObj<T>; resolveWith(context: DeferredObj<T>, args?: T[]): DeferredObj<T>; promise(target?: T): Promise<T>; } /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ export function Deferred<T>(): DeferredObj<T>; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ export interface PromiseType<T> { } /** * * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ export type DxPromise<T = void> = {} extends PromiseType<T> ? Promise<T> : PromiseType<T>