Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

electricCollectionOptions.md

70 lines2.5 KB

1---
2id: electricCollectionOptions
3title: electricCollectionOptions
4---
5​
6# Function: electricCollectionOptions()
7​
8## Call Signature
9​
10```ts
11function electricCollectionOptions<T>(config): Omit<CollectionConfig<InferSchemaOutput<T>, string | number, T, UtilsRecord>, "utils" | "onInsert" | "onUpdate" | "onDelete"> & Pick<ElectricCollectionConfig<InferSchemaOutput<T>, T>, "onInsert" | "onUpdate" | "onDelete"> & object;
12```
13​
14Defined in: [packages/electric-db-collection/src/electric.ts:576](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L576)
15​
16Creates Electric collection options for use with a standard Collection
17​
18### Type Parameters
19​
20#### T
21​
22`T` *extends* `StandardSchemaV1`\<`unknown`, `unknown`\>
23​
24The explicit type of items in the collection (highest priority)
25​
26### Parameters
27​
28#### config
29​
30[`ElectricCollectionConfig`](../interfaces/ElectricCollectionConfig.md)\<`InferSchemaOutput`\<`T`\>, `T`\> & `object`
31​
32Configuration options for the Electric collection
33​
34### Returns
35​
36`Omit`\<`CollectionConfig`\<`InferSchemaOutput`\<`T`\>, `string` \| `number`, `T`, `UtilsRecord`\>, `"utils"` \| `"onInsert"` \| `"onUpdate"` \| `"onDelete"`\> & `Pick`\<[`ElectricCollectionConfig`](../interfaces/ElectricCollectionConfig.md)\<`InferSchemaOutput`\<`T`\>, `T`\>, `"onInsert"` \| `"onUpdate"` \| `"onDelete"`\> & `object`
37​
38Collection options with utilities
39​
40## Call Signature
41​
42```ts
43function electricCollectionOptions<T>(config): Omit<CollectionConfig<T, string | number, never, UtilsRecord>, "utils" | "onInsert" | "onUpdate" | "onDelete"> & Pick<ElectricCollectionConfig<T, never>, "onInsert" | "onUpdate" | "onDelete"> & object;
44```
45​
46Defined in: [packages/electric-db-collection/src/electric.ts:594](https://github.com/TanStack/db/blob/main/packages/electric-db-collection/src/electric.ts#L594)
47​
48Creates Electric collection options for use with a standard Collection
49​
50### Type Parameters
51​
52#### T
53​
54`T` *extends* `Row`\<`unknown`\>
55​
56The explicit type of items in the collection (highest priority)
57​
58### Parameters
59​
60#### config
61​
62[`ElectricCollectionConfig`](../interfaces/ElectricCollectionConfig.md)\<`T`, `never`\> & `object`
63​
64Configuration options for the Electric collection
65​
66### Returns
67​
68`Omit`\<`CollectionConfig`\<`T`, `string` \| `number`, `never`, `UtilsRecord`\>, `"utils"` \| `"onInsert"` \| `"onUpdate"` \| `"onDelete"`\> & `Pick`\<[`ElectricCollectionConfig`](../interfaces/ElectricCollectionConfig.md)\<`T`, `never`\>, `"onInsert"` \| `"onUpdate"` \| `"onDelete"`\> & `object`
69​
70Collection options with utilities