À propos .ts

TypeScript menambahkan: static type annotations (let x: number = 5), interfaces, enums, generics, utility types (Partial, Required, Pick, Omit), type guards, dan discriminated unions. Semua kode JavaScript valid adalah TypeScript. TypeScript compiler (tsc) menghapus type annotations dan menghasilkan JavaScript. Keunggulan: deteksi error saat compile time (bukan runtime), autocompletion lebih baik di IDE, refactor lebih aman, dan dokumentasi built-in melalui types. Digunakan oleh: Angular (bahasa default), Next.js, NestJS, Deno, dan banyak framework modern. TypeScript sangat populer di enterprise dan proyek besar. tsconfig.json mengatur konfigurasi compiler. Ekosistem DefinitelyTyped menyediakan type definitions untuk ribuan library. Kekurangan: waktu compilation, learning curve untuk type system, dan boilerplate untuk type definitions.

Logiciels compatibles

  • Visual Studio Code Gratuit
  • TypeScript Compiler Gratuit
  • WebStorm Payant

Formats alternatifs

.js .jsx .tsx .mjs