Skip to content

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

@tordans

Description

@tordans

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions