Ana sayfa
Tom Utilities

JSON'dan TypeScript'e

JSON araçları

Bir JSON örneğinden isteğe bağlı ve birleşim türleriyle TypeScript arayüzleri üretir.

Girdi

Sonuç

Nasıl kullanılır

Generating TypeScript interfaces

Paste a JSON sample and press Convert to obtain interfaces. Union types are produced for mixed arrays.

  1. Paste a JSON sample.
  2. Press Convert.
  3. Copy the interfaces into your project.

Sık sorulan sorular

Are fields marked optional?

Fields missing from the sample are not inferred, so optionality is only added when a value is null.

How are arrays typed?

Homogeneous arrays use a single type, mixed arrays produce a union type and empty arrays produce unknown[].