Ty

TypeScript Editor that generates structured forms from TypeScript types

Hacker News

TypeScript Editor that generates structured forms from TypeScript types

Hey HN! I've been doing a lot of work with the TypeScript Compiler API[1] recently as part of my work on Preview.js[2], an IDE extension that lets you preview React/Solid/Vue components. One thing I noticed is that even with great autocomplete and type validation, creating/editing JS values that match a given TypeScript type can require a lot of typing. This is especially the case in Preview.js, where you can edit the props you pass to the component you're previewing in the bottom right panel. For example, quickly switching between different variants of a union type can be a hassle. To solve this, I decided to try creating a tool that generates a structured from for a given TypeScript type. For example if you pass it `type Foo = { bar: string, baz: number }`, it will show you a form with two inputs `bar` and `baz` with the appropriate types, and it will output the equivalent JS code (or JSON) as you type. You can try it at https://tseditor.fwouts.com I built this as a standalone tool so that I could debug it easily (and indeed, I found a ton of great bugs!). As it took shape, I realised there might be other use cases for it than Preview.js. Imagine for example using this in Postman (or whichever tool is better than Postman these days!) instead of inputting JSON values for your request payloads. Or perhaps using this for ad-hoc forms (the form is effectively encoded in the URL). I'm curious what you'd see yourself using this editor for? Any feedback welcome of course! Thanks François (@fwouts on Twitter) [1] https://github.com/microsoft/TypeScript/wiki/Using-the-Compi... [2] https://previewjs.com

Share card

Actual performance

12points
9comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
83%83% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: using, code · Missing: mac, agents, macos
71%71% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: ide, io · Missing: https docs, excited, just released
64%64% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
35%35% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Missing: mobile apps, ios, personal
34%34% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
15%15% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Nu
Nullable Types in TypeScript46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Nullable Types in TypeScript

Hacker News1
Ci
Cigs- Chainable AI Functions for TypeScript with OAI Structured Outputs48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cigs- Chainable AI Functions for TypeScript with OAI Structured Outputs

Hacker News2
Br
Brainfuck interpreter using TypeScript types45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Brainfuck interpreter using TypeScript types

Hacker News2
Fu
Functional data types for TypeScript development62%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Functional data types for TypeScript development

Hacker News2
Ce
Cerialize – Typescript serialization by annotation39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cerialize – Typescript serialization by annotation

Hacker News1
Sc
Scala-ts – Scala to TypeScript compiler41%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Scala-ts – Scala to TypeScript compiler

Hacker News66
Ha
Hapi with Typescript51%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Hapi with Typescript

Hacker News2
JS
JSONSchema to TypeScript compiler51%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

JSONSchema to TypeScript compiler

Hacker News72
Tr
Transpile Scala to TypeScript29%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Transpile Scala to TypeScript

Hacker News1
Du
DuoCode 1.0 bridges the gap between C# and TypeScript31%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

DuoCode 1.0 bridges the gap between C# and TypeScript

Hacker News7