.. role:: ts-api-decorator

##################
TrackedOpenPromise
##################

.. js:module:: Util
   :noindex:

.. container:: ts-api-section

   .. js:class:: TrackedOpenPromise

      This represents a ``OpenPromise`` that tracks whether or not it has been resolved or rejected.



.. container:: api-index-section

   .. rubric:: Properties

   .. rst-class:: api-index-list-item api-kind-property api-parent-kind-interface

   * :js:attr:`~Util.TrackedOpenPromise.[toStringTag]`
   * :js:attr:`~Util.TrackedOpenPromise.state`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-interface

   * :js:meth:`~Util.TrackedOpenPromise.catch`
   * :js:meth:`~Util.TrackedOpenPromise.finally`
   * :js:meth:`~Util.TrackedOpenPromise.reject`
   * :js:meth:`~Util.TrackedOpenPromise.resolve`
   * :js:meth:`~Util.TrackedOpenPromise.then`





------------

Properties
==========

.. container:: ts-api-section

   .. js:attribute:: TrackedOpenPromise.[toStringTag]

      :type: string





.. container:: ts-api-section

   .. js:attribute:: TrackedOpenPromise.state

      :type: PromiseState

      This value is ``true`` if and only if this promise has been resolved or rejected.



Methods
=======

.. rst-class:: ts-api-section

catch
-----

.. js:method:: TrackedOpenPromise.catch([ onrejected])

   :param onrejected: :ts-api-decorator:`optional` The callback to execute when the Promise is rejected.
   :type onrejected: null | function


   Attaches a callback for only the rejection of the Promise.

   :returns: A Promise for the completion of the callback.


   :rtype: Promise <T | TResult>




   .. js:function:: onrejected( reason)
      :noindex:

      :param reason: None
      :type reason: any


      :rtype: TResult | PromiseLike <TResult>



.. rst-class:: ts-api-section

finally
-------

.. js:method:: TrackedOpenPromise.finally([ onfinally])

   :param onfinally: :ts-api-decorator:`optional` The callback to execute when the Promise is settled (fulfilled or rejected).
   :type onfinally: null | function


   Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
   resolved value cannot be modified from the callback.

   :returns: A Promise for the completion of the callback.


   :rtype: Promise <T>




   .. js:function:: onfinally()
      :noindex:



      :rtype: void



.. rst-class:: ts-api-section

reject
------

.. js:method:: TrackedOpenPromise.reject( error)

   :param error: None
   :type error: any


   :rtype: void

.. rst-class:: ts-api-section

resolve
-------

.. js:method:: TrackedOpenPromise.resolve( this, value)

   :param this: None
   :type this: OpenPromise <T>
   :param value: None
   :type value: T | PromiseLike <T>


   :rtype: void

.. js:method:: TrackedOpenPromise.resolve( this)
   :noindex:

   :param this: None
   :type this: OpenPromise <void>


   :rtype: void

.. rst-class:: ts-api-section

then
----

.. js:method:: TrackedOpenPromise.then([ onfulfilled[, onrejected]])

   :param onfulfilled: :ts-api-decorator:`optional` The callback to execute when the Promise is resolved.
   :type onfulfilled: null | function
   :param onrejected: :ts-api-decorator:`optional` The callback to execute when the Promise is rejected.
   :type onrejected: null | function


   Attaches callbacks for the resolution and/or rejection of the Promise.

   :returns: A Promise for the completion of which ever callback is executed.


   :rtype: Promise <TResult1 | TResult2>




   .. js:function:: onfulfilled( value)
      :noindex:

      :param value: None
      :type value: T


      :rtype: TResult1 | PromiseLike <TResult1>

   .. js:function:: onrejected( reason)
      :noindex:

      :param reason: None
      :type reason: any


      :rtype: TResult2 | PromiseLike <TResult2>



