지호
, Vue.js + TypeScript 완벽 가이드
2개의 인터페이스를 합침
타입 스크립트 선언 병합: https://www.typescriptlang.org/docs/handbook/declaration-merging.html
node_modules/vuex/vue.d.ts
스토어의 타입이 any이기 때문에, 컴포넌트 레벨에서 접근하게 되면 store의 타입이 any로 추론됨
https://joshua1988.github.io/vue-camp/ts/vuex.html 참고하여 뷰엑스 타입 정의
src/store/state.ts
src/store/index.ts
node_modules/vuex/vue.d.ts 에서 any -> RootState로 변경
src/store/mutations.ts
src/store/types.ts
Omit: https://joshua1988.github.io/ts/usage/utility.html#자주-사용되는-유틸리티-타입-몇-개-알아보기
Union과 Intersection: https://joshua1988.github.io/ts/guide/operator.html#union-type
src/store/actions.ts
tsconfig.json
src/types/project.d.ts