拖放或貼上 JSON
提供任意樣本 JSON 資料或 API 回應。
在瀏覽器記憶體中將 API 資料轉換為乾淨、模組化的 TypeScript .d.ts 介面 — 自動將巢狀陣列抽離為具名型別。
選擇 JSON 檔案
輸出 .d.ts interface 或 type 別名 · readonly 切換.json
零上傳限制 · 執行於瀏覽器記憶體
巢狀 TypeScript 介面定義
{
"dataset": "orders_2026",
"rowCount": 42000,
"compressed": true,
"columns": [
{ "name": "id", "nullable": false },
{ "name": "amount", "nullable": false }
]
}export interface ColumnsItem {
name: string;
nullable: boolean;
}
export interface Payload {
dataset: string;
rowCount: number;
compressed: boolean;
columns: ColumnsItem[];
}| 屬性 | JSON |
|---|---|
| 副檔名 | .json |
| MIME 類型 | application/json |
| 結構類型 | 階層結構 |
| 編碼方式 | UTF-8 純文字 |
| 巢狀支援 | 是 |
| LLM Token 效率 | 低 |
| Schema / 型別約束 | 否 |
| 最佳適用場景 | REST/GraphQL API 負載、巢狀 Web 狀態、LLM 結構化輸出以及跨語言通用資料交換。 |
在本機從巢狀 JSON 擷取模組化的 TypeScript interface 或 type 定義,並支援選用 readonly 修飾詞。
提供任意樣本 JSON 資料或 API 回應。
指定根符號名稱、選擇 interface 或 type,並切換 readonly 欄位修飾。
將模組化的 TypeScript 型別直接貼入您的前端或 Node 專案中。
將 JSON 資料轉換為嚴格的 Zod v4 TypeScript 驗證器(z.object、z.email()、z.int())並匯出 z.infer 型別。
在本機從 JSON 推斷 Draft 2020-12 或 Draft-07 JSON Schema,包含巢狀型別、格式、required 陣列與嚴格 additionalProperties。
在本機從 JSON 推斷依拓撲排序的 Python Pydantic v2 BaseModel 類別,支援 list[...]、| None 聯集與 v1 相容模式。
type 別名而不是 interface 宣告嗎?可以。取消勾選 產生 interface 而非 type 即可產生 export type 型別別名。
陣列中的多種物件形狀會透過統一型別中間表示 (Unified Type IR) 乾淨地合併共通與選填(?)欄位。
請搭配使用 JSON 轉 Zod,即可同時獲得執行期驗證與靜態 z.infer 型別。