https://reactjs.org/docs/static-type-checking.html#typescript

대충 typescript 설치하고 명령어로 config 생성 후 build path 따로 지정해줘야 한다는 말.

타 라이브러리 타입 얻는 방법 3가지

https://reactjs.org/docs/static-type-checking.html#type-definitions

  1. 베스트 운 좋은 케이스. 라이브러리 자체에 index.d.ts 로 bundle되고 package.jsontypegs 혹은 types 필드에 그 파일을 명시돼있는 경우. classnames 라이브러리 참고!!!
  2. **DefinitelyTyped 를 다운받는다.** Microsoft에서 관리하는 방대한 타입 정의 레파지토리이다. 내가 오픈소스를 만든다면 저기다 타입을 contribute 하는것도 고려해보자(index.d.ts 를 하는게 나을까??) react의 경우는, 저기에 정의돼있지 않으니 다음과 같은 명령을 사용해야 한다.
# yarn
yarn add --dev @types/react

#npm
npm i --save-dev @types/react
  1. 1, 2 에서 타입을 얻지 못했으면 라이브러리를 사용하는 프로젝트 루트에다가 declarations.d.ts 파일을 만들어서 내가 타입을 선언해줘야 한다.
declare module 'querystring' {
	export function stringify(val: object): string
	export function parse(val: string): object
}