// tslint:disable:variable-name export class Deferred { private _promise: Promise; private _resolve: (value?: T | PromiseLike) => void = () => {}; private _reject: (reason?: any) => void = () => {}; constructor() { this._promise = new Promise((resolve, reject) => { this._resolve = resolve; this._reject = reject; }); } get promise(): Promise { return this._promise; } public resolve = (value?: T | PromiseLike): void => { this._resolve(value); }; public reject = (reason?: any): void => { this._reject(reason); }; }