JSON Input Area
TypeScript Interface/Type Definition
TypeScript Conversion Guide & Type Info
Tool Features
- Interface vs Type: You can choose to generate an
interfaceor atypealias according to your project specifications. Both are generally interchangeable when describing object structures in most scenarios. - Export Declaration: When checked,
exportis automatically added to all generated definitions, making it easy to export directly as a module in.tsor.d.tsfiles. - Readonly Properties: When enabled, the
readonlymodifier is prepended to all object properties, which is very useful for immutable data flows in state management libraries like Redux/Vuex. - Smart Property Names: When a JSON key contains a hyphen (e.g.,
first-name) or starts with a number, the tool automatically wraps it in double quotes to ensure the generated TS code syntax is valid.
Type Mapping Rules
- String ➜
string - Number ➜
number - Boolean ➜
boolean - Array ➜
Type[]orany[] - Null / Undefined ➜
any(Used when precise types cannot be inferred)
