@powerhousedao/reactor-browser 6.0.0-dev.23 → 6.0.0-dev.231
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/README.md +6 -3
- package/dist/client-DfoxBz8A.js +862 -0
- package/dist/client-DfoxBz8A.js.map +1 -0
- package/dist/client-DhQo2Vi9.d.ts +804 -0
- package/dist/client-DhQo2Vi9.d.ts.map +1 -0
- package/dist/document-by-id-CDLUqru5.js +441 -0
- package/dist/document-by-id-CDLUqru5.js.map +1 -0
- package/dist/index-Ce4S7Kk1.d.ts +726 -0
- package/dist/index-Ce4S7Kk1.d.ts.map +1 -0
- package/dist/index-DgwLcoI3.d.ts +343 -0
- package/dist/index-DgwLcoI3.d.ts.map +1 -0
- package/dist/index.d.ts +1507 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3249 -0
- package/dist/index.js.map +1 -0
- package/dist/make-ph-event-functions-Cr4GqOTT.js +57 -0
- package/dist/make-ph-event-functions-Cr4GqOTT.js.map +1 -0
- package/dist/relational-jwreqDwz.js +123 -0
- package/dist/relational-jwreqDwz.js.map +1 -0
- package/dist/renown-CV_45Xc1.js +1014 -0
- package/dist/renown-CV_45Xc1.js.map +1 -0
- package/dist/src/analytics/index.d.ts +112 -2
- package/dist/src/analytics/index.d.ts.map +1 -1
- package/dist/src/analytics/index.js +342 -2
- package/dist/src/analytics/index.js.map +1 -1
- package/dist/src/graphql/client.d.ts +2 -0
- package/dist/src/graphql/client.js +2 -0
- package/dist/src/relational/index.d.ts +2 -3
- package/dist/src/relational/index.js +2 -3
- package/dist/src/renown/index.d.ts +2 -3
- package/dist/src/renown/index.js +2 -3
- package/dist/types-BmR60pPN.d.ts +22 -0
- package/dist/types-BmR60pPN.d.ts.map +1 -0
- package/package.json +58 -48
- package/dist/src/actions/dispatch.d.ts +0 -18
- package/dist/src/actions/dispatch.d.ts.map +0 -1
- package/dist/src/actions/dispatch.js +0 -47
- package/dist/src/actions/dispatch.js.map +0 -1
- package/dist/src/actions/document.d.ts +0 -20
- package/dist/src/actions/document.d.ts.map +0 -1
- package/dist/src/actions/document.js +0 -711
- package/dist/src/actions/document.js.map +0 -1
- package/dist/src/actions/drive.d.ts +0 -12
- package/dist/src/actions/drive.d.ts.map +0 -1
- package/dist/src/actions/drive.js +0 -256
- package/dist/src/actions/drive.js.map +0 -1
- package/dist/src/actions/index.d.ts +0 -4
- package/dist/src/actions/index.d.ts.map +0 -1
- package/dist/src/actions/index.js +0 -4
- package/dist/src/actions/index.js.map +0 -1
- package/dist/src/actions/queue.d.ts +0 -10
- package/dist/src/actions/queue.d.ts.map +0 -1
- package/dist/src/actions/queue.js +0 -160
- package/dist/src/actions/queue.js.map +0 -1
- package/dist/src/actions/sign.d.ts +0 -5
- package/dist/src/actions/sign.d.ts.map +0 -1
- package/dist/src/actions/sign.js +0 -71
- package/dist/src/actions/sign.js.map +0 -1
- package/dist/src/analytics/context.d.ts +0 -33
- package/dist/src/analytics/context.d.ts.map +0 -1
- package/dist/src/analytics/context.js +0 -148
- package/dist/src/analytics/context.js.map +0 -1
- package/dist/src/analytics/hooks/analytics-query.d.ts +0 -31
- package/dist/src/analytics/hooks/analytics-query.d.ts.map +0 -1
- package/dist/src/analytics/hooks/analytics-query.js +0 -157
- package/dist/src/analytics/hooks/analytics-query.js.map +0 -1
- package/dist/src/analytics/hooks/document-timeline.d.ts +0 -19
- package/dist/src/analytics/hooks/document-timeline.d.ts.map +0 -1
- package/dist/src/analytics/hooks/document-timeline.js +0 -10
- package/dist/src/analytics/hooks/document-timeline.js.map +0 -1
- package/dist/src/analytics/hooks/index.d.ts +0 -4
- package/dist/src/analytics/hooks/index.d.ts.map +0 -1
- package/dist/src/analytics/hooks/index.js +0 -4
- package/dist/src/analytics/hooks/index.js.map +0 -1
- package/dist/src/analytics/hooks/timeline-items.d.ts +0 -25
- package/dist/src/analytics/hooks/timeline-items.d.ts.map +0 -1
- package/dist/src/analytics/hooks/timeline-items.js +0 -104
- package/dist/src/analytics/hooks/timeline-items.js.map +0 -1
- package/dist/src/analytics/store/browser.d.ts +0 -2
- package/dist/src/analytics/store/browser.d.ts.map +0 -1
- package/dist/src/analytics/store/browser.js +0 -2
- package/dist/src/analytics/store/browser.js.map +0 -1
- package/dist/src/analytics/store/memory.d.ts +0 -2
- package/dist/src/analytics/store/memory.d.ts.map +0 -1
- package/dist/src/analytics/store/memory.js +0 -2
- package/dist/src/analytics/store/memory.js.map +0 -1
- package/dist/src/analytics/types.d.ts +0 -9
- package/dist/src/analytics/types.d.ts.map +0 -1
- package/dist/src/analytics/types.js +0 -2
- package/dist/src/analytics/types.js.map +0 -1
- package/dist/src/analytics.d.ts +0 -3
- package/dist/src/analytics.d.ts.map +0 -1
- package/dist/src/analytics.js +0 -3
- package/dist/src/analytics.js.map +0 -1
- package/dist/src/connect.d.ts +0 -2
- package/dist/src/connect.d.ts.map +0 -1
- package/dist/src/connect.js +0 -2
- package/dist/src/connect.js.map +0 -1
- package/dist/src/constants.d.ts +0 -3
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/constants.js +0 -3
- package/dist/src/constants.js.map +0 -1
- package/dist/src/context/index.d.ts +0 -2
- package/dist/src/context/index.d.ts.map +0 -1
- package/dist/src/context/index.js +0 -2
- package/dist/src/context/index.js.map +0 -1
- package/dist/src/context/read-mode.d.ts +0 -14
- package/dist/src/context/read-mode.d.ts.map +0 -1
- package/dist/src/context/read-mode.js +0 -177
- package/dist/src/context/read-mode.js.map +0 -1
- package/dist/src/document-cache.d.ts +0 -17
- package/dist/src/document-cache.d.ts.map +0 -1
- package/dist/src/document-cache.js +0 -143
- package/dist/src/document-cache.js.map +0 -1
- package/dist/src/document-model.d.ts +0 -4
- package/dist/src/document-model.d.ts.map +0 -1
- package/dist/src/document-model.js +0 -6
- package/dist/src/document-model.js.map +0 -1
- package/dist/src/errors.d.ts +0 -16
- package/dist/src/errors.d.ts.map +0 -1
- package/dist/src/errors.js +0 -27
- package/dist/src/errors.js.map +0 -1
- package/dist/src/global/core.d.ts +0 -5
- package/dist/src/global/core.d.ts.map +0 -1
- package/dist/src/global/core.js +0 -22
- package/dist/src/global/core.js.map +0 -1
- package/dist/src/global/index.d.ts +0 -2
- package/dist/src/global/index.d.ts.map +0 -1
- package/dist/src/global/index.js +0 -2
- package/dist/src/global/index.js.map +0 -1
- package/dist/src/global/types.d.ts +0 -17
- package/dist/src/global/types.d.ts.map +0 -1
- package/dist/src/global/types.js +0 -2
- package/dist/src/global/types.js.map +0 -1
- package/dist/src/hooks/add-ph-event-handlers.d.ts +0 -2
- package/dist/src/hooks/add-ph-event-handlers.d.ts.map +0 -1
- package/dist/src/hooks/add-ph-event-handlers.js +0 -109
- package/dist/src/hooks/add-ph-event-handlers.js.map +0 -1
- package/dist/src/hooks/allowed-document-model-modules.d.ts +0 -2
- package/dist/src/hooks/allowed-document-model-modules.d.ts.map +0 -1
- package/dist/src/hooks/allowed-document-model-modules.js +0 -10
- package/dist/src/hooks/allowed-document-model-modules.js.map +0 -1
- package/dist/src/hooks/child-nodes.d.ts +0 -4
- package/dist/src/hooks/child-nodes.d.ts.map +0 -1
- package/dist/src/hooks/child-nodes.js +0 -15
- package/dist/src/hooks/child-nodes.js.map +0 -1
- package/dist/src/hooks/config/connect.d.ts +0 -96
- package/dist/src/hooks/config/connect.d.ts.map +0 -1
- package/dist/src/hooks/config/connect.js +0 -210
- package/dist/src/hooks/config/connect.js.map +0 -1
- package/dist/src/hooks/config/editor.d.ts +0 -32
- package/dist/src/hooks/config/editor.d.ts.map +0 -1
- package/dist/src/hooks/config/editor.js +0 -43
- package/dist/src/hooks/config/editor.js.map +0 -1
- package/dist/src/hooks/config/set-config-by-key.d.ts +0 -5
- package/dist/src/hooks/config/set-config-by-key.d.ts.map +0 -1
- package/dist/src/hooks/config/set-config-by-key.js +0 -15
- package/dist/src/hooks/config/set-config-by-key.js.map +0 -1
- package/dist/src/hooks/config/set-config-by-object.d.ts +0 -31
- package/dist/src/hooks/config/set-config-by-object.d.ts.map +0 -1
- package/dist/src/hooks/config/set-config-by-object.js +0 -84
- package/dist/src/hooks/config/set-config-by-object.js.map +0 -1
- package/dist/src/hooks/config/use-value-by-key.d.ts +0 -13
- package/dist/src/hooks/config/use-value-by-key.d.ts.map +0 -1
- package/dist/src/hooks/config/use-value-by-key.js +0 -23
- package/dist/src/hooks/config/use-value-by-key.js.map +0 -1
- package/dist/src/hooks/config/utils.d.ts +0 -3
- package/dist/src/hooks/config/utils.d.ts.map +0 -1
- package/dist/src/hooks/config/utils.js +0 -6
- package/dist/src/hooks/config/utils.js.map +0 -1
- package/dist/src/hooks/connect.d.ts +0 -16
- package/dist/src/hooks/connect.d.ts.map +0 -1
- package/dist/src/hooks/connect.js +0 -16
- package/dist/src/hooks/connect.js.map +0 -1
- package/dist/src/hooks/crypto.d.ts +0 -9
- package/dist/src/hooks/crypto.d.ts.map +0 -1
- package/dist/src/hooks/crypto.js +0 -13
- package/dist/src/hooks/crypto.js.map +0 -1
- package/dist/src/hooks/did.d.ts +0 -2
- package/dist/src/hooks/did.d.ts.map +0 -1
- package/dist/src/hooks/did.js +0 -3
- package/dist/src/hooks/did.js.map +0 -1
- package/dist/src/hooks/dispatch.d.ts +0 -9
- package/dist/src/hooks/dispatch.d.ts.map +0 -1
- package/dist/src/hooks/dispatch.js +0 -20
- package/dist/src/hooks/dispatch.js.map +0 -1
- package/dist/src/hooks/document-by-id.d.ts +0 -6
- package/dist/src/hooks/document-by-id.d.ts.map +0 -1
- package/dist/src/hooks/document-by-id.js +0 -13
- package/dist/src/hooks/document-by-id.js.map +0 -1
- package/dist/src/hooks/document-cache.d.ts +0 -76
- package/dist/src/hooks/document-cache.d.ts.map +0 -1
- package/dist/src/hooks/document-cache.js +0 -124
- package/dist/src/hooks/document-cache.js.map +0 -1
- package/dist/src/hooks/document-model-modules.d.ts +0 -4
- package/dist/src/hooks/document-model-modules.d.ts.map +0 -1
- package/dist/src/hooks/document-model-modules.js +0 -10
- package/dist/src/hooks/document-model-modules.js.map +0 -1
- package/dist/src/hooks/document-of-type.d.ts +0 -5
- package/dist/src/hooks/document-of-type.d.ts.map +0 -1
- package/dist/src/hooks/document-of-type.js +0 -22
- package/dist/src/hooks/document-of-type.js.map +0 -1
- package/dist/src/hooks/document-types.d.ts +0 -7
- package/dist/src/hooks/document-types.d.ts.map +0 -1
- package/dist/src/hooks/document-types.js +0 -13
- package/dist/src/hooks/document-types.js.map +0 -1
- package/dist/src/hooks/drive-by-id.d.ts +0 -4
- package/dist/src/hooks/drive-by-id.d.ts.map +0 -1
- package/dist/src/hooks/drive-by-id.js +0 -12
- package/dist/src/hooks/drive-by-id.js.map +0 -1
- package/dist/src/hooks/drives.d.ts +0 -9
- package/dist/src/hooks/drives.d.ts.map +0 -1
- package/dist/src/hooks/drives.js +0 -9
- package/dist/src/hooks/drives.js.map +0 -1
- package/dist/src/hooks/editor-modules.d.ts +0 -9
- package/dist/src/hooks/editor-modules.d.ts.map +0 -1
- package/dist/src/hooks/editor-modules.js +0 -43
- package/dist/src/hooks/editor-modules.js.map +0 -1
- package/dist/src/hooks/features.d.ts +0 -5
- package/dist/src/hooks/features.d.ts.map +0 -1
- package/dist/src/hooks/features.js +0 -6
- package/dist/src/hooks/features.js.map +0 -1
- package/dist/src/hooks/folder-by-id.d.ts +0 -3
- package/dist/src/hooks/folder-by-id.d.ts.map +0 -1
- package/dist/src/hooks/folder-by-id.js +0 -6
- package/dist/src/hooks/folder-by-id.js.map +0 -1
- package/dist/src/hooks/import-script-modules.d.ts +0 -3
- package/dist/src/hooks/import-script-modules.d.ts.map +0 -1
- package/dist/src/hooks/import-script-modules.js +0 -6
- package/dist/src/hooks/import-script-modules.js.map +0 -1
- package/dist/src/hooks/index.d.ts +0 -41
- package/dist/src/hooks/index.d.ts.map +0 -1
- package/dist/src/hooks/index.js +0 -41
- package/dist/src/hooks/index.js.map +0 -1
- package/dist/src/hooks/items-in-selected-drive.d.ts +0 -13
- package/dist/src/hooks/items-in-selected-drive.d.ts.map +0 -1
- package/dist/src/hooks/items-in-selected-drive.js +0 -35
- package/dist/src/hooks/items-in-selected-drive.js.map +0 -1
- package/dist/src/hooks/items-in-selected-folder.d.ts +0 -11
- package/dist/src/hooks/items-in-selected-folder.d.ts.map +0 -1
- package/dist/src/hooks/items-in-selected-folder.js +0 -33
- package/dist/src/hooks/items-in-selected-folder.js.map +0 -1
- package/dist/src/hooks/loading.d.ts +0 -2
- package/dist/src/hooks/loading.d.ts.map +0 -1
- package/dist/src/hooks/loading.js +0 -3
- package/dist/src/hooks/loading.js.map +0 -1
- package/dist/src/hooks/login-status.d.ts +0 -2
- package/dist/src/hooks/login-status.d.ts.map +0 -1
- package/dist/src/hooks/login-status.js +0 -3
- package/dist/src/hooks/login-status.js.map +0 -1
- package/dist/src/hooks/make-ph-event-functions.d.ts +0 -7
- package/dist/src/hooks/make-ph-event-functions.d.ts.map +0 -1
- package/dist/src/hooks/make-ph-event-functions.js +0 -46
- package/dist/src/hooks/make-ph-event-functions.js.map +0 -1
- package/dist/src/hooks/modals.d.ts +0 -17
- package/dist/src/hooks/modals.d.ts.map +0 -1
- package/dist/src/hooks/modals.js +0 -26
- package/dist/src/hooks/modals.js.map +0 -1
- package/dist/src/hooks/node-actions.d.ts +0 -12
- package/dist/src/hooks/node-actions.d.ts.map +0 -1
- package/dist/src/hooks/node-actions.js +0 -108
- package/dist/src/hooks/node-actions.js.map +0 -1
- package/dist/src/hooks/node-by-id.d.ts +0 -4
- package/dist/src/hooks/node-by-id.d.ts.map +0 -1
- package/dist/src/hooks/node-by-id.js +0 -7
- package/dist/src/hooks/node-by-id.js.map +0 -1
- package/dist/src/hooks/node-path.d.ts +0 -6
- package/dist/src/hooks/node-path.d.ts.map +0 -1
- package/dist/src/hooks/node-path.js +0 -23
- package/dist/src/hooks/node-path.js.map +0 -1
- package/dist/src/hooks/parent-folder.d.ts +0 -4
- package/dist/src/hooks/parent-folder.d.ts.map +0 -1
- package/dist/src/hooks/parent-folder.js +0 -13
- package/dist/src/hooks/parent-folder.js.map +0 -1
- package/dist/src/hooks/processor-manager.d.ts +0 -9
- package/dist/src/hooks/processor-manager.d.ts.map +0 -1
- package/dist/src/hooks/processor-manager.js +0 -9
- package/dist/src/hooks/processor-manager.js.map +0 -1
- package/dist/src/hooks/processor-modules.d.ts +0 -4
- package/dist/src/hooks/processor-modules.d.ts.map +0 -1
- package/dist/src/hooks/processor-modules.js +0 -12
- package/dist/src/hooks/processor-modules.js.map +0 -1
- package/dist/src/hooks/reactor.d.ts +0 -42
- package/dist/src/hooks/reactor.d.ts.map +0 -1
- package/dist/src/hooks/reactor.js +0 -44
- package/dist/src/hooks/reactor.js.map +0 -1
- package/dist/src/hooks/renown.d.ts +0 -8
- package/dist/src/hooks/renown.d.ts.map +0 -1
- package/dist/src/hooks/renown.js +0 -9
- package/dist/src/hooks/renown.js.map +0 -1
- package/dist/src/hooks/revision-history.d.ts +0 -11
- package/dist/src/hooks/revision-history.d.ts.map +0 -1
- package/dist/src/hooks/revision-history.js +0 -17
- package/dist/src/hooks/revision-history.js.map +0 -1
- package/dist/src/hooks/selected-document.d.ts +0 -12
- package/dist/src/hooks/selected-document.d.ts.map +0 -1
- package/dist/src/hooks/selected-document.js +0 -35
- package/dist/src/hooks/selected-document.js.map +0 -1
- package/dist/src/hooks/selected-drive.d.ts +0 -13
- package/dist/src/hooks/selected-drive.d.ts.map +0 -1
- package/dist/src/hooks/selected-drive.js +0 -63
- package/dist/src/hooks/selected-drive.js.map +0 -1
- package/dist/src/hooks/selected-folder.d.ts +0 -4
- package/dist/src/hooks/selected-folder.d.ts.map +0 -1
- package/dist/src/hooks/selected-folder.js +0 -10
- package/dist/src/hooks/selected-folder.js.map +0 -1
- package/dist/src/hooks/selected-node.d.ts +0 -9
- package/dist/src/hooks/selected-node.d.ts.map +0 -1
- package/dist/src/hooks/selected-node.js +0 -54
- package/dist/src/hooks/selected-node.js.map +0 -1
- package/dist/src/hooks/selected-timeline-item.d.ts +0 -7
- package/dist/src/hooks/selected-timeline-item.d.ts.map +0 -1
- package/dist/src/hooks/selected-timeline-item.js +0 -9
- package/dist/src/hooks/selected-timeline-item.js.map +0 -1
- package/dist/src/hooks/subgraph-modules.d.ts +0 -3
- package/dist/src/hooks/subgraph-modules.d.ts.map +0 -1
- package/dist/src/hooks/subgraph-modules.js +0 -6
- package/dist/src/hooks/subgraph-modules.js.map +0 -1
- package/dist/src/hooks/supported-document-types.d.ts +0 -3
- package/dist/src/hooks/supported-document-types.d.ts.map +0 -1
- package/dist/src/hooks/supported-document-types.js +0 -7
- package/dist/src/hooks/supported-document-types.js.map +0 -1
- package/dist/src/hooks/timeline-revision.d.ts +0 -7
- package/dist/src/hooks/timeline-revision.d.ts.map +0 -1
- package/dist/src/hooks/timeline-revision.js +0 -9
- package/dist/src/hooks/timeline-revision.js.map +0 -1
- package/dist/src/hooks/toast.d.ts +0 -7
- package/dist/src/hooks/toast.d.ts.map +0 -1
- package/dist/src/hooks/toast.js +0 -9
- package/dist/src/hooks/toast.js.map +0 -1
- package/dist/src/hooks/use-feature-flags.d.ts +0 -36
- package/dist/src/hooks/use-feature-flags.d.ts.map +0 -1
- package/dist/src/hooks/use-feature-flags.js +0 -73
- package/dist/src/hooks/use-feature-flags.js.map +0 -1
- package/dist/src/hooks/use-get-switchboard-link.d.ts +0 -14
- package/dist/src/hooks/use-get-switchboard-link.d.ts.map +0 -1
- package/dist/src/hooks/use-get-switchboard-link.js +0 -38
- package/dist/src/hooks/use-get-switchboard-link.js.map +0 -1
- package/dist/src/hooks/use-on-drop-file.d.ts +0 -3
- package/dist/src/hooks/use-on-drop-file.d.ts.map +0 -1
- package/dist/src/hooks/use-on-drop-file.js +0 -21
- package/dist/src/hooks/use-on-drop-file.js.map +0 -1
- package/dist/src/hooks/user-permissions.d.ts +0 -5
- package/dist/src/hooks/user-permissions.d.ts.map +0 -1
- package/dist/src/hooks/user-permissions.js +0 -17
- package/dist/src/hooks/user-permissions.js.map +0 -1
- package/dist/src/hooks/user.d.ts +0 -8
- package/dist/src/hooks/user.d.ts.map +0 -1
- package/dist/src/hooks/user.js +0 -9
- package/dist/src/hooks/user.js.map +0 -1
- package/dist/src/hooks/vetra-packages.d.ts +0 -8
- package/dist/src/hooks/vetra-packages.d.ts.map +0 -1
- package/dist/src/hooks/vetra-packages.js +0 -17
- package/dist/src/hooks/vetra-packages.js.map +0 -1
- package/dist/src/index.d.ts +0 -15
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -15
- package/dist/src/index.js.map +0 -1
- package/dist/src/pglite/drop.d.ts +0 -3
- package/dist/src/pglite/drop.d.ts.map +0 -1
- package/dist/src/pglite/drop.js +0 -19
- package/dist/src/pglite/drop.js.map +0 -1
- package/dist/src/pglite/hooks/index.d.ts +0 -2
- package/dist/src/pglite/hooks/index.d.ts.map +0 -1
- package/dist/src/pglite/hooks/index.js +0 -2
- package/dist/src/pglite/hooks/index.js.map +0 -1
- package/dist/src/pglite/hooks/usePGlite.d.ts +0 -11
- package/dist/src/pglite/hooks/usePGlite.d.ts.map +0 -1
- package/dist/src/pglite/hooks/usePGlite.js +0 -37
- package/dist/src/pglite/hooks/usePGlite.js.map +0 -1
- package/dist/src/pglite/index.d.ts +0 -3
- package/dist/src/pglite/index.d.ts.map +0 -1
- package/dist/src/pglite/index.js +0 -3
- package/dist/src/pglite/index.js.map +0 -1
- package/dist/src/reactor-client-document-cache.d.ts +0 -31
- package/dist/src/reactor-client-document-cache.d.ts.map +0 -1
- package/dist/src/reactor-client-document-cache.js +0 -142
- package/dist/src/reactor-client-document-cache.js.map +0 -1
- package/dist/src/reactor.d.ts +0 -18
- package/dist/src/reactor.d.ts.map +0 -1
- package/dist/src/reactor.js +0 -162
- package/dist/src/reactor.js.map +0 -1
- package/dist/src/relational/hooks/index.d.ts +0 -3
- package/dist/src/relational/hooks/index.d.ts.map +0 -1
- package/dist/src/relational/hooks/index.js +0 -3
- package/dist/src/relational/hooks/index.js.map +0 -1
- package/dist/src/relational/hooks/useRelationalDb.d.ts +0 -12
- package/dist/src/relational/hooks/useRelationalDb.d.ts.map +0 -1
- package/dist/src/relational/hooks/useRelationalDb.js +0 -36
- package/dist/src/relational/hooks/useRelationalDb.js.map +0 -1
- package/dist/src/relational/hooks/useRelationalQuery.d.ts +0 -15
- package/dist/src/relational/hooks/useRelationalQuery.d.ts.map +0 -1
- package/dist/src/relational/hooks/useRelationalQuery.js +0 -76
- package/dist/src/relational/hooks/useRelationalQuery.js.map +0 -1
- package/dist/src/relational/index.d.ts.map +0 -1
- package/dist/src/relational/index.js.map +0 -1
- package/dist/src/relational/utils/createProcessorQuery.d.ts +0 -17
- package/dist/src/relational/utils/createProcessorQuery.d.ts.map +0 -1
- package/dist/src/relational/utils/createProcessorQuery.js +0 -24
- package/dist/src/relational/utils/createProcessorQuery.js.map +0 -1
- package/dist/src/relational/utils/index.d.ts +0 -2
- package/dist/src/relational/utils/index.d.ts.map +0 -1
- package/dist/src/relational/utils/index.js +0 -2
- package/dist/src/relational/utils/index.js.map +0 -1
- package/dist/src/renown/constants.d.ts +0 -130
- package/dist/src/renown/constants.d.ts.map +0 -1
- package/dist/src/renown/constants.js +0 -40
- package/dist/src/renown/constants.js.map +0 -1
- package/dist/src/renown/index.d.ts.map +0 -1
- package/dist/src/renown/index.js.map +0 -1
- package/dist/src/renown/utils.d.ts +0 -6
- package/dist/src/renown/utils.d.ts.map +0 -1
- package/dist/src/renown/utils.js +0 -56
- package/dist/src/renown/utils.js.map +0 -1
- package/dist/src/storage/index.d.ts +0 -2
- package/dist/src/storage/index.d.ts.map +0 -1
- package/dist/src/storage/index.js +0 -2
- package/dist/src/storage/index.js.map +0 -1
- package/dist/src/storage/types.d.ts +0 -6
- package/dist/src/storage/types.d.ts.map +0 -1
- package/dist/src/storage/types.js +0 -2
- package/dist/src/storage/types.js.map +0 -1
- package/dist/src/types/config.d.ts +0 -96
- package/dist/src/types/config.d.ts.map +0 -1
- package/dist/src/types/config.js +0 -2
- package/dist/src/types/config.js.map +0 -1
- package/dist/src/types/documents.d.ts +0 -26
- package/dist/src/types/documents.d.ts.map +0 -1
- package/dist/src/types/documents.js +0 -2
- package/dist/src/types/documents.js.map +0 -1
- package/dist/src/types/global.d.ts +0 -56
- package/dist/src/types/global.d.ts.map +0 -1
- package/dist/src/types/global.js +0 -2
- package/dist/src/types/global.js.map +0 -1
- package/dist/src/types/index.d.ts +0 -10
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/index.js +0 -2
- package/dist/src/types/index.js.map +0 -1
- package/dist/src/types/modals.d.ts +0 -34
- package/dist/src/types/modals.d.ts.map +0 -1
- package/dist/src/types/modals.js +0 -2
- package/dist/src/types/modals.js.map +0 -1
- package/dist/src/types/reactor.d.ts +0 -2
- package/dist/src/types/reactor.d.ts.map +0 -1
- package/dist/src/types/reactor.js +0 -2
- package/dist/src/types/reactor.js.map +0 -1
- package/dist/src/types/timeline.d.ts +0 -24
- package/dist/src/types/timeline.d.ts.map +0 -1
- package/dist/src/types/timeline.js +0 -2
- package/dist/src/types/timeline.js.map +0 -1
- package/dist/src/types/toast.d.ts +0 -9
- package/dist/src/types/toast.d.ts.map +0 -1
- package/dist/src/types/toast.js +0 -2
- package/dist/src/types/toast.js.map +0 -1
- package/dist/src/types/upload.d.ts +0 -16
- package/dist/src/types/upload.d.ts.map +0 -1
- package/dist/src/types/upload.js +0 -2
- package/dist/src/types/upload.js.map +0 -1
- package/dist/src/types/vetra.d.ts +0 -60
- package/dist/src/types/vetra.d.ts.map +0 -1
- package/dist/src/types/vetra.js +0 -2
- package/dist/src/types/vetra.js.map +0 -1
- package/dist/src/utils/documents.d.ts +0 -2
- package/dist/src/utils/documents.d.ts.map +0 -1
- package/dist/src/utils/documents.js +0 -20
- package/dist/src/utils/documents.js.map +0 -1
- package/dist/src/utils/drive-url.d.ts +0 -2
- package/dist/src/utils/drive-url.d.ts.map +0 -1
- package/dist/src/utils/drive-url.js +0 -3
- package/dist/src/utils/drive-url.js.map +0 -1
- package/dist/src/utils/drives.d.ts +0 -36
- package/dist/src/utils/drives.d.ts.map +0 -1
- package/dist/src/utils/drives.js +0 -142
- package/dist/src/utils/drives.js.map +0 -1
- package/dist/src/utils/export-document.d.ts +0 -3
- package/dist/src/utils/export-document.d.ts.map +0 -1
- package/dist/src/utils/export-document.js +0 -18
- package/dist/src/utils/export-document.js.map +0 -1
- package/dist/src/utils/get-revision-from-date.d.ts +0 -3
- package/dist/src/utils/get-revision-from-date.d.ts.map +0 -1
- package/dist/src/utils/get-revision-from-date.js +0 -10
- package/dist/src/utils/get-revision-from-date.js.map +0 -1
- package/dist/src/utils/index.d.ts +0 -12
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/index.js +0 -12
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/nodes.d.ts +0 -8
- package/dist/src/utils/nodes.d.ts.map +0 -1
- package/dist/src/utils/nodes.js +0 -17
- package/dist/src/utils/nodes.js.map +0 -1
- package/dist/src/utils/switchboard.d.ts +0 -7
- package/dist/src/utils/switchboard.d.ts.map +0 -1
- package/dist/src/utils/switchboard.js +0 -76
- package/dist/src/utils/switchboard.js.map +0 -1
- package/dist/src/utils/url.d.ts +0 -29
- package/dist/src/utils/url.d.ts.map +0 -1
- package/dist/src/utils/url.js +0 -77
- package/dist/src/utils/url.js.map +0 -1
- package/dist/src/utils/user.d.ts +0 -5
- package/dist/src/utils/user.d.ts.map +0 -1
- package/dist/src/utils/user.js +0 -15
- package/dist/src/utils/user.js.map +0 -1
- package/dist/src/utils/validate-document.d.ts +0 -3
- package/dist/src/utils/validate-document.d.ts.map +0 -1
- package/dist/src/utils/validate-document.js +0 -38
- package/dist/src/utils/validate-document.js.map +0 -1
- package/dist/src/utils/vetra.d.ts +0 -7
- package/dist/src/utils/vetra.d.ts.map +0 -1
- package/dist/src/utils/vetra.js +0 -86
- package/dist/src/utils/vetra.js.map +0 -1
- package/dist/test/analytics.test.d.ts +0 -2
- package/dist/test/analytics.test.d.ts.map +0 -1
- package/dist/test/analytics.test.js +0 -263
- package/dist/test/analytics.test.js.map +0 -1
- package/dist/test/document-cache.test.d.ts +0 -2
- package/dist/test/document-cache.test.d.ts.map +0 -1
- package/dist/test/document-cache.test.js +0 -457
- package/dist/test/document-cache.test.js.map +0 -1
- package/dist/test/drop.test.d.ts +0 -2
- package/dist/test/drop.test.d.ts.map +0 -1
- package/dist/test/drop.test.js +0 -86
- package/dist/test/drop.test.js.map +0 -1
- package/dist/test/getSwitchboardUrl.test.d.ts +0 -2
- package/dist/test/getSwitchboardUrl.test.d.ts.map +0 -1
- package/dist/test/getSwitchboardUrl.test.js +0 -107
- package/dist/test/getSwitchboardUrl.test.js.map +0 -1
- package/dist/test/hooks/document-cache.test.d.ts +0 -2
- package/dist/test/hooks/document-cache.test.d.ts.map +0 -1
- package/dist/test/hooks/document-cache.test.js +0 -642
- package/dist/test/hooks/document-cache.test.js.map +0 -1
- package/dist/test/reactor.test.d.ts +0 -2
- package/dist/test/reactor.test.d.ts.map +0 -1
- package/dist/test/reactor.test.js +0 -26
- package/dist/test/reactor.test.js.map +0 -1
- package/dist/test/switchboard.test.d.ts +0 -2
- package/dist/test/switchboard.test.d.ts.map +0 -1
- package/dist/test/switchboard.test.js +0 -27
- package/dist/test/switchboard.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
- package/dist/vitest.config.js +0 -24
- package/dist/vitest.config.js.map +0 -1
|
@@ -0,0 +1,726 @@
|
|
|
1
|
+
import { CompiledQuery } from "kysely";
|
|
2
|
+
import { QueryCallbackReturnType, useRelationalQueryOptions } from "@powerhousedao/reactor-browser";
|
|
3
|
+
import { IRelationalDb, IRelationalQueryBuilder, RelationalDbProcessorClass } from "@powerhousedao/shared/processors";
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/pglite-CntadC_p.d.ts
|
|
6
|
+
type MessageName = 'parseComplete' | 'bindComplete' | 'closeComplete' | 'noData' | 'portalSuspended' | 'replicationStart' | 'emptyQuery' | 'copyDone' | 'copyData' | 'rowDescription' | 'parameterDescription' | 'parameterStatus' | 'backendKeyData' | 'notification' | 'readyForQuery' | 'commandComplete' | 'dataRow' | 'copyInResponse' | 'copyOutResponse' | 'authenticationOk' | 'authenticationMD5Password' | 'authenticationCleartextPassword' | 'authenticationSASL' | 'authenticationSASLContinue' | 'authenticationSASLFinal' | 'error' | 'notice';
|
|
7
|
+
type BackendMessage = {
|
|
8
|
+
name: MessageName;
|
|
9
|
+
length: number;
|
|
10
|
+
};
|
|
11
|
+
interface NoticeOrError {
|
|
12
|
+
message: string | undefined;
|
|
13
|
+
severity: string | undefined;
|
|
14
|
+
code: string | undefined;
|
|
15
|
+
detail: string | undefined;
|
|
16
|
+
hint: string | undefined;
|
|
17
|
+
position: string | undefined;
|
|
18
|
+
internalPosition: string | undefined;
|
|
19
|
+
internalQuery: string | undefined;
|
|
20
|
+
where: string | undefined;
|
|
21
|
+
schema: string | undefined;
|
|
22
|
+
table: string | undefined;
|
|
23
|
+
column: string | undefined;
|
|
24
|
+
dataType: string | undefined;
|
|
25
|
+
constraint: string | undefined;
|
|
26
|
+
file: string | undefined;
|
|
27
|
+
line: string | undefined;
|
|
28
|
+
routine: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
declare class NoticeMessage implements BackendMessage, NoticeOrError {
|
|
31
|
+
readonly length: number;
|
|
32
|
+
readonly message: string | undefined;
|
|
33
|
+
constructor(length: number, message: string | undefined);
|
|
34
|
+
readonly name = "notice";
|
|
35
|
+
severity: string | undefined;
|
|
36
|
+
code: string | undefined;
|
|
37
|
+
detail: string | undefined;
|
|
38
|
+
hint: string | undefined;
|
|
39
|
+
position: string | undefined;
|
|
40
|
+
internalPosition: string | undefined;
|
|
41
|
+
internalQuery: string | undefined;
|
|
42
|
+
where: string | undefined;
|
|
43
|
+
schema: string | undefined;
|
|
44
|
+
table: string | undefined;
|
|
45
|
+
column: string | undefined;
|
|
46
|
+
dataType: string | undefined;
|
|
47
|
+
constraint: string | undefined;
|
|
48
|
+
file: string | undefined;
|
|
49
|
+
line: string | undefined;
|
|
50
|
+
routine: string | undefined;
|
|
51
|
+
}
|
|
52
|
+
type IDBFS = Emscripten.FileSystemType & {
|
|
53
|
+
quit: () => void;
|
|
54
|
+
dbs: Record<string, IDBDatabase>;
|
|
55
|
+
};
|
|
56
|
+
type FS = typeof FS & {
|
|
57
|
+
filesystems: {
|
|
58
|
+
MEMFS: Emscripten.FileSystemType;
|
|
59
|
+
NODEFS: Emscripten.FileSystemType;
|
|
60
|
+
IDBFS: IDBFS;
|
|
61
|
+
};
|
|
62
|
+
quit: () => void;
|
|
63
|
+
};
|
|
64
|
+
interface PostgresMod extends Omit<EmscriptenModule, 'preInit' | 'preRun' | 'postRun'> {
|
|
65
|
+
preInit: Array<{
|
|
66
|
+
(mod: PostgresMod): void;
|
|
67
|
+
}>;
|
|
68
|
+
preRun: Array<{
|
|
69
|
+
(mod: PostgresMod): void;
|
|
70
|
+
}>;
|
|
71
|
+
postRun: Array<{
|
|
72
|
+
(mod: PostgresMod): void;
|
|
73
|
+
}>;
|
|
74
|
+
FS: FS;
|
|
75
|
+
FD_BUFFER_MAX: number;
|
|
76
|
+
WASM_PREFIX: string;
|
|
77
|
+
INITIAL_MEMORY: number;
|
|
78
|
+
pg_extensions: Record<string, Promise<Blob | null>>;
|
|
79
|
+
_pgl_initdb: () => number;
|
|
80
|
+
_pgl_backend: () => void;
|
|
81
|
+
_pgl_shutdown: () => void;
|
|
82
|
+
_interactive_write: (msgLength: number) => void;
|
|
83
|
+
_interactive_one: (length: number, peek: number) => void;
|
|
84
|
+
_set_read_write_cbs: (read_cb: number, write_cb: number) => void;
|
|
85
|
+
addFunction: (cb: (ptr: any, length: number) => void, signature: string) => number;
|
|
86
|
+
removeFunction: (f: number) => void;
|
|
87
|
+
}
|
|
88
|
+
type DumpTarCompressionOptions = 'none' | 'gzip' | 'auto';
|
|
89
|
+
/**
|
|
90
|
+
* Filesystem interface.
|
|
91
|
+
* All virtual filesystems that are compatible with PGlite must implement
|
|
92
|
+
* this interface.
|
|
93
|
+
*/
|
|
94
|
+
interface Filesystem {
|
|
95
|
+
/**
|
|
96
|
+
* Initiate the filesystem and return the options to pass to the emscripten module.
|
|
97
|
+
*/
|
|
98
|
+
init(pg: PGlite, emscriptenOptions: Partial<PostgresMod>): Promise<{
|
|
99
|
+
emscriptenOpts: Partial<PostgresMod>;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Sync the filesystem to any underlying storage.
|
|
103
|
+
*/
|
|
104
|
+
syncToFs(relaxedDurability?: boolean): Promise<void>;
|
|
105
|
+
/**
|
|
106
|
+
* Sync the filesystem from any underlying storage.
|
|
107
|
+
*/
|
|
108
|
+
initialSyncFs(): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Dump the PGDATA dir from the filesystem to a gzipped tarball.
|
|
111
|
+
*/
|
|
112
|
+
dumpTar(dbname: string, compression?: DumpTarCompressionOptions): Promise<File | Blob>;
|
|
113
|
+
/**
|
|
114
|
+
* Close the filesystem.
|
|
115
|
+
*/
|
|
116
|
+
closeFs(): Promise<void>;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Base class for all emscripten built-in filesystems.
|
|
120
|
+
*/
|
|
121
|
+
type DebugLevel = 0 | 1 | 2 | 3 | 4 | 5;
|
|
122
|
+
type RowMode = 'array' | 'object';
|
|
123
|
+
interface ParserOptions {
|
|
124
|
+
[pgType: number]: (value: string) => any;
|
|
125
|
+
}
|
|
126
|
+
interface SerializerOptions {
|
|
127
|
+
[pgType: number]: (value: any) => string;
|
|
128
|
+
}
|
|
129
|
+
interface QueryOptions {
|
|
130
|
+
rowMode?: RowMode;
|
|
131
|
+
parsers?: ParserOptions;
|
|
132
|
+
serializers?: SerializerOptions;
|
|
133
|
+
blob?: Blob | File;
|
|
134
|
+
onNotice?: (notice: NoticeMessage) => void;
|
|
135
|
+
paramTypes?: number[];
|
|
136
|
+
}
|
|
137
|
+
interface ExecProtocolOptions {
|
|
138
|
+
syncToFs?: boolean;
|
|
139
|
+
throwOnError?: boolean;
|
|
140
|
+
onNotice?: (notice: NoticeMessage) => void;
|
|
141
|
+
}
|
|
142
|
+
interface ExtensionSetupResult<TNamespace = any> {
|
|
143
|
+
emscriptenOpts?: any;
|
|
144
|
+
namespaceObj?: TNamespace;
|
|
145
|
+
bundlePath?: URL;
|
|
146
|
+
init?: () => Promise<void>;
|
|
147
|
+
close?: () => Promise<void>;
|
|
148
|
+
}
|
|
149
|
+
type ExtensionSetup<TNamespace = any> = (pg: PGliteInterface, emscriptenOpts: any, clientOnly?: boolean) => Promise<ExtensionSetupResult<TNamespace>>;
|
|
150
|
+
interface Extension<TNamespace = any> {
|
|
151
|
+
name: string;
|
|
152
|
+
setup: ExtensionSetup<TNamespace>;
|
|
153
|
+
}
|
|
154
|
+
type ExtensionNamespace<T> = T extends Extension<infer TNamespace> ? TNamespace : any;
|
|
155
|
+
type Extensions = {
|
|
156
|
+
[namespace: string]: Extension | URL;
|
|
157
|
+
};
|
|
158
|
+
type InitializedExtensions<TExtensions extends Extensions = Extensions> = { [K in keyof TExtensions]: ExtensionNamespace<TExtensions[K]> };
|
|
159
|
+
interface ExecProtocolResult {
|
|
160
|
+
messages: BackendMessage[];
|
|
161
|
+
data: Uint8Array;
|
|
162
|
+
}
|
|
163
|
+
interface PGliteOptions<TExtensions extends Extensions = Extensions> {
|
|
164
|
+
dataDir?: string;
|
|
165
|
+
username?: string;
|
|
166
|
+
database?: string;
|
|
167
|
+
fs?: Filesystem;
|
|
168
|
+
debug?: DebugLevel;
|
|
169
|
+
relaxedDurability?: boolean;
|
|
170
|
+
extensions?: TExtensions;
|
|
171
|
+
loadDataDir?: Blob | File;
|
|
172
|
+
initialMemory?: number;
|
|
173
|
+
wasmModule?: WebAssembly.Module;
|
|
174
|
+
fsBundle?: Blob | File;
|
|
175
|
+
parsers?: ParserOptions;
|
|
176
|
+
serializers?: SerializerOptions;
|
|
177
|
+
}
|
|
178
|
+
type PGliteInterface<T extends Extensions = Extensions> = InitializedExtensions<T> & {
|
|
179
|
+
readonly waitReady: Promise<void>;
|
|
180
|
+
readonly debug: DebugLevel;
|
|
181
|
+
readonly ready: boolean;
|
|
182
|
+
readonly closed: boolean;
|
|
183
|
+
close(): Promise<void>;
|
|
184
|
+
query<T>(query: string, params?: any[], options?: QueryOptions): Promise<Results<T>>;
|
|
185
|
+
sql<T>(sqlStrings: TemplateStringsArray, ...params: any[]): Promise<Results<T>>;
|
|
186
|
+
exec(query: string, options?: QueryOptions): Promise<Array<Results>>;
|
|
187
|
+
describeQuery(query: string): Promise<DescribeQueryResult>;
|
|
188
|
+
transaction<T>(callback: (tx: Transaction) => Promise<T>): Promise<T>;
|
|
189
|
+
execProtocolRaw(message: Uint8Array, options?: ExecProtocolOptions): Promise<Uint8Array>;
|
|
190
|
+
execProtocol(message: Uint8Array, options?: ExecProtocolOptions): Promise<ExecProtocolResult>;
|
|
191
|
+
runExclusive<T>(fn: () => Promise<T>): Promise<T>;
|
|
192
|
+
listen(channel: string, callback: (payload: string) => void, tx?: Transaction): Promise<(tx?: Transaction) => Promise<void>>;
|
|
193
|
+
unlisten(channel: string, callback?: (payload: string) => void, tx?: Transaction): Promise<void>;
|
|
194
|
+
onNotification(callback: (channel: string, payload: string) => void): () => void;
|
|
195
|
+
offNotification(callback: (channel: string, payload: string) => void): void;
|
|
196
|
+
dumpDataDir(compression?: DumpTarCompressionOptions): Promise<File | Blob>;
|
|
197
|
+
refreshArrayTypes(): Promise<void>;
|
|
198
|
+
};
|
|
199
|
+
type PGliteInterfaceExtensions<E> = E extends Extensions ? { [K in keyof E]: E[K] extends Extension ? Awaited<ReturnType<E[K]['setup']>>['namespaceObj'] extends infer N ? N extends undefined | null | void ? never : N : never : never } : Record<string, never>;
|
|
200
|
+
type Row<T = {
|
|
201
|
+
[key: string]: any;
|
|
202
|
+
}> = T;
|
|
203
|
+
type Results<T = {
|
|
204
|
+
[key: string]: any;
|
|
205
|
+
}> = {
|
|
206
|
+
rows: Row<T>[];
|
|
207
|
+
affectedRows?: number;
|
|
208
|
+
fields: {
|
|
209
|
+
name: string;
|
|
210
|
+
dataTypeID: number;
|
|
211
|
+
}[];
|
|
212
|
+
blob?: Blob;
|
|
213
|
+
};
|
|
214
|
+
interface Transaction {
|
|
215
|
+
query<T>(query: string, params?: any[], options?: QueryOptions): Promise<Results<T>>;
|
|
216
|
+
sql<T>(sqlStrings: TemplateStringsArray, ...params: any[]): Promise<Results<T>>;
|
|
217
|
+
exec(query: string, options?: QueryOptions): Promise<Array<Results>>;
|
|
218
|
+
rollback(): Promise<void>;
|
|
219
|
+
listen(channel: string, callback: (payload: string) => void): Promise<(tx?: Transaction) => Promise<void>>;
|
|
220
|
+
get closed(): boolean;
|
|
221
|
+
}
|
|
222
|
+
type DescribeQueryResult = {
|
|
223
|
+
queryParams: {
|
|
224
|
+
dataTypeID: number;
|
|
225
|
+
serializer: Serializer;
|
|
226
|
+
}[];
|
|
227
|
+
resultFields: {
|
|
228
|
+
name: string;
|
|
229
|
+
dataTypeID: number;
|
|
230
|
+
parser: Parser;
|
|
231
|
+
}[];
|
|
232
|
+
};
|
|
233
|
+
type Parser = (x: string, typeId?: number) => any;
|
|
234
|
+
type Serializer = (x: any) => string;
|
|
235
|
+
declare abstract class BasePGlite implements Pick<PGliteInterface, 'query' | 'sql' | 'exec' | 'transaction'> {
|
|
236
|
+
#private;
|
|
237
|
+
serializers: Record<number | string, Serializer>;
|
|
238
|
+
parsers: Record<number | string, Parser>;
|
|
239
|
+
abstract debug: DebugLevel;
|
|
240
|
+
/**
|
|
241
|
+
* Execute a postgres wire protocol message
|
|
242
|
+
* @param message The postgres wire protocol message to execute
|
|
243
|
+
* @returns The result of the query
|
|
244
|
+
*/
|
|
245
|
+
abstract execProtocol(message: Uint8Array, {
|
|
246
|
+
syncToFs,
|
|
247
|
+
onNotice
|
|
248
|
+
}: ExecProtocolOptions): Promise<ExecProtocolResult>;
|
|
249
|
+
/**
|
|
250
|
+
* Execute a postgres wire protocol message
|
|
251
|
+
* @param message The postgres wire protocol message to execute
|
|
252
|
+
* @returns The parsed results of the query
|
|
253
|
+
*/
|
|
254
|
+
abstract execProtocolStream(message: Uint8Array, {
|
|
255
|
+
syncToFs,
|
|
256
|
+
onNotice
|
|
257
|
+
}: ExecProtocolOptions): Promise<BackendMessage[]>;
|
|
258
|
+
/**
|
|
259
|
+
* Execute a postgres wire protocol message directly without wrapping the response.
|
|
260
|
+
* Only use if `execProtocol()` doesn't suite your needs.
|
|
261
|
+
*
|
|
262
|
+
* **Warning:** This bypasses PGlite's protocol wrappers that manage error/notice messages,
|
|
263
|
+
* transactions, and notification listeners. Only use if you need to bypass these wrappers and
|
|
264
|
+
* don't intend to use the above features.
|
|
265
|
+
*
|
|
266
|
+
* @param message The postgres wire protocol message to execute
|
|
267
|
+
* @returns The direct message data response produced by Postgres
|
|
268
|
+
*/
|
|
269
|
+
abstract execProtocolRaw(message: Uint8Array, {
|
|
270
|
+
syncToFs
|
|
271
|
+
}: ExecProtocolOptions): Promise<Uint8Array>;
|
|
272
|
+
/**
|
|
273
|
+
* Sync the database to the filesystem
|
|
274
|
+
* @returns Promise that resolves when the database is synced to the filesystem
|
|
275
|
+
*/
|
|
276
|
+
abstract syncToFs(): Promise<void>;
|
|
277
|
+
/**
|
|
278
|
+
* Handle a file attached to the current query
|
|
279
|
+
* @param file The file to handle
|
|
280
|
+
*/
|
|
281
|
+
abstract _handleBlob(blob?: File | Blob): Promise<void>;
|
|
282
|
+
/**
|
|
283
|
+
* Get the written file
|
|
284
|
+
*/
|
|
285
|
+
abstract _getWrittenBlob(): Promise<File | Blob | undefined>;
|
|
286
|
+
/**
|
|
287
|
+
* Cleanup the current file
|
|
288
|
+
*/
|
|
289
|
+
abstract _cleanupBlob(): Promise<void>;
|
|
290
|
+
abstract _checkReady(): Promise<void>;
|
|
291
|
+
abstract _runExclusiveQuery<T>(fn: () => Promise<T>): Promise<T>;
|
|
292
|
+
abstract _runExclusiveTransaction<T>(fn: () => Promise<T>): Promise<T>;
|
|
293
|
+
/**
|
|
294
|
+
* Listen for notifications on a channel
|
|
295
|
+
*/
|
|
296
|
+
abstract listen(channel: string, callback: (payload: string) => void, tx?: Transaction): Promise<(tx?: Transaction) => Promise<void>>;
|
|
297
|
+
/**
|
|
298
|
+
* Initialize the array types
|
|
299
|
+
* The oid if the type of an element and the typarray is the oid of the type of the
|
|
300
|
+
* array.
|
|
301
|
+
* We extract these from the database then create the serializers/parsers for
|
|
302
|
+
* each type.
|
|
303
|
+
* This should be called at the end of #init() in the implementing class.
|
|
304
|
+
*/
|
|
305
|
+
_initArrayTypes({
|
|
306
|
+
force
|
|
307
|
+
}?: {
|
|
308
|
+
force?: boolean | undefined;
|
|
309
|
+
}): Promise<void>;
|
|
310
|
+
/**
|
|
311
|
+
* Re-syncs the array types from the database
|
|
312
|
+
* This is useful if you add a new type to the database and want to use it, otherwise pglite won't recognize it.
|
|
313
|
+
*/
|
|
314
|
+
refreshArrayTypes(): Promise<void>;
|
|
315
|
+
/**
|
|
316
|
+
* Execute a single SQL statement
|
|
317
|
+
* This uses the "Extended Query" postgres wire protocol message.
|
|
318
|
+
* @param query The query to execute
|
|
319
|
+
* @param params Optional parameters for the query
|
|
320
|
+
* @returns The result of the query
|
|
321
|
+
*/
|
|
322
|
+
query<T>(query: string, params?: any[], options?: QueryOptions): Promise<Results<T>>;
|
|
323
|
+
/**
|
|
324
|
+
* Execute a single SQL statement like with {@link PGlite.query}, but with a
|
|
325
|
+
* templated statement where template values will be treated as parameters.
|
|
326
|
+
*
|
|
327
|
+
* You can use helpers from `/template` to further format the query with
|
|
328
|
+
* identifiers, raw SQL, and nested statements.
|
|
329
|
+
*
|
|
330
|
+
* This uses the "Extended Query" postgres wire protocol message.
|
|
331
|
+
*
|
|
332
|
+
* @param query The query to execute with parameters as template values
|
|
333
|
+
* @returns The result of the query
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```ts
|
|
337
|
+
* const results = await db.sql`SELECT * FROM ${identifier`foo`} WHERE id = ${id}`
|
|
338
|
+
* ```
|
|
339
|
+
*/
|
|
340
|
+
sql<T>(sqlStrings: TemplateStringsArray, ...params: any[]): Promise<Results<T>>;
|
|
341
|
+
/**
|
|
342
|
+
* Execute a SQL query, this can have multiple statements.
|
|
343
|
+
* This uses the "Simple Query" postgres wire protocol message.
|
|
344
|
+
* @param query The query to execute
|
|
345
|
+
* @returns The result of the query
|
|
346
|
+
*/
|
|
347
|
+
exec(query: string, options?: QueryOptions): Promise<Array<Results>>;
|
|
348
|
+
/**
|
|
349
|
+
* Describe a query
|
|
350
|
+
* @param query The query to describe
|
|
351
|
+
* @returns A description of the result types for the query
|
|
352
|
+
*/
|
|
353
|
+
describeQuery(query: string, options?: QueryOptions): Promise<DescribeQueryResult>;
|
|
354
|
+
/**
|
|
355
|
+
* Execute a transaction
|
|
356
|
+
* @param callback A callback function that takes a transaction object
|
|
357
|
+
* @returns The result of the transaction
|
|
358
|
+
*/
|
|
359
|
+
transaction<T>(callback: (tx: Transaction) => Promise<T>): Promise<T>;
|
|
360
|
+
/**
|
|
361
|
+
* Run a function exclusively, no other transactions or queries will be allowed
|
|
362
|
+
* while the function is running.
|
|
363
|
+
* This is useful when working with the execProtocol methods as they are not blocked,
|
|
364
|
+
* and do not block the locks used by transactions and queries.
|
|
365
|
+
* @param fn The function to run
|
|
366
|
+
* @returns The result of the function
|
|
367
|
+
*/
|
|
368
|
+
runExclusive<T>(fn: () => Promise<T>): Promise<T>;
|
|
369
|
+
}
|
|
370
|
+
declare class PGlite extends BasePGlite implements PGliteInterface, AsyncDisposable {
|
|
371
|
+
#private;
|
|
372
|
+
fs?: Filesystem;
|
|
373
|
+
protected mod?: PostgresMod;
|
|
374
|
+
readonly dataDir?: string;
|
|
375
|
+
readonly waitReady: Promise<void>;
|
|
376
|
+
readonly debug: DebugLevel;
|
|
377
|
+
static readonly DEFAULT_RECV_BUF_SIZE: number;
|
|
378
|
+
static readonly MAX_BUFFER_SIZE: number;
|
|
379
|
+
/**
|
|
380
|
+
* Create a new PGlite instance
|
|
381
|
+
* @param dataDir The directory to store the database files
|
|
382
|
+
* Prefix with idb:// to use indexeddb filesystem in the browser
|
|
383
|
+
* Use memory:// to use in-memory filesystem
|
|
384
|
+
* @param options PGlite options
|
|
385
|
+
*/
|
|
386
|
+
constructor(dataDir?: string, options?: PGliteOptions);
|
|
387
|
+
/**
|
|
388
|
+
* Create a new PGlite instance
|
|
389
|
+
* @param options PGlite options including the data directory
|
|
390
|
+
*/
|
|
391
|
+
constructor(options?: PGliteOptions);
|
|
392
|
+
/**
|
|
393
|
+
* Create a new PGlite instance with extensions on the Typescript interface
|
|
394
|
+
* (The main constructor does enable extensions, however due to the limitations
|
|
395
|
+
* of Typescript, the extensions are not available on the instance interface)
|
|
396
|
+
* @param options PGlite options including the data directory
|
|
397
|
+
* @returns A promise that resolves to the PGlite instance when it's ready.
|
|
398
|
+
*/
|
|
399
|
+
static create<O extends PGliteOptions>(options?: O): Promise<PGlite & PGliteInterfaceExtensions<O['extensions']>>;
|
|
400
|
+
/**
|
|
401
|
+
* Create a new PGlite instance with extensions on the Typescript interface
|
|
402
|
+
* (The main constructor does enable extensions, however due to the limitations
|
|
403
|
+
* of Typescript, the extensions are not available on the instance interface)
|
|
404
|
+
* @param dataDir The directory to store the database files
|
|
405
|
+
* Prefix with idb:// to use indexeddb filesystem in the browser
|
|
406
|
+
* Use memory:// to use in-memory filesystem
|
|
407
|
+
* @param options PGlite options
|
|
408
|
+
* @returns A promise that resolves to the PGlite instance when it's ready.
|
|
409
|
+
*/
|
|
410
|
+
static create<O extends PGliteOptions>(dataDir?: string, options?: O): Promise<PGlite & PGliteInterfaceExtensions<O['extensions']>>;
|
|
411
|
+
/**
|
|
412
|
+
* The Postgres Emscripten Module
|
|
413
|
+
*/
|
|
414
|
+
get Module(): PostgresMod;
|
|
415
|
+
/**
|
|
416
|
+
* The ready state of the database
|
|
417
|
+
*/
|
|
418
|
+
get ready(): boolean;
|
|
419
|
+
/**
|
|
420
|
+
* The closed state of the database
|
|
421
|
+
*/
|
|
422
|
+
get closed(): boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Close the database
|
|
425
|
+
* @returns A promise that resolves when the database is closed
|
|
426
|
+
*/
|
|
427
|
+
close(): Promise<void>;
|
|
428
|
+
/**
|
|
429
|
+
* Close the database when the object exits scope
|
|
430
|
+
* Stage 3 ECMAScript Explicit Resource Management
|
|
431
|
+
* https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management
|
|
432
|
+
*/
|
|
433
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
434
|
+
/**
|
|
435
|
+
* Handle a file attached to the current query
|
|
436
|
+
* @param file The file to handle
|
|
437
|
+
*/
|
|
438
|
+
_handleBlob(blob?: File | Blob): Promise<void>;
|
|
439
|
+
/**
|
|
440
|
+
* Cleanup the current file
|
|
441
|
+
*/
|
|
442
|
+
_cleanupBlob(): Promise<void>;
|
|
443
|
+
/**
|
|
444
|
+
* Get the written blob from the current query
|
|
445
|
+
* @returns The written blob
|
|
446
|
+
*/
|
|
447
|
+
_getWrittenBlob(): Promise<Blob | undefined>;
|
|
448
|
+
/**
|
|
449
|
+
* Wait for the database to be ready
|
|
450
|
+
*/
|
|
451
|
+
_checkReady(): Promise<void>;
|
|
452
|
+
/**
|
|
453
|
+
* Execute a postgres wire protocol synchronously
|
|
454
|
+
* @param message The postgres wire protocol message to execute
|
|
455
|
+
* @returns The direct message data response produced by Postgres
|
|
456
|
+
*/
|
|
457
|
+
execProtocolRawSync(message: Uint8Array): Uint8Array;
|
|
458
|
+
/**
|
|
459
|
+
* Execute a postgres wire protocol message directly without wrapping the response.
|
|
460
|
+
* Only use if `execProtocol()` doesn't suite your needs.
|
|
461
|
+
*
|
|
462
|
+
* **Warning:** This bypasses PGlite's protocol wrappers that manage error/notice messages,
|
|
463
|
+
* transactions, and notification listeners. Only use if you need to bypass these wrappers and
|
|
464
|
+
* don't intend to use the above features.
|
|
465
|
+
*
|
|
466
|
+
* @param message The postgres wire protocol message to execute
|
|
467
|
+
* @returns The direct message data response produced by Postgres
|
|
468
|
+
*/
|
|
469
|
+
execProtocolRaw(message: Uint8Array, {
|
|
470
|
+
syncToFs
|
|
471
|
+
}?: ExecProtocolOptions): Promise<Uint8Array>;
|
|
472
|
+
/**
|
|
473
|
+
* Execute a postgres wire protocol message
|
|
474
|
+
* @param message The postgres wire protocol message to execute
|
|
475
|
+
* @returns The result of the query
|
|
476
|
+
*/
|
|
477
|
+
execProtocol(message: Uint8Array, {
|
|
478
|
+
syncToFs,
|
|
479
|
+
throwOnError,
|
|
480
|
+
onNotice
|
|
481
|
+
}?: ExecProtocolOptions): Promise<ExecProtocolResult>;
|
|
482
|
+
/**
|
|
483
|
+
* Execute a postgres wire protocol message
|
|
484
|
+
* @param message The postgres wire protocol message to execute
|
|
485
|
+
* @returns The parsed results of the query
|
|
486
|
+
*/
|
|
487
|
+
execProtocolStream(message: Uint8Array, {
|
|
488
|
+
syncToFs,
|
|
489
|
+
throwOnError,
|
|
490
|
+
onNotice
|
|
491
|
+
}?: ExecProtocolOptions): Promise<BackendMessage[]>;
|
|
492
|
+
/**
|
|
493
|
+
* Check if the database is in a transaction
|
|
494
|
+
* @returns True if the database is in a transaction, false otherwise
|
|
495
|
+
*/
|
|
496
|
+
isInTransaction(): boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Perform any sync operations implemented by the filesystem, this is
|
|
499
|
+
* run after every query to ensure that the filesystem is synced.
|
|
500
|
+
*/
|
|
501
|
+
syncToFs(): Promise<void>;
|
|
502
|
+
/**
|
|
503
|
+
* Listen for a notification
|
|
504
|
+
* @param channel The channel to listen on
|
|
505
|
+
* @param callback The callback to call when a notification is received
|
|
506
|
+
*/
|
|
507
|
+
listen(channel: string, callback: (payload: string) => void, tx?: Transaction): Promise<(tx?: Transaction) => Promise<void>>;
|
|
508
|
+
/**
|
|
509
|
+
* Stop listening for a notification
|
|
510
|
+
* @param channel The channel to stop listening on
|
|
511
|
+
* @param callback The callback to remove
|
|
512
|
+
*/
|
|
513
|
+
unlisten(channel: string, callback?: (payload: string) => void, tx?: Transaction): Promise<void>;
|
|
514
|
+
/**
|
|
515
|
+
* Listen to notifications
|
|
516
|
+
* @param callback The callback to call when a notification is received
|
|
517
|
+
*/
|
|
518
|
+
onNotification(callback: (channel: string, payload: string) => void): () => void;
|
|
519
|
+
/**
|
|
520
|
+
* Stop listening to notifications
|
|
521
|
+
* @param callback The callback to remove
|
|
522
|
+
*/
|
|
523
|
+
offNotification(callback: (channel: string, payload: string) => void): void;
|
|
524
|
+
/**
|
|
525
|
+
* Dump the PGDATA dir from the filesystem to a gzipped tarball.
|
|
526
|
+
* @param compression The compression options to use - 'gzip', 'auto', 'none'
|
|
527
|
+
* @returns The tarball as a File object where available, and fallback to a Blob
|
|
528
|
+
*/
|
|
529
|
+
dumpDataDir(compression?: DumpTarCompressionOptions): Promise<File | Blob>;
|
|
530
|
+
/**
|
|
531
|
+
* Run a function in a mutex that's exclusive to queries
|
|
532
|
+
* @param fn The query to run
|
|
533
|
+
* @returns The result of the query
|
|
534
|
+
*/
|
|
535
|
+
_runExclusiveQuery<T>(fn: () => Promise<T>): Promise<T>;
|
|
536
|
+
/**
|
|
537
|
+
* Run a function in a mutex that's exclusive to transactions
|
|
538
|
+
* @param fn The function to run
|
|
539
|
+
* @returns The result of the function
|
|
540
|
+
*/
|
|
541
|
+
_runExclusiveTransaction<T>(fn: () => Promise<T>): Promise<T>;
|
|
542
|
+
clone(): Promise<PGliteInterface>;
|
|
543
|
+
_runExclusiveListen<T>(fn: () => Promise<T>): Promise<T>;
|
|
544
|
+
}
|
|
545
|
+
//#endregion
|
|
546
|
+
//#region ../../node_modules/.pnpm/@electric-sql+pglite@0.3.15/node_modules/@electric-sql/pglite/dist/live/index.d.ts
|
|
547
|
+
interface LiveQueryOptions<T = {
|
|
548
|
+
[key: string]: any;
|
|
549
|
+
}> {
|
|
550
|
+
query: string;
|
|
551
|
+
params?: any[] | null;
|
|
552
|
+
offset?: number;
|
|
553
|
+
limit?: number;
|
|
554
|
+
callback?: (results: Results<T>) => void;
|
|
555
|
+
signal?: AbortSignal;
|
|
556
|
+
}
|
|
557
|
+
interface LiveChangesOptions<T = {
|
|
558
|
+
[key: string]: any;
|
|
559
|
+
}> {
|
|
560
|
+
query: string;
|
|
561
|
+
params?: any[] | null;
|
|
562
|
+
key: string;
|
|
563
|
+
callback?: (changes: Array<Change<T>>) => void;
|
|
564
|
+
signal?: AbortSignal;
|
|
565
|
+
}
|
|
566
|
+
interface LiveIncrementalQueryOptions<T = {
|
|
567
|
+
[key: string]: any;
|
|
568
|
+
}> {
|
|
569
|
+
query: string;
|
|
570
|
+
params?: any[] | null;
|
|
571
|
+
key: string;
|
|
572
|
+
callback?: (results: Results<T>) => void;
|
|
573
|
+
signal?: AbortSignal;
|
|
574
|
+
}
|
|
575
|
+
interface LiveNamespace {
|
|
576
|
+
/**
|
|
577
|
+
* Create a live query
|
|
578
|
+
* @param query - The query to run
|
|
579
|
+
* @param params - The parameters to pass to the query
|
|
580
|
+
* @param callback - A callback to run when the query is updated
|
|
581
|
+
* @returns A promise that resolves to an object with the initial results,
|
|
582
|
+
* an unsubscribe function, and a refresh function
|
|
583
|
+
*/
|
|
584
|
+
query<T = {
|
|
585
|
+
[key: string]: any;
|
|
586
|
+
}>(query: string, params?: any[] | null, callback?: (results: Results<T>) => void): Promise<LiveQuery<T>>;
|
|
587
|
+
/**
|
|
588
|
+
* Create a live query
|
|
589
|
+
* @param options - The options to pass to the query
|
|
590
|
+
* @returns A promise that resolves to an object with the initial results,
|
|
591
|
+
* an unsubscribe function, and a refresh function
|
|
592
|
+
*/
|
|
593
|
+
query<T = {
|
|
594
|
+
[key: string]: any;
|
|
595
|
+
}>(options: LiveQueryOptions<T>): Promise<LiveQuery<T>>;
|
|
596
|
+
/**
|
|
597
|
+
* Create a live query that returns the changes to the query results
|
|
598
|
+
* @param query - The query to run
|
|
599
|
+
* @param params - The parameters to pass to the query
|
|
600
|
+
* @param callback - A callback to run when the query is updated
|
|
601
|
+
* @returns A promise that resolves to an object with the initial changes,
|
|
602
|
+
* an unsubscribe function, and a refresh function
|
|
603
|
+
*/
|
|
604
|
+
changes<T = {
|
|
605
|
+
[key: string]: any;
|
|
606
|
+
}>(query: string, params: any[] | undefined | null, key: string, callback?: (changes: Array<Change<T>>) => void): Promise<LiveChanges<T>>;
|
|
607
|
+
/**
|
|
608
|
+
* Create a live query that returns the changes to the query results
|
|
609
|
+
* @param options - The options to pass to the query
|
|
610
|
+
* @returns A promise that resolves to an object with the initial changes,
|
|
611
|
+
* an unsubscribe function, and a refresh function
|
|
612
|
+
*/
|
|
613
|
+
changes<T = {
|
|
614
|
+
[key: string]: any;
|
|
615
|
+
}>(options: LiveChangesOptions<T>): Promise<LiveChanges<T>>;
|
|
616
|
+
/**
|
|
617
|
+
* Create a live query with incremental updates
|
|
618
|
+
* @param query - The query to run
|
|
619
|
+
* @param params - The parameters to pass to the query
|
|
620
|
+
* @param callback - A callback to run when the query is updated
|
|
621
|
+
* @returns A promise that resolves to an object with the initial results,
|
|
622
|
+
* an unsubscribe function, and a refresh function
|
|
623
|
+
*/
|
|
624
|
+
incrementalQuery<T = {
|
|
625
|
+
[key: string]: any;
|
|
626
|
+
}>(query: string, params: any[] | undefined | null, key: string, callback?: (results: Results<T>) => void): Promise<LiveQuery<T>>;
|
|
627
|
+
/**
|
|
628
|
+
* Create a live query with incremental updates
|
|
629
|
+
* @param options - The options to pass to the query
|
|
630
|
+
* @returns A promise that resolves to an object with the initial results,
|
|
631
|
+
* an unsubscribe function, and a refresh function
|
|
632
|
+
*/
|
|
633
|
+
incrementalQuery<T = {
|
|
634
|
+
[key: string]: any;
|
|
635
|
+
}>(options: LiveIncrementalQueryOptions<T>): Promise<LiveQuery<T>>;
|
|
636
|
+
}
|
|
637
|
+
interface LiveQueryResults<T> extends Results<T> {
|
|
638
|
+
totalCount?: number;
|
|
639
|
+
offset?: number;
|
|
640
|
+
limit?: number;
|
|
641
|
+
}
|
|
642
|
+
interface LiveQuery<T> {
|
|
643
|
+
initialResults: LiveQueryResults<T>;
|
|
644
|
+
subscribe: (callback: (results: LiveQueryResults<T>) => void) => void;
|
|
645
|
+
unsubscribe: (callback?: (results: LiveQueryResults<T>) => void) => Promise<void>;
|
|
646
|
+
refresh: (options?: {
|
|
647
|
+
offset?: number;
|
|
648
|
+
limit?: number;
|
|
649
|
+
}) => Promise<void>;
|
|
650
|
+
}
|
|
651
|
+
interface LiveChanges<T = {
|
|
652
|
+
[key: string]: any;
|
|
653
|
+
}> {
|
|
654
|
+
fields: {
|
|
655
|
+
name: string;
|
|
656
|
+
dataTypeID: number;
|
|
657
|
+
}[];
|
|
658
|
+
initialChanges: Array<Change<T>>;
|
|
659
|
+
subscribe: (callback: (changes: Array<Change<T>>) => void) => void;
|
|
660
|
+
unsubscribe: (callback?: (changes: Array<Change<T>>) => void) => Promise<void>;
|
|
661
|
+
refresh: () => Promise<void>;
|
|
662
|
+
}
|
|
663
|
+
type ChangeInsert<T> = {
|
|
664
|
+
__changed_columns__: string[];
|
|
665
|
+
__op__: 'INSERT';
|
|
666
|
+
__after__: number;
|
|
667
|
+
} & T;
|
|
668
|
+
type ChangeDelete<T> = {
|
|
669
|
+
__changed_columns__: string[];
|
|
670
|
+
__op__: 'DELETE';
|
|
671
|
+
__after__: undefined;
|
|
672
|
+
} & T;
|
|
673
|
+
type ChangeUpdate<T> = {
|
|
674
|
+
__changed_columns__: string[];
|
|
675
|
+
__op__: 'UPDATE';
|
|
676
|
+
__after__: number;
|
|
677
|
+
} & T;
|
|
678
|
+
type ChangeReset<T> = {
|
|
679
|
+
__op__: 'RESET';
|
|
680
|
+
} & T;
|
|
681
|
+
type Change<T> = ChangeInsert<T> | ChangeDelete<T> | ChangeUpdate<T> | ChangeReset<T>;
|
|
682
|
+
type PGliteWithLive = PGliteInterface & {
|
|
683
|
+
live: LiveNamespace;
|
|
684
|
+
};
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region src/relational/hooks/useRelationalDb.d.ts
|
|
687
|
+
type RelationalDbWithLive<Schema> = IRelationalDb<Schema> & {
|
|
688
|
+
live: LiveNamespace;
|
|
689
|
+
};
|
|
690
|
+
interface IRelationalDbState<Schema> {
|
|
691
|
+
db: RelationalDbWithLive<Schema> | null;
|
|
692
|
+
isLoading: boolean;
|
|
693
|
+
error: Error | null;
|
|
694
|
+
}
|
|
695
|
+
declare const useRelationalDb: <Schema>() => IRelationalDbState<Schema>;
|
|
696
|
+
//#endregion
|
|
697
|
+
//#region src/relational/hooks/useRelationalQuery.d.ts
|
|
698
|
+
type QueryCallbackReturnType$1 = {
|
|
699
|
+
sql: string;
|
|
700
|
+
parameters?: readonly unknown[];
|
|
701
|
+
};
|
|
702
|
+
type useRelationalQueryOptions$1 = {
|
|
703
|
+
hashNamespace?: boolean;
|
|
704
|
+
};
|
|
705
|
+
declare function useRelationalQuery<Schema, T = unknown, TParams = undefined>(ProcessorClass: RelationalDbProcessorClass<Schema>, driveId: string, queryCallback: (db: IRelationalQueryBuilder<Schema>, parameters?: TParams) => QueryCallbackReturnType$1, parameters?: TParams, options?: useRelationalQueryOptions$1): {
|
|
706
|
+
readonly isLoading: boolean;
|
|
707
|
+
readonly error: Error | null;
|
|
708
|
+
readonly result: LiveQueryResults<T> | null;
|
|
709
|
+
};
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region src/relational/utils/createProcessorQuery.d.ts
|
|
712
|
+
declare function createProcessorQuery<TSchema>(ProcessorClass: RelationalDbProcessorClass<TSchema>): {
|
|
713
|
+
<TQueryBuilder extends (db: IRelationalQueryBuilder<TSchema>) => QueryCallbackReturnType>(driveId: string, queryCallback: TQueryBuilder): {
|
|
714
|
+
isLoading: boolean;
|
|
715
|
+
error: Error | null;
|
|
716
|
+
result: LiveQueryResults<ReturnType<TQueryBuilder> extends CompiledQuery<infer R> ? R : any> | null;
|
|
717
|
+
};
|
|
718
|
+
<TParams, TQueryBuilder extends (db: IRelationalQueryBuilder<TSchema>, parameters: TParams) => QueryCallbackReturnType>(driveId: string, queryCallback: TQueryBuilder, parameters: TParams, options?: useRelationalQueryOptions): {
|
|
719
|
+
isLoading: boolean;
|
|
720
|
+
error: Error | null;
|
|
721
|
+
result: LiveQueryResults<ReturnType<TQueryBuilder> extends CompiledQuery<infer R> ? R : any> | null;
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
//#endregion
|
|
725
|
+
export { type RelationalDbWithLive as a, type PGlite as c, type useRelationalQueryOptions$1 as i, type QueryCallbackReturnType$1 as n, type useRelationalDb as o, type useRelationalQuery as r, type PGliteWithLive as s, createProcessorQuery as t };
|
|
726
|
+
//# sourceMappingURL=index-Ce4S7Kk1.d.ts.map
|