`npm i`을 통해서 외부 라이브러리를 사용하다보면 타입이 제대로 지정되어있지 않거나 자바스크립트로 작성된 코드라서 타입 추론이 안되는 경우가 많다. 이럴 땐 `declare module`을 이용해서 타입을 지정할 수 있다.
```typescript
declare module "external-library" {
export type AnimatingState =
| "before-animation"
| "animating"
| "after-animation";
export function getAnimatingState(): AnimatingState;
}
```
---
참조 강의: https://inf.run/FVDi