Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ title: electricCollectionOptions
function electricCollectionOptions<T>(config): Omit<CollectionConfig<InferSchemaOutput<T>, string | number, T, UtilsRecord>, "utils"> & object;
```

Defined in: [packages/electric-db-collection/src/electric.ts:474](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L474)
Defined in: [packages/electric-db-collection/src/electric.ts:499](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L499)

Creates Electric collection options for use with a standard Collection

Expand Down Expand Up @@ -43,7 +43,7 @@ Collection options with utilities
function electricCollectionOptions<T>(config): Omit<CollectionConfig<T, string | number, never, UtilsRecord>, "utils"> & object;
```

Defined in: [packages/electric-db-collection/src/electric.ts:485](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L485)
Defined in: [packages/electric-db-collection/src/electric.ts:510](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L510)

Creates Electric collection options for use with a standard Collection

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: isChangeMessage
function isChangeMessage<T>(message): message is ChangeMessage<T>;
```

Defined in: node\_modules/.pnpm/@electric-sql+client@1.2.0/node\_modules/@electric-sql/client/dist/index.d.ts:783
Defined in: node\_modules/.pnpm/@electric-sql+client@1.3.0/node\_modules/@electric-sql/client/dist/index.d.ts:816

Type guard for checking Message is ChangeMessage.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: isControlMessage
function isControlMessage<T>(message): message is ControlMessage;
```

Defined in: node\_modules/.pnpm/@electric-sql+client@1.2.0/node\_modules/@electric-sql/client/dist/index.d.ts:801
Defined in: node\_modules/.pnpm/@electric-sql+client@1.3.0/node\_modules/@electric-sql/client/dist/index.d.ts:834

Type guard for checking Message is ControlMessage.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: ElectricCollectionConfig

# Interface: ElectricCollectionConfig\<T, TSchema\>

Defined in: [packages/electric-db-collection/src/electric.ts:124](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L124)
Defined in: [packages/electric-db-collection/src/electric.ts:140](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L140)

Configuration interface for Electric collection options

Expand Down Expand Up @@ -35,7 +35,7 @@ The schema type for validation
optional [ELECTRIC_TEST_HOOKS]: ElectricTestHooks;
```

Defined in: [packages/electric-db-collection/src/electric.ts:147](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L147)
Defined in: [packages/electric-db-collection/src/electric.ts:163](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L163)

Internal test hooks (for testing only)
Hidden via Symbol to prevent accidental usage in production
Expand All @@ -48,7 +48,7 @@ Hidden via Symbol to prevent accidental usage in production
optional onDelete: (params) => Promise<MatchingStrategy>;
```

Defined in: [packages/electric-db-collection/src/electric.ts:264](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L264)
Defined in: [packages/electric-db-collection/src/electric.ts:280](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L280)

Optional asynchronous handler function called before a delete operation

Expand Down Expand Up @@ -100,7 +100,7 @@ onDelete: async ({ transaction, collection }) => {
optional onInsert: (params) => Promise<MatchingStrategy>;
```

Defined in: [packages/electric-db-collection/src/electric.ts:195](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L195)
Defined in: [packages/electric-db-collection/src/electric.ts:211](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L211)

Optional asynchronous handler function called before an insert operation

Expand Down Expand Up @@ -174,7 +174,7 @@ onInsert: async ({ transaction, collection }) => {
optional onUpdate: (params) => Promise<MatchingStrategy>;
```

Defined in: [packages/electric-db-collection/src/electric.ts:230](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L230)
Defined in: [packages/electric-db-collection/src/electric.ts:246](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L246)

Optional asynchronous handler function called before an update operation

Expand Down Expand Up @@ -227,7 +227,7 @@ onUpdate: async ({ transaction, collection }) => {
shapeOptions: ShapeStreamOptions<GetExtensions<T>>;
```

Defined in: [packages/electric-db-collection/src/electric.ts:140](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L140)
Defined in: [packages/electric-db-collection/src/electric.ts:156](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L156)

Configuration options for the ElectricSQL ShapeStream

Expand All @@ -239,4 +239,4 @@ Configuration options for the ElectricSQL ShapeStream
optional syncMode: ElectricSyncMode;
```

Defined in: [packages/electric-db-collection/src/electric.ts:141](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L141)
Defined in: [packages/electric-db-collection/src/electric.ts:157](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L157)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: ElectricCollectionUtils

# Interface: ElectricCollectionUtils\<T\>

Defined in: [packages/electric-db-collection/src/electric.ts:456](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L456)
Defined in: [packages/electric-db-collection/src/electric.ts:481](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L481)

Electric collection utilities type

Expand Down Expand Up @@ -33,7 +33,7 @@ Electric collection utilities type
awaitMatch: AwaitMatchFn<T>;
```

Defined in: [packages/electric-db-collection/src/electric.ts:460](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L460)
Defined in: [packages/electric-db-collection/src/electric.ts:485](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L485)

***

Expand All @@ -43,4 +43,4 @@ Defined in: [packages/electric-db-collection/src/electric.ts:460](https://github
awaitTxId: AwaitTxIdFn;
```

Defined in: [packages/electric-db-collection/src/electric.ts:459](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L459)
Defined in: [packages/electric-db-collection/src/electric.ts:484](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L484)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: AwaitTxIdFn
type AwaitTxIdFn = (txId, timeout?) => Promise<boolean>;
```

Defined in: [packages/electric-db-collection/src/electric.ts:443](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L443)
Defined in: [packages/electric-db-collection/src/electric.ts:468](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L468)

Type for the awaitTxId utility function

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/electric-db-collection/type-aliases/Txid.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ title: Txid
type Txid = number;
```

Defined in: [packages/electric-db-collection/src/electric.ts:62](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L62)
Defined in: [packages/electric-db-collection/src/electric.ts:78](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L78)

Type representing a transaction ID in ElectricSQL
5 changes: 4 additions & 1 deletion docs/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ title: "@tanstack/db"
- [LocalStorageCollectionConfig](interfaces/LocalStorageCollectionConfig.md)
- [LocalStorageCollectionUtils](interfaces/LocalStorageCollectionUtils.md)
- [OperationConfig](interfaces/OperationConfig.md)
- [OptimisticChangeMessage](interfaces/OptimisticChangeMessage.md)
- [PacedMutationsConfig](interfaces/PacedMutationsConfig.md)
- [ParsedOrderBy](interfaces/ParsedOrderBy.md)
- [Parser](interfaces/Parser.md)
Expand All @@ -153,12 +152,14 @@ title: "@tanstack/db"
## Type Aliases

- [ChangeListener](type-aliases/ChangeListener.md)
- [ChangeMessageOrDeleteKeyMessage](type-aliases/ChangeMessageOrDeleteKeyMessage.md)
- [ChangesPayload](type-aliases/ChangesPayload.md)
- [CleanupFn](type-aliases/CleanupFn.md)
- [ClearStorageFn](type-aliases/ClearStorageFn.md)
- [CollectionConfigSingleRowOption](type-aliases/CollectionConfigSingleRowOption.md)
- [CollectionStatus](type-aliases/CollectionStatus.md)
- [CursorExpressions](type-aliases/CursorExpressions.md)
- [DeleteKeyMessage](type-aliases/DeleteKeyMessage.md)
- [DeleteMutationFn](type-aliases/DeleteMutationFn.md)
- [DeleteMutationFnParams](type-aliases/DeleteMutationFnParams.md)
- [FieldPath](type-aliases/FieldPath.md)
Expand All @@ -180,6 +181,7 @@ title: "@tanstack/db"
- [LiveQueryCollectionUtils](type-aliases/LiveQueryCollectionUtils.md)
- [LoadSubsetFn](type-aliases/LoadSubsetFn.md)
- [LoadSubsetOptions](type-aliases/LoadSubsetOptions.md)
- [MakeOptional](type-aliases/MakeOptional.md)
- [MaybeSingleResult](type-aliases/MaybeSingleResult.md)
- [MutationFn](type-aliases/MutationFn.md)
- [MutationFnParams](type-aliases/MutationFnParams.md)
Expand All @@ -189,6 +191,7 @@ title: "@tanstack/db"
- [NonSingleResult](type-aliases/NonSingleResult.md)
- [OperationType](type-aliases/OperationType.md)
- [OperatorName](type-aliases/OperatorName.md)
- [OptimisticChangeMessage](type-aliases/OptimisticChangeMessage.md)
- [QueryBuilder](type-aliases/QueryBuilder.md)
- [Ref](type-aliases/Ref.md)
- [ResolveTransactionChanges](type-aliases/ResolveTransactionChanges.md)
Expand Down
28 changes: 14 additions & 14 deletions docs/reference/interfaces/BaseCollectionConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: BaseCollectionConfig

# Interface: BaseCollectionConfig\<T, TKey, TSchema, TUtils, TReturn\>

Defined in: [packages/db/src/types.ts:477](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L477)
Defined in: [packages/db/src/types.ts:493](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L493)

## Extended by

Expand Down Expand Up @@ -42,7 +42,7 @@ Defined in: [packages/db/src/types.ts:477](https://github.com/TanStack/db/blob/m
optional autoIndex: "eager" | "off";
```

Defined in: [packages/db/src/types.ts:526](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L526)
Defined in: [packages/db/src/types.ts:542](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L542)

Auto-indexing mode for the collection.
When enabled, indexes will be automatically created for simple where expressions.
Expand All @@ -66,7 +66,7 @@ When enabled, indexes will be automatically created for simple where expressions
optional compare: (x, y) => number;
```

Defined in: [packages/db/src/types.ts:537](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L537)
Defined in: [packages/db/src/types.ts:553](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L553)

Optional function to compare two items.
This is used to order the items in the collection.
Expand Down Expand Up @@ -106,7 +106,7 @@ compare: (x, y) => x.createdAt.getTime() - y.createdAt.getTime()
optional defaultStringCollation: StringCollationConfig;
```

Defined in: [packages/db/src/types.ts:683](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L683)
Defined in: [packages/db/src/types.ts:699](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L699)

Specifies how to compare data in the collection.
This should be configured to match data ordering on the backend.
Expand All @@ -121,7 +121,7 @@ E.g., when using the Electric DB collection these options
optional gcTime: number;
```

Defined in: [packages/db/src/types.ts:506](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L506)
Defined in: [packages/db/src/types.ts:522](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L522)

Time in milliseconds after which the collection will be garbage collected
when it has no active subscribers. Defaults to 5 minutes (300000ms).
Expand All @@ -134,7 +134,7 @@ when it has no active subscribers. Defaults to 5 minutes (300000ms).
getKey: (item) => TKey;
```

Defined in: [packages/db/src/types.ts:501](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L501)
Defined in: [packages/db/src/types.ts:517](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L517)

Function to extract the ID from an object
This is required for update/delete operations which now only accept IDs
Expand Down Expand Up @@ -168,7 +168,7 @@ getKey: (item) => item.uuid
optional id: string;
```

Defined in: [packages/db/src/types.ts:490](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L490)
Defined in: [packages/db/src/types.ts:506](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L506)

***

Expand All @@ -178,7 +178,7 @@ Defined in: [packages/db/src/types.ts:490](https://github.com/TanStack/db/blob/m
optional onDelete: DeleteMutationFn<T, TKey, TUtils, TReturn>;
```

Defined in: [packages/db/src/types.ts:675](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L675)
Defined in: [packages/db/src/types.ts:691](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L691)

Optional asynchronous handler function called before a delete operation

Expand Down Expand Up @@ -242,7 +242,7 @@ onDelete: async ({ transaction, collection }) => {
optional onInsert: InsertMutationFn<T, TKey, TUtils, TReturn>;
```

Defined in: [packages/db/src/types.ts:588](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L588)
Defined in: [packages/db/src/types.ts:604](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L604)

Optional asynchronous handler function called before an insert operation

Expand Down Expand Up @@ -305,7 +305,7 @@ onInsert: async ({ transaction, collection }) => {
optional onUpdate: UpdateMutationFn<T, TKey, TUtils, TReturn>;
```

Defined in: [packages/db/src/types.ts:632](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L632)
Defined in: [packages/db/src/types.ts:648](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L648)

Optional asynchronous handler function called before an update operation

Expand Down Expand Up @@ -369,7 +369,7 @@ onUpdate: async ({ transaction, collection }) => {
optional schema: TSchema;
```

Defined in: [packages/db/src/types.ts:491](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L491)
Defined in: [packages/db/src/types.ts:507](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L507)

***

Expand All @@ -379,7 +379,7 @@ Defined in: [packages/db/src/types.ts:491](https://github.com/TanStack/db/blob/m
optional startSync: boolean;
```

Defined in: [packages/db/src/types.ts:517](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L517)
Defined in: [packages/db/src/types.ts:533](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L533)

Whether to eagerly start syncing on collection creation.
When true, syncing begins immediately. When false, syncing starts when the first subscriber attaches.
Expand All @@ -402,7 +402,7 @@ false
optional syncMode: SyncMode;
```

Defined in: [packages/db/src/types.ts:546](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L546)
Defined in: [packages/db/src/types.ts:562](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L562)

The mode of sync to use for the collection.

Expand All @@ -424,4 +424,4 @@ The exact implementation of the sync mode is up to the sync implementation.
optional utils: TUtils;
```

Defined in: [packages/db/src/types.ts:685](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L685)
Defined in: [packages/db/src/types.ts:701](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L701)
4 changes: 0 additions & 4 deletions docs/reference/interfaces/ChangeMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ title: ChangeMessage

Defined in: [packages/db/src/types.ts:353](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L353)

## Extended by

- [`OptimisticChangeMessage`](OptimisticChangeMessage.md)

## Type Parameters

### T
Expand Down
Loading