News for hackers. Stuff that matters.
Re:Adopting Ruby 3 types with RBS by sanxiyn on Saturday December 26, 2020 @12:17AM (#25541588)
I think it is more like .d.ts for TypeScript. Sometimes you do want types in a different file.
Re:Adopting Ruby 3 types with RBS by shadowfacts on Saturday December 26, 2020 @12:24AM (#25541613)
Not really, .ts files can have types in the source code. .d.ts lets you type external JS code which is useful for untyped dependencies, as is the case here, I imagine. But within your own project having types be part of the actual declarations is much better.
Re:Adopting Ruby 3 types with RBS by throwaway189262 on Saturday December 26, 2020 @05:18AM (#25542514)
Those are only used to retrofit types on external libraries that don't have them. All types within project are in the source.

.d.ts is a way to add types to source you don't control.

Ruby should have gone the path of typescript where .d.ts generation and type stripping is done by a tool you run when you publish your library. That way you can work with types in your code but export it to plain js that others can use with or without tyoings