Packages

Elixir renderer for the A2UI v0.9 protocol — server-driven UI over Phoenix LiveView

Current section

Files

Jump to
a2ui lib a2ui protocol messages delete_surface.ex
Raw

lib/a2ui/protocol/messages/delete_surface.ex

defmodule A2UI.Protocol.Messages.DeleteSurface do
@moduledoc """
Represents a `deleteSurface` message from the A2UI protocol.
"""
defstruct [:surface_id]
@type t :: %__MODULE__{
surface_id: String.t()
}
@doc """
Parses a raw JSON map (the inner `deleteSurface` object) into a struct.
"""
@spec from_map(map()) :: t()
def from_map(map) do
%__MODULE__{
surface_id: Map.fetch!(map, "surfaceId")
}
end
end