tinybase 8.6.0-beta.0 → 9.0.0-beta.1
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.
- package/@types/_internal/queries/with-schemas/index.d.ts +1 -2
- package/@types/_internal/ui/with-schemas/index.d.ts +8 -16
- package/@types/mergeable-store/index.d.ts +4 -4
- package/@types/mergeable-store/with-schemas/index.d.ts +41 -17
- package/@types/persisters/index.d.ts +34 -13
- package/@types/persisters/persister-durable-object-sql-storage/index.d.ts +9 -8
- package/@types/persisters/persister-durable-object-sql-storage/with-schemas/index.d.ts +10 -10
- package/@types/persisters/with-schemas/index.d.ts +72 -30
- package/@types/queries/index.d.ts +5 -7
- package/@types/queries/with-schemas/index.d.ts +9 -15
- package/@types/store/index.d.ts +1 -2
- package/@types/store/with-schemas/index.d.ts +19 -29
- package/@types/synchronizers/synchronizer-ws-client/index.d.ts +9 -3
- package/@types/synchronizers/synchronizer-ws-client/with-schemas/index.d.ts +10 -3
- package/@types/synchronizers/synchronizer-ws-server/index.d.ts +15 -2
- package/@types/synchronizers/synchronizer-ws-server/with-schemas/index.d.ts +17 -2
- package/@types/synchronizers/synchronizer-ws-server-durable-object/index.d.ts +51 -0
- package/@types/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.d.ts +51 -0
- package/@types/ui-react/with-schemas/index.d.ts +3 -6
- package/@types/ui-react-dom/with-schemas/index.d.ts +6 -12
- package/@types/ui-react-dom-charts/with-schemas/index.d.ts +3 -4
- package/@types/ui-solid/with-schemas/index.d.ts +4 -8
- package/@types/ui-solid-dom/with-schemas/index.d.ts +6 -12
- package/@types/ui-svelte-dom/with-schemas/index.d.ts +6 -12
- package/index.js +67 -25
- package/indexes/index.js +6 -8
- package/indexes/with-schemas/index.js +6 -8
- package/mergeable-store/index.js +46 -6
- package/mergeable-store/with-schemas/index.js +46 -6
- package/metrics/index.js +6 -8
- package/metrics/with-schemas/index.js +6 -8
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/mergeable-store/index.js +1 -1
- package/min/mergeable-store/index.js.gz +0 -0
- package/min/mergeable-store/with-schemas/index.js +1 -1
- package/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/min/omni/index.js +1 -1
- package/min/omni/index.js.gz +0 -0
- package/min/omni/with-schemas/index.js +1 -1
- package/min/omni/with-schemas/index.js.gz +0 -0
- package/min/persisters/index.js +1 -1
- package/min/persisters/index.js.gz +0 -0
- package/min/persisters/persister-automerge/index.js +1 -1
- package/min/persisters/persister-automerge/index.js.gz +0 -0
- package/min/persisters/persister-automerge/with-schemas/index.js +1 -1
- package/min/persisters/persister-automerge/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-browser/index.js +1 -1
- package/min/persisters/persister-browser/index.js.gz +0 -0
- package/min/persisters/persister-browser/with-schemas/index.js +1 -1
- package/min/persisters/persister-browser/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-cr-sqlite-wasm/index.js +1 -1
- package/min/persisters/persister-cr-sqlite-wasm/index.js.gz +0 -0
- package/min/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +1 -1
- package/min/persisters/persister-cr-sqlite-wasm/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-sql-storage/index.js +1 -1
- package/min/persisters/persister-durable-object-sql-storage/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js +1 -1
- package/min/persisters/persister-durable-object-sql-storage/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-storage/index.js +1 -1
- package/min/persisters/persister-durable-object-storage/index.js.gz +0 -0
- package/min/persisters/persister-durable-object-storage/with-schemas/index.js +1 -1
- package/min/persisters/persister-durable-object-storage/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-electric-sql/index.js +1 -1
- package/min/persisters/persister-electric-sql/index.js.gz +0 -0
- package/min/persisters/persister-electric-sql/with-schemas/index.js +1 -1
- package/min/persisters/persister-electric-sql/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-expo-sqlite/index.js +1 -1
- package/min/persisters/persister-expo-sqlite/index.js.gz +0 -0
- package/min/persisters/persister-expo-sqlite/with-schemas/index.js +1 -1
- package/min/persisters/persister-expo-sqlite/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-file/index.js +1 -1
- package/min/persisters/persister-file/index.js.gz +0 -0
- package/min/persisters/persister-file/with-schemas/index.js +1 -1
- package/min/persisters/persister-file/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-indexed-db/index.js +1 -1
- package/min/persisters/persister-indexed-db/index.js.gz +0 -0
- package/min/persisters/persister-indexed-db/with-schemas/index.js +1 -1
- package/min/persisters/persister-indexed-db/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-libsql/index.js +1 -1
- package/min/persisters/persister-libsql/index.js.gz +0 -0
- package/min/persisters/persister-libsql/with-schemas/index.js +1 -1
- package/min/persisters/persister-libsql/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-partykit-client/index.js +1 -1
- package/min/persisters/persister-partykit-client/index.js.gz +0 -0
- package/min/persisters/persister-partykit-client/with-schemas/index.js +1 -1
- package/min/persisters/persister-partykit-client/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-pglite/index.js +1 -1
- package/min/persisters/persister-pglite/index.js.gz +0 -0
- package/min/persisters/persister-pglite/with-schemas/index.js +1 -1
- package/min/persisters/persister-pglite/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-postgres/index.js +1 -1
- package/min/persisters/persister-postgres/index.js.gz +0 -0
- package/min/persisters/persister-postgres/with-schemas/index.js +1 -1
- package/min/persisters/persister-postgres/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-powersync/index.js +1 -1
- package/min/persisters/persister-powersync/index.js.gz +0 -0
- package/min/persisters/persister-powersync/with-schemas/index.js +1 -1
- package/min/persisters/persister-powersync/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-react-native-mmkv/index.js +1 -1
- package/min/persisters/persister-react-native-mmkv/index.js.gz +0 -0
- package/min/persisters/persister-react-native-mmkv/with-schemas/index.js +1 -1
- package/min/persisters/persister-react-native-mmkv/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-react-native-sqlite/index.js +1 -1
- package/min/persisters/persister-react-native-sqlite/index.js.gz +0 -0
- package/min/persisters/persister-react-native-sqlite/with-schemas/index.js +1 -1
- package/min/persisters/persister-react-native-sqlite/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-remote/index.js +1 -1
- package/min/persisters/persister-remote/index.js.gz +0 -0
- package/min/persisters/persister-remote/with-schemas/index.js +1 -1
- package/min/persisters/persister-remote/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-sqlite-bun/index.js +1 -1
- package/min/persisters/persister-sqlite-bun/index.js.gz +0 -0
- package/min/persisters/persister-sqlite-bun/with-schemas/index.js +1 -1
- package/min/persisters/persister-sqlite-bun/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-sqlite-wasm/index.js +1 -1
- package/min/persisters/persister-sqlite-wasm/index.js.gz +0 -0
- package/min/persisters/persister-sqlite-wasm/with-schemas/index.js +1 -1
- package/min/persisters/persister-sqlite-wasm/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-sqlite3/index.js +1 -1
- package/min/persisters/persister-sqlite3/index.js.gz +0 -0
- package/min/persisters/persister-sqlite3/with-schemas/index.js +1 -1
- package/min/persisters/persister-sqlite3/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-yjs/index.js +1 -1
- package/min/persisters/persister-yjs/index.js.gz +0 -0
- package/min/persisters/persister-yjs/with-schemas/index.js +1 -1
- package/min/persisters/persister-yjs/with-schemas/index.js.gz +0 -0
- package/min/persisters/with-schemas/index.js +1 -1
- package/min/persisters/with-schemas/index.js.gz +0 -0
- package/min/queries/index.js +1 -1
- package/min/queries/index.js.gz +0 -0
- package/min/queries/with-schemas/index.js +1 -1
- package/min/queries/with-schemas/index.js.gz +0 -0
- package/min/store/index.js +1 -1
- package/min/store/index.js.gz +0 -0
- package/min/store/with-schemas/index.js +1 -1
- package/min/store/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/index.js +1 -1
- package/min/synchronizers/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/index.js +1 -1
- package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/with-schemas/index.js +1 -1
- package/min/synchronizers/with-schemas/index.js.gz +0 -0
- package/min/ui-react-inspector/index.js +1 -1
- package/min/ui-react-inspector/index.js.gz +0 -0
- package/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-solid-inspector/index.js +1 -1
- package/min/ui-solid-inspector/index.js.gz +0 -0
- package/min/ui-solid-inspector/with-schemas/index.js +1 -1
- package/min/ui-solid-inspector/with-schemas/index.js.gz +0 -0
- package/min/ui-svelte-inspector/index.js +1 -1
- package/min/ui-svelte-inspector/index.js.gz +0 -0
- package/min/ui-svelte-inspector/with-schemas/index.js +1 -1
- package/min/ui-svelte-inspector/with-schemas/index.js.gz +0 -0
- package/min/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/omni/index.js +364 -155
- package/omni/with-schemas/index.js +364 -155
- package/package.json +8 -8
- package/persisters/index.js +133 -40
- package/persisters/persister-automerge/index.js +4 -3
- package/persisters/persister-automerge/with-schemas/index.js +4 -3
- package/persisters/persister-browser/index.js +4 -3
- package/persisters/persister-browser/with-schemas/index.js +4 -3
- package/persisters/persister-cr-sqlite-wasm/index.js +133 -40
- package/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +133 -40
- package/persisters/persister-durable-object-sql-storage/index.js +275 -113
- package/persisters/persister-durable-object-sql-storage/with-schemas/index.js +275 -113
- package/persisters/persister-durable-object-storage/index.js +4 -3
- package/persisters/persister-durable-object-storage/with-schemas/index.js +4 -3
- package/persisters/persister-electric-sql/index.js +133 -40
- package/persisters/persister-electric-sql/with-schemas/index.js +133 -40
- package/persisters/persister-expo-sqlite/index.js +133 -40
- package/persisters/persister-expo-sqlite/with-schemas/index.js +133 -40
- package/persisters/persister-file/index.js +4 -3
- package/persisters/persister-file/with-schemas/index.js +4 -3
- package/persisters/persister-indexed-db/index.js +4 -3
- package/persisters/persister-indexed-db/with-schemas/index.js +4 -3
- package/persisters/persister-libsql/index.js +133 -40
- package/persisters/persister-libsql/with-schemas/index.js +133 -40
- package/persisters/persister-partykit-client/index.js +4 -3
- package/persisters/persister-partykit-client/with-schemas/index.js +4 -3
- package/persisters/persister-pglite/index.js +134 -40
- package/persisters/persister-pglite/with-schemas/index.js +134 -40
- package/persisters/persister-postgres/index.js +134 -40
- package/persisters/persister-postgres/with-schemas/index.js +134 -40
- package/persisters/persister-powersync/index.js +186 -120
- package/persisters/persister-powersync/with-schemas/index.js +186 -120
- package/persisters/persister-react-native-mmkv/index.js +4 -3
- package/persisters/persister-react-native-mmkv/with-schemas/index.js +4 -3
- package/persisters/persister-react-native-sqlite/index.js +133 -40
- package/persisters/persister-react-native-sqlite/with-schemas/index.js +133 -40
- package/persisters/persister-remote/index.js +4 -3
- package/persisters/persister-remote/with-schemas/index.js +4 -3
- package/persisters/persister-sqlite-bun/index.js +133 -40
- package/persisters/persister-sqlite-bun/with-schemas/index.js +133 -40
- package/persisters/persister-sqlite-wasm/index.js +133 -40
- package/persisters/persister-sqlite-wasm/with-schemas/index.js +133 -40
- package/persisters/persister-sqlite3/index.js +133 -40
- package/persisters/persister-sqlite3/with-schemas/index.js +133 -40
- package/persisters/persister-yjs/index.js +4 -3
- package/persisters/persister-yjs/with-schemas/index.js +4 -3
- package/persisters/with-schemas/index.js +133 -40
- package/queries/index.js +21 -19
- package/queries/with-schemas/index.js +21 -19
- package/readme.md +14 -14
- package/relationships/index.js +6 -8
- package/relationships/with-schemas/index.js +6 -8
- package/releases.md +72 -57
- package/store/index.js +33 -2
- package/store/with-schemas/index.js +33 -2
- package/synchronizers/index.js +4 -3
- package/synchronizers/synchronizer-broadcast-channel/index.js +4 -3
- package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +4 -3
- package/synchronizers/synchronizer-local/index.js +4 -3
- package/synchronizers/synchronizer-local/with-schemas/index.js +4 -3
- package/synchronizers/synchronizer-ws-client/index.js +120 -45
- package/synchronizers/synchronizer-ws-client/with-schemas/index.js +120 -45
- package/synchronizers/synchronizer-ws-server/index.js +116 -36
- package/synchronizers/synchronizer-ws-server/with-schemas/index.js +116 -36
- package/synchronizers/synchronizer-ws-server-durable-object/index.js +125 -41
- package/synchronizers/synchronizer-ws-server-durable-object/with-schemas/index.js +125 -41
- package/synchronizers/with-schemas/index.js +4 -3
- package/ui-react-inspector/index.js +36 -5
- package/ui-react-inspector/with-schemas/index.js +36 -5
- package/ui-solid-inspector/index.js +36 -5
- package/ui-solid-inspector/with-schemas/index.js +36 -5
- package/ui-svelte/index.js +1 -1
- package/ui-svelte/with-schemas/index.js +1 -1
- package/ui-svelte-dom/index.js +2 -2
- package/ui-svelte-dom/with-schemas/index.js +2 -2
- package/ui-svelte-inspector/index.js +38 -7
- package/ui-svelte-inspector/with-schemas/index.js +38 -7
- package/with-schemas/index.js +67 -25
|
@@ -53,13 +53,7 @@ import type {
|
|
|
53
53
|
* @since v7.2.0
|
|
54
54
|
*/
|
|
55
55
|
export type ParamValue =
|
|
56
|
-
| string
|
|
57
|
-
| number
|
|
58
|
-
| boolean
|
|
59
|
-
| null
|
|
60
|
-
| string[]
|
|
61
|
-
| number[]
|
|
62
|
-
| boolean[];
|
|
56
|
+
string | number | boolean | null | string[] | number[] | boolean[];
|
|
63
57
|
|
|
64
58
|
/**
|
|
65
59
|
* The ParamValues type describes an object of param values, keyed by param Id,
|
|
@@ -997,6 +991,10 @@ export type Param = (paramId: Id) => ParamValue | undefined;
|
|
|
997
991
|
* The Select function is provided to the third `query` parameter of the
|
|
998
992
|
* setQueryDefinition method. A query definition must call the Select function
|
|
999
993
|
* at least once, otherwise it will be meaningless and return no data.
|
|
994
|
+
*
|
|
995
|
+
* A Row will only appear in the ResultTable if at least one Select clause
|
|
996
|
+
* produces a defined value for it. If all selected Cells or calculated values
|
|
997
|
+
* resolve to `undefined`, no ResultRow is created for that Row.
|
|
1000
998
|
* @example
|
|
1001
999
|
* This example shows a query that selects two Cells from the main query Table.
|
|
1002
1000
|
*
|
|
@@ -1482,8 +1480,7 @@ export type Join<
|
|
|
1482
1480
|
*/
|
|
1483
1481
|
<
|
|
1484
1482
|
IntermediateJoinedTableId extends TableIdFromSchema<Schema> | Id =
|
|
1485
|
-
|
|
1486
|
-
| Id,
|
|
1483
|
+
TableIdFromSchema<Schema> | Id,
|
|
1487
1484
|
IntermediateJoinedCellId extends JoinedCellIdOrId<
|
|
1488
1485
|
Schema,
|
|
1489
1486
|
IntermediateJoinedTableId
|
|
@@ -1511,8 +1508,7 @@ export type Join<
|
|
|
1511
1508
|
*/
|
|
1512
1509
|
<
|
|
1513
1510
|
IntermediateJoinedTableId extends TableIdFromSchema<Schema> | Id =
|
|
1514
|
-
|
|
1515
|
-
| Id,
|
|
1511
|
+
TableIdFromSchema<Schema> | Id,
|
|
1516
1512
|
IntermediateJoinedCellId extends JoinedCellIdOrId<
|
|
1517
1513
|
Schema,
|
|
1518
1514
|
IntermediateJoinedTableId
|
|
@@ -1542,8 +1538,7 @@ export type Join<
|
|
|
1542
1538
|
*/
|
|
1543
1539
|
<
|
|
1544
1540
|
IntermediateJoinedTableId extends TableIdFromSchema<Schema> | Id =
|
|
1545
|
-
|
|
1546
|
-
| Id,
|
|
1541
|
+
TableIdFromSchema<Schema> | Id,
|
|
1547
1542
|
>(
|
|
1548
1543
|
joinedTableId: TableIdFromSchema<Schema>,
|
|
1549
1544
|
fromIntermediateJoinedTableId: IntermediateJoinedTableId,
|
|
@@ -1576,8 +1571,7 @@ export type Join<
|
|
|
1576
1571
|
*/
|
|
1577
1572
|
<
|
|
1578
1573
|
IntermediateJoinedTableId extends TableIdFromSchema<Schema> | Id =
|
|
1579
|
-
|
|
1580
|
-
| Id,
|
|
1574
|
+
TableIdFromSchema<Schema> | Id,
|
|
1581
1575
|
>(
|
|
1582
1576
|
asQuery: true,
|
|
1583
1577
|
joinedQueryId: Id,
|
package/@types/store/index.d.ts
CHANGED
|
@@ -1521,8 +1521,7 @@ export type InvalidValues = {[valueId: Id]: any[]};
|
|
|
1521
1521
|
export type Changes = [
|
|
1522
1522
|
changedTables: {
|
|
1523
1523
|
[tableId: Id]:
|
|
1524
|
-
|
|
1525
|
-
| undefined;
|
|
1524
|
+
{[rowId: Id]: {[cellId: Id]: CellOrUndefined} | undefined} | undefined;
|
|
1526
1525
|
},
|
|
1527
1526
|
changedValues: {[valueId: Id]: ValueOrUndefined},
|
|
1528
1527
|
isChanges: 1,
|
|
@@ -711,9 +711,8 @@ export type ValueCallback<
|
|
|
711
711
|
Schema extends OptionalValuesSchema,
|
|
712
712
|
Params extends any[] = ValueIdFromSchema<Schema> extends infer ValueId
|
|
713
713
|
? ValueId extends ValueIdFromSchema<Schema>
|
|
714
|
-
?
|
|
715
|
-
|
|
716
|
-
| [valueId: never, value: never]
|
|
714
|
+
? | [valueId: ValueId, value: Value<Schema, ValueId>]
|
|
715
|
+
| [valueId: never, value: never]
|
|
717
716
|
: never
|
|
718
717
|
: never,
|
|
719
718
|
Params2 extends any[] = Params | [valueId: never, value: never],
|
|
@@ -957,8 +956,7 @@ export type SortedRowIdsArgs<
|
|
|
957
956
|
Schema extends OptionalTablesSchema,
|
|
958
957
|
TableId extends TableIdFromSchema<Schema>,
|
|
959
958
|
CellIdOrUndefined extends CellIdFromSchema<Schema, TableId> | undefined =
|
|
960
|
-
|
|
961
|
-
| undefined,
|
|
959
|
+
CellIdFromSchema<Schema, TableId> | undefined,
|
|
962
960
|
> = {
|
|
963
961
|
/**
|
|
964
962
|
* The Id of the Table in the Store, required.
|
|
@@ -1246,8 +1244,7 @@ export type TableCellIdsListener<
|
|
|
1246
1244
|
: never
|
|
1247
1245
|
: never,
|
|
1248
1246
|
Params3 extends any[] =
|
|
1249
|
-
|
|
|
1250
|
-
| [store: never, tableId: never, getIdChanges: never],
|
|
1247
|
+
Params | [store: never, tableId: never, getIdChanges: never],
|
|
1251
1248
|
Params2 extends any[] = Truncate<Params3>,
|
|
1252
1249
|
// Params1 extends any[] = Truncate<Params2>,
|
|
1253
1250
|
> = Params extends any
|
|
@@ -1314,8 +1311,7 @@ export type HasTableCellListener<
|
|
|
1314
1311
|
: never
|
|
1315
1312
|
: never,
|
|
1316
1313
|
Params4 extends any[] =
|
|
1317
|
-
|
|
|
1318
|
-
| [store: never, tableId: never, cellId: never, hasTableCell: never],
|
|
1314
|
+
Params | [store: never, tableId: never, cellId: never, hasTableCell: never],
|
|
1319
1315
|
Params3 extends any[] = Truncate<Params4>,
|
|
1320
1316
|
// Params2 extends any[] = Truncate<Params3>,
|
|
1321
1317
|
// Params1 extends any[] = Truncate<Params2>,
|
|
@@ -1595,8 +1591,7 @@ export type CellIdsListener<
|
|
|
1595
1591
|
: never
|
|
1596
1592
|
: never,
|
|
1597
1593
|
Params4 extends any[] =
|
|
1598
|
-
|
|
|
1599
|
-
| [store: never, tableId: never, rowId: never, getIdChanges: never],
|
|
1594
|
+
Params | [store: never, tableId: never, rowId: never, getIdChanges: never],
|
|
1600
1595
|
Params3 extends any[] = Truncate<Params4>,
|
|
1601
1596
|
// Params2 extends any[] = Truncate<Params3>,
|
|
1602
1597
|
// Params1 extends any[] = Truncate<Params2>,
|
|
@@ -1783,11 +1778,10 @@ export type CellListener<
|
|
|
1783
1778
|
// Params2 extends any[] = Truncate<Params3>,
|
|
1784
1779
|
// Params1 extends any[] = Truncate<Params2>,
|
|
1785
1780
|
> = Params extends any
|
|
1786
|
-
?
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
| ((...params: Params4) => void)
|
|
1781
|
+
? | ((...params: Params7) => void)
|
|
1782
|
+
| ((...params: Params6) => void)
|
|
1783
|
+
| ((...params: Params5) => void)
|
|
1784
|
+
| ((...params: Params4) => void)
|
|
1791
1785
|
: // The unions may no longer be discriminatory with fewer parameters, and
|
|
1792
1786
|
// TypeScript fails to resolve callback signatures in some cases.
|
|
1793
1787
|
// | ((...params: Params3) => void)
|
|
@@ -2002,11 +1996,10 @@ export type ValueListener<
|
|
|
2002
1996
|
Params2 extends any[] = Truncate<Params3>,
|
|
2003
1997
|
// Params1 extends any[] = Truncate<Params2>,
|
|
2004
1998
|
> = Params extends any
|
|
2005
|
-
?
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
| ((...params: Params2) => void)
|
|
1999
|
+
? | ((...params: Params5) => void)
|
|
2000
|
+
| ((...params: Params4) => void)
|
|
2001
|
+
| ((...params: Params3) => void)
|
|
2002
|
+
| ((...params: Params2) => void)
|
|
2010
2003
|
: // | ((...params: Params1) => void)
|
|
2011
2004
|
never;
|
|
2012
2005
|
|
|
@@ -2411,8 +2404,7 @@ export type InvalidValues = {[valueId: Id]: any[]};
|
|
|
2411
2404
|
* [
|
|
2412
2405
|
* changedTables: {
|
|
2413
2406
|
* [tableId: Id]:
|
|
2414
|
-
*
|
|
2415
|
-
* | undefined;
|
|
2407
|
+
* {[rowId: Id]: {[cellId: Id]: CellOrUndefined} | undefined} | undefined;
|
|
2416
2408
|
* },
|
|
2417
2409
|
* changedValues: {[valueId: Id]: ValueOrUndefined},
|
|
2418
2410
|
* isChanges: 1,
|
|
@@ -2470,10 +2462,9 @@ export type Changes<Schemas extends OptionalSchemas> = [
|
|
|
2470
2462
|
| {
|
|
2471
2463
|
[rowId: Id]:
|
|
2472
2464
|
| {
|
|
2473
|
-
[
|
|
2474
|
-
Schemas[0],
|
|
2475
|
-
|
|
2476
|
-
>]?: CellOrUndefined<Schemas[0], TableId, CellId>;
|
|
2465
|
+
[
|
|
2466
|
+
CellId in CellIdFromSchema<Schemas[0], TableId>
|
|
2467
|
+
]?: CellOrUndefined<Schemas[0], TableId, CellId>;
|
|
2477
2468
|
}
|
|
2478
2469
|
| undefined;
|
|
2479
2470
|
}
|
|
@@ -4601,8 +4592,7 @@ export interface Store<in out Schemas extends OptionalSchemas> {
|
|
|
4601
4592
|
rowId: Id,
|
|
4602
4593
|
cellId: CellId,
|
|
4603
4594
|
cell:
|
|
4604
|
-
|
|
|
4605
|
-
| MapCell<Schemas[0], TableId, CellId>,
|
|
4595
|
+
Cell<Schemas[0], TableId, CellId> | MapCell<Schemas[0], TableId, CellId>,
|
|
4606
4596
|
): this;
|
|
4607
4597
|
|
|
4608
4598
|
/**
|
|
@@ -79,7 +79,9 @@ export interface WsSynchronizer<
|
|
|
79
79
|
* via WebSockets facilitated by a WsServer.
|
|
80
80
|
*
|
|
81
81
|
* As well as providing a reference to the MergeableStore to persist, you must
|
|
82
|
-
* provide a configured WebSocket to send synchronization messages over.
|
|
82
|
+
* provide a configured WebSocket to send synchronization messages over. The
|
|
83
|
+
* path in the WebSocket URL is used by a WsServer as the path that the client
|
|
84
|
+
* joins. The MergeableStore Id does not select the server path.
|
|
83
85
|
*
|
|
84
86
|
* Instead of the raw browser implementation of WebSocket, you may prefer to use
|
|
85
87
|
* the [Reconnecting
|
|
@@ -107,6 +109,9 @@ export interface WsSynchronizer<
|
|
|
107
109
|
* @param onIgnoredError An optional handler for the errors that the
|
|
108
110
|
* Synchronizer would otherwise ignore when trying to synchronize data. This is
|
|
109
111
|
* suitable for debugging synchronization issues in a development environment.
|
|
112
|
+
* @param fragmentSize An optional maximum size for each WebSocket message
|
|
113
|
+
* fragment. When set, larger synchronization payloads are split into fragments
|
|
114
|
+
* and reassembled by the receiving WsSynchronizer, since v9.0.
|
|
110
115
|
* @returns A reference to the new WsSynchronizer object.
|
|
111
116
|
* @example
|
|
112
117
|
* This example creates two WsSynchronizer objects to synchronize one
|
|
@@ -125,11 +130,11 @@ export interface WsSynchronizer<
|
|
|
125
130
|
*
|
|
126
131
|
* const synchronizer1 = await createWsSynchronizer(
|
|
127
132
|
* store1,
|
|
128
|
-
* new WebSocket('ws://localhost:8047'),
|
|
133
|
+
* new WebSocket('ws://localhost:8047/petShop'),
|
|
129
134
|
* );
|
|
130
135
|
* const synchronizer2 = await createWsSynchronizer(
|
|
131
136
|
* store2,
|
|
132
|
-
* new WebSocket('ws://localhost:8047'),
|
|
137
|
+
* new WebSocket('ws://localhost:8047/petShop'),
|
|
133
138
|
* );
|
|
134
139
|
*
|
|
135
140
|
* await synchronizer1.startSync();
|
|
@@ -159,4 +164,5 @@ export function createWsSynchronizer<WebSocketType extends WebSocketTypes>(
|
|
|
159
164
|
onSend?: Send,
|
|
160
165
|
onReceive?: Receive,
|
|
161
166
|
onIgnoredError?: (error: any) => void,
|
|
167
|
+
fragmentSize?: number,
|
|
162
168
|
): Promise<WsSynchronizer<WebSocketType>>;
|
|
@@ -90,11 +90,14 @@ export interface WsSynchronizer<
|
|
|
90
90
|
* onSend?: Send,
|
|
91
91
|
* onReceive?: Receive,
|
|
92
92
|
* onIgnoredError?: (error: any) => void,
|
|
93
|
+
* fragmentSize?: number,
|
|
93
94
|
* ): Promise<WsSynchronizer<WebSocketType>>;
|
|
94
95
|
* ```
|
|
95
96
|
*
|
|
96
97
|
* As well as providing a reference to the MergeableStore to persist, you must
|
|
97
|
-
* provide a configured WebSocket to send synchronization messages over.
|
|
98
|
+
* provide a configured WebSocket to send synchronization messages over. The
|
|
99
|
+
* path in the WebSocket URL is used by a WsServer as the path that the client
|
|
100
|
+
* joins. The MergeableStore Id does not select the server path.
|
|
98
101
|
*
|
|
99
102
|
* Instead of the raw browser implementation of WebSocket, you may prefer to use
|
|
100
103
|
* the [Reconnecting
|
|
@@ -122,6 +125,9 @@ export interface WsSynchronizer<
|
|
|
122
125
|
* @param onIgnoredError An optional handler for the errors that the
|
|
123
126
|
* Synchronizer would otherwise ignore when trying to synchronize data. This is
|
|
124
127
|
* suitable for debugging synchronization issues in a development environment.
|
|
128
|
+
* @param fragmentSize An optional maximum size for each WebSocket message
|
|
129
|
+
* fragment. When set, larger synchronization payloads are split into fragments
|
|
130
|
+
* and reassembled by the receiving WsSynchronizer, since v9.0.
|
|
125
131
|
* @returns A reference to the new WsSynchronizer object.
|
|
126
132
|
* @example
|
|
127
133
|
* This example creates two WsSynchronizer objects to synchronize one
|
|
@@ -140,11 +146,11 @@ export interface WsSynchronizer<
|
|
|
140
146
|
*
|
|
141
147
|
* const synchronizer1 = await createWsSynchronizer(
|
|
142
148
|
* store1,
|
|
143
|
-
* new WebSocket('ws://localhost:8047'),
|
|
149
|
+
* new WebSocket('ws://localhost:8047/petShop'),
|
|
144
150
|
* );
|
|
145
151
|
* const synchronizer2 = await createWsSynchronizer(
|
|
146
152
|
* store2,
|
|
147
|
-
* new WebSocket('ws://localhost:8047'),
|
|
153
|
+
* new WebSocket('ws://localhost:8047/petShop'),
|
|
148
154
|
* );
|
|
149
155
|
*
|
|
150
156
|
* await synchronizer1.startSync();
|
|
@@ -177,4 +183,5 @@ export function createWsSynchronizer<
|
|
|
177
183
|
onSend?: Send,
|
|
178
184
|
onReceive?: Receive,
|
|
179
185
|
onIgnoredError?: (error: any) => void,
|
|
186
|
+
fragmentSize?: number,
|
|
180
187
|
): Promise<WsSynchronizer<Schemas, WebSocketType>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The synchronizer-ws-server module of the TinyBase project lets you create
|
|
3
|
-
*
|
|
2
|
+
* The synchronizer-ws-server module of the TinyBase project lets you create a
|
|
3
|
+
* server that facilitates synchronization between clients.
|
|
4
4
|
* @see Synchronization guide
|
|
5
5
|
* @see Todo App v6 (collaboration) demo
|
|
6
6
|
* @packageDocumentation
|
|
@@ -506,6 +506,10 @@ export interface WsServer {
|
|
|
506
506
|
* only exist when there are active clients on that particular path. The
|
|
507
507
|
* creation callback can be asynchronous.
|
|
508
508
|
*
|
|
509
|
+
* A path is taken from the path in the client WebSocket URL. For example,
|
|
510
|
+
* clients connecting to `ws://localhost:8047/petShop` will share the `petShop`
|
|
511
|
+
* path. The Id of a client's MergeableStore does not select this path.
|
|
512
|
+
*
|
|
509
513
|
* You are responsible for creating a MergeableStore to pass to this Persister,
|
|
510
514
|
* but starting and stopping its automatic saving and loading is taken care of
|
|
511
515
|
* by the WsServer. As a result, the server MergeableStore will be kept in sync
|
|
@@ -528,6 +532,13 @@ export interface WsServer {
|
|
|
528
532
|
* @param onIgnoredError An optional handler for the errors that the server
|
|
529
533
|
* would otherwise ignore when trying to sync data. This is suitable for
|
|
530
534
|
* debugging issues in a development environment.
|
|
535
|
+
* @param requestTimeoutSeconds An optional time in seconds that the server will
|
|
536
|
+
* wait for responses to synchronization requests and incomplete fragments,
|
|
537
|
+
* defaulting to `1`.
|
|
538
|
+
* @param fragmentSize An optional maximum size for each WebSocket message
|
|
539
|
+
* fragment. When set, larger synchronization payloads sent by the server are
|
|
540
|
+
* split into fragments and reassembled by the receiving WsSynchronizer, since
|
|
541
|
+
* v9.0.
|
|
531
542
|
* @returns A reference to the new WsServer object.
|
|
532
543
|
* @example
|
|
533
544
|
* This example creates a WsServer that synchronizes two clients on a shared
|
|
@@ -733,4 +744,6 @@ export function createWsServer<
|
|
|
733
744
|
| Promise<[PathPersister, (store: MergeableStore) => void]>
|
|
734
745
|
| undefined,
|
|
735
746
|
onIgnoredError?: (error: any) => void,
|
|
747
|
+
requestTimeoutSeconds?: number,
|
|
748
|
+
fragmentSize?: number,
|
|
736
749
|
): WsServer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The synchronizer-ws-server module of the TinyBase project lets you create
|
|
3
|
-
*
|
|
2
|
+
* The synchronizer-ws-server module of the TinyBase project lets you create a
|
|
3
|
+
* server that facilitates synchronization between clients.
|
|
4
4
|
* @see Synchronization guide
|
|
5
5
|
* @see Todo App v6 (collaboration) demo
|
|
6
6
|
* @packageDocumentation
|
|
@@ -521,6 +521,8 @@ export interface WsServer {
|
|
|
521
521
|
* | Promise<[PathPersister, (store: MergeableStore) => void]>
|
|
522
522
|
* | undefined,
|
|
523
523
|
* onIgnoredError?: (error: any) => void,
|
|
524
|
+
* requestTimeoutSeconds?: number,
|
|
525
|
+
* fragmentSize?: number,
|
|
524
526
|
* ): WsServer;
|
|
525
527
|
* ```
|
|
526
528
|
*
|
|
@@ -533,6 +535,10 @@ export interface WsServer {
|
|
|
533
535
|
* only exist when there are active clients on that particular path. The
|
|
534
536
|
* creation callback can be asynchronous.
|
|
535
537
|
*
|
|
538
|
+
* A path is taken from the path in the client WebSocket URL. For example,
|
|
539
|
+
* clients connecting to `ws://localhost:8047/petShop` will share the `petShop`
|
|
540
|
+
* path. The Id of a client's MergeableStore does not select this path.
|
|
541
|
+
*
|
|
536
542
|
* You are responsible for creating a MergeableStore to pass to this Persister,
|
|
537
543
|
* but starting and stopping its automatic saving and loading is taken care of
|
|
538
544
|
* by the WsServer. As a result, the server MergeableStore will be kept in sync
|
|
@@ -555,6 +561,13 @@ export interface WsServer {
|
|
|
555
561
|
* @param onIgnoredError An optional handler for the errors that the server
|
|
556
562
|
* would otherwise ignore when trying to sync data. This is suitable for
|
|
557
563
|
* debugging issues in a development environment.
|
|
564
|
+
* @param requestTimeoutSeconds An optional time in seconds that the server will
|
|
565
|
+
* wait for responses to synchronization requests and incomplete fragments,
|
|
566
|
+
* defaulting to `1`.
|
|
567
|
+
* @param fragmentSize An optional maximum size for each WebSocket message
|
|
568
|
+
* fragment. When set, larger synchronization payloads sent by the server are
|
|
569
|
+
* split into fragments and reassembled by the receiving WsSynchronizer, since
|
|
570
|
+
* v9.0.
|
|
558
571
|
* @returns A reference to the new WsServer object.
|
|
559
572
|
* @example
|
|
560
573
|
* This example creates a WsServer that synchronizes two clients on a shared
|
|
@@ -762,4 +775,6 @@ export function createWsServer<
|
|
|
762
775
|
| Promise<[PathPersister, (store: MergeableStore<Schemas>) => void]>
|
|
763
776
|
| undefined,
|
|
764
777
|
onIgnoredError?: (error: any) => void,
|
|
778
|
+
requestTimeoutSeconds?: number,
|
|
779
|
+
fragmentSize?: number,
|
|
765
780
|
): WsServer;
|
|
@@ -142,6 +142,57 @@ export class WsServerDurableObject<Env = unknown> extends DurableObject<Env> {
|
|
|
142
142
|
*/
|
|
143
143
|
getClientIds(): Ids;
|
|
144
144
|
|
|
145
|
+
/**
|
|
146
|
+
* The getFragmentSize method is used to specify a maximum size for each
|
|
147
|
+
* WebSocket message fragment sent by the Durable Object.
|
|
148
|
+
*
|
|
149
|
+
* Return a number to split larger synchronization payloads into fragments
|
|
150
|
+
* that are reassembled by the receiving WsSynchronizer. Return `undefined`
|
|
151
|
+
* to send each payload as a single WebSocket message.
|
|
152
|
+
* @returns The maximum fragment size, or `undefined` to disable
|
|
153
|
+
* fragmentation.
|
|
154
|
+
* @example
|
|
155
|
+
* This example limits outbound Durable Object synchronization message
|
|
156
|
+
* fragments to 32KB.
|
|
157
|
+
*
|
|
158
|
+
* ```js ignore
|
|
159
|
+
* import {WsServerDurableObject} from 'tinybase/synchronizers/synchronizer-ws-server-durable-object';
|
|
160
|
+
*
|
|
161
|
+
* export class MyDurableObject extends WsServerDurableObject {
|
|
162
|
+
* getFragmentSize() {
|
|
163
|
+
* return 32 * 1024;
|
|
164
|
+
* }
|
|
165
|
+
* }
|
|
166
|
+
* ```
|
|
167
|
+
* @category Getter
|
|
168
|
+
* @since v9.0.0
|
|
169
|
+
*/
|
|
170
|
+
getFragmentSize(): number | undefined;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The getRequestTimeoutSeconds method is used to specify how long the Durable
|
|
174
|
+
* Object will wait for synchronization responses and incomplete fragments.
|
|
175
|
+
*
|
|
176
|
+
* Return a number of seconds to use as the timeout. The default is `1`.
|
|
177
|
+
* @returns The number of seconds to wait before timing out.
|
|
178
|
+
* @example
|
|
179
|
+
* This example waits up to 10 seconds for synchronization responses and
|
|
180
|
+
* incomplete fragments.
|
|
181
|
+
*
|
|
182
|
+
* ```js ignore
|
|
183
|
+
* import {WsServerDurableObject} from 'tinybase/synchronizers/synchronizer-ws-server-durable-object';
|
|
184
|
+
*
|
|
185
|
+
* export class MyDurableObject extends WsServerDurableObject {
|
|
186
|
+
* getRequestTimeoutSeconds() {
|
|
187
|
+
* return 10;
|
|
188
|
+
* }
|
|
189
|
+
* }
|
|
190
|
+
* ```
|
|
191
|
+
* @category Getter
|
|
192
|
+
* @since v9.0.0
|
|
193
|
+
*/
|
|
194
|
+
getRequestTimeoutSeconds(): number;
|
|
195
|
+
|
|
145
196
|
/**
|
|
146
197
|
* The onPathId method is called when the first client connects to, or the
|
|
147
198
|
* last client disconnects from, the server with a given path Id.
|
|
@@ -162,6 +162,57 @@ export class WsServerDurableObject<
|
|
|
162
162
|
*/
|
|
163
163
|
getClientIds(): Ids;
|
|
164
164
|
|
|
165
|
+
/**
|
|
166
|
+
* The getFragmentSize method is used to specify a maximum size for each
|
|
167
|
+
* WebSocket message fragment sent by the Durable Object.
|
|
168
|
+
*
|
|
169
|
+
* Return a number to split larger synchronization payloads into fragments
|
|
170
|
+
* that are reassembled by the receiving WsSynchronizer. Return `undefined`
|
|
171
|
+
* to send each payload as a single WebSocket message.
|
|
172
|
+
* @returns The maximum fragment size, or `undefined` to disable
|
|
173
|
+
* fragmentation.
|
|
174
|
+
* @example
|
|
175
|
+
* This example limits outbound Durable Object synchronization message
|
|
176
|
+
* fragments to 32KB.
|
|
177
|
+
*
|
|
178
|
+
* ```js ignore
|
|
179
|
+
* import {WsServerDurableObject} from 'tinybase/synchronizers/synchronizer-ws-server-durable-object';
|
|
180
|
+
*
|
|
181
|
+
* export class MyDurableObject extends WsServerDurableObject {
|
|
182
|
+
* getFragmentSize() {
|
|
183
|
+
* return 32 * 1024;
|
|
184
|
+
* }
|
|
185
|
+
* }
|
|
186
|
+
* ```
|
|
187
|
+
* @category Getter
|
|
188
|
+
* @since v9.0.0
|
|
189
|
+
*/
|
|
190
|
+
getFragmentSize(): number | undefined;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The getRequestTimeoutSeconds method is used to specify how long the Durable
|
|
194
|
+
* Object will wait for synchronization responses and incomplete fragments.
|
|
195
|
+
*
|
|
196
|
+
* Return a number of seconds to use as the timeout. The default is `1`.
|
|
197
|
+
* @returns The number of seconds to wait before timing out.
|
|
198
|
+
* @example
|
|
199
|
+
* This example waits up to 10 seconds for synchronization responses and
|
|
200
|
+
* incomplete fragments.
|
|
201
|
+
*
|
|
202
|
+
* ```js ignore
|
|
203
|
+
* import {WsServerDurableObject} from 'tinybase/synchronizers/synchronizer-ws-server-durable-object';
|
|
204
|
+
*
|
|
205
|
+
* export class MyDurableObject extends WsServerDurableObject {
|
|
206
|
+
* getRequestTimeoutSeconds() {
|
|
207
|
+
* return 10;
|
|
208
|
+
* }
|
|
209
|
+
* }
|
|
210
|
+
* ```
|
|
211
|
+
* @category Getter
|
|
212
|
+
* @since v9.0.0
|
|
213
|
+
*/
|
|
214
|
+
getRequestTimeoutSeconds(): number;
|
|
215
|
+
|
|
165
216
|
/**
|
|
166
217
|
* The onPathId method is called when the first client connects to, or the
|
|
167
218
|
* last client disconnects from, the server with a given path Id.
|
|
@@ -4208,8 +4208,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
4208
4208
|
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
4209
4209
|
CellId extends CellIdFromSchema<Schemas[0], TableId>,
|
|
4210
4210
|
SetOrMapCell =
|
|
4211
|
-
|
|
|
4212
|
-
| MapCell<Schemas[0], TableId, CellId>,
|
|
4211
|
+
Cell<Schemas[0], TableId, CellId> | MapCell<Schemas[0], TableId, CellId>,
|
|
4213
4212
|
>(
|
|
4214
4213
|
tableId: TableId | GetId<Schemas, Parameter, TableId>,
|
|
4215
4214
|
rowId: Id | GetId<Schemas, Parameter, Id>,
|
|
@@ -5941,8 +5940,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
5941
5940
|
<
|
|
5942
5941
|
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
5943
5942
|
CellIdOrUndefined extends
|
|
5944
|
-
|
|
5945
|
-
| undefined,
|
|
5943
|
+
CellIdFromSchema<Schemas[0], TableId> | undefined,
|
|
5946
5944
|
>(
|
|
5947
5945
|
tableId: TableId,
|
|
5948
5946
|
cellId: CellIdOrUndefined,
|
|
@@ -6030,8 +6028,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
6030
6028
|
<
|
|
6031
6029
|
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
6032
6030
|
CellIdOrUndefined extends
|
|
6033
|
-
|
|
6034
|
-
| undefined,
|
|
6031
|
+
CellIdFromSchema<Schemas[0], TableId> | undefined,
|
|
6035
6032
|
>(
|
|
6036
6033
|
args: SortedRowIdsArgs<Schemas[0], TableId>,
|
|
6037
6034
|
listener: SortedRowIdsListener<Schemas, TableId, CellIdOrUndefined>,
|
|
@@ -229,8 +229,7 @@ export type TableInHtmlTableProps<
|
|
|
229
229
|
| CellIdFromSchema<Schemas[0], TableId>[]
|
|
230
230
|
| {
|
|
231
231
|
[CellId in CellIdFromSchema<Schemas[0], TableId>]?:
|
|
232
|
-
|
|
|
233
|
-
| CustomCell<Schemas, TableId, CellId>;
|
|
232
|
+
string | CustomCell<Schemas, TableId, CellId>;
|
|
234
233
|
};
|
|
235
234
|
}
|
|
236
235
|
: never
|
|
@@ -309,8 +308,7 @@ export type SortedTableInHtmlTableProps<
|
|
|
309
308
|
| CellIdFromSchema<Schemas[0], TableId>[]
|
|
310
309
|
| {
|
|
311
310
|
[CellId in CellIdFromSchema<Schemas[0], TableId>]?:
|
|
312
|
-
|
|
|
313
|
-
| CustomCell<Schemas, TableId, CellId>;
|
|
311
|
+
string | CustomCell<Schemas, TableId, CellId>;
|
|
314
312
|
};
|
|
315
313
|
/**
|
|
316
314
|
* Whether the table should be interactive such that clicking a header changes
|
|
@@ -427,8 +425,7 @@ export type SliceInHtmlTableProps<Schemas extends OptionalSchemas> = {
|
|
|
427
425
|
* @since v4.1.0
|
|
428
426
|
*/
|
|
429
427
|
readonly customCells?:
|
|
430
|
-
|
|
|
431
|
-
| {[cellId: Id]: string | CustomCell<NoSchemas, Id, Id>};
|
|
428
|
+
Ids | {[cellId: Id]: string | CustomCell<NoSchemas, Id, Id>};
|
|
432
429
|
};
|
|
433
430
|
|
|
434
431
|
/**
|
|
@@ -478,8 +475,7 @@ export type RelationshipInHtmlTableProps<Schemas extends OptionalSchemas> = {
|
|
|
478
475
|
* @since v4.1.0
|
|
479
476
|
*/
|
|
480
477
|
readonly customCells?:
|
|
481
|
-
|
|
|
482
|
-
| {[cellId: Id]: string | CustomCell<NoSchemas, Id, Id>};
|
|
478
|
+
Ids | {[cellId: Id]: string | CustomCell<NoSchemas, Id, Id>};
|
|
483
479
|
};
|
|
484
480
|
|
|
485
481
|
/**
|
|
@@ -514,8 +510,7 @@ export type ResultTableInHtmlTableProps<Schemas extends OptionalSchemas> = {
|
|
|
514
510
|
* @since v4.1.0
|
|
515
511
|
*/
|
|
516
512
|
readonly customCells?:
|
|
517
|
-
|
|
|
518
|
-
| {[cellId: Id]: string | CustomResultCell<Schemas>};
|
|
513
|
+
Ids | {[cellId: Id]: string | CustomResultCell<Schemas>};
|
|
519
514
|
};
|
|
520
515
|
|
|
521
516
|
/**
|
|
@@ -577,8 +572,7 @@ export type ResultSortedTableInHtmlTableProps<Schemas extends OptionalSchemas> =
|
|
|
577
572
|
* @since v4.1.0
|
|
578
573
|
*/
|
|
579
574
|
readonly customCells?:
|
|
580
|
-
|
|
|
581
|
-
| {[cellId: Id]: string | CustomResultCell<Schemas>};
|
|
575
|
+
Ids | {[cellId: Id]: string | CustomResultCell<Schemas>};
|
|
582
576
|
/**
|
|
583
577
|
* Whether the table should be interactive such that clicking a header changes
|
|
584
578
|
* the sorting and/or direction.
|
|
@@ -498,10 +498,9 @@ type NumericCellIdFromSchema<
|
|
|
498
498
|
Schemas extends OptionalSchemas,
|
|
499
499
|
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
500
500
|
> = {
|
|
501
|
-
[
|
|
502
|
-
Schemas[0],
|
|
503
|
-
|
|
504
|
-
>]: Schemas[0][TableId][CellId] extends {type: 'any' | 'number'}
|
|
501
|
+
[
|
|
502
|
+
CellId in CellIdFromSchema<Schemas[0], TableId>
|
|
503
|
+
]: Schemas[0][TableId][CellId] extends {type: 'any' | 'number'}
|
|
505
504
|
? CellId
|
|
506
505
|
: never;
|
|
507
506
|
}[CellIdFromSchema<Schemas[0], TableId>];
|
|
@@ -1690,8 +1690,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
1690
1690
|
<
|
|
1691
1691
|
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
1692
1692
|
CellIdOrUndefined extends
|
|
1693
|
-
|
|
1694
|
-
| undefined,
|
|
1693
|
+
CellIdFromSchema<Schemas[0], TableId> | undefined,
|
|
1695
1694
|
>(
|
|
1696
1695
|
tableId: MaybeAccessor<TableId>,
|
|
1697
1696
|
cellId?: MaybeAccessor<CellIdOrUndefined>,
|
|
@@ -3237,8 +3236,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
3237
3236
|
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
3238
3237
|
CellId extends CellIdFromSchema<Schemas[0], TableId>,
|
|
3239
3238
|
SetOrMapCell =
|
|
3240
|
-
|
|
|
3241
|
-
| MapCell<Schemas[0], TableId, CellId>,
|
|
3239
|
+
Cell<Schemas[0], TableId, CellId> | MapCell<Schemas[0], TableId, CellId>,
|
|
3242
3240
|
>(
|
|
3243
3241
|
tableId: MaybeAccessor<TableId> | GetId<Schemas, Parameter, TableId>,
|
|
3244
3242
|
rowId: MaybeAccessor<Id> | GetId<Schemas, Parameter, Id>,
|
|
@@ -5260,8 +5258,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
5260
5258
|
<
|
|
5261
5259
|
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
5262
5260
|
CellIdOrUndefined extends
|
|
5263
|
-
|
|
5264
|
-
| undefined,
|
|
5261
|
+
CellIdFromSchema<Schemas[0], TableId> | undefined,
|
|
5265
5262
|
>(
|
|
5266
5263
|
tableId: MaybeAccessor<TableId>,
|
|
5267
5264
|
cellId: MaybeAccessor<CellIdOrUndefined>,
|
|
@@ -5367,8 +5364,7 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
|
|
|
5367
5364
|
<
|
|
5368
5365
|
TableId extends TableIdFromSchema<Schemas[0]>,
|
|
5369
5366
|
CellIdOrUndefined extends
|
|
5370
|
-
|
|
5371
|
-
| undefined,
|
|
5367
|
+
CellIdFromSchema<Schemas[0], TableId> | undefined,
|
|
5372
5368
|
>(
|
|
5373
5369
|
args: SortedRowIdsArgs<Schemas[0], TableId>,
|
|
5374
5370
|
listener: SortedRowIdsListener<Schemas, TableId, CellIdOrUndefined>,
|