-type state() :: #{count => integer(), waiting => [{pid(), reference()}]}.
-type type() :: #{'__type__' => 'erlang.util.CountDownLatch', pid => pid()}.
-spec '__new__'(pos_integer()) -> type().
-spec await(type()) -> boolean().
-spec await(type(), timeout()) -> boolean().
-spec count_down(type()) -> undefined.
-spec loop(state()) -> ok.