async def until(self, condition: ValueLike):
        """Repeat this trigger until a condition is met.

        This method awaits this trigger at least once, and returns a :class:`tuple` of the values
        that are :meth:`sample`\\ d when :py:`condition` evaluates to a non-zero value. Values
        sampled during previous repeats are discarded.

        Awaiting a :py:`trigger` returns values indicating the state of the clock and reset signals,
        while awaiting :py:`trigger.until(...)` does not:

        .. code::

            while True:
                clk_edge, rst_active, *values, flag_value = await trigger.sample(flag) # never raises
                if flag_value:
                    break
            # `values` may be used after the loop finishes

        .. code::

            values = await trigger.until(flag) # may raise `DomainReset`

        Raises
        ------
        :exc:`TypeError`
            If the shape of :py:`condition` is a :class:`ShapeCastable`.
        :exc:`DomainReset`
            If the clock domain has been synchronously or asynchronously reset during the wait.
        """
        if not isinstance(condition, ValueLike):
            raise TypeError(f"Condition must be a value-like object, not {condition!r}")
        if isinstance(condition, ValueCastable):
            shape = condition.shape()
            if not isinstance(shape, Shape):
                raise TypeError(f"The shape of a condition may only be `signed` or `unsigned`, "
                                f"not {shape!r}")
        tick = self.sample(condition).__aiter__()
        try:
            done = False
            while not done:
                clk, rst, *values, done = await tick.__anext__()
                if rst:
                    raise DomainReset
            return tuple(values)
        finally:
            await tick.aclose()
Repeat this trigger until a condition is met.

        This method awaits this trigger at least once, and returns a :class:`tuple` of the values
        that are :meth:`sample`\ d when :py:`condition` evaluates to a non-zero value. Values
        sampled during previous repeats are discarded.

        Awaiting a :py:`trigger` returns values indicating the state of the clock and reset signals,
        while awaiting :py:`trigger.until(...)` does not:

        .. code::

            while True:
                clk_edge, rst_active, *values, flag_value = await trigger.sample(flag) # never raises
                if flag_value:
                    break
            # `values` may be used after the loop finishes

        .. code::

            values = await trigger.until(flag) # may raise `DomainReset`

        Raises
        ------
        :exc:`TypeError`
            If the shape of :py:`condition` is a :class:`ShapeCastable`.
        :exc:`DomainReset`
            If the clock domain has been synchronously or asynchronously reset during the wait.
        
amaranth/sim/_async.py