You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve type of collection utils for Trailbase, PowerSync, and localOnly collections (#1236)
* Proprly type collection utils for Electric, Trailbase, PowerSync, and local collections.
* Changeset
* ci: apply automated fixes
* Revert unnecessary change to Electric collection typing
* Add type tests to check the type of the utils of the collections
* ci: apply automated fixes
* Fix types in powersync tests
* Fix type in trailbase type test
* ci: apply automated fixes
* Changeset update
* Add type test verifying utils retain concrete types after createCollection
Adds a reproduction test for the issue where ElectricCollectionUtils type
is widened to UtilsRecord after passing electricCollectionOptions through
createCollection when handlers (onInsert, onUpdate, onDelete) are present.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix ElectricCollectionUtils type lost after createCollection
Omit onInsert/onUpdate/onDelete from CollectionConfig in the return type
of electricCollectionOptions overloads, then re-add them via Pick from
ElectricCollectionConfig which carries the correct ElectricCollectionUtils<T>.
This eliminates conflicting TUtils inference sites when the result is
passed to createCollection.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* ci: apply automated fixes
* Add electric-db-collection to changeset
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments