# `DoubleDown.Double.Types`
[🔗](https://github.com/mccraigmccraig/double_down/blob/main/lib/double_down/double/types.ex#L1)

Shared type definitions for per-operation functions in `DoubleDown.Double`.

These types describe the function signatures accepted by `expect/4`,
`stub/3`, and `fake/3` — the per-operation Double API.

# `cross_contract_expect`

```elixir
@type cross_contract_expect() :: ([term()], term(), map() -&gt; {term(), term()})
```

A stateful expect responder with cross-contract state access:
`fn [args], state, all_states -> {result, new_state} end`.

# `cross_contract_fake`

```elixir
@type cross_contract_fake() :: ([term()], term(), map() -&gt; {term(), term()})
```

A per-operation fake function with cross-contract state access:
`fn [args], state, all_states -> {result, new_state} end`.

# `expect_fun`

```elixir
@type expect_fun() :: stateless_expect() | stateful_expect() | cross_contract_expect()
```

Any expect responder (stateless, stateful, or cross-contract).

# `fake_fun`

```elixir
@type fake_fun() :: stateful_fake() | cross_contract_fake()
```

Any per-operation fake function (stateful or cross-contract).

# `stateful_expect`

```elixir
@type stateful_expect() :: ([term()], term() -&gt; {term(), term()})
```

A stateful expect responder reading the fallback's state:
`fn [args], state -> {result, new_state} end`.

# `stateful_fake`

```elixir
@type stateful_fake() :: ([term()], term() -&gt; {term(), term()})
```

A per-operation fake function reading the fallback's state:
`fn [args], state -> {result, new_state} end`.

# `stateless_expect`

```elixir
@type stateless_expect() :: ([term()] -&gt; term())
```

A stateless expect responder: `fn [args] -> result end`.

# `stub_fun`

```elixir
@type stub_fun() :: ([term()] -&gt; term())
```

A per-operation stub function: `fn [args] -> result end`.
Always 1-arity (stateless).

---

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