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

SyncMetadataApi.md

174 lines2.0 KB

1---
2id: SyncMetadataApi
3title: SyncMetadataApi
4---
5​
6Defined in: [packages/db/src/types.ts:554](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L554)
7​
8## Type Parameters
9​
10### TKey
11​
12`TKey` *extends* `string` \| `number` = `string` \| `number`
13​
14## Properties
15​
16### collection
17​
18```ts
19collection: object;
20```
21​
22Defined in: [packages/db/src/types.ts:562](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L562)
23​
24#### delete()
25​
26```ts
27delete: (key) => void;
28```
29​
30##### Parameters
31​
32###### key
33​
34`string`
35​
36##### Returns
37​
38`void`
39​
40#### get()
41​
42```ts
43get: (key) => unknown;
44```
45​
46##### Parameters
47​
48###### key
49​
50`string`
51​
52##### Returns
53​
54`unknown`
55​
56#### list()
57​
58```ts
59list: (prefix?) => readonly object[];
60```
61​
62##### Parameters
63​
64###### prefix?
65​
66`string`
67​
68##### Returns
69​
70readonly `object`[]
71​
72#### set()
73​
74```ts
75set: (key, value) => void;
76```
77​
78##### Parameters
79​
80###### key
81​
82`string`
83​
84###### value
85​
86`unknown`
87​
88##### Returns
89​
90`void`
91​
92***
93​
94### persistence
95​
96```ts
97persistence:
98 | SyncPersistenceCapabilityV1<TKey>
99 | null;
100```
101​
102Defined in: [packages/db/src/types.ts:580](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L580)
103​
104**`Internal`**
105​
106Unstable, versioned bridge between persistence-aware collection adapters
107and sync adapters. Application code should not construct this capability.
108Custom adapter wrappers must forward it unchanged. `null` explicitly means
109that the collection has no persistence capability; a missing property is
110invalid.
111​
112 Adapter infrastructure; not an application-facing API.
113​
114***
115​
116### row
117​
118```ts
119row: object;
120```
121​
122Defined in: [packages/db/src/types.ts:557](https://github.com/TanStack/db/blob/main/packages/db/src/types.ts#L557)
123​
124#### delete()
125​
126```ts
127delete: (key) => void;
128```
129​
130##### Parameters
131​
132###### key
133​
134`TKey`
135​
136##### Returns
137​
138`void`
139​
140#### get()
141​
142```ts
143get: (key) => unknown;
144```
145​
146##### Parameters
147​
148###### key
149​
150`TKey`
151​
152##### Returns
153​
154`unknown`
155​
156#### set()
157​
158```ts
159set: (key, metadata) => void;
160```
161​
162##### Parameters
163​
164###### key
165​
166`TKey`
167​
168###### metadata
169​
170`unknown`
171​
172##### Returns
173​
174`void`