티스토리 뷰

최근에이 문제를 발견했으며 다음은 저에게 도움이되는 몇 가지 구성입니다.

DefinitelyTyped @ types / gapi 패키지를 사용하고 있습니다.

npm install --save-dev @types/gapi

typescript docs 에서 /// <reference types="..." />지시문을 사용 하여 typescript 파일에 유형을로드합니다.

/// <reference types="gapi" />

tsconfig.json내 프로젝트의 루트 파일에있는 추가 구성 :

{
  ...
    "compilerOptions": {
        // I thought this was enough to recognize the types
            // but that was not the case
                "typeRoots": ["node_modules/@types"],
                    ...
                      }
                      }
                      

typescript v2.0 이상을 사용해야합니다.



출처
https://stackoverflow.com/questions/39915890
댓글
공지사항
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31