# `NPM.TypesResolution`
[🔗](https://github.com/elixir-volt/npm_ex/blob/v0.7.4/lib/npm/types_resolution.ex#L1)

Resolves DefinitelyTyped @types/ packages for TypeScript consumers.

Maps package names to their corresponding @types/ package names
and checks if type definitions are needed or already provided.

# `has_bundled_types?`

```elixir
@spec has_bundled_types?(map()) :: boolean()
```

Checks if a package bundles its own types (has a `types` or `typings` field).

# `installed_types`

```elixir
@spec installed_types(map()) :: [String.t()]
```

Lists all @types/ packages in the lockfile.

# `missing_types`

```elixir
@spec missing_types(map(), map(), String.t()) :: [String.t()]
```

Finds packages that need @types/ definitions.

Returns packages that don't bundle types and whose @types/ package
is not in the lockfile.

# `types_map`

```elixir
@spec types_map(map()) :: %{required(String.t()) =&gt; String.t()}
```

Maps installed @types/ packages back to the packages they provide types for.

# `types_package`

```elixir
@spec types_package(String.t()) :: String.t()
```

Returns the @types/ package name for a given package.

---

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