public:computer:typescript

This is an old revision of the document!


TypeScript

npm i -D typescript  // devDependency로 설치
npm i -g typescript  // global로 설치
  • PowerShell 관리자모드 실행
Set-ExecutionPolicy Unrestricted
npx tsc myFirstTypescript.ts  // devDependency로 설치 시
tsc myFirstTypescript.ts  // global 설치 시
tsc --init

  "outDir": "./dist",
  "rootDir": "./src",

npm i -g tslint  // tslint package module 설치
tslint --init

{
  ...
  "rules": {
    "semicolon": true
  },
  ...
}

  "editor.formatOnSave": false,
  "tslint.autoFixOnSave": true,

npm i tslint-config-prettier  // 패키지 설치 후 아래 진행

{
  ...
  "extends": ["tslint:recommended", "tslint-config-prettier"],
  ...
}

  editor.formatOnSave: true
  ...
  "prettier.tslintIntegration": true

  • 트랜스파일러(transpiler)
  • 비구조화 할당(destructuring assignment
  • 화살표 함수(arrow function)
  • 캡슐화(encapsulation), 상속(inheritance), 다형성(polymorphism)
  • 반복기(iterator)
  • 생성기(generator)
  • Promise, await/async
  • 비동기 콜백 함수 asynchronous callback function
  • 타입 주석(type annotation)
  • 타입 추론(type inference)
  • 튜플(tuple)
  • 제네릭 타입(generic type)
  • 추상 데이터 타입(abstract data type)
  • 합집합 타일(union 또는 sum type), 교집합 타입(intersection 또는 product type)
  • package.json
  • tsconfig.json
    • module 키
    • moduleResolution 키
    • target 키
    • baseUrl과 outDir 키
    • paths 키
    • esModuleInterop 키
    • sourceMap 키
    • downlevelIteration 키
    • noImplicitAny 키
  • number, boolean, string, object, any, undefined
  • let, const
  • 템플릿 문자열; `` 역따옴표(backtick) ${}
  • object, interface,
  • 선택속성(optional property) ?
  • public/computer/typescript.1639547604.txt.gz
  • Last modified: 2021/12/15 14:53
  • by alex