Minga.Mode.DeleteConfirmState (Minga v0.1.0)

Copy Markdown View Source

FSM state for the file tree delete confirmation prompt.

Holds the path being deleted, whether it's a directory, and the child count (for directory prompts). Also tracks whether this is the initial trash prompt or the permanent-delete fallback prompt.

Summary

Functions

Creates a new delete confirm state for the given file tree entry.

Transitions to the permanent delete fallback prompt.

Types

phase()

@type phase() :: :trash | :permanent

t()

@type t() :: %Minga.Mode.DeleteConfirmState{
  child_count: non_neg_integer(),
  count: non_neg_integer() | nil,
  dir?: boolean(),
  name: String.t(),
  path: String.t(),
  phase: phase()
}

Functions

new(path, name, dir?, child_count \\ 0)

@spec new(String.t(), String.t(), boolean(), non_neg_integer()) :: t()

Creates a new delete confirm state for the given file tree entry.

to_permanent(state)

@spec to_permanent(t()) :: t()

Transitions to the permanent delete fallback prompt.