/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Licensed under the Apache License, Version 2.0. See LICENSE file in the project root for details. ***************************************************************************** */ /** * Encapsulates a Promise and exposes its resolve and reject callbacks. */ export declare class Deferred { private _promise; private _resolve; private _reject; private _callback?; /** * Initializes a new instance of the Deferred class. */ constructor(); /** * Gets the promise. */ get promise(): Promise; /** * Gets the callback used to resolve the promise. */ get resolve(): (value?: T | PromiseLike | undefined) => void; /** * Gets the callback used to reject the promise. */ get reject(): (reason: any) => void; /** * Gets a NodeJS-style callback that can be used to resolve or reject the promise. */ get callback(): T extends void ? (err: Error | null | undefined) => void : (err: Error | null | undefined, value: T) => void; /** * Creates a NodeJS-style callback that can be used to resolve or reject the promise with multiple values. */ createCallback(selector: (...args: A) => T): (err: Error | null | undefined, ...args: A) => void; }