# `Adze.Aliases`
[🔗](https://github.com/matthewlehner/adze/blob/v0.1.0/lib/adze/aliases.ex#L1)

List every `alias` / `import` / `require` / `use` directive in a file,
scoped per `defmodule` and emitted in source order.

Useful as a cleanup target (unused aliases, `import` -> explicit
`alias`, etc.) and as a navigation index for AI consumers — same role
as `outline`, but specifically for directives.

## Output shape

    %{
      file: "lib/foo.ex" | nil,
      modules: [
        %{
          name: "Foo.Bar",
          range: %{start: 1, end: 20},
          directives: [
            %{
              kind: :alias | :import | :require | :use,
              target: "Foo.Bar",           # dotted module string
              as: "Baz" | nil,             # alias-only binding override
              group: true | false,         # part of `alias Foo.{A, B}` form
              text: "alias Foo.Bar",       # raw source slice
              range: %{start: N, end: N}
            },
            ...
          ]
        }
      ]
    }

Group-form `alias Foo.{A, B}` is expanded into one entry per member.
All members share the same `range` and `text` (pointing at the
original declaration) and carry `group: true`, so callers can either
reason about each binding independently or recognize the original
grouping.

# `directive`

```elixir
@type directive() :: %{
  kind: :alias | :import | :require | :use,
  target: String.t(),
  as: String.t() | nil,
  group: boolean(),
  text: String.t(),
  range: %{start: pos_integer(), end: pos_integer()} | nil
}
```

# `aliases`

```elixir
@spec aliases(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, term()}
```

# `aliases_file`

```elixir
@spec aliases_file(Path.t()) :: {:ok, map()} | {:error, term()}
```

---

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