JSON 转 TypeScript
根据 JSON 示例自动生成嵌套的 TypeScript Interface 定义。
根接口名称
生成结果 (TS Interfaces)
export interface IRootObject {
id: number;
name: string;
active: boolean;
tags: string[];
metadata: Metadata;
}
export interface Metadata {
author: string;
version: string;
}使用说明
1. 工具会递归分析对象结构并生成对应接口。
2. 数组对象会自动拆出独立的项类型。
3. `null` 或无法精确推断的值统一标记为 `unknown`。