-
Notifications
You must be signed in to change notification settings - Fork 9
Description
This should be relatively simple, but to have better TS support we should add the returned fields as typed properties on each model. This helps with autocomplete (even for JS users) and will overall tighten up the project code.
Currently the only fields being typed are mostly things that should be private to the package:
Lines 4 to 9 in 330c170
| class Row { | |
| API: API; | |
| id?: string; | |
| docId?: string; | |
| tableId?: string; | |
| values?: any; |
A solution could be to create an interface for RowFields or something like that which has all of the fields returned from the Coda API. This interface can be used to type the create/update methods instead of using any:
Line 28 in 330c170
| async update(row: any): Promise<boolean> { |
It's possible that we may need to add the fields to the main model as well as have interfaces for each individual CRUD operation that needs it though, in case some take different options.
We'll also want to mark some of the current fields as private so that they aren't exposed outside of the package.