강의

멘토링

커뮤니티

Inflearn Community Q&A

ng3154294163's profile image
ng3154294163

asked

Learn TypeScript with a real-world project

Analysis of type errors related to DOM functions

declare가 무엇인가요

Written on

·

204

1

declare가 무엇이고 언제 어디서 왜 쓰는건지 궁금합니다.

es6typescript

Answer 2

1

ng3154294163님의 프로필 이미지
ng3154294163
Questioner

답변 감사합니다.

0

captain님의 프로필 이미지
captain
Instructor

안녕하세요 개발을잘해보자쫌님, 좋은 질문 주셨네요. declare는 타입스크립트에게 이런 변수나 라이브러리가 있어 라고 말해주는 예약어입니다. 타입스크립트가 모듈 방식(import, export)으로 프로젝트를 구성하다보니 전역으로 선언한 변수(라이브러리)를 import 해주지 않으면 인식을 못하는데요. 그 때 사용하시면 됩니다 :)

ng3154294163's profile image
ng3154294163

asked

Ask a question