JSON 转 TypeScript

将 JSON 转换为 TypeScript 接口定义

根类型名
TypeScript 接口
interface Address {
  city: string
  zip: string
}

interface User {
  id: number
  name: string
  age: number
  active: boolean
  address: Address
  tags: string[]
  scores: number[]
  meta: null
}