Gee
在线工具
数据转换
工具箱
TypeScript 类型生成
输入 JSON,自动推断并生成 TypeScript interface / type,支持嵌套对象和数组
JSON 输入
格式化
[ { "id": 1, "title": "Hello World", "published": true, "score": 4.5, "author": { "name": "Alice", "email": "alice@example.com" }, "tags": ["ts", "json"] }, { "id": 2, "title": "Second Post", "published": false, "score": 3.8, "author": { "name": "Bob", "email": "bob@example.com", "bio": "Developer" }, "tags": [] } ]
TypeScript 类型
复制
interface Author { name: string email: string } interface RootItem { id: number title: string published: boolean score: number author: Author tags: string[] | unknown[] } type Root = RootItem[]
根类型名:
interface
type
宽松模式(string/number 合并为 unknown)