PhoenixDnd.Intent (phoenix_dnd v0.1.0)

Copy Markdown View Source

A validated, canonical user intent sent by the editor hook.

Intents describe user actions, not accepted state changes. The parent LiveView remains responsible for authorization, domain validation, and producing the next authoritative scene revision.

Summary

Types

t()

@type t() :: %PhoenixDnd.Intent{
  base_revision: non_neg_integer(),
  client_id: String.t(),
  gesture_id: String.t() | nil,
  intent_id: String.t(),
  payload: map(),
  phase: String.t(),
  type: String.t(),
  version: 1
}

Functions

parse(payload)

@spec parse(map()) :: {:ok, t()} | {:error, String.t()}

parse!(payload)

@spec parse!(map()) :: t()