tinybase 5.0.0-beta.0 → 5.0.0-beta.10
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/bin/cli.js +1 -1
- package/lib/checkpoints.js +1 -1
- package/lib/checkpoints.js.gz +0 -0
- package/lib/cjs/checkpoints.cjs +1 -1
- package/lib/cjs/checkpoints.cjs.gz +0 -0
- package/lib/cjs/indexes.cjs +1 -1
- package/lib/cjs/indexes.cjs.gz +0 -0
- package/lib/cjs/mergeable-store.cjs +1 -0
- package/lib/cjs/mergeable-store.cjs.gz +0 -0
- package/lib/cjs/metrics.cjs +1 -1
- package/lib/cjs/metrics.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-automerge.cjs +1 -1
- package/lib/cjs/persisters/persister-automerge.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-browser.cjs +1 -1
- package/lib/cjs/persisters/persister-browser.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-cr-sqlite-wasm.cjs +1 -1
- package/lib/cjs/persisters/persister-cr-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-electric-sql.cjs +1 -1
- package/lib/cjs/persisters/persister-electric-sql.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-expo-sqlite-next.cjs +1 -1
- package/lib/cjs/persisters/persister-expo-sqlite-next.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-expo-sqlite.cjs +1 -1
- package/lib/cjs/persisters/persister-expo-sqlite.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-file.cjs +1 -1
- package/lib/cjs/persisters/persister-file.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-indexed-db.cjs +1 -1
- package/lib/cjs/persisters/persister-indexed-db.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-libsql.cjs +1 -0
- package/lib/cjs/persisters/persister-libsql.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-partykit-client.cjs +1 -1
- package/lib/cjs/persisters/persister-partykit-client.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-partykit-server.cjs +1 -1
- package/lib/cjs/persisters/persister-partykit-server.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-powersync.cjs +1 -0
- package/lib/cjs/persisters/persister-powersync.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-remote.cjs +1 -1
- package/lib/cjs/persisters/persister-remote.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-sqlite-wasm.cjs +1 -1
- package/lib/cjs/persisters/persister-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-sqlite3.cjs +1 -1
- package/lib/cjs/persisters/persister-sqlite3.cjs.gz +0 -0
- package/lib/cjs/persisters/persister-yjs.cjs +1 -1
- package/lib/cjs/persisters/persister-yjs.cjs.gz +0 -0
- package/lib/cjs/persisters.cjs +1 -1
- package/lib/cjs/persisters.cjs.gz +0 -0
- package/lib/cjs/queries.cjs +1 -1
- package/lib/cjs/queries.cjs.gz +0 -0
- package/lib/cjs/relationships.cjs +1 -1
- package/lib/cjs/relationships.cjs.gz +0 -0
- package/lib/cjs/store.cjs +1 -1
- package/lib/cjs/store.cjs.gz +0 -0
- package/lib/cjs/synchronizers/synchronizer-local.cjs +1 -0
- package/lib/cjs/synchronizers/synchronizer-local.cjs.gz +0 -0
- package/lib/cjs/synchronizers/synchronizer-ws-client.cjs +1 -0
- package/lib/cjs/synchronizers/synchronizer-ws-client.cjs.gz +0 -0
- package/lib/cjs/synchronizers/synchronizer-ws-server.cjs +1 -0
- package/lib/cjs/synchronizers/synchronizer-ws-server.cjs.gz +0 -0
- package/lib/cjs/synchronizers.cjs +1 -0
- package/lib/cjs/synchronizers.cjs.gz +0 -0
- package/lib/cjs/tinybase.cjs +1 -1
- package/lib/cjs/tinybase.cjs.gz +0 -0
- package/lib/cjs/tools.cjs +1 -1
- package/lib/cjs/tools.cjs.gz +0 -0
- package/lib/cjs/ui-react-dom-debug.cjs +1 -1
- package/lib/cjs/ui-react-dom-debug.cjs.gz +0 -0
- package/lib/cjs/ui-react-dom.cjs +1 -1
- package/lib/cjs/ui-react-dom.cjs.gz +0 -0
- package/lib/cjs/ui-react.cjs +1 -1
- package/lib/cjs/ui-react.cjs.gz +0 -0
- package/lib/cjs-es6/checkpoints.cjs +1 -1
- package/lib/cjs-es6/checkpoints.cjs.gz +0 -0
- package/lib/cjs-es6/indexes.cjs +1 -1
- package/lib/cjs-es6/indexes.cjs.gz +0 -0
- package/lib/cjs-es6/mergeable-store.cjs +1 -0
- package/lib/cjs-es6/mergeable-store.cjs.gz +0 -0
- package/lib/cjs-es6/metrics.cjs +1 -1
- package/lib/cjs-es6/metrics.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-automerge.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-automerge.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-browser.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-browser.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-cr-sqlite-wasm.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-cr-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-electric-sql.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-electric-sql.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-expo-sqlite-next.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-expo-sqlite-next.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-expo-sqlite.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-expo-sqlite.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-file.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-file.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-indexed-db.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-indexed-db.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-libsql.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-libsql.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-partykit-client.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-partykit-client.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-partykit-server.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-partykit-server.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-powersync.cjs +1 -0
- package/lib/cjs-es6/persisters/persister-powersync.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-remote.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-remote.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-sqlite-wasm.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-sqlite-wasm.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-sqlite3.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-sqlite3.cjs.gz +0 -0
- package/lib/cjs-es6/persisters/persister-yjs.cjs +1 -1
- package/lib/cjs-es6/persisters/persister-yjs.cjs.gz +0 -0
- package/lib/cjs-es6/persisters.cjs +1 -1
- package/lib/cjs-es6/persisters.cjs.gz +0 -0
- package/lib/cjs-es6/queries.cjs +1 -1
- package/lib/cjs-es6/queries.cjs.gz +0 -0
- package/lib/cjs-es6/relationships.cjs +1 -1
- package/lib/cjs-es6/relationships.cjs.gz +0 -0
- package/lib/cjs-es6/store.cjs +1 -1
- package/lib/cjs-es6/store.cjs.gz +0 -0
- package/lib/cjs-es6/synchronizers/synchronizer-local.cjs +1 -0
- package/lib/cjs-es6/synchronizers/synchronizer-local.cjs.gz +0 -0
- package/lib/cjs-es6/synchronizers/synchronizer-ws-client.cjs +1 -0
- package/lib/cjs-es6/synchronizers/synchronizer-ws-client.cjs.gz +0 -0
- package/lib/cjs-es6/synchronizers/synchronizer-ws-server.cjs +1 -0
- package/lib/cjs-es6/synchronizers/synchronizer-ws-server.cjs.gz +0 -0
- package/lib/cjs-es6/synchronizers.cjs +1 -0
- package/lib/cjs-es6/synchronizers.cjs.gz +0 -0
- package/lib/cjs-es6/tinybase.cjs +1 -1
- package/lib/cjs-es6/tinybase.cjs.gz +0 -0
- package/lib/cjs-es6/tools.cjs +1 -1
- package/lib/cjs-es6/tools.cjs.gz +0 -0
- package/lib/cjs-es6/ui-react-dom-debug.cjs +1 -1
- package/lib/cjs-es6/ui-react-dom-debug.cjs.gz +0 -0
- package/lib/cjs-es6/ui-react-dom.cjs +1 -1
- package/lib/cjs-es6/ui-react-dom.cjs.gz +0 -0
- package/lib/cjs-es6/ui-react.cjs +1 -1
- package/lib/cjs-es6/ui-react.cjs.gz +0 -0
- package/lib/debug/checkpoints.js +254 -235
- package/lib/debug/indexes.js +10 -6
- package/lib/debug/mergeable-store.js +2230 -0
- package/lib/debug/metrics.js +10 -6
- package/lib/debug/persisters/persister-automerge.js +113 -87
- package/lib/debug/persisters/persister-browser.js +95 -57
- package/lib/debug/persisters/persister-cr-sqlite-wasm.js +175 -109
- package/lib/debug/persisters/persister-electric-sql.js +176 -109
- package/lib/debug/persisters/persister-expo-sqlite-next.js +176 -110
- package/lib/debug/persisters/persister-expo-sqlite.js +175 -109
- package/lib/debug/persisters/persister-file.js +94 -57
- package/lib/debug/persisters/persister-indexed-db.js +94 -57
- package/lib/debug/persisters/persister-libsql.js +913 -0
- package/lib/debug/persisters/persister-partykit-client.js +90 -59
- package/lib/debug/persisters/persister-partykit-server.js +19 -26
- package/lib/debug/persisters/persister-powersync.js +928 -0
- package/lib/debug/persisters/persister-remote.js +86 -53
- package/lib/debug/persisters/persister-sqlite-wasm.js +175 -109
- package/lib/debug/persisters/persister-sqlite3.js +175 -109
- package/lib/debug/persisters/persister-yjs.js +111 -84
- package/lib/debug/persisters.js +82 -50
- package/lib/debug/queries.js +18 -12
- package/lib/debug/relationships.js +10 -6
- package/lib/debug/store.js +150 -127
- package/lib/debug/synchronizers/synchronizer-local.js +559 -0
- package/lib/debug/synchronizers/synchronizer-ws-client.js +586 -0
- package/lib/debug/synchronizers/synchronizer-ws-server.js +96 -0
- package/lib/debug/synchronizers.js +519 -0
- package/lib/debug/tinybase.js +1281 -409
- package/lib/debug/tools.js +41 -64
- package/lib/debug/ui-react-dom.js +277 -213
- package/lib/debug/ui-react.js +213 -198
- package/lib/es6/checkpoints.js +1 -1
- package/lib/es6/checkpoints.js.gz +0 -0
- package/lib/es6/indexes.js +1 -1
- package/lib/es6/indexes.js.gz +0 -0
- package/lib/es6/mergeable-store.js +1 -0
- package/lib/es6/mergeable-store.js.gz +0 -0
- package/lib/es6/metrics.js +1 -1
- package/lib/es6/metrics.js.gz +0 -0
- package/lib/es6/persisters/persister-automerge.js +1 -1
- package/lib/es6/persisters/persister-automerge.js.gz +0 -0
- package/lib/es6/persisters/persister-browser.js +1 -1
- package/lib/es6/persisters/persister-browser.js.gz +0 -0
- package/lib/es6/persisters/persister-cr-sqlite-wasm.js +1 -1
- package/lib/es6/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/es6/persisters/persister-electric-sql.js +1 -1
- package/lib/es6/persisters/persister-electric-sql.js.gz +0 -0
- package/lib/es6/persisters/persister-expo-sqlite-next.js +1 -1
- package/lib/es6/persisters/persister-expo-sqlite-next.js.gz +0 -0
- package/lib/es6/persisters/persister-expo-sqlite.js +1 -1
- package/lib/es6/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/es6/persisters/persister-file.js +1 -1
- package/lib/es6/persisters/persister-file.js.gz +0 -0
- package/lib/es6/persisters/persister-indexed-db.js +1 -1
- package/lib/es6/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/es6/persisters/persister-libsql.js +1 -0
- package/lib/es6/persisters/persister-libsql.js.gz +0 -0
- package/lib/es6/persisters/persister-partykit-client.js +1 -1
- package/lib/es6/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/es6/persisters/persister-partykit-server.js +1 -1
- package/lib/es6/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/es6/persisters/persister-powersync.js +1 -0
- package/lib/es6/persisters/persister-powersync.js.gz +0 -0
- package/lib/es6/persisters/persister-remote.js +1 -1
- package/lib/es6/persisters/persister-remote.js.gz +0 -0
- package/lib/es6/persisters/persister-sqlite-wasm.js +1 -1
- package/lib/es6/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/es6/persisters/persister-sqlite3.js +1 -1
- package/lib/es6/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/es6/persisters/persister-yjs.js +1 -1
- package/lib/es6/persisters/persister-yjs.js.gz +0 -0
- package/lib/es6/persisters.js +1 -1
- package/lib/es6/persisters.js.gz +0 -0
- package/lib/es6/queries.js +1 -1
- package/lib/es6/queries.js.gz +0 -0
- package/lib/es6/relationships.js +1 -1
- package/lib/es6/relationships.js.gz +0 -0
- package/lib/es6/store.js +1 -1
- package/lib/es6/store.js.gz +0 -0
- package/lib/es6/synchronizers/synchronizer-local.js +1 -0
- package/lib/es6/synchronizers/synchronizer-local.js.gz +0 -0
- package/lib/es6/synchronizers/synchronizer-ws-client.js +1 -0
- package/lib/es6/synchronizers/synchronizer-ws-client.js.gz +0 -0
- package/lib/es6/synchronizers/synchronizer-ws-server.js +1 -0
- package/lib/es6/synchronizers/synchronizer-ws-server.js.gz +0 -0
- package/lib/es6/synchronizers.js +1 -0
- package/lib/es6/synchronizers.js.gz +0 -0
- package/lib/es6/tinybase.js +1 -1
- package/lib/es6/tinybase.js.gz +0 -0
- package/lib/es6/tools.js +1 -1
- package/lib/es6/tools.js.gz +0 -0
- package/lib/es6/ui-react-dom-debug.js +1 -1
- package/lib/es6/ui-react-dom-debug.js.gz +0 -0
- package/lib/es6/ui-react-dom.js +1 -1
- package/lib/es6/ui-react-dom.js.gz +0 -0
- package/lib/es6/ui-react.js +1 -1
- package/lib/es6/ui-react.js.gz +0 -0
- package/lib/indexes.js +1 -1
- package/lib/indexes.js.gz +0 -0
- package/lib/mergeable-store.js +1 -0
- package/lib/mergeable-store.js.gz +0 -0
- package/lib/metrics.js +1 -1
- package/lib/metrics.js.gz +0 -0
- package/lib/persisters/persister-automerge.js +1 -1
- package/lib/persisters/persister-automerge.js.gz +0 -0
- package/lib/persisters/persister-browser.js +1 -1
- package/lib/persisters/persister-browser.js.gz +0 -0
- package/lib/persisters/persister-cr-sqlite-wasm.js +1 -1
- package/lib/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/persisters/persister-electric-sql.js +1 -1
- package/lib/persisters/persister-electric-sql.js.gz +0 -0
- package/lib/persisters/persister-expo-sqlite-next.js +1 -1
- package/lib/persisters/persister-expo-sqlite-next.js.gz +0 -0
- package/lib/persisters/persister-expo-sqlite.js +1 -1
- package/lib/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/persisters/persister-file.js +1 -1
- package/lib/persisters/persister-file.js.gz +0 -0
- package/lib/persisters/persister-indexed-db.js +1 -1
- package/lib/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/persisters/persister-libsql.js +1 -0
- package/lib/persisters/persister-libsql.js.gz +0 -0
- package/lib/persisters/persister-partykit-client.js +1 -1
- package/lib/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/persisters/persister-partykit-server.js +1 -1
- package/lib/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/persisters/persister-powersync.js +1 -0
- package/lib/persisters/persister-powersync.js.gz +0 -0
- package/lib/persisters/persister-remote.js +1 -1
- package/lib/persisters/persister-remote.js.gz +0 -0
- package/lib/persisters/persister-sqlite-wasm.js +1 -1
- package/lib/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/persisters/persister-sqlite3.js +1 -1
- package/lib/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/persisters/persister-yjs.js +1 -1
- package/lib/persisters/persister-yjs.js.gz +0 -0
- package/lib/persisters.js +1 -1
- package/lib/persisters.js.gz +0 -0
- package/lib/queries.js +1 -1
- package/lib/queries.js.gz +0 -0
- package/lib/relationships.js +1 -1
- package/lib/relationships.js.gz +0 -0
- package/lib/store.js +1 -1
- package/lib/store.js.gz +0 -0
- package/lib/synchronizers/synchronizer-local.js +1 -0
- package/lib/synchronizers/synchronizer-local.js.gz +0 -0
- package/lib/synchronizers/synchronizer-ws-client.js +1 -0
- package/lib/synchronizers/synchronizer-ws-client.js.gz +0 -0
- package/lib/synchronizers/synchronizer-ws-server.js +1 -0
- package/lib/synchronizers/synchronizer-ws-server.js.gz +0 -0
- package/lib/synchronizers.js +1 -0
- package/lib/synchronizers.js.gz +0 -0
- package/lib/tinybase.js +1 -1
- package/lib/tinybase.js.gz +0 -0
- package/lib/tools.js +1 -1
- package/lib/tools.js.gz +0 -0
- package/lib/types/checkpoints.d.ts +2 -2
- package/lib/types/indexes.d.ts +2 -2
- package/lib/types/mergeable-store.d.ts +214 -0
- package/lib/types/metrics.d.ts +2 -2
- package/lib/types/persisters/persister-automerge.d.ts +11 -7
- package/lib/types/persisters/persister-browser.d.ts +13 -4
- package/lib/types/persisters/persister-cr-sqlite-wasm.d.ts +4 -0
- package/lib/types/persisters/persister-electric-sql.d.ts +4 -0
- package/lib/types/persisters/persister-expo-sqlite-next.d.ts +7 -3
- package/lib/types/persisters/persister-expo-sqlite.d.ts +4 -0
- package/lib/types/persisters/persister-file.d.ts +7 -2
- package/lib/types/persisters/persister-indexed-db.d.ts +4 -0
- package/lib/types/persisters/persister-libsql.d.ts +142 -0
- package/lib/types/persisters/persister-partykit-client.d.ts +4 -0
- package/lib/types/persisters/persister-partykit-server.d.ts +12 -8
- package/lib/types/persisters/persister-powersync.d.ts +157 -0
- package/lib/types/persisters/persister-remote.d.ts +4 -0
- package/lib/types/persisters/persister-sqlite-wasm.d.ts +4 -0
- package/lib/types/persisters/persister-sqlite3.d.ts +4 -0
- package/lib/types/persisters/persister-yjs.d.ts +6 -2
- package/lib/types/persisters.d.ts +125 -48
- package/lib/types/queries.d.ts +2 -2
- package/lib/types/relationships.d.ts +2 -2
- package/lib/types/store.d.ts +275 -187
- package/lib/types/synchronizers/synchronizer-local.d.ts +27 -0
- package/lib/types/synchronizers/synchronizer-ws-client.d.ts +35 -0
- package/lib/types/synchronizers/synchronizer-ws-server.d.ts +36 -0
- package/lib/types/synchronizers.d.ts +132 -0
- package/lib/types/tinybase.d.ts +10 -8
- package/lib/types/tools.d.ts +4 -4
- package/lib/types/ui-react.d.ts +235 -95
- package/lib/types/with-schemas/checkpoints.d.ts +2 -2
- package/lib/types/with-schemas/indexes.d.ts +2 -2
- package/lib/types/with-schemas/internal/queries.d.ts +4 -3
- package/lib/types/with-schemas/internal/store.d.ts +8 -3
- package/lib/types/with-schemas/mergeable-store.d.ts +492 -0
- package/lib/types/with-schemas/metrics.d.ts +2 -2
- package/lib/types/with-schemas/persisters/persister-automerge.d.ts +12 -8
- package/lib/types/with-schemas/persisters/persister-browser.d.ts +17 -8
- package/lib/types/with-schemas/persisters/persister-cr-sqlite-wasm.d.ts +5 -1
- package/lib/types/with-schemas/persisters/persister-electric-sql.d.ts +5 -1
- package/lib/types/with-schemas/persisters/persister-expo-sqlite-next.d.ts +8 -4
- package/lib/types/with-schemas/persisters/persister-expo-sqlite.d.ts +5 -1
- package/lib/types/with-schemas/persisters/persister-file.d.ts +9 -4
- package/lib/types/with-schemas/persisters/persister-indexed-db.d.ts +5 -1
- package/lib/types/with-schemas/persisters/persister-libsql.d.ts +155 -0
- package/lib/types/with-schemas/persisters/persister-partykit-client.d.ts +5 -1
- package/lib/types/with-schemas/persisters/persister-partykit-server.d.ts +15 -11
- package/lib/types/with-schemas/persisters/persister-powersync.d.ts +170 -0
- package/lib/types/with-schemas/persisters/persister-remote.d.ts +5 -1
- package/lib/types/with-schemas/persisters/persister-sqlite-wasm.d.ts +5 -1
- package/lib/types/with-schemas/persisters/persister-sqlite3.d.ts +5 -1
- package/lib/types/with-schemas/persisters/persister-yjs.d.ts +7 -3
- package/lib/types/with-schemas/persisters.d.ts +161 -101
- package/lib/types/with-schemas/queries.d.ts +3 -3
- package/lib/types/with-schemas/relationships.d.ts +2 -2
- package/lib/types/with-schemas/store.d.ts +483 -345
- package/lib/types/with-schemas/synchronizers/synchronizer-local.d.ts +29 -0
- package/lib/types/with-schemas/synchronizers/synchronizer-ws-client.d.ts +41 -0
- package/lib/types/with-schemas/synchronizers/synchronizer-ws-server.d.ts +36 -0
- package/lib/types/with-schemas/synchronizers.d.ts +146 -0
- package/lib/types/with-schemas/tinybase.d.ts +9 -8
- package/lib/types/with-schemas/tools.d.ts +4 -4
- package/lib/types/with-schemas/ui-react.d.ts +259 -102
- package/lib/ui-react-dom.js +1 -1
- package/lib/ui-react-dom.js.gz +0 -0
- package/lib/ui-react.js +1 -1
- package/lib/ui-react.js.gz +0 -0
- package/lib/umd/checkpoints.js +1 -1
- package/lib/umd/checkpoints.js.gz +0 -0
- package/lib/umd/indexes.js +1 -1
- package/lib/umd/indexes.js.gz +0 -0
- package/lib/umd/mergeable-store.js +1 -0
- package/lib/umd/mergeable-store.js.gz +0 -0
- package/lib/umd/metrics.js +1 -1
- package/lib/umd/metrics.js.gz +0 -0
- package/lib/umd/persisters/persister-automerge.js +1 -1
- package/lib/umd/persisters/persister-automerge.js.gz +0 -0
- package/lib/umd/persisters/persister-browser.js +1 -1
- package/lib/umd/persisters/persister-browser.js.gz +0 -0
- package/lib/umd/persisters/persister-cr-sqlite-wasm.js +1 -1
- package/lib/umd/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/umd/persisters/persister-electric-sql.js +1 -1
- package/lib/umd/persisters/persister-electric-sql.js.gz +0 -0
- package/lib/umd/persisters/persister-expo-sqlite-next.js +1 -1
- package/lib/umd/persisters/persister-expo-sqlite-next.js.gz +0 -0
- package/lib/umd/persisters/persister-expo-sqlite.js +1 -1
- package/lib/umd/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/umd/persisters/persister-file.js +1 -1
- package/lib/umd/persisters/persister-file.js.gz +0 -0
- package/lib/umd/persisters/persister-indexed-db.js +1 -1
- package/lib/umd/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/umd/persisters/persister-libsql.js +1 -0
- package/lib/umd/persisters/persister-libsql.js.gz +0 -0
- package/lib/umd/persisters/persister-partykit-client.js +1 -1
- package/lib/umd/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/umd/persisters/persister-partykit-server.js +1 -1
- package/lib/umd/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/umd/persisters/persister-powersync.js +1 -0
- package/lib/umd/persisters/persister-powersync.js.gz +0 -0
- package/lib/umd/persisters/persister-remote.js +1 -1
- package/lib/umd/persisters/persister-remote.js.gz +0 -0
- package/lib/umd/persisters/persister-sqlite-wasm.js +1 -1
- package/lib/umd/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/umd/persisters/persister-sqlite3.js +1 -1
- package/lib/umd/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/umd/persisters/persister-yjs.js +1 -1
- package/lib/umd/persisters/persister-yjs.js.gz +0 -0
- package/lib/umd/persisters.js +1 -1
- package/lib/umd/persisters.js.gz +0 -0
- package/lib/umd/queries.js +1 -1
- package/lib/umd/queries.js.gz +0 -0
- package/lib/umd/relationships.js +1 -1
- package/lib/umd/relationships.js.gz +0 -0
- package/lib/umd/store.js +1 -1
- package/lib/umd/store.js.gz +0 -0
- package/lib/umd/synchronizers/synchronizer-local.js +1 -0
- package/lib/umd/synchronizers/synchronizer-local.js.gz +0 -0
- package/lib/umd/synchronizers/synchronizer-ws-client.js +1 -0
- package/lib/umd/synchronizers/synchronizer-ws-client.js.gz +0 -0
- package/lib/umd/synchronizers/synchronizer-ws-server.js +1 -0
- package/lib/umd/synchronizers/synchronizer-ws-server.js.gz +0 -0
- package/lib/umd/synchronizers.js +1 -0
- package/lib/umd/synchronizers.js.gz +0 -0
- package/lib/umd/tinybase.js +1 -1
- package/lib/umd/tinybase.js.gz +0 -0
- package/lib/umd/tools.js +1 -1
- package/lib/umd/tools.js.gz +0 -0
- package/lib/umd/ui-react-dom-debug.js +1 -1
- package/lib/umd/ui-react-dom-debug.js.gz +0 -0
- package/lib/umd/ui-react-dom.js +1 -1
- package/lib/umd/ui-react-dom.js.gz +0 -0
- package/lib/umd/ui-react.js +1 -1
- package/lib/umd/ui-react.js.gz +0 -0
- package/lib/umd-es6/checkpoints.js +1 -1
- package/lib/umd-es6/checkpoints.js.gz +0 -0
- package/lib/umd-es6/indexes.js +1 -1
- package/lib/umd-es6/indexes.js.gz +0 -0
- package/lib/umd-es6/mergeable-store.js +1 -0
- package/lib/umd-es6/mergeable-store.js.gz +0 -0
- package/lib/umd-es6/metrics.js +1 -1
- package/lib/umd-es6/metrics.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-automerge.js +1 -1
- package/lib/umd-es6/persisters/persister-automerge.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-browser.js +1 -1
- package/lib/umd-es6/persisters/persister-browser.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-cr-sqlite-wasm.js +1 -1
- package/lib/umd-es6/persisters/persister-cr-sqlite-wasm.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-electric-sql.js +1 -1
- package/lib/umd-es6/persisters/persister-electric-sql.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-expo-sqlite-next.js +1 -1
- package/lib/umd-es6/persisters/persister-expo-sqlite-next.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-expo-sqlite.js +1 -1
- package/lib/umd-es6/persisters/persister-expo-sqlite.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-file.js +1 -1
- package/lib/umd-es6/persisters/persister-file.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-indexed-db.js +1 -1
- package/lib/umd-es6/persisters/persister-indexed-db.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-libsql.js +1 -0
- package/lib/umd-es6/persisters/persister-libsql.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-partykit-client.js +1 -1
- package/lib/umd-es6/persisters/persister-partykit-client.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-partykit-server.js +1 -1
- package/lib/umd-es6/persisters/persister-partykit-server.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-powersync.js +1 -0
- package/lib/umd-es6/persisters/persister-powersync.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-remote.js +1 -1
- package/lib/umd-es6/persisters/persister-remote.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-sqlite-wasm.js +1 -1
- package/lib/umd-es6/persisters/persister-sqlite-wasm.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-sqlite3.js +1 -1
- package/lib/umd-es6/persisters/persister-sqlite3.js.gz +0 -0
- package/lib/umd-es6/persisters/persister-yjs.js +1 -1
- package/lib/umd-es6/persisters/persister-yjs.js.gz +0 -0
- package/lib/umd-es6/persisters.js +1 -1
- package/lib/umd-es6/persisters.js.gz +0 -0
- package/lib/umd-es6/queries.js +1 -1
- package/lib/umd-es6/queries.js.gz +0 -0
- package/lib/umd-es6/relationships.js +1 -1
- package/lib/umd-es6/relationships.js.gz +0 -0
- package/lib/umd-es6/store.js +1 -1
- package/lib/umd-es6/store.js.gz +0 -0
- package/lib/umd-es6/synchronizers/synchronizer-local.js +1 -0
- package/lib/umd-es6/synchronizers/synchronizer-local.js.gz +0 -0
- package/lib/umd-es6/synchronizers/synchronizer-ws-client.js +1 -0
- package/lib/umd-es6/synchronizers/synchronizer-ws-client.js.gz +0 -0
- package/lib/umd-es6/synchronizers/synchronizer-ws-server.js +1 -0
- package/lib/umd-es6/synchronizers/synchronizer-ws-server.js.gz +0 -0
- package/lib/umd-es6/synchronizers.js +1 -0
- package/lib/umd-es6/synchronizers.js.gz +0 -0
- package/lib/umd-es6/tinybase.js +1 -1
- package/lib/umd-es6/tinybase.js.gz +0 -0
- package/lib/umd-es6/tools.js +1 -1
- package/lib/umd-es6/tools.js.gz +0 -0
- package/lib/umd-es6/ui-react-dom-debug.js +1 -1
- package/lib/umd-es6/ui-react-dom-debug.js.gz +0 -0
- package/lib/umd-es6/ui-react-dom.js +1 -1
- package/lib/umd-es6/ui-react-dom.js.gz +0 -0
- package/lib/umd-es6/ui-react.js +1 -1
- package/lib/umd-es6/ui-react.js.gz +0 -0
- package/package.json +68 -48
- package/readme.md +2 -2
package/lib/types/ui-react.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* @module ui-react
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import {Callback, Id, IdOrNull, Ids, ParameterizedCallback} from './common.d';
|
|
25
|
+
import {Callback, Id, IdOrNull, Ids, ParameterizedCallback} from './common.d.ts';
|
|
26
26
|
import {
|
|
27
27
|
Cell,
|
|
28
28
|
CellIdsListener,
|
|
@@ -56,22 +56,22 @@ import {
|
|
|
56
56
|
ValueOrUndefined,
|
|
57
57
|
Values,
|
|
58
58
|
ValuesListener,
|
|
59
|
-
} from './store.d';
|
|
59
|
+
} from './store.d.ts';
|
|
60
60
|
import {
|
|
61
61
|
CheckpointIds,
|
|
62
62
|
CheckpointIdsListener,
|
|
63
63
|
CheckpointListener,
|
|
64
64
|
Checkpoints,
|
|
65
|
-
} from './checkpoints.d';
|
|
65
|
+
} from './checkpoints.d.ts';
|
|
66
66
|
import {ComponentType, ReactElement} from 'react';
|
|
67
|
-
import {Indexes, SliceIdsListener, SliceRowIdsListener} from './indexes.d';
|
|
67
|
+
import {Indexes, SliceIdsListener, SliceRowIdsListener} from './indexes.d.ts';
|
|
68
68
|
import {
|
|
69
69
|
LinkedRowIdsListener,
|
|
70
70
|
LocalRowIdsListener,
|
|
71
71
|
Relationships,
|
|
72
72
|
RemoteRowIdListener,
|
|
73
|
-
} from './relationships.d';
|
|
74
|
-
import {MetricListener, Metrics} from './metrics.d';
|
|
73
|
+
} from './relationships.d.ts';
|
|
74
|
+
import {MetricListener, Metrics} from './metrics.d.ts';
|
|
75
75
|
import {
|
|
76
76
|
Queries,
|
|
77
77
|
ResultCellIdsListener,
|
|
@@ -82,8 +82,10 @@ import {
|
|
|
82
82
|
ResultSortedRowIdsListener,
|
|
83
83
|
ResultTableCellIdsListener,
|
|
84
84
|
ResultTableListener,
|
|
85
|
-
} from './queries.d';
|
|
86
|
-
import {
|
|
85
|
+
} from './queries.d.ts';
|
|
86
|
+
import {MergeableStore} from './mergeable-store';
|
|
87
|
+
import {Persister} from './persisters.d.ts';
|
|
88
|
+
import {Synchronizer} from './synchronizers';
|
|
87
89
|
|
|
88
90
|
/**
|
|
89
91
|
* The StoreOrStoreId type is used when you need to refer to a Store in a React
|
|
@@ -212,6 +214,7 @@ export type UndoOrRedoInformation = [boolean, Callback, Id | undefined, string];
|
|
|
212
214
|
* useSetTableCallback hook or useSetRowCallback hook - so that the Id arguments
|
|
213
215
|
* of the object to set can also be dependent on the event or parameter
|
|
214
216
|
* provided (as well as the object itself being set).
|
|
217
|
+
* @category Identity
|
|
215
218
|
*/
|
|
216
219
|
export type GetId<Parameter> = (parameter: Parameter, store: Store) => Id;
|
|
217
220
|
|
|
@@ -221,9 +224,9 @@ export type GetId<Parameter> = (parameter: Parameter, store: Store) => Id;
|
|
|
221
224
|
*
|
|
222
225
|
* It is possible to create a Store outside of the React app with the regular
|
|
223
226
|
* createStore function and pass it in, but you may prefer to create it within
|
|
224
|
-
* the app, perhaps inside the top-level component. To
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
+
* the app, perhaps inside the top-level component. To prevent a new Store being
|
|
228
|
+
* created every time the app renders or re-renders, the useCreateStore hook
|
|
229
|
+
* wraps the creation in a memoization.
|
|
227
230
|
*
|
|
228
231
|
* The useCreateStore hook is a very thin wrapper around the React `useMemo`
|
|
229
232
|
* hook, defaulting to an empty array for its dependencies, so that by default,
|
|
@@ -300,6 +303,14 @@ export function useCreateStore(
|
|
|
300
303
|
createDeps?: React.DependencyList,
|
|
301
304
|
): Store;
|
|
302
305
|
|
|
306
|
+
/**
|
|
307
|
+
* The useCreateMergeableStore hook
|
|
308
|
+
*/
|
|
309
|
+
export function useCreateMergeableStore(
|
|
310
|
+
create: () => MergeableStore,
|
|
311
|
+
createDeps?: React.DependencyList,
|
|
312
|
+
): MergeableStore;
|
|
313
|
+
|
|
303
314
|
/**
|
|
304
315
|
* The useStoreIds hook is used to retrieve the Ids of all the named Store
|
|
305
316
|
* objects present in the current Provider component context.
|
|
@@ -2476,8 +2487,8 @@ export function useSetRowCallback<Parameter>(
|
|
|
2476
2487
|
* specify `reuseRowIds` to be `false`, then the Id will be a monotonically
|
|
2477
2488
|
* increasing string representation of an increasing integer, regardless of any
|
|
2478
2489
|
* you may have previously deleted.
|
|
2479
|
-
* @param tableId The Id of the Table in the Store, or a GetId function
|
|
2480
|
-
*
|
|
2490
|
+
* @param tableId The Id of the Table in the Store, or a GetId function that
|
|
2491
|
+
* will return it.
|
|
2481
2492
|
* @param getRow A function which returns the Row object that will be used to
|
|
2482
2493
|
* update the Store, based on the parameter the callback will receive (and which
|
|
2483
2494
|
* is most likely a DOM event).
|
|
@@ -3626,8 +3637,8 @@ export function useTableIdsListener(
|
|
|
3626
3637
|
* dependencies) or the component unmounts, the listener on the underlying Store
|
|
3627
3638
|
* will be deleted.
|
|
3628
3639
|
* @param tableId The Id of the Table to listen to, or `null` as a wildcard.
|
|
3629
|
-
* @param listener The function that will be called whenever the matching
|
|
3630
|
-
*
|
|
3640
|
+
* @param listener The function that will be called whenever the matching Table
|
|
3641
|
+
* is added or removed.
|
|
3631
3642
|
* @param listenerDeps An optional array of dependencies for the `listener`
|
|
3632
3643
|
* function, which, if any change, result in the re-registration of the
|
|
3633
3644
|
* listener. This parameter defaults to an empty array.
|
|
@@ -4112,8 +4123,8 @@ export function useSortedRowIdsListener(
|
|
|
4112
4123
|
* more easily done with the useHasRow hook).
|
|
4113
4124
|
*
|
|
4114
4125
|
* You can either listen to a single Row being added or removed (by specifying
|
|
4115
|
-
* the Table Id and Row Id, as the method's first two parameters) or changes
|
|
4116
|
-
*
|
|
4126
|
+
* the Table Id and Row Id, as the method's first two parameters) or changes to
|
|
4127
|
+
* any Row (by providing `null` wildcards).
|
|
4117
4128
|
*
|
|
4118
4129
|
* Both, either, or neither of the `tableId` and `rowId` parameters can be
|
|
4119
4130
|
* wildcarded with `null`. You can listen to a specific Row in a specific Table,
|
|
@@ -4126,8 +4137,8 @@ export function useSortedRowIdsListener(
|
|
|
4126
4137
|
* the component unmounts, the listener on the underlying Store will be deleted.
|
|
4127
4138
|
* @param tableId The Id of the Table to listen to, or `null` as a wildcard.
|
|
4128
4139
|
* @param rowId The Id of the Row to listen to, or `null` as a wildcard.
|
|
4129
|
-
* @param listener The function that will be called whenever the matching Row
|
|
4130
|
-
*
|
|
4140
|
+
* @param listener The function that will be called whenever the matching Row is
|
|
4141
|
+
* added or removed.
|
|
4131
4142
|
* @param listenerDeps An optional array of dependencies for the `listener`
|
|
4132
4143
|
* function, which, if any change, result in the re-registration of the
|
|
4133
4144
|
* listener. This parameter defaults to an empty array.
|
|
@@ -4339,14 +4350,14 @@ export function useCellIdsListener(
|
|
|
4339
4350
|
* own specific listener to do more than simply tracking the value (which is
|
|
4340
4351
|
* more easily done with the useHasCell hook).
|
|
4341
4352
|
*
|
|
4342
|
-
* You can either listen to a single Cell being added or removed (by
|
|
4343
|
-
*
|
|
4344
|
-
*
|
|
4353
|
+
* You can either listen to a single Cell being added or removed (by specifying
|
|
4354
|
+
* the Table Id, Row Id, and Cell Id as the method's first three parameters) or
|
|
4355
|
+
* changes to any Cell (by providing `null` wildcards).
|
|
4345
4356
|
*
|
|
4346
|
-
* All, some, or none of the `tableId`, `rowId`, and `cellId` parameters can
|
|
4347
|
-
*
|
|
4348
|
-
*
|
|
4349
|
-
*
|
|
4357
|
+
* All, some, or none of the `tableId`, `rowId`, and `cellId` parameters can be
|
|
4358
|
+
* wildcarded with `null`. You can listen to a specific Cell in a specific Row
|
|
4359
|
+
* in a specific Table, any Cell in any Row in any Table, for example - or every
|
|
4360
|
+
* other combination of wildcards.
|
|
4350
4361
|
*
|
|
4351
4362
|
* Unlike the addHasCellListener method, which returns a listener Id and
|
|
4352
4363
|
* requires you to remove it manually, the useHasCellListener hook manages this
|
|
@@ -4696,8 +4707,8 @@ export function useValueIdsListener(
|
|
|
4696
4707
|
* dependencies) or the component unmounts, the listener on the underlying Store
|
|
4697
4708
|
* will be deleted.
|
|
4698
4709
|
* @param valueId The Id of the Value to listen to, or `null` as a wildcard.
|
|
4699
|
-
* @param listener The function that will be called whenever the matching
|
|
4700
|
-
*
|
|
4710
|
+
* @param listener The function that will be called whenever the matching Value
|
|
4711
|
+
* is added or removed.
|
|
4701
4712
|
* @param listenerDeps An optional array of dependencies for the `listener`
|
|
4702
4713
|
* function, which, if any change, result in the re-registration of the
|
|
4703
4714
|
* listener. This parameter defaults to an empty array.
|
|
@@ -4996,13 +5007,11 @@ export function useDidFinishTransactionListener(
|
|
|
4996
5007
|
*
|
|
4997
5008
|
* It is possible to create a Metrics object outside of the React app with the
|
|
4998
5009
|
* regular createMetrics function and pass it in, but you may prefer to create
|
|
4999
|
-
* it within the app, perhaps inside the top-level component. To
|
|
5000
|
-
*
|
|
5001
|
-
* the useCreateMetrics hook
|
|
5002
|
-
*
|
|
5003
|
-
*
|
|
5004
|
-
* hook, defaulting to the provided Store as its dependency, so that by default,
|
|
5005
|
-
* the creation only occurs once per Store.
|
|
5010
|
+
* it within the app, perhaps inside the top-level component. To prevent a new
|
|
5011
|
+
* Metrics object being created every time the app renders or re-renders, since
|
|
5012
|
+
* v5.0 the useCreateMetrics hook performs the creation in an effect. As a
|
|
5013
|
+
* result this hook will return `undefined` on the brief first render, which you
|
|
5014
|
+
* should defend against.
|
|
5006
5015
|
*
|
|
5007
5016
|
* If your `create` function contains other dependencies, the changing of which
|
|
5008
5017
|
* should also cause the Metrics object to be recreated, you can provide them in
|
|
@@ -5037,7 +5046,7 @@ export function useDidFinishTransactionListener(
|
|
|
5037
5046
|
* 'species',
|
|
5038
5047
|
* );
|
|
5039
5048
|
* });
|
|
5040
|
-
* return <span>{metrics
|
|
5049
|
+
* return <span>{metrics?.getMetric('speciesCount')}</span>;
|
|
5041
5050
|
* };
|
|
5042
5051
|
*
|
|
5043
5052
|
* const app = document.createElement('div');
|
|
@@ -5075,7 +5084,7 @@ export function useDidFinishTransactionListener(
|
|
|
5075
5084
|
* },
|
|
5076
5085
|
* [tableToCount],
|
|
5077
5086
|
* );
|
|
5078
|
-
* return <span>{metrics
|
|
5087
|
+
* return <span>{metrics?.getMetric('tableCount')}</span>;
|
|
5079
5088
|
* };
|
|
5080
5089
|
*
|
|
5081
5090
|
* const app = document.createElement('div');
|
|
@@ -5098,7 +5107,7 @@ export function useCreateMetrics(
|
|
|
5098
5107
|
store: Store,
|
|
5099
5108
|
create: (store: Store) => Metrics,
|
|
5100
5109
|
createDeps?: React.DependencyList,
|
|
5101
|
-
): Metrics;
|
|
5110
|
+
): Metrics | undefined;
|
|
5102
5111
|
|
|
5103
5112
|
/**
|
|
5104
5113
|
* The useMetricsIds hook is used to retrieve the Ids of all the named Metrics
|
|
@@ -5478,13 +5487,11 @@ export function useMetricListener(
|
|
|
5478
5487
|
*
|
|
5479
5488
|
* It is possible to create an Indexes object outside of the React app with the
|
|
5480
5489
|
* regular createIndexes function and pass it in, but you may prefer to create
|
|
5481
|
-
* it within the app, perhaps inside the top-level component. To
|
|
5482
|
-
*
|
|
5483
|
-
* the useCreateIndexes hook
|
|
5484
|
-
*
|
|
5485
|
-
*
|
|
5486
|
-
* hook, defaulting to the provided Store as its dependency, so that by default,
|
|
5487
|
-
* the creation only occurs once per Store.
|
|
5490
|
+
* it within the app, perhaps inside the top-level component. To prevent a new
|
|
5491
|
+
* Indexes object being created every time the app renders or re-renders, since
|
|
5492
|
+
* v5.0 the useCreateIndexes hook performs the creation in an effect. As a
|
|
5493
|
+
* result this hook will return `undefined` on the brief first render, which you
|
|
5494
|
+
* should defend against.
|
|
5488
5495
|
*
|
|
5489
5496
|
* If your `create` function contains other dependencies, the changing of which
|
|
5490
5497
|
* should also cause the Indexes object to be recreated, you can provide them in
|
|
@@ -5524,7 +5531,7 @@ export function useMetricListener(
|
|
|
5524
5531
|
* 'species',
|
|
5525
5532
|
* );
|
|
5526
5533
|
* });
|
|
5527
|
-
* return <span>{JSON.stringify(indexes
|
|
5534
|
+
* return <span>{JSON.stringify(indexes?.getSliceIds('bySpecies'))}</span>;
|
|
5528
5535
|
* };
|
|
5529
5536
|
*
|
|
5530
5537
|
* const app = document.createElement('div');
|
|
@@ -5565,7 +5572,7 @@ export function useMetricListener(
|
|
|
5565
5572
|
* },
|
|
5566
5573
|
* [cellToIndex],
|
|
5567
5574
|
* );
|
|
5568
|
-
* return <span>{JSON.stringify(indexes
|
|
5575
|
+
* return <span>{JSON.stringify(indexes?.getSliceIds('byCell'))}</span>;
|
|
5569
5576
|
* };
|
|
5570
5577
|
*
|
|
5571
5578
|
* const app = document.createElement('div');
|
|
@@ -5588,7 +5595,7 @@ export function useCreateIndexes(
|
|
|
5588
5595
|
store: Store,
|
|
5589
5596
|
create: (store: Store) => Indexes,
|
|
5590
5597
|
createDeps?: React.DependencyList,
|
|
5591
|
-
): Indexes;
|
|
5598
|
+
): Indexes | undefined;
|
|
5592
5599
|
|
|
5593
5600
|
/**
|
|
5594
5601
|
* The useIndexesIds hook is used to retrieve the Ids of all the named Indexes
|
|
@@ -6166,13 +6173,10 @@ export function useSliceRowIdsListener(
|
|
|
6166
6173
|
* It is possible to create a Relationships object outside of the React app with
|
|
6167
6174
|
* the regular createRelationships function and pass it in, but you may prefer
|
|
6168
6175
|
* to create it within the app, perhaps inside the top-level component. To
|
|
6169
|
-
*
|
|
6170
|
-
*
|
|
6171
|
-
* a
|
|
6172
|
-
*
|
|
6173
|
-
* The useCreateRelationships hook is a very thin wrapper around the React
|
|
6174
|
-
* `useMemo` hook, defaulting to the provided Store as its dependency, so that
|
|
6175
|
-
* by default, the creation only occurs once per Store.
|
|
6176
|
+
* prevent a new Relationships object being created every time the app renders
|
|
6177
|
+
* or re-renders, since v5.0 the useCreateRelationships hook performs the
|
|
6178
|
+
* creation in an effect. As a result this hook will return `undefined` on the
|
|
6179
|
+
* brief first render, which you should defend against.
|
|
6176
6180
|
*
|
|
6177
6181
|
* If your `create` function contains other dependencies, the changing of which
|
|
6178
6182
|
* should also cause the Relationships object to be recreated, you can provide
|
|
@@ -6214,7 +6218,9 @@ export function useSliceRowIdsListener(
|
|
|
6214
6218
|
* 'species',
|
|
6215
6219
|
* );
|
|
6216
6220
|
* });
|
|
6217
|
-
* return
|
|
6221
|
+
* return (
|
|
6222
|
+
* <span>{relationships?.getRemoteRowId('petSpecies', 'fido')}</span>
|
|
6223
|
+
* );
|
|
6218
6224
|
* };
|
|
6219
6225
|
*
|
|
6220
6226
|
* const app = document.createElement('div');
|
|
@@ -6260,7 +6266,9 @@ export function useSliceRowIdsListener(
|
|
|
6260
6266
|
* },
|
|
6261
6267
|
* [remoteTableAndCellToLink],
|
|
6262
6268
|
* );
|
|
6263
|
-
* return
|
|
6269
|
+
* return (
|
|
6270
|
+
* <span>{relationships?.getRemoteRowId('cellLinked', 'fido')}</span>
|
|
6271
|
+
* );
|
|
6264
6272
|
* };
|
|
6265
6273
|
*
|
|
6266
6274
|
* const app = document.createElement('div');
|
|
@@ -6283,7 +6291,7 @@ export function useCreateRelationships(
|
|
|
6283
6291
|
store: Store,
|
|
6284
6292
|
create: (store: Store) => Relationships,
|
|
6285
6293
|
createDeps?: React.DependencyList,
|
|
6286
|
-
): Relationships;
|
|
6294
|
+
): Relationships | undefined;
|
|
6287
6295
|
|
|
6288
6296
|
/**
|
|
6289
6297
|
* The useRelationshipsIds hook is used to retrieve the Ids of all the named
|
|
@@ -7129,13 +7137,11 @@ export function useLinkedRowIdsListener(
|
|
|
7129
7137
|
*
|
|
7130
7138
|
* It is possible to create a Queries object outside of the React app with the
|
|
7131
7139
|
* regular createQueries function and pass it in, but you may prefer to create
|
|
7132
|
-
* it within the app, perhaps inside the top-level component. To
|
|
7133
|
-
*
|
|
7134
|
-
* the useCreateQueries hook
|
|
7135
|
-
*
|
|
7136
|
-
*
|
|
7137
|
-
* hook, defaulting to the provided Store as its dependency, so that by default,
|
|
7138
|
-
* the creation only occurs once per Store.
|
|
7140
|
+
* it within the app, perhaps inside the top-level component. To prevent a new
|
|
7141
|
+
* Queries object being created every time the app renders or re-renders, since
|
|
7142
|
+
* v5.0 the useCreateQueries hook performs the creation in an effect. As a
|
|
7143
|
+
* result this hook will return `undefined` on the brief first render, which you
|
|
7144
|
+
* should defend against.
|
|
7139
7145
|
*
|
|
7140
7146
|
* If your `create` function contains other dependencies, the changing of which
|
|
7141
7147
|
* should also cause the Queries object to be recreated, you can provide them in
|
|
@@ -7178,7 +7184,7 @@ export function useLinkedRowIdsListener(
|
|
|
7178
7184
|
* );
|
|
7179
7185
|
* });
|
|
7180
7186
|
* return (
|
|
7181
|
-
* <span>{queries
|
|
7187
|
+
* <span>{queries?.getResultCell('dogColors', 'fido', 'color')}</span>
|
|
7182
7188
|
* );
|
|
7183
7189
|
* };
|
|
7184
7190
|
*
|
|
@@ -7220,7 +7226,7 @@ export function useLinkedRowIdsListener(
|
|
|
7220
7226
|
* );
|
|
7221
7227
|
* });
|
|
7222
7228
|
* return (
|
|
7223
|
-
* <span>{queries
|
|
7229
|
+
* <span>{queries?.getResultCell('dogColors', 'fido', 'color')}</span>
|
|
7224
7230
|
* );
|
|
7225
7231
|
* };
|
|
7226
7232
|
*
|
|
@@ -7242,7 +7248,7 @@ export function useCreateQueries(
|
|
|
7242
7248
|
store: Store,
|
|
7243
7249
|
create: (store: Store) => Queries,
|
|
7244
7250
|
createDeps?: React.DependencyList,
|
|
7245
|
-
): Queries;
|
|
7251
|
+
): Queries | undefined;
|
|
7246
7252
|
|
|
7247
7253
|
/**
|
|
7248
7254
|
* The useQueriesIds hook is used to retrieve the Ids of all the named Queries
|
|
@@ -9133,14 +9139,11 @@ export function useResultCellListener(
|
|
|
9133
9139
|
*
|
|
9134
9140
|
* It is possible to create a Checkpoints object outside of the React app with
|
|
9135
9141
|
* the regular createCheckpoints function and pass it in, but you may prefer to
|
|
9136
|
-
* create it within the app, perhaps inside the top-level component. To
|
|
9137
|
-
*
|
|
9138
|
-
* re-renders, the
|
|
9139
|
-
*
|
|
9140
|
-
*
|
|
9141
|
-
* The useCreateCheckpoints hook is a very thin wrapper around the React
|
|
9142
|
-
* `useMemo` hook, defaulting to the provided Store as its dependency, so that
|
|
9143
|
-
* by default, the creation only occurs once per Store.
|
|
9142
|
+
* create it within the app, perhaps inside the top-level component. To prevent
|
|
9143
|
+
* a new Checkpoints object being created every time the app renders or
|
|
9144
|
+
* re-renders, since v5.0 the useCreateMetrics hook performs the creation in an
|
|
9145
|
+
* effect. As a result this hook will return `undefined` on the brief first
|
|
9146
|
+
* render, which you should defend against.
|
|
9144
9147
|
*
|
|
9145
9148
|
* If your `create` function contains other dependencies, the changing of which
|
|
9146
9149
|
* should also cause the Checkpoints object to be recreated, you can provide
|
|
@@ -9170,7 +9173,7 @@ export function useResultCellListener(
|
|
|
9170
9173
|
* console.log('Checkpoints created');
|
|
9171
9174
|
* return createCheckpoints(store).setSize(10);
|
|
9172
9175
|
* });
|
|
9173
|
-
* return <span>{JSON.stringify(checkpoints
|
|
9176
|
+
* return <span>{JSON.stringify(checkpoints?.getCheckpointIds())}</span>;
|
|
9174
9177
|
* };
|
|
9175
9178
|
*
|
|
9176
9179
|
* const app = document.createElement('div');
|
|
@@ -9202,7 +9205,7 @@ export function useResultCellListener(
|
|
|
9202
9205
|
* },
|
|
9203
9206
|
* [size],
|
|
9204
9207
|
* );
|
|
9205
|
-
* return <span>{JSON.stringify(checkpoints
|
|
9208
|
+
* return <span>{JSON.stringify(checkpoints?.getCheckpointIds())}</span>;
|
|
9206
9209
|
* };
|
|
9207
9210
|
*
|
|
9208
9211
|
* const app = document.createElement('div');
|
|
@@ -9225,7 +9228,7 @@ export function useCreateCheckpoints(
|
|
|
9225
9228
|
store: Store,
|
|
9226
9229
|
create: (store: Store) => Checkpoints,
|
|
9227
9230
|
createDeps?: React.DependencyList,
|
|
9228
|
-
): Checkpoints;
|
|
9231
|
+
): Checkpoints | undefined;
|
|
9229
9232
|
|
|
9230
9233
|
/**
|
|
9231
9234
|
* The useCheckpointsIds hook is used to retrieve the Ids of all the named
|
|
@@ -10064,11 +10067,9 @@ export function useCheckpointListener(
|
|
|
10064
10067
|
*
|
|
10065
10068
|
* It is possible to create a Persister outside of the React app with the
|
|
10066
10069
|
* regular createPersister function and pass it in, but you may prefer to create
|
|
10067
|
-
* it within the app, perhaps inside the top-level component. To
|
|
10068
|
-
*
|
|
10069
|
-
*
|
|
10070
|
-
* second callback so that you can configure the Persister, once, and
|
|
10071
|
-
* asynchronously, when it is created.
|
|
10070
|
+
* it within the app, perhaps inside the top-level component. To prevent a new
|
|
10071
|
+
* Persister being created every time the app renders or re-renders, since v5.0
|
|
10072
|
+
* the useCreateMetrics hook performs the creation in an effect.
|
|
10072
10073
|
*
|
|
10073
10074
|
* If your `create` function (the second parameter to the hook) contains
|
|
10074
10075
|
* dependencies, the changing of which should cause the Persister to be
|
|
@@ -10076,19 +10077,18 @@ export function useCheckpointListener(
|
|
|
10076
10077
|
* you would for any React hook with dependencies. The Store passed in as the
|
|
10077
10078
|
* first parameter of this hook is used as a dependency by default.
|
|
10078
10079
|
*
|
|
10079
|
-
* A second `then
|
|
10080
|
-
* called after the creation, and, importantly, can be asynchronous, so
|
|
10081
|
-
* can configure the Persister with the startAutoLoad method and
|
|
10082
|
-
* method, for example. If this callback contains dependencies,
|
|
10083
|
-
* which should cause the Persister to be reconfigured, you can
|
|
10084
|
-
* an array in the fifth parameter. The Persister itself is used
|
|
10085
|
-
* by default.
|
|
10080
|
+
* A second callback, called `then`, can be provided as the fourth parameter.
|
|
10081
|
+
* This is called after the creation, and, importantly, can be asynchronous, so
|
|
10082
|
+
* that you can configure the Persister with the startAutoLoad method and
|
|
10083
|
+
* startAutoSave method, for example. If this callback contains dependencies,
|
|
10084
|
+
* the changing of which should cause the Persister to be reconfigured, you can
|
|
10085
|
+
* provide them in an array in the fifth parameter. The Persister itself is used
|
|
10086
|
+
* as a dependency by default.
|
|
10086
10087
|
*
|
|
10087
10088
|
* Since v4.3.0, the `create` function can return undefined, meaning that you
|
|
10088
10089
|
* can enable or disable persistence conditionally within this hook. This is
|
|
10089
10090
|
* useful for applications which might turn on or off their cloud persistence or
|
|
10090
|
-
* collaboration features.
|
|
10091
|
-
* undefined, which you should handle accordingly.
|
|
10091
|
+
* collaboration features.
|
|
10092
10092
|
*
|
|
10093
10093
|
* Since v4.3.19, a `destroy` function can be provided which will be called
|
|
10094
10094
|
* after an old Persister is destroyed due to a change in the `createDeps`
|
|
@@ -10225,12 +10225,152 @@ export function useCreatePersister<
|
|
|
10225
10225
|
store: Store,
|
|
10226
10226
|
create: (store: Store) => PersisterOrUndefined,
|
|
10227
10227
|
createDeps?: React.DependencyList,
|
|
10228
|
-
then?: (persister:
|
|
10228
|
+
then?: (persister: Persister) => Promise<void>,
|
|
10229
10229
|
thenDeps?: React.DependencyList,
|
|
10230
|
-
destroy?: (persister:
|
|
10230
|
+
destroy?: (persister: Persister) => void,
|
|
10231
10231
|
destroyDeps?: React.DependencyList,
|
|
10232
10232
|
): PersisterOrUndefined;
|
|
10233
10233
|
|
|
10234
|
+
/**
|
|
10235
|
+
* The useCreateSynchronizer hook is used to create a Synchronizer within a
|
|
10236
|
+
* React application along with convenient memoization and callbacks.
|
|
10237
|
+
*
|
|
10238
|
+
* It is possible to create a Synchronizer outside of the React app with the
|
|
10239
|
+
* regular createSynchronizer function and pass it in, but you may prefer to
|
|
10240
|
+
* create it within the app, perhaps inside the top-level component. To prevent
|
|
10241
|
+
* a new Synchronizer being created every time the app renders or re-renders,
|
|
10242
|
+
* the useCreateMetrics hook performs the creation in an effect.
|
|
10243
|
+
*
|
|
10244
|
+
* If your asynchronous `create` function (the second parameter to the hook)
|
|
10245
|
+
* contains dependencies, the changing of which should cause the Synchronizer to
|
|
10246
|
+
* be recreated, you can provide them in an array in the third parameter, just
|
|
10247
|
+
* as you would for any React hook with dependencies. The MergeableStore passed
|
|
10248
|
+
* in as the first parameter of this hook is used as a dependency by default.
|
|
10249
|
+
*
|
|
10250
|
+
* A second callback, called `then`, can be provided as the fourth parameter.
|
|
10251
|
+
* This is called after the creation, and can also be asynchronous, so that you
|
|
10252
|
+
* can configure the Synchronizer with the startSync method, for example. If
|
|
10253
|
+
* this callback contains dependencies, the changing of which should cause the
|
|
10254
|
+
* Synchronizer to be reconfigured, you can provide them in an array in the
|
|
10255
|
+
* fifth parameter. The Synchronizer itself is used as a dependency by default.
|
|
10256
|
+
*
|
|
10257
|
+
* The `create` function can return undefined, meaning that you can enable or
|
|
10258
|
+
* disable synchronization conditionally within this hook. This is useful for
|
|
10259
|
+
* applications which might turn on or off their cloud synchronization or
|
|
10260
|
+
* collaboration features.
|
|
10261
|
+
*
|
|
10262
|
+
* This hook ensures the Synchronizer object is destroyed whenever a new one is
|
|
10263
|
+
* created or the component is unmounted.
|
|
10264
|
+
* @param store A reference to the MergeableStore for which to create a new
|
|
10265
|
+
* Synchronizer object.
|
|
10266
|
+
* @param create An asynchronous function for performing the creation steps of
|
|
10267
|
+
* the Synchronizer object for the Store.
|
|
10268
|
+
* @param createDeps An optional array of dependencies for the `create`
|
|
10269
|
+
* function, which, if any change, result in its rerun. This parameter defaults
|
|
10270
|
+
* to an empty array.
|
|
10271
|
+
* @param then An optional callback for performing asynchronous post-creation
|
|
10272
|
+
* steps on the Synchronizer, such as starting automatic synchronization.
|
|
10273
|
+
* @param thenDeps An optional array of dependencies for the `then` callback,
|
|
10274
|
+
* which, if any change, result in its rerun. This parameter defaults to an
|
|
10275
|
+
* empty array.
|
|
10276
|
+
* @param destroy An optional callback whenever the Synchronizer is destroyed
|
|
10277
|
+
* due to a change in the `createDeps` dependencies.
|
|
10278
|
+
* @param destroyDeps An optional array of dependencies for the `destroy`
|
|
10279
|
+
* callback, which, if any change, result in `destroy` and `then` being rerun.
|
|
10280
|
+
* This parameter defaults to an empty array.
|
|
10281
|
+
* @returns A reference to the Synchronizer.
|
|
10282
|
+
* @example
|
|
10283
|
+
* This example creates a Synchronizer at the top level of a React application.
|
|
10284
|
+
* Even though the App component is rendered twice, the Synchronizer creation
|
|
10285
|
+
* only occurs once by default.
|
|
10286
|
+
*
|
|
10287
|
+
* ```jsx
|
|
10288
|
+
* const App = () => {
|
|
10289
|
+
* const store = useCreateMergeableStore(() => createMergeableStore('s1'));
|
|
10290
|
+
* const synchronizer = useCreateSynchronizer(store, async (store) => {
|
|
10291
|
+
* console.log('Synchronizer created');
|
|
10292
|
+
* return await createLocalSynchronizer(store, 'pets');
|
|
10293
|
+
* });
|
|
10294
|
+
* return <span>{JSON.stringify(useTables(store))}</span>;
|
|
10295
|
+
* };
|
|
10296
|
+
*
|
|
10297
|
+
* const app = document.createElement('div');
|
|
10298
|
+
* const root = ReactDOMClient.createRoot(app);
|
|
10299
|
+
* root.render(<App />); // !act
|
|
10300
|
+
* // -> 'Synchronizer created'
|
|
10301
|
+
*
|
|
10302
|
+
* // ... // !act
|
|
10303
|
+
* root.render(<App />); // !act
|
|
10304
|
+
* // No second Synchronizer creation
|
|
10305
|
+
*
|
|
10306
|
+
* root.unmount(); // !act
|
|
10307
|
+
* ```
|
|
10308
|
+
* @example
|
|
10309
|
+
* This example creates a Synchronizer at the top level of a React application.
|
|
10310
|
+
* The App component is rendered twice, each with a different top-level prop.
|
|
10311
|
+
* The useCreateSynchronizer hook takes the `url` prop as a dependency, and so
|
|
10312
|
+
* the Synchronizer object is created again on the second render. The first is
|
|
10313
|
+
* destroyed and the `destroy` parameter is called for it. A `then` parameter
|
|
10314
|
+
* is provided to start both Synchronizers' synchronization.
|
|
10315
|
+
*
|
|
10316
|
+
* ```jsx
|
|
10317
|
+
* const server1 = createWsServer(new ws.WebSocketServer({port: 8044}));
|
|
10318
|
+
* const server2 = createWsServer(new ws.WebSocketServer({port: 8045}));
|
|
10319
|
+
*
|
|
10320
|
+
* const App = ({url}) => {
|
|
10321
|
+
* const store = useCreateMergeableStore(() => createMergeableStore('s1'));
|
|
10322
|
+
* const synchronizer = useCreateSynchronizer(
|
|
10323
|
+
* store,
|
|
10324
|
+
* async (store) => {
|
|
10325
|
+
* const webSocket = new WebSocket(url);
|
|
10326
|
+
* console.log(`Synchronizer created for ${webSocket.url}`);
|
|
10327
|
+
* return await createWsSynchronizer(store, webSocket);
|
|
10328
|
+
* },
|
|
10329
|
+
* [url],
|
|
10330
|
+
* async (synchronizer) => {
|
|
10331
|
+
* await synchronizer.startSync();
|
|
10332
|
+
* },
|
|
10333
|
+
* [],
|
|
10334
|
+
* (synchronizer) => {
|
|
10335
|
+
* const webSocket = synchronizer.getWebSocket();
|
|
10336
|
+
* console.log(`Synchronizer destroyed for ${webSocket.url}`);
|
|
10337
|
+
* },
|
|
10338
|
+
* );
|
|
10339
|
+
* return <span>{JSON.stringify(useTables(store))}</span>;
|
|
10340
|
+
* };
|
|
10341
|
+
*
|
|
10342
|
+
* const app = document.createElement('div');
|
|
10343
|
+
* const root = ReactDOMClient.createRoot(app);
|
|
10344
|
+
* root.render(<App url="ws://localhost:8044/" />); // !act
|
|
10345
|
+
* // ... // !act
|
|
10346
|
+
* // -> 'Synchronizer created for ws://localhost:8044/'
|
|
10347
|
+
*
|
|
10348
|
+
* root.render(<App url="ws://localhost:8045/" />); // !act
|
|
10349
|
+
* // ... // !act
|
|
10350
|
+
* // -> 'Synchronizer created for ws://localhost:8045/'
|
|
10351
|
+
* // -> 'Synchronizer destroyed for ws://localhost:8044/'
|
|
10352
|
+
*
|
|
10353
|
+
* root.unmount(); // !act
|
|
10354
|
+
* // -> 'Synchronizer destroyed for ws://localhost:8045/'
|
|
10355
|
+
*
|
|
10356
|
+
* server1.destroy();
|
|
10357
|
+
* server2.destroy();
|
|
10358
|
+
* ```
|
|
10359
|
+
* @category Synchronizer hooks
|
|
10360
|
+
* @since v5.0.0
|
|
10361
|
+
*/
|
|
10362
|
+
export function useCreateSynchronizer<
|
|
10363
|
+
SynchronizerOrUndefined extends Synchronizer | undefined,
|
|
10364
|
+
>(
|
|
10365
|
+
store: MergeableStore,
|
|
10366
|
+
create: (store: MergeableStore) => Promise<SynchronizerOrUndefined>,
|
|
10367
|
+
createDeps?: React.DependencyList,
|
|
10368
|
+
then?: (synchronizer: Synchronizer) => Promise<void>,
|
|
10369
|
+
thenDeps?: React.DependencyList,
|
|
10370
|
+
destroy?: (synchronizer: Synchronizer) => void,
|
|
10371
|
+
destroyDeps?: React.DependencyList,
|
|
10372
|
+
): SynchronizerOrUndefined;
|
|
10373
|
+
|
|
10234
10374
|
/**
|
|
10235
10375
|
* The ExtraProps type represents a set of arbitrary additional props.
|
|
10236
10376
|
* @category Props
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* @module checkpoints
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {Id, IdOrNull, Ids} from './common.d';
|
|
14
|
-
import {OptionalSchemas, Store} from './store.d';
|
|
13
|
+
import {Id, IdOrNull, Ids} from './common.d.ts';
|
|
14
|
+
import {OptionalSchemas, Store} from './store.d.ts';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* The CheckpointIds type is a representation of the list of checkpoint Ids
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
OptionalTablesSchema,
|
|
18
18
|
RowCallback,
|
|
19
19
|
Store,
|
|
20
|
-
} from './store.d';
|
|
21
|
-
import {Id, IdOrNull, Ids, SortKey} from './common.d';
|
|
20
|
+
} from './store.d.ts';
|
|
21
|
+
import {Id, IdOrNull, Ids, SortKey} from './common.d.ts';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* The Index type represents the concept of a map of Slice objects, keyed by Id.
|
|
@@ -8,8 +8,9 @@ export type JoinedCellIdOrId<
|
|
|
8
8
|
JoinedTableId extends TableIdFromSchema<Schema> | Id =
|
|
9
9
|
| TableIdFromSchema<Schema>
|
|
10
10
|
| Id,
|
|
11
|
-
> =
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
> =
|
|
12
|
+
JoinedTableId extends TableIdFromSchema<Schema>
|
|
13
|
+
? CellIdFromSchema<Schema, JoinedTableId>
|
|
14
|
+
: Id;
|
|
14
15
|
|
|
15
16
|
export type GetResultCell = (cellId: Id) => ResultCell;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Cell,
|
|
3
|
+
OptionalSchemas,
|
|
3
4
|
OptionalTablesSchema,
|
|
4
5
|
OptionalValuesSchema,
|
|
6
|
+
Store,
|
|
5
7
|
Value,
|
|
6
8
|
} from '../store';
|
|
7
9
|
import {Id} from '../common';
|
|
@@ -34,9 +36,10 @@ export type DefaultCellIdFromSchema<
|
|
|
34
36
|
export type AllCellIdFromSchema<
|
|
35
37
|
Schema extends OptionalTablesSchema,
|
|
36
38
|
TableId extends TableIdFromSchema<Schema> = TableIdFromSchema<Schema>,
|
|
37
|
-
> =
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
> =
|
|
40
|
+
TableId extends TableIdFromSchema<Schema>
|
|
41
|
+
? CellIdFromSchema<Schema, TableId>
|
|
42
|
+
: never;
|
|
40
43
|
|
|
41
44
|
export type CellIsDefaultedFromSchema<
|
|
42
45
|
Schema extends OptionalTablesSchema,
|
|
@@ -99,3 +102,5 @@ export type Truncate<Params> = Params extends [...infer ShorterParams, any]
|
|
|
99
102
|
: never;
|
|
100
103
|
|
|
101
104
|
export type NoInfer<Type> = [Type][Type extends any ? 0 : never];
|
|
105
|
+
|
|
106
|
+
export type StoreAlias<Schemas extends OptionalSchemas> = Store<Schemas>;
|