-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TS thinks the return type of GoogleSpreadsheetRow<Row>.get("Column")
is any
rather than Row["Column"]
#641
Comments
Oh wow, I totally missed that... Was definitely my intention to return the typed column. Thanks for the heads up - will push an update shortly! |
Hmm so taking a deeper look and poking around a bit, it looks like for the types on First, support the Alternatively (or in addition to rather) perhaps a slightly more complex schema system would help. This could either be something like providing a transformation function (ie convert the formatted/string version and spit out the values that match your expected types using things like Or something like providing a schema object, which defines the types and optionally provide transformation functions for each key - although many of the transformations may be able to be inferred since common types will cover most cases - things like boolean, dates, floats/ints, etc. This will all make things slightly more complicated than just providing the type only when calling Open to suggestions too - since I don't actually use this tool on any complex projects... |
i think adding |
That's pretty much it; it's probably because the type signature of
GoogleSpreadsheetRow.get
is(key: keyof T) => any
rather than<K extends keyof T>(key: K) => T[K]
or similar.I could open a PR to update that if it's okay!
The text was updated successfully, but these errors were encountered: