MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / Promise

Class Promise

napi.h:1667–1700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1665};
1666
1667class Promise : public Object {
1668 public:
1669 class Deferred {
1670 public:
1671 static Deferred New(napi_env env);
1672 Deferred(napi_env env);
1673
1674 Napi::Promise Promise() const;
1675 Napi::Env Env() const;
1676
1677 void Resolve(napi_value value) const;
1678 void Reject(napi_value value) const;
1679
1680 private:
1681 napi_env _env;
1682 napi_deferred _deferred;
1683 napi_value _promise;
1684 };
1685
1686 static void CheckCast(napi_env env, napi_value value);
1687
1688 Promise();
1689 Promise(napi_env env, napi_value value);
1690
1691 MaybeOrValue<Promise> Then(napi_value onFulfilled) const;
1692 MaybeOrValue<Promise> Then(napi_value onFulfilled,
1693 napi_value onRejected) const;
1694 MaybeOrValue<Promise> Catch(napi_value onRejected) const;
1695
1696 MaybeOrValue<Promise> Then(const Function& onFulfilled) const;
1697 MaybeOrValue<Promise> Then(const Function& onFulfilled,
1698 const Function& onRejected) const;
1699 MaybeOrValue<Promise> Catch(const Function& onRejected) const;
1700};
1701
1702template <typename T>
1703class Buffer : public Uint8Array {

Callers 3

PromiseMethod · 0.85
ThenMethod · 0.85
CatchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected