# `Figler.Document`
[🔗](https://github.com/open-pencil/figler/blob/v0.1.0-beta.3/lib/figler/document.ex#L1)

A complete decoded boundary for a Figma document.

This representation preserves archive entries and rendering assets alongside
the raw Kiwi payload and document metadata. `open/1` leaves `:message` as
`nil` for analysis and rendering; `Figler.decode/1` additionally fills it
with a complete generated message for ordinary Elixir transformations.

# `source`

```elixir
@type source() :: :archive | :container | :payload
```

# `t`

```elixir
@type t() :: %Figler.Document{
  blobs: [binary()],
  canvas: binary() | nil,
  canvas_path: String.t() | nil,
  entries: %{optional(String.t()) =&gt; binary()},
  images: %{optional(String.t()) =&gt; binary()},
  message: Figler.Schema.Message.t() | nil,
  pages: [Figler.Document.Page.t()],
  payload: binary(),
  schema: binary(),
  source: source()
}
```

# `open`

```elixir
@spec open(binary()) :: {:ok, t()} | {:error, Figler.Error.t()}
```

Opens an exported `.fig` archive, `fig-kiwi` container, or raw Kiwi payload.

Returns `{:error, %Figler.Error{}}` for malformed input.

# `open!`

```elixir
@spec open!(binary()) :: t()
```

Like `open/1`, but raises `Figler.Error` when the input cannot be decoded.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
