# TS7016: Could not find a declaration file for module '…'. '…' implicitly has an 'any' type.

> A JavaScript package has no type declarations, so its imports would be `any`. Install its `@types` package or declare the module.

## What it means

An import resolved to a JavaScript file, but no declaration file (`.d.ts`) was found for it, so
under `noImplicitAny` everything it exports would be `any`. This is common with older npm
packages that don't ship types.

## Example

```ts
import { slugify } from "slugger";
export const s = slugify("Hello");
```

```js
exports.slugify = (s) => s.toLowerCase();
```

```json
{ "name": "slugger", "main": "index.js" }
```

## How to fix

- Install the community types if they exist: `npm i -D @types/<package>`.
- Otherwise add a declaration in your project, for example in `types/<package>.d.ts`:
  `declare module "<package>" { export function f(x: string): number; }`.
- A shorthand `declare module "<package>";` silences it but makes every import `any`.

Source: https://ts-r.dev/errors/TS7016/
