types: add @type t to last two untyped GenServer structs

Every other defstruct in the app already has a @type t declaration;
these two GenServer states were the last holdouts. Declaring t here
means the whole codebase is ready for the typed-struct milestone of
Elixir's set-theoretic type system (the next phase after the inference
pass already shipping in 1.19).
This commit is contained in:
Graham McIntire 2026-04-21 10:18:24 -05:00
parent 3a163028e3
commit 256e61ec76
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
2 changed files with 13 additions and 0 deletions

View file

@ -22,6 +22,13 @@ defmodule Aprsme.ConnectionMonitor do
:last_check
]
@type t :: %__MODULE__{
node_stats: %{optional(node()) => map()},
local_connections: non_neg_integer(),
draining: boolean(),
last_check: integer()
}
def start_link(opts) do
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
end

View file

@ -14,6 +14,12 @@ defmodule AprsmeWeb.MapLive.PacketBatcher do
defstruct [:parent_pid, :buffer, :timer_ref]
@type t :: %__MODULE__{
parent_pid: pid(),
buffer: [map()],
timer_ref: reference() | nil
}
@doc """
Start the packet batcher for a LiveView process.
"""