合并 PDF
二维码生成器
密码生成器
JSON 格式化工具
所有工具
返回首页
从 JSON 生成 TypeScript 接口
根名称
JSON
{ "id": 1, "name": "Ana", "active": true, "address": { "city": "São Paulo", "zip": "01000-000" }, "tags": ["a", "b"] }
TypeScript 接口
复制
interface Root { id: number; name: string; active: boolean; address: Address; tags: string[]; } interface Address { city: string; zip: string; }
粘贴 JSON 对象,获取包含嵌套对象和数组的 TypeScript 接口定义,可直接复制到代码中使用。