Archive
Type Definitions

Type Definitions

When assigning a type to a variable added to process.env

types/global.d.ts
declare namespace NodeJS {
  interface Process {
    env: ProcessEnv
  }
  interface ProcessEnv {
    NODE_ENV: string
  }
}

When assigning variable types to window and document objects

types/global.d.ts
export {}
declare global {
  // Add window object variable type
  interface Window {}
  // Add document object variable type
  interface Document {}
}

© 2023 kidow. All rights reserved.
안녕하세요?