Описание .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.

Поддерживаемое ПО

  • Visual Studio Code Бесплатно
  • TypeScript Compiler Бесплатно
  • WebStorm Платно

Альтернативные форматы

.js .jsx .tsx .mjs