get-convex / convex-js

TypeScript/JavaScript client library for Convex
https://docs.convex.dev
Apache License 2.0
108 stars 12 forks source link

Add `v.tuple` #16

Open boar-is opened 3 weeks ago

boar-is commented 3 weeks ago

This is important, since arrays don't provide proper typings:

v.tuple(v.number(), v.string()) // [number, string] ✅

v.array(v.union(v.number(), v.string())) // (number | string)[]

For now, the only solution is to use v.any or do weird type castings.