fireproof-storage / fireproof

Realtime database, runs anywhere. Install Fireproof in your front-end app or edge function, and sync data via any backend.
https://fireproof.storage
Other
219 stars 16 forks source link

fix: stabilizes inferred generic typings #80

Closed thedanchez closed 5 months ago

thedanchez commented 5 months ago

Discovered an issue while kicking the tires with the SolidJS adapter where the TypeScript compiler was not inferring the correct typings for object fields. Came to realize that our DocRecord type needed to be refined further. This should stabilize the types and give better autocomplete.

Concrete example is, if you had something like { foo: true } that was passed into the generics formula, the compiler would say your object had a field foo whose available values were DocFragment & true instead of simply resolving to boolean which is a valid DocFragment value type.