Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/third_party/closure/goog/promise/resolver.js
4575 views
1
/**
2
* @license
3
* Copyright The Closure Library Authors.
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
goog.module('goog.promise.Resolver');
7
goog.module.declareLegacyNamespace();
8
9
const GoogPromise = goog.requireType('goog.Promise');
10
const Thenable = goog.requireType('goog.Thenable');
11
12
/**
13
* Resolver interface for promises. The resolver is a convenience interface that
14
* bundles the promise and its associated resolve and reject functions together,
15
* for cases where the resolver needs to be persisted internally.
16
* @template TYPE
17
* @interface
18
*/
19
class Resolver {
20
constructor() {
21
/**
22
* The promise that created this resolver.
23
* @type {!GoogPromise<TYPE>}
24
*/
25
this.promise;
26
/**
27
* Resolves this resolver with the specified value.
28
* @type {function((TYPE|GoogPromise<TYPE>|Promise<TYPE>|IThenable|Thenable)=)}
29
*/
30
this.resolve;
31
/**
32
* Rejects this resolver with the specified reason.
33
* @type {function(*=): void}
34
*/
35
this.reject;
36
}
37
}
38
39
exports = Resolver;
40
41