MailglassAdmin.Preview.CaptureState (MailglassAdmin v1.4.4)

Copy Markdown View Source

Canonical capture-state value for deterministic preview screenshot targets.

Summary

Types

t()

@type t() :: %MailglassAdmin.Preview.CaptureState{
  mailable: module(),
  scenario: atom(),
  theme: theme(),
  url: String.t(),
  width: 375 | 768 | 1024
}

theme()

@type theme() :: :light | :dark

Functions

build_url(base_path, mailable, scenario, width, theme)

@spec build_url(String.t(), module(), atom(), 375 | 768 | 1024, theme()) :: String.t()

new(base_path, mailable, scenario, width, theme)

@spec new(String.t(), module(), atom(), 375 | 768 | 1024, theme()) :: t()

sort_key(state)

@spec sort_key(t()) :: {String.t(), String.t(), 375 | 768 | 1024, String.t()}

themes()

@spec themes() :: [theme()]

widths()

@spec widths() :: [375 | 768 | 1024]