Skip to content
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

TypeScript: Column disabled:true should allow types without | null #366

Open
tordans opened this issue Oct 28, 2024 · 0 comments
Open

TypeScript: Column disabled:true should allow types without | null #366

tordans opened this issue Oct 28, 2024 · 0 comments

Comments

@tordans
Copy link

tordans commented Oct 28, 2024

When I mark a column as disabled: true I would expect the library to trust that I know what data this column will have, because that data is under my control and not the users control.

In my Row types, I would like to type this column as "string" and not "string|nil".

However, ATM the textColumn will error

Argument of type 'Partial<Column<string | null, TextColumnData<string | null>, string>>' is not assignable to parameter of type 'Partial<Column<string, any, string>>'.

Suggestion:

The textColumn should learn about the disabled:true and allow to omit the nil.

Example:

I have an id column which I fill with the id of my Database and a fallback value in createRow. This way I can make sure the id is always given. It is also a quick way to group the updates in new rows vs. rows that need an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant