Closed SrBrahma closed 6 months ago
The problematic type is the DocId, that is declared just as declare class DocId {}
, and that {} is probably being interpreted as any non-nullish value, as it says when we type A = {}
:
Don't use `{}` as a type. `{}` actually means "any non-nullish value".
- If you want a type meaning "any object", you probably want `Record<string, unknown>` instead.
- If you want a type meaning "any value", you probably want `unknown` instead.
- If you want a type meaning "empty object", you probably want `Record<string, never>` instead.
Proof of that is that I can just write any type of value in the first param when the other params are filled, except null.
I am using the alpha version of the lib.
I have no idea on how to fix this, as I never saw that DocId type before.
Fixed with v10
Images to better explain:
When writing first param. Working as intended:
When filling first param when others are already filled. Intellisense not working, may enter invalid fields without TS error.
I have found out that if I remove the first where type declaration in the .d.ts of this lib, it gets fixed.
The problematic where that causes it and that I removed to fix it, as shows the previous image