Andrea Simone Costa
banner
jfet97.bsky.social
Andrea Simone Costa
@jfet97.bsky.social
Just some TypeScript here

https://andreasimonecosta.dev/posts/
I've completed Parser Combinators: The Final Frontier - Advent of TypeScript 2024 adventofts.com/events/2024/24

Fuck "Type instantiation is excessively deep and possibly infinite", I wanna non termination
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
adventofts.com
December 24, 2024 at 9:02 PM
I've completed Magic Curry Mind Control Inception - Advent of TypeScript 2024 adventofts.com/events/2024/16

Special cased for t4 😅 with a powerful T extends [string, number, boolean] XD
Advent of TypeScript
Advent of TypeScript is a month-long event running from December 1 to Christmas, featuring daily TypeScript challenges. Participants can test their skills, climb the leaderboard, and engage with the T...
adventofts.com
December 16, 2024 at 8:15 AM
December 13, 2024 at 8:18 AM
I've completed 🎩Bernard's Long List Of Names - Advent of TypeScript 2024 adventofts.com/events/2024/12
December 12, 2024 at 12:47 PM
#typescript

The next TypeScript compiler update will be exciting!

PR #56941 by @gabritto.bsky.social improves support for conditional and indexed access types as return types, enabling proper typing for functions like the one in the snippet without clunky hacks or dubious overloads.
December 4, 2024 at 9:33 AM
Hi there @gabritto.bsky.social!

I'm playing with your PR and I got a couple of non working cases (and some combinations), but I can't find the reason in the description of the PR. Would you mind to have a look? Thanks!

www.typescriptlang.org/play/?ts=5.8...
TS Playground - An online editor for exploring TypeScript and JavaScript
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
www.typescriptlang.org
November 29, 2024 at 8:56 PM
#typescript

Immediate access in the realm of values is not deferred, but `to` has a type param as type so TS can only resort to its constraint. OTOH in the realm of types `T["property"]` stays deferred, so indirect access is well typed.

@andarist.bsky.social highlight of the day from our chat
November 22, 2024 at 9:34 PM
Reposted by Andrea Simone Costa
I'll remember the world before and after this PR: github.com/microsoft/Ty...
The new era of conditional types checking is coming in TypeScript 5.8!
Narrow generic conditional and indexed access return types when checking return statements by gabritto · Pull Request #56941 · microsoft/TypeScript
Fixes #33912. Fixes #33014. Motivation Sometimes we want to write functions whose return type is picked between different options, depending on the type of a parameter. For instance: declare const ...
github.com
November 6, 2024 at 9:23 AM
Reposted by Andrea Simone Costa
I'm looking for TypeScript consulting to support my full-time open-source work on @arktype.io!

If your team struggles with...

🧩 Writing complex types to optimize DX
☠️ tsserver lag in editor
🧪 Type testing or benchmarking

I can help! If not, retweets also really help💖
October 31, 2024 at 5:34 PM