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, class, abstract class
  • 선택속성(optional property) ?
  • 익명 인터페이스(anonymous interface)
  • 클래스; 접근제한자(access modifier), 생성자(constructor)
  • 구현 implements
  • 상속 extends, super 키워드
  • static 속성 in class
  • 구조화 structuring ↔ 비구조화 destructuring
  • 잔여 연산자 rest operator, 전개 연산자 spread operator
  • 타입 변환 type conversion, cf.) type casting, type coercion
  • 타입 단언 type assertion
  • 매개변수 parameter, 인수 혹은 인자 argument
  • 함수 시그니처 function signature
  • 타입 별칭 type alias
  • undefined, null
  • 선택적 매개변수 optional parameter
  • 함수 표현식 function expression
  • 일등 함수 first-class function
  • 표현식, 함수 표현식, 계산법, 함수 호출 연산자, 익명 함수
  • public/computer/typescript.1639548978.txt.gz
  • Last modified: 2021/12/15 15:16
  • by alex