# `MingaEditor.Commands.FileTree.DuplicateBackend`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/commands/file_tree/duplicate_backend.ex#L1)

Injectable boundary for the Duplicate command's owned filesystem effects.

The command claims a destination before copying so cleanup can remove only output owned by that operation. The backend keeps filesystem failures deterministic in tests.

# `cleanup_result`

```elixir
@type cleanup_result() :: {:ok, [String.t()]} | {:error, File.posix(), String.t()}
```

# `copy_result`

```elixir
@type copy_result() ::
  :ok
  | {:ok, [String.t()]}
  | {:error, File.posix()}
  | {:error, File.posix(), String.t()}
```

# `entry_type`

```elixir
@type entry_type() :: :directory | :file
```

# `t`

```elixir
@type t() :: module()
```

# `claim_destination`

```elixir
@callback claim_destination(String.t(), entry_type()) :: :ok | {:error, File.posix()}
```

# `cleanup`

```elixir
@callback cleanup(String.t()) :: cleanup_result()
```

# `copy`

```elixir
@callback copy(String.t(), String.t(), entry_type()) :: copy_result()
```

---

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