From f1a8e30bbf321fd8e89e7218cc750c46f75de360 Mon Sep 17 00:00:00 2001 From: pawelblaszczyk5 Date: Fri, 5 Sep 2025 22:26:20 +0200 Subject: [PATCH] fix: explicitly type `electricCollectionOptions` return value --- .changeset/chilly-phones-rest.md | 5 +++++ packages/electric-db-collection/src/electric.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/chilly-phones-rest.md diff --git a/.changeset/chilly-phones-rest.md b/.changeset/chilly-phones-rest.md new file mode 100644 index 000000000..e5113f347 --- /dev/null +++ b/.changeset/chilly-phones-rest.md @@ -0,0 +1,5 @@ +--- +"@tanstack/electric-db-collection": patch +--- + +fix: explicitly type `electricCollectionOptions` return value diff --git a/packages/electric-db-collection/src/electric.ts b/packages/electric-db-collection/src/electric.ts index 6655020c4..c38669f57 100644 --- a/packages/electric-db-collection/src/electric.ts +++ b/packages/electric-db-collection/src/electric.ts @@ -292,7 +292,11 @@ export function electricCollectionOptions< TExplicit extends Row = Row, TSchema extends StandardSchemaV1 = never, TFallback extends Row = Row, ->(config: ElectricCollectionConfig) { +>( + config: ElectricCollectionConfig +): CollectionConfig> & { + utils: ElectricCollectionUtils +} { const seenTxids = new Store>(new Set([])) const sync = createElectricSync>( config.shapeOptions,