# `MingaEditor.Shell.Registry.Snapshot`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/shell/registry/snapshot.ex#L1)

Pure coherent publication value for the serialized shell registry.

# `register_error`

```elixir
@type register_error() ::
  {:duplicate_id, shell_id()}
  | {:duplicate_module, module(), shell_id()}
  | {:duplicate_default, shell_id()}
```

# `shell_id`

```elixir
@type shell_id() :: atom()
```

# `t`

```elixir
@type t() :: %MingaEditor.Shell.Registry.Snapshot{
  default_id: shell_id() | nil,
  entries: %{optional(shell_id()) =&gt; MingaEditor.Shell.Entry.t()},
  generation: non_neg_integer(),
  next_generation: pos_integer(),
  ordered: [MingaEditor.Shell.Entry.t()]
}
```

# `advance`

```elixir
@spec advance(t()) :: t()
```

Advances the coherent publication generation.

# `entry_for_module`

```elixir
@spec entry_for_module(t(), module()) :: MingaEditor.Shell.Entry.t() | nil
```

Returns the entry registered for an implementation module.

# `from_entries`

```elixir
@spec from_entries([MingaEditor.Shell.Entry.t()]) :: t()
```

Builds an unpublished snapshot from validated entries.

# `new`

```elixir
@spec new() :: t()
```

Builds an empty unpublished snapshot.

# `put_builtin`

```elixir
@spec put_builtin(t(), MingaEditor.Shell.Entry.t()) ::
  {:ok, t()} | {:error, register_error()}
```

Adds or refreshes a built-in contribution while preserving stable identity.

# `register`

```elixir
@spec register(t(), MingaEditor.Shell.Entry.t()) ::
  {:ok, t()} | {:error, register_error()}
```

Registers a new contribution after coherent duplicate checks.

# `resolve`

```elixir
@spec resolve(t(), shell_id() | module()) :: MingaEditor.Shell.Entry.t() | nil
```

Resolves a shell id or implementation module from this publication.

# `unregister`

```elixir
@spec unregister(t(), MingaEditor.Shell.Entry.source(), shell_id()) ::
  {:ok, t(), boolean()} | {:error, :not_owner}
```

Removes one contribution only when the source owns it.

# `unregister_source`

```elixir
@spec unregister_source(t(), MingaEditor.Shell.Entry.source()) :: {t(), boolean()}
```

Removes every contribution owned by one source in one value transition.

---

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