Comment

Comment by Waterluvian

I’ve been absolutely loving template types and dot notation pathing. I have an entire compile time (and therefore autocompletable) argument for major.minor.patch.theme.schemaname for all schemas in the program manage. I don’t consider these “hyper typing” because they’re very, very easy to reason about when used in the right context like dot notation paths.

I wish, however, I could cleanly type “this must be an integer between 0 and 58” but typescript isn’t that expressive unless you do some pretty ridonkulous things. Especially with template strings it would be so cool to have something like:

type foo = `v${0:1}.{0:99}.{0:}`

(or whatever pre-existing format exists elsewhere. I just made that up)

This would be generalized as a “number range literal”, maybe. So not particular to template strings.

But not regex. Solving this with a regex literal type would be the poster child of “hyper typing”.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton