D
DevTools
← 返回首页
📝 JSON 转 TypeScript 接口
根据 JSON 数据自动生成 TypeScript 类型定义
根接口名称
导出方式
interface
type
export interface
export type
可选属性 (字段可能不存在时加 ?)
属性名转驼峰命名
JSON 数据
0 字符
{ "id": 1, "name": "张三", "email": "zhangsan@example.com", "age": 25, "is_active": true, "roles": ["admin", "user"], "profile": { "avatar_url": "https://example.com/avatar.jpg", "bio": "这是一段简介", "location": "北京" }, "created_at": "2023-09-01T12:00:00Z", "scores": [95.5, 88.0, 92.3], "settings": { "theme": "dark", "notifications": { "email": true, "push": false, "sms": true } } }
生成 TS
格式化 JSON
清空
TypeScript 类型
0 行
复制
下载 .ts