🟦 JSON 转 TypeScriptJSON to TypeScript Interface
根据 JSON 数据自动生成 TypeScript interface 类型定义,支持嵌套对象和数组。Generate TypeScript interfaces from JSON, including nested objects and arrays.
使用说明与常见问题How-to & FAQ
「JSON 转 TypeScript」是什么?What is the JSON to TypeScript Interface tool?
根据 JSON 数据自动生成 TypeScript interface 类型定义,支持嵌套对象和数组。Generate TypeScript interfaces from JSON, including nested objects and arrays.
如何使用「JSON 转 TypeScript」?How do I use the JSON to TypeScript Interface tool?
在「JSON 转 TypeScript」中,把内容粘贴或输入到上方输入框,按需设置「根类型名」,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「{"m":[1,"a",null]}」,得到「export interface Root { ⏎ m: (number | string | null)[]; ⏎ }」。In the JSON to TypeScript Interface: Paste or type into the input box, adjust "Root name"; the result appears below instantly — click "Copy result" to copy it. Example: "{"m":[1,"a",null]}" → "export interface Root { ⏎ m: (number | string | null)[]; ⏎ }".
代码或数据会被上传吗?Is my code or data uploaded?
不会。「JSON 转 TypeScript」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The JSON to TypeScript Interface runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「JSON 转 TypeScript」免费吗?需要注册吗?Is the JSON to TypeScript Interface free? Do I need an account?
「JSON 转 TypeScript」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The JSON to TypeScript Interface is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.