Content
@
0 reply
0 recast
0 reaction
Nicholas Charriere
@pushix
I was looking at google's new node SDK for gemini. I like this "disjoint types" pattern. A very good way to make your TypeScript very readable + meaningful, I have used something similar, but not with the "never" trick.
9 replies
0 recast
9 reactions
stringtheory
@stringtheory69
Can u elaborate?
1 reply
0 recast
0 reaction
Nicholas Charriere
@pushix
When you manipulate a Part, it's always either a TextPart or a InlineDataPart. The cheap way to describe this is: Part { text?: string; inlineData?: thing; } But this isn't as helpful: it doesn't tell you that it's strictly one or the other.
1 reply
0 recast
1 reaction