Skip to content

7.6.0 Type Annotation for DocumentCollection #750

@denny99

Description

@denny99

Version 7.6.0 introduced a new type defintion for the collection generic.

Was:
DocumentCollection<T extends object = any>

Is now:

DocumentCollection<T extends Record<string, unknown>>

The Record type with unknown forces me to give all of my interfaces an index signature like [key: string]: unknown.
As soon as i start adding the signature a whole lot of other things start to break... And obviously it is not correct, i don't want foreign fields on my objects.

So right now, it is just impossible for us to upgrade, so i had to freeze my version back to 7.5.0.

I know object and any are discouraged. But a Record<string, any> doesn't force us to always use index signatures.
So this might be a better solution for replacing object?

image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions