Privvert logoPrivvert

JSON → TypeScript

Generér interfaces

Om dette værktøj

Paste any JSON sample and get strongly-typed TypeScript interfaces or types. Detects optional fields by merging arrays of objects with different shapes.

Funktioner

  • interface or type output
  • Merges array elements into a single shape with optionals
  • Names nested types from their key
  • Quoted keys for non-identifiers

Sådan bruger du det

  1. Paste a JSON example.
  2. Set the root type name.
  3. Copy the generated TypeScript.
🔒 100 % privat

Alt sker inde i din browser med JavaScript og WebAssembly. Dine filer bliver aldrig uploadet, aldrig gemt og aldrig set af os.

Ofte stillede spørgsmål

Can it infer string literal unions?

Currently it produces 'string'; literal-union inference is on the roadmap.