interface vs type alias — which should I pick?
For modelling JSON either is fine. Use interface for object shapes that may extend or merge across files (declaration merging is interface-only). Use type for unions, intersections, mapped types, and conditional types. The generator emits interface by default because it is the most common and most extensible choice for API response shapes.
Are unions inferred from arrays of mixed types?
The generator infers the type from the first element only — arrays of mixed types fall back to the first element type. For real mixed arrays (e.g. (string | number)[]), edit the output by hand. A more sophisticated inference would walk every element and union the distinct types.
How should I handle optional fields?
JSON has only present-or-null. To mark a property optional in TypeScript add a "?" — e.g. `email?: string`. The generator marks fields whose sample value is null as `field: null`; change to `field?: string` once you know the real shape.
Will this work with strict mode?
Yes. The output uses concrete types without any. For nested objects it produces named interfaces; for null fields it uses `null` rather than `any`. If you enable `noUncheckedIndexedAccess`, beware that the generator does not yet add `| undefined` to optional fields — add manually where necessary.
How do I validate at runtime?
TypeScript interfaces are erased at compile time, so the JSON shape is not validated at runtime. For runtime validation, generate a Zod schema, an io-ts codec, or use a library like Valibot or Ajv against a JSON Schema. Type-only is fine when the JSON comes from a service you control.
Why does the output use `Record<string, unknown>` for empty objects?
When the generator encounters an empty object {} the JSON sample provides no keys to infer, so the safest fallback is `Record<string, unknown>`. Provide a richer sample that includes the actual keys to get a typed nested interface instead.
Is the JSON uploaded?
No. The conversion runs entirely in your browser. There is no network call when you click Convert — internal API contracts, tokens, and PII never leave the device. Verify in DevTools → Network.
Can I use these interfaces with React, Vue, or Next.js?
Yes. The output is plain TypeScript — drop it into any framework. For React, type a `useState<Root | null>(null)` or props with the interface. For Next.js API routes, type the request body and response body of `Route Handlers`. The interfaces work identically across all TypeScript projects.