@livestore/react 0.3.0-dev.27 → 0.3.0-dev.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/LiveStoreContext.d.ts +10 -6
  3. package/dist/LiveStoreContext.d.ts.map +1 -1
  4. package/dist/LiveStoreContext.js +0 -14
  5. package/dist/LiveStoreContext.js.map +1 -1
  6. package/dist/LiveStoreProvider.d.ts +2 -2
  7. package/dist/LiveStoreProvider.d.ts.map +1 -1
  8. package/dist/LiveStoreProvider.js +5 -1
  9. package/dist/LiveStoreProvider.js.map +1 -1
  10. package/dist/LiveStoreProvider.test.js +6 -5
  11. package/dist/LiveStoreProvider.test.js.map +1 -1
  12. package/dist/__tests__/fixture.d.ts +115 -546
  13. package/dist/__tests__/fixture.d.ts.map +1 -1
  14. package/dist/__tests__/fixture.js +64 -22
  15. package/dist/__tests__/fixture.js.map +1 -1
  16. package/dist/mod.d.ts +4 -4
  17. package/dist/mod.d.ts.map +1 -1
  18. package/dist/mod.js +4 -4
  19. package/dist/mod.js.map +1 -1
  20. package/dist/useClientDocument.d.ts +61 -0
  21. package/dist/useClientDocument.d.ts.map +1 -0
  22. package/dist/useClientDocument.js +79 -0
  23. package/dist/useClientDocument.js.map +1 -0
  24. package/dist/useClientDocument.test.d.ts +2 -0
  25. package/dist/useClientDocument.test.d.ts.map +1 -0
  26. package/dist/{useRow.test.js → useClientDocument.test.js} +44 -48
  27. package/dist/useClientDocument.test.js.map +1 -0
  28. package/dist/useQuery.d.ts +1 -3
  29. package/dist/useQuery.d.ts.map +1 -1
  30. package/dist/useQuery.js +6 -3
  31. package/dist/useQuery.js.map +1 -1
  32. package/dist/useQuery.test.js +16 -17
  33. package/dist/useQuery.test.js.map +1 -1
  34. package/dist/useStore.d.ts +9 -0
  35. package/dist/useStore.d.ts.map +1 -0
  36. package/dist/useStore.js +28 -0
  37. package/dist/useStore.js.map +1 -0
  38. package/package.json +11 -11
  39. package/src/LiveStoreContext.ts +10 -19
  40. package/src/LiveStoreProvider.test.tsx +6 -5
  41. package/src/LiveStoreProvider.tsx +7 -4
  42. package/src/__snapshots__/{useRow.test.tsx.snap → useClientDocument.test.tsx.snap} +62 -46
  43. package/src/__snapshots__/useQuery.test.tsx.snap +8 -8
  44. package/src/__tests__/fixture.tsx +69 -39
  45. package/src/mod.ts +5 -5
  46. package/src/{useRow.test.tsx → useClientDocument.test.tsx} +51 -55
  47. package/src/useClientDocument.ts +157 -0
  48. package/src/useQuery.test.tsx +18 -19
  49. package/src/useQuery.ts +9 -8
  50. package/src/useStore.ts +36 -0
  51. package/tmp/pack.tgz +0 -0
  52. package/dist/useAtom.d.ts +0 -8
  53. package/dist/useAtom.d.ts.map +0 -1
  54. package/dist/useAtom.js +0 -42
  55. package/dist/useAtom.js.map +0 -1
  56. package/dist/useRow.d.ts +0 -64
  57. package/dist/useRow.d.ts.map +0 -1
  58. package/dist/useRow.js +0 -108
  59. package/dist/useRow.js.map +0 -1
  60. package/dist/useRow.test.d.ts +0 -2
  61. package/dist/useRow.test.d.ts.map +0 -1
  62. package/dist/useRow.test.js.map +0 -1
  63. package/src/useAtom.ts +0 -66
  64. package/src/useRow.ts +0 -210
@@ -1,7 +1,9 @@
1
- import { DbSchema } from '@livestore/common/schema';
2
- import { Effect } from '@livestore/utils/effect';
1
+ import { State } from '@livestore/common/schema';
2
+ import type { Store } from '@livestore/livestore';
3
+ import { Effect, Schema } from '@livestore/utils/effect';
3
4
  import type * as otel from '@opentelemetry/api';
4
5
  import React from 'react';
6
+ import * as LiveStoreReact from '../mod.js';
5
7
  export type Todo = {
6
8
  id: string;
7
9
  text: string;
@@ -12,183 +14,71 @@ export type AppState = {
12
14
  newTodoText: string;
13
15
  filter: Filter;
14
16
  };
15
- export declare const todos: DbSchema.TableDef<{
16
- name: "todos";
17
- columns: {
18
- id: {
19
- columnType: "text";
20
- schema: import("effect/Schema").Schema<string, string, never>;
21
- default: import("effect/Option").None<never>;
22
- nullable: false;
23
- primaryKey: true;
24
- };
25
- text: {
26
- columnType: "text";
27
- schema: import("effect/Schema").Schema<string, string, never>;
28
- default: import("effect/Option").Some<"">;
29
- nullable: false;
30
- primaryKey: false;
31
- };
32
- completed: {
33
- columnType: "integer";
34
- schema: import("effect/Schema").Schema<boolean, number, never>;
35
- default: import("effect/Option").Some<false>;
36
- nullable: false;
37
- primaryKey: false;
38
- };
39
- };
40
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
41
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
42
- }, {
43
- isSingleton: false;
44
- disableAutomaticIdColumn: false;
45
- deriveMutations: {
46
- enabled: true;
47
- clientOnly: true;
48
- };
49
- isSingleColumn: false;
50
- requiredInsertColumnNames: "id";
51
- }, import("effect/Schema").Schema<{
52
- readonly id: string;
53
- readonly text: string;
54
- readonly completed: boolean;
55
- }, {
56
- readonly id: string;
57
- readonly text: string;
58
- readonly completed: number;
59
- }, never>>;
60
- export declare const app: DbSchema.TableDef<{
61
- name: "app";
62
- columns: {
63
- id: {
64
- columnType: "text";
65
- schema: import("effect/Schema").Schema<string, string, never>;
66
- default: import("effect/Option").Some<"static">;
67
- nullable: false;
68
- primaryKey: true;
69
- };
70
- newTodoText: {
71
- columnType: "text";
72
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
73
- default: import("effect/Option").Some<"">;
74
- nullable: true;
75
- primaryKey: false;
76
- };
77
- filter: {
78
- columnType: "text";
79
- schema: import("effect/Schema").Schema<string, string, never>;
80
- default: import("effect/Option").Some<"all">;
81
- nullable: false;
82
- primaryKey: false;
83
- };
84
- };
85
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
86
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
87
- }, {
88
- isSingleton: true;
89
- disableAutomaticIdColumn: false;
90
- deriveMutations: never;
91
- isSingleColumn: false;
92
- requiredInsertColumnNames: never;
93
- }, import("effect/Schema").Schema<{
94
- readonly id: string;
95
- readonly newTodoText: string | null;
96
- readonly filter: string;
97
- }, {
98
- readonly id: string;
99
- readonly newTodoText: string | null;
100
- readonly filter: string;
101
- }, never>>;
102
- export declare const userInfo: DbSchema.TableDef<{
103
- name: "UserInfo";
104
- columns: {
105
- username: {
106
- columnType: "text";
107
- schema: import("effect/Schema").Schema<string, string, never>;
108
- default: import("effect/Option").Some<"">;
109
- nullable: false;
110
- primaryKey: false;
111
- };
112
- text: {
113
- columnType: "text";
114
- schema: import("effect/Schema").Schema<string, string, never>;
115
- default: import("effect/Option").Some<"">;
116
- nullable: false;
117
- primaryKey: false;
17
+ export declare const events: {
18
+ todoCreated: State.SQLite.EventDef<"todoCreated", {
19
+ readonly id: string;
20
+ readonly text: string;
21
+ readonly completed: boolean;
22
+ }, {
23
+ readonly id: string;
24
+ readonly text: string;
25
+ readonly completed: boolean;
26
+ }, false>;
27
+ todoUpdated: State.SQLite.EventDef<"todoUpdated", {
28
+ readonly id: string;
29
+ readonly text?: string | undefined;
30
+ readonly completed?: boolean | undefined;
31
+ }, {
32
+ readonly id: string;
33
+ readonly text?: string | undefined;
34
+ readonly completed?: boolean | undefined;
35
+ }, false>;
36
+ AppRouterSet: State.SQLite.ClientDocumentTableDef.SetEventDefLike<"AppRouter", {
37
+ readonly currentTaskId: string | null;
38
+ }, {
39
+ partialSet: true;
40
+ default: {
41
+ id: "singleton";
42
+ value: {
43
+ readonly currentTaskId: null;
44
+ };
118
45
  };
119
- id: import("@livestore/common/dist/schema/db-schema/dsl/field-defs.js").ColumnDefinition<string, string>;
120
- };
121
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
122
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
123
- }, {
124
- isSingleton: false;
125
- disableAutomaticIdColumn: false;
126
- deriveMutations: {
127
- enabled: true;
128
- clientOnly: true;
129
- };
130
- isSingleColumn: false;
131
- requiredInsertColumnNames: never;
132
- }, import("effect/Schema").Schema<{
133
- readonly username: string;
134
- readonly text: string;
135
- readonly id: string;
136
- }, {
137
- readonly username: string;
138
- readonly text: string;
139
- readonly id: string;
140
- }, never>>;
141
- export declare const AppRouterSchema: DbSchema.TableDef<{
142
- name: "AppRouter";
143
- columns: {
144
- currentTaskId: {
145
- columnType: "text";
146
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
147
- default: import("effect/Option").Some<null>;
148
- nullable: true;
149
- primaryKey: false;
46
+ }>;
47
+ UserInfoSet: State.SQLite.ClientDocumentTableDef.SetEventDefLike<"UserInfo", {
48
+ readonly text: string;
49
+ readonly username: string;
50
+ }, {
51
+ partialSet: true;
52
+ default: {
53
+ id: undefined;
54
+ value: {
55
+ readonly username: "";
56
+ readonly text: "";
57
+ };
150
58
  };
151
- id: import("@livestore/common/dist/schema/db-schema/dsl/field-defs.js").ColumnDefinition<"singleton", "singleton">;
152
- };
153
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
154
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
155
- }, {
156
- isSingleton: true;
157
- disableAutomaticIdColumn: false;
158
- deriveMutations: {
159
- enabled: true;
160
- clientOnly: true;
161
- };
162
- isSingleColumn: false;
163
- requiredInsertColumnNames: never;
164
- }, import("effect/Schema").Schema<{
165
- readonly currentTaskId: string | null;
166
- readonly id: "singleton";
167
- }, {
168
- readonly currentTaskId: string | null;
169
- readonly id: "singleton";
170
- }, never>>;
59
+ }>;
60
+ };
171
61
  export declare const tables: {
172
- todos: DbSchema.TableDef<{
62
+ todos: State.SQLite.TableDef<{
173
63
  name: "todos";
174
64
  columns: {
175
- id: {
65
+ readonly id: {
176
66
  columnType: "text";
177
- schema: import("effect/Schema").Schema<string, string, never>;
67
+ schema: Schema.Schema<string, string, never>;
178
68
  default: import("effect/Option").None<never>;
179
69
  nullable: false;
180
70
  primaryKey: true;
181
71
  };
182
- text: {
72
+ readonly text: {
183
73
  columnType: "text";
184
- schema: import("effect/Schema").Schema<string, string, never>;
74
+ schema: Schema.Schema<string, string, never>;
185
75
  default: import("effect/Option").Some<"">;
186
76
  nullable: false;
187
77
  primaryKey: false;
188
78
  };
189
- completed: {
79
+ readonly completed: {
190
80
  columnType: "integer";
191
- schema: import("effect/Schema").Schema<boolean, number, never>;
81
+ schema: Schema.Schema<boolean, number, never>;
192
82
  default: import("effect/Option").Some<false>;
193
83
  nullable: false;
194
84
  primaryKey: false;
@@ -197,15 +87,9 @@ export declare const tables: {
197
87
  indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
198
88
  ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
199
89
  }, {
200
- isSingleton: false;
201
- disableAutomaticIdColumn: false;
202
- deriveMutations: {
203
- enabled: true;
204
- clientOnly: true;
205
- };
206
- isSingleColumn: false;
90
+ isClientDocumentTable: false;
207
91
  requiredInsertColumnNames: "id";
208
- }, import("effect/Schema").Schema<{
92
+ }, Schema.Schema<{
209
93
  readonly id: string;
210
94
  readonly text: string;
211
95
  readonly completed: boolean;
@@ -214,26 +98,26 @@ export declare const tables: {
214
98
  readonly text: string;
215
99
  readonly completed: number;
216
100
  }, never>>;
217
- app: DbSchema.TableDef<{
101
+ app: State.SQLite.TableDef<{
218
102
  name: "app";
219
103
  columns: {
220
- id: {
104
+ readonly id: {
221
105
  columnType: "text";
222
- schema: import("effect/Schema").Schema<string, string, never>;
106
+ schema: Schema.Schema<string, string, never>;
223
107
  default: import("effect/Option").Some<"static">;
224
108
  nullable: false;
225
109
  primaryKey: true;
226
110
  };
227
- newTodoText: {
111
+ readonly newTodoText: {
228
112
  columnType: "text";
229
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
113
+ schema: Schema.Schema<string | null, string | null, never>;
230
114
  default: import("effect/Option").Some<"">;
231
115
  nullable: true;
232
116
  primaryKey: false;
233
117
  };
234
- filter: {
118
+ readonly filter: {
235
119
  columnType: "text";
236
- schema: import("effect/Schema").Schema<string, string, never>;
120
+ schema: Schema.Schema<string, string, never>;
237
121
  default: import("effect/Option").Some<"all">;
238
122
  nullable: false;
239
123
  primaryKey: false;
@@ -242,12 +126,9 @@ export declare const tables: {
242
126
  indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
243
127
  ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
244
128
  }, {
245
- isSingleton: true;
246
- disableAutomaticIdColumn: false;
247
- deriveMutations: never;
248
- isSingleColumn: false;
129
+ isClientDocumentTable: false;
249
130
  requiredInsertColumnNames: never;
250
- }, import("effect/Schema").Schema<{
131
+ }, Schema.Schema<{
251
132
  readonly id: string;
252
133
  readonly newTodoText: string | null;
253
134
  readonly filter: string;
@@ -256,234 +137,81 @@ export declare const tables: {
256
137
  readonly newTodoText: string | null;
257
138
  readonly filter: string;
258
139
  }, never>>;
259
- userInfo: DbSchema.TableDef<{
260
- name: "UserInfo";
261
- columns: {
262
- username: {
263
- columnType: "text";
264
- schema: import("effect/Schema").Schema<string, string, never>;
265
- default: import("effect/Option").Some<"">;
266
- nullable: false;
267
- primaryKey: false;
268
- };
269
- text: {
270
- columnType: "text";
271
- schema: import("effect/Schema").Schema<string, string, never>;
272
- default: import("effect/Option").Some<"">;
273
- nullable: false;
274
- primaryKey: false;
275
- };
276
- id: import("@livestore/common/dist/schema/db-schema/dsl/field-defs.js").ColumnDefinition<string, string>;
277
- };
278
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
279
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
280
- }, {
281
- isSingleton: false;
282
- disableAutomaticIdColumn: false;
283
- deriveMutations: {
284
- enabled: true;
285
- clientOnly: true;
286
- };
287
- isSingleColumn: false;
288
- requiredInsertColumnNames: never;
289
- }, import("effect/Schema").Schema<{
290
- readonly username: string;
140
+ userInfo: State.SQLite.ClientDocumentTableDef<"UserInfo", {
291
141
  readonly text: string;
292
- readonly id: string;
293
- }, {
294
142
  readonly username: string;
143
+ }, {
295
144
  readonly text: string;
296
- readonly id: string;
297
- }, never>>;
298
- AppRouterSchema: DbSchema.TableDef<{
299
- name: "AppRouter";
300
- columns: {
301
- currentTaskId: {
302
- columnType: "text";
303
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
304
- default: import("effect/Option").Some<null>;
305
- nullable: true;
306
- primaryKey: false;
307
- };
308
- id: import("@livestore/common/dist/schema/db-schema/dsl/field-defs.js").ColumnDefinition<"singleton", "singleton">;
309
- };
310
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
311
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
145
+ readonly username: string;
312
146
  }, {
313
- isSingleton: true;
314
- disableAutomaticIdColumn: false;
315
- deriveMutations: {
316
- enabled: true;
317
- clientOnly: true;
147
+ partialSet: true;
148
+ default: {
149
+ id: undefined;
150
+ value: {
151
+ readonly username: "";
152
+ readonly text: "";
153
+ };
318
154
  };
319
- isSingleColumn: false;
320
- requiredInsertColumnNames: never;
321
- }, import("effect/Schema").Schema<{
155
+ }>;
156
+ AppRouterSchema: State.SQLite.ClientDocumentTableDef<"AppRouter", {
322
157
  readonly currentTaskId: string | null;
323
- readonly id: "singleton";
324
158
  }, {
325
159
  readonly currentTaskId: string | null;
326
- readonly id: "singleton";
327
- }, never>>;
160
+ }, {
161
+ partialSet: true;
162
+ default: {
163
+ id: "singleton";
164
+ value: {
165
+ readonly currentTaskId: null;
166
+ };
167
+ };
168
+ }>;
328
169
  };
329
170
  export declare const schema: import("@livestore/common/schema").FromInputSchema.DeriveSchema<{
330
- tables: {
331
- todos: DbSchema.TableDef<{
332
- name: "todos";
333
- columns: {
334
- id: {
335
- columnType: "text";
336
- schema: import("effect/Schema").Schema<string, string, never>;
337
- default: import("effect/Option").None<never>;
338
- nullable: false;
339
- primaryKey: true;
340
- };
341
- text: {
342
- columnType: "text";
343
- schema: import("effect/Schema").Schema<string, string, never>;
344
- default: import("effect/Option").Some<"">;
345
- nullable: false;
346
- primaryKey: false;
347
- };
348
- completed: {
349
- columnType: "integer";
350
- schema: import("effect/Schema").Schema<boolean, number, never>;
351
- default: import("effect/Option").Some<false>;
352
- nullable: false;
353
- primaryKey: false;
354
- };
355
- };
356
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
357
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
358
- }, {
359
- isSingleton: false;
360
- disableAutomaticIdColumn: false;
361
- deriveMutations: {
362
- enabled: true;
363
- clientOnly: true;
364
- };
365
- isSingleColumn: false;
366
- requiredInsertColumnNames: "id";
367
- }, import("effect/Schema").Schema<{
171
+ state: import("@livestore/common/dist/schema/schema.js").State;
172
+ events: {
173
+ todoCreated: State.SQLite.EventDef<"todoCreated", {
368
174
  readonly id: string;
369
175
  readonly text: string;
370
176
  readonly completed: boolean;
371
177
  }, {
372
178
  readonly id: string;
373
179
  readonly text: string;
374
- readonly completed: number;
375
- }, never>>;
376
- app: DbSchema.TableDef<{
377
- name: "app";
378
- columns: {
379
- id: {
380
- columnType: "text";
381
- schema: import("effect/Schema").Schema<string, string, never>;
382
- default: import("effect/Option").Some<"static">;
383
- nullable: false;
384
- primaryKey: true;
385
- };
386
- newTodoText: {
387
- columnType: "text";
388
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
389
- default: import("effect/Option").Some<"">;
390
- nullable: true;
391
- primaryKey: false;
392
- };
393
- filter: {
394
- columnType: "text";
395
- schema: import("effect/Schema").Schema<string, string, never>;
396
- default: import("effect/Option").Some<"all">;
397
- nullable: false;
398
- primaryKey: false;
399
- };
400
- };
401
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
402
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
403
- }, {
404
- isSingleton: true;
405
- disableAutomaticIdColumn: false;
406
- deriveMutations: never;
407
- isSingleColumn: false;
408
- requiredInsertColumnNames: never;
409
- }, import("effect/Schema").Schema<{
180
+ readonly completed: boolean;
181
+ }, false>;
182
+ todoUpdated: State.SQLite.EventDef<"todoUpdated", {
410
183
  readonly id: string;
411
- readonly newTodoText: string | null;
412
- readonly filter: string;
184
+ readonly text?: string | undefined;
185
+ readonly completed?: boolean | undefined;
413
186
  }, {
414
187
  readonly id: string;
415
- readonly newTodoText: string | null;
416
- readonly filter: string;
417
- }, never>>;
418
- userInfo: DbSchema.TableDef<{
419
- name: "UserInfo";
420
- columns: {
421
- username: {
422
- columnType: "text";
423
- schema: import("effect/Schema").Schema<string, string, never>;
424
- default: import("effect/Option").Some<"">;
425
- nullable: false;
426
- primaryKey: false;
427
- };
428
- text: {
429
- columnType: "text";
430
- schema: import("effect/Schema").Schema<string, string, never>;
431
- default: import("effect/Option").Some<"">;
432
- nullable: false;
433
- primaryKey: false;
434
- };
435
- id: import("@livestore/common/dist/schema/db-schema/dsl/field-defs.js").ColumnDefinition<string, string>;
436
- };
437
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
438
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
188
+ readonly text?: string | undefined;
189
+ readonly completed?: boolean | undefined;
190
+ }, false>;
191
+ AppRouterSet: State.SQLite.ClientDocumentTableDef.SetEventDefLike<"AppRouter", {
192
+ readonly currentTaskId: string | null;
439
193
  }, {
440
- isSingleton: false;
441
- disableAutomaticIdColumn: false;
442
- deriveMutations: {
443
- enabled: true;
444
- clientOnly: true;
194
+ partialSet: true;
195
+ default: {
196
+ id: "singleton";
197
+ value: {
198
+ readonly currentTaskId: null;
199
+ };
445
200
  };
446
- isSingleColumn: false;
447
- requiredInsertColumnNames: never;
448
- }, import("effect/Schema").Schema<{
449
- readonly username: string;
201
+ }>;
202
+ UserInfoSet: State.SQLite.ClientDocumentTableDef.SetEventDefLike<"UserInfo", {
450
203
  readonly text: string;
451
- readonly id: string;
452
- }, {
453
204
  readonly username: string;
454
- readonly text: string;
455
- readonly id: string;
456
- }, never>>;
457
- AppRouterSchema: DbSchema.TableDef<{
458
- name: "AppRouter";
459
- columns: {
460
- currentTaskId: {
461
- columnType: "text";
462
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
463
- default: import("effect/Option").Some<null>;
464
- nullable: true;
465
- primaryKey: false;
466
- };
467
- id: import("@livestore/common/dist/schema/db-schema/dsl/field-defs.js").ColumnDefinition<"singleton", "singleton">;
468
- };
469
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
470
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
471
205
  }, {
472
- isSingleton: true;
473
- disableAutomaticIdColumn: false;
474
- deriveMutations: {
475
- enabled: true;
476
- clientOnly: true;
206
+ partialSet: true;
207
+ default: {
208
+ id: undefined;
209
+ value: {
210
+ readonly username: "";
211
+ readonly text: "";
212
+ };
477
213
  };
478
- isSingleColumn: false;
479
- requiredInsertColumnNames: never;
480
- }, import("effect/Schema").Schema<{
481
- readonly currentTaskId: string | null;
482
- readonly id: "singleton";
483
- }, {
484
- readonly currentTaskId: string | null;
485
- readonly id: "singleton";
486
- }, never>>;
214
+ }>;
487
215
  };
488
216
  }>;
489
217
  export declare const makeTodoMvcReact: ({ otelTracer, otelContext, strictMode, }?: {
@@ -492,166 +220,7 @@ export declare const makeTodoMvcReact: ({ otelTracer, otelContext, strictMode, }
492
220
  strictMode?: boolean;
493
221
  }) => Effect.Effect<{
494
222
  wrapper: ({ children }: any) => React.JSX.Element;
495
- store: import("@livestore/livestore/src/mod.js").Store<import("@livestore/common/schema").FromInputSchema.DeriveSchema<{
496
- tables: {
497
- todos: DbSchema.TableDef<{
498
- name: "todos";
499
- columns: {
500
- id: {
501
- columnType: "text";
502
- schema: import("effect/Schema").Schema<string, string, never>;
503
- default: import("effect/Option").None<never>;
504
- nullable: false;
505
- primaryKey: true;
506
- };
507
- text: {
508
- columnType: "text";
509
- schema: import("effect/Schema").Schema<string, string, never>;
510
- default: import("effect/Option").Some<"">;
511
- nullable: false;
512
- primaryKey: false;
513
- };
514
- completed: {
515
- columnType: "integer";
516
- schema: import("effect/Schema").Schema<boolean, number, never>;
517
- default: import("effect/Option").Some<false>;
518
- nullable: false;
519
- primaryKey: false;
520
- };
521
- };
522
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
523
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
524
- }, {
525
- isSingleton: false;
526
- disableAutomaticIdColumn: false;
527
- deriveMutations: {
528
- enabled: true;
529
- clientOnly: true;
530
- };
531
- isSingleColumn: false;
532
- requiredInsertColumnNames: "id";
533
- }, import("effect/Schema").Schema<{
534
- readonly id: string;
535
- readonly text: string;
536
- readonly completed: boolean;
537
- }, {
538
- readonly id: string;
539
- readonly text: string;
540
- readonly completed: number;
541
- }, never>>;
542
- app: DbSchema.TableDef<{
543
- name: "app";
544
- columns: {
545
- id: {
546
- columnType: "text";
547
- schema: import("effect/Schema").Schema<string, string, never>;
548
- default: import("effect/Option").Some<"static">;
549
- nullable: false;
550
- primaryKey: true;
551
- };
552
- newTodoText: {
553
- columnType: "text";
554
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
555
- default: import("effect/Option").Some<"">;
556
- nullable: true;
557
- primaryKey: false;
558
- };
559
- filter: {
560
- columnType: "text";
561
- schema: import("effect/Schema").Schema<string, string, never>;
562
- default: import("effect/Option").Some<"all">;
563
- nullable: false;
564
- primaryKey: false;
565
- };
566
- };
567
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
568
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
569
- }, {
570
- isSingleton: true;
571
- disableAutomaticIdColumn: false;
572
- deriveMutations: never;
573
- isSingleColumn: false;
574
- requiredInsertColumnNames: never;
575
- }, import("effect/Schema").Schema<{
576
- readonly id: string;
577
- readonly newTodoText: string | null;
578
- readonly filter: string;
579
- }, {
580
- readonly id: string;
581
- readonly newTodoText: string | null;
582
- readonly filter: string;
583
- }, never>>;
584
- userInfo: DbSchema.TableDef<{
585
- name: "UserInfo";
586
- columns: {
587
- username: {
588
- columnType: "text";
589
- schema: import("effect/Schema").Schema<string, string, never>;
590
- default: import("effect/Option").Some<"">;
591
- nullable: false;
592
- primaryKey: false;
593
- };
594
- text: {
595
- columnType: "text";
596
- schema: import("effect/Schema").Schema<string, string, never>;
597
- default: import("effect/Option").Some<"">;
598
- nullable: false;
599
- primaryKey: false;
600
- };
601
- id: import("@livestore/common/dist/schema/db-schema/dsl/field-defs.js").ColumnDefinition<string, string>;
602
- };
603
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
604
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
605
- }, {
606
- isSingleton: false;
607
- disableAutomaticIdColumn: false;
608
- deriveMutations: {
609
- enabled: true;
610
- clientOnly: true;
611
- };
612
- isSingleColumn: false;
613
- requiredInsertColumnNames: never;
614
- }, import("effect/Schema").Schema<{
615
- readonly username: string;
616
- readonly text: string;
617
- readonly id: string;
618
- }, {
619
- readonly username: string;
620
- readonly text: string;
621
- readonly id: string;
622
- }, never>>;
623
- AppRouterSchema: DbSchema.TableDef<{
624
- name: "AppRouter";
625
- columns: {
626
- currentTaskId: {
627
- columnType: "text";
628
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
629
- default: import("effect/Option").Some<null>;
630
- nullable: true;
631
- primaryKey: false;
632
- };
633
- id: import("@livestore/common/dist/schema/db-schema/dsl/field-defs.js").ColumnDefinition<"singleton", "singleton">;
634
- };
635
- indexes?: ReadonlyArray<import("@livestore/common/dist/schema/db-schema/dsl/mod.js").Index>;
636
- ast: import("@livestore/common/dist/schema/db-schema/ast/sqlite.js").Table;
637
- }, {
638
- isSingleton: true;
639
- disableAutomaticIdColumn: false;
640
- deriveMutations: {
641
- enabled: true;
642
- clientOnly: true;
643
- };
644
- isSingleColumn: false;
645
- requiredInsertColumnNames: never;
646
- }, import("effect/Schema").Schema<{
647
- readonly currentTaskId: string | null;
648
- readonly id: "singleton";
649
- }, {
650
- readonly currentTaskId: string | null;
651
- readonly id: "singleton";
652
- }, never>>;
653
- };
654
- }>, {}>;
223
+ store: Store<import("@livestore/common/schema").LiveStoreSchema, {}> & LiveStoreReact.ReactApi;
655
224
  renderCount: {
656
225
  readonly val: number;
657
226
  inc: () => void;