티스토리 뷰

728x90

global.d.ts

declare global {
  interface Window {
    ethereum?: any;
  }

  namespace NodeJS {
    interface ProcessEnv {
      NEXT_PUBLIC_ERC721_CA: string;
    }
  }
}

export const ethereum = window.ethereum;

tsconfig.json

{
  ...
  "include": [
    "global.d.ts",
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx"
  ],
  ...
}

'웹 개발 > Typescript' 카테고리의 다른 글

keyof + generic + extends & type lookup  (0) 2022.01.08
Generic 기본  (0) 2022.01.08
class 기본 (static, singleton)  (0) 2022.01.08
class 기본 (readonly, index signatures)  (0) 2022.01.04
class 기본 (초기화, getter, setter)  (0) 2022.01.04
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/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
글 보관함