UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

52 lines (49 loc) 3.19 kB
/** * DevExtreme (core/utils/deferred.d.ts) * Version: 21.2.4 * Build date: Mon Dec 06 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> { // eslint-disable-next-line @typescript-eslint/prefer-function-type (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(): 'pending' | 'rejected' | 'resolved'; 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(...args: T[]): DeferredObj<T>; notifyWith(context: DeferredObj<T>, args?: T[]): DeferredObj<T>; reject(...args: T[]): DeferredObj<T>; rejectWith(context: DeferredObj<T>, args?: T[]): DeferredObj<T>; resolve(...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>; // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-unused-vars /** * @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>;