@livestore/react 0.3.0-dev.9 → 0.3.1-dev.0

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 (97) hide show
  1. package/LICENSE +201 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/LiveStoreContext.d.ts +10 -4
  4. package/dist/LiveStoreContext.d.ts.map +1 -1
  5. package/dist/LiveStoreContext.js +1 -11
  6. package/dist/LiveStoreContext.js.map +1 -1
  7. package/dist/LiveStoreProvider.d.ts +29 -12
  8. package/dist/LiveStoreProvider.d.ts.map +1 -1
  9. package/dist/LiveStoreProvider.js +84 -55
  10. package/dist/LiveStoreProvider.js.map +1 -1
  11. package/dist/LiveStoreProvider.test.js +80 -29
  12. package/dist/LiveStoreProvider.test.js.map +1 -1
  13. package/dist/__tests__/fixture.d.ts +122 -556
  14. package/dist/__tests__/fixture.d.ts.map +1 -1
  15. package/dist/__tests__/fixture.js +71 -30
  16. package/dist/__tests__/fixture.js.map +1 -1
  17. package/dist/experimental/components/LiveList.d.ts +2 -2
  18. package/dist/experimental/components/LiveList.d.ts.map +1 -1
  19. package/dist/experimental/components/LiveList.js +10 -6
  20. package/dist/experimental/components/LiveList.js.map +1 -1
  21. package/dist/mod.d.ts +4 -5
  22. package/dist/mod.d.ts.map +1 -1
  23. package/dist/mod.js +4 -5
  24. package/dist/mod.js.map +1 -1
  25. package/dist/useClientDocument.d.ts +61 -0
  26. package/dist/useClientDocument.d.ts.map +1 -0
  27. package/dist/useClientDocument.js +79 -0
  28. package/dist/useClientDocument.js.map +1 -0
  29. package/dist/useClientDocument.test.d.ts +2 -0
  30. package/dist/useClientDocument.test.d.ts.map +1 -0
  31. package/dist/useClientDocument.test.js +175 -0
  32. package/dist/useClientDocument.test.js.map +1 -0
  33. package/dist/useQuery.d.ts +25 -3
  34. package/dist/useQuery.d.ts.map +1 -1
  35. package/dist/useQuery.js +67 -47
  36. package/dist/useQuery.js.map +1 -1
  37. package/dist/useQuery.test.d.ts +1 -1
  38. package/dist/useQuery.test.d.ts.map +1 -1
  39. package/dist/useQuery.test.js +86 -24
  40. package/dist/useQuery.test.js.map +1 -1
  41. package/dist/useRcResource.d.ts +76 -0
  42. package/dist/useRcResource.d.ts.map +1 -0
  43. package/dist/useRcResource.js +152 -0
  44. package/dist/useRcResource.js.map +1 -0
  45. package/dist/useRcResource.test.d.ts +2 -0
  46. package/dist/useRcResource.test.d.ts.map +1 -0
  47. package/dist/useRcResource.test.js +122 -0
  48. package/dist/useRcResource.test.js.map +1 -0
  49. package/dist/useStore.d.ts +9 -0
  50. package/dist/useStore.d.ts.map +1 -0
  51. package/dist/useStore.js +28 -0
  52. package/dist/useStore.js.map +1 -0
  53. package/dist/utils/useStateRefWithReactiveInput.d.ts.map +1 -1
  54. package/package.json +20 -13
  55. package/src/LiveStoreContext.ts +11 -16
  56. package/src/LiveStoreProvider.test.tsx +176 -37
  57. package/src/LiveStoreProvider.tsx +156 -81
  58. package/src/__snapshots__/useClientDocument.test.tsx.snap +613 -0
  59. package/src/__snapshots__/useQuery.test.tsx.snap +2011 -0
  60. package/src/__tests__/fixture.tsx +74 -47
  61. package/src/experimental/components/LiveList.tsx +10 -7
  62. package/src/mod.ts +5 -6
  63. package/src/useClientDocument.test.tsx +306 -0
  64. package/src/useClientDocument.ts +157 -0
  65. package/src/useQuery.test.tsx +182 -71
  66. package/src/useQuery.ts +95 -58
  67. package/src/useRcResource.test.tsx +167 -0
  68. package/src/useRcResource.ts +182 -0
  69. package/src/useStore.ts +36 -0
  70. package/dist/useAtom.d.ts +0 -5
  71. package/dist/useAtom.d.ts.map +0 -1
  72. package/dist/useAtom.js +0 -38
  73. package/dist/useAtom.js.map +0 -1
  74. package/dist/useRow.d.ts +0 -50
  75. package/dist/useRow.d.ts.map +0 -1
  76. package/dist/useRow.js +0 -93
  77. package/dist/useRow.js.map +0 -1
  78. package/dist/useRow.test.d.ts +0 -2
  79. package/dist/useRow.test.d.ts.map +0 -1
  80. package/dist/useRow.test.js +0 -202
  81. package/dist/useRow.test.js.map +0 -1
  82. package/dist/useScopedQuery.d.ts +0 -33
  83. package/dist/useScopedQuery.d.ts.map +0 -1
  84. package/dist/useScopedQuery.js +0 -87
  85. package/dist/useScopedQuery.js.map +0 -1
  86. package/dist/useScopedQuery.test.d.ts +0 -2
  87. package/dist/useScopedQuery.test.d.ts.map +0 -1
  88. package/dist/useScopedQuery.test.js +0 -60
  89. package/dist/useScopedQuery.test.js.map +0 -1
  90. package/src/__snapshots__/useRow.test.tsx.snap +0 -360
  91. package/src/useAtom.ts +0 -52
  92. package/src/useRow.test.tsx +0 -344
  93. package/src/useRow.ts +0 -188
  94. package/src/useScopedQuery.test.tsx +0 -96
  95. package/src/useScopedQuery.ts +0 -143
  96. package/tsconfig.json +0 -20
  97. package/vitest.config.js +0 -17
@@ -1,7 +1,8 @@
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
- import React from 'react';
5
+ import * as LiveStoreReact from '../mod.js';
5
6
  export type Todo = {
6
7
  id: string;
7
8
  text: string;
@@ -12,200 +13,82 @@ export type AppState = {
12
13
  newTodoText: string;
13
14
  filter: Filter;
14
15
  };
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<DbSchema.SqliteDsl.Index>;
41
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
42
- }, {
43
- isSingleton: false;
44
- disableAutomaticIdColumn: false;
45
- deriveMutations: {
46
- enabled: true;
47
- localOnly: boolean;
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<DbSchema.SqliteDsl.Index>;
86
- ast: import("@livestore/db-schema/dist/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 AppComponentSchema: 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;
16
+ export declare const events: {
17
+ todoCreated: State.SQLite.EventDef<"todoCreated", {
18
+ readonly id: string;
19
+ readonly text: string;
20
+ readonly completed: boolean;
21
+ }, {
22
+ readonly id: string;
23
+ readonly text: string;
24
+ readonly completed: boolean;
25
+ }, false>;
26
+ todoUpdated: State.SQLite.EventDef<"todoUpdated", {
27
+ readonly id: string;
28
+ readonly text?: string | undefined;
29
+ readonly completed?: boolean | undefined;
30
+ }, {
31
+ readonly id: string;
32
+ readonly text?: string | undefined;
33
+ readonly completed?: boolean | undefined;
34
+ }, false>;
35
+ AppRouterSet: State.SQLite.ClientDocumentTableDef.SetEventDefLike<"AppRouter", {
36
+ readonly currentTaskId: string | null;
37
+ }, {
38
+ partialSet: true;
39
+ default: {
40
+ id: "singleton";
41
+ value: {
42
+ readonly currentTaskId: null;
43
+ };
118
44
  };
119
- id: DbSchema.SqliteDsl.ColumnDefinition<string, string>;
120
- };
121
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
122
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
123
- }, {
124
- isSingleton: false;
125
- disableAutomaticIdColumn: false;
126
- deriveMutations: {
127
- enabled: true;
128
- localOnly: boolean;
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;
45
+ }>;
46
+ UserInfoSet: State.SQLite.ClientDocumentTableDef.SetEventDefLike<"UserInfo", {
47
+ readonly text: string;
48
+ readonly username: string;
49
+ }, {
50
+ partialSet: true;
51
+ default: {
52
+ id: undefined;
53
+ value: {
54
+ readonly username: "";
55
+ readonly text: "";
56
+ };
150
57
  };
151
- id: DbSchema.SqliteDsl.ColumnDefinition<"singleton", "singleton">;
152
- };
153
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
154
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
155
- }, {
156
- isSingleton: true;
157
- disableAutomaticIdColumn: false;
158
- deriveMutations: {
159
- enabled: true;
160
- localOnly: boolean;
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>>;
58
+ }>;
59
+ };
171
60
  export declare const tables: {
172
- todos: DbSchema.TableDef<{
61
+ todos: State.SQLite.TableDef<{
173
62
  name: "todos";
174
63
  columns: {
175
- id: {
64
+ readonly id: {
176
65
  columnType: "text";
177
- schema: import("effect/Schema").Schema<string, string, never>;
66
+ schema: Schema.Schema<string, string, never>;
178
67
  default: import("effect/Option").None<never>;
179
68
  nullable: false;
180
69
  primaryKey: true;
181
70
  };
182
- text: {
71
+ readonly text: {
183
72
  columnType: "text";
184
- schema: import("effect/Schema").Schema<string, string, never>;
73
+ schema: Schema.Schema<string, string, never>;
185
74
  default: import("effect/Option").Some<"">;
186
75
  nullable: false;
187
76
  primaryKey: false;
188
77
  };
189
- completed: {
78
+ readonly completed: {
190
79
  columnType: "integer";
191
- schema: import("effect/Schema").Schema<boolean, number, never>;
80
+ schema: Schema.Schema<boolean, number, never>;
192
81
  default: import("effect/Option").Some<false>;
193
82
  nullable: false;
194
83
  primaryKey: false;
195
84
  };
196
85
  };
197
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
198
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
86
+ indexes?: ReadonlyArray<import("@livestore/common/dist/schema/state/sqlite/db-schema/dsl/mod.js").Index>;
87
+ ast: import("@livestore/common/dist/schema/state/sqlite/db-schema/ast/sqlite.js").Table;
199
88
  }, {
200
- isSingleton: false;
201
- disableAutomaticIdColumn: false;
202
- deriveMutations: {
203
- enabled: true;
204
- localOnly: boolean;
205
- };
206
- isSingleColumn: false;
89
+ isClientDocumentTable: false;
207
90
  requiredInsertColumnNames: "id";
208
- }, import("effect/Schema").Schema<{
91
+ }, Schema.Schema<{
209
92
  readonly id: string;
210
93
  readonly text: string;
211
94
  readonly completed: boolean;
@@ -214,40 +97,37 @@ export declare const tables: {
214
97
  readonly text: string;
215
98
  readonly completed: number;
216
99
  }, never>>;
217
- app: DbSchema.TableDef<{
100
+ app: State.SQLite.TableDef<{
218
101
  name: "app";
219
102
  columns: {
220
- id: {
103
+ readonly id: {
221
104
  columnType: "text";
222
- schema: import("effect/Schema").Schema<string, string, never>;
105
+ schema: Schema.Schema<string, string, never>;
223
106
  default: import("effect/Option").Some<"static">;
224
107
  nullable: false;
225
108
  primaryKey: true;
226
109
  };
227
- newTodoText: {
110
+ readonly newTodoText: {
228
111
  columnType: "text";
229
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
112
+ schema: Schema.Schema<string | null, string | null, never>;
230
113
  default: import("effect/Option").Some<"">;
231
114
  nullable: true;
232
115
  primaryKey: false;
233
116
  };
234
- filter: {
117
+ readonly filter: {
235
118
  columnType: "text";
236
- schema: import("effect/Schema").Schema<string, string, never>;
119
+ schema: Schema.Schema<string, string, never>;
237
120
  default: import("effect/Option").Some<"all">;
238
121
  nullable: false;
239
122
  primaryKey: false;
240
123
  };
241
124
  };
242
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
243
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
125
+ indexes?: ReadonlyArray<import("@livestore/common/dist/schema/state/sqlite/db-schema/dsl/mod.js").Index>;
126
+ ast: import("@livestore/common/dist/schema/state/sqlite/db-schema/ast/sqlite.js").Table;
244
127
  }, {
245
- isSingleton: true;
246
- disableAutomaticIdColumn: false;
247
- deriveMutations: never;
248
- isSingleColumn: false;
128
+ isClientDocumentTable: false;
249
129
  requiredInsertColumnNames: never;
250
- }, import("effect/Schema").Schema<{
130
+ }, Schema.Schema<{
251
131
  readonly id: string;
252
132
  readonly newTodoText: string | null;
253
133
  readonly filter: string;
@@ -256,405 +136,91 @@ export declare const tables: {
256
136
  readonly newTodoText: string | null;
257
137
  readonly filter: string;
258
138
  }, never>>;
259
- AppComponentSchema: 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: DbSchema.SqliteDsl.ColumnDefinition<string, string>;
277
- };
278
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
279
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
280
- }, {
281
- isSingleton: false;
282
- disableAutomaticIdColumn: false;
283
- deriveMutations: {
284
- enabled: true;
285
- localOnly: boolean;
286
- };
287
- isSingleColumn: false;
288
- requiredInsertColumnNames: never;
289
- }, import("effect/Schema").Schema<{
290
- readonly username: string;
139
+ userInfo: State.SQLite.ClientDocumentTableDef<"UserInfo", {
291
140
  readonly text: string;
292
- readonly id: string;
293
- }, {
294
141
  readonly username: string;
142
+ }, {
295
143
  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: DbSchema.SqliteDsl.ColumnDefinition<"singleton", "singleton">;
309
- };
310
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
311
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
144
+ readonly username: string;
312
145
  }, {
313
- isSingleton: true;
314
- disableAutomaticIdColumn: false;
315
- deriveMutations: {
316
- enabled: true;
317
- localOnly: boolean;
146
+ partialSet: true;
147
+ default: {
148
+ id: undefined;
149
+ value: {
150
+ readonly username: "";
151
+ readonly text: "";
152
+ };
318
153
  };
319
- isSingleColumn: false;
320
- requiredInsertColumnNames: never;
321
- }, import("effect/Schema").Schema<{
154
+ }>;
155
+ AppRouterSchema: State.SQLite.ClientDocumentTableDef<"AppRouter", {
322
156
  readonly currentTaskId: string | null;
323
- readonly id: "singleton";
324
157
  }, {
325
158
  readonly currentTaskId: string | null;
326
- readonly id: "singleton";
327
- }, never>>;
159
+ }, {
160
+ partialSet: true;
161
+ default: {
162
+ id: "singleton";
163
+ value: {
164
+ readonly currentTaskId: null;
165
+ };
166
+ };
167
+ }>;
328
168
  };
329
169
  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<DbSchema.SqliteDsl.Index>;
357
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
358
- }, {
359
- isSingleton: false;
360
- disableAutomaticIdColumn: false;
361
- deriveMutations: {
362
- enabled: true;
363
- localOnly: boolean;
364
- };
365
- isSingleColumn: false;
366
- requiredInsertColumnNames: "id";
367
- }, import("effect/Schema").Schema<{
170
+ state: import("@livestore/common/schema").InternalState;
171
+ events: {
172
+ todoCreated: State.SQLite.EventDef<"todoCreated", {
368
173
  readonly id: string;
369
174
  readonly text: string;
370
175
  readonly completed: boolean;
371
176
  }, {
372
177
  readonly id: string;
373
178
  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<DbSchema.SqliteDsl.Index>;
402
- ast: import("@livestore/db-schema/dist/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<{
179
+ readonly completed: boolean;
180
+ }, false>;
181
+ todoUpdated: State.SQLite.EventDef<"todoUpdated", {
410
182
  readonly id: string;
411
- readonly newTodoText: string | null;
412
- readonly filter: string;
183
+ readonly text?: string | undefined;
184
+ readonly completed?: boolean | undefined;
413
185
  }, {
414
186
  readonly id: string;
415
- readonly newTodoText: string | null;
416
- readonly filter: string;
417
- }, never>>;
418
- AppComponentSchema: 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: DbSchema.SqliteDsl.ColumnDefinition<string, string>;
436
- };
437
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
438
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
187
+ readonly text?: string | undefined;
188
+ readonly completed?: boolean | undefined;
189
+ }, false>;
190
+ AppRouterSet: State.SQLite.ClientDocumentTableDef.SetEventDefLike<"AppRouter", {
191
+ readonly currentTaskId: string | null;
439
192
  }, {
440
- isSingleton: false;
441
- disableAutomaticIdColumn: false;
442
- deriveMutations: {
443
- enabled: true;
444
- localOnly: boolean;
193
+ partialSet: true;
194
+ default: {
195
+ id: "singleton";
196
+ value: {
197
+ readonly currentTaskId: null;
198
+ };
445
199
  };
446
- isSingleColumn: false;
447
- requiredInsertColumnNames: never;
448
- }, import("effect/Schema").Schema<{
449
- readonly username: string;
200
+ }>;
201
+ UserInfoSet: State.SQLite.ClientDocumentTableDef.SetEventDefLike<"UserInfo", {
450
202
  readonly text: string;
451
- readonly id: string;
452
- }, {
453
203
  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: DbSchema.SqliteDsl.ColumnDefinition<"singleton", "singleton">;
468
- };
469
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
470
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
471
204
  }, {
472
- isSingleton: true;
473
- disableAutomaticIdColumn: false;
474
- deriveMutations: {
475
- enabled: true;
476
- localOnly: boolean;
205
+ partialSet: true;
206
+ default: {
207
+ id: undefined;
208
+ value: {
209
+ readonly username: "";
210
+ readonly text: "";
211
+ };
477
212
  };
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>>;
213
+ }>;
487
214
  };
488
215
  }>;
489
- export declare const makeTodoMvcReact: ({ otelTracer, otelContext, useGlobalReactivityGraph, strictMode, }?: {
216
+ export declare const makeTodoMvcReact: ({ otelTracer, otelContext, strictMode, }?: {
490
217
  otelTracer?: otel.Tracer;
491
218
  otelContext?: otel.Context;
492
- useGlobalReactivityGraph?: boolean;
493
219
  strictMode?: boolean;
494
220
  }) => Effect.Effect<{
495
- wrapper: ({ children }: any) => React.JSX.Element;
496
- store: import("@livestore/livestore/src/index.js").Store<import("@livestore/livestore/src/index.js").BaseGraphQLContext, import("@livestore/common/schema").FromInputSchema.DeriveSchema<{
497
- tables: {
498
- todos: DbSchema.TableDef<{
499
- name: "todos";
500
- columns: {
501
- id: {
502
- columnType: "text";
503
- schema: import("effect/Schema").Schema<string, string, never>;
504
- default: import("effect/Option").None<never>;
505
- nullable: false;
506
- primaryKey: true;
507
- };
508
- text: {
509
- columnType: "text";
510
- schema: import("effect/Schema").Schema<string, string, never>;
511
- default: import("effect/Option").Some<"">;
512
- nullable: false;
513
- primaryKey: false;
514
- };
515
- completed: {
516
- columnType: "integer";
517
- schema: import("effect/Schema").Schema<boolean, number, never>;
518
- default: import("effect/Option").Some<false>;
519
- nullable: false;
520
- primaryKey: false;
521
- };
522
- };
523
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
524
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
525
- }, {
526
- isSingleton: false;
527
- disableAutomaticIdColumn: false;
528
- deriveMutations: {
529
- enabled: true;
530
- localOnly: boolean;
531
- };
532
- isSingleColumn: false;
533
- requiredInsertColumnNames: "id";
534
- }, import("effect/Schema").Schema<{
535
- readonly id: string;
536
- readonly text: string;
537
- readonly completed: boolean;
538
- }, {
539
- readonly id: string;
540
- readonly text: string;
541
- readonly completed: number;
542
- }, never>>;
543
- app: DbSchema.TableDef<{
544
- name: "app";
545
- columns: {
546
- id: {
547
- columnType: "text";
548
- schema: import("effect/Schema").Schema<string, string, never>;
549
- default: import("effect/Option").Some<"static">;
550
- nullable: false;
551
- primaryKey: true;
552
- };
553
- newTodoText: {
554
- columnType: "text";
555
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
556
- default: import("effect/Option").Some<"">;
557
- nullable: true;
558
- primaryKey: false;
559
- };
560
- filter: {
561
- columnType: "text";
562
- schema: import("effect/Schema").Schema<string, string, never>;
563
- default: import("effect/Option").Some<"all">;
564
- nullable: false;
565
- primaryKey: false;
566
- };
567
- };
568
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
569
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
570
- }, {
571
- isSingleton: true;
572
- disableAutomaticIdColumn: false;
573
- deriveMutations: never;
574
- isSingleColumn: false;
575
- requiredInsertColumnNames: never;
576
- }, import("effect/Schema").Schema<{
577
- readonly id: string;
578
- readonly newTodoText: string | null;
579
- readonly filter: string;
580
- }, {
581
- readonly id: string;
582
- readonly newTodoText: string | null;
583
- readonly filter: string;
584
- }, never>>;
585
- AppComponentSchema: DbSchema.TableDef<{
586
- name: "UserInfo";
587
- columns: {
588
- username: {
589
- columnType: "text";
590
- schema: import("effect/Schema").Schema<string, string, never>;
591
- default: import("effect/Option").Some<"">;
592
- nullable: false;
593
- primaryKey: false;
594
- };
595
- text: {
596
- columnType: "text";
597
- schema: import("effect/Schema").Schema<string, string, never>;
598
- default: import("effect/Option").Some<"">;
599
- nullable: false;
600
- primaryKey: false;
601
- };
602
- id: DbSchema.SqliteDsl.ColumnDefinition<string, string>;
603
- };
604
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
605
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
606
- }, {
607
- isSingleton: false;
608
- disableAutomaticIdColumn: false;
609
- deriveMutations: {
610
- enabled: true;
611
- localOnly: boolean;
612
- };
613
- isSingleColumn: false;
614
- requiredInsertColumnNames: never;
615
- }, import("effect/Schema").Schema<{
616
- readonly username: string;
617
- readonly text: string;
618
- readonly id: string;
619
- }, {
620
- readonly username: string;
621
- readonly text: string;
622
- readonly id: string;
623
- }, never>>;
624
- AppRouterSchema: DbSchema.TableDef<{
625
- name: "AppRouter";
626
- columns: {
627
- currentTaskId: {
628
- columnType: "text";
629
- schema: import("effect/Schema").Schema<string | null, string | null, never>;
630
- default: import("effect/Option").Some<null>;
631
- nullable: true;
632
- primaryKey: false;
633
- };
634
- id: DbSchema.SqliteDsl.ColumnDefinition<"singleton", "singleton">;
635
- };
636
- indexes?: ReadonlyArray<DbSchema.SqliteDsl.Index>;
637
- ast: import("@livestore/db-schema/dist/ast/sqlite.js").Table;
638
- }, {
639
- isSingleton: true;
640
- disableAutomaticIdColumn: false;
641
- deriveMutations: {
642
- enabled: true;
643
- localOnly: boolean;
644
- };
645
- isSingleColumn: false;
646
- requiredInsertColumnNames: never;
647
- }, import("effect/Schema").Schema<{
648
- readonly currentTaskId: string | null;
649
- readonly id: "singleton";
650
- }, {
651
- readonly currentTaskId: string | null;
652
- readonly id: "singleton";
653
- }, never>>;
654
- };
655
- }>>;
656
- reactivityGraph: import("@livestore/livestore/src/index.js").ReactivityGraph;
657
- makeRenderCount: () => {
221
+ wrapper: ({ children }: any) => import("react/jsx-runtime").JSX.Element;
222
+ store: Store<import("@livestore/common/schema").LiveStoreSchema<import("@livestore/common/dist/schema/state/sqlite/db-schema/dsl/mod.js").DbSchema, State.SQLite.EventDefRecord>, {}> & LiveStoreReact.ReactApi;
223
+ renderCount: {
658
224
  readonly val: number;
659
225
  inc: () => void;
660
226
  };